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

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,51 @@
1
1
  # @motionscript/sdk
2
2
 
3
+ ## 0.1.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 6697bb4: Every chart command runs from a document.
8
+
9
+ - Thirteen of the twenty chart commands returned a composition of seekable parts rather than a `Command`, so a document naming one failed to compile with `TypeError: made.at is not a function`: `enter` on all three charts, `showSeries`, `hideSeries` and `spotlightSeries` on the line and bar charts, and `selectSlice`, `deselectSlice`, `selectOnlySlice` and `clearSelection` on the pie. So did `zoomTo` with a region naming neither axis, and `resetZoom` before any zoom. Each now returns a `Command` that lasts the duration it was given. A line or bar `enter` without a legend, whose beats end before that, holds its last frame for the rest of it.
10
+ - `@motionscript/sdk/component` gains `asCommand(part, duration?)`, which makes a composition built with `at`, `sequence`, `together`, `hold`, `compose` or `drive` the `Command` a `@command()` method returns. A part that ends before `duration` holds its last frame, and one that runs longer is played faster, so the command always ends where the part does.
11
+ - A line chart's first `zoomTo` from an auto axis tweens. It started from the unset range and ticks, which the axis tween steps at the midpoint, so the first zoom cut halfway through and only later ones moved. A zoom, and `resetZoom`, now start from the range and ticks the axis draws.
12
+
13
+ - ffd26fd: A `protein`'s `color` now paints. The prop resolves to an RGBA tuple when it is written, and `hexOf` turned anything that was not a string into `#ffffff`. So `colorScheme: 'uniform'` painted every atom, bond, tube and ribbon white whatever `color` was, the `residue` scheme's fallback was white, and a tween of `color` changed nothing. `hexOf` now writes any `Color` as hex through `colorOps`, so `color` drives `uniform` and the fallbacks, and a change to it rebuilds the cached tints. The `element`, `chain`, `secondary` and `residue` colours are unchanged.
14
+
15
+ `colorOps` is now exported from `@motionscript/sdk`, and it gains `hex(value)`, which writes any `Color` as `#rrggbb`, or as `#rrggbbaa` when it is not opaque.
16
+
17
+ - 59c9944: A subclass that redeclares a `@property` or a `@command()` its base already declares now overrides it. `getPropertyMeta` and `getCommandMeta` kept the base's declaration and dropped the subclass's, so a redeclared default, mapper, tween or editor option, or a command's `args` and `name`, never took effect. The most-derived declaration of each key now wins, whole, in the position the base gave it, and an inherited key the subclass does not redeclare is kept as declared. `Registry.describe`, a node type's command table and a new instance's values all read that one declaration.
18
+
19
+ A bare `Globe` now starts at its own camera and key light (orbit −10, elevation 25, zoom 2.8, ambient 0.55, key 1.9) rather than `Canvas3D`'s (35, 20, 12, 0.45, 2.4), which framed it as a small disc twelve radii away. A bare `Protein` likewise starts at elevation 18, zoom 2.6, ambient 0.55 and key 1.6. `describe("graph3d")` no longer reports `Canvas3D`'s defaults for `orbit`, `elevation` and `zoom`, which a graph derives from `camera.initialPosition`.
20
+
21
+ ## 0.1.0-alpha.2
22
+
23
+ ### Patch Changes
24
+
25
+ - 0227e28: A command published under a key of its own, `@command({ key: "press" }) pulse()`, runs the method it decorates. The registry recorded the key as the method to call, so dispatching it from a document called whatever the class had under that name: a prop (`Command "press" needs a "press" method`), an inherited method, or nothing. `CommandMeta` now carries `method` beside `key`, and `Registry.addNode` stores it as `NodeCommandEntry.method`. A command whose key is a core command's but whose method is not is no longer taken for the core command when compile decides whether it reads or writes layout. A command declared without a `key` is unchanged.
26
+
27
+ ## 0.1.0-alpha.1
28
+
29
+ ### Minor Changes
30
+
31
+ - 59cecba: The SDK carries what a component is written against, so a kit no longer reaches into `@motionscript/core`. New in `@motionscript/sdk` (and `@motionscript/core/sdk`, which it passes through):
32
+
33
+ - `PathShape` and `PathShapeProps`, the document's `"path"` node, whose `data` is in its own box's unit space.
34
+ - `pathOps`, with the `PathSampler`, `PathAnchor`, `PathSubpath` and `VectorPath` types it takes and returns.
35
+ - `textOps`.
36
+ - `toPathString`, plus the `PathBounds` and `GraphicsOp` types.
37
+ - `InsetsProps`, what a `padding`-style prop accepts, and `SizeConstraints`, what an overriding `measure()` is handed.
38
+ - `SpaceCamera`, what `_spaceCamera()` returns to open a 2.5D space.
39
+ - `BufferGeometry3D`.
40
+
41
+ `@motionscript/sdk/component` is a new subpath over `@motionscript/core/component`: seekable entrances (`at`, `sequence`, `together`, `hold`, `compose`, `drive`), `declarePaints`, number formatting and the orbit-camera lerps. It is a subpath because a scene author never needs it, and because its `hold` (a seekable pause) is not the barrel's `hold` (an audio curve).
42
+
43
+ Host machinery stays in core: the asset catalog and declaration pass, render and measure contexts, `SceneTimeline`, `Engine` and `Session`.
44
+
45
+ - 59cecba: Ship a browser build in `dist/browser/`, like every other package: one ES module per export (`.`, `./component`, `./jsx-runtime`, `./jsx-dev-runtime`) and a `manifest.json` mapping each to its file. It imports `@motionscript/core` rather than bundling it, so an import map names core once and the SDK, the backend and every kit share it.
46
+
47
+ `@motionscript/core` is now a peer dependency of the SDK rather than a dependency, as it is of everything else built on core. npm and pnpm install a missing peer for you; with a package manager that does not, add `@motionscript/core` beside `@motionscript/sdk`.
48
+
3
49
  ## 0.1.0-alpha.0
4
50
 
5
51
  Initial release.
package/README.md CHANGED
@@ -15,9 +15,13 @@ Install it with a rendering backend such as
15
15
  [`@motionscript/browser`](../browser):
16
16
 
17
17
  ```bash
18
- npm install @motionscript/sdk @motionscript/browser @motionscript/canvaskit
18
+ npm install @motionscript/sdk @motionscript/core @motionscript/browser @motionscript/canvaskit
19
19
  ```
20
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
+
21
25
  ## Quick example
22
26
 
23
27
  ```ts
@@ -68,12 +72,26 @@ all supported. See the
68
72
  - **JSX runtime**: `@motionscript/sdk/jsx-runtime` and
69
73
  `@motionscript/sdk/jsx-dev-runtime`, so a composite node can build its children
70
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.
71
80
 
72
81
  Component kits such as [`@motionscript/code`](../components/code) and
73
- [`@motionscript/latex`](../components/latex) are not bundled here. Install one
74
- as a dependency, or copy a component's source into your project with
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
75
85
  `ms add <name>` (see [`@motionscript/cli`](../cli)).
76
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
+
77
95
  This package has no rendering backend of its own. Pair it with
78
96
  [`@motionscript/browser`](../browser) (Skia/CanvasKit), and use
79
97
  [`@motionscript/react`](../react) to mount a player in a React app.
@@ -0,0 +1,2 @@
1
+ export*from"@motionscript/core/component";
2
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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"],
5
+ "mappings": "AAWA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export*from"@motionscript/core/sdk";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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"],
5
+ "mappings": "AAUA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{jsxDEV as m,Fragment as o}from"@motionscript/core/jsx/jsx-dev-runtime";export{o as Fragment,m as jsxDEV};
2
+ //# sourceMappingURL=jsx-dev-runtime.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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"],
5
+ "mappings": "AAAA,OAAS,UAAAA,EAAQ,YAAAC,MAAgB",
6
+ "names": ["jsxDEV", "Fragment"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{jsx as x,jsxs as e,Fragment as j}from"@motionscript/core/jsx/jsx-runtime";export{j as Fragment,x as jsx,e as jsxs};
2
+ //# sourceMappingURL=jsx-runtime.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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"],
5
+ "mappings": "AAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,YAAAC,MAAgB",
6
+ "names": ["jsx", "jsxs", "Fragment"]
7
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@motionscript/sdk",
3
+ "version": "0.1.0-alpha.3",
4
+ "exports": {
5
+ ".": "dist/browser/index.js",
6
+ "./component": "dist/browser/component.js",
7
+ "./jsx-runtime": "dist/browser/jsx-runtime.js",
8
+ "./jsx-dev-runtime": "dist/browser/jsx-dev-runtime.js"
9
+ },
10
+ "peers": [
11
+ "@motionscript/core"
12
+ ],
13
+ "assets": {}
14
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `@motionscript/sdk/component` — what a component package needs beyond the
3
+ * authoring barrel: seekable entrances (`at`, `sequence`, `together`, `hold`,
4
+ * `compose`, `drive`, and `asCommand` to return one from a `@command()` method),
5
+ * `declarePaints`, number formatting and the orbit-camera lerps.
6
+ *
7
+ * A subpath, not part of `.`, because a scene author never reaches for it and
8
+ * one name collides: `hold` here is a seekable pause, where the barrel's `hold`
9
+ * is an audio curve. The curation is `@motionscript/core/component`'s, for the
10
+ * same reason `index.ts` passes through `@motionscript/core/sdk`.
11
+ */
12
+ export * from "@motionscript/core/component";
13
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `@motionscript/sdk/component` — what a component package needs beyond the
3
+ * authoring barrel: seekable entrances (`at`, `sequence`, `together`, `hold`,
4
+ * `compose`, `drive`, and `asCommand` to return one from a `@command()` method),
5
+ * `declarePaints`, number formatting and the orbit-camera lerps.
6
+ *
7
+ * A subpath, not part of `.`, because a scene author never reaches for it and
8
+ * one name collides: `hold` here is a seekable pause, where the barrel's `hold`
9
+ * is an audio curve. The curation is `@motionscript/core/component`'s, for the
10
+ * same reason `index.ts` passes through `@motionscript/core/sdk`.
11
+ */
12
+ export * from "@motionscript/core/component";
13
+ //# sourceMappingURL=component.js.map
@@ -0,0 +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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/sdk",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.3",
4
4
  "type": "module",
5
5
  "description": "Engine-agnostic animation library for Motion Script: scenes, nodes, props, tweens, layout, and the JSX runtime.",
6
6
  "repository": {
@@ -34,6 +34,10 @@
34
34
  "types": "./dist/index.d.ts",
35
35
  "default": "./dist/index.js"
36
36
  },
37
+ "./component": {
38
+ "types": "./dist/component.d.ts",
39
+ "default": "./dist/component.js"
40
+ },
37
41
  "./jsx-runtime": {
38
42
  "types": "./dist/jsx-runtime.d.ts",
39
43
  "default": "./dist/jsx-runtime.js"
@@ -43,8 +47,8 @@
43
47
  "default": "./dist/jsx-dev-runtime.js"
44
48
  }
45
49
  },
46
- "dependencies": {
47
- "@motionscript/core": "^0.1.0-alpha.0"
50
+ "peerDependencies": {
51
+ "@motionscript/core": "^0.1.0-alpha.3"
48
52
  },
49
53
  "devDependencies": {
50
54
  "@types/node": "^25.6.2",
@@ -55,10 +59,11 @@
55
59
  "tsc-alias": "^1.8.16",
56
60
  "typescript": "^6.0.3",
57
61
  "typescript-eslint": "^8.48.0",
58
- "vitest": "^4.1.5"
62
+ "vitest": "^4.1.5",
63
+ "@motionscript/core": "0.1.0-alpha.3"
59
64
  },
60
65
  "scripts": {
61
- "build": "eslint . && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
66
+ "build": "eslint . && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node ../../scripts/build-browser.mjs",
62
67
  "dev": "concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc-alias -p tsconfig.build.json -w\"",
63
68
  "clean": "rimraf --glob dist .turbo *.tsbuildinfo",
64
69
  "test": "vitest",