foldkit 0.87.0 → 0.88.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/dist/command/index.d.ts +60 -13
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +41 -16
- package/dist/command/public.d.ts +1 -1
- package/dist/command/public.d.ts.map +1 -1
- package/dist/devTools/overlay.d.ts +44 -20
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +119 -78
- package/dist/devTools/protocol.d.ts +48 -11
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +8 -3
- 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 +8 -4
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +6 -6
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +2 -2
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +12 -5
- package/dist/test/apps/counter.d.ts +14 -13
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +6 -3
- package/dist/test/apps/formChild.d.ts +4 -17
- package/dist/test/apps/formChild.d.ts.map +1 -1
- package/dist/test/apps/formChild.js +4 -6
- package/dist/test/apps/login.d.ts +3 -6
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +2 -3
- package/dist/test/apps/resumeUpload.d.ts +9 -7
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +4 -6
- package/dist/test/internal.d.ts +58 -13
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +121 -39
- package/dist/test/scene.d.ts +14 -3
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +21 -15
- package/dist/test/story.d.ts +15 -5
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +22 -15
- package/dist/ui/animation/update.d.ts +7 -5
- package/dist/ui/animation/update.d.ts.map +1 -1
- package/dist/ui/animation/update.js +6 -8
- package/dist/ui/calendar/index.d.ts +7 -8
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +7 -10
- package/dist/ui/calendar/public.d.ts +1 -1
- package/dist/ui/calendar/public.d.ts.map +1 -1
- package/dist/ui/calendar/public.js +1 -1
- package/dist/ui/combobox/multi.d.ts +1 -0
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/shared.d.ts +32 -17
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +17 -28
- package/dist/ui/combobox/single.d.ts +1 -0
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/dialog/index.d.ts +10 -5
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +11 -10
- package/dist/ui/disclosure/index.d.ts +5 -3
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +3 -3
- package/dist/ui/dragAndDrop/index.d.ts +14 -7
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +19 -8
- package/dist/ui/listbox/multi.d.ts +1 -0
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/shared.d.ts +40 -21
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +21 -34
- package/dist/ui/listbox/single.d.ts +1 -0
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/menu/index.d.ts +40 -22
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +25 -37
- package/dist/ui/popover/index.d.ts +26 -16
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +14 -21
- package/dist/ui/radioGroup/index.d.ts +6 -3
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +5 -10
- package/dist/ui/tabs/index.d.ts +6 -3
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +13 -23
- package/dist/ui/toast/index.d.ts +4 -0
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/update.d.ts +11 -3
- package/dist/ui/toast/update.d.ts.map +1 -1
- package/dist/ui/toast/update.js +8 -4
- package/dist/ui/tooltip/index.d.ts +6 -3
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +2 -4
- package/dist/ui/virtualList/index.d.ts +7 -3
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +15 -4
- package/package.json +7 -5
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
+
/** A serialized Command produced during a Message dispatch (or `init`). `args` is `Some` when the Command's definition declared an args record, and carries the runtime values used to construct the Command instance. */
|
|
3
|
+
export declare const SerializedCommand: S.Struct<{
|
|
4
|
+
readonly name: S.String;
|
|
5
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
6
|
+
}>;
|
|
7
|
+
/** A serialized Command suitable for transmission over the WS protocol. */
|
|
8
|
+
export type SerializedCommand = typeof SerializedCommand.Type;
|
|
2
9
|
/** 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. `mountStartNames` lists Mounts that fired during the render after this Message; `mountEndNames` lists Mounts whose elements were unmounted during that render. The Messages dispatched by mount Effects appear as their own entries elsewhere in history. */
|
|
3
10
|
export declare const SerializedEntry: S.Struct<{
|
|
4
11
|
readonly index: S.Number;
|
|
5
12
|
readonly tag: S.String;
|
|
6
13
|
readonly message: S.Unknown;
|
|
7
|
-
readonly
|
|
14
|
+
readonly commands: S.$Array<S.Struct<{
|
|
15
|
+
readonly name: S.String;
|
|
16
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
17
|
+
}>>;
|
|
8
18
|
readonly mountStartNames: S.$Array<S.String>;
|
|
9
19
|
readonly mountEndNames: S.$Array<S.String>;
|
|
10
20
|
readonly timestamp: S.Number;
|
|
@@ -100,7 +110,10 @@ export declare const ResponseMessages: import("../schema/index.js").CallableTagg
|
|
|
100
110
|
readonly index: S.Number;
|
|
101
111
|
readonly tag: S.String;
|
|
102
112
|
readonly message: S.Unknown;
|
|
103
|
-
readonly
|
|
113
|
+
readonly commands: S.$Array<S.Struct<{
|
|
114
|
+
readonly name: S.String;
|
|
115
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
116
|
+
}>>;
|
|
104
117
|
readonly mountStartNames: S.$Array<S.String>;
|
|
105
118
|
readonly mountEndNames: S.$Array<S.String>;
|
|
106
119
|
readonly timestamp: S.Number;
|
|
@@ -118,7 +131,10 @@ export declare const ResponseMessage: import("../schema/index.js").CallableTagge
|
|
|
118
131
|
readonly index: S.Number;
|
|
119
132
|
readonly tag: S.String;
|
|
120
133
|
readonly message: S.Unknown;
|
|
121
|
-
readonly
|
|
134
|
+
readonly commands: S.$Array<S.Struct<{
|
|
135
|
+
readonly name: S.String;
|
|
136
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
137
|
+
}>>;
|
|
122
138
|
readonly mountStartNames: S.$Array<S.String>;
|
|
123
139
|
readonly mountEndNames: S.$Array<S.String>;
|
|
124
140
|
readonly timestamp: S.Number;
|
|
@@ -153,10 +169,13 @@ export declare const ResponseRuntimes: import("../schema/index.js").CallableTagg
|
|
|
153
169
|
readonly title: S.String;
|
|
154
170
|
}>>;
|
|
155
171
|
}>;
|
|
156
|
-
/** 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. `
|
|
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. `mountStartNames` lists the Mounts that fired during the initial render. */
|
|
157
173
|
export declare const ResponseInit: import("../schema/index.js").CallableTaggedStruct<"ResponseInit", {
|
|
158
174
|
maybeModel: S.OptionFromNullOr<S.Unknown>;
|
|
159
|
-
|
|
175
|
+
commands: S.$Array<S.Struct<{
|
|
176
|
+
readonly name: S.String;
|
|
177
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
178
|
+
}>>;
|
|
160
179
|
mountStartNames: S.$Array<S.String>;
|
|
161
180
|
}>;
|
|
162
181
|
/** 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,7 +201,10 @@ export declare const Response: S.Union<readonly [import("../schema/index.js").Ca
|
|
|
182
201
|
readonly index: S.Number;
|
|
183
202
|
readonly tag: S.String;
|
|
184
203
|
readonly message: S.Unknown;
|
|
185
|
-
readonly
|
|
204
|
+
readonly commands: S.$Array<S.Struct<{
|
|
205
|
+
readonly name: S.String;
|
|
206
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
207
|
+
}>>;
|
|
186
208
|
readonly mountStartNames: S.$Array<S.String>;
|
|
187
209
|
readonly mountEndNames: S.$Array<S.String>;
|
|
188
210
|
readonly timestamp: S.Number;
|
|
@@ -198,7 +220,10 @@ export declare const Response: S.Union<readonly [import("../schema/index.js").Ca
|
|
|
198
220
|
readonly index: S.Number;
|
|
199
221
|
readonly tag: S.String;
|
|
200
222
|
readonly message: S.Unknown;
|
|
201
|
-
readonly
|
|
223
|
+
readonly commands: S.$Array<S.Struct<{
|
|
224
|
+
readonly name: S.String;
|
|
225
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
226
|
+
}>>;
|
|
202
227
|
readonly mountStartNames: S.$Array<S.String>;
|
|
203
228
|
readonly mountEndNames: S.$Array<S.String>;
|
|
204
229
|
readonly timestamp: S.Number;
|
|
@@ -224,7 +249,10 @@ export declare const Response: S.Union<readonly [import("../schema/index.js").Ca
|
|
|
224
249
|
}>>;
|
|
225
250
|
}>, import("../schema/index.js").CallableTaggedStruct<"ResponseInit", {
|
|
226
251
|
maybeModel: S.OptionFromNullOr<S.Unknown>;
|
|
227
|
-
|
|
252
|
+
commands: S.$Array<S.Struct<{
|
|
253
|
+
readonly name: S.String;
|
|
254
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
255
|
+
}>>;
|
|
228
256
|
mountStartNames: S.$Array<S.String>;
|
|
229
257
|
}>, import("../schema/index.js").CallableTaggedStruct<"ResponseRuntimeState", {
|
|
230
258
|
currentIndex: S.Number;
|
|
@@ -298,7 +326,10 @@ export declare const ResponseFrame: S.Struct<{
|
|
|
298
326
|
readonly index: S.Number;
|
|
299
327
|
readonly tag: S.String;
|
|
300
328
|
readonly message: S.Unknown;
|
|
301
|
-
readonly
|
|
329
|
+
readonly commands: S.$Array<S.Struct<{
|
|
330
|
+
readonly name: S.String;
|
|
331
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
332
|
+
}>>;
|
|
302
333
|
readonly mountStartNames: S.$Array<S.String>;
|
|
303
334
|
readonly mountEndNames: S.$Array<S.String>;
|
|
304
335
|
readonly timestamp: S.Number;
|
|
@@ -314,7 +345,10 @@ export declare const ResponseFrame: S.Struct<{
|
|
|
314
345
|
readonly index: S.Number;
|
|
315
346
|
readonly tag: S.String;
|
|
316
347
|
readonly message: S.Unknown;
|
|
317
|
-
readonly
|
|
348
|
+
readonly commands: S.$Array<S.Struct<{
|
|
349
|
+
readonly name: S.String;
|
|
350
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
351
|
+
}>>;
|
|
318
352
|
readonly mountStartNames: S.$Array<S.String>;
|
|
319
353
|
readonly mountEndNames: S.$Array<S.String>;
|
|
320
354
|
readonly timestamp: S.Number;
|
|
@@ -340,7 +374,10 @@ export declare const ResponseFrame: S.Struct<{
|
|
|
340
374
|
}>>;
|
|
341
375
|
}>, import("../schema/index.js").CallableTaggedStruct<"ResponseInit", {
|
|
342
376
|
maybeModel: S.OptionFromNullOr<S.Unknown>;
|
|
343
|
-
|
|
377
|
+
commands: S.$Array<S.Struct<{
|
|
378
|
+
readonly name: S.String;
|
|
379
|
+
readonly args: S.OptionFromNullOr<S.$Record<S.String, S.Unknown>>;
|
|
380
|
+
}>>;
|
|
344
381
|
mountStartNames: S.$Array<S.String>;
|
|
345
382
|
}>, import("../schema/index.js").CallableTaggedStruct<"ResponseRuntimeState", {
|
|
346
383
|
currentIndex: 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,ggBAAggB;AAChgB,eAAO,MAAM,eAAe
|
|
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,ggBAAggB;AAChgB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;EAa1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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGxB,CAAA;AACF,uEAAuE;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"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
2
|
import { ts } from '../schema/index.js';
|
|
3
3
|
// SHARED
|
|
4
|
+
/** A serialized Command produced during a Message dispatch (or `init`). `args` is `Some` when the Command's definition declared an args record, and carries the runtime values used to construct the Command instance. */
|
|
5
|
+
export const SerializedCommand = S.Struct({
|
|
6
|
+
name: S.String,
|
|
7
|
+
args: S.OptionFromNullOr(S.Record(S.String, S.Unknown)),
|
|
8
|
+
});
|
|
4
9
|
/** 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. `mountStartNames` lists Mounts that fired during the render after this Message; `mountEndNames` lists Mounts whose elements were unmounted during that render. The Messages dispatched by mount Effects appear as their own entries elsewhere in history. */
|
|
5
10
|
export const SerializedEntry = S.Struct({
|
|
6
11
|
index: S.Number,
|
|
7
12
|
tag: S.String,
|
|
8
13
|
message: S.Unknown,
|
|
9
|
-
|
|
14
|
+
commands: S.Array(SerializedCommand),
|
|
10
15
|
mountStartNames: S.Array(S.String),
|
|
11
16
|
mountEndNames: S.Array(S.String),
|
|
12
17
|
timestamp: S.Number,
|
|
@@ -113,10 +118,10 @@ export const ResponseDispatched = ts('ResponseDispatched', {
|
|
|
113
118
|
export const ResponseRuntimes = ts('ResponseRuntimes', {
|
|
114
119
|
runtimes: S.Array(RuntimeInfo),
|
|
115
120
|
});
|
|
116
|
-
/** 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. `
|
|
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. `mountStartNames` lists the Mounts that fired during the initial render. */
|
|
117
122
|
export const ResponseInit = ts('ResponseInit', {
|
|
118
123
|
maybeModel: S.OptionFromNullOr(S.Unknown),
|
|
119
|
-
|
|
124
|
+
commands: S.Array(SerializedCommand),
|
|
120
125
|
mountStartNames: S.Array(S.String),
|
|
121
126
|
});
|
|
122
127
|
/** 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. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SerializedEntry } from './protocol.js';
|
|
2
|
-
import type { HistoryEntry } from './store.js';
|
|
1
|
+
import type { SerializedCommand, SerializedEntry } from './protocol.js';
|
|
2
|
+
import type { CommandRecord, HistoryEntry } 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
|
|
@@ -19,6 +19,12 @@ import type { HistoryEntry } from './store.js';
|
|
|
19
19
|
* row lazy actually hits.
|
|
20
20
|
*/
|
|
21
21
|
export declare const toInspectableValue: (value: unknown) => unknown;
|
|
22
|
+
/**
|
|
23
|
+
* Convert a runtime `CommandRecord` to its wire shape. Args are wrapped in an
|
|
24
|
+
* `Option` so `None` cleanly distinguishes argless Commands from Commands that
|
|
25
|
+
* happen to have an empty args record.
|
|
26
|
+
*/
|
|
27
|
+
export declare const toSerializedCommand: (command: CommandRecord) => SerializedCommand;
|
|
22
28
|
/**
|
|
23
29
|
* Convert a `HistoryEntry` plus its absolute index into the wire-friendly
|
|
24
30
|
* `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":"
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/devTools/serialize.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAwB7D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OAUnD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,aAAa,KACrB,iBAGD,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,YAAY,EACnB,OAAO,MAAM,KACZ,eAoBF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Array as Array_, Function, Match as M, Predicate, Record, } from 'effect';
|
|
1
|
+
import { Array as Array_, Function, Match as M, Option, Predicate, Record, } from 'effect';
|
|
2
2
|
import { extractSubmodelInfo } from './submodelPath.js';
|
|
3
3
|
const inspectableCache = new WeakMap();
|
|
4
4
|
const computeInspectableValue = (value) => M.value(value).pipe(M.when(M.instanceOf(File), file => ({
|
|
@@ -39,6 +39,15 @@ export const toInspectableValue = (value) => {
|
|
|
39
39
|
inspectableCache.set(value, result);
|
|
40
40
|
return result;
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Convert a runtime `CommandRecord` to its wire shape. Args are wrapped in an
|
|
44
|
+
* `Option` so `None` cleanly distinguishes argless Commands from Commands that
|
|
45
|
+
* happen to have an empty args record.
|
|
46
|
+
*/
|
|
47
|
+
export const toSerializedCommand = (command) => ({
|
|
48
|
+
name: command.name,
|
|
49
|
+
args: Option.fromNullishOr(command.args),
|
|
50
|
+
});
|
|
42
51
|
/**
|
|
43
52
|
* Convert a `HistoryEntry` plus its absolute index into the wire-friendly
|
|
44
53
|
* `SerializedEntry` shape. Flattens the diff's `HashSet` path collections to
|
|
@@ -51,7 +60,7 @@ export const toSerializedEntry = (entry, index) => {
|
|
|
51
60
|
index,
|
|
52
61
|
tag: entry.tag,
|
|
53
62
|
message: toInspectableValue(entry.message),
|
|
54
|
-
|
|
63
|
+
commands: Array_.map(entry.commands, toSerializedCommand),
|
|
55
64
|
mountStartNames: entry.mountStartNames,
|
|
56
65
|
mountEndNames: entry.mountEndNames,
|
|
57
66
|
timestamp: entry.timestamp,
|
package/dist/devTools/store.d.ts
CHANGED
|
@@ -6,10 +6,14 @@ export type DiffResult = Readonly<{
|
|
|
6
6
|
}>;
|
|
7
7
|
export declare const emptyDiff: DiffResult;
|
|
8
8
|
export declare const computeDiff: (previous: unknown, current: unknown) => DiffResult;
|
|
9
|
+
export type CommandRecord = Readonly<{
|
|
10
|
+
name: string;
|
|
11
|
+
args?: Record<string, unknown>;
|
|
12
|
+
}>;
|
|
9
13
|
export type HistoryEntry = Readonly<{
|
|
10
14
|
tag: string;
|
|
11
15
|
message: unknown;
|
|
12
|
-
|
|
16
|
+
commands: ReadonlyArray<CommandRecord>;
|
|
13
17
|
mountStartNames: ReadonlyArray<string>;
|
|
14
18
|
mountEndNames: ReadonlyArray<string>;
|
|
15
19
|
timestamp: number;
|
|
@@ -20,7 +24,7 @@ export type StoreState = Readonly<{
|
|
|
20
24
|
entries: ReadonlyArray<HistoryEntry>;
|
|
21
25
|
keyframes: HashMap.HashMap<number, unknown>;
|
|
22
26
|
maybeInitModel: Option.Option<unknown>;
|
|
23
|
-
|
|
27
|
+
initCommands: ReadonlyArray<CommandRecord>;
|
|
24
28
|
initMountStartNames: ReadonlyArray<string>;
|
|
25
29
|
startIndex: number;
|
|
26
30
|
isPaused: boolean;
|
|
@@ -34,10 +38,10 @@ export type Bridge = Readonly<{
|
|
|
34
38
|
}>;
|
|
35
39
|
export declare const createDevToolsStore: (bridge: Bridge, maxEntries?: number) => Effect.Effect<DevToolsStore>;
|
|
36
40
|
export type DevToolsStore = Readonly<{
|
|
37
|
-
recordInit: (model: unknown,
|
|
41
|
+
recordInit: (model: unknown, commands: ReadonlyArray<CommandRecord>, mountStartNames?: ReadonlyArray<string>) => Effect.Effect<void>;
|
|
38
42
|
recordMessage: (message: Readonly<{
|
|
39
43
|
_tag: string;
|
|
40
|
-
}>, modelBeforeUpdate: unknown, modelAfterUpdate: unknown,
|
|
44
|
+
}>, modelBeforeUpdate: unknown, modelAfterUpdate: unknown, commands: ReadonlyArray<CommandRecord>, isModelChanged: boolean) => Effect.Effect<void>;
|
|
41
45
|
attachRenderedMounts: (mountStartNames: ReadonlyArray<string>, mountEndNames: ReadonlyArray<string>) => Effect.Effect<void>;
|
|
42
46
|
getModelAtIndex: (index: number) => Effect.Effect<unknown>;
|
|
43
47
|
getMessageAtIndex: (index: number) => Effect.Effect<Option.Option<unknown>>;
|
|
@@ -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,KAAK,CAAA;AAM5B,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACrC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;CACvC,CAAC,CAAA;AAEF,eAAO,MAAM,SAAS,EAAE,UAGvB,CAAA;AAID,eAAO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AgB,EAAE,OAAO,EACzB,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,EACtC,cAAc,EAAE,OAAO,KACpB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACxB,oBAAoB,EAAE,CACpB,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,EACtC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,KACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACxB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC1D,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3E,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IAC5D,MAAM,EAAE,CAAC,KAAK,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
|
@@ -67,7 +67,7 @@ const emptyState = {
|
|
|
67
67
|
entries: [],
|
|
68
68
|
keyframes: HashMap.empty(),
|
|
69
69
|
maybeInitModel: Option.none(),
|
|
70
|
-
|
|
70
|
+
initCommands: [],
|
|
71
71
|
initMountStartNames: [],
|
|
72
72
|
startIndex: 0,
|
|
73
73
|
isPaused: false,
|
|
@@ -98,15 +98,15 @@ export const createDevToolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
98
98
|
isPaused: state.isPaused && isPausedAtRetainedIndex,
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
|
-
const recordInit = (model,
|
|
101
|
+
const recordInit = (model, commands, mountStartNames = []) => SubscriptionRef.update(stateRef, state => ({
|
|
102
102
|
...state,
|
|
103
103
|
maybeInitModel: Option.some(model),
|
|
104
|
-
|
|
104
|
+
initCommands: commands,
|
|
105
105
|
initMountStartNames: mountStartNames,
|
|
106
106
|
keyframes: HashMap.set(state.keyframes, 0, model),
|
|
107
107
|
maybeLatestModel: Option.some(model),
|
|
108
108
|
}));
|
|
109
|
-
const recordMessage = (message, modelBeforeUpdate, modelAfterUpdate,
|
|
109
|
+
const recordMessage = (message, modelBeforeUpdate, modelAfterUpdate, commands, isModelChanged) => SubscriptionRef.update(stateRef, state => {
|
|
110
110
|
const absoluteIndex = state.startIndex + state.entries.length;
|
|
111
111
|
const diff = isModelChanged
|
|
112
112
|
? computeDiff(modelBeforeUpdate, modelAfterUpdate)
|
|
@@ -117,7 +117,7 @@ export const createDevToolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
117
117
|
entries: Array.append(state.entries, {
|
|
118
118
|
tag: message._tag,
|
|
119
119
|
message,
|
|
120
|
-
|
|
120
|
+
commands,
|
|
121
121
|
mountStartNames: [],
|
|
122
122
|
mountEndNames: [],
|
|
123
123
|
timestamp: performance.now(),
|
|
@@ -197,7 +197,7 @@ export const createDevToolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
197
197
|
const clear = SubscriptionRef.update(stateRef, state => ({
|
|
198
198
|
...emptyState,
|
|
199
199
|
maybeInitModel: state.maybeInitModel,
|
|
200
|
-
|
|
200
|
+
initCommands: state.initCommands,
|
|
201
201
|
initMountStartNames: state.initMountStartNames,
|
|
202
202
|
keyframes: Option.match(state.maybeInitModel, {
|
|
203
203
|
onNone: () => HashMap.empty(),
|
|
@@ -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;AA8Bf,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, toSerializedEntry } from './serialize.js';
|
|
4
|
+
import { toInspectableValue, toSerializedCommand, toSerializedEntry, } 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';
|
|
@@ -168,7 +168,7 @@ const dispatchRequest = (store, dispatch, maybeMessageSchema, request) => Match.
|
|
|
168
168
|
const state = yield* SubscriptionRef.get(store.stateRef);
|
|
169
169
|
return ResponseInit({
|
|
170
170
|
maybeModel: Option.map(state.maybeInitModel, toInspectableValue),
|
|
171
|
-
|
|
171
|
+
commands: Array.map(state.initCommands, toSerializedCommand),
|
|
172
172
|
mountStartNames: state.initMountStartNames,
|
|
173
173
|
});
|
|
174
174
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,OAAO,EAEP,MAAM,EAGN,KAAK,EAEL,MAAM,EAON,MAAM,EAIP,MAAM,QAAQ,CAAA;AAGf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,OAAO,EAEP,MAAM,EAGN,KAAK,EAEL,MAAM,EAON,MAAM,EAIP,MAAM,QAAQ,CAAA;AAGf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,GAAG,EAA+B,MAAM,iBAAiB,CAAA;AAalE,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAe5C,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,YAAY,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C5B,KAAK,EACL,OAAO,EACP,aAAa,EACb,KAAK,EACL,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AAEpB,wBAAgB,WAAW,CACzB,KAAK,EACL,OAAO,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAChC,aAAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,SAAS,GAAG,KAAK,EACjB,uBAAuB,GAAG,KAAK,EAE/B,MAAM,EAAE,aAAa,CACnB,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AA2NpB,kEAAkE;AAClE,eAAO,MAAM,GAAG,GAAI,SAAS,iBAAiB,KAAG,IA4ChD,CAAA"}
|
package/dist/runtime/runtime.js
CHANGED
|
@@ -2,7 +2,7 @@ import { BrowserRuntime } from '@effect/platform-browser';
|
|
|
2
2
|
import { Array, Cause, Context, Duration, Effect, Exit, Function, Layer, Match, Option, Predicate, PubSub, Queue, Record, Ref, Scheduler, Schema, Stream, SubscriptionRef, pipe, } from 'effect';
|
|
3
3
|
import { h } from 'snabbdom';
|
|
4
4
|
import { createOverlay } from '../devTools/overlay.js';
|
|
5
|
-
import { createDevToolsStore } from '../devTools/store.js';
|
|
5
|
+
import { createDevToolsStore, } from '../devTools/store.js';
|
|
6
6
|
import { startWebSocketBridge } from '../devTools/webSocketBridge.js';
|
|
7
7
|
import { MountTracker } from '../mount/index.js';
|
|
8
8
|
import { fromString as urlFromString } from '../url/index.js';
|
|
@@ -14,6 +14,9 @@ import { PreserveModelMessage, RequestModelMessage, RestoreModelMessage, } from
|
|
|
14
14
|
import { orderByPriority } from './messagePriority.js';
|
|
15
15
|
import { makePreserveScheduler } from './preserveScheduler.js';
|
|
16
16
|
import { makeRenderLoop } from './renderLoop.js';
|
|
17
|
+
const toCommandRecord = (command) => command.args !== undefined
|
|
18
|
+
? { name: command.name, args: command.args }
|
|
19
|
+
: { name: command.name };
|
|
17
20
|
const DEFAULT_DEV_TOOLS_SHOW = 'Development';
|
|
18
21
|
const DEFAULT_DEV_TOOLS_POSITION = 'BottomRight';
|
|
19
22
|
const DEFAULT_DEV_TOOLS_MODE = 'TimeTravel';
|
|
@@ -157,7 +160,9 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
|
|
|
157
160
|
const modelPubSub = yield* PubSub.unbounded();
|
|
158
161
|
yield* Effect.forEach(
|
|
159
162
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
160
|
-
initCommands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name
|
|
163
|
+
initCommands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name, {
|
|
164
|
+
attributes: command.args ?? {},
|
|
165
|
+
}), provideAllResources, Effect.flatMap(enqueueNormal))));
|
|
161
166
|
if (routingConfig) {
|
|
162
167
|
addNavigationEventListeners(enqueueHighUnsafe, routingConfig);
|
|
163
168
|
}
|
|
@@ -212,7 +217,9 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
|
|
|
212
217
|
}
|
|
213
218
|
yield* Effect.forEach(
|
|
214
219
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
215
|
-
commands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name
|
|
220
|
+
commands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name, {
|
|
221
|
+
attributes: command.args ?? {},
|
|
222
|
+
}), provideAllResources, Effect.flatMap(enqueueNormal))));
|
|
216
223
|
const maybeDevToolsStore = yield* Ref.get(maybeDevToolsStoreRef);
|
|
217
224
|
yield* Option.match(maybeDevToolsStore, {
|
|
218
225
|
onNone: () => Effect.void,
|
|
@@ -220,7 +227,7 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
|
|
|
220
227
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
221
228
|
message, currentModel, nextModel, Array.map(
|
|
222
229
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
223
|
-
commands,
|
|
230
|
+
commands, toCommandRecord), currentModel !== nextModel),
|
|
224
231
|
});
|
|
225
232
|
});
|
|
226
233
|
// NOTE: `dispatchService` defaults to the live dispatch but is
|
|
@@ -305,7 +312,7 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
|
|
|
305
312
|
const maybeStoreForInit = yield* Ref.get(maybeDevToolsStoreRef);
|
|
306
313
|
yield* Option.match(maybeStoreForInit, {
|
|
307
314
|
onNone: () => Effect.void,
|
|
308
|
-
onSome: store => store.recordInit(initModel, Array.map(initCommands,
|
|
315
|
+
onSome: store => store.recordInit(initModel, Array.map(initCommands, toCommandRecord), initMountEvents.starts),
|
|
309
316
|
});
|
|
310
317
|
// NOTE: lastDirtyMessageRef holds the most recent dirtying Message, so
|
|
311
318
|
// slow-view callbacks during high-rate bursts attribute to the last
|
|
@@ -7,32 +7,33 @@ export type Model = typeof Model.Type;
|
|
|
7
7
|
export declare const ClickedIncrement: import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>;
|
|
8
8
|
export declare const ClickedDecrement: import("../../schema/index.js").CallableTaggedStruct<"ClickedDecrement", {}>;
|
|
9
9
|
export declare const ClickedFetch: import("../../schema/index.js").CallableTaggedStruct<"ClickedFetch", {}>;
|
|
10
|
+
export declare const ClickedFetchById: import("../../schema/index.js").CallableTaggedStruct<"ClickedFetchById", {
|
|
11
|
+
id: S.Number;
|
|
12
|
+
}>;
|
|
10
13
|
export declare const SucceededFetchCount: import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
|
|
11
14
|
count: S.Number;
|
|
12
15
|
}>;
|
|
13
16
|
export declare const FailedFetchCount: import("../../schema/index.js").CallableTaggedStruct<"FailedFetchCount", {
|
|
14
17
|
error: S.String;
|
|
15
18
|
}>;
|
|
16
|
-
export declare const Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedDecrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedFetch", {}>, import("../../schema/index.js").CallableTaggedStruct<"
|
|
19
|
+
export declare const Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedDecrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedFetch", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedFetchById", {
|
|
20
|
+
id: S.Number;
|
|
21
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
|
|
17
22
|
count: S.Number;
|
|
18
23
|
}>, import("../../schema/index.js").CallableTaggedStruct<"FailedFetchCount", {
|
|
19
24
|
error: S.String;
|
|
20
25
|
}>]>;
|
|
21
26
|
export type Message = typeof Message.Type;
|
|
22
|
-
export declare const FetchCount: Command.
|
|
27
|
+
export declare const FetchCount: Command.CommandDefinitionNoArgs<"FetchCount", Effect.Effect<{
|
|
23
28
|
readonly _tag: "SucceededFetchCount";
|
|
24
29
|
readonly count: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
readonly _tag: "SucceededFetchCount";
|
|
33
|
-
readonly count: number;
|
|
34
|
-
}, never, never>;
|
|
35
|
-
}>;
|
|
30
|
+
}, never, never>>;
|
|
31
|
+
export declare const FetchCountById: Command.CommandDefinitionWithArgs<"FetchCountById", {
|
|
32
|
+
id: S.Number;
|
|
33
|
+
}, Effect.Effect<{
|
|
34
|
+
readonly _tag: "SucceededFetchCount";
|
|
35
|
+
readonly count: number;
|
|
36
|
+
}, never, never>>;
|
|
36
37
|
export declare const initialModel: Model;
|
|
37
38
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
38
39
|
//# sourceMappingURL=counter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/test/apps/counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAKjD,eAAO,MAAM,KAAK;;EAAgC,CAAA;AAClD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,mBAAmB;;EAAgD,CAAA;AAChF,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAE1E,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/test/apps/counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAKjD,eAAO,MAAM,KAAK;;EAAgC,CAAA;AAClD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,gBAAgB;;EAA0C,CAAA;AACvE,eAAO,MAAM,mBAAmB;;EAAgD,CAAA;AAChF,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAE1E,eAAO,MAAM,OAAO;;;;;;IAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,UAAU;;;iBAIgC,CAAA;AAEvD,eAAO,MAAM,cAAc;;;;;iBAKyC,CAAA;AAIpE,eAAO,MAAM,YAAY,EAAE,KAAoB,CAAA;AAI/C,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAaxD,CAAA"}
|
|
@@ -7,25 +7,28 @@ export const Model = S.Struct({ count: S.Number });
|
|
|
7
7
|
export const ClickedIncrement = m('ClickedIncrement');
|
|
8
8
|
export const ClickedDecrement = m('ClickedDecrement');
|
|
9
9
|
export const ClickedFetch = m('ClickedFetch');
|
|
10
|
+
export const ClickedFetchById = m('ClickedFetchById', { id: S.Number });
|
|
10
11
|
export const SucceededFetchCount = m('SucceededFetchCount', { count: S.Number });
|
|
11
12
|
export const FailedFetchCount = m('FailedFetchCount', { error: S.String });
|
|
12
13
|
export const Message = S.Union([
|
|
13
14
|
ClickedIncrement,
|
|
14
15
|
ClickedDecrement,
|
|
15
16
|
ClickedFetch,
|
|
17
|
+
ClickedFetchById,
|
|
16
18
|
SucceededFetchCount,
|
|
17
19
|
FailedFetchCount,
|
|
18
20
|
]);
|
|
19
21
|
// COMMAND
|
|
20
|
-
export const FetchCount = Command.define('FetchCount', SucceededFetchCount, FailedFetchCount);
|
|
21
|
-
export const
|
|
22
|
+
export const FetchCount = Command.define('FetchCount', SucceededFetchCount, FailedFetchCount)(Effect.sync(() => SucceededFetchCount({ count: 0 })));
|
|
23
|
+
export const FetchCountById = Command.define('FetchCountById', { id: S.Number }, SucceededFetchCount, FailedFetchCount)(({ id }) => Effect.sync(() => SucceededFetchCount({ count: id })));
|
|
22
24
|
// INIT
|
|
23
25
|
export const initialModel = { count: 0 };
|
|
24
26
|
// UPDATE
|
|
25
27
|
export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
|
|
26
28
|
ClickedIncrement: () => [{ count: model.count + 1 }, []],
|
|
27
29
|
ClickedDecrement: () => [{ count: model.count - 1 }, []],
|
|
28
|
-
ClickedFetch: () => [model, [
|
|
30
|
+
ClickedFetch: () => [model, [FetchCount()]],
|
|
31
|
+
ClickedFetchById: ({ id }) => [model, [FetchCountById({ id })]],
|
|
29
32
|
SucceededFetchCount: ({ count }) => [{ count }, []],
|
|
30
33
|
FailedFetchCount: () => [model, []],
|
|
31
34
|
}));
|
|
@@ -22,26 +22,13 @@ export declare const ChildOutMessage: S.Union<readonly [import("../../schema/ind
|
|
|
22
22
|
id: S.String;
|
|
23
23
|
}>, import("../../schema/index.js").CallableTaggedStruct<"RequestedCancel", {}>]>;
|
|
24
24
|
export type ChildOutMessage = typeof ChildOutMessage.Type;
|
|
25
|
-
export declare const SubmitForm: Command.
|
|
25
|
+
export declare const SubmitForm: Command.CommandDefinitionNoArgs<"SubmitForm", Effect.Effect<{
|
|
26
26
|
readonly _tag: "SucceededSubmit";
|
|
27
27
|
readonly id: string;
|
|
28
|
-
}
|
|
29
|
-
export declare const
|
|
30
|
-
name: "SubmitForm";
|
|
31
|
-
effect: Effect.Effect<{
|
|
32
|
-
readonly _tag: "SucceededSubmit";
|
|
33
|
-
readonly id: string;
|
|
34
|
-
}, never, never>;
|
|
35
|
-
}>;
|
|
36
|
-
export declare const ResetForm: Command.CommandDefinition<"ResetForm", {
|
|
28
|
+
}, never, never>>;
|
|
29
|
+
export declare const ResetForm: Command.CommandDefinitionNoArgs<"ResetForm", Effect.Effect<{
|
|
37
30
|
readonly _tag: "CompletedReset";
|
|
38
|
-
}
|
|
39
|
-
export declare const resetForm: Readonly<{
|
|
40
|
-
name: "ResetForm";
|
|
41
|
-
effect: Effect.Effect<{
|
|
42
|
-
readonly _tag: "CompletedReset";
|
|
43
|
-
}, never, never>;
|
|
44
|
-
}>;
|
|
31
|
+
}, never, never>>;
|
|
45
32
|
export declare const initialChildModel: ChildModel;
|
|
46
33
|
export declare const childUpdate: (_model: ChildModel, message: ChildMessage) => readonly [ChildModel, ReadonlyArray<Command.Command<ChildMessage>>, Option.Option<ChildOutMessage>];
|
|
47
34
|
export declare const ParentModel: S.Struct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formChild.d.ts","sourceRoot":"","sources":["../../../src/test/apps/formChild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAKjD,eAAO,MAAM,UAAU;;EAErB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,eAAe;;EAAyC,CAAA;AACrE,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,cAAc,4EAAsB,CAAA;AAEjD,eAAO,MAAM,YAAY;;2JAKvB,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAInD,eAAO,MAAM,aAAa;;EAAuC,CAAA;AACjE,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,eAAe;;iFAA4C,CAAA;AACxE,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD,eAAO,MAAM,UAAU;;;
|
|
1
|
+
{"version":3,"file":"formChild.d.ts","sourceRoot":"","sources":["../../../src/test/apps/formChild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAKjD,eAAO,MAAM,UAAU;;EAErB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,eAAO,MAAM,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,CAAA"}
|
|
@@ -21,22 +21,20 @@ export const RequestedSave = m('RequestedSave', { id: S.String });
|
|
|
21
21
|
export const RequestedCancel = m('RequestedCancel');
|
|
22
22
|
export const ChildOutMessage = S.Union([RequestedSave, RequestedCancel]);
|
|
23
23
|
// CHILD COMMAND
|
|
24
|
-
export const SubmitForm = Command.define('SubmitForm', SucceededSubmit);
|
|
25
|
-
export const
|
|
26
|
-
export const ResetForm = Command.define('ResetForm', CompletedReset);
|
|
27
|
-
export const resetForm = ResetForm(Effect.sync(() => CompletedReset()));
|
|
24
|
+
export const SubmitForm = Command.define('SubmitForm', SucceededSubmit)(Effect.sync(() => SucceededSubmit({ id: 'abc' })));
|
|
25
|
+
export const ResetForm = Command.define('ResetForm', CompletedReset)(Effect.sync(() => CompletedReset()));
|
|
28
26
|
// CHILD INIT
|
|
29
27
|
export const initialChildModel = { status: 'Idle' };
|
|
30
28
|
// CHILD UPDATE
|
|
31
29
|
export const childUpdate = (_model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
|
|
32
30
|
SubmittedForm: () => [
|
|
33
31
|
{ status: 'Submitting' },
|
|
34
|
-
[
|
|
32
|
+
[SubmitForm()],
|
|
35
33
|
Option.none(),
|
|
36
34
|
],
|
|
37
35
|
SucceededSubmit: ({ id }) => [
|
|
38
36
|
{ status: 'Submitted' },
|
|
39
|
-
[
|
|
37
|
+
[ResetForm()],
|
|
40
38
|
Option.some(RequestedSave({ id })),
|
|
41
39
|
],
|
|
42
40
|
CancelledForm: () => [
|