@motionscript/sdk 0.1.0-alpha.8 → 0.1.0-alpha.9
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 +2 -0
- package/LICENSE +201 -201
- package/NOTICE +49 -49
- package/README.md +175 -175
- package/dist/browser/component.js.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/component.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx-dev-runtime.js +0 -2
- package/dist/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx-runtime.d.ts +0 -3
- package/dist/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx-runtime.js +0 -2
- package/dist/jsx-runtime.js.map +0 -1
package/CHANGELOG.md
CHANGED
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
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
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/renderer/crates/renderer/src/shaders/prim.wgsl (`fn_hash2`):
|
|
8
|
-
"Hash without Sine" by David Hoskins (https://www.shadertoy.com/view/4djSRW).
|
|
9
|
-
Copyright (c) 2014 David Hoskins.
|
|
10
|
-
|
|
11
|
-
- packages/renderer/crates/renderer/src/shaders/prim.wgsl (`simplex_noise`): "Noise - simplex - 2D" by Inigo Quilez
|
|
12
|
-
(https://www.shadertoy.com/view/Msf3WH). Copyright (c) 2013 Inigo Quilez.
|
|
13
|
-
|
|
14
|
-
- packages/renderer/crates/render3d (in @motionscript/renderer's WebAssembly):
|
|
15
|
-
its shaders (src/shaders/mesh.wgsl) port three.js r185's mesh programs and
|
|
16
|
-
src/geometry.rs its primitive generators (https://threejs.org).
|
|
17
|
-
Copyright (c) 2010-2026 three.js authors.
|
|
18
|
-
|
|
19
|
-
@motionscript/renderer's WebAssembly (dist/ms_renderer_bg.wasm) compiles in
|
|
20
|
-
Rust crates under MIT, Apache-2.0, Zlib and Unicode-3.0 terms (wgpu, naga,
|
|
21
|
-
harfrust, read-fonts, kurbo, wasm-bindgen and others); their notices are in
|
|
22
|
-
packages/renderer/THIRD_PARTY_NOTICES.txt.
|
|
23
|
-
|
|
24
|
-
MP3 export loads @mediabunny/mp3-encoder (MPL-2.0), a WebAssembly build of
|
|
25
|
-
the LAME MP3 encoder (LGPL, https://lame.sourceforge.io), on first use.
|
|
26
|
-
|
|
27
|
-
The browser builds under dist/browser/ bundle each package's npm dependencies;
|
|
28
|
-
dist/browser/THIRD_PARTY_LICENSES.txt in each package lists them with their
|
|
29
|
-
licences.
|
|
30
|
-
|
|
31
|
-
MIT License
|
|
32
|
-
|
|
33
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
34
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
35
|
-
in the Software without restriction, including without limitation the rights
|
|
36
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
37
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
38
|
-
furnished to do so, subject to the following conditions:
|
|
39
|
-
|
|
40
|
-
The above copyright notice and this permission notice shall be included in all
|
|
41
|
-
copies or substantial portions of the Software.
|
|
42
|
-
|
|
43
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
44
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
45
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
46
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
47
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
48
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
49
|
-
SOFTWARE.
|
|
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/renderer/crates/renderer/src/shaders/prim.wgsl (`fn_hash2`):
|
|
8
|
+
"Hash without Sine" by David Hoskins (https://www.shadertoy.com/view/4djSRW).
|
|
9
|
+
Copyright (c) 2014 David Hoskins.
|
|
10
|
+
|
|
11
|
+
- packages/renderer/crates/renderer/src/shaders/prim.wgsl (`simplex_noise`): "Noise - simplex - 2D" by Inigo Quilez
|
|
12
|
+
(https://www.shadertoy.com/view/Msf3WH). Copyright (c) 2013 Inigo Quilez.
|
|
13
|
+
|
|
14
|
+
- packages/renderer/crates/render3d (in @motionscript/renderer's WebAssembly):
|
|
15
|
+
its shaders (src/shaders/mesh.wgsl) port three.js r185's mesh programs and
|
|
16
|
+
src/geometry.rs its primitive generators (https://threejs.org).
|
|
17
|
+
Copyright (c) 2010-2026 three.js authors.
|
|
18
|
+
|
|
19
|
+
@motionscript/renderer's WebAssembly (dist/ms_renderer_bg.wasm) compiles in
|
|
20
|
+
Rust crates under MIT, Apache-2.0, Zlib and Unicode-3.0 terms (wgpu, naga,
|
|
21
|
+
harfrust, read-fonts, kurbo, wasm-bindgen and others); their notices are in
|
|
22
|
+
packages/renderer/THIRD_PARTY_NOTICES.txt.
|
|
23
|
+
|
|
24
|
+
MP3 export loads @mediabunny/mp3-encoder (MPL-2.0), a WebAssembly build of
|
|
25
|
+
the LAME MP3 encoder (LGPL, https://lame.sourceforge.io), on first use.
|
|
26
|
+
|
|
27
|
+
The browser builds under dist/browser/ bundle each package's npm dependencies;
|
|
28
|
+
dist/browser/THIRD_PARTY_LICENSES.txt in each package lists them with their
|
|
29
|
+
licences.
|
|
30
|
+
|
|
31
|
+
MIT License
|
|
32
|
+
|
|
33
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
34
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
35
|
+
in the Software without restriction, including without limitation the rights
|
|
36
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
37
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
38
|
+
furnished to do so, subject to the following conditions:
|
|
39
|
+
|
|
40
|
+
The above copyright notice and this permission notice shall be included in all
|
|
41
|
+
copies or substantial portions of the Software.
|
|
42
|
+
|
|
43
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
44
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
45
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
46
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
47
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
48
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
49
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
# @motionscript/sdk
|
|
2
|
-
|
|
3
|
-
**Motion Script** is a TypeScript 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, layout,
|
|
10
|
-
and the factories a node type is written with) 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
|
|
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
|
-
(a component generates a class, and identity is per copy).
|
|
25
|
-
|
|
26
|
-
## Quick example
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
import { createBrowserEngine } from '@motionscript/browser';
|
|
30
|
-
import type { CompositionDocument } from '@motionscript/sdk';
|
|
31
|
-
|
|
32
|
-
// A scene is data: a tree of nodes, then commands placed at times.
|
|
33
|
-
const doc: CompositionDocument = {
|
|
34
|
-
kind: 'composition',
|
|
35
|
-
nodes: [
|
|
36
|
-
{ id: 'card', type: 'rect', parentId: null, layerOrder: 0,
|
|
37
|
-
props: { width: 400, height: 400, fill: 'white', cornerRadius: 20 } },
|
|
38
|
-
{ id: 'lens', type: 'ellipse', parentId: 'card', layerOrder: 0,
|
|
39
|
-
props: { width: 350, height: 350, fill: 'black' } },
|
|
40
|
-
],
|
|
41
|
-
commands: [
|
|
42
|
-
// Slide the lens 300px over 3 seconds.
|
|
43
|
-
{ id: 'slide', type: 'to', targetId: 'lens', at: 0, duration: 3, args: { x: 300 } },
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const engine = await createBrowserEngine();
|
|
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 component registered with the engine
|
|
55
|
-
and named by key (see [Writing a node type](#writing-a-node-type)). Flow layout,
|
|
56
|
-
fills, gradients, filters, WGSL 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`, `migrateDocument` (and `DOCUMENT_FORMAT_VERSION`,
|
|
65
|
-
`DocumentTooNewError`, `migrateNodeProps`) for documents saved by older
|
|
66
|
-
releases, and the `Registry` a document compiles against.
|
|
67
|
-
- **Nodes**: geometry (`Rect`, `Ellipse`, `Path`, `Polygon`,
|
|
68
|
-
`Polygram`, `MaskGroup`, `BooleanGroup`), text (`Text`,
|
|
69
|
-
`RichText`, `NumberNode`), structure (`Canvas2D`, `Canvas3D`, `Camera`), and
|
|
70
|
-
media (`Video`; images are a fill, `Fills.image`). Layout is the `flow` prop,
|
|
71
|
-
through `flowOps`. Each is a component: call it to build one
|
|
72
|
-
(`Rect({ fill: 'red', children: [...] })`).
|
|
73
|
-
- **Components**: the factories `component2d`, `component3d` and
|
|
74
|
-
`componentAudio`, the `Types` a component's state is declared with,
|
|
75
|
-
`commandsFor`, `provides`, and the modules a component spreads in and calls:
|
|
76
|
-
`Paint`, `Flow`, `Shapes`, `Aim`, `Typeface`, `TextLayout`, `Material`,
|
|
77
|
-
`View3D`.
|
|
78
|
-
- **Animation**: commands (`to`, `set`, `variableTo`/`variableSet` and a node
|
|
79
|
-
type's own), each placed at a time, easing (`linear`, `easeIn`,
|
|
80
|
-
`easeOut`, `easeInOut`), and interpolation (`lerpNumber`).
|
|
81
|
-
- **Styling & effects**: `Fills`, `Effects`, `Adjustments`, `VideoAdjustments`,
|
|
82
|
-
`AudioEffects`, plus the `Stroke`/`Shadow`/`Corners` attribute types.
|
|
83
|
-
`ImageFilters` and `VideoFilters` remain as `@deprecated` aliases until the
|
|
84
|
-
next major.
|
|
85
|
-
- **Audio**: the `SoundNode` and `AudioBus` nodes, and `ramp`/`hold` for
|
|
86
|
-
JSON automation of their levels, speed and effects.
|
|
87
|
-
- **Utilities**: `createRef`, `clamp`, `generateList`, `createContext`,
|
|
88
|
-
`Random`.
|
|
89
|
-
- **Component machinery**: `@motionscript/sdk/component`, what a component
|
|
90
|
-
package needs beyond the barrel: number formatting, text defaults, the named
|
|
91
|
-
shape outlines and the orbit-camera lerps. It is a subpath because a scene
|
|
92
|
-
author never needs it.
|
|
93
|
-
|
|
94
|
-
Component kits such as [`@motionscript/code`](https://github.com/motionscript-dev/motionscript/tree/main/packages/components/code) and
|
|
95
|
-
[`@motionscript/math`](https://github.com/motionscript-dev/motionscript/tree/main/packages/components/math) are not bundled here. They are
|
|
96
|
-
built on this package and take it as a peer dependency. Install one as a
|
|
97
|
-
dependency
|
|
98
|
-
|
|
99
|
-
in [`packages/components/CLAUDE.md`](https://github.com/motionscript-dev/motionscript/blob/main/packages/components/CLAUDE.md).
|
|
100
|
-
|
|
101
|
-
## What is deliberately not here
|
|
102
|
-
|
|
103
|
-
`Engine`, `Session`, `PlaybackController`, `ClipStore`, `StateEvaluator`,
|
|
104
|
-
`AssetManager`, the platform seams (`Ticker`, `StorageAdapter`) and the render
|
|
105
|
-
backends (`CanvasRenderContext2D`, `NullRenderContext`) are what a host builds;
|
|
106
|
-
import them from `@motionscript/core`. Members prefixed `_` are outside the API.
|
|
107
|
-
|
|
108
|
-
## How the surface is defined
|
|
109
|
-
|
|
110
|
-
The package names no symbol. `.` is `export * from '@motionscript/core/sdk'` and
|
|
111
|
-
`./component` is `export * from '@motionscript/core/component'`. The curated
|
|
112
|
-
lists live in core, in `src/sdk/index.ts` (named exports, no wildcards) and
|
|
113
|
-
`src/component.ts` (eight `export *` lines), so there is one list rather than two
|
|
114
|
-
that drift. A name an author would reasonably reach for is added to core's
|
|
115
|
-
`src/sdk/index.ts`; rebuilding core adds it here with no edit in this package.
|
|
116
|
-
One that only a host or a test needs stays in core. `FillChain` is a class in
|
|
117
|
-
core but exported as a type here: named, never constructed.
|
|
118
|
-
|
|
119
|
-
The types and values resolve through core's built `dist/`, so nothing imports
|
|
120
|
-
until core has been built. `src/tests/sdk-parity.test.ts` in core compares this
|
|
121
|
-
barrel's value names with core's `sdk/index.ts`; it fails when core's `dist/` is
|
|
122
|
-
stale or absent.
|
|
123
|
-
|
|
124
|
-
## Writing a node type
|
|
125
|
-
|
|
126
|
-
A node type is one object handed to a factory. `key` is its document key;
|
|
127
|
-
`state` its entries, plain values or `Types` builders, plus whatever modules it
|
|
128
|
-
spreads in; `commands` what it does on the timeline; `render` what it draws:
|
|
129
|
-
|
|
130
|
-
```ts
|
|
131
|
-
import { component2d, Graphics2D, Paint, Types } from '@motionscript/sdk';
|
|
132
|
-
import { createBrowserEngine } from '@motionscript/browser';
|
|
133
|
-
|
|
134
|
-
export const Gauge = component2d({
|
|
135
|
-
key: 'gauge',
|
|
136
|
-
state: { ...Paint.state, value: Types.number(0, { min: 0, max: 1 }) },
|
|
137
|
-
commands: { ...Paint.commands, fillUp: { args: ['value'] } },
|
|
138
|
-
render: (ctx, state) => Paint.draw(ctx, state, new Graphics2D().ellipse({
|
|
139
|
-
width: ctx.size.width, height: ctx.size.height, ratio: 0.75, startAngle: -90, sweep: 360 * state.value,
|
|
140
|
-
})),
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const engine = await createBrowserEngine({ nodes: [Gauge] });
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
The factory generates the node class, declares its key and writes its entries
|
|
147
|
-
and commands where the registry reads them, so a document can name `gauge`
|
|
148
|
-
once it is handed to an engine. Calling `Gauge({ value: 0.4 })` builds one in
|
|
149
|
-
code, typed by its entries. No decorators and no JSX are needed: a component
|
|
150
|
-
compiles with plain TypeScript. The guide is the
|
|
151
|
-
[custom node docs](https://motionscript.dev/docs/custom-node/introduction).
|
|
152
|
-
|
|
153
|
-
## Loading from a CDN
|
|
154
|
-
|
|
155
|
-
`dist/browser/` holds one ES module per export. Core is a peer, so the modules
|
|
156
|
-
leave `@motionscript/core/sdk` and `/component` as imports, and `dist/browser/manifest.json` maps each
|
|
157
|
-
export to its file and lists core under `peers`. An import map names
|
|
158
|
-
`@motionscript/sdk` (and its subpaths) and `@motionscript/core` (and its
|
|
159
|
-
subpaths) once, and every kit loaded beside them shares both.
|
|
160
|
-
|
|
161
|
-
This package has no rendering backend of its own. Pair it with
|
|
162
|
-
[`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser) (WebGPU), and use
|
|
163
|
-
[`@motionscript/react`](https://github.com/motionscript-dev/motionscript/tree/main/packages/react) to mount a player in a React app. See the
|
|
164
|
-
[docs](https://motionscript.dev/docs) for the full API reference.
|
|
165
|
-
|
|
166
|
-
## Development
|
|
167
|
-
|
|
168
|
-
From the monorepo root:
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
pnpm --filter @motionscript/sdk build
|
|
172
|
-
pnpm --filter @motionscript/sdk test
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
It has no tests of its own (`passWithNoTests`); core's parity test guards it.
|
|
1
|
+
# @motionscript/sdk
|
|
2
|
+
|
|
3
|
+
**Motion Script** is a TypeScript 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, layout,
|
|
10
|
+
and the factories a node type is written with) 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
|
|
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
|
+
(a component generates a class, and identity is per copy).
|
|
25
|
+
|
|
26
|
+
## Quick example
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { createBrowserEngine } from '@motionscript/browser';
|
|
30
|
+
import type { CompositionDocument } from '@motionscript/sdk';
|
|
31
|
+
|
|
32
|
+
// A scene is data: a tree of nodes, then commands placed at times.
|
|
33
|
+
const doc: CompositionDocument = {
|
|
34
|
+
kind: 'composition',
|
|
35
|
+
nodes: [
|
|
36
|
+
{ id: 'card', type: 'rect', parentId: null, layerOrder: 0,
|
|
37
|
+
props: { width: 400, height: 400, fill: 'white', cornerRadius: 20 } },
|
|
38
|
+
{ id: 'lens', type: 'ellipse', parentId: 'card', layerOrder: 0,
|
|
39
|
+
props: { width: 350, height: 350, fill: 'black' } },
|
|
40
|
+
],
|
|
41
|
+
commands: [
|
|
42
|
+
// Slide the lens 300px over 3 seconds.
|
|
43
|
+
{ id: 'slide', type: 'to', targetId: 'lens', at: 0, duration: 3, args: { x: 300 } },
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const engine = await createBrowserEngine();
|
|
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 component registered with the engine
|
|
55
|
+
and named by key (see [Writing a node type](#writing-a-node-type)). Flow layout,
|
|
56
|
+
fills, gradients, filters, WGSL 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`, `migrateDocument` (and `DOCUMENT_FORMAT_VERSION`,
|
|
65
|
+
`DocumentTooNewError`, `migrateNodeProps`) for documents saved by older
|
|
66
|
+
releases, and the `Registry` a document compiles against.
|
|
67
|
+
- **Nodes**: geometry (`Rect`, `Ellipse`, `Path`, `Polygon`,
|
|
68
|
+
`Polygram`, `MaskGroup`, `BooleanGroup`), text (`Text`,
|
|
69
|
+
`RichText`, `NumberNode`), structure (`Canvas2D`, `Canvas3D`, `Camera`), and
|
|
70
|
+
media (`Video`; images are a fill, `Fills.image`). Layout is the `flow` prop,
|
|
71
|
+
through `flowOps`. Each is a component: call it to build one
|
|
72
|
+
(`Rect({ fill: 'red', children: [...] })`).
|
|
73
|
+
- **Components**: the factories `component2d`, `component3d` and
|
|
74
|
+
`componentAudio`, the `Types` a component's state is declared with,
|
|
75
|
+
`commandsFor`, `provides`, and the modules a component spreads in and calls:
|
|
76
|
+
`Paint`, `Flow`, `Shapes`, `Aim`, `Typeface`, `TextLayout`, `Material`,
|
|
77
|
+
`View3D`.
|
|
78
|
+
- **Animation**: commands (`to`, `set`, `variableTo`/`variableSet` and a node
|
|
79
|
+
type's own), each placed at a time, easing (`linear`, `easeIn`,
|
|
80
|
+
`easeOut`, `easeInOut`), and interpolation (`lerpNumber`).
|
|
81
|
+
- **Styling & effects**: `Fills`, `Effects`, `Adjustments`, `VideoAdjustments`,
|
|
82
|
+
`AudioEffects`, plus the `Stroke`/`Shadow`/`Corners` attribute types.
|
|
83
|
+
`ImageFilters` and `VideoFilters` remain as `@deprecated` aliases until the
|
|
84
|
+
next major.
|
|
85
|
+
- **Audio**: the `SoundNode` and `AudioBus` nodes, and `ramp`/`hold` for
|
|
86
|
+
JSON automation of their levels, speed and effects.
|
|
87
|
+
- **Utilities**: `createRef`, `clamp`, `generateList`, `createContext`,
|
|
88
|
+
`Random`.
|
|
89
|
+
- **Component machinery**: `@motionscript/sdk/component`, what a component
|
|
90
|
+
package needs beyond the barrel: number formatting, text defaults, the named
|
|
91
|
+
shape outlines and the orbit-camera lerps. It is a subpath because a scene
|
|
92
|
+
author never needs it.
|
|
93
|
+
|
|
94
|
+
Component kits such as [`@motionscript/code`](https://github.com/motionscript-dev/motionscript/tree/main/packages/components/code) and
|
|
95
|
+
[`@motionscript/math`](https://github.com/motionscript-dev/motionscript/tree/main/packages/components/math) are not bundled here. They are
|
|
96
|
+
built on this package and take it as a peer dependency. Install one as a
|
|
97
|
+
dependency; each kit's `registry.json` names the files a copy of one of its
|
|
98
|
+
components takes. The rules a kit follows are
|
|
99
|
+
in [`packages/components/CLAUDE.md`](https://github.com/motionscript-dev/motionscript/blob/main/packages/components/CLAUDE.md).
|
|
100
|
+
|
|
101
|
+
## What is deliberately not here
|
|
102
|
+
|
|
103
|
+
`Engine`, `Session`, `PlaybackController`, `ClipStore`, `StateEvaluator`,
|
|
104
|
+
`AssetManager`, the platform seams (`Ticker`, `StorageAdapter`) and the render
|
|
105
|
+
backends (`CanvasRenderContext2D`, `NullRenderContext`) are what a host builds;
|
|
106
|
+
import them from `@motionscript/core`. Members prefixed `_` are outside the API.
|
|
107
|
+
|
|
108
|
+
## How the surface is defined
|
|
109
|
+
|
|
110
|
+
The package names no symbol. `.` is `export * from '@motionscript/core/sdk'` and
|
|
111
|
+
`./component` is `export * from '@motionscript/core/component'`. The curated
|
|
112
|
+
lists live in core, in `src/sdk/index.ts` (named exports, no wildcards) and
|
|
113
|
+
`src/component.ts` (eight `export *` lines), so there is one list rather than two
|
|
114
|
+
that drift. A name an author would reasonably reach for is added to core's
|
|
115
|
+
`src/sdk/index.ts`; rebuilding core adds it here with no edit in this package.
|
|
116
|
+
One that only a host or a test needs stays in core. `FillChain` is a class in
|
|
117
|
+
core but exported as a type here: named, never constructed.
|
|
118
|
+
|
|
119
|
+
The types and values resolve through core's built `dist/`, so nothing imports
|
|
120
|
+
until core has been built. `src/tests/sdk-parity.test.ts` in core compares this
|
|
121
|
+
barrel's value names with core's `sdk/index.ts`; it fails when core's `dist/` is
|
|
122
|
+
stale or absent.
|
|
123
|
+
|
|
124
|
+
## Writing a node type
|
|
125
|
+
|
|
126
|
+
A node type is one object handed to a factory. `key` is its document key;
|
|
127
|
+
`state` its entries, plain values or `Types` builders, plus whatever modules it
|
|
128
|
+
spreads in; `commands` what it does on the timeline; `render` what it draws:
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
import { component2d, Graphics2D, Paint, Types } from '@motionscript/sdk';
|
|
132
|
+
import { createBrowserEngine } from '@motionscript/browser';
|
|
133
|
+
|
|
134
|
+
export const Gauge = component2d({
|
|
135
|
+
key: 'gauge',
|
|
136
|
+
state: { ...Paint.state, value: Types.number(0, { min: 0, max: 1 }) },
|
|
137
|
+
commands: { ...Paint.commands, fillUp: { args: ['value'] } },
|
|
138
|
+
render: (ctx, state) => Paint.draw(ctx, state, new Graphics2D().ellipse({
|
|
139
|
+
width: ctx.size.width, height: ctx.size.height, ratio: 0.75, startAngle: -90, sweep: 360 * state.value,
|
|
140
|
+
})),
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const engine = await createBrowserEngine({ nodes: [Gauge] });
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The factory generates the node class, declares its key and writes its entries
|
|
147
|
+
and commands where the registry reads them, so a document can name `gauge`
|
|
148
|
+
once it is handed to an engine. Calling `Gauge({ value: 0.4 })` builds one in
|
|
149
|
+
code, typed by its entries. No decorators and no JSX are needed: a component
|
|
150
|
+
compiles with plain TypeScript. The guide is the
|
|
151
|
+
[custom node docs](https://motionscript.dev/docs/custom-node/introduction).
|
|
152
|
+
|
|
153
|
+
## Loading from a CDN
|
|
154
|
+
|
|
155
|
+
`dist/browser/` holds one ES module per export. Core is a peer, so the modules
|
|
156
|
+
leave `@motionscript/core/sdk` and `/component` as imports, and `dist/browser/manifest.json` maps each
|
|
157
|
+
export to its file and lists core under `peers`. An import map names
|
|
158
|
+
`@motionscript/sdk` (and its subpaths) and `@motionscript/core` (and its
|
|
159
|
+
subpaths) once, and every kit loaded beside them shares both.
|
|
160
|
+
|
|
161
|
+
This package has no rendering backend of its own. Pair it with
|
|
162
|
+
[`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser) (WebGPU), and use
|
|
163
|
+
[`@motionscript/react`](https://github.com/motionscript-dev/motionscript/tree/main/packages/react) to mount a player in a React app. See the
|
|
164
|
+
[docs](https://motionscript.dev/docs) for the full API reference.
|
|
165
|
+
|
|
166
|
+
## Development
|
|
167
|
+
|
|
168
|
+
From the monorepo root:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pnpm --filter @motionscript/sdk build
|
|
172
|
+
pnpm --filter @motionscript/sdk test
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
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": ["/**\
|
|
4
|
+
"sourcesContent": ["/**\n * `@motionscript/sdk/component` — what a component package needs beyond the\n * authoring barrel: number formatting, text defaults, the named shape outlines\n * and the orbit-camera lerps.\n *\n * A subpath, not part of `.`, because a scene author never reaches for it. The\n * curation is `@motionscript/core/component`'s, for the same reason\n * `index.ts` passes through `@motionscript/core/sdk`.\n */\nexport * from \"@motionscript/core/component\";\n"],
|
|
5
5
|
"mappings": "AASA,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\
|
|
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
5
|
"mappings": "AAUA,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,8BAA8B,CAAC","sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,8BAA8B,CAAC","sourcesContent":["/**\n * `@motionscript/sdk/component` — what a component package needs beyond the\n * authoring barrel: number formatting, text defaults, the named shape outlines\n * and the orbit-camera lerps.\n *\n * A subpath, not part of `.`, because a scene author never reaches for it. The\n * curation is `@motionscript/core/component`'s, for the same reason\n * `index.ts` passes through `@motionscript/core/sdk`.\n */\nexport * from \"@motionscript/core/component\";\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":["/**\
|
|
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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motionscript/sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Motion Script authoring surface behind one import: document types, components and their modules, commands, styling, and the machinery component kits build on.",
|
|
6
6
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@motionscript/core": "^0.1.0-alpha.
|
|
45
|
+
"@motionscript/core": "^0.1.0-alpha.9"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^25.6.2",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"typescript": "^6.0.3",
|
|
55
55
|
"typescript-eslint": "^8.48.0",
|
|
56
56
|
"vitest": "^4.1.5",
|
|
57
|
-
"@motionscript/core": "0.1.0-alpha.
|
|
57
|
+
"@motionscript/core": "0.1.0-alpha.9"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "eslint . && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node ../../scripts/build-browser.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAC1E,YAAY,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC"}
|
package/dist/jsx-dev-runtime.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
package/dist/jsx-runtime.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC"}
|
package/dist/jsx-runtime.js
DELETED
package/dist/jsx-runtime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|