foldkit 0.89.0 → 0.90.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 +19 -10
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +3 -11
- package/dist/devTools/overlay.d.ts +3 -3
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +209 -171
- package/dist/devTools/protocol.d.ts +77 -19
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +10 -5
- package/dist/devTools/serialize.d.ts +8 -2
- package/dist/devTools/serialize.d.ts.map +1 -1
- package/dist/devTools/serialize.js +11 -2
- package/dist/devTools/store.d.ts +9 -5
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +13 -13
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +2 -2
- package/dist/html/index.d.ts +12 -0
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +20 -4
- package/dist/mount/index.d.ts +64 -21
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/mount/index.js +43 -32
- package/dist/mount/public.d.ts +1 -1
- package/dist/mount/public.d.ts.map +1 -1
- package/dist/runtime/crashUI.js +30 -30
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +4 -4
- package/dist/test/apps/bubbling.js +4 -4
- package/dist/test/apps/disabledButton.js +10 -10
- package/dist/test/apps/fileUpload.d.ts.map +1 -1
- package/dist/test/apps/fileUpload.js +13 -13
- package/dist/test/apps/interactions.d.ts.map +1 -1
- package/dist/test/apps/interactions.js +15 -15
- package/dist/test/apps/keypress.js +8 -8
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +32 -24
- package/dist/test/apps/logoutButton.d.ts.map +1 -1
- package/dist/test/apps/logoutButton.js +2 -2
- package/dist/test/apps/mountPanel.d.ts +19 -3
- package/dist/test/apps/mountPanel.d.ts.map +1 -1
- package/dist/test/apps/mountPanel.js +41 -20
- package/dist/test/apps/multiRole.js +3 -3
- package/dist/test/apps/pointer.d.ts.map +1 -1
- package/dist/test/apps/pointer.js +11 -11
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +8 -8
- package/dist/test/internal.d.ts +50 -20
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +65 -74
- package/dist/test/scene.d.ts +7 -7
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +42 -37
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +2 -2
- package/dist/ui/anchor.d.ts +12 -8
- package/dist/ui/anchor.d.ts.map +1 -1
- package/dist/ui/anchor.js +41 -16
- package/dist/ui/animation/index.js +24 -24
- package/dist/ui/button/index.d.ts.map +1 -1
- package/dist/ui/button/index.js +6 -6
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +101 -99
- package/dist/ui/checkbox/index.d.ts.map +1 -1
- package/dist/ui/checkbox/index.js +15 -15
- package/dist/ui/combobox/multi.d.ts +1 -7
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/shared.d.ts +14 -5
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +137 -125
- package/dist/ui/combobox/single.d.ts +1 -7
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/datePicker/index.js +4 -4
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +27 -27
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +24 -22
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +15 -15
- package/dist/ui/fieldset/index.js +6 -6
- package/dist/ui/fileDrop/index.d.ts +2 -2
- package/dist/ui/fileDrop/index.d.ts.map +1 -1
- package/dist/ui/fileDrop/index.js +16 -16
- package/dist/ui/input/index.d.ts.map +1 -1
- package/dist/ui/input/index.js +15 -13
- package/dist/ui/listbox/multi.d.ts +1 -7
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/shared.d.ts +12 -3
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +91 -89
- package/dist/ui/listbox/single.d.ts +1 -7
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/menu/index.d.ts +12 -3
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +75 -77
- package/dist/ui/popover/index.d.ts +13 -3
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +62 -53
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +20 -20
- package/dist/ui/select/index.d.ts.map +1 -1
- package/dist/ui/select/index.js +13 -11
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +26 -26
- package/dist/ui/switch/index.d.ts.map +1 -1
- package/dist/ui/switch/index.js +14 -14
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +40 -36
- package/dist/ui/textarea/index.d.ts.map +1 -1
- package/dist/ui/textarea/index.js +15 -13
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +27 -27
- package/dist/ui/tooltip/index.d.ts +11 -2
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +33 -33
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +18 -15
- package/package.json +1 -1
|
@@ -6,7 +6,14 @@ export declare const SerializedCommand: S.Struct<{
|
|
|
6
6
|
}>;
|
|
7
7
|
/** A serialized Command suitable for transmission over the WS protocol. */
|
|
8
8
|
export type SerializedCommand = typeof SerializedCommand.Type;
|
|
9
|
-
/** A serialized
|
|
9
|
+
/** A serialized Mount lifecycle event (start or end). `args` is `Some` when the Mount's definition declared an args record, and carries the runtime values used to construct the MountAction instance. */
|
|
10
|
+
export declare const SerializedMount: S.Struct<{
|
|
11
|
+
readonly name: S.String;
|
|
12
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
13
|
+
}>;
|
|
14
|
+
/** A serialized Mount lifecycle event suitable for transmission over the WS protocol. */
|
|
15
|
+
export type SerializedMount = typeof SerializedMount.Type;
|
|
16
|
+
/** A serialized history entry as it appears on the wire. `submodelPath` lists `Got<Child>Message` wrapper tags from outer to inner when the entry came up through a Submodel chain; `maybeLeafTag` is `Some` with the innermost child Message tag when one exists. `mountStarts` lists Mounts that fired during the render after this Message; `mountEnds` lists Mounts whose elements were unmounted during that render. The Messages dispatched by mount Effects appear as their own entries elsewhere in history. */
|
|
10
17
|
export declare const SerializedEntry: S.Struct<{
|
|
11
18
|
readonly index: S.Number;
|
|
12
19
|
readonly tag: S.String;
|
|
@@ -15,8 +22,14 @@ export declare const SerializedEntry: S.Struct<{
|
|
|
15
22
|
readonly name: S.String;
|
|
16
23
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
17
24
|
}>>;
|
|
18
|
-
readonly
|
|
19
|
-
|
|
25
|
+
readonly mountStarts: S.$Array<S.Struct<{
|
|
26
|
+
readonly name: S.String;
|
|
27
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
28
|
+
}>>;
|
|
29
|
+
readonly mountEnds: S.$Array<S.Struct<{
|
|
30
|
+
readonly name: S.String;
|
|
31
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
32
|
+
}>>;
|
|
20
33
|
readonly timestamp: S.Number;
|
|
21
34
|
readonly isModelChanged: S.Boolean;
|
|
22
35
|
readonly changedPaths: S.$Array<S.String>;
|
|
@@ -114,8 +127,14 @@ export declare const ResponseMessages: import("../schema/index.js").CallableTagg
|
|
|
114
127
|
readonly name: S.String;
|
|
115
128
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
116
129
|
}>>;
|
|
117
|
-
readonly
|
|
118
|
-
|
|
130
|
+
readonly mountStarts: S.$Array<S.Struct<{
|
|
131
|
+
readonly name: S.String;
|
|
132
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
133
|
+
}>>;
|
|
134
|
+
readonly mountEnds: S.$Array<S.Struct<{
|
|
135
|
+
readonly name: S.String;
|
|
136
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
137
|
+
}>>;
|
|
119
138
|
readonly timestamp: S.Number;
|
|
120
139
|
readonly isModelChanged: S.Boolean;
|
|
121
140
|
readonly changedPaths: S.$Array<S.String>;
|
|
@@ -135,8 +154,14 @@ export declare const ResponseMessage: import("../schema/index.js").CallableTagge
|
|
|
135
154
|
readonly name: S.String;
|
|
136
155
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
137
156
|
}>>;
|
|
138
|
-
readonly
|
|
139
|
-
|
|
157
|
+
readonly mountStarts: S.$Array<S.Struct<{
|
|
158
|
+
readonly name: S.String;
|
|
159
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
160
|
+
}>>;
|
|
161
|
+
readonly mountEnds: S.$Array<S.Struct<{
|
|
162
|
+
readonly name: S.String;
|
|
163
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
164
|
+
}>>;
|
|
140
165
|
readonly timestamp: S.Number;
|
|
141
166
|
readonly isModelChanged: S.Boolean;
|
|
142
167
|
readonly changedPaths: S.$Array<S.String>;
|
|
@@ -169,14 +194,17 @@ export declare const ResponseRuntimes: import("../schema/index.js").CallableTagg
|
|
|
169
194
|
readonly title: S.String;
|
|
170
195
|
}>>;
|
|
171
196
|
}>;
|
|
172
|
-
/** Response carrying the recorded init data. `maybeModel` is `None` until the runtime has finished its first render and recorded init; once set it stays set for the rest of the runtime's life. `commands` lists the Commands returned from the application's `init` function in the order they were produced, with their args when declared. `
|
|
197
|
+
/** Response carrying the recorded init data. `maybeModel` is `None` until the runtime has finished its first render and recorded init; once set it stays set for the rest of the runtime's life. `commands` lists the Commands returned from the application's `init` function in the order they were produced, with their args when declared. `mountStarts` lists the Mounts that fired during the initial render, with their args when declared. */
|
|
173
198
|
export declare const ResponseInit: import("../schema/index.js").CallableTaggedStruct<"ResponseInit", {
|
|
174
199
|
maybeModel: S.OptionFromNullOr<S.Unknown>;
|
|
175
200
|
commands: S.$Array<S.Struct<{
|
|
176
201
|
readonly name: S.String;
|
|
177
202
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
178
203
|
}>>;
|
|
179
|
-
|
|
204
|
+
mountStarts: S.$Array<S.Struct<{
|
|
205
|
+
readonly name: S.String;
|
|
206
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
207
|
+
}>>;
|
|
180
208
|
}>;
|
|
181
209
|
/** Response carrying a snapshot of the runtime's DevTools state. `currentIndex` is the absolute index of the most recently recorded Message, or -1 when no Messages have been recorded yet. `startIndex` is the earliest absolute index still retained in the rolling buffer (older entries are evicted past `maxEntries`). `totalEntries` is the number of retained entries. `isPaused` is true while the runtime is paused at a replayed snapshot; `maybePausedAtIndex` is `Some(index)` then and `None` otherwise. `hasInitModel` is true once the runtime has finished initialising. */
|
|
182
210
|
export declare const ResponseRuntimeState: import("../schema/index.js").CallableTaggedStruct<"ResponseRuntimeState", {
|
|
@@ -205,8 +233,14 @@ export declare const Response: S.Union<readonly [import("../schema/index.js").Ca
|
|
|
205
233
|
readonly name: S.String;
|
|
206
234
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
207
235
|
}>>;
|
|
208
|
-
readonly
|
|
209
|
-
|
|
236
|
+
readonly mountStarts: S.$Array<S.Struct<{
|
|
237
|
+
readonly name: S.String;
|
|
238
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
239
|
+
}>>;
|
|
240
|
+
readonly mountEnds: S.$Array<S.Struct<{
|
|
241
|
+
readonly name: S.String;
|
|
242
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
243
|
+
}>>;
|
|
210
244
|
readonly timestamp: S.Number;
|
|
211
245
|
readonly isModelChanged: S.Boolean;
|
|
212
246
|
readonly changedPaths: S.$Array<S.String>;
|
|
@@ -224,8 +258,14 @@ export declare const Response: S.Union<readonly [import("../schema/index.js").Ca
|
|
|
224
258
|
readonly name: S.String;
|
|
225
259
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
226
260
|
}>>;
|
|
227
|
-
readonly
|
|
228
|
-
|
|
261
|
+
readonly mountStarts: S.$Array<S.Struct<{
|
|
262
|
+
readonly name: S.String;
|
|
263
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
264
|
+
}>>;
|
|
265
|
+
readonly mountEnds: S.$Array<S.Struct<{
|
|
266
|
+
readonly name: S.String;
|
|
267
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
268
|
+
}>>;
|
|
229
269
|
readonly timestamp: S.Number;
|
|
230
270
|
readonly isModelChanged: S.Boolean;
|
|
231
271
|
readonly changedPaths: S.$Array<S.String>;
|
|
@@ -253,7 +293,10 @@ export declare const Response: S.Union<readonly [import("../schema/index.js").Ca
|
|
|
253
293
|
readonly name: S.String;
|
|
254
294
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
255
295
|
}>>;
|
|
256
|
-
|
|
296
|
+
mountStarts: S.$Array<S.Struct<{
|
|
297
|
+
readonly name: S.String;
|
|
298
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
299
|
+
}>>;
|
|
257
300
|
}>, import("../schema/index.js").CallableTaggedStruct<"ResponseRuntimeState", {
|
|
258
301
|
currentIndex: S.Number;
|
|
259
302
|
startIndex: S.Number;
|
|
@@ -330,8 +373,14 @@ export declare const ResponseFrame: S.Struct<{
|
|
|
330
373
|
readonly name: S.String;
|
|
331
374
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
332
375
|
}>>;
|
|
333
|
-
readonly
|
|
334
|
-
|
|
376
|
+
readonly mountStarts: S.$Array<S.Struct<{
|
|
377
|
+
readonly name: S.String;
|
|
378
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
379
|
+
}>>;
|
|
380
|
+
readonly mountEnds: S.$Array<S.Struct<{
|
|
381
|
+
readonly name: S.String;
|
|
382
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
383
|
+
}>>;
|
|
335
384
|
readonly timestamp: S.Number;
|
|
336
385
|
readonly isModelChanged: S.Boolean;
|
|
337
386
|
readonly changedPaths: S.$Array<S.String>;
|
|
@@ -349,8 +398,14 @@ export declare const ResponseFrame: S.Struct<{
|
|
|
349
398
|
readonly name: S.String;
|
|
350
399
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
351
400
|
}>>;
|
|
352
|
-
readonly
|
|
353
|
-
|
|
401
|
+
readonly mountStarts: S.$Array<S.Struct<{
|
|
402
|
+
readonly name: S.String;
|
|
403
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
404
|
+
}>>;
|
|
405
|
+
readonly mountEnds: S.$Array<S.Struct<{
|
|
406
|
+
readonly name: S.String;
|
|
407
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
408
|
+
}>>;
|
|
354
409
|
readonly timestamp: S.Number;
|
|
355
410
|
readonly isModelChanged: S.Boolean;
|
|
356
411
|
readonly changedPaths: S.$Array<S.String>;
|
|
@@ -378,7 +433,10 @@ export declare const ResponseFrame: S.Struct<{
|
|
|
378
433
|
readonly name: S.String;
|
|
379
434
|
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
380
435
|
}>>;
|
|
381
|
-
|
|
436
|
+
mountStarts: S.$Array<S.Struct<{
|
|
437
|
+
readonly name: S.String;
|
|
438
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
439
|
+
}>>;
|
|
382
440
|
}>, import("../schema/index.js").CallableTaggedStruct<"ResponseRuntimeState", {
|
|
383
441
|
currentIndex: S.Number;
|
|
384
442
|
startIndex: S.Number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/devTools/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAMpC,0NAA0N;AAC1N,eAAO,MAAM,iBAAiB;;;EAG5B,CAAA;AACF,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/devTools/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAMpC,0NAA0N;AAC1N,eAAO,MAAM,iBAAiB;;;EAG5B,CAAA;AACF,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,0MAA0M;AAC1M,eAAO,MAAM,eAAe;;;EAG1B,CAAA;AACF,yFAAyF;AACzF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD,wfAAwf;AACxf,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;EAa1B,CAAA;AACF,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD,wHAAwH;AACxH,eAAO,MAAM,YAAY;;E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AACvE,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAA;AAErD,0FAA0F;AAC1F,eAAO,MAAM,UAAU;;;;;;;;;;;EAGrB,CAAA;AACF,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA"}
|
|
@@ -6,14 +6,19 @@ export const SerializedCommand = S.Struct({
|
|
|
6
6
|
name: S.String,
|
|
7
7
|
args: S.OptionFromNullOr(S.Record(S.String, S.Unknown)),
|
|
8
8
|
});
|
|
9
|
-
/** A serialized
|
|
9
|
+
/** A serialized Mount lifecycle event (start or end). `args` is `Some` when the Mount's definition declared an args record, and carries the runtime values used to construct the MountAction instance. */
|
|
10
|
+
export const SerializedMount = S.Struct({
|
|
11
|
+
name: S.String,
|
|
12
|
+
args: S.OptionFromNullOr(S.Record(S.String, S.Unknown)),
|
|
13
|
+
});
|
|
14
|
+
/** A serialized history entry as it appears on the wire. `submodelPath` lists `Got<Child>Message` wrapper tags from outer to inner when the entry came up through a Submodel chain; `maybeLeafTag` is `Some` with the innermost child Message tag when one exists. `mountStarts` lists Mounts that fired during the render after this Message; `mountEnds` lists Mounts whose elements were unmounted during that render. The Messages dispatched by mount Effects appear as their own entries elsewhere in history. */
|
|
10
15
|
export const SerializedEntry = S.Struct({
|
|
11
16
|
index: S.Number,
|
|
12
17
|
tag: S.String,
|
|
13
18
|
message: S.Unknown,
|
|
14
19
|
commands: S.Array(SerializedCommand),
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
mountStarts: S.Array(SerializedMount),
|
|
21
|
+
mountEnds: S.Array(SerializedMount),
|
|
17
22
|
timestamp: S.Number,
|
|
18
23
|
isModelChanged: S.Boolean,
|
|
19
24
|
changedPaths: S.Array(S.String),
|
|
@@ -118,11 +123,11 @@ export const ResponseDispatched = ts('ResponseDispatched', {
|
|
|
118
123
|
export const ResponseRuntimes = ts('ResponseRuntimes', {
|
|
119
124
|
runtimes: S.Array(RuntimeInfo),
|
|
120
125
|
});
|
|
121
|
-
/** Response carrying the recorded init data. `maybeModel` is `None` until the runtime has finished its first render and recorded init; once set it stays set for the rest of the runtime's life. `commands` lists the Commands returned from the application's `init` function in the order they were produced, with their args when declared. `
|
|
126
|
+
/** Response carrying the recorded init data. `maybeModel` is `None` until the runtime has finished its first render and recorded init; once set it stays set for the rest of the runtime's life. `commands` lists the Commands returned from the application's `init` function in the order they were produced, with their args when declared. `mountStarts` lists the Mounts that fired during the initial render, with their args when declared. */
|
|
122
127
|
export const ResponseInit = ts('ResponseInit', {
|
|
123
128
|
maybeModel: S.OptionFromNullOr(S.Unknown),
|
|
124
129
|
commands: S.Array(SerializedCommand),
|
|
125
|
-
|
|
130
|
+
mountStarts: S.Array(SerializedMount),
|
|
126
131
|
});
|
|
127
132
|
/** Response carrying a snapshot of the runtime's DevTools state. `currentIndex` is the absolute index of the most recently recorded Message, or -1 when no Messages have been recorded yet. `startIndex` is the earliest absolute index still retained in the rolling buffer (older entries are evicted past `maxEntries`). `totalEntries` is the number of retained entries. `isPaused` is true while the runtime is paused at a replayed snapshot; `maybePausedAtIndex` is `Some(index)` then and `None` otherwise. `hasInitModel` is true once the runtime has finished initialising. */
|
|
128
133
|
export const ResponseRuntimeState = ts('ResponseRuntimeState', {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SerializedCommand, SerializedEntry } from './protocol.js';
|
|
2
|
-
import type { CommandRecord, HistoryEntry } from './store.js';
|
|
1
|
+
import type { SerializedCommand, SerializedEntry, SerializedMount } from './protocol.js';
|
|
2
|
+
import type { CommandRecord, HistoryEntry, MountRecord } from './store.js';
|
|
3
3
|
/**
|
|
4
4
|
* Convert DOM-class instances (File, Blob, Date, URL) to plain-object
|
|
5
5
|
* representations so the tree renderer's key-enumeration walk can see their
|
|
@@ -25,6 +25,12 @@ export declare const toInspectableValue: (value: unknown) => unknown;
|
|
|
25
25
|
* happen to have an empty args record.
|
|
26
26
|
*/
|
|
27
27
|
export declare const toSerializedCommand: (command: CommandRecord) => SerializedCommand;
|
|
28
|
+
/**
|
|
29
|
+
* Convert a runtime `MountRecord` to its wire shape. Args are wrapped in an
|
|
30
|
+
* `Option` so `None` cleanly distinguishes argless Mounts from Mounts that
|
|
31
|
+
* happen to have an empty args record.
|
|
32
|
+
*/
|
|
33
|
+
export declare const toSerializedMount: (mount: MountRecord) => SerializedMount;
|
|
28
34
|
/**
|
|
29
35
|
* Convert a `HistoryEntry` plus its absolute index into the wire-friendly
|
|
30
36
|
* `SerializedEntry` shape. Flattens the diff's `HashSet` path collections to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/devTools/serialize.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/devTools/serialize.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAwB1E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OAUnD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,aAAa,KACrB,iBAGD,CAAA;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,WAAW,KAAG,eAGrD,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,YAAY,EACnB,OAAO,MAAM,KACZ,eAoBF,CAAA"}
|
|
@@ -48,6 +48,15 @@ export const toSerializedCommand = (command) => ({
|
|
|
48
48
|
name: command.name,
|
|
49
49
|
args: Option.fromNullishOr(command.args),
|
|
50
50
|
});
|
|
51
|
+
/**
|
|
52
|
+
* Convert a runtime `MountRecord` to its wire shape. Args are wrapped in an
|
|
53
|
+
* `Option` so `None` cleanly distinguishes argless Mounts from Mounts that
|
|
54
|
+
* happen to have an empty args record.
|
|
55
|
+
*/
|
|
56
|
+
export const toSerializedMount = (mount) => ({
|
|
57
|
+
name: mount.name,
|
|
58
|
+
args: Option.fromNullishOr(mount.args),
|
|
59
|
+
});
|
|
51
60
|
/**
|
|
52
61
|
* Convert a `HistoryEntry` plus its absolute index into the wire-friendly
|
|
53
62
|
* `SerializedEntry` shape. Flattens the diff's `HashSet` path collections to
|
|
@@ -61,8 +70,8 @@ export const toSerializedEntry = (entry, index) => {
|
|
|
61
70
|
tag: entry.tag,
|
|
62
71
|
message: toInspectableValue(entry.message),
|
|
63
72
|
commands: Array_.map(entry.commands, toSerializedCommand),
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
mountStarts: Array_.map(entry.mountStarts, toSerializedMount),
|
|
74
|
+
mountEnds: Array_.map(entry.mountEnds, toSerializedMount),
|
|
66
75
|
timestamp: entry.timestamp,
|
|
67
76
|
isModelChanged: entry.isModelChanged,
|
|
68
77
|
changedPaths: Array_.fromIterable(entry.diff.changedPaths),
|
package/dist/devTools/store.d.ts
CHANGED
|
@@ -10,12 +10,16 @@ export type CommandRecord = Readonly<{
|
|
|
10
10
|
name: string;
|
|
11
11
|
args?: Record<string, unknown>;
|
|
12
12
|
}>;
|
|
13
|
+
export type MountRecord = Readonly<{
|
|
14
|
+
name: string;
|
|
15
|
+
args?: Record<string, unknown>;
|
|
16
|
+
}>;
|
|
13
17
|
export type HistoryEntry = Readonly<{
|
|
14
18
|
tag: string;
|
|
15
19
|
message: unknown;
|
|
16
20
|
commands: ReadonlyArray<CommandRecord>;
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
mountStarts: ReadonlyArray<MountRecord>;
|
|
22
|
+
mountEnds: ReadonlyArray<MountRecord>;
|
|
19
23
|
timestamp: number;
|
|
20
24
|
isModelChanged: boolean;
|
|
21
25
|
diff: DiffResult;
|
|
@@ -25,7 +29,7 @@ export type StoreState = Readonly<{
|
|
|
25
29
|
keyframes: HashMap.HashMap<number, unknown>;
|
|
26
30
|
maybeInitModel: Option.Option<unknown>;
|
|
27
31
|
initCommands: ReadonlyArray<CommandRecord>;
|
|
28
|
-
|
|
32
|
+
initMountStarts: ReadonlyArray<MountRecord>;
|
|
29
33
|
startIndex: number;
|
|
30
34
|
isPaused: boolean;
|
|
31
35
|
pausedAtIndex: number;
|
|
@@ -38,11 +42,11 @@ export type Bridge = Readonly<{
|
|
|
38
42
|
}>;
|
|
39
43
|
export declare const createDevToolsStore: (bridge: Bridge, maxEntries?: number) => Effect.Effect<DevToolsStore>;
|
|
40
44
|
export type DevToolsStore = Readonly<{
|
|
41
|
-
recordInit: (model: unknown, commands: ReadonlyArray<CommandRecord>,
|
|
45
|
+
recordInit: (model: unknown, commands: ReadonlyArray<CommandRecord>, mountStarts?: ReadonlyArray<MountRecord>) => Effect.Effect<void>;
|
|
42
46
|
recordMessage: (message: Readonly<{
|
|
43
47
|
_tag: string;
|
|
44
48
|
}>, modelBeforeUpdate: unknown, modelAfterUpdate: unknown, commands: ReadonlyArray<CommandRecord>, isModelChanged: boolean) => Effect.Effect<void>;
|
|
45
|
-
attachRenderedMounts: (
|
|
49
|
+
attachRenderedMounts: (mountStarts: ReadonlyArray<MountRecord>, mountEnds: ReadonlyArray<MountRecord>) => Effect.Effect<void>;
|
|
46
50
|
getModelAtIndex: (index: number) => Effect.Effect<unknown>;
|
|
47
51
|
getMessageAtIndex: (index: number) => Effect.Effect<Option.Option<unknown>>;
|
|
48
52
|
getDiffAtIndex: (index: number) => Effect.Effect<DiffResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/devTools/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,OAAO,EACP,OAAO,EAEP,MAAM,EAIN,eAAe,EAEhB,MAAM,QAAQ,CAAA;AAEf,eAAO,MAAM,UAAU,K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EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC1B,QAAQ,EAAE,eAAe,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;CACtD,CAAC,CAAA"}
|
package/dist/devTools/store.js
CHANGED
|
@@ -68,7 +68,7 @@ const emptyState = {
|
|
|
68
68
|
keyframes: HashMap.empty(),
|
|
69
69
|
maybeInitModel: Option.none(),
|
|
70
70
|
initCommands: [],
|
|
71
|
-
|
|
71
|
+
initMountStarts: [],
|
|
72
72
|
startIndex: 0,
|
|
73
73
|
isPaused: false,
|
|
74
74
|
pausedAtIndex: 0,
|
|
@@ -98,11 +98,11 @@ export const createDevToolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
98
98
|
isPaused: state.isPaused && isPausedAtRetainedIndex,
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
|
-
const recordInit = (model, commands,
|
|
101
|
+
const recordInit = (model, commands, mountStarts = []) => SubscriptionRef.update(stateRef, state => ({
|
|
102
102
|
...state,
|
|
103
103
|
maybeInitModel: Option.some(model),
|
|
104
104
|
initCommands: commands,
|
|
105
|
-
|
|
105
|
+
initMountStarts: mountStarts,
|
|
106
106
|
keyframes: HashMap.set(state.keyframes, 0, model),
|
|
107
107
|
maybeLatestModel: Option.some(model),
|
|
108
108
|
}));
|
|
@@ -118,8 +118,8 @@ export const createDevToolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
118
118
|
tag: message._tag,
|
|
119
119
|
message,
|
|
120
120
|
commands,
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
mountStarts: [],
|
|
122
|
+
mountEnds: [],
|
|
123
123
|
timestamp: performance.now(),
|
|
124
124
|
isModelChanged: hasChangedFields,
|
|
125
125
|
diff,
|
|
@@ -139,24 +139,24 @@ export const createDevToolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
139
139
|
* its mount buffer after each render and calls this to associate the
|
|
140
140
|
* events with the correct entry. When called before any Message has been
|
|
141
141
|
* recorded (only possible from the init render path), the starts attach
|
|
142
|
-
* to `
|
|
142
|
+
* to `initMountStarts`; init has no `ends` because nothing existed
|
|
143
143
|
* to unmount. */
|
|
144
|
-
const attachRenderedMounts = (
|
|
145
|
-
if (Array.isReadonlyArrayEmpty(
|
|
146
|
-
Array.isReadonlyArrayEmpty(
|
|
144
|
+
const attachRenderedMounts = (mountStarts, mountEnds) => SubscriptionRef.update(stateRef, state => {
|
|
145
|
+
if (Array.isReadonlyArrayEmpty(mountStarts) &&
|
|
146
|
+
Array.isReadonlyArrayEmpty(mountEnds)) {
|
|
147
147
|
return state;
|
|
148
148
|
}
|
|
149
149
|
return Array.match(state.entries, {
|
|
150
150
|
onEmpty: () => ({
|
|
151
151
|
...state,
|
|
152
|
-
|
|
152
|
+
initMountStarts: Array.appendAll(state.initMountStarts, mountStarts),
|
|
153
153
|
}),
|
|
154
154
|
onNonEmpty: entries => ({
|
|
155
155
|
...state,
|
|
156
156
|
entries: Array.modifyLastNonEmpty(entries, (last) => ({
|
|
157
157
|
...last,
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
mountStarts: Array.appendAll(last.mountStarts, mountStarts),
|
|
159
|
+
mountEnds: Array.appendAll(last.mountEnds, mountEnds),
|
|
160
160
|
})),
|
|
161
161
|
}),
|
|
162
162
|
});
|
|
@@ -198,7 +198,7 @@ export const createDevToolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
198
198
|
...emptyState,
|
|
199
199
|
maybeInitModel: state.maybeInitModel,
|
|
200
200
|
initCommands: state.initCommands,
|
|
201
|
-
|
|
201
|
+
initMountStarts: state.initMountStarts,
|
|
202
202
|
keyframes: Option.match(state.maybeInitModel, {
|
|
203
203
|
onNone: () => HashMap.empty(),
|
|
204
204
|
onSome: model => HashMap.set(HashMap.empty(), 0, model),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webSocketBridge.d.ts","sourceRoot":"","sources":["../../src/devTools/webSocketBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAIN,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"webSocketBridge.d.ts","sourceRoot":"","sources":["../../src/devTools/webSocketBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAIN,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AA+Bf,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,YAAY,CAAA;AAQ3D,KAAK,GAAG,GAAG,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;AAczC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,aAAa,EACpB,KAAK,GAAG,EACR,UAAU,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EACnD,oBAAoB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KACnD,MAAM,CAAC,MAAM,CAAC,IAAI,CA+EjB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Array, Cause, Effect, Exit, HashMap, Match, Option, Order, Schema as S, SubscriptionRef, pipe, } from 'effect';
|
|
2
2
|
import { OptionExt } from '../effectExtensions/index.js';
|
|
3
3
|
import { EventConnected, EventDisconnected, EventFrame, KeyframeInfo, RequestFrame, ResponseDispatched, ResponseError, ResponseFrame, ResponseInit, ResponseKeyframes, ResponseMessage, ResponseMessages, ResponseModel, ResponseReplayed, ResponseResumed, ResponseRuntimeState, RuntimeInfo, } from './protocol.js';
|
|
4
|
-
import { toInspectableValue, toSerializedCommand, toSerializedEntry, } from './serialize.js';
|
|
4
|
+
import { toInspectableValue, toSerializedCommand, toSerializedEntry, toSerializedMount, } from './serialize.js';
|
|
5
5
|
import { INIT_INDEX } from './store.js';
|
|
6
6
|
import { formatPathNotFound, resolvePath, summarizeValue, } from './summarize.js';
|
|
7
7
|
const REQUEST_CHANNEL = 'foldkit:devTools:request';
|
|
@@ -169,7 +169,7 @@ const dispatchRequest = (store, dispatch, maybeMessageSchema, request) => Match.
|
|
|
169
169
|
return ResponseInit({
|
|
170
170
|
maybeModel: Option.map(state.maybeInitModel, toInspectableValue),
|
|
171
171
|
commands: Array.map(state.initCommands, toSerializedCommand),
|
|
172
|
-
|
|
172
|
+
mountStarts: Array.map(state.initMountStarts, toSerializedMount),
|
|
173
173
|
});
|
|
174
174
|
}),
|
|
175
175
|
RequestGetRuntimeState: () => Effect.gen(function* () {
|
package/dist/html/index.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ import type { MountAction } from '../mount/index.js';
|
|
|
4
4
|
import { Dispatch } from '../runtime/index.js';
|
|
5
5
|
import { VNode } from '../vdom.js';
|
|
6
6
|
export { createKeyedLazy, createLazy } from './lazy.js';
|
|
7
|
+
/**
|
|
8
|
+
* The `id` of the DOM element that hosts the Foldkit DevTools shadow root.
|
|
9
|
+
* Lives here (not in `devTools/`) because the `OnBlur` handler below uses it
|
|
10
|
+
* to suppress blur Messages whose `relatedTarget` is this host (i.e. when
|
|
11
|
+
* focus crosses into the DevTools UI). The DevTools overlay imports this
|
|
12
|
+
* constant when creating the host element, so the two stay in sync.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DEVTOOLS_HOST_ID = "foldkit-devtools";
|
|
7
15
|
/**
|
|
8
16
|
* Tag symbol attached to file-aware event handler functions so Scene test
|
|
9
17
|
* helpers can distinguish `OnFileChange` from `OnChange` (both register on
|
|
@@ -58,6 +66,7 @@ export declare const FOLDKIT_MOUNT_KEY: "foldkitMount";
|
|
|
58
66
|
* introspection can identify pending mounts. */
|
|
59
67
|
export type FoldkitMountMarker = Readonly<{
|
|
60
68
|
name: string;
|
|
69
|
+
args?: Record<string, unknown>;
|
|
61
70
|
}>;
|
|
62
71
|
/** Union of all HTML, SVG, and MathML attributes a virtual DOM element can carry. */
|
|
63
72
|
export type Attribute<Message> = Data.TaggedEnum<{
|
|
@@ -1520,6 +1529,7 @@ export declare const html: <Message = never>() => {
|
|
|
1520
1529
|
readonly _tag: "OnMount";
|
|
1521
1530
|
readonly action: Readonly<{
|
|
1522
1531
|
name: string;
|
|
1532
|
+
args?: Record<string, unknown>;
|
|
1523
1533
|
f: (element: Element) => Effect.Effect<Readonly<{
|
|
1524
1534
|
message: Message;
|
|
1525
1535
|
cleanup: () => void;
|
|
@@ -2523,6 +2533,7 @@ export declare const html: <Message = never>() => {
|
|
|
2523
2533
|
};
|
|
2524
2534
|
OnMount: (action: Readonly<{
|
|
2525
2535
|
name: string;
|
|
2536
|
+
args?: Record<string, unknown>;
|
|
2526
2537
|
f: (element: Element) => Effect.Effect<Readonly<{
|
|
2527
2538
|
message: Message;
|
|
2528
2539
|
cleanup: () => void;
|
|
@@ -2531,6 +2542,7 @@ export declare const html: <Message = never>() => {
|
|
|
2531
2542
|
readonly _tag: "OnMount";
|
|
2532
2543
|
readonly action: Readonly<{
|
|
2533
2544
|
name: string;
|
|
2545
|
+
args?: Record<string, unknown>;
|
|
2534
2546
|
f: (element: Element) => Effect.Effect<Readonly<{
|
|
2535
2547
|
message: Message;
|
|
2536
2548
|
cleanup: () => void;
|