Visualize Your Ideas With Code
docs: add 3.4.0 release (#588)
Jacob51e20315319f
diff --git a/packages/2d/src/curves/CubicBezierSegment.ts b/packages/2d/src/curves/CubicBezierSegment.tsindex 27938868..f314cf03 100644--- a/packages/2d/src/curves/CubicBezierSegment.ts+++ b/packages/2d/src/curves/CubicBezierSegment.ts@@ -2,15 +2,14 @@ import {Vector2} from '@motion-canvas/core/lib/types';import {bezierCurveTo} from '../utils';import {PolynomialSegment} from './PolynomialSegment';import {Polynomial2D} from './Polynomial2D';+import {lazy} from '@motion-canvas/core/lib/decorators';/*** A spline segment representing a cubic Bézier curve.*/export class CubicBezierSegment extends PolynomialSegment {- private static el = document.createElementNS(- 'http://www.w3.org/2000/svg',- 'path',- );+ @lazy(() => document.createElementNS('http://www.w3.org/2000/svg', 'path'))+ private static el: SVGPathElement;public get points(): Vector2[] {return [this.p0, this.p1, this.p2, this.p3];diff --git a/packages/2d/src/curves/QuadBezierSegment.ts b/packages/2d/src/curves/QuadBezierSegment.tsindex 930157c3..5e3f707d 100644--- a/packages/2d/src/curves/QuadBezierSegment.ts+++ b/packages/2d/src/curves/QuadBezierSegment.ts@@ -2,15 +2,14 @@ import {Vector2} from '@motion-canvas/core/lib/types';import {quadraticCurveTo} from '../utils';import {PolynomialSegment} from './PolynomialSegment';import {Polynomial2D} from './Polynomial2D';+import {lazy} from '@motion-canvas/core/lib/decorators';/*** A spline segment representing a quadratic Bézier curve.*/export class QuadBezierSegment extends PolynomialSegment {- private static el = document.createElementNS(- 'http://www.w3.org/2000/svg',- 'path',- );+ @lazy(() => document.createElementNS('http://www.w3.org/2000/svg', 'path'))+ private static el: SVGPathElement;public get points(): Vector2[] {return [this.p0, this.p1, this.p2];diff --git a/packages/docs/blog/2023-03-28-version-3.4.0.mdx b/packages/docs/blog/2023-03-28-version-3.4.0.mdxnew file mode 100644index 00000000..aaa6b1e3--- /dev/null+++ b/packages/docs/blog/2023-03-28-version-3.4.0.mdx@@ -0,0 +1,74 @@+---+slug: version-3.4.0+title: Motion Canvas v3.4.0+description: Please stop making fun of {''}.+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 CodeBlock from '@theme/CodeBlock';++<IssueGroup type={'feat'}>+ <Issue user={'ksassnowski'}>+ New{' '}+ <Link to="/docs/spline">+ <code>Spline</code>+ </Link>{' '}+ node lets you draw lines made up of Bezier curves:+ <PullRequest id={514} />+ <CodeBlock language={'tsx'} className="margin-top--sm margin-bottom--sm">+ {`<Spline lineWidth={6} stroke={'lightseagreen'}>+ <Knot position={[-100, 30]} />+ <Knot ref={knot} position={[0, -50]} startHandle={[-70, 0]} />+ <Knot position={[100, 30]} />+</Spline>`}+ </CodeBlock>+ </Issue>+ <Issue user={'ksassnowski'} pr={579}>+ <Link to="/api/core/types/Vector2">+ <code>Vector2</code>+ </Link>{' '}+ has been expanded with new methods:{' '}+ <Link to="/api/core/types/Vector2#degrees">+ <code>degrees</code>+ </Link>+ , <Link to="/api/core/types/Vector2#equals">+ <code>equals</code>+ </Link>, <Link to="/api/core/types/Vector2#squaredMagnitude">+ <code>squaredMagnitude</code>+ </Link>+ </Issue>+ <Issue user={'guifeliper'} pr={552}>+ Names displayed in the project selection view are now retrieved from the+ meta files.+ </Issue>+ <Issue user={'aarthificial'} pr={564}>+ Introduce initial API for plugins.+ </Issue>+ <Issue user={'aarthificial'} pr={565}>+ The fields in the editor are now autogenerated based on the structure of the+ meta file.+ </Issue>+</IssueGroup>+<IssueGroup type={'fix'}>+ <Issue user={'aarthificial'} pr={572}>+ Support multiple fiddles on one page.+ </Issue>+ <Issue user={'aarthificial'} pr={563}>+ Fix CodeBlock types.+ </Issue>+ <Issue user={'aarthificial'} pr={562}>+ Size is now copied when cloning a node.+ </Issue>+ <Issue user={'aarthificial'} pr={561}>+ Zoom to fit works correctly for smaller canvases.+ </Issue>+</IssueGroup>++<small>+ Check out <Link to="/docs/updating">the Update Guide</Link> for information on+ how to update your existing projects.+</small>diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.jsindex 83e34c85..e32de9d8 100644--- a/packages/docs/docusaurus.config.js+++ b/packages/docs/docusaurus.config.js@@ -149,19 +149,23 @@ const config = {{examples: [{- name: 'random',+ name: 'Random',+ fileName: 'random',url: 'Random values generator',},{- name: 'quickstart',+ name: 'Quickstart',+ fileName: 'quickstart',url: 'Quickstart example',},{- name: 'logging',+ name: 'Logging',+ fileName: 'logging',url: 'Logging example',},{- name: 'presentation',+ name: 'Presentation',+ fileName: 'presentation',url: 'Presentation example',},],