Skip to content

Visualize Your Ideas With Code

docs: add 3.5.0 release (#609)

Jacob0500efe4a71c
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 24387bc6..d4c68903 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -100,7 +100,7 @@ This Contribution Guide was partially inspired by [React][react] and
[Angular][angular].
[semver]: https://semver.org/
-[discord]: https://discord.gg/XnnWTrHYAW
+[discord]: https://chat.motioncanvas.io
[semantic-release]:
https://semantic-release.gitbook.io/semantic-release/support/faq#can-i-set-the-initial-release-version-of-my-package-to-0.0.1
[main]: https://github.com/motion-canvas/motion-canvas/tree/main
diff --git a/README.md b/README.md
index 38dcbdc6..f156ba99 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
<a href="https://lerna.js.org"><img src="https://img.shields.io/badge/published%20with-lerna-c084fc?style=flat" alt="published with lerna"></a>
<a href="https://vitejs.dev"><img src="https://img.shields.io/badge/powered%20by-vite-646cff?style=flat" alt="powered by lerna"></a>
<a href="https://www.npmjs.com/package/@motion-canvas/core"><img src="https://img.shields.io/npm/v/@motion-canvas/core?style=flat" alt="npm package version"></a>
- <a href="https://discord.gg/XnnWTrHYAW"><img src="https://img.shields.io/discord/1071029581009657896?style=flat&logo=discord&logoColor=fff&color=404eed" alt="discord"></a>
+ <a href="https://chat.motioncanvas.io"><img src="https://img.shields.io/discord/1071029581009657896?style=flat&logo=discord&logoColor=fff&color=404eed" alt="discord"></a>
</p>
<br/>
@@ -78,5 +78,5 @@ help make Motion Canvas better.
[authenticate]:
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token
[template]: https://github.com/motion-canvas/project-template#using-the-template
-[discord]: https://discord.gg/XnnWTrHYAW
+[discord]: https://chat.motioncanvas.io
[docs]: https://motioncanvas.io/docs/quickstart
diff --git a/packages/docs/blog/2023-04-06-examples.tsx b/packages/docs/blog/2023-04-06-examples.tsx
new file mode 100644
index 00000000..4697695a
--- /dev/null
+++ b/packages/docs/blog/2023-04-06-examples.tsx
@@ -0,0 +1,22 @@
+import {makeScene2D} from '@motion-canvas/2d/lib/scenes';
+import {CubicBezier} from '@motion-canvas/2d/lib/components';
+import {createRef} from '@motion-canvas/core/lib/utils';
+
+export default makeScene2D(function* (view) {
+ const bezier = createRef<CubicBezier>();
+
+ view.add(
+ <CubicBezier
+ ref={bezier}
+ lineWidth={6}
+ stroke={'lightseagreen'}
+ p0={[-200, 0]}
+ p1={[50, -200]}
+ p2={[-50, 200]}
+ p3={[200, 0]}
+ />,
+ );
+
+ yield* bezier().start(1, 1);
+ yield* bezier().start(0).end(0).end(1, 1);
+});
diff --git a/packages/docs/blog/2023-04-06-version-3.5.0.mdx b/packages/docs/blog/2023-04-06-version-3.5.0.mdx
new file mode 100644
index 00000000..f22e9996
--- /dev/null
+++ b/packages/docs/blog/2023-04-06-version-3.5.0.mdx
@@ -0,0 +1,66 @@
+---
+slug: version-3.5.0
+title: Motion Canvas v3.5.0
+authors: aarthificial
+---
+
+import IssueGroup from '@site/src/components/Release/IssueGroup';
+import Issue from '@site/src/components/Release/Issue';
+import PullRequest from '@site/src/components/Release/PullRequest';
+import Link from '@docusaurus/Link';
+import Fiddle from '@site/src/components/Fiddle';
+import source from '!!raw-loader!@site/blog/2023-04-06-examples.tsx';
+
+<IssueGroup type={'feat'}>
+ <Issue user={'ksassnowski'}>
+ New{' '}
+ <Link to="/docs/bezier-curves">
+ <code>Bézier</code>
+ </Link>{' '}
+ nodes let you easily create splines consisting of only one segment:{' '}
+ <PullRequest id={603} />
+ <Fiddle className="margin-top--sm margin-bottom--sm">{source}</Fiddle>
+ </Issue>
+ <Issue user={'aarthificial'}>
+ New{' '}
+ <Link to="/api/2d/components/Video">
+ <code>Video</code>
+ </Link>{' '}
+ properties: <PullRequest id={601} />
+ <ul className="margin-top--sm margin-bottom--sm">
+ <li>
+ <Link to="/api/2d/components/VideoProps#play">
+ <code>play</code>
+ </Link>{' '}
+ automatically plays the video
+ </li>
+ <li>
+ <Link to="/api/2d/components/Video#loop">
+ <code>loop</code>
+ </Link>{' '}
+ restarts the video upon reaching the end
+ </li>
+ </ul>
+ </Issue>
+ <Issue user={'aarthificial'} id={598}>
+ Fiddles now support multiple examples. You can switch between them using the
+ dropdown on the right side.
+ </Issue>
+</IssueGroup>
+<IssueGroup type={'fix'}>
+ <Issue user={'aarthificial'} pr={608}>
+ <code>UPDATE AVAILABLE</code> now links to the GitHub release page.
+ </Issue>
+ <Issue user={'aarthificial'} pr={600}>
+ Videos play smoothly when in presentation mode.
+ </Issue>
+ <Issue user={'aarthificial'} pr={599}>
+ Reused async resources are now correctly awaited.
+ </Issue>
+ <Issue user={'ksassnowski'} pr={597}>
+ Arrow orientations for splines are correctly calculated.
+ </Issue>
+ <Issue user={'aarthificial'} pr={589}>
+ The showcase editor has been fixed.
+ </Issue>
+</IssueGroup>
diff --git a/packages/docs/docs/components/bezier.mdx b/packages/docs/docs/components/bezier.mdx
index db19d64c..5fcbb454 100644
--- a/packages/docs/docs/components/bezier.mdx
+++ b/packages/docs/docs/components/bezier.mdx
@@ -10,10 +10,9 @@ slug: /bezier-curves
import {makeScene2D} from '@motion-canvas/2d/lib/scenes';
import {CubicBezier} from '@motion-canvas/2d/lib/components';
import {createRef} from '@motion-canvas/core/lib/utils';
-import {all} from '@motion-canvas/core/lib/flow';
export default makeScene2D(function* (view) {
- const bezier = createRef<Spline>();
+ const bezier = createRef<CubicBezier>();
view.add(
<CubicBezier
@@ -36,10 +35,9 @@ export default makeScene2D(function* (view) {
import {makeScene2D} from '@motion-canvas/2d/lib/scenes';
import {QuadBezier} from '@motion-canvas/2d/lib/components';
import {createRef} from '@motion-canvas/core/lib/utils';
-import {all} from '@motion-canvas/core/lib/flow';
export default makeScene2D(function* (view) {
- const bezier = createRef<Spline>();
+ const bezier = createRef<QuadBezier>();
view.add(
<QuadBezier
@@ -280,6 +278,6 @@ export default makeScene2D(function* (view) {
[line]: /api/2d/components/Line
[quad-bezier]: /api/2d/components/QuadBezier
[cubic-bezier]: /api/2d/components/CubicBezier
-[start-arrow]: /api/2d/components/CurveProps#startArrow
-[end-arrow]: /api/2d/components/CurveProps#endArrow
-[arrow-size]: /api/2d/components/CurveProps#arrowSize
+[start-arrow]: /api/2d/components/QuadBezierProps#startArrow
+[end-arrow]: /api/2d/components/QuadBezierProps#endArrow
+[arrow-size]: /api/2d/components/QuadBezierProps#arrowSize
diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js
index e32de9d8..6bd10ce8 100644
--- a/packages/docs/docusaurus.config.js
+++ b/packages/docs/docusaurus.config.js
@@ -21,7 +21,7 @@ const config = {
customFields: {
discordApi:
'https://discord.com/api/guilds/1071029581009657896/widget.json',
- discordUrl: 'https://discord.gg/XnnWTrHYAW',
+ discordUrl: 'https://chat.motioncanvas.io',
githubApi: 'https://api.github.com/repos/motion-canvas/motion-canvas',
githubUrl: 'https://github.com/motion-canvas/motion-canvas',
},
@@ -79,7 +79,7 @@ const config = {
},
{
label: 'Discord',
- href: 'https://discord.gg/XnnWTrHYAW',
+ href: 'https://chat.motioncanvas.io',
},
],
},
diff --git a/packages/docs/src/components/Fiddle/index.tsx b/packages/docs/src/components/Fiddle/index.tsx
index bb6bfe88..ed85f698 100644
--- a/packages/docs/src/components/Fiddle/index.tsx
+++ b/packages/docs/src/components/Fiddle/index.tsx
@@ -29,8 +29,10 @@ import {
} from '@site/src/components/Fiddle/transformer';
import {parseFiddle} from '@site/src/components/Fiddle/parseFiddle';
import Dropdown from '@site/src/components/Dropdown';
+import clsx from 'clsx';
export interface FiddleProps {
+ className?: string;
children: string;
}
@@ -48,7 +50,7 @@ function highlight(sizePixels = 4) {
];
}
-export default function Fiddle({children}: FiddleProps) {
+export default function Fiddle({children, className}: FiddleProps) {
const [player, setPlayer] = useState<Player>(null);
const editorView = useRef<EditorView>(null);
const editorRef = useRef<HTMLDivElement>();
@@ -133,7 +135,7 @@ export default function Fiddle({children}: FiddleProps) {
hasChangedSinceLastUpdate;
return (
- <div className={styles.root}>
+ <div className={clsx(styles.root, className)}>
<div className={styles.preview} ref={previewRef}>
{!player && <div>Press play to preview the animation</div>}
</div>