@motionscript/sdk 0.1.0-alpha.3 → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,121 @@
1
1
  # @motionscript/sdk
2
2
 
3
+ ## 0.1.0-alpha.5
4
+
5
+ ### Patch Changes
6
+
7
+ - da6f97a: Every package ships a `NOTICE`, and a browser build lists what it bundles.
8
+
9
+ - Each tarball carries the repository `NOTICE`: the copyright line and the MIT attributions for the noise functions in `skia-render`'s fractal-noise fill (David Hoskins' "Hash without Sine", Inigo Quilez's 2D simplex noise).
10
+ - `@motionscript/canvaskit` ships `THIRD_PARTY_NOTICES.txt` with the licences of the libraries compiled into the binary: FreeType, HarfBuzz, ICU 74, zlib, libpng, Brotli, WOFF2, Emscripten and musl.
11
+ - `dist/browser/manifest.json` gains `thirdParty`, the packages the browser build bundled (`name`, `version`, `license`), and their licence and NOTICE files are written to `dist/browser/THIRD_PARTY_LICENSES.txt`. `@motionscript/browser` bundles mediabunny (MPL-2.0, unmodified; source at https://github.com/Vanilagy/mediabunny), esbuild-wasm and three; `@motionscript/math` bundles MathJax.
12
+
13
+ - 1778355: The published packages carry what a user needs and say what they are.
14
+
15
+ - `@motionscript/code` no longer ships `dist/tests/diff.bench.*`, and `@motionscript/math` no longer ships `dist/tests/harness.*` or `mathjax.setup.*`: test helpers under a `tests` folder are left out of every package's build.
16
+ - `@motionscript/sdk`'s description no longer repeats core's, and `@motionscript/math`'s names the coordinate systems, plots, 3D graphs and network graphs it has as well as formulas.
17
+ - The READMEs of `@motionscript/canvaskit`, `@motionscript/charts`, `@motionscript/geo`, `@motionscript/grids`, `@motionscript/skia-render` and `@motionscript/geography` say what to install, and `@motionscript/sdk`'s example now opens the document in an engine and plays it. Links between packages point at the repository, so they work on npm.
18
+
19
+ ## 0.1.0-alpha.4
20
+
21
+ ### Minor Changes
22
+
23
+ - 7f8b4d0: A node can give its children coordinates of its own, which is what a coordinate system needs: a child's `x`/`y` are then in the parent's units and the child keeps its size.
24
+
25
+ - A parent answers `_planeOf(child)` with a `ChildPlane` (`toOffset` and `toCoords`, exported). Paint, `global`, the anchor getters, `moveTo({ target })` and `parentPlanePointAt` all read it, and the last two answer in the parent's coordinates. A node whose parent publishes none is unchanged.
26
+ - `childPlanePointAt(root, path, point)`, and `childPlanePoint` on the player, say where a point lands in the coordinates a node positions its children in, for a host placing a node that is not there yet. They answer `null` for a node whose children are in pixels, and `_planeOf(null)` is what they ask.
27
+ - `findNode2D(from, id)` and `frameIn(host, node)` are exported from the SDK, for a node that follows another by id. `@motionscript/grids` now uses them and still exports both names.
28
+
29
+ - 158723b: **Breaking:** the engine no longer has a "scene" in its document API. Its unit is a clip document on a project track, so the names that said "scene" now say what the thing is. This is a clean break: there are no aliases and no deprecated re-exports, so update the names below.
30
+
31
+ | Before | After |
32
+ | -------------------------------------------------------- | ---------------------------- |
33
+ | `SceneDocument` (`StillDocument \| CompositionDocument`) | `VisualDocument` |
34
+ | `SceneTimeline` | `ClipTimeline` |
35
+ | `SceneEffect` (the union of effects a node can carry) | `NodeEffect` |
36
+ | `integrateSpeedToSceneTime` | `integrateSpeedToClipTime` |
37
+ | `sourceTimeAtSceneElapsed` | `sourceTimeAtClipElapsed` |
38
+ | `Sound.sceneDurationFor` | `Sound.clipDurationFor` |
39
+ | `AudioSink.syncTo(sceneTime)` (parameter name) | `AudioSink.syncTo(clipTime)` |
40
+
41
+ `ClipDocument` is now `VisualDocument | AudioDocument`, as before. The document types, the 3D `Scene3D` and its `scene3d` settings are unchanged: that is a 3D scene, not this.
42
+
43
+ Two messages changed with the names: `assertValidDocument` now throws `Invalid clip document:` (was `Invalid scene document:`), and the JSX runtime's error for a value that is not a node class reads `JSX element must be a Node class`.
44
+
45
+ The built-in `Canvas2D`, `Provider` and `ThemeProvider` moved from `nodes/scene/` to `nodes/root/` inside core. That directory was never an export path, so no import from the package changes.
46
+
47
+ - 7f8b4d0: Three commands that draw the eye to a node and leave it as it was.
48
+
49
+ - `pulse({ factor })` swells a node to `factor` times its size and settles it back; `wiggle({ angle, turns })` rocks it about its own turn. Both are on every 2D node.
50
+ - `flash({ portion })` sends a stretch of a shape's outline along it. A shape that rests with `end: 0` is seen only as the stretch passing.
51
+
52
+ - 217ae88: The `texture`, `displace`, `godRays` and `trails` effects are removed.
53
+
54
+ - `Effects.texture`, `Effects.displace`, `Effects.godRays` and `Effects.trails` are gone, and so are the same four on `Adjustments` (`godRays`, `texture`, `displace`) and their option and effect types: `TextureOptions`, `TextureEffect`, `DisplaceOptions`, `DisplaceEffect`, `DisplaceChannel`, `GodRaysOptions`, `GodRaysEffect`, `TrailsOptions`, `TrailsEffect`.
55
+ - A document that still holds one of these effects builds, and the effect draws nothing: the renderer has no handler for the type and skips it.
56
+ - `trails` also leaves the list of effects a media fill cannot carry. `motionBlur` is unchanged.
57
+ - No effect declares an image any more, so `EffectData.declare` has no implementation in the library.
58
+
59
+ - 7f8b4d0: 3D graphs, and named commands for 3D scenes.
60
+
61
+ - `@motionscript/math` gains `axes3d` (a 3D graph that is its own viewport, a `canvas3d` with its camera, lights and `orbitTo`, so it goes straight on a 2D stage: three axes through a box of graph coordinates, z up, with ticks, tips, numbers and titles), `surfacePlot3d` (a height over x and y, or three parts in u and v; coloured by height with `colorScale`, ruled with `meshLines`), `curvePlot3d` (a space curve, drawn on with `progressTo`), `plotPoint3d` (rides a surface it is put inside) and `vectorArrow3d`. Anything inside the axes sits at graph coordinates and keeps its own size.
62
+ - Every 3D node has `moveTo`, `rotateTo` and `scaleTo`. A `canvas3d` has `orbitTo` for its default camera, and a `camera3d` has `orbitTo` and `lookTo`.
63
+ - A 3D parent can place its children in coordinates of its own (`Node3D._spaceOf`, `ChildSpace3D`), as a 2D one already could, and so can a `canvas3d` for the 3D nodes directly inside it (`Canvas3D._spaceOf`).
64
+ - The SDK exports `MaterialShorthand3D`, what a mesh node of your own returns from `materialShorthand()`.
65
+
66
+ - 7f8b4d0: `@motionscript/math` gains coordinate systems, plots and the marks that go on a graph.
67
+
68
+ - `numberLine`, `axes2d` and `numberPlane` are coordinate systems: a child's `x`/`y` are graph units whatever the child is, so a text or an image sits on a graph at its own size, `moveTo` moves it in graph units, and `rangeTo` pans and zooms everything inside.
69
+ - `functionPlot` draws an equation and reads its kind from how it is written: `sin(x)`, `x = y^2`, `r = 1 + cos(theta)`, `(cos(t), sin(t))`. `morphTo` bends one curve into another, and curves break at asymptotes and domain edges. A name the equation does not know is a named value: 1 until `params` gives it one, bindable to a variable by a formula, listed by `equationParams`.
70
+ - `pointsPlot`, `plotPoint`, `vectorArrow`, `curveArea`, `riemannSum`, `tangentLine` and `dropLines` are drawn in graph coordinates. The ones that ride a plot name it by id in `on`.
71
+ - `@motionscript/math/kit` exports `CoordinateSystem`, `Mark`, the coordinate map, the equation language and the sampler for a custom system or mark.
72
+ - The SDK exports the `Extents` type that `pathOps.bounds` already returned.
73
+
74
+ - 217ae88: A node type can withdraw what it inherits, and the math nodes take only the paints they draw.
75
+
76
+ - `@withdraw(...keys)` drops inherited properties and commands from a node class. A withdrawn property is left out of `describe()` and holds its default whatever is written to it; a withdrawn command is left out of `commandKeys()` but still runs for a stored document, changing nothing. A subclass that declares the key again takes it back.
77
+ - `Registry.takesCommand(type, key)` says whether a node type takes a command: its own, or a node-less one unless that runs a method the type lacks or withdrew. `addCommand` takes a `method` for that; the paint commands name theirs.
78
+ - Math: a plot, a tangent, drop lines, an arrow, a brace, an emphasis mark and an angle mark have no `fill`; a curve area has no `stroke`; a formula, a traced path, a field, a curve area, a Riemann sum, a plot point and a sample space have no outline trim (`start`, `end`, `progressTo`, `flash`). An open `pointsPlot` draws no fill.
79
+ - Math: `partColors` and `colorTo` on `latex`, `latexMatrix` and `networkGraph` are now `partFills` and `partFillTo`, each part taking any paint (`{ part, fill }`). A vector field's and stream lines' `colorScale` is now `strengthFills`, and a sample space's `colors` is now `columnFills`, both lists of paints.
80
+ - Math: a vector field's and stream lines' shadow is cast when they are painted by strength too, not only in one paint.
81
+
82
+ - 7f8b4d0: Planes that transform, fields, polar planes, implicit curves and trails.
83
+
84
+ - `numberPlane` gains `matrix` and `transformTo` (a linear map of the whole plane), `warp` and `warpTo` (a bend by a function of its points), and a faint `ghost` of itself while it is transformed. The grid, the axes and everything on the plane go with it.
85
+ - New nodes: `polarPlane` (rings and spokes; plots and marks go on it as on axes), `vectorField` (arrows of a field `(P, Q)`, coloured by strength with `colorScale`), `streamLines` (the lines the field carries a point along, sent flowing with `flowTo`) and `tracedPath` (the trail a point leaves as a value changes).
86
+ - A `functionPlot` draws an implicit equation, such as `x^2 + y^2 = 4`, where it holds.
87
+ - A `Camera` can `follow` a node of its world by id, with `lookAt` as an offset from it.
88
+
89
+ - 7f8b4d0: A node can name points an editor may drag to set its `Vector2` props. It answers `_handles()` with each prop and where it sits in its own frame, and `_handleValue(prop, at)` with the value that puts it somewhere else. `nodeHandlesAt` and `handleValueAt` (exported from the SDK), and `nodeHandles`/`handleValue` on the player, answer in viewport space. A math `vectorArrow` offers its two ends in graph units, and a `curlyBrace` that spans two points offers those.
90
+ - 7f8b4d0: A node type can say where it goes, so a host can offer it only where it works.
91
+
92
+ - `@node({ within, beside, closed })`: `within` names the types a node goes inside (a name covers every type built on it), `beside` the types it needs at least one of as a sibling, and `closed` marks a parent that takes only children that name it. Nothing checks them at build.
93
+ - `parentIssue`, `siblingIssue` and `placementIssues` answer them for a host, together with the 2D/3D seam and `acceptsChildren`; `nodeTypeIsA` walks `parentKey`.
94
+ - In `@motionscript/math` a `functionPlot` holds the marks that are of it: a `tangentLine`, and a `plotPoint` or `dropLines` put inside it follow its curve with no `on`. `curveArea` and `riemannSum` sit beside the plots they read and name them in `on`. Plots, arrows and marks go inside a coordinate system.
95
+
96
+ - 3eefc7e: Package reshuffle.
97
+
98
+ - `@motionscript/layout-grid` is now `@motionscript/grids` (`@motionscript/grids/kit`, and `packages/components/grids`), and its `LayoutGrid` base class is `ItemGrid` (`ItemGridProps`, `ITEM_GRID_TYPES`). `RectangularGrid`, `RadialGrid`, `PathGrid` and `SphereGrid` keep their names and document keys. Update the dependency, the imports, and any `@motionscript/layout-grid/kit` specifier a copied component carries.
99
+ - `@motionscript/geo-data` is now `@motionscript/geography`. The data format on disk (`data/v1/…`) is unchanged, so `@motionscript/geo` reads it as before and a host that serves `@motionscript/geo-data/data` serves `@motionscript/geography/data` the same way.
100
+ - `@motionscript/ui` is removed: its `Switch`, `Button`, `Window` and `Cursor` nodes, and the `ControlNode` base class, no longer ship. They are plain nodes over `@motionscript/sdk`, so a project that needs one writes its own and shapes it to taste.
101
+ - `@motionscript/patterns` is new. It holds the pattern nodes (`LineGridPattern`, `DotGridPattern`, `GridPattern`, `ViewportPattern`) that `@motionscript/core` and `@motionscript/sdk` no longer ship.
102
+
103
+ - 7f8b4d0: A stroke's `startCap` and `endCap` take a marker as well as a cap: `arrow`, `triangle`, `stealth`, `dot`, `box`, `diamond` or `bar`. Any open path, arc or custom shape can be an arrow.
104
+
105
+ - A pointed head has its tip on the path's end and turns with the path. A marker is `capScale × weight` long (`capScale` is new, default `4`, and tweens) and shrinks to fit a contour shorter than it, so a head rides `start`/`end` as a path is drawn on.
106
+ - A marker is drawn even where a dash pattern leaves the end bare, and a marked stroke is centred on its path whatever its `align`.
107
+ - `StrokeMarker` and `StrokeEnd` are exported; `cap` still takes the three caps only.
108
+
109
+ - 96ed4d4: The `Line` node is removed. A `Path` draws what it drew.
110
+
111
+ - The `line` node type is no longer registered and `Line` and `LineProps` are no longer exported. A document that names `line` fails to build with `Unknown node type`. Write its points as a path instead: `<Line points={[[0, 0], [200, 0]]} />` is `<Path data="M 0 0 L 200 0" />`, and in a document a `path` node whose `data` is in the unit space of its box. A path's `y` runs down where a line's points ran up, and a face-value `Path` is centred on its own extent rather than drawn from the node's origin.
112
+ - `shapeOutline` and `hasShapeOutline` no longer answer for `"line"`.
113
+ - `Graphics2D.line` and the `line` op are unchanged: a custom node still draws a polyline with them, vertex `radius` and `closed` included.
114
+
115
+ ### Patch Changes
116
+
117
+ - 217ae88: A host can keep a node looking exactly as it does when it moves it to another parent, as a design tool does. `reparentPlacementAt(root, path, parentPath, offsets)` (the player's `reparentPlacement`) carries `x`/`y` values the node takes under its parent now, its own and its moves' destinations, to the ones that put its centre at the same place under the new parent, and gives the turn to add to its rotation and the factor to scale it by so the two parents' own turn and scale, cameras included, are undone. It works through a freeform parent's padding and alignment and a parent's own coordinates, and answers `null` for a parent that arranges its children in a run or a grid. `flowOps.freeSlot` says where a freeform arrangement puts one more item.
118
+
3
119
  ## 0.1.0-alpha.3
4
120
 
5
121
  ### Patch Changes
package/LICENSE CHANGED
@@ -1,201 +1,201 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,48 @@
1
+ Motionscript
2
+ Copyright 2026 Motionscript LLC
3
+
4
+ This product includes the third-party code below, each part under the MIT
5
+ License reproduced at the end of this file.
6
+
7
+ - packages/skia-render/src/fills/fractal-noise.ts: `hash2` is "Hash without
8
+ Sine" by David Hoskins (https://www.shadertoy.com/view/4djSRW).
9
+ Copyright (c) 2014 David Hoskins.
10
+
11
+ - packages/skia-render/src/fills/fractal-noise.ts: `simplexNoise` follows
12
+ "Noise - simplex - 2D" by Inigo Quilez (https://www.shadertoy.com/view/Msf3WH).
13
+ Copyright (c) 2013 Inigo Quilez.
14
+
15
+ The project website, which is in the source repository only and in no npm
16
+ package, also includes MIT code: its landing-page background
17
+ (packages/site/components/landing/GradientBackground.tsx) uses 3D simplex
18
+ noise from webgl-noise by Ian McEwan, Ashima Arts
19
+ (https://github.com/ashima/webgl-noise). Copyright (C) 2011 by Ashima Arts.
20
+
21
+ @motionscript/canvaskit is a build of Skia's CanvasKit (BSD-3-Clause,
22
+ Copyright (c) 2011 Google Inc.) and carries FreeType, HarfBuzz, ICU, zlib,
23
+ libpng, Brotli, WOFF2, Emscripten and musl; their notices are in
24
+ packages/canvaskit/THIRD_PARTY_NOTICES.txt.
25
+
26
+ The browser builds under dist/browser/ bundle each package's npm dependencies;
27
+ dist/browser/THIRD_PARTY_LICENSES.txt in each package lists them with their
28
+ licences.
29
+
30
+ MIT License
31
+
32
+ Permission is hereby granted, free of charge, to any person obtaining a copy
33
+ of this software and associated documentation files (the "Software"), to deal
34
+ in the Software without restriction, including without limitation the rights
35
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
+ copies of the Software, and to permit persons to whom the Software is
37
+ furnished to do so, subject to the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included in all
40
+ copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
+ SOFTWARE.
package/README.md CHANGED
@@ -1,109 +1,156 @@
1
- # Motionscript
2
-
3
- **Motion Script** is a TypeScript/JSX framework for making videos with code.
4
- Describe animations as documents of nodes and commands, then preview
5
- them live in the browser and export straight to MP4 — no timeline UI, no
6
- keyframe panel, just a codebase you can version, review, and generate.
7
-
8
- `@motionscript/sdk` is the flagship package: the authoring surface of
9
- [`@motionscript/core`](../core) (the document model, scene graph, runtime,
10
- layout, and JSX runtime) behind a single import.
11
-
12
- ## Getting started
13
-
14
- Install it with a rendering backend such as
15
- [`@motionscript/browser`](../browser):
16
-
17
- ```bash
18
- npm install @motionscript/sdk @motionscript/core @motionscript/browser @motionscript/canvaskit
19
- ```
20
-
21
- `@motionscript/core` is a peer dependency rather than a bundled one: the
22
- backend and every component kit share the one copy your project installs,
23
- because two copies of the engine in one module graph break class identity.
24
-
25
- ## Quick example
26
-
27
- ```ts
28
- import type { CompositionDocument } from '@motionscript/sdk';
29
-
30
- // A scene is data: a tree of nodes, then commands placed at times.
31
- const doc: CompositionDocument = {
32
- kind: 'composition',
33
- nodes: [
34
- { id: 'card', type: 'rect', parentId: null, layerOrder: 0,
35
- props: { width: 400, height: 400, fill: 'white', cornerRadius: 20 } },
36
- { id: 'lens', type: 'ellipse', parentId: 'card', layerOrder: 0,
37
- props: { width: 350, height: 350, fill: 'black' } },
38
- ],
39
- commands: [
40
- // Slide the lens 300px over 3 seconds.
41
- { id: 'slide', type: 'to', targetId: 'lens', at: 0, duration: 3, args: { x: 300 } },
42
- ],
43
- };
44
- ```
45
-
46
- A scene is data: nodes, and commands placed at times, so any frame can be asked
47
- for directly and a seek costs the same in either direction. Custom drawing, and
48
- anything JSON cannot express, belongs in a node class registered with the engine
49
- and named by key. Flow layout,
50
- fills, gradients, filters, SkSL shader effects, paths, text, audio and 3D are
51
- all supported. See the
52
- [docs](https://motionscript.dev/docs) for the full feature set.
53
-
54
- ## What's in here
55
-
56
- - **Documents & projects**: the `ProjectDocument`, `StillDocument`,
57
- `CompositionDocument` and `AudioDocument` types, `asProjectDocument`,
58
- `validateDocument`, and the `Registry` a document compiles against.
59
- - **Nodes**: geometry (`Rect`, `Ellipse`, `Line`, `Path`, `Polygon`,
60
- `Polygram`, `LineGrid`, `MaskGroup`, `BooleanGroup`), text (`Text`,
61
- `RichText`, `NumberNode`), structure (`Canvas2D`, `Canvas3D`, `Camera`), and
62
- media (`Video`; images are a fill, `Fills.image`). Layout is the `flow` prop,
63
- through `flowOps`.
64
- - **Animation**: commands (`to`, `set`, `variableTo`/`variableSet` and a node's
65
- own `@command` methods), each placed at a time, easing (`linear`, `easeIn`,
66
- `easeOut`, `easeInOut`), and interpolation (`lerpNumber`).
67
- - **Styling & effects**: `Fills`, `Effects`, `ImageFilters`, `VideoFilters`,
68
- `AudioFilters`, plus the `Stroke`/`Shadow`/`Corners` attribute types.
69
- - **Audio**: the `SoundNode` and `AudioBus` nodes.
70
- - **Utilities**: `createRef`, `clamp`, `generateList`, `createContext`,
71
- `Random`, the `@property` decorator.
72
- - **JSX runtime**: `@motionscript/sdk/jsx-runtime` and
73
- `@motionscript/sdk/jsx-dev-runtime`, so a composite node can build its children
74
- as TSX.
75
- - **Component machinery**: `@motionscript/sdk/component`, what a component
76
- package needs beyond the barrel: seekable entrances (`at`, `sequence`,
77
- `together`, `hold`, `compose`, `drive`, and `asCommand` to return one from a
78
- `@command()` method), `declarePaints`, number formatting and the
79
- orbit-camera lerps.
80
-
81
- Component kits such as [`@motionscript/code`](../components/code) and
82
- [`@motionscript/latex`](../components/latex) are not bundled here. They are
83
- built on this package and take it as a peer dependency. Install one as a
84
- dependency, or copy a component's source into your project with
85
- `ms add <name>` (see [`@motionscript/cli`](../cli)).
86
-
87
- ## Loading from a CDN
88
-
89
- `dist/browser/` holds one ES module per export, with `@motionscript/core` left
90
- as an import, and `dist/browser/manifest.json` maps each export to its file. An
91
- import map names `@motionscript/sdk` (and its subpaths) and
92
- `@motionscript/core` (and its subpaths) once, and every kit loaded beside them
93
- shares both.
94
-
95
- This package has no rendering backend of its own. Pair it with
96
- [`@motionscript/browser`](../browser) (Skia/CanvasKit), and use
97
- [`@motionscript/react`](../react) to mount a player in a React app.
98
-
99
- See the [docs](https://motionscript.dev/docs) for the full feature set and API
100
- reference.
101
-
102
- ## Development
103
-
104
- From the monorepo root:
105
-
106
- ```bash
107
- pnpm --filter @motionscript/sdk build
108
- pnpm --filter @motionscript/sdk test
109
- ```
1
+ # @motionscript/sdk
2
+
3
+ **Motion Script** is a TypeScript/JSX framework for making videos with code.
4
+ Describe animations as documents of nodes and commands, then preview
5
+ them live in the browser and export straight to MP4 — no timeline UI, no
6
+ keyframe panel, just a codebase you can version, review, and generate.
7
+
8
+ `@motionscript/sdk` is the flagship package: the authoring surface of
9
+ [`@motionscript/core`](https://github.com/motionscript-dev/motionscript/tree/main/packages/core) (the document model, scene graph, runtime,
10
+ layout, and JSX runtime) behind a single import.
11
+
12
+ ## Getting started
13
+
14
+ Install it with a rendering backend such as
15
+ [`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser):
16
+
17
+ ```bash
18
+ npm install @motionscript/sdk @motionscript/core @motionscript/browser @motionscript/canvaskit
19
+ ```
20
+
21
+ `@motionscript/core` is a peer dependency rather than a bundled one: the
22
+ backend and every component kit share the one copy your project installs,
23
+ because two copies of the engine in one module graph break class identity.
24
+
25
+ ## Quick example
26
+
27
+ ```ts
28
+ import { createBrowserEngine } from '@motionscript/browser';
29
+ import type { CompositionDocument } from '@motionscript/sdk';
30
+
31
+ // A scene is data: a tree of nodes, then commands placed at times.
32
+ const doc: CompositionDocument = {
33
+ kind: 'composition',
34
+ nodes: [
35
+ { id: 'card', type: 'rect', parentId: null, layerOrder: 0,
36
+ props: { width: 400, height: 400, fill: 'white', cornerRadius: 20 } },
37
+ { id: 'lens', type: 'ellipse', parentId: 'card', layerOrder: 0,
38
+ props: { width: 350, height: 350, fill: 'black' } },
39
+ ],
40
+ commands: [
41
+ // Slide the lens 300px over 3 seconds.
42
+ { id: 'slide', type: 'to', targetId: 'lens', at: 0, duration: 3, args: { x: 300 } },
43
+ ],
44
+ };
45
+
46
+ // Serve canvaskit.wasm from @motionscript/canvaskit as a static file.
47
+ const engine = await createBrowserEngine({ wasmUrl: '/canvaskit.wasm' });
48
+ const session = engine.open({ document: doc, target: document.querySelector('canvas')! });
49
+ session.playback!.play();
50
+ ```
51
+
52
+ A scene is data: nodes, and commands placed at times, so any frame can be asked
53
+ for directly and a seek costs the same in either direction. Custom drawing, and
54
+ anything JSON cannot express, belongs in a node class registered with the engine
55
+ and named by key. Flow layout,
56
+ fills, gradients, filters, SkSL shader effects, paths, text, audio and 3D are
57
+ all supported. See the
58
+ [docs](https://motionscript.dev/docs) for the full feature set.
59
+
60
+ ## What's in here
61
+
62
+ - **Documents & projects**: the `ProjectDocument`, `StillDocument`,
63
+ `CompositionDocument` and `AudioDocument` types, `asProjectDocument`,
64
+ `validateDocument`, and the `Registry` a document compiles against.
65
+ - **Nodes**: geometry (`Rect`, `Ellipse`, `Path`, `Polygon`,
66
+ `Polygram`, `MaskGroup`, `BooleanGroup`), text (`Text`,
67
+ `RichText`, `NumberNode`), structure (`Canvas2D`, `Canvas3D`, `Camera`), and
68
+ media (`Video`; images are a fill, `Fills.image`). Layout is the `flow` prop,
69
+ through `flowOps`.
70
+ - **Animation**: commands (`to`, `set`, `variableTo`/`variableSet` and a node's
71
+ own `@command` methods), each placed at a time, easing (`linear`, `easeIn`,
72
+ `easeOut`, `easeInOut`), and interpolation (`lerpNumber`).
73
+ - **Styling & effects**: `Fills`, `Effects`, `Adjustments`, `VideoAdjustments`,
74
+ `AudioFilters`, plus the `Stroke`/`Shadow`/`Corners` attribute types.
75
+ `ImageFilters` and `VideoFilters` remain as `@deprecated` aliases until the
76
+ next major.
77
+ - **Audio**: the `SoundNode` and `AudioBus` nodes.
78
+ - **Utilities**: `createRef`, `clamp`, `generateList`, `createContext`,
79
+ `Random`, the `@property` decorator.
80
+ - **JSX runtime**: `@motionscript/sdk/jsx-runtime` and
81
+ `@motionscript/sdk/jsx-dev-runtime`, so a composite node can build its children
82
+ as TSX (see [JSX](#jsx)).
83
+ - **Component machinery**: `@motionscript/sdk/component`, what a component
84
+ package needs beyond the barrel: seekable entrances (`at`, `sequence`,
85
+ `together`, `hold`, `compose`, `drive`, and `asCommand` to return one from a
86
+ `@command()` method), `declarePaints`, number formatting and the
87
+ orbit-camera lerps. It is a subpath because a scene author never needs it and
88
+ `hold` is a name on both sides: the barrel's is an audio curve, this one is a
89
+ seekable pause. A file that needs both aliases one.
90
+
91
+ Component kits such as [`@motionscript/code`](https://github.com/motionscript-dev/motionscript/tree/main/packages/components/code) and
92
+ [`@motionscript/math`](https://github.com/motionscript-dev/motionscript/tree/main/packages/components/math) are not bundled here. They are
93
+ built on this package and take it as a peer dependency. Install one as a
94
+ dependency, or copy a component's source into your project with
95
+ `ms add <name>` (see [`@motionscript/cli`](https://github.com/motionscript-dev/motionscript/tree/main/packages/cli)). The rules a kit follows are
96
+ in [`packages/components/CLAUDE.md`](https://github.com/motionscript-dev/motionscript/blob/main/packages/components/CLAUDE.md).
97
+
98
+ ## What is deliberately not here
99
+
100
+ `Engine`, `Session`, `PlaybackController`, `ClipStore`, `StateEvaluator`,
101
+ `AssetManager`, the platform seams (`Ticker`, `StorageAdapter`) and the render
102
+ backends (`CanvasRenderContext2D`, `NullRenderContext`) are what a host builds;
103
+ import them from `@motionscript/core`. Members prefixed `_` are outside the API.
104
+
105
+ ## How the surface is defined
106
+
107
+ The package names no symbol. `.` is `export * from '@motionscript/core/sdk'` and
108
+ `./component` is `export * from '@motionscript/core/component'`. The curated
109
+ lists live in core, in `src/sdk/index.ts` (named exports, no wildcards) and
110
+ `src/component.ts` (eight `export *` lines), so there is one list rather than two
111
+ that drift. A name an author would reasonably reach for is added to core's
112
+ `src/sdk/index.ts`; rebuilding core adds it here with no edit in this package.
113
+ One that only a host or a test needs stays in core. `Curve` and `FillChain` are
114
+ classes in core but exported as types here: named, never constructed.
115
+
116
+ The types and values resolve through core's built `dist/`, so nothing imports
117
+ until core has been built. `src/tests/sdk-parity.test.ts` in core compares this
118
+ barrel's value names with core's `sdk/index.ts`; it fails when core's `dist/` is
119
+ stale or absent.
120
+
121
+ ## JSX
122
+
123
+ Configure TypeScript with `"jsx": "react-jsx"` and `"jsxImportSource":
124
+ "@motionscript/sdk"` (`"react-jsxdev"` for the dev runtime), plus
125
+ `"experimentalDecorators": true` for `@property` and `@node`. Only the automatic
126
+ runtime exists: there is no `createElement` or `h`. An element is a node
127
+ instance: `JSX.Element` is `Node`, `IntrinsicElements` is empty (no lowercase
128
+ tag), and the tag must be a class (an arrow function throws `TypeError: type is
129
+ not a constructor`). A fragment is an array at run time. `key` is written to the
130
+ node's `key`, and `ref` takes a `createRef()`. Which children a node accepts is a
131
+ run-time check, not a type, so annotate `const r: Node = <Rect />`, not `Rect`.
132
+
133
+ ## Loading from a CDN
134
+
135
+ `dist/browser/` holds one ES module per export. Core is a peer, so the modules
136
+ leave `@motionscript/core/sdk`, `/component`, `/jsx/jsx-runtime` and
137
+ `/jsx/jsx-dev-runtime` as imports, and `dist/browser/manifest.json` maps each
138
+ export to its file and lists core under `peers`. An import map names
139
+ `@motionscript/sdk` (and its subpaths) and `@motionscript/core` (and its
140
+ subpaths) once, and every kit loaded beside them shares both.
141
+
142
+ This package has no rendering backend of its own. Pair it with
143
+ [`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser) (Skia/CanvasKit), and use
144
+ [`@motionscript/react`](https://github.com/motionscript-dev/motionscript/tree/main/packages/react) to mount a player in a React app. See the
145
+ [docs](https://motionscript.dev/docs) for the full API reference.
146
+
147
+ ## Development
148
+
149
+ From the monorepo root:
150
+
151
+ ```bash
152
+ pnpm --filter @motionscript/sdk build
153
+ pnpm --filter @motionscript/sdk test
154
+ ```
155
+
156
+ It has no tests of its own (`passWithNoTests`); core's parity test guards it.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/component.ts"],
4
- "sourcesContent": ["/**\n * `@motionscript/sdk/component` — what a component package needs beyond the\n * authoring barrel: seekable entrances (`at`, `sequence`, `together`, `hold`,\n * `compose`, `drive`, and `asCommand` to return one from a `@command()` method),\n * `declarePaints`, number formatting and the orbit-camera lerps.\n *\n * A subpath, not part of `.`, because a scene author never reaches for it and\n * one name collides: `hold` here is a seekable pause, where the barrel's `hold`\n * is an audio curve. The curation is `@motionscript/core/component`'s, for the\n * same reason `index.ts` passes through `@motionscript/core/sdk`.\n */\nexport * from \"@motionscript/core/component\";\n"],
4
+ "sourcesContent": ["/**\r\n * `@motionscript/sdk/component` — what a component package needs beyond the\r\n * authoring barrel: seekable entrances (`at`, `sequence`, `together`, `hold`,\r\n * `compose`, `drive`, and `asCommand` to return one from a `@command()` method),\r\n * `declarePaints`, number formatting and the orbit-camera lerps.\r\n *\r\n * A subpath, not part of `.`, because a scene author never reaches for it and\r\n * one name collides: `hold` here is a seekable pause, where the barrel's `hold`\r\n * is an audio curve. The curation is `@motionscript/core/component`'s, for the\r\n * same reason `index.ts` passes through `@motionscript/core/sdk`.\r\n */\r\nexport * from \"@motionscript/core/component\";\r\n"],
5
5
  "mappings": "AAWA,WAAc",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["/**\n * `@motionscript/sdk` — the published, friendly name over `@motionscript/core`.\n *\n * The curation lives in `@motionscript/core`'s own `\"./sdk\"` subpath\n * (`packages/core/src/sdk/index.ts`), not here: a hand-curated copy in a\n * different package than the classes it names is exactly the \"two\n * definitions that can silently disagree\" shape this codebase avoids\n * elsewhere. This file exists so the published package name and its own\n * versioning stay stable — only its implementation is a passthrough.\n */\nexport * from \"@motionscript/core/sdk\";\n"],
4
+ "sourcesContent": ["/**\r\n * `@motionscript/sdk` — the published, friendly name over `@motionscript/core`.\r\n *\r\n * The curation lives in `@motionscript/core`'s own `\"./sdk\"` subpath\r\n * (`packages/core/src/sdk/index.ts`), not here: a hand-curated copy in a\r\n * different package than the classes it names is exactly the \"two\r\n * definitions that can silently disagree\" shape this codebase avoids\r\n * elsewhere. This file exists so the published package name and its own\r\n * versioning stay stable — only its implementation is a passthrough.\r\n */\r\nexport * from \"@motionscript/core/sdk\";\r\n"],
5
5
  "mappings": "AAUA,WAAc",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/jsx-dev-runtime.ts"],
4
- "sourcesContent": ["export { jsxDEV, Fragment } from '@motionscript/core/jsx/jsx-dev-runtime';\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\n"],
4
+ "sourcesContent": ["export { jsxDEV, Fragment } from '@motionscript/core/jsx/jsx-dev-runtime';\r\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\r\n"],
5
5
  "mappings": "AAAA,OAAS,UAAAA,EAAQ,YAAAC,MAAgB",
6
6
  "names": ["jsxDEV", "Fragment"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/jsx-runtime.ts"],
4
- "sourcesContent": ["export { jsx, jsxs, Fragment } from '@motionscript/core/jsx/jsx-runtime';\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\n"],
4
+ "sourcesContent": ["export { jsx, jsxs, Fragment } from '@motionscript/core/jsx/jsx-runtime';\r\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\r\n"],
5
5
  "mappings": "AAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,YAAAC,MAAgB",
6
6
  "names": ["jsx", "jsxs", "Fragment"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/sdk",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.5",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js",
6
6
  "./component": "dist/browser/component.js",
@@ -10,5 +10,6 @@
10
10
  "peers": [
11
11
  "@motionscript/core"
12
12
  ],
13
- "assets": {}
13
+ "assets": {},
14
+ "thirdParty": []
14
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,8BAA8B,CAAC","sourcesContent":["/**\n * `@motionscript/sdk/component` — what a component package needs beyond the\n * authoring barrel: seekable entrances (`at`, `sequence`, `together`, `hold`,\n * `compose`, `drive`, and `asCommand` to return one from a `@command()` method),\n * `declarePaints`, number formatting and the orbit-camera lerps.\n *\n * A subpath, not part of `.`, because a scene author never reaches for it and\n * one name collides: `hold` here is a seekable pause, where the barrel's `hold`\n * is an audio curve. The curation is `@motionscript/core/component`'s, for the\n * same reason `index.ts` passes through `@motionscript/core/sdk`.\n */\nexport * from \"@motionscript/core/component\";\n"]}
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,8BAA8B,CAAC","sourcesContent":["/**\r\n * `@motionscript/sdk/component` — what a component package needs beyond the\r\n * authoring barrel: seekable entrances (`at`, `sequence`, `together`, `hold`,\r\n * `compose`, `drive`, and `asCommand` to return one from a `@command()` method),\r\n * `declarePaints`, number formatting and the orbit-camera lerps.\r\n *\r\n * A subpath, not part of `.`, because a scene author never reaches for it and\r\n * one name collides: `hold` here is a seekable pause, where the barrel's `hold`\r\n * is an audio curve. The curation is `@motionscript/core/component`'s, for the\r\n * same reason `index.ts` passes through `@motionscript/core/sdk`.\r\n */\r\nexport * from \"@motionscript/core/component\";\r\n"]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,wBAAwB,CAAC","sourcesContent":["/**\n * `@motionscript/sdk` — the published, friendly name over `@motionscript/core`.\n *\n * The curation lives in `@motionscript/core`'s own `\"./sdk\"` subpath\n * (`packages/core/src/sdk/index.ts`), not here: a hand-curated copy in a\n * different package than the classes it names is exactly the \"two\n * definitions that can silently disagree\" shape this codebase avoids\n * elsewhere. This file exists so the published package name and its own\n * versioning stay stable — only its implementation is a passthrough.\n */\nexport * from \"@motionscript/core/sdk\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,wBAAwB,CAAC","sourcesContent":["/**\r\n * `@motionscript/sdk` — the published, friendly name over `@motionscript/core`.\r\n *\r\n * The curation lives in `@motionscript/core`'s own `\"./sdk\"` subpath\r\n * (`packages/core/src/sdk/index.ts`), not here: a hand-curated copy in a\r\n * different package than the classes it names is exactly the \"two\r\n * definitions that can silently disagree\" shape this codebase avoids\r\n * elsewhere. This file exists so the published package name and its own\r\n * versioning stay stable — only its implementation is a passthrough.\r\n */\r\nexport * from \"@motionscript/core/sdk\";\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC","sourcesContent":["export { jsxDEV, Fragment } from '@motionscript/core/jsx/jsx-dev-runtime';\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\n"]}
1
+ {"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC","sourcesContent":["export { jsxDEV, Fragment } from '@motionscript/core/jsx/jsx-dev-runtime';\r\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { jsx, jsxs, Fragment } from '@motionscript/core/jsx/jsx-runtime';\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\n"]}
1
+ {"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { jsx, jsxs, Fragment } from '@motionscript/core/jsx/jsx-runtime';\r\nexport type { JSX } from '@motionscript/core/jsx/jsx-runtime';\r\n"]}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@motionscript/sdk",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.5",
4
4
  "type": "module",
5
- "description": "Engine-agnostic animation library for Motion Script: scenes, nodes, props, tweens, layout, and the JSX runtime.",
5
+ "description": "The Motion Script authoring surface behind one import: document types, nodes, commands, styling, the JSX runtime, and the machinery component kits build on.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/motionscript-dev/motionscript.git",
@@ -25,6 +25,7 @@
25
25
  "types": "dist/index.d.ts",
26
26
  "sideEffects": false,
27
27
  "files": [
28
+ "NOTICE",
28
29
  "dist",
29
30
  "CHANGELOG.md",
30
31
  "!dist/**/*.tsbuildinfo"
@@ -48,7 +49,7 @@
48
49
  }
49
50
  },
50
51
  "peerDependencies": {
51
- "@motionscript/core": "^0.1.0-alpha.3"
52
+ "@motionscript/core": "^0.1.0-alpha.5"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@types/node": "^25.6.2",
@@ -60,7 +61,7 @@
60
61
  "typescript": "^6.0.3",
61
62
  "typescript-eslint": "^8.48.0",
62
63
  "vitest": "^4.1.5",
63
- "@motionscript/core": "0.1.0-alpha.3"
64
+ "@motionscript/core": "0.1.0-alpha.5"
64
65
  },
65
66
  "scripts": {
66
67
  "build": "eslint . && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node ../../scripts/build-browser.mjs",