@dashfoo/core 1.0.0 → 1.1.1
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/README.md +30 -23
- package/dist/index.d.ts +308 -196
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +279 -269
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,75 +1,70 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/state/node-attrs.d.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* its first member and strips the keys the others own, which erased every
|
|
7
|
-
* tabset and row attribute at the parse boundary. The four keys that two kinds
|
|
8
|
-
* share (`enableClose`, `max`, `min`, `weight`) declare the same type on both
|
|
9
|
-
* sides, so merging widens nothing. Which keys are legal for a given node is
|
|
10
|
-
* enforced by the reducer against that node's own schema.
|
|
4
|
+
* Merged, not a union: a union of all-optional members matches its first member
|
|
5
|
+
* and strips the rest. The reducer enforces which keys a given node accepts.
|
|
11
6
|
*/
|
|
12
7
|
declare const mutableNodeAttrsSchema: z.ZodObject<{
|
|
13
|
-
name: z.ZodOptional<z.ZodString>;
|
|
14
8
|
config: z.ZodOptional<z.ZodOptional<z.ZodType<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
15
9
|
[key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
16
10
|
} | null)[] | {
|
|
17
|
-
[key: string]: string | number | boolean |
|
|
11
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
18
12
|
} | null)[] | {
|
|
19
|
-
[key: string]: string | number | boolean |
|
|
13
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
20
14
|
} | null)[] | {
|
|
21
|
-
[key: string]: string | number | boolean |
|
|
15
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
22
16
|
} | null)[] | {
|
|
23
|
-
[key: string]: string | number | boolean |
|
|
17
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
24
18
|
} | null)[] | {
|
|
25
|
-
[key: string]: string | number | boolean |
|
|
19
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
26
20
|
} | null)[] | {
|
|
27
|
-
[key: string]: string | number | boolean |
|
|
21
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
28
22
|
} | null)[] | {
|
|
29
|
-
[key: string]: string | number | boolean |
|
|
23
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
30
24
|
} | null)[] | {
|
|
31
|
-
[key: string]: string | number | boolean |
|
|
25
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
32
26
|
} | null)[] | {
|
|
33
|
-
[key: string]: string | number | boolean |
|
|
27
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
34
28
|
} | null)[] | {
|
|
35
|
-
[key: string]: string | number | boolean |
|
|
29
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
36
30
|
} | null)[] | {
|
|
37
|
-
[key: string]: string | number | boolean |
|
|
38
|
-
} | null, unknown, z.core.$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean |
|
|
39
|
-
[key: string]: string | number | boolean |
|
|
31
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
32
|
+
} | null, unknown, z.core.$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
33
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
40
34
|
} | null)[] | {
|
|
41
|
-
[key: string]: string | number | boolean |
|
|
35
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
42
36
|
} | null)[] | {
|
|
43
|
-
[key: string]: string | number | boolean |
|
|
37
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
44
38
|
} | null)[] | {
|
|
45
|
-
[key: string]: string | number | boolean |
|
|
39
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
46
40
|
} | null)[] | {
|
|
47
|
-
[key: string]: string | number | boolean |
|
|
41
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
48
42
|
} | null)[] | {
|
|
49
|
-
[key: string]: string | number | boolean |
|
|
43
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
50
44
|
} | null)[] | {
|
|
51
|
-
[key: string]: string | number | boolean |
|
|
45
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
52
46
|
} | null)[] | {
|
|
53
|
-
[key: string]: string | number | boolean |
|
|
47
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
54
48
|
} | null)[] | {
|
|
55
|
-
[key: string]: string | number | boolean |
|
|
49
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
56
50
|
} | null)[] | {
|
|
57
|
-
[key: string]: string | number | boolean |
|
|
51
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
58
52
|
} | null)[] | {
|
|
59
|
-
[key: string]: string | number | boolean |
|
|
53
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
60
54
|
} | null)[] | {
|
|
61
|
-
[key: string]: string | number | boolean |
|
|
55
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
62
56
|
} | null, unknown>>>>;
|
|
63
57
|
enableDrag: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
64
58
|
enableRename: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
59
|
+
name: z.ZodOptional<z.ZodString>;
|
|
65
60
|
enableClose: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
66
61
|
enableMaximize: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
67
62
|
selected: z.ZodOptional<z.ZodNumber>;
|
|
68
63
|
max: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
69
64
|
unit: z.ZodEnum<{
|
|
70
|
-
px: "px";
|
|
71
65
|
"%": "%";
|
|
72
66
|
em: "em";
|
|
67
|
+
px: "px";
|
|
73
68
|
rem: "rem";
|
|
74
69
|
vh: "vh";
|
|
75
70
|
vw: "vw";
|
|
@@ -78,9 +73,9 @@ declare const mutableNodeAttrsSchema: z.ZodObject<{
|
|
|
78
73
|
}, z.core.$strip>>>;
|
|
79
74
|
min: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
80
75
|
unit: z.ZodEnum<{
|
|
81
|
-
px: "px";
|
|
82
76
|
"%": "%";
|
|
83
77
|
em: "em";
|
|
78
|
+
px: "px";
|
|
84
79
|
rem: "rem";
|
|
85
80
|
vh: "vh";
|
|
86
81
|
vw: "vw";
|
|
@@ -88,8 +83,8 @@ declare const mutableNodeAttrsSchema: z.ZodObject<{
|
|
|
88
83
|
value: z.ZodNumber;
|
|
89
84
|
}, z.core.$strip>>>;
|
|
90
85
|
orientation: z.ZodOptional<z.ZodEnum<{
|
|
91
|
-
row: "row";
|
|
92
86
|
column: "column";
|
|
87
|
+
row: "row";
|
|
93
88
|
}>>;
|
|
94
89
|
snap: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
95
90
|
divisions: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"panels">]>>;
|
|
@@ -121,51 +116,51 @@ declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
121
116
|
config: z.ZodOptional<z.ZodType<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
122
117
|
[key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
123
118
|
} | null)[] | {
|
|
124
|
-
[key: string]: string | number | boolean |
|
|
119
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
125
120
|
} | null)[] | {
|
|
126
|
-
[key: string]: string | number | boolean |
|
|
121
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
127
122
|
} | null)[] | {
|
|
128
|
-
[key: string]: string | number | boolean |
|
|
123
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
129
124
|
} | null)[] | {
|
|
130
|
-
[key: string]: string | number | boolean |
|
|
125
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
131
126
|
} | null)[] | {
|
|
132
|
-
[key: string]: string | number | boolean |
|
|
127
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
133
128
|
} | null)[] | {
|
|
134
|
-
[key: string]: string | number | boolean |
|
|
129
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
135
130
|
} | null)[] | {
|
|
136
|
-
[key: string]: string | number | boolean |
|
|
131
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
137
132
|
} | null)[] | {
|
|
138
|
-
[key: string]: string | number | boolean |
|
|
133
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
139
134
|
} | null)[] | {
|
|
140
|
-
[key: string]: string | number | boolean |
|
|
135
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
141
136
|
} | null)[] | {
|
|
142
|
-
[key: string]: string | number | boolean |
|
|
137
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
143
138
|
} | null)[] | {
|
|
144
|
-
[key: string]: string | number | boolean |
|
|
145
|
-
} | null, unknown, z.core.$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean |
|
|
146
|
-
[key: string]: string | number | boolean |
|
|
139
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
140
|
+
} | null, unknown, z.core.$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
141
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
147
142
|
} | null)[] | {
|
|
148
|
-
[key: string]: string | number | boolean |
|
|
143
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
149
144
|
} | null)[] | {
|
|
150
|
-
[key: string]: string | number | boolean |
|
|
145
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
151
146
|
} | null)[] | {
|
|
152
|
-
[key: string]: string | number | boolean |
|
|
147
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
153
148
|
} | null)[] | {
|
|
154
|
-
[key: string]: string | number | boolean |
|
|
149
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
155
150
|
} | null)[] | {
|
|
156
|
-
[key: string]: string | number | boolean |
|
|
151
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
157
152
|
} | null)[] | {
|
|
158
|
-
[key: string]: string | number | boolean |
|
|
153
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
159
154
|
} | null)[] | {
|
|
160
|
-
[key: string]: string | number | boolean |
|
|
155
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
161
156
|
} | null)[] | {
|
|
162
|
-
[key: string]: string | number | boolean |
|
|
157
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
163
158
|
} | null)[] | {
|
|
164
|
-
[key: string]: string | number | boolean |
|
|
159
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
165
160
|
} | null)[] | {
|
|
166
|
-
[key: string]: string | number | boolean |
|
|
161
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
167
162
|
} | null)[] | {
|
|
168
|
-
[key: string]: string | number | boolean |
|
|
163
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
169
164
|
} | null, unknown>>>;
|
|
170
165
|
enableClose: z.ZodOptional<z.ZodBoolean>;
|
|
171
166
|
enableDrag: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -189,7 +184,6 @@ declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
189
184
|
targetId: z.ZodString;
|
|
190
185
|
type: z.ZodLiteral<"moveNode">;
|
|
191
186
|
}, z.core.$strip>, z.ZodObject<{
|
|
192
|
-
index: z.ZodOptional<z.ZodNumber>;
|
|
193
187
|
location: z.ZodEnum<{
|
|
194
188
|
center: "center";
|
|
195
189
|
"split-bottom": "split-bottom";
|
|
@@ -226,66 +220,66 @@ declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
226
220
|
weights: z.ZodArray<z.ZodNumber>;
|
|
227
221
|
}, z.core.$strip>, z.ZodObject<{
|
|
228
222
|
attrs: z.ZodObject<{
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
[key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
223
|
+
config: z.ZodOptional<z.ZodOptional<z.ZodType<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
224
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
232
225
|
} | null)[] | {
|
|
233
|
-
[key: string]: string | number | boolean |
|
|
226
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
234
227
|
} | null)[] | {
|
|
235
|
-
[key: string]: string | number | boolean |
|
|
228
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
236
229
|
} | null)[] | {
|
|
237
|
-
[key: string]: string | number | boolean |
|
|
230
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
238
231
|
} | null)[] | {
|
|
239
|
-
[key: string]: string | number | boolean |
|
|
232
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
240
233
|
} | null)[] | {
|
|
241
|
-
[key: string]: string | number | boolean |
|
|
234
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
242
235
|
} | null)[] | {
|
|
243
|
-
[key: string]: string | number | boolean |
|
|
236
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
244
237
|
} | null)[] | {
|
|
245
|
-
[key: string]: string | number | boolean |
|
|
238
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
246
239
|
} | null)[] | {
|
|
247
|
-
[key: string]: string | number | boolean |
|
|
240
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
248
241
|
} | null)[] | {
|
|
249
|
-
[key: string]: string | number | boolean |
|
|
242
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
250
243
|
} | null)[] | {
|
|
251
|
-
[key: string]: string | number | boolean |
|
|
244
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
252
245
|
} | null)[] | {
|
|
253
|
-
[key: string]: string | number | boolean |
|
|
254
|
-
} | null, unknown, z.core.$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean |
|
|
255
|
-
[key: string]: string | number | boolean |
|
|
246
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
247
|
+
} | null, unknown, z.core.$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
248
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
256
249
|
} | null)[] | {
|
|
257
|
-
[key: string]: string | number | boolean |
|
|
250
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
258
251
|
} | null)[] | {
|
|
259
|
-
[key: string]: string | number | boolean |
|
|
252
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
260
253
|
} | null)[] | {
|
|
261
|
-
[key: string]: string | number | boolean |
|
|
254
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
262
255
|
} | null)[] | {
|
|
263
|
-
[key: string]: string | number | boolean |
|
|
256
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
264
257
|
} | null)[] | {
|
|
265
|
-
[key: string]: string | number | boolean |
|
|
258
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
266
259
|
} | null)[] | {
|
|
267
|
-
[key: string]: string | number | boolean |
|
|
260
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
268
261
|
} | null)[] | {
|
|
269
|
-
[key: string]: string | number | boolean |
|
|
262
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
270
263
|
} | null)[] | {
|
|
271
|
-
[key: string]: string | number | boolean |
|
|
264
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
272
265
|
} | null)[] | {
|
|
273
|
-
[key: string]: string | number | boolean |
|
|
266
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
274
267
|
} | null)[] | {
|
|
275
|
-
[key: string]: string | number | boolean |
|
|
268
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
276
269
|
} | null)[] | {
|
|
277
|
-
[key: string]: string | number | boolean |
|
|
270
|
+
[key: string]: string | number | boolean | any | any | null;
|
|
278
271
|
} | null, unknown>>>>;
|
|
279
272
|
enableDrag: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
280
273
|
enableRename: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
274
|
+
name: z.ZodOptional<z.ZodString>;
|
|
281
275
|
enableClose: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
282
276
|
enableMaximize: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
283
277
|
selected: z.ZodOptional<z.ZodNumber>;
|
|
284
278
|
max: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
285
279
|
unit: z.ZodEnum<{
|
|
286
|
-
px: "px";
|
|
287
280
|
"%": "%";
|
|
288
281
|
em: "em";
|
|
282
|
+
px: "px";
|
|
289
283
|
rem: "rem";
|
|
290
284
|
vh: "vh";
|
|
291
285
|
vw: "vw";
|
|
@@ -294,9 +288,9 @@ declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
294
288
|
}, z.core.$strip>>>;
|
|
295
289
|
min: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
296
290
|
unit: z.ZodEnum<{
|
|
297
|
-
px: "px";
|
|
298
291
|
"%": "%";
|
|
299
292
|
em: "em";
|
|
293
|
+
px: "px";
|
|
300
294
|
rem: "rem";
|
|
301
295
|
vh: "vh";
|
|
302
296
|
vw: "vw";
|
|
@@ -304,8 +298,8 @@ declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
304
298
|
value: z.ZodNumber;
|
|
305
299
|
}, z.core.$strip>>>;
|
|
306
300
|
orientation: z.ZodOptional<z.ZodEnum<{
|
|
307
|
-
row: "row";
|
|
308
301
|
column: "column";
|
|
302
|
+
row: "row";
|
|
309
303
|
}>>;
|
|
310
304
|
snap: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
311
305
|
divisions: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"panels">]>>;
|
|
@@ -330,8 +324,8 @@ declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
330
324
|
tabEnableDrag: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
331
325
|
tabEnableRename: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
332
326
|
tabLocation: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
333
|
-
top: "top";
|
|
334
327
|
bottom: "bottom";
|
|
328
|
+
top: "top";
|
|
335
329
|
}>>>;
|
|
336
330
|
tabSetEnableMaximize: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
337
331
|
tabSetEnableTabStrip: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -397,42 +391,35 @@ type DropIntent = {
|
|
|
397
391
|
};
|
|
398
392
|
//#endregion
|
|
399
393
|
//#region src/model/schema.d.ts
|
|
400
|
-
/**
|
|
401
|
-
* Weights are relative shares, and every reader that rendered one already
|
|
402
|
-
* treated a missing weight as a single share (`row-view` summed `weight ?? 1`),
|
|
403
|
-
* so filling it in at the boundary changes nothing on screen. The one place that
|
|
404
|
-
* read a missing weight as a percentage was `placeBesideTarget`, which is why
|
|
405
|
-
* docking beside an unweighted target halved it to `50` and left its unweighted
|
|
406
|
-
* siblings rendering as a sliver of the row.
|
|
407
|
-
*/
|
|
394
|
+
/** Weights are relative shares of a row, not percentages. */
|
|
408
395
|
declare const DEFAULT_WEIGHT = 1;
|
|
409
396
|
type JsonValue = string | number | boolean | null | Array<JsonValue> | {
|
|
410
397
|
[key: string]: JsonValue;
|
|
411
398
|
};
|
|
412
399
|
declare const jsonValueSchema: z.ZodType<JsonValue>;
|
|
413
400
|
declare const edgeSchema: z.ZodEnum<{
|
|
414
|
-
left: "left";
|
|
415
|
-
top: "top";
|
|
416
401
|
bottom: "bottom";
|
|
402
|
+
left: "left";
|
|
417
403
|
right: "right";
|
|
404
|
+
top: "top";
|
|
418
405
|
}>;
|
|
419
406
|
declare const unitSchema: z.ZodEnum<{
|
|
420
|
-
px: "px";
|
|
421
407
|
"%": "%";
|
|
422
408
|
em: "em";
|
|
409
|
+
px: "px";
|
|
423
410
|
rem: "rem";
|
|
424
411
|
vh: "vh";
|
|
425
412
|
vw: "vw";
|
|
426
413
|
}>;
|
|
427
414
|
declare const orientationSchema: z.ZodEnum<{
|
|
428
|
-
row: "row";
|
|
429
415
|
column: "column";
|
|
416
|
+
row: "row";
|
|
430
417
|
}>;
|
|
431
418
|
declare const dimensionSchema: z.ZodObject<{
|
|
432
419
|
unit: z.ZodEnum<{
|
|
433
|
-
px: "px";
|
|
434
420
|
"%": "%";
|
|
435
421
|
em: "em";
|
|
422
|
+
px: "px";
|
|
436
423
|
rem: "rem";
|
|
437
424
|
vh: "vh";
|
|
438
425
|
vw: "vw";
|
|
@@ -455,11 +442,8 @@ declare const tabNodeSchema: z.ZodObject<{
|
|
|
455
442
|
type: z.ZodLiteral<"tab">;
|
|
456
443
|
}, z.core.$strip>;
|
|
457
444
|
/**
|
|
458
|
-
*
|
|
459
|
-
*
|
|
460
|
-
* `.pick`), and picking `weight` with its default attached would inject that
|
|
461
|
-
* default: `.partial()` over a defaulted field still fills it in, which would
|
|
462
|
-
* rewrite a tabset's weight on every unrelated attribute update.
|
|
445
|
+
* Kept pre-transform so `node-attrs` can `.pick()` from it: a pipe has no
|
|
446
|
+
* `.pick`, and `.partial()` over a defaulted field still fills the default in.
|
|
463
447
|
*/
|
|
464
448
|
declare const tabsetNodeObjectSchema: z.ZodObject<{
|
|
465
449
|
children: z.ZodArray<z.ZodObject<{
|
|
@@ -477,9 +461,9 @@ declare const tabsetNodeObjectSchema: z.ZodObject<{
|
|
|
477
461
|
id: z.ZodString;
|
|
478
462
|
max: z.ZodOptional<z.ZodObject<{
|
|
479
463
|
unit: z.ZodEnum<{
|
|
480
|
-
px: "px";
|
|
481
464
|
"%": "%";
|
|
482
465
|
em: "em";
|
|
466
|
+
px: "px";
|
|
483
467
|
rem: "rem";
|
|
484
468
|
vh: "vh";
|
|
485
469
|
vw: "vw";
|
|
@@ -488,9 +472,9 @@ declare const tabsetNodeObjectSchema: z.ZodObject<{
|
|
|
488
472
|
}, z.core.$strip>>;
|
|
489
473
|
min: z.ZodOptional<z.ZodObject<{
|
|
490
474
|
unit: z.ZodEnum<{
|
|
491
|
-
px: "px";
|
|
492
475
|
"%": "%";
|
|
493
476
|
em: "em";
|
|
477
|
+
px: "px";
|
|
494
478
|
rem: "rem";
|
|
495
479
|
vh: "vh";
|
|
496
480
|
vw: "vw";
|
|
@@ -518,9 +502,9 @@ declare const tabsetNodeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
518
502
|
id: z.ZodString;
|
|
519
503
|
max: z.ZodOptional<z.ZodObject<{
|
|
520
504
|
unit: z.ZodEnum<{
|
|
521
|
-
px: "px";
|
|
522
505
|
"%": "%";
|
|
523
506
|
em: "em";
|
|
507
|
+
px: "px";
|
|
524
508
|
rem: "rem";
|
|
525
509
|
vh: "vh";
|
|
526
510
|
vw: "vw";
|
|
@@ -529,9 +513,9 @@ declare const tabsetNodeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
529
513
|
}, z.core.$strip>>;
|
|
530
514
|
min: z.ZodOptional<z.ZodObject<{
|
|
531
515
|
unit: z.ZodEnum<{
|
|
532
|
-
px: "px";
|
|
533
516
|
"%": "%";
|
|
534
517
|
em: "em";
|
|
518
|
+
px: "px";
|
|
535
519
|
rem: "rem";
|
|
536
520
|
vh: "vh";
|
|
537
521
|
vw: "vw";
|
|
@@ -543,79 +527,98 @@ declare const tabsetNodeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
543
527
|
type: z.ZodLiteral<"tabset">;
|
|
544
528
|
weight: z.ZodDefault<z.ZodNumber>;
|
|
545
529
|
}, z.core.$strip>, z.ZodTransform<{
|
|
546
|
-
selected: number;
|
|
547
530
|
children: {
|
|
548
531
|
component: string;
|
|
549
|
-
id: string;
|
|
550
|
-
name: string;
|
|
551
|
-
type: "tab";
|
|
552
532
|
config?: JsonValue | undefined;
|
|
553
533
|
enableClose?: boolean | undefined;
|
|
554
534
|
enableDrag?: boolean | undefined;
|
|
555
535
|
enableRename?: boolean | undefined;
|
|
536
|
+
id: string;
|
|
537
|
+
name: string;
|
|
538
|
+
type: "tab";
|
|
556
539
|
}[];
|
|
557
|
-
id: string;
|
|
558
|
-
type: "tabset";
|
|
559
|
-
weight: number;
|
|
560
540
|
enableClose?: boolean | undefined;
|
|
561
541
|
enableMaximize?: boolean | undefined;
|
|
542
|
+
id: string;
|
|
562
543
|
max?: {
|
|
563
|
-
unit: "
|
|
544
|
+
unit: "%" | "em" | "px" | "rem" | "vh" | "vw";
|
|
564
545
|
value: number;
|
|
565
546
|
} | undefined;
|
|
566
547
|
min?: {
|
|
567
|
-
unit: "
|
|
548
|
+
unit: "%" | "em" | "px" | "rem" | "vh" | "vw";
|
|
568
549
|
value: number;
|
|
569
550
|
} | undefined;
|
|
570
551
|
name?: string | undefined;
|
|
552
|
+
type: "tabset";
|
|
553
|
+
weight: number;
|
|
554
|
+
selected: number;
|
|
571
555
|
}, {
|
|
572
556
|
children: {
|
|
573
557
|
component: string;
|
|
574
|
-
id: string;
|
|
575
|
-
name: string;
|
|
576
|
-
type: "tab";
|
|
577
558
|
config?: JsonValue | undefined;
|
|
578
559
|
enableClose?: boolean | undefined;
|
|
579
560
|
enableDrag?: boolean | undefined;
|
|
580
561
|
enableRename?: boolean | undefined;
|
|
562
|
+
id: string;
|
|
563
|
+
name: string;
|
|
564
|
+
type: "tab";
|
|
581
565
|
}[];
|
|
582
|
-
id: string;
|
|
583
|
-
selected: number;
|
|
584
|
-
type: "tabset";
|
|
585
|
-
weight: number;
|
|
586
566
|
enableClose?: boolean | undefined;
|
|
587
567
|
enableMaximize?: boolean | undefined;
|
|
568
|
+
id: string;
|
|
588
569
|
max?: {
|
|
589
|
-
unit: "
|
|
570
|
+
unit: "%" | "em" | "px" | "rem" | "vh" | "vw";
|
|
590
571
|
value: number;
|
|
591
572
|
} | undefined;
|
|
592
573
|
min?: {
|
|
593
|
-
unit: "
|
|
574
|
+
unit: "%" | "em" | "px" | "rem" | "vh" | "vw";
|
|
594
575
|
value: number;
|
|
595
576
|
} | undefined;
|
|
596
577
|
name?: string | undefined;
|
|
597
|
-
|
|
598
|
-
type
|
|
599
|
-
children: Array<RowNode | z.infer<typeof tabsetNodeSchema>>;
|
|
600
|
-
id: string;
|
|
601
|
-
max?: z.infer<typeof dimensionSchema>;
|
|
602
|
-
min?: z.infer<typeof dimensionSchema>;
|
|
603
|
-
orientation: z.infer<typeof orientationSchema>;
|
|
604
|
-
snap?: z.infer<typeof snapSchema>;
|
|
605
|
-
type: "row";
|
|
578
|
+
selected: number;
|
|
579
|
+
type: "tabset";
|
|
606
580
|
weight: number;
|
|
607
|
-
}
|
|
608
|
-
type
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
581
|
+
}>>;
|
|
582
|
+
/** The getter's explicit return type is required: without it, TS7023. */
|
|
583
|
+
declare const rowNodeSchema: z.ZodObject<{
|
|
584
|
+
children: z.ZodArray<z.ZodUnion<[typeof rowNodeSchema, typeof tabsetNodeSchema]>>;
|
|
585
|
+
id: z.ZodString;
|
|
586
|
+
max: z.ZodOptional<z.ZodObject<{
|
|
587
|
+
unit: z.ZodEnum<{
|
|
588
|
+
"%": "%";
|
|
589
|
+
em: "em";
|
|
590
|
+
px: "px";
|
|
591
|
+
rem: "rem";
|
|
592
|
+
vh: "vh";
|
|
593
|
+
vw: "vw";
|
|
594
|
+
}>;
|
|
595
|
+
value: z.ZodNumber;
|
|
596
|
+
}, z.core.$strip>>;
|
|
597
|
+
min: z.ZodOptional<z.ZodObject<{
|
|
598
|
+
unit: z.ZodEnum<{
|
|
599
|
+
"%": "%";
|
|
600
|
+
em: "em";
|
|
601
|
+
px: "px";
|
|
602
|
+
rem: "rem";
|
|
603
|
+
vh: "vh";
|
|
604
|
+
vw: "vw";
|
|
605
|
+
}>;
|
|
606
|
+
value: z.ZodNumber;
|
|
607
|
+
}, z.core.$strip>>;
|
|
608
|
+
orientation: z.ZodEnum<{
|
|
609
|
+
column: "column";
|
|
610
|
+
row: "row";
|
|
611
|
+
}>;
|
|
612
|
+
snap: z.ZodOptional<z.ZodObject<{
|
|
613
|
+
divisions: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"panels">]>>;
|
|
614
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
615
|
+
threshold: z.ZodOptional<z.ZodNumber>;
|
|
616
|
+
}, z.core.$strip>>;
|
|
617
|
+
type: z.ZodLiteral<"row">;
|
|
618
|
+
weight: z.ZodDefault<z.ZodNumber>;
|
|
619
|
+
}, z.core.$strip>;
|
|
620
|
+
type RowNode = z.infer<typeof rowNodeSchema>;
|
|
621
|
+
type RowNodeInput = z.input<typeof rowNodeSchema>;
|
|
619
622
|
declare const geometrySchema: z.ZodObject<{
|
|
620
623
|
height: z.ZodNumber;
|
|
621
624
|
left: z.ZodNumber;
|
|
@@ -630,7 +633,43 @@ declare const floatNodeSchema: z.ZodObject<{
|
|
|
630
633
|
width: z.ZodNumber;
|
|
631
634
|
}, z.core.$strip>;
|
|
632
635
|
id: z.ZodString;
|
|
633
|
-
layout: z.
|
|
636
|
+
layout: z.ZodObject<{
|
|
637
|
+
children: z.ZodArray<z.ZodUnion<[typeof rowNodeSchema, typeof tabsetNodeSchema]>>;
|
|
638
|
+
id: z.ZodString;
|
|
639
|
+
max: z.ZodOptional<z.ZodObject<{
|
|
640
|
+
unit: z.ZodEnum<{
|
|
641
|
+
"%": "%";
|
|
642
|
+
em: "em";
|
|
643
|
+
px: "px";
|
|
644
|
+
rem: "rem";
|
|
645
|
+
vh: "vh";
|
|
646
|
+
vw: "vw";
|
|
647
|
+
}>;
|
|
648
|
+
value: z.ZodNumber;
|
|
649
|
+
}, z.core.$strip>>;
|
|
650
|
+
min: z.ZodOptional<z.ZodObject<{
|
|
651
|
+
unit: z.ZodEnum<{
|
|
652
|
+
"%": "%";
|
|
653
|
+
em: "em";
|
|
654
|
+
px: "px";
|
|
655
|
+
rem: "rem";
|
|
656
|
+
vh: "vh";
|
|
657
|
+
vw: "vw";
|
|
658
|
+
}>;
|
|
659
|
+
value: z.ZodNumber;
|
|
660
|
+
}, z.core.$strip>>;
|
|
661
|
+
orientation: z.ZodEnum<{
|
|
662
|
+
column: "column";
|
|
663
|
+
row: "row";
|
|
664
|
+
}>;
|
|
665
|
+
snap: z.ZodOptional<z.ZodObject<{
|
|
666
|
+
divisions: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"panels">]>>;
|
|
667
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
668
|
+
threshold: z.ZodOptional<z.ZodNumber>;
|
|
669
|
+
}, z.core.$strip>>;
|
|
670
|
+
type: z.ZodLiteral<"row">;
|
|
671
|
+
weight: z.ZodDefault<z.ZodNumber>;
|
|
672
|
+
}, z.core.$strip>;
|
|
634
673
|
minimized: z.ZodOptional<z.ZodBoolean>;
|
|
635
674
|
name: z.ZodOptional<z.ZodString>;
|
|
636
675
|
type: z.ZodLiteral<"float">;
|
|
@@ -648,8 +687,8 @@ declare const globalAttributesSchema: z.ZodObject<{
|
|
|
648
687
|
tabEnableDrag: z.ZodOptional<z.ZodBoolean>;
|
|
649
688
|
tabEnableRename: z.ZodOptional<z.ZodBoolean>;
|
|
650
689
|
tabLocation: z.ZodOptional<z.ZodEnum<{
|
|
651
|
-
top: "top";
|
|
652
690
|
bottom: "bottom";
|
|
691
|
+
top: "top";
|
|
653
692
|
}>>;
|
|
654
693
|
tabSetEnableMaximize: z.ZodOptional<z.ZodBoolean>;
|
|
655
694
|
tabSetEnableTabStrip: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -665,7 +704,43 @@ declare const dashfooSchema: z.ZodObject<{
|
|
|
665
704
|
width: z.ZodNumber;
|
|
666
705
|
}, z.core.$strip>;
|
|
667
706
|
id: z.ZodString;
|
|
668
|
-
layout: z.
|
|
707
|
+
layout: z.ZodObject<{
|
|
708
|
+
children: z.ZodArray<z.ZodUnion<[typeof rowNodeSchema, typeof tabsetNodeSchema]>>;
|
|
709
|
+
id: z.ZodString;
|
|
710
|
+
max: z.ZodOptional<z.ZodObject<{
|
|
711
|
+
unit: z.ZodEnum<{
|
|
712
|
+
"%": "%";
|
|
713
|
+
em: "em";
|
|
714
|
+
px: "px";
|
|
715
|
+
rem: "rem";
|
|
716
|
+
vh: "vh";
|
|
717
|
+
vw: "vw";
|
|
718
|
+
}>;
|
|
719
|
+
value: z.ZodNumber;
|
|
720
|
+
}, z.core.$strip>>;
|
|
721
|
+
min: z.ZodOptional<z.ZodObject<{
|
|
722
|
+
unit: z.ZodEnum<{
|
|
723
|
+
"%": "%";
|
|
724
|
+
em: "em";
|
|
725
|
+
px: "px";
|
|
726
|
+
rem: "rem";
|
|
727
|
+
vh: "vh";
|
|
728
|
+
vw: "vw";
|
|
729
|
+
}>;
|
|
730
|
+
value: z.ZodNumber;
|
|
731
|
+
}, z.core.$strip>>;
|
|
732
|
+
orientation: z.ZodEnum<{
|
|
733
|
+
column: "column";
|
|
734
|
+
row: "row";
|
|
735
|
+
}>;
|
|
736
|
+
snap: z.ZodOptional<z.ZodObject<{
|
|
737
|
+
divisions: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"panels">]>>;
|
|
738
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
739
|
+
threshold: z.ZodOptional<z.ZodNumber>;
|
|
740
|
+
}, z.core.$strip>>;
|
|
741
|
+
type: z.ZodLiteral<"row">;
|
|
742
|
+
weight: z.ZodDefault<z.ZodNumber>;
|
|
743
|
+
}, z.core.$strip>;
|
|
669
744
|
minimized: z.ZodOptional<z.ZodBoolean>;
|
|
670
745
|
name: z.ZodOptional<z.ZodString>;
|
|
671
746
|
type: z.ZodLiteral<"float">;
|
|
@@ -683,14 +758,50 @@ declare const dashfooSchema: z.ZodObject<{
|
|
|
683
758
|
tabEnableDrag: z.ZodOptional<z.ZodBoolean>;
|
|
684
759
|
tabEnableRename: z.ZodOptional<z.ZodBoolean>;
|
|
685
760
|
tabLocation: z.ZodOptional<z.ZodEnum<{
|
|
686
|
-
top: "top";
|
|
687
761
|
bottom: "bottom";
|
|
762
|
+
top: "top";
|
|
688
763
|
}>>;
|
|
689
764
|
tabSetEnableMaximize: z.ZodOptional<z.ZodBoolean>;
|
|
690
765
|
tabSetEnableTabStrip: z.ZodOptional<z.ZodBoolean>;
|
|
691
766
|
tabSetMinSize: z.ZodOptional<z.ZodNumber>;
|
|
692
767
|
}, z.core.$strip>;
|
|
693
|
-
layout: z.
|
|
768
|
+
layout: z.ZodObject<{
|
|
769
|
+
children: z.ZodArray<z.ZodUnion<[typeof rowNodeSchema, typeof tabsetNodeSchema]>>;
|
|
770
|
+
id: z.ZodString;
|
|
771
|
+
max: z.ZodOptional<z.ZodObject<{
|
|
772
|
+
unit: z.ZodEnum<{
|
|
773
|
+
"%": "%";
|
|
774
|
+
em: "em";
|
|
775
|
+
px: "px";
|
|
776
|
+
rem: "rem";
|
|
777
|
+
vh: "vh";
|
|
778
|
+
vw: "vw";
|
|
779
|
+
}>;
|
|
780
|
+
value: z.ZodNumber;
|
|
781
|
+
}, z.core.$strip>>;
|
|
782
|
+
min: z.ZodOptional<z.ZodObject<{
|
|
783
|
+
unit: z.ZodEnum<{
|
|
784
|
+
"%": "%";
|
|
785
|
+
em: "em";
|
|
786
|
+
px: "px";
|
|
787
|
+
rem: "rem";
|
|
788
|
+
vh: "vh";
|
|
789
|
+
vw: "vw";
|
|
790
|
+
}>;
|
|
791
|
+
value: z.ZodNumber;
|
|
792
|
+
}, z.core.$strip>>;
|
|
793
|
+
orientation: z.ZodEnum<{
|
|
794
|
+
column: "column";
|
|
795
|
+
row: "row";
|
|
796
|
+
}>;
|
|
797
|
+
snap: z.ZodOptional<z.ZodObject<{
|
|
798
|
+
divisions: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"panels">]>>;
|
|
799
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
800
|
+
threshold: z.ZodOptional<z.ZodNumber>;
|
|
801
|
+
}, z.core.$strip>>;
|
|
802
|
+
type: z.ZodLiteral<"row">;
|
|
803
|
+
weight: z.ZodDefault<z.ZodNumber>;
|
|
804
|
+
}, z.core.$strip>;
|
|
694
805
|
maximizedTabsetId: z.ZodOptional<z.ZodString>;
|
|
695
806
|
version: z.ZodLiteral<1>;
|
|
696
807
|
}, z.core.$strip>;
|
|
@@ -763,12 +874,6 @@ type Rect = {
|
|
|
763
874
|
x: number;
|
|
764
875
|
y: number;
|
|
765
876
|
};
|
|
766
|
-
type DockTarget = {
|
|
767
|
-
kind: "tab";
|
|
768
|
-
} | {
|
|
769
|
-
edge: Edge;
|
|
770
|
-
kind: "split";
|
|
771
|
-
};
|
|
772
877
|
type BandOptions = {
|
|
773
878
|
bandFraction?: number;
|
|
774
879
|
};
|
|
@@ -776,21 +881,25 @@ type DockZone = {
|
|
|
776
881
|
location: DockLocation;
|
|
777
882
|
points: Array<Point>;
|
|
778
883
|
};
|
|
779
|
-
declare const dockLocationFor: (target: DockTarget) => DockLocation;
|
|
780
884
|
declare const splitEdge: (location: DockLocation) => Edge | undefined;
|
|
781
|
-
declare const resolveDockTarget: (pointer: Point, rect: Rect, opts?: BandOptions) =>
|
|
885
|
+
declare const resolveDockTarget: (pointer: Point, rect: Rect, opts?: BandOptions) => DockLocation;
|
|
782
886
|
declare const dockZonePolygons: (rect: Rect, opts?: BandOptions) => Array<DockZone>;
|
|
783
887
|
declare const zoneRect: (rect: Rect, location: DockLocation) => Rect;
|
|
784
888
|
//#endregion
|
|
785
889
|
//#region src/geometry/snap.d.ts
|
|
786
890
|
declare const DEFAULT_SNAP_THRESHOLD = 4;
|
|
787
891
|
declare const resolveSnapTargets: (config: SnapConfig, panelCount: number) => Array<number>;
|
|
788
|
-
|
|
892
|
+
type SnapGrid = {
|
|
893
|
+
targets: Array<number>;
|
|
894
|
+
threshold: number;
|
|
895
|
+
};
|
|
896
|
+
declare const resolveSnapGrid: (config: SnapConfig | null, panelCount: number) => SnapGrid;
|
|
897
|
+
declare const snapEnabled: (grid: SnapGrid) => boolean;
|
|
789
898
|
type SnapResult = {
|
|
790
899
|
sizes: Array<number>;
|
|
791
900
|
snapped: boolean;
|
|
792
901
|
};
|
|
793
|
-
declare const snapSizes: (sizes: Array<number>, boundaryIndex: number,
|
|
902
|
+
declare const snapSizes: (sizes: Array<number>, boundaryIndex: number, grid: SnapGrid) => SnapResult;
|
|
794
903
|
type SnapDecision = {
|
|
795
904
|
kind: "inactive";
|
|
796
905
|
} | {
|
|
@@ -799,8 +908,8 @@ type SnapDecision = {
|
|
|
799
908
|
kind: "engage";
|
|
800
909
|
sizes: Array<number>;
|
|
801
910
|
};
|
|
802
|
-
declare const decideSnap: (sizes: Array<number>, boundaryIndex: number | null,
|
|
803
|
-
declare const settleSnap: (sizes: Array<number>, boundaryIndex: number | null,
|
|
911
|
+
declare const decideSnap: (sizes: Array<number>, boundaryIndex: number | null, grid: SnapGrid) => SnapDecision;
|
|
912
|
+
declare const settleSnap: (sizes: Array<number>, boundaryIndex: number | null, grid: SnapGrid) => Array<number>;
|
|
804
913
|
//#endregion
|
|
805
914
|
//#region src/state/history.d.ts
|
|
806
915
|
type History = {
|
|
@@ -812,6 +921,11 @@ declare const HISTORY_LIMIT = 100;
|
|
|
812
921
|
declare const createHistory: (present: Dashfoo) => History;
|
|
813
922
|
declare const canUndo: (history: History) => boolean;
|
|
814
923
|
declare const canRedo: (history: History) => boolean;
|
|
924
|
+
/**
|
|
925
|
+
* An action that changed nothing is not an edit: recording it would spend an
|
|
926
|
+
* undo slot and clear a redo stack the user just built. Not coalescing (ADR
|
|
927
|
+
* 0002): two distinct edits are still two entries.
|
|
928
|
+
*/
|
|
815
929
|
declare const dispatch: (history: History, action: Action) => History;
|
|
816
930
|
declare const undo: (history: History) => History;
|
|
817
931
|
declare const redo: (history: History) => History;
|
|
@@ -827,17 +941,6 @@ declare const normalize: (model: Dashfoo) => Dashfoo;
|
|
|
827
941
|
type DashfooContext = {
|
|
828
942
|
history: History;
|
|
829
943
|
};
|
|
830
|
-
type DashfooEvent = {
|
|
831
|
-
action: Action;
|
|
832
|
-
type: "DISPATCH";
|
|
833
|
-
} | {
|
|
834
|
-
model: Dashfoo;
|
|
835
|
-
type: "SET_MODEL";
|
|
836
|
-
} | {
|
|
837
|
-
type: "REDO";
|
|
838
|
-
} | {
|
|
839
|
-
type: "UNDO";
|
|
840
|
-
};
|
|
841
944
|
type DashfooMachineInput = {
|
|
842
945
|
model: Dashfoo;
|
|
843
946
|
};
|
|
@@ -867,27 +970,34 @@ type DragSubject = {
|
|
|
867
970
|
kind: "external";
|
|
868
971
|
tab: TabNode;
|
|
869
972
|
};
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
973
|
+
/** `scope` names whoever resolved the intent, echoed back on `COMMIT` so the host can route the action. */
|
|
974
|
+
type DropResolution = {
|
|
975
|
+
intent: DropIntent;
|
|
976
|
+
scope: string;
|
|
873
977
|
};
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
978
|
+
/** One value, so a drop target without a subject is unrepresentable. See ADR 0002. */
|
|
979
|
+
type DragState = {
|
|
980
|
+
drop: DropResolution | null;
|
|
981
|
+
kind: "dragging";
|
|
878
982
|
subject: DragSubject;
|
|
879
|
-
type: "START";
|
|
880
983
|
} | {
|
|
881
|
-
|
|
882
|
-
}
|
|
883
|
-
|
|
984
|
+
kind: "idle";
|
|
985
|
+
};
|
|
986
|
+
type DragContext = {
|
|
987
|
+
drag: DragState;
|
|
884
988
|
};
|
|
885
989
|
type DragEmitted = {
|
|
886
990
|
action: Action;
|
|
991
|
+
scope: string;
|
|
887
992
|
type: "COMMIT";
|
|
888
993
|
};
|
|
994
|
+
/** One definition of both "is this drop valid" and "what does it do", so the guard and the emit agree. */
|
|
995
|
+
declare const dropAction: (drag: DragState) => {
|
|
996
|
+
action: Action;
|
|
997
|
+
scope: string;
|
|
998
|
+
} | null;
|
|
889
999
|
declare const dragDockMachine: import("xstate").StateMachine<DragContext, {
|
|
890
|
-
|
|
1000
|
+
drop: DropResolution | null;
|
|
891
1001
|
type: "OVER";
|
|
892
1002
|
} | {
|
|
893
1003
|
subject: DragSubject;
|
|
@@ -899,7 +1009,7 @@ declare const dragDockMachine: import("xstate").StateMachine<DragContext, {
|
|
|
899
1009
|
}, {}, never, never, {
|
|
900
1010
|
type: "hasValidDrop";
|
|
901
1011
|
params: unknown;
|
|
902
|
-
}, never, "
|
|
1012
|
+
}, never, "dragging" | "idle", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, DragEmitted, import("xstate").MetaObject, {
|
|
903
1013
|
id: "dragDock";
|
|
904
1014
|
states: {
|
|
905
1015
|
readonly dragging: {};
|
|
@@ -908,6 +1018,8 @@ declare const dragDockMachine: import("xstate").StateMachine<DragContext, {
|
|
|
908
1018
|
}>;
|
|
909
1019
|
//#endregion
|
|
910
1020
|
//#region src/state/reducer.d.ts
|
|
1021
|
+
/** Identity-equal output means "no edit". A rejected action skips `normalize`, so
|
|
1022
|
+
* pass a model that has already been through it. */
|
|
911
1023
|
declare const reducer: (model: Dashfoo, action: Action) => Dashfoo;
|
|
912
1024
|
//#endregion
|
|
913
1025
|
//#region src/model/serialize.d.ts
|
|
@@ -933,14 +1045,14 @@ declare const collectTabsets: (model: Dashfoo) => Array<TabsetNode>;
|
|
|
933
1045
|
declare const getFirstTabset: (model: Dashfoo) => TabsetNode | undefined;
|
|
934
1046
|
declare const findTabset: (model: Dashfoo, tabsetId: string) => TabsetNode | undefined;
|
|
935
1047
|
declare const findTab: (model: Dashfoo, tabId: string) => TabLocation | undefined;
|
|
936
|
-
declare const findRow: (
|
|
1048
|
+
declare const findRow: (model: Dashfoo, id: string) => RowNode | undefined;
|
|
937
1049
|
declare const findAttributedNode: (model: Dashfoo, id: string) => AttributedNode | undefined;
|
|
938
1050
|
declare const findRootContaining: (model: Dashfoo, nodeId: string) => RowNode | undefined;
|
|
939
|
-
declare const findTabsetParent: (
|
|
1051
|
+
declare const findTabsetParent: (model: Dashfoo, tabsetId: string) => {
|
|
940
1052
|
index: number;
|
|
941
1053
|
parent: RowNode;
|
|
942
1054
|
} | undefined;
|
|
943
1055
|
declare const findDuplicateIds: (model: Dashfoo) => Array<string>;
|
|
944
1056
|
//#endregion
|
|
945
|
-
export { type Action, type AttributedNode, type BandOptions, DEFAULT_SNAP_THRESHOLD, DEFAULT_WEIGHT, type Dashfoo, type
|
|
1057
|
+
export { type Action, type AttributedNode, type BandOptions, DEFAULT_SNAP_THRESHOLD, DEFAULT_WEIGHT, type Dashfoo, type DashfooInput, type Dimension, type DockLocation, type DockZone, type DragState, type DragSubject, type DropIntent, type DropResolution, type Edge, type FloatNode, type FloatOptions, type Geometry, type GlobalAttributes, HISTORY_LIMIT, type History, type Json, type ModelOptions, type MutableNodeAttrs, type Node, type Orientation, type Point, type Rect, type RowNode, type RowNodeInput, type RowOptions, type SnapConfig, type SnapDecision, type SnapGrid, type SnapResult, type TabContainer, type TabLocation, type TabNode, type TabOptions, type TabsetNode, type TabsetOptions, type Unit, actionSchema, canRedo, canUndo, collectRoots, collectTabsets, collectTabsetsInRow, createHistory, createNodeId, createTabId, dashfooMachine, dashfooSchema, decideSnap, dimensionSchema, dispatch, dockLocationSchema, dockZonePolygons, dragDockMachine, dropAction, edgeSchema, findAttributedNode, findDuplicateIds, findFloat, findRootContaining, findRow, findTab, findTabset, findTabsetParent, floatNode, floatNodeSchema, fromJSON, geometrySchema, getFirstTabset, globalAttributesSchema, jsonValueSchema, model, mutableNodeAttrsSchema, normalize, orientationSchema, parseModel, redo, reducer, resolveDockTarget, resolveSnapGrid, resolveSnapTargets, row, rowNodeSchema, settleSnap, snapEnabled, snapSchema, snapSizes, splitEdge, stackModel, tab, tabNodeSchema, tabset, tabsetNodeObjectSchema, tabsetNodeSchema, toJSON, undo, unitSchema, zoneRect };
|
|
946
1058
|
//# sourceMappingURL=index.d.ts.map
|