@motionscript/grids 0.1.0-alpha.5 → 0.1.0-alpha.7
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 +24 -0
- package/README.md +47 -15
- package/dist/browser/chunks/chunk-J62D7EFZ.js +2 -0
- package/dist/browser/chunks/chunk-J62D7EFZ.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/engine.d.ts +4 -4
- package/dist/engine.js +4 -4
- package/dist/engine.js.map +1 -1
- package/dist/kit/index.d.ts +3 -1
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +4 -1
- package/dist/kit/index.js.map +1 -1
- package/dist/kit/item-grid.d.ts +203 -198
- package/dist/kit/item-grid.d.ts.map +1 -1
- package/dist/kit/item-grid.js +413 -440
- package/dist/kit/item-grid.js.map +1 -1
- package/dist/nodes.d.ts +8 -3
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +6 -10
- package/dist/nodes.js.map +1 -1
- package/dist/path-grid/path-grid.d.ts +187 -73
- package/dist/path-grid/path-grid.d.ts.map +1 -1
- package/dist/path-grid/path-grid.js +129 -172
- package/dist/path-grid/path-grid.js.map +1 -1
- package/dist/radial-grid/radial-grid.d.ts +171 -45
- package/dist/radial-grid/radial-grid.d.ts.map +1 -1
- package/dist/radial-grid/radial-grid.js +55 -87
- package/dist/radial-grid/radial-grid.js.map +1 -1
- package/dist/rectangular-grid/rectangular-grid.d.ts +203 -70
- package/dist/rectangular-grid/rectangular-grid.d.ts.map +1 -1
- package/dist/rectangular-grid/rectangular-grid.js +107 -145
- package/dist/rectangular-grid/rectangular-grid.js.map +1 -1
- package/dist/sphere-grid/sphere-grid.d.ts +192 -60
- package/dist/sphere-grid/sphere-grid.d.ts.map +1 -1
- package/dist/sphere-grid/sphere-grid.js +90 -137
- package/dist/sphere-grid/sphere-grid.js.map +1 -1
- package/package.json +4 -4
- package/src/engine.ts +4 -4
- package/src/kit/index.ts +13 -1
- package/src/kit/item-grid.ts +505 -442
- package/src/nodes.ts +18 -3
- package/src/path-grid/path-grid.ts +137 -164
- package/src/radial-grid/radial-grid.ts +69 -78
- package/src/rectangular-grid/rectangular-grid.ts +118 -133
- package/src/sphere-grid/sphere-grid.ts +103 -117
- package/dist/browser/chunks/chunk-XDUDKWM7.js +0 -2
- package/dist/browser/chunks/chunk-XDUDKWM7.js.map +0 -7
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { ItemGrid
|
|
3
|
-
export interface RectangularGridProps extends ItemGridProps {
|
|
4
|
-
columns: number;
|
|
5
|
-
fillDirection: FillDirection;
|
|
6
|
-
cellMode: CellMode;
|
|
7
|
-
cellWidth: number;
|
|
8
|
-
cellHeight: number;
|
|
9
|
-
columnGap: number;
|
|
10
|
-
rowGap: number;
|
|
11
|
-
lastLineAlign: LineAlign;
|
|
12
|
-
rowOffset: number;
|
|
13
|
-
columnOffset: number;
|
|
14
|
-
}
|
|
1
|
+
import { type NodeOf, type Node2D as _Node2D, type Node2DProps as _Node2DProps } from "@motionscript/sdk";
|
|
2
|
+
import { ItemGrid } from "../kit/index.js";
|
|
15
3
|
/**
|
|
16
4
|
* Children in rows and columns — the grid the other three are variations on.
|
|
17
5
|
*
|
|
@@ -20,60 +8,205 @@ export interface RectangularGridProps extends ItemGridProps {
|
|
|
20
8
|
* room a child set to fill grows into. Shift every other row by half a cell
|
|
21
9
|
* for a brick bond or a hex pack.
|
|
22
10
|
*/
|
|
23
|
-
export declare
|
|
24
|
-
columns: number
|
|
25
|
-
fillDirection:
|
|
26
|
-
cellMode:
|
|
27
|
-
cellWidth: number
|
|
28
|
-
cellHeight: number
|
|
29
|
-
columnGap: number
|
|
30
|
-
rowGap: number
|
|
31
|
-
lastLineAlign:
|
|
32
|
-
rowOffset: number
|
|
33
|
-
columnOffset: number
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
dim
|
|
63
|
-
grow
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
11
|
+
export declare const RectangularGrid: import("@motionscript/sdk").Component<"rectangularGrid", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
12
|
+
readonly columns: import("@motionscript/sdk").Type<number, number, false>;
|
|
13
|
+
readonly fillDirection: import("@motionscript/sdk").Type<"row" | "column", "row" | "column", false>;
|
|
14
|
+
readonly cellMode: import("@motionscript/sdk").Type<"fixed" | "fit" | "fill", "fixed" | "fit" | "fill", false>;
|
|
15
|
+
readonly cellWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
16
|
+
readonly cellHeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
17
|
+
readonly columnGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
18
|
+
readonly rowGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
19
|
+
readonly lastLineAlign: import("@motionscript/sdk").Type<"start" | "center" | "end", "start" | "center" | "end", false>;
|
|
20
|
+
readonly rowOffset: import("@motionscript/sdk").Type<number, number, false>;
|
|
21
|
+
readonly columnOffset: import("@motionscript/sdk").Type<number, number, false>;
|
|
22
|
+
readonly order: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
23
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
24
|
+
readonly arrangeLike: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
25
|
+
readonly revealState: import("@motionscript/sdk").Type<import("../index.js").RevealState | null | undefined, import("../index.js").RevealState | null | undefined, false>;
|
|
26
|
+
readonly waveState: import("@motionscript/sdk").Type<import("../index.js").WaveState | null | undefined, import("../index.js").WaveState | null | undefined, false>;
|
|
27
|
+
readonly focusState: import("@motionscript/sdk").Type<import("../index.js").FocusState | null | undefined, import("../index.js").FocusState | null | undefined, false>;
|
|
28
|
+
readonly transition: import("@motionscript/sdk").Type<ItemGrid.GridTransition | null | undefined, ItemGrid.GridTransition | null | undefined, false>;
|
|
29
|
+
readonly transitionSource: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
|
|
30
|
+
}>, {
|
|
31
|
+
readonly columnsTo: {
|
|
32
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
33
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
34
|
+
readonly columns: import("@motionscript/sdk").Type<4 | undefined, 4 | undefined, false>;
|
|
35
|
+
};
|
|
36
|
+
readonly gapTo: {
|
|
37
|
+
readonly columnGap: import("@motionscript/sdk").Type<48 | undefined, 48 | undefined, false>;
|
|
38
|
+
readonly rowGap: import("@motionscript/sdk").Type<48 | undefined, 48 | undefined, false>;
|
|
39
|
+
};
|
|
40
|
+
readonly cellSizeTo: {
|
|
41
|
+
readonly cellWidth: import("@motionscript/sdk").Type<160 | undefined, 160 | undefined, false>;
|
|
42
|
+
readonly cellHeight: import("@motionscript/sdk").Type<160 | undefined, 160 | undefined, false>;
|
|
43
|
+
};
|
|
44
|
+
readonly focusRow: {
|
|
45
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
46
|
+
readonly grow: import("@motionscript/sdk").Type<0.1 | undefined, 0.1 | undefined, false>;
|
|
47
|
+
readonly row: import("@motionscript/sdk").Type<number, number, false>;
|
|
48
|
+
};
|
|
49
|
+
readonly focusColumn: {
|
|
50
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
51
|
+
readonly grow: import("@motionscript/sdk").Type<0.1 | undefined, 0.1 | undefined, false>;
|
|
52
|
+
readonly column: import("@motionscript/sdk").Type<number, number, false>;
|
|
53
|
+
};
|
|
54
|
+
readonly reveal: {
|
|
55
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
56
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
57
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
58
|
+
};
|
|
59
|
+
readonly conceal: {
|
|
60
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
61
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
62
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
63
|
+
};
|
|
64
|
+
readonly wave: {
|
|
65
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
66
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
67
|
+
readonly style: import("@motionscript/sdk").Type<"scale" | "fade" | "spin" | "lift", "scale" | "fade" | "spin" | "lift", false>;
|
|
68
|
+
readonly amount: import("@motionscript/sdk").Type<number, number, false>;
|
|
69
|
+
};
|
|
70
|
+
readonly focus: {
|
|
71
|
+
readonly item: import("@motionscript/sdk").Type<number, number, false>;
|
|
72
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
73
|
+
readonly grow: import("@motionscript/sdk").Type<number, number, false>;
|
|
74
|
+
};
|
|
75
|
+
readonly unfocus: unknown;
|
|
76
|
+
readonly spreadTo: {
|
|
77
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
78
|
+
};
|
|
79
|
+
readonly shuffle: {
|
|
80
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
81
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
82
|
+
readonly seed: import("@motionscript/sdk").Type<number, number, false>;
|
|
83
|
+
};
|
|
84
|
+
readonly swap: {
|
|
85
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
86
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
87
|
+
readonly first: import("@motionscript/sdk").Type<number, number, false>;
|
|
88
|
+
readonly second: import("@motionscript/sdk").Type<number, number, false>;
|
|
89
|
+
};
|
|
90
|
+
readonly reorder: {
|
|
91
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
92
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
93
|
+
readonly order: import("@motionscript/sdk").Type<string, string, false>;
|
|
94
|
+
};
|
|
95
|
+
readonly morphInto: {
|
|
96
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
97
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
98
|
+
readonly target: import("@motionscript/sdk").Type<string | undefined, string | undefined, false>;
|
|
99
|
+
};
|
|
100
|
+
}, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
101
|
+
readonly columns: import("@motionscript/sdk").Type<number, number, false>;
|
|
102
|
+
readonly fillDirection: import("@motionscript/sdk").Type<"row" | "column", "row" | "column", false>;
|
|
103
|
+
readonly cellMode: import("@motionscript/sdk").Type<"fixed" | "fit" | "fill", "fixed" | "fit" | "fill", false>;
|
|
104
|
+
readonly cellWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
105
|
+
readonly cellHeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
106
|
+
readonly columnGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
107
|
+
readonly rowGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
108
|
+
readonly lastLineAlign: import("@motionscript/sdk").Type<"start" | "center" | "end", "start" | "center" | "end", false>;
|
|
109
|
+
readonly rowOffset: import("@motionscript/sdk").Type<number, number, false>;
|
|
110
|
+
readonly columnOffset: import("@motionscript/sdk").Type<number, number, false>;
|
|
111
|
+
readonly order: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
112
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
113
|
+
readonly arrangeLike: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
114
|
+
readonly revealState: import("@motionscript/sdk").Type<import("../index.js").RevealState | null | undefined, import("../index.js").RevealState | null | undefined, false>;
|
|
115
|
+
readonly waveState: import("@motionscript/sdk").Type<import("../index.js").WaveState | null | undefined, import("../index.js").WaveState | null | undefined, false>;
|
|
116
|
+
readonly focusState: import("@motionscript/sdk").Type<import("../index.js").FocusState | null | undefined, import("../index.js").FocusState | null | undefined, false>;
|
|
117
|
+
readonly transition: import("@motionscript/sdk").Type<ItemGrid.GridTransition | null | undefined, ItemGrid.GridTransition | null | undefined, false>;
|
|
118
|
+
readonly transitionSource: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
|
|
119
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
120
|
+
readonly columns: import("@motionscript/sdk").Type<number, number, false>;
|
|
121
|
+
readonly fillDirection: import("@motionscript/sdk").Type<"row" | "column", "row" | "column", false>;
|
|
122
|
+
readonly cellMode: import("@motionscript/sdk").Type<"fixed" | "fit" | "fill", "fixed" | "fit" | "fill", false>;
|
|
123
|
+
readonly cellWidth: import("@motionscript/sdk").Type<number, number, false>;
|
|
124
|
+
readonly cellHeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
125
|
+
readonly columnGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
126
|
+
readonly rowGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
127
|
+
readonly lastLineAlign: import("@motionscript/sdk").Type<"start" | "center" | "end", "start" | "center" | "end", false>;
|
|
128
|
+
readonly rowOffset: import("@motionscript/sdk").Type<number, number, false>;
|
|
129
|
+
readonly columnOffset: import("@motionscript/sdk").Type<number, number, false>;
|
|
130
|
+
readonly order: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
131
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
132
|
+
readonly arrangeLike: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
133
|
+
readonly revealState: import("@motionscript/sdk").Type<import("../index.js").RevealState | null | undefined, import("../index.js").RevealState | null | undefined, false>;
|
|
134
|
+
readonly waveState: import("@motionscript/sdk").Type<import("../index.js").WaveState | null | undefined, import("../index.js").WaveState | null | undefined, false>;
|
|
135
|
+
readonly focusState: import("@motionscript/sdk").Type<import("../index.js").FocusState | null | undefined, import("../index.js").FocusState | null | undefined, false>;
|
|
136
|
+
readonly transition: import("@motionscript/sdk").Type<ItemGrid.GridTransition | null | undefined, ItemGrid.GridTransition | null | undefined, false>;
|
|
137
|
+
readonly transitionSource: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
|
|
138
|
+
}>, {
|
|
139
|
+
readonly columnsTo: {
|
|
140
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
141
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
142
|
+
readonly columns: import("@motionscript/sdk").Type<4 | undefined, 4 | undefined, false>;
|
|
143
|
+
};
|
|
144
|
+
readonly gapTo: {
|
|
145
|
+
readonly columnGap: import("@motionscript/sdk").Type<48 | undefined, 48 | undefined, false>;
|
|
146
|
+
readonly rowGap: import("@motionscript/sdk").Type<48 | undefined, 48 | undefined, false>;
|
|
147
|
+
};
|
|
148
|
+
readonly cellSizeTo: {
|
|
149
|
+
readonly cellWidth: import("@motionscript/sdk").Type<160 | undefined, 160 | undefined, false>;
|
|
150
|
+
readonly cellHeight: import("@motionscript/sdk").Type<160 | undefined, 160 | undefined, false>;
|
|
151
|
+
};
|
|
152
|
+
readonly focusRow: {
|
|
153
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
154
|
+
readonly grow: import("@motionscript/sdk").Type<0.1 | undefined, 0.1 | undefined, false>;
|
|
155
|
+
readonly row: import("@motionscript/sdk").Type<number, number, false>;
|
|
156
|
+
};
|
|
157
|
+
readonly focusColumn: {
|
|
158
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
159
|
+
readonly grow: import("@motionscript/sdk").Type<0.1 | undefined, 0.1 | undefined, false>;
|
|
160
|
+
readonly column: import("@motionscript/sdk").Type<number, number, false>;
|
|
161
|
+
};
|
|
162
|
+
readonly reveal: {
|
|
163
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
164
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
165
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
166
|
+
};
|
|
167
|
+
readonly conceal: {
|
|
168
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
169
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
170
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
171
|
+
};
|
|
172
|
+
readonly wave: {
|
|
173
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
174
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
175
|
+
readonly style: import("@motionscript/sdk").Type<"scale" | "fade" | "spin" | "lift", "scale" | "fade" | "spin" | "lift", false>;
|
|
176
|
+
readonly amount: import("@motionscript/sdk").Type<number, number, false>;
|
|
177
|
+
};
|
|
178
|
+
readonly focus: {
|
|
179
|
+
readonly item: import("@motionscript/sdk").Type<number, number, false>;
|
|
180
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
181
|
+
readonly grow: import("@motionscript/sdk").Type<number, number, false>;
|
|
182
|
+
};
|
|
183
|
+
readonly unfocus: unknown;
|
|
184
|
+
readonly spreadTo: {
|
|
185
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
186
|
+
};
|
|
187
|
+
readonly shuffle: {
|
|
188
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
189
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
190
|
+
readonly seed: import("@motionscript/sdk").Type<number, number, false>;
|
|
191
|
+
};
|
|
192
|
+
readonly swap: {
|
|
193
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
194
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
195
|
+
readonly first: import("@motionscript/sdk").Type<number, number, false>;
|
|
196
|
+
readonly second: import("@motionscript/sdk").Type<number, number, false>;
|
|
197
|
+
};
|
|
198
|
+
readonly reorder: {
|
|
199
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
200
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
201
|
+
readonly order: import("@motionscript/sdk").Type<string, string, false>;
|
|
202
|
+
};
|
|
203
|
+
readonly morphInto: {
|
|
204
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
205
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
206
|
+
readonly target: import("@motionscript/sdk").Type<string | undefined, string | undefined, false>;
|
|
207
|
+
};
|
|
208
|
+
}, _Node2D<_Node2DProps>>>>;
|
|
209
|
+
export type RectangularGrid = NodeOf<typeof RectangularGrid>;
|
|
210
|
+
/** What a call or a document row may set. */
|
|
211
|
+
export type RectangularGridProps = NonNullable<Parameters<typeof RectangularGrid>[0]>;
|
|
79
212
|
//# sourceMappingURL=rectangular-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectangular-grid.d.ts","sourceRoot":"","sources":["../../src/rectangular-grid/rectangular-grid.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"rectangular-grid.d.ts","sourceRoot":"","sources":["../../src/rectangular-grid/rectangular-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,MAAM,EAGX,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EACjC,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAGL,QAAQ,EAMT,MAAM,QAAQ,CAAA;AA6Cf;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAmEf,CAAA;AAEb,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAA;AAC5D,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,11 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { component2d, easeInOut, Types, } from "@motionscript/sdk";
|
|
2
|
+
import { CELL_MODES, FILL_DIRECTIONS, ItemGrid, LINE_ALIGNS, rectangularCell, staggerArgs, TRANSITION_STAGGER, } from "../kit/index.js";
|
|
3
|
+
const own = {
|
|
4
|
+
columns: Types.number(3, { min: 1, step: 1 }),
|
|
5
|
+
fillDirection: Types.oneOf(FILL_DIRECTIONS, { default: "row" }),
|
|
6
|
+
cellMode: Types.oneOf(CELL_MODES, { default: "fit" }),
|
|
7
|
+
cellWidth: Types.number(120, { min: 0, step: 1 }),
|
|
8
|
+
cellHeight: Types.number(120, { min: 0, step: 1 }),
|
|
9
|
+
columnGap: Types.number(24, { step: 1 }),
|
|
10
|
+
rowGap: Types.number(24, { step: 1 }),
|
|
11
|
+
lastLineAlign: Types.oneOf(LINE_ALIGNS, { default: "start" }),
|
|
12
|
+
rowOffset: Types.number(0, { min: -1, max: 1, step: 0.05 }),
|
|
13
|
+
columnOffset: Types.number(0, { min: -1, max: 1, step: 0.05 }),
|
|
14
|
+
};
|
|
15
|
+
function arrangement(s) {
|
|
16
|
+
return {
|
|
17
|
+
kind: "rectangular",
|
|
18
|
+
columns: s.columns,
|
|
19
|
+
fillDirection: s.fillDirection,
|
|
20
|
+
cellMode: s.cellMode,
|
|
21
|
+
cellWidth: s.cellWidth,
|
|
22
|
+
cellHeight: s.cellHeight,
|
|
23
|
+
columnGap: s.columnGap,
|
|
24
|
+
rowGap: s.rowGap,
|
|
25
|
+
lastLineAlign: s.lastLineAlign,
|
|
26
|
+
rowOffset: s.rowOffset,
|
|
27
|
+
columnOffset: s.columnOffset,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const arranger = {
|
|
31
|
+
arrangement,
|
|
32
|
+
// A child set to fill takes its cell, where the cell is not simply the largest child.
|
|
33
|
+
itemSpace: (s, count, space) => (s.cellMode === "fit" ? space : rectangularCell(arrangement(s), count, [], space)),
|
|
34
|
+
};
|
|
35
|
+
/** The focus args of a row or a column: the grow a row leaves out is the shared focus's. */
|
|
36
|
+
const lineFocus = {
|
|
37
|
+
dim: Types.number(0.7, { min: 0, max: 1, step: 0.05 }),
|
|
38
|
+
grow: ItemGrid.hinted(0.1, { min: 0, max: 1, step: 0.05 }),
|
|
6
39
|
};
|
|
7
|
-
import { command, easeInOut, node, property, } from "@motionscript/sdk";
|
|
8
|
-
import { CELL_MODES, contentBoxOf, FILL_DIRECTIONS, LINE_ALIGNS, ItemGrid, rectangularCell, staggerArgs, TRANSITION_STAGGER, } from "../kit/index.js";
|
|
9
40
|
/**
|
|
10
41
|
* Children in rows and columns — the grid the other three are variations on.
|
|
11
42
|
*
|
|
@@ -14,143 +45,74 @@ import { CELL_MODES, contentBoxOf, FILL_DIRECTIONS, LINE_ALIGNS, ItemGrid, recta
|
|
|
14
45
|
* room a child set to fill grows into. Shift every other row by half a cell
|
|
15
46
|
* for a brick bond or a hex pack.
|
|
16
47
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
__decorate([
|
|
86
|
-
property({ default: 3, min: 1, step: 1 })
|
|
87
|
-
], RectangularGrid.prototype, "columns", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
property({ default: "row", kind: "enum", options: FILL_DIRECTIONS })
|
|
90
|
-
], RectangularGrid.prototype, "fillDirection", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
property({ default: "fit", kind: "enum", options: CELL_MODES })
|
|
93
|
-
], RectangularGrid.prototype, "cellMode", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
property({ default: 120, min: 0, step: 1 })
|
|
96
|
-
], RectangularGrid.prototype, "cellWidth", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
property({ default: 120, min: 0, step: 1 })
|
|
99
|
-
], RectangularGrid.prototype, "cellHeight", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
property({ default: 24, step: 1 })
|
|
102
|
-
], RectangularGrid.prototype, "columnGap", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
property({ default: 24, step: 1 })
|
|
105
|
-
], RectangularGrid.prototype, "rowGap", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
property({ default: "start", kind: "enum", options: LINE_ALIGNS })
|
|
108
|
-
], RectangularGrid.prototype, "lastLineAlign", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
property({ default: 0, min: -1, max: 1, step: 0.05 })
|
|
111
|
-
], RectangularGrid.prototype, "rowOffset", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
property({ default: 0, min: -1, max: 1, step: 0.05 })
|
|
114
|
-
], RectangularGrid.prototype, "columnOffset", void 0);
|
|
115
|
-
__decorate([
|
|
116
|
-
command({ args: [{ key: "columns", min: 1, step: 1, default: 4 }, ...staggerArgs(TRANSITION_STAGGER)] })
|
|
117
|
-
], RectangularGrid.prototype, "columnsTo", null);
|
|
118
|
-
__decorate([
|
|
119
|
-
command({ args: [{ key: "columnGap", default: 48 }, { key: "rowGap", default: 48 }] })
|
|
120
|
-
], RectangularGrid.prototype, "gapTo", null);
|
|
121
|
-
__decorate([
|
|
122
|
-
command({ args: [{ key: "cellWidth", min: 0, default: 160 }, { key: "cellHeight", min: 0, default: 160 }] })
|
|
123
|
-
], RectangularGrid.prototype, "cellSizeTo", null);
|
|
124
|
-
__decorate([
|
|
125
|
-
command({
|
|
126
|
-
args: [
|
|
127
|
-
{ key: "row", min: 0, step: 1, default: 0 },
|
|
128
|
-
{ key: "dim", min: 0, max: 1, step: 0.05, default: 0.7 },
|
|
129
|
-
{ key: "grow", min: 0, max: 1, step: 0.05, default: 0.1 },
|
|
130
|
-
],
|
|
131
|
-
})
|
|
132
|
-
], RectangularGrid.prototype, "focusRow", null);
|
|
133
|
-
__decorate([
|
|
134
|
-
command({
|
|
135
|
-
args: [
|
|
136
|
-
{ key: "column", min: 0, step: 1, default: 0 },
|
|
137
|
-
{ key: "dim", min: 0, max: 1, step: 0.05, default: 0.7 },
|
|
138
|
-
{ key: "grow", min: 0, max: 1, step: 0.05, default: 0.1 },
|
|
139
|
-
],
|
|
140
|
-
})
|
|
141
|
-
], RectangularGrid.prototype, "focusColumn", null);
|
|
142
|
-
RectangularGrid = __decorate([
|
|
143
|
-
node({
|
|
144
|
-
key: "rectangularGrid",
|
|
145
|
-
parentKey: "node",
|
|
146
|
-
forkable: true,
|
|
147
|
-
layout: {
|
|
148
|
-
children: "freeform",
|
|
149
|
-
acceptsChildren: true,
|
|
150
|
-
defaultWidthMode: "hug",
|
|
151
|
-
defaultHeightMode: "hug",
|
|
48
|
+
export const RectangularGrid = ItemGrid.define(component2d({
|
|
49
|
+
key: "rectangularGrid",
|
|
50
|
+
state: { ...ItemGrid.state, ...own },
|
|
51
|
+
defaults: ItemGrid.defaults,
|
|
52
|
+
commands: {
|
|
53
|
+
...ItemGrid.commands,
|
|
54
|
+
/** Re-flow the items into `columns` columns, each moving to its new cell. */
|
|
55
|
+
columnsTo: {
|
|
56
|
+
args: { columns: ItemGrid.hinted(4, { min: 1, step: 1 }), ...staggerArgs(TRANSITION_STAGGER) },
|
|
57
|
+
run: (timeline, s, children) => {
|
|
58
|
+
const columns = Math.max(1, Math.round(timeline.args.columns ?? s.columns));
|
|
59
|
+
return ItemGrid.transitionTo(timeline, s, children, { columns });
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
/** Animate the spacing between columns and rows. */
|
|
63
|
+
gapTo: {
|
|
64
|
+
args: { columnGap: ItemGrid.hinted(48), rowGap: ItemGrid.hinted(48) },
|
|
65
|
+
run: (timeline) => {
|
|
66
|
+
const data = {};
|
|
67
|
+
if (timeline.args.columnGap !== undefined)
|
|
68
|
+
data.columnGap = timeline.args.columnGap;
|
|
69
|
+
if (timeline.args.rowGap !== undefined)
|
|
70
|
+
data.rowGap = timeline.args.rowGap;
|
|
71
|
+
return timeline.tween(data);
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* Animate the cell size, from whatever the cells measure now. The grid
|
|
76
|
+
* switches to `fixed` cells as it starts, since a size of its own is what
|
|
77
|
+
* `fixed` means.
|
|
78
|
+
*/
|
|
79
|
+
cellSizeTo: {
|
|
80
|
+
args: { cellWidth: ItemGrid.hinted(160, { min: 0 }), cellHeight: ItemGrid.hinted(160, { min: 0 }) },
|
|
81
|
+
easing: easeInOut("cubic"),
|
|
82
|
+
run: (timeline, s, children) => {
|
|
83
|
+
const sizes = children.map((child) => child.size);
|
|
84
|
+
const box = ItemGrid.contentBox(timeline.node.size, s.padding);
|
|
85
|
+
const from = rectangularCell(arrangement(s), sizes.length, sizes, box);
|
|
86
|
+
const width = timeline.args.cellWidth ?? from.width;
|
|
87
|
+
const height = timeline.args.cellHeight ?? from.height;
|
|
88
|
+
return timeline.animate((t) => ({
|
|
89
|
+
cellMode: "fixed",
|
|
90
|
+
cellWidth: from.width + (width - from.width) * t,
|
|
91
|
+
cellHeight: from.height + (height - from.height) * t,
|
|
92
|
+
}));
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
/** Bring one row (from 0 at the top) forward and push the rest back. */
|
|
96
|
+
focusRow: {
|
|
97
|
+
args: { row: Types.number(0, { min: 0, step: 1 }), ...lineFocus },
|
|
98
|
+
run: (timeline, s, children) => {
|
|
99
|
+
const slots = ItemGrid.itemSlots(timeline, s, children);
|
|
100
|
+
const row = Math.round(timeline.args.row ?? 0);
|
|
101
|
+
const inRow = (i) => slots[i]?.meta.kind === "rectangular" && slots[i].meta.row === row;
|
|
102
|
+
return ItemGrid.focusOn(timeline, s, inRow, slots.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15);
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
/** Bring one column (from 0 at the left) forward and push the rest back. */
|
|
106
|
+
focusColumn: {
|
|
107
|
+
args: { column: Types.number(0, { min: 0, step: 1 }), ...lineFocus },
|
|
108
|
+
run: (timeline, s, children) => {
|
|
109
|
+
const slots = ItemGrid.itemSlots(timeline, s, children);
|
|
110
|
+
const column = Math.round(timeline.args.column ?? 0);
|
|
111
|
+
const inColumn = (i) => slots[i]?.meta.kind === "rectangular" && slots[i].meta.column === column;
|
|
112
|
+
return ItemGrid.focusOn(timeline, s, inColumn, slots.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15);
|
|
113
|
+
},
|
|
152
114
|
},
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
115
|
+
},
|
|
116
|
+
...ItemGrid.fields(arranger),
|
|
117
|
+
}), arranger);
|
|
156
118
|
//# sourceMappingURL=rectangular-grid.js.map
|