Skip to content

Commit

Permalink
Merge pull request #75 from motionly-video/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
karelnagel authored Feb 26, 2023
2 parents 26daa8f + 9ab7995 commit 384e8d0
Show file tree
Hide file tree
Showing 155 changed files with 2,048 additions and 2,215 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"analyze": "ANALYZE=true turbo build",
"start": "turbo start",
"test": "turbo test",
"turbo": "turbo turbo",
"dev": "turbo dev",
"fast-publish": "changeset add; changeset version; changeset publish",
"preview": "cd packages/components; yarn preview",
Expand All @@ -39,4 +40,4 @@
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.8.1"
}
}
}
25 changes: 13 additions & 12 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@
"dependencies": {
"@motionly/base": "*",
"@motionly/confetti": "*",
"@remotion/cli": "3.3.34",
"@remotion/gif": "3.3.34",
"@remotion/lottie": "3.3.34",
"@remotion/media-utils": "3.3.34",
"@remotion/motion-blur": "3.3.34",
"@remotion/noise": "3.3.34",
"@remotion/paths": "3.3.34",
"@remotion/shapes": "3.3.34",
"@remotion/cli": "3.3.44",
"@remotion/gif": "3.3.44",
"@remotion/lottie": "3.3.44",
"@remotion/media-utils": "3.3.44",
"@remotion/motion-blur": "3.3.44",
"@remotion/noise": "3.3.44",
"@remotion/paths": "3.3.44",
"@remotion/shapes": "3.3.44",
"@types/react-simple-maps": "^3.0.0",
"axios": "^1.2.3",
"lottie-web": "^5.10.0",
"react-qr-code": "^2.0.10",
"react-simple-maps": "^3.0.0",
"typescript": "^4.9.4"
"typescript": "^4.9.4",
"zod": "^3.20.6"
},
"peerDependencies": {
"@remotion/cli": "^3.3.34",
Expand All @@ -42,13 +43,13 @@
"@remotion/shapes": "^3.3.34",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"remotion": "3.3.34"
"remotion": "3.3.44"
},
"devDependencies": {
"@types/react": "17.0.11",
"@types/react-dom": "17.0.8",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"remotion": "3.3.34"
"remotion": "3.3.44"
}
}
}
12 changes: 3 additions & 9 deletions packages/components/src/components/Transcription/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1232,24 +1232,18 @@ export const defaultTranscriptionProps: TranscriptionProps = {
src: defaultTranscriptionWords,
animationType: "current-word",
animationStyle: {
outlineColor: {
color: {
type: "basic",
color: "#00FFFFFF",
color: "#FF0000FF",
},
outlineWidth: 20,
},
textStyle: {
fontSize: 100,
fontSize: 80,
fontFamily: "Inter",
color: {
type: "basic",
color: "#FFFFFFFF",
},
outlineColor: {
type: "basic",
color: "#000FFFFF",
},
outlineWidth: 20,
fontWeight: "800",
lineHeight: 1.3,
textAlign: "center",
Expand Down
8 changes: 6 additions & 2 deletions packages/components/src/components/Transcription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { StyleAndClass, TranscriptionWord } from "@motionly/base";
import { TranscriptionProps } from "@motionly/base";
import { useTextStyles } from "../../hooks/useTextStyles";
export * from "./default";
import z from "zod";

export const Transcription = ({
textStyle,
Expand Down Expand Up @@ -41,8 +42,11 @@ export const Transcription = ({
if (typeof src !== "string") return;
fetch(src)
.then((res) => res.json())
.then((data) => setWords(data))
.catch((e) => console.error(e));
.then((data) => {
z.array(TranscriptionWord).parse(data);
setWords(data);
})
.catch((e) => setWords([]));
}, [src]);

useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions packages/player/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
"dependencies": {
"@motionly/components": "*",
"@remotion/player": "3.3.34",
"@remotion/cli": "3.3.34",
"remotion": "3.3.34"
"@remotion/player": "3.3.44",
"@remotion/cli": "3.3.44",
"remotion": "3.3.44"
},
"peerDependencies": {
"react": ">=16.8.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/player/src/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ export const Player = forwardRef<PlayerRef, PlayerProps>(
useEffect(() => setIsClient(true), []);
const template = useMemo(() => prepareTemplate(temp), [temp]);
return (
<SelectedContext.Provider
value={{ setSelected, selected, selectedRef }}
>
<SelectedContext.Provider value={{ setSelected, selected, selectedRef }}>
<RemotionPlayer
ref={ref}
component={isClient ? Composition : () => <>{loading}</>}
fps={template.fps}
durationInFrames={Math.ceil(template.duration * template.fps)}
durationInFrames={Math.ceil((template.duration || 1) * template.fps)}
inputProps={{
bg: template.bg,
comps: template.comps,
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"@motionly/base": "*",
"axios": "^1.2.1",
"typescript": "^4.9.4",
"@remotion/lambda": "3.3.34",
"remotion": "3.3.34"
"@remotion/lambda": "3.3.44",
"remotion": "3.3.44"
},
"scripts": {
"build": "tsc",
Expand Down
5 changes: 5 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"^build"
]
},
"turbo": {
"dependsOn": [
"^build"
]
},
"start": {
"dependsOn": [
"build"
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions websites/client/app/(layout)/(mdx)/blog/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Page } from "../layout";

export const blog: Page = {
id: "blog",
title: "Blog",
pages: [
{
id: "first",
title: "First post",
},
],
};
3 changes: 3 additions & 0 deletions websites/client/app/(layout)/(mdx)/blog/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hello world

This is the first blog post.
18 changes: 18 additions & 0 deletions websites/client/app/(layout)/(mdx)/docs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Page } from "../layout";

export const docs: Page = {
id: "docs",
title: "Docs",
pages: [
{
id: "player",
title: "Player",
pages: [
{
id: "usage",
title: "Usage",
},
],
},
],
};
File renamed without changes.
File renamed without changes.
121 changes: 121 additions & 0 deletions websites/client/app/(layout)/(mdx)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
"use client";

import Link from "next/link";
import { usePathname } from "next/navigation";
import { ReactNode } from "react";
import Error from "next/error";
import { blog } from "./blog";
import { docs } from "./docs";
import { legal } from "./legal";
import { MdOutlineArrowForwardIos } from "react-icons/md";
import { useState } from "react";

export type Page = {
id: string;
title: string;
pages?: Page[];
};

const collections: Page[] = [blog, docs, legal];

export default function MDXLayout({ children }: { children: ReactNode }) {
const pathname = usePathname();
const paths = pathname?.split("/").filter((x) => x);
const collection = collections.find((c) => c.id === paths?.[0]);
if (!collection || !paths) return <Error statusCode={404} />;

return (
<div className="grid grid-cols-4 md:grid-cols-5 gap-4 px-2">
<div className="hidden md:flex flex-col w-full space-y-1">
{collection.pages?.map((page) => (
<MenuItem key={page.id} {...page} parents={`/${collection.id}`} />
))}
</div>
<div className="col-span-4 space-y-3">
<div className="text-sm breadcrumbs">
<ul>
<BreadCrumb page={collection} paths={paths} />
</ul>
</div>
<div className="prose md:prose-lg mb-10">{children}</div>
</div>
</div>
);
}

const BreadCrumb = ({
paths,
page,
i = 0,
}: {
page: Page;
paths: string[];
i?: number;
}) => {
const next = page.pages?.find((p) => p.id === paths[i + 1]);
return (
<>
<li>
{i !== paths.length - 1 ? (
<Link href={`/${paths.slice(0, i + 1).join("/")}`} className="">
{page.title}
</Link>
) : (
<p className="text-primary">{page.title}</p>
)}
</li>
{next && <BreadCrumb page={next} paths={paths} i={i + 1} />}
</>
);
};

const MenuItem = ({
id,
title,
pages,
parents,
}: Page & { parents: string }) => {
const url = `${parents}/${id}`;
const pathname = usePathname();
const isSelected = pathname === url;
const [open, setOpen] = useState(true);
return (
<div className="flex flex-col space-y-1">
<div
className={`w-full bg-opacity-10 rounded-md duration-150 flex justify-between items-center px-2 ${
isSelected
? "bg-primary text-primary"
: "hover:bg-base-content hover:bg-opacity-10"
}`}
>
<Link
className="h-full w-full py-1 opacity-90"
href={url}
onClick={() => isSelected && setOpen(!open)}
>
{title}
</Link>
{pages && (
<MdOutlineArrowForwardIos
onClick={() => setOpen(!open)}
className={`text-sm duration-200 cursor-pointer ${
open ? "rotate-90" : ""
}`}
/>
)}
</div>
{open && pages && (
<div className="flex">
<div className="w-6 flex justify-center">
<div className="bg-base-content bg-opacity-20 w-[1px] h-full " />
</div>
<div className="w-full">
{pages?.map((page) => (
<MenuItem key={page.id} {...page} parents={url} />
))}
</div>
</div>
)}
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export const metadata = meta({
title: "Cookie Policy",
description: "Cookie Policy for using Motionly.video",
});

# Cookie Policy

This Cookie Policy explains how Motionly.video (“we”, “us”, or “our”) uses cookies and similar technologies to recognize you when you visit our website. It explains what these technologies are and why we use them, as well as your rights to control our use of them.
Expand Down
24 changes: 24 additions & 0 deletions websites/client/app/(layout)/(mdx)/legal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Page } from "../layout";

export const legal: Page = {
id: "legal",
title: "Legal",
pages: [
{
id: "terms",
title: "Terms and Conditions",
},
{
id: "privacy",
title: "Privacy Policy",
},
{
id: "refund",
title: "Refund Policy",
},
{
id: "cookie",
title: "Cookie Policy",
},
],
};
1 change: 1 addition & 0 deletions websites/client/app/(layout)/(mdx)/legal/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Legal
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export const metadata = meta({
title: "Privacy Policy",
description: "Privacy Policy for using Motionly.video",
});

# Privacy Policy

At Motionly.video, we are committed to protecting the privacy of our users. This Privacy Policy explains how we collect, use, and protect the personal information you provide to us when using our services.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export const metadata = meta({
title: "Refund Policy",
description: "Refund Policy for using Motionly.video",
});

# Refund Policy

At Motionly.video, we strive to provide an exceptional video editing experience. If you are not satisfied with our services, we offer a money-back guarantee.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export const metadata = meta({
title: "Terms and Conditions",
description: "Terms and conditions for using Motionly.video",
});

# Terms and Conditions

Welcome to Motionly.video (the “Website”). This document serves as the Terms and Conditions Agreement (the “Agreement”) between Motionly.video (“Motionly.video” or “us” or “we”) and all users of the Website (“you”).
Expand Down
7 changes: 7 additions & 0 deletions websites/client/app/(layout)/(pages)/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return children;
}
Loading

1 comment on commit 384e8d0

@vercel
Copy link

@vercel vercel bot commented on 384e8d0 Feb 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.