@motionscript/layout-grid 0.0.0-stage → 0.1.0-alpha.0
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 +5 -0
- package/LICENSE +201 -0
- package/dist/browser/chunks/chunk-PB3E5HQV.js +2 -0
- package/dist/browser/chunks/chunk-PB3E5HQV.js.map +7 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/kit.js +2 -0
- package/dist/browser/kit.js.map +7 -0
- package/dist/browser/manifest.json +12 -0
- package/dist/engine.d.ts +13 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +13 -0
- package/dist/engine.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/kit/index.d.ts +7 -0
- package/dist/kit/index.d.ts.map +1 -0
- package/dist/kit/index.js +7 -0
- package/dist/kit/index.js.map +1 -0
- package/dist/kit/item-effects.d.ts +37 -0
- package/dist/kit/item-effects.d.ts.map +1 -0
- package/dist/kit/item-effects.js +76 -0
- package/dist/kit/item-effects.js.map +1 -0
- package/dist/kit/layout-grid.d.ts +243 -0
- package/dist/kit/layout-grid.d.ts.map +1 -0
- package/dist/kit/layout-grid.js +542 -0
- package/dist/kit/layout-grid.js.map +1 -0
- package/dist/kit/order.d.ts +13 -0
- package/dist/kit/order.d.ts.map +1 -0
- package/dist/kit/order.js +43 -0
- package/dist/kit/order.js.map +1 -0
- package/dist/kit/random.d.ts +7 -0
- package/dist/kit/random.d.ts.map +1 -0
- package/dist/kit/random.js +29 -0
- package/dist/kit/random.js.map +1 -0
- package/dist/kit/slots/index.d.ts +22 -0
- package/dist/kit/slots/index.d.ts.map +1 -0
- package/dist/kit/slots/index.js +28 -0
- package/dist/kit/slots/index.js.map +1 -0
- package/dist/kit/slots/path-templates.d.ts +15 -0
- package/dist/kit/slots/path-templates.d.ts.map +1 -0
- package/dist/kit/slots/path-templates.js +113 -0
- package/dist/kit/slots/path-templates.js.map +1 -0
- package/dist/kit/slots/path.d.ts +45 -0
- package/dist/kit/slots/path.d.ts.map +1 -0
- package/dist/kit/slots/path.js +87 -0
- package/dist/kit/slots/path.js.map +1 -0
- package/dist/kit/slots/radial.d.ts +30 -0
- package/dist/kit/slots/radial.d.ts.map +1 -0
- package/dist/kit/slots/radial.js +45 -0
- package/dist/kit/slots/radial.js.map +1 -0
- package/dist/kit/slots/rectangular.d.ts +42 -0
- package/dist/kit/slots/rectangular.d.ts.map +1 -0
- package/dist/kit/slots/rectangular.js +79 -0
- package/dist/kit/slots/rectangular.js.map +1 -0
- package/dist/kit/slots/slot.d.ts +62 -0
- package/dist/kit/slots/slot.d.ts.map +1 -0
- package/dist/kit/slots/slot.js +41 -0
- package/dist/kit/slots/slot.js.map +1 -0
- package/dist/kit/slots/sphere.d.ts +36 -0
- package/dist/kit/slots/sphere.d.ts.map +1 -0
- package/dist/kit/slots/sphere.js +68 -0
- package/dist/kit/slots/sphere.js.map +1 -0
- package/dist/kit/stagger.d.ts +24 -0
- package/dist/kit/stagger.d.ts.map +1 -0
- package/dist/kit/stagger.js +90 -0
- package/dist/kit/stagger.js.map +1 -0
- package/dist/nodes.d.ts +15 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +15 -0
- package/dist/nodes.js.map +1 -0
- package/dist/path-grid/index.d.ts +2 -0
- package/dist/path-grid/index.d.ts.map +1 -0
- package/dist/path-grid/index.js +2 -0
- package/dist/path-grid/index.js.map +1 -0
- package/dist/path-grid/path-grid.d.ts +82 -0
- package/dist/path-grid/path-grid.d.ts.map +1 -0
- package/dist/path-grid/path-grid.js +192 -0
- package/dist/path-grid/path-grid.js.map +1 -0
- package/dist/radial-grid/index.d.ts +2 -0
- package/dist/radial-grid/index.d.ts.map +1 -0
- package/dist/radial-grid/index.js +2 -0
- package/dist/radial-grid/index.js.map +1 -0
- package/dist/radial-grid/radial-grid.d.ts +51 -0
- package/dist/radial-grid/radial-grid.d.ts.map +1 -0
- package/dist/radial-grid/radial-grid.js +95 -0
- package/dist/radial-grid/radial-grid.js.map +1 -0
- package/dist/rectangular-grid/index.d.ts +2 -0
- package/dist/rectangular-grid/index.d.ts.map +1 -0
- package/dist/rectangular-grid/index.js +2 -0
- package/dist/rectangular-grid/index.js.map +1 -0
- package/dist/rectangular-grid/rectangular-grid.d.ts +79 -0
- package/dist/rectangular-grid/rectangular-grid.d.ts.map +1 -0
- package/dist/rectangular-grid/rectangular-grid.js +156 -0
- package/dist/rectangular-grid/rectangular-grid.js.map +1 -0
- package/dist/sphere-grid/index.d.ts +2 -0
- package/dist/sphere-grid/index.d.ts.map +1 -0
- package/dist/sphere-grid/index.js +2 -0
- package/dist/sphere-grid/index.js.map +1 -0
- package/dist/sphere-grid/sphere-grid.d.ts +68 -0
- package/dist/sphere-grid/sphere-grid.d.ts.map +1 -0
- package/dist/sphere-grid/sphere-grid.js +149 -0
- package/dist/sphere-grid/sphere-grid.js.map +1 -0
- package/package.json +69 -3
- package/registry.json +32 -0
- package/src/engine.ts +12 -0
- package/src/index.ts +6 -0
- package/src/kit/index.ts +6 -0
- package/src/kit/item-effects.ts +114 -0
- package/src/kit/layout-grid.ts +605 -0
- package/src/kit/order.ts +41 -0
- package/src/kit/random.ts +29 -0
- package/src/kit/slots/index.ts +39 -0
- package/src/kit/slots/path-templates.ts +120 -0
- package/src/kit/slots/path.ts +120 -0
- package/src/kit/slots/radial.ts +62 -0
- package/src/kit/slots/rectangular.ts +108 -0
- package/src/kit/slots/slot.ts +82 -0
- package/src/kit/slots/sphere.ts +94 -0
- package/src/kit/stagger.ts +96 -0
- package/src/nodes.ts +15 -0
- package/src/path-grid/index.ts +1 -0
- package/src/path-grid/path-grid.ts +213 -0
- package/src/radial-grid/index.ts +1 -0
- package/src/radial-grid/radial-grid.ts +90 -0
- package/src/rectangular-grid/index.ts +1 -0
- package/src/rectangular-grid/rectangular-grid.ts +160 -0
- package/src/sphere-grid/index.ts +1 -0
- package/src/sphere-grid/sphere-grid.ts +143 -0
- package/README.md +0 -4
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +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.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{pathOps as et}from"@motionscript/core";function _(n,t,e){return{x:n,y:t,depth:0,rotation:0,rotationX:0,rotationY:0,scale:1,opacity:1,meta:e}}function Q(n,t,e){if(e<=0)return n;if(e>=1)return t;let o=(s,r)=>s+(r-s)*e;return{x:o(n.x,t.x),y:o(n.y,t.y),depth:o(n.depth,t.depth),rotation:o(n.rotation,t.rotation),rotationX:o(n.rotationX,t.rotationX),rotationY:o(n.rotationY,t.rotationY),scale:o(n.scale,t.scale),opacity:o(n.opacity,t.opacity),meta:e<.5?n.meta:t.meta}}function V(n,t){return t===1?n:{...n,x:n.x*t,y:n.y*t,depth:n.depth*t}}function tt(n){let t=0,e=0;for(let o of n)o.width>t&&(t=o.width),o.height>e&&(e=o.height);return{width:t,height:e}}var Zt=["distribute","fixed"],R=new Map,St=32;function kt(n){let t=R.get(n);if(t)return t;let e=et.contours(n),o={sampler:et.sampler(n),closed:e.length===1&&e[0].closed};return R.size>=St&&R.delete(R.keys().next().value),R.set(n,o),o}function nt(n,t){let{count:e}=t;if(e===0)return[];let{sampler:o,closed:s}=kt(n.path),r=o.length,a=z(Math.min(n.trimStart,n.trimEnd)),i=z(Math.max(n.trimStart,n.trimEnd)),c=a*r,l=(i-a)*r,d=s&&a===0&&i===1,h=n.offset+n.flowSpeed*t.time,u=n.placement,x=u.rotation*Math.PI/180,S=Math.cos(x),I=Math.sin(x),y=[];for(let k=0;k<e;k++){let m;n.spacing==="fixed"&&l>0?m=h+k*n.spacingDistance/l:d?m=h+k/e:m=h+(e===1?.5:k/(e-1));let b=!0;d?m=m-Math.floor(m):(m<-1e-9||m>1+1e-9)&&(b=!1);let g=o.frameAt(c+z(m)*l);if(!g){let X=_(0,0,{kind:"path",t:z(m)});X.opacity=0,y.push(X);continue}let P=u.flipY?-1:1,T=(g.x-u.originX)*u.scale,v=(g.y-u.originY)*u.scale*P,C=_(u.x+T*S+v*I,u.y-T*I+v*S,{kind:"path",t:z(m)});n.alignToPath&&(C.rotation=-Math.atan2(g.ty*P,g.tx)*180/Math.PI+u.rotation),b||(C.opacity=0),y.push(C)}return y}function z(n){return n<0?0:n>1?1:n}var Qt=["clockwise","counterclockwise"];function ot(n,t,e){let o=n.sweep,s=Math.min(1,Math.abs(o)/360)**8,r=t<=1?0:o/(t-1+s),a=n.direction==="counterclockwise"?-1:1,i=n.startAngle+n.spinSpeed*e,c=[];for(let l=0;l<t;l++)c.push(i+a*l*r);return c}function st(n,t){let e=ot(n,t.count,t.time),o=e[0]??0;return e.map(s=>{let r=s*Math.PI/180,a=_(n.radius*Math.sin(r),n.radius*Math.cos(r),{kind:"radial",angle:Math.abs(s-o)});return n.rotateItems&&(a.rotation=s),a})}function te(n,t,e){let o=ot({...n,spinSpeed:0},t,0)[e]??n.startAngle;return-It(o)}function It(n){let t=(n%360+360)%360;return t>180?t-360:t}var oe=["row","column"],se=["fit","fixed","fill"],re=["start","center","end"];function rt(n,t){let e=Math.max(1,Math.round(n.columns)),o=Math.max(1,Math.ceil(t/e));return n.fillDirection==="column"?{rows:o,columns:Math.max(1,Math.ceil(t/o))}:{rows:o,columns:e}}function At(n,t,e,o){let{rows:s,columns:r}=rt(n,t);switch(n.cellMode){case"fixed":return{width:Math.max(0,n.cellWidth),height:Math.max(0,n.cellHeight)};case"fill":return{width:Math.max(0,(o.width-n.columnGap*(r-1))/r),height:Math.max(0,(o.height-n.rowGap*(s-1))/s)};default:return tt(e)}}function at(n,t){let{count:e}=t;if(e===0)return[];let{rows:o,columns:s}=rt(n,e),r=n.fillDirection==="column",a=r?s:o,i=r?o:s,c=At(n,e,t.sizes,t.box),l=c.width+n.columnGap,d=c.height+n.rowGap,h=a-1,u=e-h*i,x=i-u,S=n.lastLineAlign==="center"?x/2:n.lastLineAlign==="end"?x:0,I=n.rowOffset*l,y=n.columnOffset*d,k=[];for(let m=0;m<e;m++){let b=Math.floor(m/i),g=m%i;b===h&&(g+=S);let P=r?g:b,T=r?b:g,v=Math.round(P),C=Math.round(T),X=(T-(s-1)/2)*l+(v%2===1?I:0)-(o>1?I/2:0),wt=((o-1)/2-P)*d-(C%2===1?y:0)+(s>1?y/2:0);k.push(_(X,wt,{kind:"rectangular",row:v,column:C}))}return k}var ce=["outward","billboard"],le=["x","y","z"],Ot=Math.PI*(3-Math.sqrt(5)),w=180/Math.PI;function it(n,t){if(t<=1)return[0,0,1];let e=1-2*(n+.5)/t,o=Math.sqrt(Math.max(0,1-e*e)),s=n*Ot;return[Math.cos(s)*o,e,Math.sin(s)*o]}function Et(n,t,e,o){let[s,r,a]=n,i=t/w,c=e/w,l=o/w,d=s*Math.cos(i)+a*Math.sin(i),h=-s*Math.sin(i)+a*Math.cos(i),u=r*Math.cos(c)-h*Math.sin(c),x=r*Math.sin(c)+h*Math.cos(c);return[d*Math.cos(l)+u*Math.sin(l),-d*Math.sin(l)+u*Math.cos(l),x]}function ct(n,t){let{count:e}=t,o=n.radius,s=n.yaw+n.spinSpeed*t.time,r=n.facing==="outward",a=[];for(let i=0;i<e;i++){let c=it(i,e),[l,d,h]=Et(c,s,n.pitch,n.roll),u=_(l*o,d*o,{kind:"sphere",lat:Math.asin(Math.max(-1,Math.min(1,c[1])))*w,lon:Math.atan2(c[2],c[0])*w,depth:h});u.depth=h*o,r&&(u.rotationY=Math.asin(Math.max(-1,Math.min(1,l)))*w,u.rotationX=Math.atan2(d,h)*w),u.opacity=1-n.depthFade*(1-(h+1)/2),r&&n.cullBackfaces&&bt(u,[l,d,h],n.focalLength)&&(u.opacity=0),a.push(u)}return a}function bt(n,t,e){return e<=0?t[2]<0:t[0]*-n.x+t[1]*-n.y+t[2]*(e-n.depth)<0}function he(n,t){let[e,o,s]=it(t,n);return{yaw:-Math.atan2(e,s)*w,pitch:Math.atan2(o,Math.hypot(e,s))*w}}var de=["circle","square","star","heart","infinity","wave","spiral","arc","line"];var G=new Map,Ct=64;function fe(n,t){let e=`${n}:${Math.round(t.width*100)}:${Math.round(t.height*100)}`,o=G.get(e);if(o)return o;let s=Lt(n,t);return G.size>=Ct&&G.delete(G.keys().next().value),G.set(e,s),s}function Lt(n,t){let e=t.width>0?t.width:400,o=t.height>0?t.height:400,s=e/2,r=o/2;switch(n){case"square":return B([[-s,r],[s,r],[s,-r],[-s,-r]]);case"star":{let a=[];for(let i=0;i<10;i++){let c=i*Math.PI/5,l=i%2===0?1:.45;a.push([Math.sin(c)*s*l,Math.cos(c)*r*l])}return B(a)}case"heart":return B(N(96,a=>{let i=a*2*Math.PI,c=16*Math.sin(i)**3,l=13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i);return[c/17*s,(l+2.5)/15.5*r]}).slice(0,-1));case"infinity":return B(N(96,a=>{let i=a*2*Math.PI,c=1+Math.sin(i)**2;return[Math.cos(i)/c*s,Math.sin(i)*Math.cos(i)/c*r*2]}).slice(0,-1));case"wave":return H(N(96,a=>[(-1+2*a)*s,Math.sin(a*4*Math.PI)*r*.6]));case"spiral":return H(N(160,a=>{let i=a*3*2*Math.PI,c=.08+.92*a;return[Math.sin(i)*s*c,Math.cos(i)*r*c]}));case"arc":return H(N(64,a=>{let i=-Math.PI/2+a*Math.PI;return[Math.sin(i)*s,-r+Math.cos(i)*o]}));case"line":return[{type:"M",x:-s,y:0},{type:"L",x:s,y:0}];default:return Pt(s,r)}}function Pt(n,t){let e=.5522847498;return[{type:"M",x:0,y:t},{type:"C",x1:e*n,y1:t,x2:n,y2:e*t,x:n,y:0},{type:"C",x1:n,y1:-e*t,x2:e*n,y2:-t,x:0,y:-t},{type:"C",x1:-e*n,y1:-t,x2:-n,y2:-e*t,x:-n,y:0},{type:"C",x1:-n,y1:e*t,x2:-e*n,y2:t,x:0,y:t},{type:"Z"}]}function N(n,t){let e=[];for(let o=0;o<=n;o++)e.push(t(o/n));return e}function H(n){return n.map(([t,e],o)=>o===0?{type:"M",x:t,y:e}:{type:"L",x:t,y:e})}function B(n){return[...H(n),{type:"Z"}]}function K(n,t){switch(n.kind){case"rectangular":return at(n,t);case"radial":return st(n,t);case"path":return nt(n,t);case"sphere":return ct(n,t)}}function $(n){return n.kind==="sphere"?Math.max(1,n.focalLength):0}function Tt(n){let t=Math.floor(n)>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function W(n,t){let e=[...n],o=Tt(t);for(let s=e.length-1;s>0;s--){let r=Math.floor(o()*(s+1));[e[s],e[r]]=[e[r],e[s]]}return e}function lt(n){let t=2166136261;for(let e=0;e<n.length;e++)t=Math.imul(t^n.charCodeAt(e),16777619);return t>>>0}var ht=["index","reverse","random","centerOut","edgesIn","row","column","angle","path","depth"],vt=.95;function ut(n,t,e){let o=t.length,s=Rt(n,t,e),r=1/0,a=-1/0;for(let c of s)c<r&&(r=c),c>a&&(a=c);let i=a-r;return i>1e-9?s.map(c=>(c-r)/i):new Array(o).fill(0)}function D(n,t,e){let o=Math.max(0,Math.min(vt,e)),s=o===0?t:(t-n*o)/(1-o);return s<0?0:s>1?1:s}function Rt(n,t,e){switch(n){case"reverse":return t.map((o,s)=>-s);case"random":{let o=W(t.map((r,a)=>a),e),s=new Array(t.length);return o.forEach((r,a)=>{s[r]=a}),s}case"centerOut":return t.map(o=>Math.round(Math.hypot(o.x,o.y,o.depth)*1e3)/1e3);case"edgesIn":return t.map(o=>-Math.round(Math.hypot(o.x,o.y,o.depth)*1e3)/1e3);case"row":return t.map(o=>o.meta.kind==="rectangular"?o.meta.row:-Math.round(o.y));case"column":return t.map(o=>o.meta.kind==="rectangular"?o.meta.column:Math.round(o.x));case"angle":return t.map((o,s)=>o.meta.kind==="radial"?o.meta.angle:o.meta.kind==="rectangular"||o.meta.kind==="sphere"?zt(o):s);case"path":return t.map((o,s)=>o.meta.kind==="path"?o.meta.t:s);case"depth":return t.map((o,s)=>o.meta.kind==="sphere"?-o.meta.depth:s);default:return t.map((o,s)=>s)}}function zt(n){let t=Math.atan2(n.x,n.y)*180/Math.PI;return t<0?t+360:t}var Z=["scale","fade","center","rise","flip","spin"],dt=["scale","lift","fade","spin"];function ft(n,t,e,o,s,r){o&&Gt(n,o.style,o.values[t]??1,e),s&&Nt(n,s,s.values[t]??0,e),r&&Dt(n,r,r.values[t]??0)}function Gt(n,t,e,o){if(e===1)return;let s=q(e);switch(t){case"fade":n.opacity*=s;break;case"center":n.x*=e,n.y*=e,n.depth*=e,n.opacity*=q(e*4);break;case"rise":n.y-=(1-e)*Math.max(40,o.height),n.opacity*=s;break;case"flip":n.rotationX+=(1-e)*90;break;case"spin":n.rotation-=(1-e)*180,n.scale*=Math.max(0,e);break;default:n.scale*=Math.max(0,e)}}function Nt(n,t,e,o){if(e!==0)switch(t.style){case"lift":n.y+=t.amount*e*Math.max(40,o.height);break;case"fade":n.opacity*=q(1-t.amount*e);break;case"spin":n.rotation+=t.amount*e*360;break;default:n.scale*=1+t.amount*e}}function Dt(n,t,e){if(e!==0){if(e>0){n.scale*=1+t.grow*e;return}n.opacity*=q(1-t.dim*-e),n.scale*=Math.max(0,1+t.grow*.5*e)}}function q(n){return n<0?0:n>1?1:n}function A(n,t){let e=[],o=new Array(t).fill(!1);for(let s of n??[]){let r=Math.round(s);r>=0&&r<t&&!o[r]&&(o[r]=!0,e.push(r))}for(let s=0;s<t;s++)o[s]||e.push(s);return e}function U(n){let t=new Array(n.length);return n.forEach((e,o)=>{t[e]=o}),t}function pt(n){return Array.isArray(n)?n.map(Number).filter(Number.isFinite):typeof n!="string"?[]:n.split(/[\s,]+/).filter(t=>t!=="").map(Number).filter(Number.isFinite)}import{command as M,easeIn as Yt,easeInOut as Y,easeOut as mt,flowOps as F,insetsOps as xt,Node2D as Ft,property as O,sizeInputOps as yt}from"@motionscript/core";var p=function(n,t,e,o){var s=arguments.length,r=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,t,e,o);else for(var i=n.length-1;i>=0;i--)(a=n[i])&&(r=(s<3?a(r):s>3?a(t,e,r):a(t,e))||r);return s>3&&r&&Object.defineProperty(t,e,r),r};function E(n){return[{key:"staggerOrder",kind:"enum",options:ht,default:"index"},{key:"stagger",min:0,max:.95,step:.05,default:n}]}var Mt=["rectangularGrid","radialGrid","pathGrid","sphereGrid"],j=.3,Xt={width:0,height:0},Bt={x:0,y:0},f=class n extends Ft{reveal(t){let e=t.data?.style??"scale",o=t.easing??(e==="scale"||e==="flip"?mt("back"):mt("cubic")),s=this._ranks(t.data?.staggerOrder),r=t.data?.stagger??.5;return this.command(a=>a>=1?{revealState:null}:{revealState:{style:e,values:s.map(i=>o(D(i,a,r)))}},t.duration)}conceal(t){let e=t.data?.style??"scale",o=t.easing??(e==="scale"||e==="flip"?Yt("back"):Y("cubic")),s=this._ranks(t.data?.staggerOrder),r=t.data?.stagger??.5,a=this.revealState?.values;return this.command(i=>({revealState:{style:e,values:s.map((c,l)=>(a?.[l]??1)*(1-o(D(c,i,r))))}}),t.duration)}wave(t){let e=t.data?.style??"scale",o=t.data?.amount??.3,s=t.easing??Y("sine"),r=this._ranks(t.data?.staggerOrder),a=t.data?.stagger??.7;return this.command(i=>i>=1?{waveState:null}:{waveState:{style:e,amount:o,values:r.map(c=>Math.sin(Math.PI*s(D(c,i,a))))}},t.duration)}focus(t){let e=this._itemCount(),o=Math.round(t.data?.item??0);return this._focusOn(s=>s===o,e,t)}unfocus(t){let e=this.focusState,o=t.easing??Y("cubic");return this.command(s=>{if(s>=1||!e)return{focusState:null};let r=1-o(s);return{focusState:{...e,values:e.values.map(a=>a*r)}}},t.duration)}spreadTo(t){return this.to({data:{spread:t.data?.spread??1},duration:t.duration,easing:t.easing})}shuffle(t){let e=A(this.order,this._itemCount()),o=W(e,t.data?.seed??1);return o.length>1&&o.every((s,r)=>s===e[r])&&(o=[...o.slice(1),o[0]]),this._transitionTo({order:o},t)}swap(t){let e=A(this.order,this._itemCount()),o=e.indexOf(Math.round(t.data?.first??0)),s=e.indexOf(Math.round(t.data?.second??1));return o>=0&&s>=0&&([e[o],e[s]]=[e[s],e[o]]),this._transitionTo({order:e},t,0)}reorder(t){let e=A(pt(t.data?.order),this._itemCount());return this._transitionTo({order:e},t)}morphInto(t){return this._transitionTo({arrangeLike:t.data?.target??""},t)}applyDefaultSize(t){(!t||t.width===void 0)&&this.applyProp("width","hug",{tween:yt.lerp}),(!t||t.height===void 0)&&this.applyProp("height","hug",{tween:yt.lerp})}itemSpace(t,e,o){return e}measure(t,e){this.lastMeasure={constraints:t,measurer:e};let o=this.effectivePadding(),s=this.flowChildren();if(s.length===0)return this._measured=null,F.size(this,t,o,Xt);let r=F.contentBox(this,t,o),a=this._measureItems(s,r,e);return this._measured={space:r,sizes:a},F.size(this,t,o,Ht(this._targetSlots(s.length,a,r).slots,a,this._focal))}layoutChildren(t,e){this._placements.clear();let o=this.flowChildren();if(o.length===0){this._slots=[],this._sizes=[],this._focal=0;return}let s=xt.insetBounds(t.width,t.height,this.effectivePadding()),r=this._measured;this._measured=null;let a=r&&r.sizes.length===o.length&&Wt(r.space,s)?r.sizes:this._measureItems(o,s,e),i=this._resolve(a,s);this._slots=i,this._sizes=a;for(let c=0;c<o.length;c++){let l=i[c];o[c].layout({x:s.x+l.x,y:s.y-l.y,width:a[c].width,height:a[c].height},e),(l.rotation!==0||l.scale!==1||l.rotationX!==0||l.rotationY!==0||l.depth!==0||l.opacity!==1)&&this._placements.set(o[c],{rotation:l.rotation,scale:l.scale,rotationX:l.rotationX,rotationY:l.rotationY,depth:l.depth,opacity:l.opacity})}}_placementOf(t){return this._placements.get(t)??null}_spaceCamera(){let t=this._focal;return t<=0||this._inSpace()?null:{perspective:t,orbit:0,elevation:0,dolly:0,lookAt:Bt,zoom:1,heading:0,viewportX:0,viewportY:0}}_placements=new Map;_measured=null;_slots=[];_sizes=[];_focal=0;_borrowCache=null;_itemCount(){return this.flowChildren().length}_itemSlots(){let t=this._itemCount();if(this._slots.length===t)return this._slots;let e=new Array(t).fill({width:100,height:100});return this._targetSlots(t,e,L(this)).slots}_itemSizes(){return this._sizes.length===this._itemCount()?this._sizes:[]}_ranks(t){return ut(t??"index",this._itemSlots(),lt(this.id))}_transitionTo(t,e,o=j){let s=this._snapshot(),r=e.easing??Y("cubic"),a=this._ranks(e.data?.staggerOrder),i=e.data?.stagger??o;return this.command(c=>{if(c>=1)return{...t,transition:null};let l=a.map(d=>r(D(d,c,i)));return{...t,transition:{from:s,mix:l}}},e.duration)}_focusOn(t,e,o){let s=this.focusState,r=o.data?.dim??.7,a=o.data?.grow??.15,i=Array.from({length:e},(l,d)=>t(d)?1:-1),c=o.easing??Y("cubic");return this.command(l=>{let d=c(l);return{focusState:{dim:J(s?.dim??r,r,d),grow:J(s?.grow??a,a,d),values:i.map((h,u)=>J(s?.values[u]??0,h,d))}}},o.duration)}_snapshot(){let t=this._borrowed();return{arrangement:t?t.arrangementFor(L(t)):this.arrangementFor(L(this)),source:t?.id??"",order:A(this.order,this._itemCount()),spread:this.spread}}_measureItems(t,e,o){let s=F.measure({},t,e,o).sizes,r=this.itemSpace(t.length,e,s);return r===e?[...s]:[...F.measure({},t,r,o).sizes]}_targetSlots(t,e,o){let s=this._borrowed(),r=s?s.arrangementFor(L(s)):this.arrangementFor(o),a=K(r,{count:t,sizes:e,box:s?L(s):o,time:this.time.total});return s&&(a=this._fromGrid(s,a)),{slots:U(A(this.order,t)).map(c=>V(a[c],this.spread)),arrangement:r}}_resolve(t,e){let o=t.length,s=this._targetSlots(o,t,e),r=s.slots,a=$(s.arrangement),i=this.transition;if(i){let{from:h}=i,u=h.source?this._gridById(h.source):null,x=u?L(u):e,S=K(h.arrangement,{count:o,sizes:t,box:x,time:this.time.total});u&&u!==this&&(S=this._fromGrid(u,S));let I=U(A(h.order,o));for(let y=0;y<o;y++)r[y]=Q(V(S[I[y]],h.spread),r[y],i.mix[y]??1);a=a||$(h.arrangement)}this._focal=a;let c=this.revealState,l=this.waveState,d=this.focusState;if(c||l||d)for(let h=0;h<o;h++)ft(r[h],h,t[h],c,l,d);return r}_inSpace(){for(let t=this.parent;t;t=t.parent){if(t._spaceCamera())return!0;if(!t._rendersChildrenInSpace())return!1}return!1}_borrowed(){let t=this.arrangeLike;return!t||t===this.id?null:this._gridById(t)}_gridById(t){if(t===this.id)return this;let e=this._borrowCache;if(e&&e.id===t&&e.grid.mounted)return e.grid;let o=qt(this,t),s=o instanceof n?o:null;return this._borrowCache=s?{id:t,grid:s}:null,s}_fromGrid(t,e){let o=jt(this,t);return e.map(s=>{let r=gt(s.x*o.scale,s.y*o.scale,o.rotation);return{...s,x:o.x+r.x,y:o.y+r.y,depth:s.depth*o.scale,rotation:s.rotation+o.rotation,scale:s.scale*o.scale}})}};p([O({default:[],kind:"order",animatable:!1})],f.prototype,"order",void 0);p([O({default:1,min:0,max:3,step:.05})],f.prototype,"spread",void 0);p([O({default:"",kind:"nodeRef",nodeTypes:Mt,animatable:!1})],f.prototype,"arrangeLike",void 0);p([O({default:void 0,kind:"state",animatable:!1})],f.prototype,"revealState",void 0);p([O({default:void 0,kind:"state",animatable:!1})],f.prototype,"waveState",void 0);p([O({default:void 0,kind:"state",animatable:!1})],f.prototype,"focusState",void 0);p([O({default:void 0,kind:"state",animatable:!1})],f.prototype,"transition",void 0);p([M({args:[{key:"style",kind:"enum",options:Z,default:"scale"},...E(.5)]})],f.prototype,"reveal",null);p([M({args:[{key:"style",kind:"enum",options:Z,default:"scale"},...E(.5)]})],f.prototype,"conceal",null);p([M({args:[{key:"style",kind:"enum",options:dt,default:"scale"},{key:"amount",min:0,max:2,step:.05,default:.3},...E(.7)]})],f.prototype,"wave",null);p([M({args:[{key:"item",min:0,step:1,default:0},{key:"dim",min:0,max:1,step:.05,default:.7},{key:"grow",min:0,max:1,step:.05,default:.15}]})],f.prototype,"focus",null);p([M()],f.prototype,"unfocus",null);p([M({args:[{key:"spread",min:0,max:3,step:.05,default:1}]})],f.prototype,"spreadTo",null);p([M({args:[{key:"seed",min:0,step:1,default:1},...E(j)]})],f.prototype,"shuffle",null);p([M({args:[{key:"first",min:0,step:1,default:0},{key:"second",min:0,step:1,default:1},...E(0)]})],f.prototype,"swap",null);p([M({args:[{key:"order",kind:"text",default:""},...E(j)]})],f.prototype,"reorder",null);p([M({args:[{key:"target",kind:"nodeRef",nodeTypes:Mt},...E(j)]})],f.prototype,"morphInto",null);function L(n){let t=n.layoutBounds,e=xt.insetBounds(t.width,t.height,n.effectivePadding());return{width:e.width,height:e.height}}function Ht(n,t,e){let o=0,s=0;for(let r=0;r<n.length;r++){let a=n[r],i=t[r],c=a.rotation*Math.PI/180,l=Math.abs(Math.cos(c)),d=Math.abs(Math.sin(c)),h=e>0&&e-a.depth>1?e/(e-a.depth):1,u=(i.width*l+i.height*d)/2*a.scale*h,x=(i.width*d+i.height*l)/2*a.scale*h;o=Math.max(o,Math.abs(a.x)*h+u),s=Math.max(s,Math.abs(a.y)*h+x)}return{width:o*2,height:s*2}}function gt(n,t,e){if(e===0)return{x:n,y:t};let o=e*Math.PI/180,s=Math.cos(o),r=Math.sin(o);return{x:n*s+t*r,y:-n*r+t*s}}function Wt(n,t){return Math.abs(n.width-t.width)<1e-6&&Math.abs(n.height-t.height)<1e-6}function J(n,t,e){return n+(t-n)*e}function qt(n,t){let e=n;for(;e.parent;)e=e.parent;return _t(e,t)}function _t(n,t){if(n.id===t)return n;for(let e of n.children){let o=_t(e,t);if(o)return o}return null}function jt(n,t){let e=t.global,o=n.global,s=o.scale===0?0:1/o.scale,r=gt((e.x-o.x)*s,(e.y-o.y)*s,-o.rotation);return{x:r.x,y:r.y,rotation:e.rotation-o.rotation,scale:e.scale*s}}export{_ as a,Q as b,V as c,tt as d,Zt as e,nt as f,Qt as g,ot as h,st as i,te as j,It as k,oe as l,se as m,re as n,rt as o,At as p,at as q,ce as r,le as s,it as t,Et as u,ct as v,he as w,de as x,fe as y,K as z,$ as A,Tt as B,W as C,lt as D,ht as E,ut as F,D as G,Z as H,dt as I,ft as J,A as K,U as L,pt as M,E as N,Mt as O,j as P,f as Q,L as R,qt as S,jt as T};
|
|
2
|
+
//# sourceMappingURL=chunk-PB3E5HQV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/kit/slots/path.ts", "../../../src/kit/slots/slot.ts", "../../../src/kit/slots/radial.ts", "../../../src/kit/slots/rectangular.ts", "../../../src/kit/slots/sphere.ts", "../../../src/kit/slots/path-templates.ts", "../../../src/kit/slots/index.ts", "../../../src/kit/random.ts", "../../../src/kit/stagger.ts", "../../../src/kit/item-effects.ts", "../../../src/kit/order.ts", "../../../src/kit/layout-grid.ts"],
|
|
4
|
+
"sourcesContent": ["import { pathOps, type PathData, type PathSampler } from \"@motionscript/core\"\n\nimport { slot, type Slot, type SlotInput } from \"./slot\"\n\n/** `distribute` spreads the items over the path; `fixed` sets them a distance apart. */\nexport const PATH_SPACINGS = [\"distribute\", \"fixed\"] as const\nexport type PathSpacing = (typeof PATH_SPACINGS)[number]\n\n/** How path coordinates land in the grid's frame: `origin` of the path goes to `(x, y)`, turned and scaled. */\nexport interface PathPlacement {\n originX: number\n originY: number\n /** The path is y-down, as SVG and the editor write one. */\n flipY?: boolean\n x: number\n y: number\n /** Degrees clockwise. */\n rotation: number\n scale: number\n}\n\nexport interface PathArrangement {\n kind: \"path\"\n /** y-up, like every path in the library, unless its placement says otherwise. */\n path: PathData\n placement: PathPlacement\n spacing: PathSpacing\n /** Pixels between items when `spacing` is `fixed`. */\n spacingDistance: number\n /** Share of the path the items are moved along; wraps on a closed path. */\n offset: number\n /** Share of the path per second the items travel on their own. */\n flowSpeed: number\n trimStart: number\n trimEnd: number\n /** Turn each item to follow the path's direction. */\n alignToPath: boolean\n}\n\nconst SAMPLERS = new Map<PathData, { sampler: PathSampler; closed: boolean }>()\nconst SAMPLER_CACHE = 32\n\n/** A sampler for `path`, kept while the same value keeps arriving — a path is re-read every frame. */\nfunction measured(path: PathData): { sampler: PathSampler; closed: boolean } {\n const hit = SAMPLERS.get(path)\n if (hit) return hit\n const contours = pathOps.contours(path)\n const entry = {\n sampler: pathOps.sampler(path),\n closed: contours.length === 1 && contours[0].closed,\n }\n if (SAMPLERS.size >= SAMPLER_CACHE) SAMPLERS.delete(SAMPLERS.keys().next().value!)\n SAMPLERS.set(path, entry)\n return entry\n}\n\n/**\n * Items at even arc-length steps — by distance along the curve rather than the\n * path's own parameter, which bunches them up wherever a curve is tight.\n *\n * On a closed path used whole, `n` items take `n` equal steps and `offset`\n * wraps round, so an animated offset is a loop. Anywhere else the ends are\n * ends: `n` items take `n - 1` steps so both get one, and an item moved past\n * either is hidden rather than piled on it.\n */\nexport function pathSlots(arrangement: PathArrangement, input: SlotInput): Slot[] {\n const { count } = input\n if (count === 0) return []\n const { sampler, closed } = measured(arrangement.path)\n const length = sampler.length\n const a = clamp01(Math.min(arrangement.trimStart, arrangement.trimEnd))\n const b = clamp01(Math.max(arrangement.trimStart, arrangement.trimEnd))\n const start = a * length\n const span = (b - a) * length\n const loops = closed && a === 0 && b === 1\n const offset = arrangement.offset + arrangement.flowSpeed * input.time\n const place = arrangement.placement\n const rad = (place.rotation * Math.PI) / 180\n const cos = Math.cos(rad)\n const sin = Math.sin(rad)\n\n const slots: Slot[] = []\n for (let k = 0; k < count; k++) {\n let u: number\n if (arrangement.spacing === \"fixed\" && span > 0) {\n u = offset + (k * arrangement.spacingDistance) / span\n } else if (loops) {\n u = offset + k / count\n } else {\n u = offset + (count === 1 ? 0.5 : k / (count - 1))\n }\n let visible = true\n if (loops) u = u - Math.floor(u)\n else if (u < -1e-9 || u > 1 + 1e-9) visible = false\n const at = sampler.frameAt(start + clamp01(u) * span)\n if (!at) {\n const s = slot(0, 0, { kind: \"path\", t: clamp01(u) })\n s.opacity = 0\n slots.push(s)\n continue\n }\n // Into the grid's frame: about the path's origin, turned clockwise (y-up).\n const flip = place.flipY ? -1 : 1\n const px = (at.x - place.originX) * place.scale\n const py = (at.y - place.originY) * place.scale * flip\n const s = slot(\n place.x + px * cos + py * sin,\n place.y - px * sin + py * cos,\n { kind: \"path\", t: clamp01(u) },\n )\n if (arrangement.alignToPath) s.rotation = (-Math.atan2(at.ty * flip, at.tx) * 180) / Math.PI + place.rotation\n if (!visible) s.opacity = 0\n slots.push(s)\n }\n return slots\n}\n\nfunction clamp01(v: number): number {\n return v < 0 ? 0 : v > 1 ? 1 : v\n}\n", "import type { Size2D } from \"@motionscript/core\"\n\n/**\n * One place in an arrangement, in the grid's own frame: centred on it, y-up,\n * `depth` toward the viewer.\n *\n * Pure data, and the whole of what an arrangement produces — which is what lets\n * a morph blend any two of them item by item, whatever shapes they came from.\n */\nexport interface Slot {\n x: number\n y: number\n depth: number\n /** Degrees clockwise. */\n rotation: number\n /** Tilt, degrees, as a node's own `rotationX`/`rotationY`. */\n rotationX: number\n rotationY: number\n scale: number\n opacity: number\n meta: SlotMeta\n}\n\n/** What kind of place a slot is — the orderings a stagger can follow. */\nexport type SlotMeta =\n | { kind: \"rectangular\"; row: number; column: number }\n /** Degrees clockwise from the arrangement's first slot. */\n | { kind: \"radial\"; angle: number }\n /** `0..1` along the part of the path in use. */\n | { kind: \"path\"; t: number }\n /** `depth` is `-1` at the back of the sphere and `1` at the front. */\n | { kind: \"sphere\"; lat: number; lon: number; depth: number }\n\n/** What an arrangement is laid out for. */\nexport interface SlotInput {\n count: number\n /** Each item's measured size, in item order. */\n sizes: readonly Size2D[]\n /** The grid's content box. */\n box: Size2D\n /** Scene seconds, for arrangements that move on their own. */\n time: number\n}\n\nexport function slot(x: number, y: number, meta: SlotMeta): Slot {\n return { x, y, depth: 0, rotation: 0, rotationX: 0, rotationY: 0, scale: 1, opacity: 1, meta }\n}\n\n/** `a` toward `b`. The meta switches halfway, since an ordering cannot be half one thing. */\nexport function blendSlot(a: Slot, b: Slot, t: number): Slot {\n if (t <= 0) return a\n if (t >= 1) return b\n const mix = (p: number, q: number) => p + (q - p) * t\n return {\n x: mix(a.x, b.x),\n y: mix(a.y, b.y),\n depth: mix(a.depth, b.depth),\n rotation: mix(a.rotation, b.rotation),\n rotationX: mix(a.rotationX, b.rotationX),\n rotationY: mix(a.rotationY, b.rotationY),\n scale: mix(a.scale, b.scale),\n opacity: mix(a.opacity, b.opacity),\n meta: t < 0.5 ? a.meta : b.meta,\n }\n}\n\n/** Push `s` away from (or pull it toward) the grid's centre. */\nexport function spreadSlot(s: Slot, spread: number): Slot {\n if (spread === 1) return s\n return { ...s, x: s.x * spread, y: s.y * spread, depth: s.depth * spread }\n}\n\n/** Largest width and height among `sizes`. */\nexport function largest(sizes: readonly Size2D[]): Size2D {\n let width = 0\n let height = 0\n for (const size of sizes) {\n if (size.width > width) width = size.width\n if (size.height > height) height = size.height\n }\n return { width, height }\n}\n", "import { slot, type Slot, type SlotInput } from \"./slot\"\n\nexport const RADIAL_DIRECTIONS = [\"clockwise\", \"counterclockwise\"] as const\nexport type RadialDirection = (typeof RADIAL_DIRECTIONS)[number]\n\nexport interface RadialArrangement {\n kind: \"radial\"\n radius: number\n /** Where the first item sits, degrees clockwise from twelve o'clock. */\n startAngle: number\n /** How much of the circle the items span, degrees. */\n sweep: number\n direction: RadialDirection\n /** Turn each item so its top faces away from the centre. */\n rotateItems: boolean\n /** Degrees per second the ring turns on its own. */\n spinSpeed: number\n}\n\n/**\n * The angle of each of `count` slots, clockwise from twelve o'clock. A full\n * circle divides by the count, so the last item does not land on the first; an\n * arc divides by one less, so both ends get an item. In between the divisor\n * slides from one to the other as the arc closes — steeply, so an arc is an arc\n * until it is nearly whole, and a sweep animated to 360 lands without a jump.\n */\nexport function radialAngles(arrangement: RadialArrangement, count: number, time: number): number[] {\n const sweep = arrangement.sweep\n const closing = Math.min(1, Math.abs(sweep) / 360) ** 8\n const step = count <= 1 ? 0 : sweep / (count - 1 + closing)\n const sign = arrangement.direction === \"counterclockwise\" ? -1 : 1\n const start = arrangement.startAngle + arrangement.spinSpeed * time\n const angles: number[] = []\n for (let k = 0; k < count; k++) angles.push(start + sign * k * step)\n return angles\n}\n\nexport function radialSlots(arrangement: RadialArrangement, input: SlotInput): Slot[] {\n const angles = radialAngles(arrangement, input.count, input.time)\n const start = angles[0] ?? 0\n return angles.map((angle) => {\n const rad = (angle * Math.PI) / 180\n const s = slot(arrangement.radius * Math.sin(rad), arrangement.radius * Math.cos(rad), {\n kind: \"radial\",\n angle: Math.abs(angle - start),\n })\n if (arrangement.rotateItems) s.rotation = angle\n return s\n })\n}\n\n/** The change to `startAngle` that brings slot `index` to twelve o'clock by the shorter way round. */\nexport function radialTurnToTop(arrangement: RadialArrangement, count: number, index: number): number {\n const angle = radialAngles({ ...arrangement, spinSpeed: 0 }, count, 0)[index] ?? arrangement.startAngle\n return -wrapDegrees(angle)\n}\n\n/** `degrees` folded into `(-180, 180]`. */\nexport function wrapDegrees(degrees: number): number {\n const wrapped = ((degrees % 360) + 360) % 360\n return wrapped > 180 ? wrapped - 360 : wrapped\n}\n", "import type { Size2D } from \"@motionscript/core\"\n\nimport { largest, slot, type Slot, type SlotInput } from \"./slot\"\n\nexport const FILL_DIRECTIONS = [\"row\", \"column\"] as const\nexport type FillDirection = (typeof FILL_DIRECTIONS)[number]\n\n/**\n * How big a cell is: the largest child (`fit`), a size of its own (`fixed`), or\n * an equal share of the grid's box (`fill`), which is also the room a child set\n * to `fill` grows into.\n */\nexport const CELL_MODES = [\"fit\", \"fixed\", \"fill\"] as const\nexport type CellMode = (typeof CELL_MODES)[number]\n\n/** Where a short last row (or column, filling by column) sits. */\nexport const LINE_ALIGNS = [\"start\", \"center\", \"end\"] as const\nexport type LineAlign = (typeof LINE_ALIGNS)[number]\n\nexport interface RectangularArrangement {\n kind: \"rectangular\"\n columns: number\n fillDirection: FillDirection\n cellMode: CellMode\n cellWidth: number\n cellHeight: number\n columnGap: number\n rowGap: number\n lastLineAlign: LineAlign\n /** Share of a column's pitch every other row shifts right — `0.5` is a brick bond. */\n rowOffset: number\n /** Share of a row's pitch every other column shifts down. */\n columnOffset: number\n}\n\n/** Rows and columns `count` items make, `columns` wide. */\nexport function rectangularShape(arrangement: RectangularArrangement, count: number): { rows: number; columns: number } {\n const columns = Math.max(1, Math.round(arrangement.columns))\n const rows = Math.max(1, Math.ceil(count / columns))\n // Filling by column, the rows are set by the count, and a column the items\n // never reach would pull the block off centre.\n if (arrangement.fillDirection === \"column\") return { rows, columns: Math.max(1, Math.ceil(count / rows)) }\n return { rows, columns }\n}\n\n/** The cell every item is laid out in — what a `fill` child is measured against. */\nexport function rectangularCell(\n arrangement: RectangularArrangement,\n count: number,\n sizes: readonly Size2D[],\n box: Size2D,\n): Size2D {\n const { rows, columns } = rectangularShape(arrangement, count)\n switch (arrangement.cellMode) {\n case \"fixed\":\n return { width: Math.max(0, arrangement.cellWidth), height: Math.max(0, arrangement.cellHeight) }\n case \"fill\":\n return {\n width: Math.max(0, (box.width - arrangement.columnGap * (columns - 1)) / columns),\n height: Math.max(0, (box.height - arrangement.rowGap * (rows - 1)) / rows),\n }\n default:\n return largest(sizes)\n }\n}\n\n/**\n * Items fill rows left to right, top to bottom (or columns top to bottom, left to\n * right), and the whole block is centred on the grid.\n */\nexport function rectangularSlots(arrangement: RectangularArrangement, input: SlotInput): Slot[] {\n const { count } = input\n if (count === 0) return []\n const { rows, columns } = rectangularShape(arrangement, count)\n const byColumn = arrangement.fillDirection === \"column\"\n // Filling by column keeps the column count and lets the rows follow from it.\n const lines = byColumn ? columns : rows\n const perLine = byColumn ? rows : columns\n const cell = rectangularCell(arrangement, count, input.sizes, input.box)\n const pitchX = cell.width + arrangement.columnGap\n const pitchY = cell.height + arrangement.rowGap\n const lastLine = lines - 1\n const lastCount = count - lastLine * perLine\n const shortBy = perLine - lastCount\n const lead = arrangement.lastLineAlign === \"center\" ? shortBy / 2 : arrangement.lastLineAlign === \"end\" ? shortBy : 0\n // Shifting every other row by a share of a pitch moves the block's centre by\n // half that share; taking it back keeps the block centred on the grid.\n const shiftX = arrangement.rowOffset * pitchX\n const shiftY = arrangement.columnOffset * pitchY\n\n const slots: Slot[] = []\n for (let i = 0; i < count; i++) {\n const line = Math.floor(i / perLine)\n let along = i % perLine\n if (line === lastLine) along += lead\n const row = byColumn ? along : line\n const column = byColumn ? line : along\n // A centred short line sits between whole cells; its parity is the cell it covers most.\n const rowIndex = Math.round(row)\n const columnIndex = Math.round(column)\n const x = (column - (columns - 1) / 2) * pitchX\n + (rowIndex % 2 === 1 ? shiftX : 0) - (rows > 1 ? shiftX / 2 : 0)\n const y = ((rows - 1) / 2 - row) * pitchY\n - (columnIndex % 2 === 1 ? shiftY : 0) + (columns > 1 ? shiftY / 2 : 0)\n slots.push(slot(x, y, { kind: \"rectangular\", row: rowIndex, column: columnIndex }))\n }\n return slots\n}\n", "import { slot, type Slot, type SlotInput } from \"./slot\"\n\n/** `outward` lays each item on the sphere's surface; `billboard` keeps every item facing the viewer. */\nexport const SPHERE_FACINGS = [\"outward\", \"billboard\"] as const\nexport type SphereFacing = (typeof SPHERE_FACINGS)[number]\n\nexport const SPHERE_AXES = [\"x\", \"y\", \"z\"] as const\nexport type SphereAxis = (typeof SPHERE_AXES)[number]\n\nexport interface SphereArrangement {\n kind: \"sphere\"\n radius: number\n /** Turn about the vertical axis, degrees — positive carries the front to the right. */\n yaw: number\n /** Turn about the horizontal axis, degrees — positive brings the top toward the viewer. */\n pitch: number\n /** Turn about the view axis, degrees clockwise. */\n roll: number\n facing: SphereFacing\n /** The camera's distance from the sphere's centre plane, px — smaller is more dramatic. */\n focalLength: number\n /** How much the back half fades, `0..1`. */\n depthFade: number\n /** Hide the items whose faces point away from the viewer. */\n cullBackfaces: boolean\n /** Degrees per second of yaw the sphere turns on its own. */\n spinSpeed: number\n}\n\nconst GOLDEN_ANGLE = Math.PI * (3 - Math.sqrt(5))\nconst DEG = 180 / Math.PI\n\n/** Point `k` of `count` on the unit sphere — a Fibonacci lattice, as even as `count` points get. */\nexport function fibonacciPoint(k: number, count: number): [number, number, number] {\n if (count <= 1) return [0, 0, 1]\n const y = 1 - (2 * (k + 0.5)) / count\n const r = Math.sqrt(Math.max(0, 1 - y * y))\n const theta = k * GOLDEN_ANGLE\n return [Math.cos(theta) * r, y, Math.sin(theta) * r]\n}\n\n/** `p` turned by yaw, then pitch, then roll — y-up, z toward the viewer. */\nexport function orient(p: readonly [number, number, number], yaw: number, pitch: number, roll: number): [number, number, number] {\n const [x0, y0, z0] = p\n const ya = yaw / DEG, pa = pitch / DEG, ra = roll / DEG\n const x1 = x0 * Math.cos(ya) + z0 * Math.sin(ya)\n const z1 = -x0 * Math.sin(ya) + z0 * Math.cos(ya)\n const y2 = y0 * Math.cos(pa) - z1 * Math.sin(pa)\n const z2 = y0 * Math.sin(pa) + z1 * Math.cos(pa)\n return [x1 * Math.cos(ra) + y2 * Math.sin(ra), -x1 * Math.sin(ra) + y2 * Math.cos(ra), z2]\n}\n\nexport function sphereSlots(arrangement: SphereArrangement, input: SlotInput): Slot[] {\n const { count } = input\n const radius = arrangement.radius\n const yaw = arrangement.yaw + arrangement.spinSpeed * input.time\n const outward = arrangement.facing === \"outward\"\n const slots: Slot[] = []\n for (let k = 0; k < count; k++) {\n const q = fibonacciPoint(k, count)\n const [nx, ny, nz] = orient(q, yaw, arrangement.pitch, arrangement.roll)\n const s = slot(nx * radius, ny * radius, {\n kind: \"sphere\",\n lat: Math.asin(Math.max(-1, Math.min(1, q[1]))) * DEG,\n lon: Math.atan2(q[2], q[0]) * DEG,\n depth: nz,\n })\n s.depth = nz * radius\n if (outward) {\n // The tilt whose `Rx · Ry` turns a face's normal onto the surface normal.\n s.rotationY = Math.asin(Math.max(-1, Math.min(1, nx))) * DEG\n s.rotationX = Math.atan2(ny, nz) * DEG\n }\n s.opacity = 1 - arrangement.depthFade * (1 - (nz + 1) / 2)\n if (outward && arrangement.cullBackfaces && facesAway(s, [nx, ny, nz], arrangement.focalLength)) s.opacity = 0\n slots.push(s)\n }\n return slots\n}\n\n/** Whether an outward face at `s` shows its back to a viewer `focal` px in front of the centre. */\nfunction facesAway(s: Slot, normal: readonly [number, number, number], focal: number): boolean {\n if (focal <= 0) return normal[2] < 0\n return normal[0] * -s.x + normal[1] * -s.y + normal[2] * (focal - s.depth) < 0\n}\n\n/** The yaw and pitch that bring point `index` of `count` round to face the viewer. */\nexport function sphereFaceForward(count: number, index: number): { yaw: number; pitch: number } {\n const [x, y, z] = fibonacciPoint(index, count)\n return {\n yaw: -Math.atan2(x, z) * DEG,\n pitch: Math.atan2(y, Math.hypot(x, z)) * DEG,\n }\n}\n", "import type { PathCommand, Size2D } from \"@motionscript/core\"\n\n/**\n * The shapes a path grid can follow without a path of its own, each drawn to\n * fill the grid's box. Centred and y-up, like every path in the library; the\n * closed ones run clockwise, so an item flowing along any of them travels the\n * same way round.\n */\nexport const PATH_TEMPLATES = [\n \"circle\",\n \"square\",\n \"star\",\n \"heart\",\n \"infinity\",\n \"wave\",\n \"spiral\",\n \"arc\",\n \"line\",\n] as const\nexport type PathTemplate = (typeof PATH_TEMPLATES)[number]\n\n/** What a template is drawn at when the grid has no box to fill. */\nconst FALLBACK = 400\n\nconst DRAWN = new Map<string, PathCommand[]>()\nconst DRAWN_CACHE = 64\n\n/**\n * `template` drawn to fill `box`. The same template at the same size is the\n * same array, which is what lets the path's measurement be kept between frames.\n */\nexport function templatePath(template: PathTemplate, box: Size2D): PathCommand[] {\n const key = `${template}:${Math.round(box.width * 100)}:${Math.round(box.height * 100)}`\n const hit = DRAWN.get(key)\n if (hit) return hit\n const path = drawTemplate(template, box)\n if (DRAWN.size >= DRAWN_CACHE) DRAWN.delete(DRAWN.keys().next().value!)\n DRAWN.set(key, path)\n return path\n}\n\nfunction drawTemplate(template: PathTemplate, box: Size2D): PathCommand[] {\n const w = box.width > 0 ? box.width : FALLBACK\n const h = box.height > 0 ? box.height : FALLBACK\n const rx = w / 2\n const ry = h / 2\n switch (template) {\n case \"square\":\n return closed([\n [-rx, ry], [rx, ry], [rx, -ry], [-rx, -ry],\n ])\n case \"star\": {\n const points: [number, number][] = []\n for (let i = 0; i < 10; i++) {\n const angle = (i * Math.PI) / 5\n const r = i % 2 === 0 ? 1 : 0.45\n points.push([Math.sin(angle) * rx * r, Math.cos(angle) * ry * r])\n }\n return closed(points)\n }\n case \"heart\":\n return closed(sample(96, (t) => {\n // The classic heart curve, from its top notch, clockwise.\n const a = t * 2 * Math.PI\n const x = 16 * Math.sin(a) ** 3\n const y = 13 * Math.cos(a) - 5 * Math.cos(2 * a) - 2 * Math.cos(3 * a) - Math.cos(4 * a)\n return [(x / 17) * rx, ((y + 2.5) / 15.5) * ry]\n }).slice(0, -1))\n case \"infinity\":\n return closed(sample(96, (t) => {\n const a = t * 2 * Math.PI\n const d = 1 + Math.sin(a) ** 2\n return [(Math.cos(a) / d) * rx, ((Math.sin(a) * Math.cos(a)) / d) * ry * 2]\n }).slice(0, -1))\n case \"wave\":\n return open(sample(96, (t) => [(-1 + 2 * t) * rx, Math.sin(t * 4 * Math.PI) * ry * 0.6]))\n case \"spiral\":\n return open(sample(160, (t) => {\n const a = t * 3 * 2 * Math.PI\n const r = 0.08 + 0.92 * t\n return [Math.sin(a) * rx * r, Math.cos(a) * ry * r]\n }))\n case \"arc\":\n return open(sample(64, (t) => {\n const a = -Math.PI / 2 + t * Math.PI\n return [Math.sin(a) * rx, -ry + Math.cos(a) * h]\n }))\n case \"line\":\n return [{ type: \"M\", x: -rx, y: 0 }, { type: \"L\", x: rx, y: 0 }]\n default:\n return ellipse(rx, ry)\n }\n}\n\n/** Four quarter-arcs from the top, clockwise. */\nfunction ellipse(rx: number, ry: number): PathCommand[] {\n const k = 0.5522847498\n return [\n { type: \"M\", x: 0, y: ry },\n { type: \"C\", x1: k * rx, y1: ry, x2: rx, y2: k * ry, x: rx, y: 0 },\n { type: \"C\", x1: rx, y1: -k * ry, x2: k * rx, y2: -ry, x: 0, y: -ry },\n { type: \"C\", x1: -k * rx, y1: -ry, x2: -rx, y2: -k * ry, x: -rx, y: 0 },\n { type: \"C\", x1: -rx, y1: k * ry, x2: -k * rx, y2: ry, x: 0, y: ry },\n { type: \"Z\" },\n ]\n}\n\nfunction sample(steps: number, at: (t: number) => [number, number]): [number, number][] {\n const points: [number, number][] = []\n for (let i = 0; i <= steps; i++) points.push(at(i / steps))\n return points\n}\n\nfunction open(points: [number, number][]): PathCommand[] {\n return points.map(([x, y], i) => (i === 0 ? { type: \"M\", x, y } : { type: \"L\", x, y }))\n}\n\nfunction closed(points: [number, number][]): PathCommand[] {\n return [...open(points), { type: \"Z\" }]\n}\n", "import { pathSlots, type PathArrangement } from \"./path\"\nimport { radialSlots, type RadialArrangement } from \"./radial\"\nimport { rectangularSlots, type RectangularArrangement } from \"./rectangular\"\nimport type { Slot, SlotInput } from \"./slot\"\nimport { sphereSlots, type SphereArrangement } from \"./sphere\"\n\nexport * from \"./slot\"\nexport * from \"./rectangular\"\nexport * from \"./radial\"\nexport * from \"./path\"\nexport * from \"./path-templates\"\nexport * from \"./sphere\"\n\n/**\n * Everything an arrangement needs to place items, as plain data — so a\n * transition can keep the one it is leaving, and a grid can borrow another's.\n */\nexport type Arrangement = RectangularArrangement | RadialArrangement | PathArrangement | SphereArrangement\n\nexport type ArrangementKind = Arrangement[\"kind\"]\n\n/** Where each of `input.count` items sits under `arrangement`, in slot order. */\nexport function slotsOf(arrangement: Arrangement, input: SlotInput): Slot[] {\n switch (arrangement.kind) {\n case \"rectangular\":\n return rectangularSlots(arrangement, input)\n case \"radial\":\n return radialSlots(arrangement, input)\n case \"path\":\n return pathSlots(arrangement, input)\n case \"sphere\":\n return sphereSlots(arrangement, input)\n }\n}\n\n/** The camera distance an arrangement is seen through, or `0` when it is flat. */\nexport function focalLengthOf(arrangement: Arrangement): number {\n return arrangement.kind === \"sphere\" ? Math.max(1, arrangement.focalLength) : 0\n}\n", "/** A seeded generator in `[0, 1)` — mulberry32, so a shuffle is the same on every frame and every machine. */\nexport function seededRandom(seed: number): () => number {\n let a = Math.floor(seed) >>> 0\n return () => {\n a = (a + 0x6d2b79f5) >>> 0\n let t = a\n t = Math.imul(t ^ (t >>> 15), t | 1)\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61)\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n }\n}\n\n/** `values` in a seeded random order. */\nexport function shuffled<T>(values: readonly T[], seed: number): T[] {\n const out = [...values]\n const random = seededRandom(seed)\n for (let i = out.length - 1; i > 0; i--) {\n const j = Math.floor(random() * (i + 1))\n ;[out[i], out[j]] = [out[j], out[i]]\n }\n return out\n}\n\n/** A stable number for a string — a node's id, so its \"random\" stagger never changes between builds. */\nexport function hashSeed(text: string): number {\n let h = 2166136261\n for (let i = 0; i < text.length; i++) h = Math.imul(h ^ text.charCodeAt(i), 16777619)\n return h >>> 0\n}\n", "import { shuffled } from \"./random\"\nimport type { Slot } from \"./slots\"\n\n/**\n * The order a per-item effect sweeps through a grid's items. The first five\n * work on any grid; the rest follow one arrangement's own geometry — rows and\n * columns of a rectangular grid (or top-to-bottom and left-to-right of any\n * other), the way round a ring, the way along a path, front to back of a sphere\n * — and fall back to item order where the grid has no such thing.\n */\nexport const STAGGER_ORDERS = [\n \"index\",\n \"reverse\",\n \"random\",\n \"centerOut\",\n \"edgesIn\",\n \"row\",\n \"column\",\n \"angle\",\n \"path\",\n \"depth\",\n] as const\nexport type StaggerOrder = (typeof STAGGER_ORDERS)[number]\n\n/** The most of a command's length the offsets may take; the rest is each item's own motion. */\nconst MAX_STAGGER = 0.95\n\n/**\n * Each item's start, `0..1`, as a share of the stagger: `0` goes first, `1`\n * last, and items that tie go together — a ring revealed `centerOut` from its\n * centre appears all at once, which is what that means.\n */\nexport function staggerRanks(order: StaggerOrder, slots: readonly Slot[], seed: number): number[] {\n const n = slots.length\n const keys = keysOf(order, slots, seed)\n let min = Infinity\n let max = -Infinity\n for (const key of keys) {\n if (key < min) min = key\n if (key > max) max = key\n }\n const range = max - min\n if (!(range > 1e-9)) return new Array<number>(n).fill(0)\n return keys.map((key) => (key - min) / range)\n}\n\n/**\n * Item progress at command time `t`: each item runs over the same length of\n * time, starting `rank · stagger` in. The stagger lives inside the command's\n * duration, so a one-second reveal takes one second for four items or four\n * hundred.\n */\nexport function staggerProgress(rank: number, t: number, stagger: number): number {\n const s = Math.max(0, Math.min(MAX_STAGGER, stagger))\n const p = s === 0 ? t : (t - rank * s) / (1 - s)\n return p < 0 ? 0 : p > 1 ? 1 : p\n}\n\nfunction keysOf(order: StaggerOrder, slots: readonly Slot[], seed: number): number[] {\n switch (order) {\n case \"reverse\":\n return slots.map((_, i) => -i)\n case \"random\": {\n const sequence = shuffled(slots.map((_, i) => i), seed)\n const keys = new Array<number>(slots.length)\n sequence.forEach((item, rank) => {\n keys[item] = rank\n })\n return keys\n }\n case \"centerOut\":\n return slots.map((s) => Math.round(Math.hypot(s.x, s.y, s.depth) * 1000) / 1000)\n case \"edgesIn\":\n return slots.map((s) => -Math.round(Math.hypot(s.x, s.y, s.depth) * 1000) / 1000)\n case \"row\":\n return slots.map((s) => (s.meta.kind === \"rectangular\" ? s.meta.row : -Math.round(s.y)))\n case \"column\":\n return slots.map((s) => (s.meta.kind === \"rectangular\" ? s.meta.column : Math.round(s.x)))\n case \"angle\":\n return slots.map((s, i) =>\n s.meta.kind === \"radial\" ? s.meta.angle : s.meta.kind === \"rectangular\" || s.meta.kind === \"sphere\" ? clockAngle(s) : i\n )\n case \"path\":\n return slots.map((s, i) => (s.meta.kind === \"path\" ? s.meta.t : i))\n case \"depth\":\n return slots.map((s, i) => (s.meta.kind === \"sphere\" ? -s.meta.depth : i))\n default:\n return slots.map((_, i) => i)\n }\n}\n\n/** Degrees clockwise from twelve o'clock to where `s` sits. */\nfunction clockAngle(s: Slot): number {\n const angle = (Math.atan2(s.x, s.y) * 180) / Math.PI\n return angle < 0 ? angle + 360 : angle\n}\n", "import type { Size2D } from \"@motionscript/core\"\n\nimport type { Slot } from \"./slots\"\n\n/**\n * What an item does on its way in (or out): grow from nothing, fade, fly out of\n * the grid's centre, rise into place, flip up, or spin in.\n */\nexport const REVEAL_STYLES = [\"scale\", \"fade\", \"center\", \"rise\", \"flip\", \"spin\"] as const\nexport type RevealStyle = (typeof REVEAL_STYLES)[number]\n\n/** What a wave does to each item as it passes. */\nexport const WAVE_STYLES = [\"scale\", \"lift\", \"fade\", \"spin\"] as const\nexport type WaveStyle = (typeof WAVE_STYLES)[number]\n\n/**\n * How far into view each item is, `1` shown and `0` gone — past `1` on the\n * way to it under an overshooting ease. Absent means every item is shown.\n */\nexport interface RevealState {\n style: RevealStyle\n values: readonly number[]\n}\n\n/** Each item's share of the wave passing through it, `0` at rest and `1` at the crest. */\nexport interface WaveState {\n style: WaveStyle\n /** How big the crest is — a share of the item's size, opacity or a turn, by style. */\n amount: number\n values: readonly number[]\n}\n\n/** Each item's emphasis: `1` the focus, `-1` pushed back, `0` untouched. */\nexport interface FocusState {\n /** How far the others fade, `0..1`. */\n dim: number\n /** How much the focus grows, as a share of its size; the others shrink by half that. */\n grow: number\n values: readonly number[]\n}\n\n/** Layer item `i`'s reveal, wave and focus onto its slot, in place. */\nexport function applyItemEffects(\n s: Slot,\n i: number,\n size: Size2D,\n reveal: RevealState | null | undefined,\n wave: WaveState | null | undefined,\n focus: FocusState | null | undefined,\n): void {\n if (reveal) applyReveal(s, reveal.style, reveal.values[i] ?? 1, size)\n if (wave) applyWave(s, wave, wave.values[i] ?? 0, size)\n if (focus) applyFocus(s, focus, focus.values[i] ?? 0)\n}\n\nfunction applyReveal(s: Slot, style: RevealStyle, v: number, size: Size2D): void {\n if (v === 1) return\n const shown = clamp01(v)\n switch (style) {\n case \"fade\":\n s.opacity *= shown\n break\n case \"center\":\n s.x *= v\n s.y *= v\n s.depth *= v\n s.opacity *= clamp01(v * 4)\n break\n case \"rise\":\n s.y -= (1 - v) * Math.max(40, size.height)\n s.opacity *= shown\n break\n case \"flip\":\n s.rotationX += (1 - v) * 90\n break\n case \"spin\":\n s.rotation -= (1 - v) * 180\n s.scale *= Math.max(0, v)\n break\n default:\n s.scale *= Math.max(0, v)\n }\n}\n\nfunction applyWave(s: Slot, wave: WaveState, w: number, size: Size2D): void {\n if (w === 0) return\n switch (wave.style) {\n case \"lift\":\n s.y += wave.amount * w * Math.max(40, size.height)\n break\n case \"fade\":\n s.opacity *= clamp01(1 - wave.amount * w)\n break\n case \"spin\":\n s.rotation += wave.amount * w * 360\n break\n default:\n s.scale *= 1 + wave.amount * w\n }\n}\n\nfunction applyFocus(s: Slot, focus: FocusState, f: number): void {\n if (f === 0) return\n if (f > 0) {\n s.scale *= 1 + focus.grow * f\n return\n }\n s.opacity *= clamp01(1 - focus.dim * -f)\n s.scale *= Math.max(0, 1 + focus.grow * 0.5 * f)\n}\n\nfunction clamp01(v: number): number {\n return v < 0 ? 0 : v > 1 ? 1 : v\n}\n", "/**\n * A grid's `order` lists items in slot order: slot `k` holds item `order[k]`.\n * These keep it a permutation whatever it was written as — a stale entry past\n * the count, a repeat, or nothing at all — so a child added or removed never\n * leaves a slot empty or two items in one.\n */\n\n/** `order` repaired into a permutation of `0..count-1`: its valid entries first, then the rest in item order. */\nexport function normalizeOrder(order: readonly number[] | undefined, count: number): number[] {\n const out: number[] = []\n const taken = new Array<boolean>(count).fill(false)\n for (const entry of order ?? []) {\n const item = Math.round(entry)\n if (item >= 0 && item < count && !taken[item]) {\n taken[item] = true\n out.push(item)\n }\n }\n for (let item = 0; item < count; item++) if (!taken[item]) out.push(item)\n return out\n}\n\n/** For each item, the slot it sits in. */\nexport function slotOfItem(order: readonly number[]): number[] {\n const slots = new Array<number>(order.length)\n order.forEach((item, slot) => {\n slots[item] = slot\n })\n return slots\n}\n\n/** An order written as `\"2, 0, 1\"` or as numbers. */\nexport function parseOrder(value: unknown): number[] {\n if (Array.isArray(value)) return value.map(Number).filter(Number.isFinite)\n if (typeof value !== \"string\") return []\n return value\n .split(/[\\s,]+/)\n .filter((part) => part !== \"\")\n .map(Number)\n .filter(Number.isFinite)\n}\n", "import {\n command,\n easeIn,\n easeInOut,\n easeOut,\n flowOps,\n insetsOps,\n Node2D,\n property,\n sizeInputOps,\n type BoxBounds,\n type ChildPlacement,\n type Command,\n type CommandArgs,\n type MeasureContext2D,\n type EasingFunction,\n type Node2DProps,\n type Size2D,\n type SizeConstraints,\n type SpaceCamera,\n} from \"@motionscript/core\"\n\nimport {\n applyItemEffects,\n REVEAL_STYLES,\n WAVE_STYLES,\n type FocusState,\n type RevealState,\n type RevealStyle,\n type WaveState,\n type WaveStyle,\n} from \"./item-effects\"\nimport { normalizeOrder, parseOrder, slotOfItem } from \"./order\"\nimport { hashSeed, shuffled } from \"./random\"\nimport { blendSlot, focalLengthOf, slotsOf, spreadSlot, type Arrangement, type Slot } from \"./slots\"\nimport { STAGGER_ORDERS, staggerProgress, staggerRanks, type StaggerOrder } from \"./stagger\"\n\n/** An arrangement a grid is leaving, kept as data so its slots can be worked out afresh every frame. */\nexport interface GridSnapshot {\n arrangement: Arrangement\n /** The grid the arrangement was borrowed from, or `\"\"` for the grid's own. */\n source: string\n order: readonly number[]\n spread: number\n}\n\n/** A change of arrangement under way: where the items are coming from, and how far each has come. */\nexport interface GridTransition {\n from: GridSnapshot\n /** Each item's eased, staggered progress, `0..1`. */\n mix: readonly number[]\n}\n\nexport interface LayoutGridProps extends Node2DProps {\n /** Items in slot order: slot `k` holds child `order[k]`. Empty is the children's own order. */\n order: number[]\n /** `0` gathers every item at the centre, `1` is the arrangement, past `1` pushes them apart. */\n spread: number\n /** Another grid whose arrangement this one takes on — what {@link LayoutGrid.morphInto} animates. */\n arrangeLike: string\n // What the per-item commands write. State rather than settings: a command\n // owns each while it runs, and a document has no reason to name them.\n revealState: RevealState | null\n waveState: WaveState | null\n focusState: FocusState | null\n transition: GridTransition | null\n}\n\n/** What a command that moves the items to new slots is built from. */\nexport interface TransitionArgs {\n data?: StaggerArgs\n duration: number\n easing?: EasingFunction\n}\n\n/** The stagger options every per-item command takes. */\nexport interface StaggerArgs {\n staggerOrder?: StaggerOrder\n /** `0..0.95`: how much of the command's length the items' offsets take up. */\n stagger?: number\n}\n\n/** `@command` descriptors for {@link StaggerArgs}, `stagger` defaulting to `fallback`. */\nexport function staggerArgs(fallback: number) {\n return [\n { key: \"staggerOrder\", kind: \"enum\", options: STAGGER_ORDERS, default: \"index\" },\n { key: \"stagger\", min: 0, max: 0.95, step: 0.05, default: fallback },\n ] as const\n}\n\n/**\n * Every grid's document key — what a reference to \"another grid\" may name. A\n * `nodeRef` descriptor carries it as `nodeTypes`, for a host's picker to offer\n * only those.\n */\nexport const LAYOUT_GRID_TYPES = [\"rectangularGrid\", \"radialGrid\", \"pathGrid\", \"sphereGrid\"] as const\n\n/** The stagger a move to new slots takes when its command states none. */\nexport const TRANSITION_STAGGER = 0.3\n\nconst NO_CONTENT: Size2D = { width: 0, height: 0 }\nconst CENTRE = { x: 0, y: 0 }\n\n/**\n * The base of every grid: a container that places each of its children in a\n * slot of an arrangement — a rectangular grid, a ring, a path, a sphere.\n *\n * ## Children only\n *\n * The items are the children, in layer order. A child's slot is a parent\n * transform on it, so its own `x`/`y`/`rotation`/`scale` — and any command on\n * them — still work, relative to the slot. A group is one item; a grid of\n * grids is a grid of items that happen to be grids.\n *\n * ## One pass\n *\n * Every frame: measure the children, ask the arrangement for its slots (a pure\n * function of the props, the sizes and the clock), blend them from where a\n * transition is leaving, and layer on the per-item effects — reveal, wave,\n * focus. What is left is each child's box and {@link ChildPlacement}, which the\n * renderer, picking and `global` all read, so a selection outline lands on\n * the pixels even on a sphere.\n *\n * ## Commands\n *\n * Every command is a pure function of time, like the rest of the library. The\n * per-item ones stagger *inside* their duration — a one-second reveal takes one\n * second for four children or four hundred — and write their per-item state\n * into props ({@link revealState} and its siblings), which is what keeps them\n * seekable. The ones that change the arrangement itself (a reorder, a morph, a\n * column count) keep the arrangement they are leaving as data and blend each\n * item from its old slot to its new one.\n */\nexport abstract class LayoutGrid<P extends LayoutGridProps = LayoutGridProps> extends Node2D<P> {\n @property({ default: [], kind: \"order\", animatable: false }) declare order: number[]\n @property({ default: 1, min: 0, max: 3, step: 0.05 }) declare spread: number\n @property({ default: \"\", kind: \"nodeRef\", nodeTypes: LAYOUT_GRID_TYPES, animatable: false }) declare arrangeLike: string\n // Unset until a command writes one, so a fresh node's row does not state them.\n @property({ default: undefined, kind: \"state\", animatable: false }) declare revealState: RevealState | null | undefined\n @property({ default: undefined, kind: \"state\", animatable: false }) declare waveState: WaveState | null | undefined\n @property({ default: undefined, kind: \"state\", animatable: false }) declare focusState: FocusState | null | undefined\n @property({ default: undefined, kind: \"state\", animatable: false }) declare transition: GridTransition | null | undefined\n\n /**\n * Bring the items in, one after another. Every item starts hidden, so place\n * it where the grid enters — or after a {@link conceal}.\n */\n @command({ args: [{ key: \"style\", kind: \"enum\", options: REVEAL_STYLES, default: \"scale\" }, ...staggerArgs(0.5)] })\n reveal(args: CommandArgs<{ style?: RevealStyle } & StaggerArgs> & { duration: number }): Command<LayoutGridProps> {\n const style = args.data?.style ?? \"scale\"\n const ease = args.easing ?? (style === \"scale\" || style === \"flip\" ? easeOut(\"back\") : easeOut(\"cubic\"))\n const ranks = this._ranks(args.data?.staggerOrder)\n const stagger = args.data?.stagger ?? 0.5\n return this.command<LayoutGridProps>((t) => {\n if (t >= 1) return { revealState: null }\n return { revealState: { style, values: ranks.map((rank) => ease(staggerProgress(rank, t, stagger))) } }\n }, args.duration)\n }\n\n /** Take the items out, one after another — {@link reveal} in reverse. They stay hidden after. */\n @command({ args: [{ key: \"style\", kind: \"enum\", options: REVEAL_STYLES, default: \"scale\" }, ...staggerArgs(0.5)] })\n conceal(args: CommandArgs<{ style?: RevealStyle } & StaggerArgs> & { duration: number }): Command<LayoutGridProps> {\n const style = args.data?.style ?? \"scale\"\n const ease = args.easing ?? (style === \"scale\" || style === \"flip\" ? easeIn(\"back\") : easeInOut(\"cubic\"))\n const ranks = this._ranks(args.data?.staggerOrder)\n const stagger = args.data?.stagger ?? 0.5\n const from = this.revealState?.values\n return this.command<LayoutGridProps>((t) => ({\n revealState: {\n style,\n values: ranks.map((rank, i) => (from?.[i] ?? 1) * (1 - ease(staggerProgress(rank, t, stagger)))),\n },\n }), args.duration)\n }\n\n /** Send a ripple through the items that swells each in turn and settles back. */\n @command({\n args: [\n { key: \"style\", kind: \"enum\", options: WAVE_STYLES, default: \"scale\" },\n { key: \"amount\", min: 0, max: 2, step: 0.05, default: 0.3 },\n ...staggerArgs(0.7),\n ],\n })\n wave(args: CommandArgs<{ style?: WaveStyle; amount?: number } & StaggerArgs> & { duration: number }): Command<LayoutGridProps> {\n const style = args.data?.style ?? \"scale\"\n const amount = args.data?.amount ?? 0.3\n const ease = args.easing ?? easeInOut(\"sine\")\n const ranks = this._ranks(args.data?.staggerOrder)\n const stagger = args.data?.stagger ?? 0.7\n return this.command<LayoutGridProps>((t) => {\n if (t >= 1) return { waveState: null }\n return {\n waveState: {\n style,\n amount,\n values: ranks.map((rank) => Math.sin(Math.PI * ease(staggerProgress(rank, t, stagger)))),\n },\n }\n }, args.duration)\n }\n\n /** Bring one item (by its place in the layers, from 0) forward and push the rest back. */\n @command({\n args: [\n { key: \"item\", min: 0, step: 1, default: 0 },\n { key: \"dim\", min: 0, max: 1, step: 0.05, default: 0.7 },\n { key: \"grow\", min: 0, max: 1, step: 0.05, default: 0.15 },\n ],\n })\n focus(args: CommandArgs<{ item?: number; dim?: number; grow?: number }> & { duration: number }): Command<LayoutGridProps> {\n const n = this._itemCount()\n const item = Math.round(args.data?.item ?? 0)\n return this._focusOn((i) => i === item, n, args)\n }\n\n /** Bring every item back to even. */\n @command()\n unfocus(args: CommandArgs<Record<string, never>> & { duration: number }): Command<LayoutGridProps> {\n const from = this.focusState\n const ease = args.easing ?? easeInOut(\"cubic\")\n return this.command<LayoutGridProps>((t) => {\n if (t >= 1 || !from) return { focusState: null }\n const k = 1 - ease(t)\n return { focusState: { ...from, values: from.values.map((v) => v * k) } }\n }, args.duration)\n }\n\n /** Gather the items toward the centre (`0`), back to the arrangement (`1`), or push them apart. */\n @command({ args: [{ key: \"spread\", min: 0, max: 3, step: 0.05, default: 1 }] })\n spreadTo(args: CommandArgs<{ spread: number }> & { duration: number }): Command<P> {\n return this.to({ data: { spread: args.data?.spread ?? 1 } as Partial<P>, duration: args.duration, easing: args.easing })\n }\n\n /** Send every item to a random slot. The same `seed` always deals the same way. */\n @command({ args: [{ key: \"seed\", min: 0, step: 1, default: 1 }, ...staggerArgs(TRANSITION_STAGGER)] })\n shuffle(args: CommandArgs<{ seed?: number } & StaggerArgs> & { duration: number }): Command<P> {\n const current = normalizeOrder(this.order, this._itemCount())\n let next = shuffled(current, args.data?.seed ?? 1)\n // A shuffle that deals everything back where it was would look like nothing happened.\n if (next.length > 1 && next.every((item, k) => item === current[k])) next = [...next.slice(1), next[0]]\n return this._transitionTo({ order: next } as Partial<P>, args)\n }\n\n /** Two items trade places, by their place in the layers. */\n @command({\n args: [\n { key: \"first\", min: 0, step: 1, default: 0 },\n { key: \"second\", min: 0, step: 1, default: 1 },\n ...staggerArgs(0),\n ],\n })\n swap(args: CommandArgs<{ first?: number; second?: number } & StaggerArgs> & { duration: number }): Command<P> {\n const order = normalizeOrder(this.order, this._itemCount())\n const a = order.indexOf(Math.round(args.data?.first ?? 0))\n const b = order.indexOf(Math.round(args.data?.second ?? 1))\n if (a >= 0 && b >= 0) [order[a], order[b]] = [order[b], order[a]]\n return this._transitionTo({ order } as Partial<P>, args, 0)\n }\n\n /** Move the items into a new order — a list of layer indices, first slot first, like `\"2, 0, 1\"`. */\n @command({ args: [{ key: \"order\", kind: \"text\", default: \"\" }, ...staggerArgs(TRANSITION_STAGGER)] })\n reorder(args: CommandArgs<{ order?: string | number[] } & StaggerArgs> & { duration: number }): Command<P> {\n const order = normalizeOrder(parseOrder(args.data?.order), this._itemCount())\n return this._transitionTo({ order } as Partial<P>, args)\n }\n\n /**\n * Move every item into another grid's arrangement — a grid into a ring, a ring\n * onto a sphere — and keep following it. An empty `target` morphs back to\n * this grid's own.\n */\n @command({ args: [{ key: \"target\", kind: \"nodeRef\", nodeTypes: LAYOUT_GRID_TYPES }, ...staggerArgs(TRANSITION_STAGGER)] })\n morphInto(args: CommandArgs<{ target?: string } & StaggerArgs> & { duration: number }): Command<P> {\n return this._transitionTo({ arrangeLike: args.data?.target ?? \"\" } as Partial<P>, args)\n }\n\n /** This grid's own arrangement, for a content box of `box`. */\n protected abstract arrangementFor(box: Size2D): Arrangement\n\n // A grid's size is what its items come to. The base's rule — hug only when\n // built with children — would have a grid from a document, whose children\n // arrive after it, fill its parent instead.\n protected override applyDefaultSize(props?: { readonly width?: unknown; readonly height?: unknown }): void {\n if (!props || props.width === undefined) this.applyProp(\"width\", \"hug\", { tween: sizeInputOps.lerp })\n if (!props || props.height === undefined) this.applyProp(\"height\", \"hug\", { tween: sizeInputOps.lerp })\n }\n\n /** The room each item is measured in — the whole content box, unless an arrangement has cells. */\n protected itemSpace(_count: number, space: Size2D, _sizes?: readonly Size2D[]): Size2D {\n return space\n }\n\n override measure(constraints: SizeConstraints, scope: MeasureContext2D): Partial<Size2D> {\n this.lastMeasure = { constraints, measurer: scope }\n const padding = this.effectivePadding()\n const items = this.flowChildren()\n if (items.length === 0) {\n this._measured = null\n return flowOps.size(this, constraints, padding, NO_CONTENT)\n }\n const space = flowOps.contentBox(this, constraints, padding)\n const sizes = this._measureItems(items, space, scope)\n this._measured = { space, sizes }\n return flowOps.size(this, constraints, padding, extentOf(this._targetSlots(items.length, sizes, space).slots, sizes, this._focal))\n }\n\n protected override layoutChildren(rect: BoxBounds, scope: MeasureContext2D): void {\n this._placements.clear()\n const items = this.flowChildren()\n if (items.length === 0) {\n this._slots = []\n this._sizes = []\n this._focal = 0\n return\n }\n const inner = insetsOps.insetBounds(rect.width, rect.height, this.effectivePadding())\n const measured = this._measured\n this._measured = null\n const sizes = measured && measured.sizes.length === items.length && sameSize(measured.space, inner)\n ? measured.sizes\n : this._measureItems(items, inner, scope)\n const slots = this._resolve(sizes, inner)\n this._slots = slots\n this._sizes = sizes\n for (let i = 0; i < items.length; i++) {\n const s = slots[i]\n items[i].layout({ x: inner.x + s.x, y: inner.y - s.y, width: sizes[i].width, height: sizes[i].height }, scope)\n if (s.rotation !== 0 || s.scale !== 1 || s.rotationX !== 0 || s.rotationY !== 0 || s.depth !== 0 || s.opacity !== 1) {\n this._placements.set(items[i], {\n rotation: s.rotation,\n scale: s.scale,\n rotationX: s.rotationX,\n rotationY: s.rotationY,\n depth: s.depth,\n opacity: s.opacity,\n })\n }\n }\n }\n\n override _placementOf(child: Node2D): ChildPlacement | null {\n return this._placements.get(child) ?? null\n }\n\n /**\n * A grid whose arrangement has depth is seen through a camera of its own,\n * which paints its items far to near — unless it already sits in a space (an\n * orbit camera, a 3D stage), where its items join that one and its camera.\n */\n override _spaceCamera(): SpaceCamera | null {\n const focal = this._focal\n if (focal <= 0 || this._inSpace()) return null\n return {\n perspective: focal,\n orbit: 0,\n elevation: 0,\n dolly: 0,\n lookAt: CENTRE,\n zoom: 1,\n heading: 0,\n viewportX: 0,\n viewportY: 0,\n }\n }\n\n private readonly _placements = new Map<Node2D, ChildPlacement>()\n /** What {@link measure} found, for {@link layoutChildren} to reuse in the same pass. */\n private _measured: { space: Size2D; sizes: Size2D[] } | null = null\n /** Each item's slot from the last layout — what a command ranks its stagger by. */\n private _slots: Slot[] = []\n /** Each item's size from the last layout. */\n private _sizes: readonly Size2D[] = []\n /** The last layout's camera distance, `0` while flat. */\n private _focal = 0\n private _borrowCache: { id: string; grid: LayoutGrid } | null = null\n\n /** How many items a command built now will act on. */\n protected _itemCount(): number {\n return this.flowChildren().length\n }\n\n /** Each item's slot as it stands, for a command being built — the last layout's where it still fits. */\n protected _itemSlots(): Slot[] {\n const n = this._itemCount()\n if (this._slots.length === n) return this._slots\n const sizes = new Array<Size2D>(n).fill({ width: 100, height: 100 })\n return this._targetSlots(n, sizes, contentBoxOf(this)).slots\n }\n\n /** The item sizes the last layout found. */\n protected _itemSizes(): readonly Size2D[] {\n return this._sizes.length === this._itemCount() ? this._sizes : []\n }\n\n /** Each item's start in a stagger. A random order is seeded by the node's id, so it never changes between builds. */\n protected _ranks(order: StaggerOrder | undefined): number[] {\n return staggerRanks(order ?? \"index\", this._itemSlots(), hashSeed(this.id))\n }\n\n /**\n * Write `changes` to the arrangement and move each item from its slot in the\n * one being left to its slot in the new one, staggered.\n */\n protected _transitionTo(changes: Partial<P>, args: TransitionArgs, stagger = TRANSITION_STAGGER): Command<P> {\n const from = this._snapshot()\n const ease = args.easing ?? easeInOut(\"cubic\")\n const ranks = this._ranks(args.data?.staggerOrder)\n const spread = args.data?.stagger ?? stagger\n return this.command<P>((t) => {\n if (t >= 1) return { ...changes, transition: null } as Partial<P>\n const mix = ranks.map((rank) => ease(staggerProgress(rank, t, spread)))\n return { ...changes, transition: { from, mix } } as Partial<P>\n }, args.duration)\n }\n\n /** Emphasise the items `isFocus` picks and push the rest back. */\n protected _focusOn(\n isFocus: (item: number) => boolean,\n count: number,\n args: CommandArgs<{ dim?: number; grow?: number }> & { duration: number },\n ): Command<LayoutGridProps> {\n const from = this.focusState\n const dim = args.data?.dim ?? 0.7\n const grow = args.data?.grow ?? 0.15\n const target = Array.from({ length: count }, (_, i) => (isFocus(i) ? 1 : -1))\n const ease = args.easing ?? easeInOut(\"cubic\")\n return this.command<LayoutGridProps>((t) => {\n const e = ease(t)\n return {\n focusState: {\n dim: lerp(from?.dim ?? dim, dim, e),\n grow: lerp(from?.grow ?? grow, grow, e),\n values: target.map((v, i) => lerp(from?.values[i] ?? 0, v, e)),\n },\n }\n }, args.duration)\n }\n\n private _snapshot(): GridSnapshot {\n const source = this._borrowed()\n return {\n arrangement: source ? source.arrangementFor(contentBoxOf(source)) : this.arrangementFor(contentBoxOf(this)),\n source: source?.id ?? \"\",\n order: normalizeOrder(this.order, this._itemCount()),\n spread: this.spread,\n }\n }\n\n private _measureItems(items: readonly Node2D[], space: Size2D, scope: MeasureContext2D): Size2D[] {\n const measured = flowOps.measure({}, items, space, scope).sizes\n const cell = this.itemSpace(items.length, space, measured)\n if (cell === space) return [...measured]\n return [...flowOps.measure({}, items, cell, scope).sizes]\n }\n\n /** Where each item sits in the arrangement it is heading for, before any transition or effect. */\n private _targetSlots(count: number, sizes: readonly Size2D[], box: Size2D): { slots: Slot[]; arrangement: Arrangement } {\n const source = this._borrowed()\n const arrangement = source ? source.arrangementFor(contentBoxOf(source)) : this.arrangementFor(box)\n let slots = slotsOf(arrangement, { count, sizes, box: source ? contentBoxOf(source) : box, time: this.time.total })\n if (source) slots = this._fromGrid(source, slots)\n const slotOf = slotOfItem(normalizeOrder(this.order, count))\n return { slots: slotOf.map((k) => spreadSlot(slots[k], this.spread)), arrangement }\n }\n\n /** Each item's final slot this frame: the target, blended from any transition, with its effects on. */\n private _resolve(sizes: readonly Size2D[], box: Size2D): Slot[] {\n const count = sizes.length\n const target = this._targetSlots(count, sizes, box)\n const slots = target.slots\n let focal = focalLengthOf(target.arrangement)\n const transition = this.transition\n if (transition) {\n const { from } = transition\n const source = from.source ? this._gridById(from.source) : null\n const fromBox = source ? contentBoxOf(source) : box\n let leaving = slotsOf(from.arrangement, { count, sizes, box: fromBox, time: this.time.total })\n if (source && source !== this) leaving = this._fromGrid(source, leaving)\n const slotOf = slotOfItem(normalizeOrder(from.order, count))\n for (let i = 0; i < count; i++) {\n slots[i] = blendSlot(spreadSlot(leaving[slotOf[i]], from.spread), slots[i], transition.mix[i] ?? 1)\n }\n // A morph into or out of depth keeps the camera for its whole length.\n focal = focal || focalLengthOf(from.arrangement)\n }\n this._focal = focal\n const reveal = this.revealState\n const wave = this.waveState\n const focus = this.focusState\n if (reveal || wave || focus) {\n for (let i = 0; i < count; i++) applyItemEffects(slots[i], i, sizes[i], reveal, wave, focus)\n }\n return slots\n }\n\n /** Whether an ancestor places this grid in a space, as `spaceFrameOf` walks it. */\n private _inSpace(): boolean {\n for (let n = this.parent; n; n = n.parent) {\n if (n._spaceCamera()) return true\n if (!n._rendersChildrenInSpace()) return false\n }\n return false\n }\n\n /** The grid {@link arrangeLike} names, when it names another grid in this tree. */\n private _borrowed(): LayoutGrid | null {\n const id = this.arrangeLike\n if (!id || id === this.id) return null\n return this._gridById(id)\n }\n\n private _gridById(id: string): LayoutGrid | null {\n if (id === this.id) return this\n const cached = this._borrowCache\n if (cached && cached.id === id && cached.grid.mounted) return cached.grid\n const found = findNode2D(this, id)\n const grid = found instanceof LayoutGrid ? found : null\n this._borrowCache = grid ? { id, grid } : null\n return grid\n }\n\n /** `slots`, laid out in `source`'s frame, moved into this grid's. */\n private _fromGrid(source: LayoutGrid, slots: Slot[]): Slot[] {\n const frame = frameIn(this, source)\n return slots.map((s) => {\n const p = rotateClockwise(s.x * frame.scale, s.y * frame.scale, frame.rotation)\n return {\n ...s,\n x: frame.x + p.x,\n y: frame.y + p.y,\n depth: s.depth * frame.scale,\n rotation: s.rotation + frame.rotation,\n scale: s.scale * frame.scale,\n }\n })\n }\n}\n\n/** A node's content box: its laid-out size inside its padding. */\nexport function contentBoxOf(grid: Node2D): Size2D {\n const b = grid.layoutBounds\n const inner = insetsOps.insetBounds(b.width, b.height, grid.effectivePadding())\n return { width: inner.width, height: inner.height }\n}\n\n/** The box, centred on the grid, that holds every item where its slot puts it. */\nfunction extentOf(slots: readonly Slot[], sizes: readonly Size2D[], focal: number): Size2D {\n let halfWidth = 0\n let halfHeight = 0\n for (let i = 0; i < slots.length; i++) {\n const s = slots[i]\n const size = sizes[i]\n const rad = (s.rotation * Math.PI) / 180\n const cos = Math.abs(Math.cos(rad))\n const sin = Math.abs(Math.sin(rad))\n // What the camera does to a slot at depth, so a sphere hugs its front.\n const lens = focal > 0 && focal - s.depth > 1 ? focal / (focal - s.depth) : 1\n const w = ((size.width * cos + size.height * sin) / 2) * s.scale * lens\n const h = ((size.width * sin + size.height * cos) / 2) * s.scale * lens\n halfWidth = Math.max(halfWidth, Math.abs(s.x) * lens + w)\n halfHeight = Math.max(halfHeight, Math.abs(s.y) * lens + h)\n }\n return { width: halfWidth * 2, height: halfHeight * 2 }\n}\n\nfunction rotateClockwise(x: number, y: number, degrees: number): { x: number; y: number } {\n if (degrees === 0) return { x, y }\n const rad = (degrees * Math.PI) / 180\n const cos = Math.cos(rad)\n const sin = Math.sin(rad)\n return { x: x * cos + y * sin, y: -x * sin + y * cos }\n}\n\nfunction sameSize(a: Size2D, b: Size2D): boolean {\n return Math.abs(a.width - b.width) < 1e-6 && Math.abs(a.height - b.height) < 1e-6\n}\n\nfunction lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t\n}\n\n/** The 2D node `id` names in the tree `from` is in, or `null`. */\nexport function findNode2D(from: Node2D, id: string): Node2D | null {\n let root: Node2D = from\n while (root.parent) root = root.parent\n return findIn(root, id)\n}\n\nfunction findIn(at: Node2D, id: string): Node2D | null {\n if (at.id === id) return at\n for (const child of at.children) {\n const found = findIn(child, id)\n if (found) return found\n }\n return null\n}\n\n/** Where `node`'s frame sits in `grid`'s: offset, turn and scale, y-up. */\nexport function frameIn(grid: Node2D, node: Node2D): { x: number; y: number; rotation: number; scale: number } {\n const there = node.global\n const here = grid.global\n const inverse = here.scale === 0 ? 0 : 1 / here.scale\n const offset = rotateClockwise((there.x - here.x) * inverse, (there.y - here.y) * inverse, -here.rotation)\n return { x: offset.x, y: offset.y, rotation: there.rotation - here.rotation, scale: there.scale * inverse }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,OAAgD,qBC4CnD,SAAUC,EAAKC,EAAWC,EAAWC,EAAc,CACvD,MAAO,CAAE,EAAA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AQA,EAAOA,EAAK,OAChC,OAAOC,GAAOD,EAAM1B,CAAE,CACxB,CAEA,SAAS2B,GAAOC,EAAY5B,EAAU,CACpC,GAAI4B,EAAG,KAAO5B,EAAI,OAAO4B,EACzB,QAAW7D,KAAS6D,EAAG,SAAU,CAC/B,IAAM1B,EAAQyB,GAAO5D,EAAOiC,CAAE,EAC9B,GAAIE,EAAO,OAAOA,CACpB,CACA,OAAO,IACT,CAGM,SAAUI,GAAQF,EAAcyB,EAAY,CAChD,IAAMC,EAAQD,EAAK,OACbE,EAAO3B,EAAK,OACZ4B,EAAUD,EAAK,QAAU,EAAI,EAAI,EAAIA,EAAK,MAC1CE,EAASzB,IAAiBsB,EAAM,EAAIC,EAAK,GAAKC,GAAUF,EAAM,EAAIC,EAAK,GAAKC,EAAS,CAACD,EAAK,QAAQ,EACzG,MAAO,CAAE,EAAGE,EAAO,EAAG,EAAGA,EAAO,EAAG,SAAUH,EAAM,SAAWC,EAAK,SAAU,MAAOD,EAAM,MAAQE,CAAO,CAC3G",
|
|
6
|
+
"names": ["pathOps", "slot", "x", "y", "meta", "blendSlot", "a", "b", "t", "mix", "p", "q", "spreadSlot", "s", "spread", "largest", "sizes", "width", "height", "size", "PATH_SPACINGS", "SAMPLERS", "SAMPLER_CACHE", "measured", "path", "hit", "contours", "pathOps", "entry", "pathSlots", "arrangement", "input", "count", "sampler", "closed", "length", "clamp01", "b", "start", "span", "loops", "offset", "place", "rad", "cos", "sin", "slots", "u", "visible", "at", "s", "slot", "flip", "px", "py", "v", "RADIAL_DIRECTIONS", "radialAngles", "arrangement", "count", "time", "sweep", "closing", "step", "sign", "start", "angles", "k", "radialSlots", "input", "angle", "rad", "s", "slot", "radialTurnToTop", "index", "wrapDegrees", "degrees", "wrapped", "FILL_DIRECTIONS", "CELL_MODES", "LINE_ALIGNS", "rectangularShape", "arrangement", "count", "columns", "rows", "rectangularCell", "sizes", "box", "largest", "rectangularSlots", "input", "byColumn", "lines", "perLine", "cell", "pitchX", "pitchY", "lastLine", "lastCount", "shortBy", "lead", "shiftX", "shiftY", "slots", "i", "line", "along", "row", "column", "rowIndex", "columnIndex", "x", "y", "slot", "SPHERE_FACINGS", "SPHERE_AXES", "GOLDEN_ANGLE", "DEG", "fibonacciPoint", "k", "count", "y", "r", "theta", "orient", "p", "yaw", "pitch", "roll", "x0", "y0", "z0", "ya", "pa", "ra", "x1", "z1", "y2", "z2", "sphereSlots", "arrangement", "input", "radius", "outward", "slots", "q", "nx", "ny", "nz", "s", "slot", "facesAway", "normal", "focal", "sphereFaceForward", "index", "x", "z", "PATH_TEMPLATES", "DRAWN", "DRAWN_CACHE", "templatePath", "template", "box", "key", "hit", "path", "drawTemplate", "w", "h", "rx", "ry", "closed", "points", "angle", "r", "sample", "t", "a", "x", "y", "d", "open", "ellipse", "k", "steps", "at", "i", "slotsOf", "arrangement", "input", "rectangularSlots", "radialSlots", "pathSlots", "sphereSlots", "focalLengthOf", "seededRandom", "seed", "a", "t", "shuffled", "values", "out", "random", "i", "j", "hashSeed", "text", "h", "STAGGER_ORDERS", "MAX_STAGGER", "staggerRanks", "order", "slots", "seed", "n", "keys", "keysOf", "min", "max", "key", "range", "staggerProgress", "rank", "stagger", "s", "p", "_", "i", "sequence", "shuffled", "item", "clockAngle", "angle", "REVEAL_STYLES", "WAVE_STYLES", "applyItemEffects", "s", "i", "size", "reveal", "wave", "focus", "applyReveal", "applyWave", "applyFocus", "style", "v", "shown", "clamp01", "w", "f", "normalizeOrder", "order", "count", "out", "taken", "entry", "item", "slotOfItem", "slots", "slot", "parseOrder", "value", "part", "command", "easeIn", "easeInOut", "easeOut", "flowOps", "insetsOps", "Node2D", "property", "sizeInputOps", "staggerArgs", "fallback", "STAGGER_ORDERS", "LAYOUT_GRID_TYPES", "TRANSITION_STAGGER", "NO_CONTENT", "CENTRE", "LayoutGrid", "_LayoutGrid", "Node2D", "args", "style", "ease", "easeOut", "ranks", "stagger", "t", "rank", "staggerProgress", "easeIn", "easeInOut", "from", "i", "amount", "n", "item", "k", "v", "current", "normalizeOrder", "next", "shuffled", "order", "a", "b", "parseOrder", "props", "sizeInputOps", "_count", "space", "_sizes", "constraints", "scope", "padding", "items", "flowOps", "sizes", "extentOf", "rect", "inner", "insetsOps", "measured", "sameSize", "slots", "s", "child", "focal", "contentBoxOf", "staggerRanks", "hashSeed", "changes", "spread", "mix", "isFocus", "count", "dim", "grow", "target", "_", "e", "lerp", "source", "cell", "box", "arrangement", "slotsOf", "slotOfItem", "spreadSlot", "focalLengthOf", "transition", "fromBox", "leaving", "slotOf", "blendSlot", "reveal", "wave", "focus", "applyItemEffects", "id", "cached", "found", "findNode2D", "grid", "frame", "frameIn", "p", "rotateClockwise", "__decorate", "property", "command", "REVEAL_STYLES", "WAVE_STYLES", "halfWidth", "halfHeight", "size", "rad", "cos", "sin", "lens", "w", "h", "x", "y", "degrees", "root", "findIn", "at", "node", "there", "here", "inverse", "offset"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as gt,B as wt,C as St,D as vt,E as Tt,F as _t,G as kt,H as xt,I as Gt,J as Ot,K as G,L as Pt,M as Rt,N as O,O as At,P,Q as S,R as B,S as K,T as I,a as nt,b as at,c as rt,d as dt,e as D,f as st,g as M,h as lt,i as pt,j as N,k as A,l as H,m as C,n as F,o as ut,p as E,q as ht,r as j,s as W,t as ct,u as ft,v as mt,w as X,x as z,y as Y,z as yt}from"./chunks/chunk-PB3E5HQV.js";import{command as T,easeInOut as Z,node as q,property as y}from"@motionscript/core";var p=function(r,t,e,i){var o=arguments.length,n=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,t,e,i);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(n=(o<3?a(n):o>3?a(t,e,n):a(t,e))||n);return o>3&&n&&Object.defineProperty(t,e,n),n},d=class extends S{constructor(t){super(t)}columnsTo(t){let e=Math.max(1,Math.round(t.data?.columns??this.columns));return this._transitionTo({columns:e},t)}gapTo(t){let e={};return t.data?.columnGap!==void 0&&(e.columnGap=t.data.columnGap),t.data?.rowGap!==void 0&&(e.rowGap=t.data.rowGap),this.to({data:e,duration:t.duration,easing:t.easing})}cellSizeTo(t){let e=this._itemSizes(),i=E(this.arrangementFor(),e.length,e,B(this)),o=t.data?.cellWidth??i.width,n=t.data?.cellHeight??i.height;return this.command(a=>({cellMode:"fixed",cellWidth:i.width+(o-i.width)*a,cellHeight:i.height+(n-i.height)*a}),t.duration,t.easing??Z("cubic"))}focusRow(t){let e=this._itemSlots(),i=Math.round(t.data?.row??0);return this._focusOn(o=>e[o]?.meta.kind==="rectangular"&&e[o].meta.row===i,e.length,t)}focusColumn(t){let e=this._itemSlots(),i=Math.round(t.data?.column??0);return this._focusOn(o=>e[o]?.meta.kind==="rectangular"&&e[o].meta.column===i,e.length,t)}arrangementFor(){return{kind:"rectangular",columns:this.columns,fillDirection:this.fillDirection,cellMode:this.cellMode,cellWidth:this.cellWidth,cellHeight:this.cellHeight,columnGap:this.columnGap,rowGap:this.rowGap,lastLineAlign:this.lastLineAlign,rowOffset:this.rowOffset,columnOffset:this.columnOffset}}itemSpace(t,e){return this.cellMode==="fit"?e:E(this.arrangementFor(),t,[],e)}};p([y({default:3,min:1,step:1})],d.prototype,"columns",void 0);p([y({default:"row",kind:"enum",options:H})],d.prototype,"fillDirection",void 0);p([y({default:"fit",kind:"enum",options:C})],d.prototype,"cellMode",void 0);p([y({default:120,min:0,step:1})],d.prototype,"cellWidth",void 0);p([y({default:120,min:0,step:1})],d.prototype,"cellHeight",void 0);p([y({default:24,step:1})],d.prototype,"columnGap",void 0);p([y({default:24,step:1})],d.prototype,"rowGap",void 0);p([y({default:"start",kind:"enum",options:F})],d.prototype,"lastLineAlign",void 0);p([y({default:0,min:-1,max:1,step:.05})],d.prototype,"rowOffset",void 0);p([y({default:0,min:-1,max:1,step:.05})],d.prototype,"columnOffset",void 0);p([T({args:[{key:"columns",min:1,step:1,default:4},...O(P)]})],d.prototype,"columnsTo",null);p([T({args:[{key:"columnGap",default:48},{key:"rowGap",default:48}]})],d.prototype,"gapTo",null);p([T({args:[{key:"cellWidth",min:0,default:160},{key:"cellHeight",min:0,default:160}]})],d.prototype,"cellSizeTo",null);p([T({args:[{key:"row",min:0,step:1,default:0},{key:"dim",min:0,max:1,step:.05,default:.7},{key:"grow",min:0,max:1,step:.05,default:.1}]})],d.prototype,"focusRow",null);p([T({args:[{key:"column",min:0,step:1,default:0},{key:"dim",min:0,max:1,step:.05,default:.7},{key:"grow",min:0,max:1,step:.05,default:.1}]})],d.prototype,"focusColumn",null);d=p([q({key:"rectangularGrid",parentKey:"node",forkable:!0,layout:{children:"grid",acceptsChildren:!0,defaultWidthMode:"hug",defaultHeightMode:"hug"}})],d);import{command as R,node as J,property as v}from"@motionscript/core";var m=function(r,t,e,i){var o=arguments.length,n=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,t,e,i);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(n=(o<3?a(n):o>3?a(t,e,n):a(t,e))||n);return o>3&&n&&Object.defineProperty(t,e,n),n},c=class extends S{constructor(t){super(t)}spin(t){let e=t.data?.degrees??360;return this.to({data:{startAngle:this.startAngle+e},duration:t.duration,easing:t.easing})}turnTo(t){let e=this._itemCount(),i=G(this.order,e).indexOf(Math.round(t.data?.item??0)),o=i<0?0:N(this.arrangementFor(),e,i);return this.to({data:{startAngle:this.startAngle+o},duration:t.duration,easing:t.easing})}radiusTo(t){return this.to({data:{radius:t.data?.radius??this.radius},duration:t.duration,easing:t.easing})}sweepTo(t){return this.to({data:{sweep:t.data?.sweep??this.sweep},duration:t.duration,easing:t.easing})}arrangementFor(){return{kind:"radial",radius:this.radius,startAngle:this.startAngle,sweep:this.sweep,direction:this.direction,rotateItems:this.rotateItems,spinSpeed:this.spinSpeed}}};m([v({default:200,min:0,step:1})],c.prototype,"radius",void 0);m([v({default:0,step:1,unit:"\xB0"})],c.prototype,"startAngle",void 0);m([v({default:360,min:-360,max:360,step:1,unit:"\xB0"})],c.prototype,"sweep",void 0);m([v({default:"clockwise",kind:"enum",options:M})],c.prototype,"direction",void 0);m([v({default:!1})],c.prototype,"rotateItems",void 0);m([v({default:0,step:1,unit:"\xB0/s"})],c.prototype,"spinSpeed",void 0);m([R({args:[{key:"degrees",step:15,unit:"\xB0",default:360}]})],c.prototype,"spin",null);m([R({args:[{key:"item",min:0,step:1,default:0}]})],c.prototype,"turnTo",null);m([R({args:[{key:"radius",min:0,default:280}]})],c.prototype,"radiusTo",null);m([R({args:[{key:"sweep",min:-360,max:360,unit:"\xB0",default:360}]})],c.prototype,"sweepTo",null);c=m([J({key:"radialGrid",parentKey:"node",forkable:!0,layout:{children:"flow",acceptsChildren:!0,defaultWidthMode:"hug",defaultHeightMode:"hug"}})],c);import{command as b,node as Q,Path as V,pathOps as _,PathShape as $,pathProperty as tt,property as g}from"@motionscript/core";var f=function(r,t,e,i){var o=arguments.length,n=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,t,e,i);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(n=(o<3?a(n):o>3?a(t,e,n):a(t,e))||n);return o>3&&n&&Object.defineProperty(t,e,n),n},U=[...z,"custom"],L={originX:0,originY:0,x:0,y:0,rotation:0,scale:1},k={width:640,height:400},l=class extends S{constructor(t){super(t)}flow(t){let e=t.data?.loops??1;return this.to({data:{offset:this.offset+e},duration:t.duration,easing:t.easing})}trimTo(t){return this.to({data:{trimStart:t.data?.trimStart??this.trimStart,trimEnd:t.data?.trimEnd??this.trimEnd},duration:t.duration,easing:t.easing})}setPath(t){let e=t.data?.pathNode??"",i=e?{pathNode:e}:{shape:t.data?.shape??this.shape,pathNode:""};return this._transitionTo(i,t)}arrangementFor(t){let{path:e,placement:i}=this._pathIn(t);return{kind:"path",path:e,placement:i,spacing:this.spacing,spacingDistance:this.spacingDistance,offset:this.offset,flowSpeed:this.flowSpeed,trimStart:this.trimStart,trimEnd:this.trimEnd,alignToPath:this.alignToPath}}applyDefaultSize(t){(!t||t.width===void 0)&&this.applyProp("width",k.width),(!t||t.height===void 0)&&this.applyProp("height",k.height)}_linked=null;_pathIn(t){let e=this.pathNode?K(this,this.pathNode):null;if(e instanceof $)return{path:this._unitPath(e),placement:{...L,...I(this,e)}};if(e instanceof V&&_.bounds(e.data)){let o=_.bounds(e.data),n=I(this,e);return{path:e.data,placement:{originX:(o.minX+o.maxX)/2,originY:(o.minY+o.maxY)/2,...n}}}if(this.shape==="custom"){let o=_.bounds(this.path);if(o)return{path:this.path,placement:{...L,originX:(o.minX+o.maxX)/2,originY:(o.minY+o.maxY)/2,flipY:!0}}}let i=this.shape==="custom"?"circle":this.shape;return{path:Y(i,t),placement:L}}_unitPath(t){let{width:e,height:i}=t.layoutBounds,o=this._linked;if(o&&o.data===t.data&&o.width===e&&o.height===i)return o.path;let n=_.anchorCommands(_.anchors(t.data),a=>({x:a.x*e,y:-a.y*i}));return this._linked={data:t.data,width:e,height:i,path:n},n}};f([g({default:"circle",kind:"enum",options:U})],l.prototype,"shape",void 0);f([tt()],l.prototype,"path",void 0);f([g({default:"",kind:"nodeRef",nodeTypes:["path"],animatable:!1})],l.prototype,"pathNode",void 0);f([g({default:"distribute",kind:"enum",options:D})],l.prototype,"spacing",void 0);f([g({default:80,min:0,step:1})],l.prototype,"spacingDistance",void 0);f([g({default:0,step:.01})],l.prototype,"offset",void 0);f([g({default:0,step:.01,unit:"/s"})],l.prototype,"flowSpeed",void 0);f([g({default:0,min:0,max:1,step:.01})],l.prototype,"trimStart",void 0);f([g({default:1,min:0,max:1,step:.01})],l.prototype,"trimEnd",void 0);f([g({default:!0})],l.prototype,"alignToPath",void 0);f([b({args:[{key:"loops",step:.25,default:1}]})],l.prototype,"flow",null);f([b({args:[{key:"trimStart",min:0,max:1,step:.01,default:.25},{key:"trimEnd",min:0,max:1,step:.01,default:.75}]})],l.prototype,"trimTo",null);f([b({args:[{key:"shape",kind:"enum",options:U,default:"heart"},{key:"pathNode",kind:"nodeRef",nodeTypes:["path"]},...O(P)]})],l.prototype,"setPath",null);l=f([Q({key:"pathGrid",parentKey:"node",forkable:!0,layout:{children:"flow",acceptsChildren:!0,defaultWidthMode:"fixed",defaultHeightMode:"fixed",defaultWidth:k.width,defaultHeight:k.height},seed:{...k}})],l);import{command as x,node as et,property as w}from"@motionscript/core";var h=function(r,t,e,i){var o=arguments.length,n=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,t,e,i);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(n=(o<3?a(n):o>3?a(t,e,n):a(t,e))||n);return o>3&&n&&Object.defineProperty(t,e,n),n},ot={x:"pitch",y:"yaw",z:"roll"},s=class extends S{constructor(t){super(t)}spin(t){let e=ot[t.data?.axis??"y"]??"yaw",i=t.data?.degrees??360;return this.to({data:{[e]:this[e]+i},duration:t.duration,easing:t.easing})}orientTo(t){return this.to({data:{yaw:t.data?.yaw??this.yaw,pitch:t.data?.pitch??this.pitch,roll:t.data?.roll??this.roll},duration:t.duration,easing:t.easing})}turnTo(t){let e=this._itemCount(),i=G(this.order,e).indexOf(Math.round(t.data?.item??0));if(i<0)return this.to({data:{},duration:t.duration});let o=X(e,i),n=this.spinSpeed*this.time.total;return this.to({data:{yaw:this.yaw+A(o.yaw-(this.yaw+n)),pitch:this.pitch+A(o.pitch-this.pitch),roll:0},duration:t.duration,easing:t.easing})}radiusTo(t){return this.to({data:{radius:t.data?.radius??this.radius},duration:t.duration,easing:t.easing})}focalLengthTo(t){return this.to({data:{focalLength:t.data?.focalLength??this.focalLength},duration:t.duration,easing:t.easing})}arrangementFor(){return{kind:"sphere",radius:this.radius,yaw:this.yaw,pitch:this.pitch,roll:this.roll,facing:this.facing,focalLength:this.focalLength,depthFade:this.depthFade,cullBackfaces:this.cullBackfaces,spinSpeed:this.spinSpeed}}};h([w({default:220,min:0,step:1})],s.prototype,"radius",void 0);h([w({default:0,step:1,unit:"\xB0"})],s.prototype,"yaw",void 0);h([w({default:0,step:1,unit:"\xB0"})],s.prototype,"pitch",void 0);h([w({default:0,step:1,unit:"\xB0"})],s.prototype,"roll",void 0);h([w({default:"outward",kind:"enum",options:j})],s.prototype,"facing",void 0);h([w({default:900,min:100,step:10})],s.prototype,"focalLength",void 0);h([w({default:.5,min:0,max:1,step:.05})],s.prototype,"depthFade",void 0);h([w({default:!1})],s.prototype,"cullBackfaces",void 0);h([w({default:0,step:1,unit:"\xB0/s"})],s.prototype,"spinSpeed",void 0);h([x({args:[{key:"axis",kind:"enum",options:W,default:"y"},{key:"degrees",step:15,unit:"\xB0",default:360}]})],s.prototype,"spin",null);h([x({args:[{key:"yaw",unit:"\xB0",default:45},{key:"pitch",unit:"\xB0",default:20},{key:"roll",unit:"\xB0",default:0}]})],s.prototype,"orientTo",null);h([x({args:[{key:"item",min:0,step:1,default:0}]})],s.prototype,"turnTo",null);h([x({args:[{key:"radius",min:0,default:300}]})],s.prototype,"radiusTo",null);h([x({args:[{key:"focalLength",min:100,default:600}]})],s.prototype,"focalLengthTo",null);s=h([et({key:"sphereGrid",parentKey:"node",forkable:!0,layout:{children:"flow",acceptsChildren:!0,defaultWidthMode:"hug",defaultHeightMode:"hug"}})],s);var it=[d,c,l,s];export{C as CELL_MODES,H as FILL_DIRECTIONS,At as LAYOUT_GRID_TYPES,F as LINE_ALIGNS,S as LayoutGrid,it as NODES,U as PATH_GRID_SHAPES,D as PATH_SPACINGS,z as PATH_TEMPLATES,l as PathGrid,M as RADIAL_DIRECTIONS,xt as REVEAL_STYLES,c as RadialGrid,d as RectangularGrid,W as SPHERE_AXES,j as SPHERE_FACINGS,Tt as STAGGER_ORDERS,s as SphereGrid,P as TRANSITION_STAGGER,Gt as WAVE_STYLES,Ot as applyItemEffects,at as blendSlot,B as contentBoxOf,ct as fibonacciPoint,K as findNode2D,gt as focalLengthOf,I as frameIn,vt as hashSeed,dt as largest,G as normalizeOrder,ft as orient,Rt as parseOrder,st as pathSlots,lt as radialAngles,pt as radialSlots,N as radialTurnToTop,E as rectangularCell,ut as rectangularShape,ht as rectangularSlots,wt as seededRandom,St as shuffled,nt as slot,Pt as slotOfItem,yt as slotsOf,X as sphereFaceForward,mt as sphereSlots,rt as spreadSlot,O as staggerArgs,kt as staggerProgress,_t as staggerRanks,Y as templatePath,A as wrapDegrees};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|