Visualize Your Ideas With Code
docs: add 3.0.0 release (#438)
Jacob3a6d673c5187
diff --git a/package-lock.json b/package-lock.jsonindex e90c0e57..b4a9e160 100644--- a/package-lock.json+++ b/package-lock.json@@ -21534,10 +21534,10 @@},"packages/2d": {"name": "@motion-canvas/2d",- "version": "2.6.0",+ "version": "3.0.0","license": "MIT","dependencies": {- "@motion-canvas/core": "^2.6.0",+ "@motion-canvas/core": "^3.0.0","code-fns": "^0.8.2","mathjax-full": "^3.2.2"},@@ -21555,7 +21555,7 @@},"packages/core": {"name": "@motion-canvas/core",- "version": "2.6.0",+ "version": "3.0.0","license": "MIT","dependencies": {"@types/chroma-js": "^2.1.4",@@ -21572,7 +21572,7 @@},"packages/create": {"name": "@motion-canvas/create",- "version": "2.6.0",+ "version": "3.0.0","license": "MIT","dependencies": {"prompts": "^2.4.2"@@ -21581,10 +21581,10 @@"create-motion-canvas": "index.js"},"devDependencies": {- "@motion-canvas/2d": "^2.6.0",- "@motion-canvas/core": "^2.6.0",- "@motion-canvas/ui": "^2.6.0",- "@motion-canvas/vite-plugin": "^2.6.0"+ "@motion-canvas/2d": "^3.0.0",+ "@motion-canvas/core": "^3.0.0",+ "@motion-canvas/ui": "^3.0.0",+ "@motion-canvas/vite-plugin": "^3.0.0"}},"packages/docs": {@@ -21653,10 +21653,10 @@},"packages/player": {"name": "@motion-canvas/player",- "version": "2.6.0",+ "version": "3.0.0","license": "MIT","devDependencies": {- "@motion-canvas/core": "^2.6.0",+ "@motion-canvas/core": "^3.0.0","sass": "^1.58.0","terser": "^5.16.1"}@@ -21676,10 +21676,10 @@},"packages/ui": {"name": "@motion-canvas/ui",- "version": "2.6.0",+ "version": "3.0.0","license": "MIT","dependencies": {- "@motion-canvas/core": "^2.6.0"+ "@motion-canvas/core": "^3.0.0"},"devDependencies": {"@preact/preset-vite": "^2.5.0",@@ -21692,7 +21692,7 @@},"packages/vite-plugin": {"name": "@motion-canvas/vite-plugin",- "version": "2.6.0",+ "version": "3.0.0","license": "MIT","dependencies": {"follow-redirects": "^1.15.2",@@ -24930,9 +24930,9 @@"@motion-canvas/2d": {"version": "file:packages/2d","requires": {- "@motion-canvas/core": "^2.6.0",+ "@motion-canvas/core": "^3.0.0","@motion-canvas/internal": "0.0.0",- "code-fns": "0.8.2",+ "code-fns": "^0.8.2","mathjax-full": "^3.2.2"},"dependencies": {@@ -24959,10 +24959,10 @@"@motion-canvas/create": {"version": "file:packages/create","requires": {- "@motion-canvas/2d": "^2.6.0",- "@motion-canvas/core": "^2.6.0",- "@motion-canvas/ui": "^2.6.0",- "@motion-canvas/vite-plugin": "^2.6.0",+ "@motion-canvas/2d": "^3.0.0",+ "@motion-canvas/core": "^3.0.0",+ "@motion-canvas/ui": "^3.0.0",+ "@motion-canvas/vite-plugin": "^3.0.0","prompts": "^2.4.2"}},@@ -25020,7 +25020,7 @@"@motion-canvas/player": {"version": "file:packages/player","requires": {- "@motion-canvas/core": "^2.6.0",+ "@motion-canvas/core": "^3.0.0","sass": "^1.58.0","terser": "^5.16.1"}@@ -25037,7 +25037,7 @@"@motion-canvas/ui": {"version": "file:packages/ui","requires": {- "@motion-canvas/core": "^2.6.0",+ "@motion-canvas/core": "^3.0.0","@preact/preset-vite": "^2.5.0","clsx": "^1.2.1","highlight.js": "^11.7.0",diff --git a/packages/docs/blog/2023-02-27-version-3.0.0.mdx b/packages/docs/blog/2023-02-27-version-3.0.0.mdxnew file mode 100644index 00000000..46cd33ca--- /dev/null+++ b/packages/docs/blog/2023-02-27-version-3.0.0.mdx@@ -0,0 +1,74 @@+---+slug: version-3.0.0+title: Motion Canvas v3.0.0+authors: aarthificial+---++import IssueGroup from '@site/src/components/Release/IssueGroup';+import Issue from '@site/src/components/Release/Issue';+import Link from '@docusaurus/Link';++:::info++Check out the [Migration Guide](/docs/migrating-to-3.0.0) for instructions on+how to update your project.++:::++<IssueGroup type={'feat'}>+ <Issue user={'aarthificial'} pr={402}>+ New playback architecture:+ <ul className="margin-top--sm margin-bottom--sm">+ <li>Project settings are now stored in meta files.</li>+ <li>Preview and rendering settings are configured separately.</li>+ <li>The animation range is stored using seconds instead of frames.</li>+ <li>+ You can adjust the audio offset by holding <code>SHIFT</code> and+ dragging the waveform left and right+ </li>+ <li>+ The rendering is not locked to the framerate, making the process a bit+ faster.+ </li>+ </ul>+ This change also opens the door to a lot of new features, including the{' '}+ <Link to="https://github.com/motion-canvas/motion-canvas/issues/213">+ Presentation Mode+ </Link>+ , <Link to="https://github.com/motion-canvas/motion-canvas/issues/170">+ Editable Signals+ </Link> and <Link to="https://github.com/motion-canvas/motion-canvas/issues/364">+ Custom Exporters+ </Link>.+ </Issue>+ <Issue user={'ccaven'} pr={421}>+ Rendering settings include a quarter resolution (x0.25).+ </Issue>+ <Issue user={'mohsinhijazee'} pr={404}>+ New{' '}+ <Link to="/api/2d/components/Layout#textDirection">+ <code>textDirection</code>+ </Link>{' '}+ property for RTL/LTR text.+ </Issue>+</IssueGroup>+<IssueGroup type={'fix'}>+ <Issue user={'aarthificial'} pr={437}>+ Fix <code>Vector2.exactlyEquals</code>.+ </Issue>+ <Issue user={'aarthificial'} pr={436}>+ Render only within the range.+ </Issue>+ <Issue user={'aarthificial'} pr={433}>+ Fix initial value of <code>endOffset</code>.+ </Issue>+ <Issue user={'aarthificial'} pr={432}>+ Correctly reset zoom.+ </Issue>+ <Issue user={'aarthificial'} pr={427}>+ Fix performance issue with audio track.+ </Issue>+ <Issue user={'aarthificial'} pr={424}>+ Clear semi-transparent backgrounds.+ </Issue>+</IssueGroup>diff --git a/packages/docs/docs/migration/3.0.0.mdx b/packages/docs/docs/migration/3.0.0.mdxnew file mode 100644index 00000000..08a24657--- /dev/null+++ b/packages/docs/docs/migration/3.0.0.mdx@@ -0,0 +1,97 @@+---+title: Version 3+slug: /migrating-to-3.0.0+---++# Migrating to v3++## Installation++Update all `@motion-canvas` packages to version `3.x.x` by running:++```bash+npm install --save @motion-canvas/2d@3 @motion-canvas/core@3 @motion-canvas/ui@3 @motion-canvas/vite-plugin@3+```++## Name changes++This version introduces multiple name changes that are meant to make the code+more readable and less prone to collisions with already existing types. Make+sure to replace the following names in your codebase:++| Old name | New name |+| ------------------------------- | ------------------------------------------------------------------------------- |+| `Image` | [`Img`](/api/2d/components/Img) |+| `Text` | [`Txt`](/api/2d/components/Txt) |+| `Rect` (the type, not the node) | [`BBox`](/api/core/types/BBox) |+| `Node.getCacheRect` | [`Node.getCacheBBox`](/api/2d/components/Node#getCacheBBox) |+| `Node.cacheRect` | [`Node.cacheBBox`](/api/2d/components/Node#cacheBBox) |+| `Node.fullCacheRect` | [`Node.fullCacheBBox`](/api/2d/components/Node#fullCacheBBox) |+| `CodeBlock.selectionOpacity` | [`CodeBlock.unselectedOpacity`](/api/2d/components/CodeBlock#unselectedOpacity) |++## Project configuration++Most project settings are now configured via the editor and stored in the meta+file. After running your project for the first time, the meta file will be+automatically updated to contain these new settings.++You can transfer your configuration from the project file:++```ts title="src/project.ts"+import {makeProject} from '@motion-canvas/core';++import example from './scenes/example?scene';++export default makeProject({+ scenes: [example],+ // highlight-start+ background: '#141414',+ audioOffset: 2,+ // highlight-end+});+```++Over to the meta file:++```json title="src/project.meta"+{+ "version": 1,+ "shared": {+ // highlight-next-line+ "background": "rgb(20,20,20)",+ "range": [0, null],+ "size": {+ "x": 1920,+ "y": 1080+ },+ // highlight-next-line+ "audioOffset": 2+ },+ "preview": {+ "fps": 30,+ "resolutionScale": 1+ },+ "rendering": {+ "fps": 30,+ "resolutionScale": 1,+ "colorSpace": "srgb",+ "fileType": "image/png",+ "quality": 1+ }+}+```++## `CodeBlock` revert++Due to technical issues,+[PR #401](https://github.com/motion-canvas/motion-canvas/pull/401) has been+reverted.++- The [`CodeBlock`](/docs/code-block) should be imported using the full path+ again:+ ```ts+ import {CodeBlock} from '@motion-canvas/2d/lib/components/CodeBlock';+ ```+- The `stockTheme` property is not supported for the time being.++Please stay tuned as we try to find a better solution.diff --git a/packages/docs/docs/migration/_category_.yml b/packages/docs/docs/migration/_category_.ymlnew file mode 100644index 00000000..be45e97e--- /dev/null+++ b/packages/docs/docs/migration/_category_.yml@@ -0,0 +1,4 @@+label: Migration+position: 100+link:+ type: generated-indexdiff --git a/packages/docs/docs/updating.mdx b/packages/docs/docs/migration/updating.mdxsimilarity index 95%rename from packages/docs/docs/updating.mdxrename to packages/docs/docs/migration/updating.mdxindex 235c8ae8..8ddb3e3f 100644--- a/packages/docs/docs/updating.mdx+++ b/packages/docs/docs/migration/updating.mdx@@ -1,5 +1,5 @@----sidebar_position: 100+sidebar_position: -1slug: /updating---diff --git a/packages/docs/release-blog-generator.js b/packages/docs/release-blog-generator.jsindex 5097bace..052709ee 100644--- a/packages/docs/release-blog-generator.js+++ b/packages/docs/release-blog-generator.js@@ -23,7 +23,11 @@ async function gitLog(from, to) {async function gitTags() {const tags = await runBash('git tag');- return tags.trim().split('\n').reverse();+ return tags+ .trim()+ .split('\n')+ .reverse()+ .filter(tag => !tag.includes('-alpha'));}function getDate() {