foldkit 0.88.1 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +62 -24
- 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/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +4 -4
- package/dist/test/apps/counter.d.ts +5 -1
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +34 -5
- 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 +36 -15
- package/dist/test/internal.d.ts +56 -26
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +75 -82
- package/dist/test/scene.d.ts +12 -8
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +56 -39
- package/dist/test/story.d.ts +5 -1
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +16 -4
- 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/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 +40 -40
- package/dist/ui/combobox/single.d.ts +1 -7
- package/dist/ui/combobox/single.d.ts.map +1 -1
- 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 +8 -12
- 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 +8 -12
- 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 +22 -15
- 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 +10 -10
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/mount/public.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/mount/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,MAAM,EACN,UAAU,GACX,MAAM,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[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}
|
package/dist/runtime/runtime.js
CHANGED
|
@@ -190,11 +190,11 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
|
|
|
190
190
|
const mountStartBuffer = [];
|
|
191
191
|
const mountEndBuffer = [];
|
|
192
192
|
const mountTracker = {
|
|
193
|
-
started: name => {
|
|
194
|
-
mountStartBuffer.push(name);
|
|
193
|
+
started: (name, args) => {
|
|
194
|
+
mountStartBuffer.push(args === undefined ? { name } : { name, args });
|
|
195
195
|
},
|
|
196
|
-
ended: name => {
|
|
197
|
-
mountEndBuffer.push(name);
|
|
196
|
+
ended: (name, args) => {
|
|
197
|
+
mountEndBuffer.push(args === undefined ? { name } : { name, args });
|
|
198
198
|
},
|
|
199
199
|
};
|
|
200
200
|
const drainMountEvents = () => {
|
|
@@ -2,6 +2,7 @@ import { Effect, Schema as S } from 'effect';
|
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
3
|
export declare const Model: S.Struct<{
|
|
4
4
|
readonly count: S.Number;
|
|
5
|
+
readonly log: S.$Array<S.Number>;
|
|
5
6
|
}>;
|
|
6
7
|
export type Model = typeof Model.Type;
|
|
7
8
|
export declare const ClickedIncrement: import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>;
|
|
@@ -10,6 +11,9 @@ export declare const ClickedFetch: import("../../schema/index.js").CallableTagge
|
|
|
10
11
|
export declare const ClickedFetchById: import("../../schema/index.js").CallableTaggedStruct<"ClickedFetchById", {
|
|
11
12
|
id: S.Number;
|
|
12
13
|
}>;
|
|
14
|
+
export declare const StartedThreeFetches: import("../../schema/index.js").CallableTaggedStruct<"StartedThreeFetches", {}>;
|
|
15
|
+
export declare const StartedTwoFetchesById: import("../../schema/index.js").CallableTaggedStruct<"StartedTwoFetchesById", {}>;
|
|
16
|
+
export declare const StartedMixedFetches: import("../../schema/index.js").CallableTaggedStruct<"StartedMixedFetches", {}>;
|
|
13
17
|
export declare const SucceededFetchCount: import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
|
|
14
18
|
count: S.Number;
|
|
15
19
|
}>;
|
|
@@ -18,7 +22,7 @@ export declare const FailedFetchCount: import("../../schema/index.js").CallableT
|
|
|
18
22
|
}>;
|
|
19
23
|
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
24
|
id: S.Number;
|
|
21
|
-
}>, import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
|
|
25
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"StartedThreeFetches", {}>, import("../../schema/index.js").CallableTaggedStruct<"StartedTwoFetchesById", {}>, import("../../schema/index.js").CallableTaggedStruct<"StartedMixedFetches", {}>, import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
|
|
22
26
|
count: S.Number;
|
|
23
27
|
}>, import("../../schema/index.js").CallableTaggedStruct<"FailedFetchCount", {
|
|
24
28
|
error: S.String;
|
|
@@ -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
|
|
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;;;EAGhB,CAAA;AACF,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,iFAA2B,CAAA;AAC3D,eAAO,MAAM,qBAAqB,mFAA6B,CAAA;AAC/D,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,eAAO,MAAM,mBAAmB;;EAAgD,CAAA;AAChF,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAE1E,eAAO,MAAM,OAAO;;;;;;IAUlB,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,KAA6B,CAAA;AAIxD,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAiCxD,CAAA"}
|
|
@@ -2,12 +2,18 @@ import { Effect, Match as M, Schema as S } from 'effect';
|
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
3
|
import { m } from '../../message/index.js';
|
|
4
4
|
// MODEL
|
|
5
|
-
export const Model = S.Struct({
|
|
5
|
+
export const Model = S.Struct({
|
|
6
|
+
count: S.Number,
|
|
7
|
+
log: S.Array(S.Number),
|
|
8
|
+
});
|
|
6
9
|
// MESSAGE
|
|
7
10
|
export const ClickedIncrement = m('ClickedIncrement');
|
|
8
11
|
export const ClickedDecrement = m('ClickedDecrement');
|
|
9
12
|
export const ClickedFetch = m('ClickedFetch');
|
|
10
13
|
export const ClickedFetchById = m('ClickedFetchById', { id: S.Number });
|
|
14
|
+
export const StartedThreeFetches = m('StartedThreeFetches');
|
|
15
|
+
export const StartedTwoFetchesById = m('StartedTwoFetchesById');
|
|
16
|
+
export const StartedMixedFetches = m('StartedMixedFetches');
|
|
11
17
|
export const SucceededFetchCount = m('SucceededFetchCount', { count: S.Number });
|
|
12
18
|
export const FailedFetchCount = m('FailedFetchCount', { error: S.String });
|
|
13
19
|
export const Message = S.Union([
|
|
@@ -15,6 +21,9 @@ export const Message = S.Union([
|
|
|
15
21
|
ClickedDecrement,
|
|
16
22
|
ClickedFetch,
|
|
17
23
|
ClickedFetchById,
|
|
24
|
+
StartedThreeFetches,
|
|
25
|
+
StartedTwoFetchesById,
|
|
26
|
+
StartedMixedFetches,
|
|
18
27
|
SucceededFetchCount,
|
|
19
28
|
FailedFetchCount,
|
|
20
29
|
]);
|
|
@@ -22,13 +31,33 @@ export const Message = S.Union([
|
|
|
22
31
|
export const FetchCount = Command.define('FetchCount', SucceededFetchCount, FailedFetchCount)(Effect.sync(() => SucceededFetchCount({ count: 0 })));
|
|
23
32
|
export const FetchCountById = Command.define('FetchCountById', { id: S.Number }, SucceededFetchCount, FailedFetchCount)(({ id }) => Effect.sync(() => SucceededFetchCount({ count: id })));
|
|
24
33
|
// INIT
|
|
25
|
-
export const initialModel = { count: 0 };
|
|
34
|
+
export const initialModel = { count: 0, log: [] };
|
|
26
35
|
// UPDATE
|
|
27
36
|
export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
|
|
28
|
-
ClickedIncrement: () => [{ count: model.count + 1 }, []],
|
|
29
|
-
ClickedDecrement: () => [{ count: model.count - 1 }, []],
|
|
37
|
+
ClickedIncrement: () => [{ ...model, count: model.count + 1 }, []],
|
|
38
|
+
ClickedDecrement: () => [{ ...model, count: model.count - 1 }, []],
|
|
30
39
|
ClickedFetch: () => [model, [FetchCount()]],
|
|
31
40
|
ClickedFetchById: ({ id }) => [model, [FetchCountById({ id })]],
|
|
32
|
-
|
|
41
|
+
StartedThreeFetches: () => [
|
|
42
|
+
model,
|
|
43
|
+
[FetchCount(), FetchCount(), FetchCount()],
|
|
44
|
+
],
|
|
45
|
+
StartedTwoFetchesById: () => [
|
|
46
|
+
model,
|
|
47
|
+
[FetchCountById({ id: 5 }), FetchCountById({ id: 5 })],
|
|
48
|
+
],
|
|
49
|
+
StartedMixedFetches: () => [
|
|
50
|
+
model,
|
|
51
|
+
[
|
|
52
|
+
FetchCount(),
|
|
53
|
+
FetchCount(),
|
|
54
|
+
FetchCountById({ id: 99 }),
|
|
55
|
+
FetchCountById({ id: 99 }),
|
|
56
|
+
],
|
|
57
|
+
],
|
|
58
|
+
SucceededFetchCount: ({ count }) => [
|
|
59
|
+
{ count, log: [...model.log, count] },
|
|
60
|
+
[],
|
|
61
|
+
],
|
|
33
62
|
FailedFetchCount: () => [model, []],
|
|
34
63
|
}));
|
|
@@ -16,22 +16,33 @@ export declare const FailedMountSidebar: import("../../schema/index.js").Callabl
|
|
|
16
16
|
reason: S.String;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const ClickedIncrement: import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>;
|
|
19
|
+
export declare const ScrolledTo: import("../../schema/index.js").CallableTaggedStruct<"ScrolledTo", {
|
|
20
|
+
offset: S.Number;
|
|
21
|
+
}>;
|
|
19
22
|
export declare const Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"ClickedToggle", {}>, import("../../schema/index.js").CallableTaggedStruct<"MeasuredPanel", {
|
|
20
23
|
width: S.Number;
|
|
21
24
|
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"FailedMountSidebar", {
|
|
22
25
|
reason: S.String;
|
|
23
|
-
}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}
|
|
26
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ScrolledTo", {
|
|
27
|
+
offset: S.Number;
|
|
28
|
+
}>]>;
|
|
24
29
|
export type Message = typeof Message.Type;
|
|
25
|
-
export declare const MeasurePanel: Mount.
|
|
30
|
+
export declare const MeasurePanel: Mount.MountDefinitionNoArgs<"MeasurePanel", {
|
|
26
31
|
readonly _tag: "MeasuredPanel";
|
|
27
32
|
readonly width: number;
|
|
28
33
|
} | {
|
|
29
34
|
readonly _tag: "FailedMountSidebar";
|
|
30
35
|
readonly reason: string;
|
|
31
36
|
}>;
|
|
32
|
-
export declare const FocusButton: Mount.
|
|
37
|
+
export declare const FocusButton: Mount.MountDefinitionNoArgs<"FocusButton", {
|
|
33
38
|
readonly _tag: "CompletedFocusButton";
|
|
34
39
|
}>;
|
|
40
|
+
export declare const ScrollList: Mount.MountDefinitionWithArgs<"ScrollList", {
|
|
41
|
+
offset: S.Number;
|
|
42
|
+
}, {
|
|
43
|
+
readonly _tag: "ScrolledTo";
|
|
44
|
+
readonly offset: number;
|
|
45
|
+
}>;
|
|
35
46
|
export declare const initialModel: Model;
|
|
36
47
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
37
48
|
export declare const view: (model: Model) => Html;
|
|
@@ -39,4 +50,9 @@ export declare const view: (model: Model) => Html;
|
|
|
39
50
|
* two MeasurePanel mounts simultaneously so we can exercise the (name,
|
|
40
51
|
* occurrence) tracking. */
|
|
41
52
|
export declare const twoPanelView: (model: Model) => Html;
|
|
53
|
+
/** A view that renders an arg-bearing Mount so Scene tests can exercise
|
|
54
|
+
* Instance-based mount matching (matcher's args structurally equal the
|
|
55
|
+
* pending Mount's args). The chosen `offset` flows through `ScrollList`'s
|
|
56
|
+
* args and is observable on the rendered Mount marker. */
|
|
57
|
+
export declare const scrollListView: (offset: number) => Html;
|
|
42
58
|
//# sourceMappingURL=mountPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mountPanel.d.ts","sourceRoot":"","sources":["../../../src/test/apps/mountPanel.ts"],"names":[],"mappings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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, Match as M, Option, Schema as S } from 'effect';
|
|
1
|
+
import { Effect, Function, Match as M, Option, Schema as S } from 'effect';
|
|
2
2
|
import { html } from '../../html/index.js';
|
|
3
3
|
import { m } from '../../message/index.js';
|
|
4
4
|
import * as Mount from '../../mount/index.js';
|
|
@@ -14,16 +14,39 @@ export const MeasuredPanel = m('MeasuredPanel', { width: S.Number });
|
|
|
14
14
|
export const CompletedFocusButton = m('CompletedFocusButton');
|
|
15
15
|
export const FailedMountSidebar = m('FailedMountSidebar', { reason: S.String });
|
|
16
16
|
export const ClickedIncrement = m('ClickedIncrement');
|
|
17
|
+
export const ScrolledTo = m('ScrolledTo', { offset: S.Number });
|
|
17
18
|
export const Message = S.Union([
|
|
18
19
|
ClickedToggle,
|
|
19
20
|
MeasuredPanel,
|
|
20
21
|
CompletedFocusButton,
|
|
21
22
|
FailedMountSidebar,
|
|
22
23
|
ClickedIncrement,
|
|
24
|
+
ScrolledTo,
|
|
23
25
|
]);
|
|
24
26
|
// MOUNT
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
// NOTE: these Mounts are runtime/Scene fixtures, not idiomatic examples of
|
|
28
|
+
// Mount work. Their factory bodies skip the DOM measurement/manipulation that
|
|
29
|
+
// real Mounts perform (e.g. `element.getBoundingClientRect()` for measurement,
|
|
30
|
+
// `element.focus()` for focus) and emit synthetic result Messages so tests can
|
|
31
|
+
// pin specific values. See `ui/popover/popover.ts`, `ui/listbox/shared.ts`,
|
|
32
|
+
// etc. for production-shaped Mounts that read or write the element handle.
|
|
33
|
+
export const MeasurePanel = Mount.define('MeasurePanel', MeasuredPanel, FailedMountSidebar)(() => Effect.succeed({
|
|
34
|
+
message: MeasuredPanel({ width: 320 }),
|
|
35
|
+
cleanup: Function.constVoid,
|
|
36
|
+
}));
|
|
37
|
+
export const FocusButton = Mount.define('FocusButton', CompletedFocusButton)(() => Effect.succeed({
|
|
38
|
+
message: CompletedFocusButton(),
|
|
39
|
+
cleanup: Function.constVoid,
|
|
40
|
+
}));
|
|
41
|
+
export const ScrollList = Mount.define('ScrollList', { offset: S.Number }, ScrolledTo)(({ offset }) => element => Effect.sync(() => {
|
|
42
|
+
if (element instanceof HTMLElement) {
|
|
43
|
+
element.scrollTop = offset;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
message: ScrolledTo({ offset }),
|
|
47
|
+
cleanup: Function.constVoid,
|
|
48
|
+
};
|
|
49
|
+
}));
|
|
27
50
|
// INIT
|
|
28
51
|
export const initialModel = {
|
|
29
52
|
isOpen: false,
|
|
@@ -40,22 +63,15 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
40
63
|
CompletedFocusButton: () => [model, []],
|
|
41
64
|
FailedMountSidebar: () => [model, []],
|
|
42
65
|
ClickedIncrement: () => [{ ...model, count: model.count + 1 }, []],
|
|
66
|
+
ScrolledTo: () => [model, []],
|
|
43
67
|
}));
|
|
44
68
|
// VIEW
|
|
45
69
|
const { div, button, span, OnMount, OnClick, Class, Key } = html();
|
|
46
|
-
const measurePanel = MeasurePanel(() => Effect.succeed({
|
|
47
|
-
message: MeasuredPanel({ width: 320 }),
|
|
48
|
-
cleanup: () => { },
|
|
49
|
-
}));
|
|
50
|
-
const focusButton = FocusButton(() => Effect.succeed({
|
|
51
|
-
message: CompletedFocusButton(),
|
|
52
|
-
cleanup: () => { },
|
|
53
|
-
}));
|
|
54
70
|
export const view = (model) => div([Class('panel-test')], [
|
|
55
|
-
button([Key('toggle'), OnClick(ClickedToggle()), OnMount(
|
|
71
|
+
button([Key('toggle'), OnClick(ClickedToggle()), OnMount(FocusButton())], [model.isOpen ? 'Close' : 'Open']),
|
|
56
72
|
...(model.isOpen
|
|
57
73
|
? [
|
|
58
|
-
div([Key('panel'), OnMount(
|
|
74
|
+
div([Key('panel'), OnMount(MeasurePanel())], [
|
|
59
75
|
span([], [
|
|
60
76
|
Option.match(model.measuredWidth, {
|
|
61
77
|
onNone: () => 'unmeasured',
|
|
@@ -70,7 +86,12 @@ export const view = (model) => div([Class('panel-test')], [
|
|
|
70
86
|
* two MeasurePanel mounts simultaneously so we can exercise the (name,
|
|
71
87
|
* occurrence) tracking. */
|
|
72
88
|
export const twoPanelView = (model) => div([Class('two-panels')], [
|
|
73
|
-
div([Key('panel-a'), OnMount(
|
|
74
|
-
div([Key('panel-b'), OnMount(
|
|
89
|
+
div([Key('panel-a'), OnMount(MeasurePanel())], [span([], ['A'])]),
|
|
90
|
+
div([Key('panel-b'), OnMount(MeasurePanel())], [span([], ['B'])]),
|
|
75
91
|
button([Key('inc'), OnClick(ClickedIncrement())], [`count: ${model.count}`]),
|
|
76
92
|
]);
|
|
93
|
+
/** A view that renders an arg-bearing Mount so Scene tests can exercise
|
|
94
|
+
* Instance-based mount matching (matcher's args structurally equal the
|
|
95
|
+
* pending Mount's args). The chosen `offset` flows through `ScrollList`'s
|
|
96
|
+
* args and is observable on the rendered Mount marker. */
|
|
97
|
+
export const scrollListView = (offset) => div([Class('scroll-list')], [div([Key('list'), OnMount(ScrollList({ offset }))], [])]);
|
package/dist/test/internal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CommandDefinition } from '../command/index.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type MountDefinition } from '../mount/index.js';
|
|
3
3
|
/** A Command in a test simulation. Carries `name` and optionally the `args`
|
|
4
4
|
* the runtime captured at construction. Instance matchers (Command values
|
|
5
5
|
* produced by calling a Definition) are matched against this shape; the
|
|
@@ -30,11 +30,36 @@ export declare const formatCommand: (command: AnyCommand) => string;
|
|
|
30
30
|
* `occurrence` index that disambiguates same-named mounts in the rendered
|
|
31
31
|
* tree (e.g. two open popovers each contributing an `AnchorPopover`). The
|
|
32
32
|
* occurrence is the 0-based position among same-named markers in
|
|
33
|
-
* tree-traversal order.
|
|
33
|
+
* tree-traversal order. `args` carries the runtime values used to construct
|
|
34
|
+
* the MountAction when its definition declared an args record. */
|
|
34
35
|
export type PendingMount = Readonly<{
|
|
35
36
|
name: string;
|
|
37
|
+
args?: Record<string, unknown>;
|
|
36
38
|
occurrence: number;
|
|
37
39
|
}>;
|
|
40
|
+
/** A Mount lifecycle event in a test simulation. Carries `name` and
|
|
41
|
+
* optionally the `args` used to construct the MountAction. Mirrors
|
|
42
|
+
* `AnyCommand` for Mount matchers. */
|
|
43
|
+
export type AnyMount = Readonly<{
|
|
44
|
+
name: string;
|
|
45
|
+
args?: Record<string, unknown>;
|
|
46
|
+
}>;
|
|
47
|
+
/** Pattern for matching a pending Mount in test assertions. A Definition
|
|
48
|
+
* matches by name only ("a Mount with this identity is in the rendered
|
|
49
|
+
* tree"); an Instance matches by name AND structural-equal args ("a Mount
|
|
50
|
+
* with this identity AND these args"). Choose the form per assertion based
|
|
51
|
+
* on whether the test cares about the args value.
|
|
52
|
+
*
|
|
53
|
+
* Two modes only: name-only or name + full args. Partial-args matching is
|
|
54
|
+
* intentionally unsupported, mirroring `CommandMatcher`. */
|
|
55
|
+
export type MountMatcher = MountDefinition<string, unknown> | AnyMount;
|
|
56
|
+
/** Whether a `matcher` matches a pending Mount. Definition matchers match by
|
|
57
|
+
* name. Instance matchers (with declared args) match by name + structural
|
|
58
|
+
* args equality; instance matchers without args match by name. */
|
|
59
|
+
export declare const mountMatches: (matcher: MountMatcher, mount: AnyMount) => boolean;
|
|
60
|
+
/** Formats a Mount matcher for display in error messages. Definition
|
|
61
|
+
* matchers render as just the name; Instance matchers append the args. */
|
|
62
|
+
export declare const formatMountMatcher: (matcher: MountMatcher) => string;
|
|
38
63
|
type UpdateResult<Model, OutMessage> = readonly [Model, ReadonlyArray<AnyCommand>] | readonly [Model, ReadonlyArray<AnyCommand>, OutMessage];
|
|
39
64
|
/** A Command matcher (Definition or Instance) with the result Message to
|
|
40
65
|
* resolve a pending Command with. Definition matchers resolve by name; an
|
|
@@ -45,18 +70,16 @@ export type Resolver<ResultMessage = unknown> = readonly [CommandMatcher, Result
|
|
|
45
70
|
ResultMessage,
|
|
46
71
|
(message: ResultMessage) => unknown
|
|
47
72
|
];
|
|
48
|
-
/** A Mount
|
|
49
|
-
* `Resolver` for Commands. The optional third
|
|
50
|
-
* result into the parent's Message universe
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
ResultMessage,
|
|
54
|
-
(message: ResultMessage) => unknown
|
|
55
|
-
];
|
|
73
|
+
/** A Mount matcher (Definition or Instance) with the result Message to
|
|
74
|
+
* resolve it with. Mirrors `Resolver` for Commands. The optional third
|
|
75
|
+
* element lifts a child Mount result into the parent's Message universe
|
|
76
|
+
* (mirrors `Mount.mapMessage`). */
|
|
77
|
+
export type MountResolver<ResultMessage = unknown> = readonly [MountMatcher, ResultMessage] | readonly [MountMatcher, ResultMessage, (message: ResultMessage) => unknown];
|
|
56
78
|
/** A resolver entry pairs a Command matcher with the Message that should be
|
|
57
79
|
* fed back through update when a pending Command matches. Stored as a list
|
|
58
80
|
* (not a name-keyed map) so Instance matchers with the same name but
|
|
59
|
-
* different args can coexist.
|
|
81
|
+
* different args can coexist. Each entry is consumed on its first matching
|
|
82
|
+
* dispatch. */
|
|
60
83
|
export type ResolverEntry<Message> = Readonly<{
|
|
61
84
|
matcher: CommandMatcher;
|
|
62
85
|
message: Message;
|
|
@@ -76,11 +99,10 @@ export type BaseInternal<Model, Message, OutMessage = undefined> = Readonly<{
|
|
|
76
99
|
* match by name + args. */
|
|
77
100
|
export declare const resolveByMatcher: <Model, Message>(internal: BaseInternal<Model, Message, unknown>, matcher: CommandMatcher, resolverMessage: Message) => BaseInternal<Model, Message, unknown> | undefined;
|
|
78
101
|
/** Resolves all listed Commands, cascading through any Commands produced by
|
|
79
|
-
* the result.
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* where the latest wins. */
|
|
102
|
+
* the result. Each entry is consumed by exactly one matching dispatch in
|
|
103
|
+
* declaration order; for N identical responses, compose with
|
|
104
|
+
* `Array.makeBy(n, () => [Def, message])`. Across calls, new entries replace
|
|
105
|
+
* any leftover resolvers sharing their fingerprint (latest wins). */
|
|
84
106
|
export declare const resolveAllInternal: <Model, Message, OutMessage>(internal: BaseInternal<Model, Message, OutMessage>, resolvers: ReadonlyArray<Resolver>) => BaseInternal<Model, Message, OutMessage>;
|
|
85
107
|
/** Throws if any of the given matchers fail to match a pending Command.
|
|
86
108
|
* Definition matchers match by name; Instance matchers match by name + args. */
|
|
@@ -96,19 +118,27 @@ export declare const assertZeroCommands: (commands: ReadonlyArray<AnyCommand>) =
|
|
|
96
118
|
export declare const assertNoUnresolvedCommands: (commands: ReadonlyArray<AnyCommand>, context: string) => void;
|
|
97
119
|
/** Throws when Commands remain at the end of a test. */
|
|
98
120
|
export declare const assertAllCommandsResolved: (commands: ReadonlyArray<AnyCommand>) => void;
|
|
99
|
-
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
export declare const
|
|
121
|
+
/** Formats a list of pending Mounts (with args + occurrence suffix where
|
|
122
|
+
* applicable) for display in error messages. Returns " (none)" when
|
|
123
|
+
* empty, mirroring the Command-side formatters. */
|
|
124
|
+
export declare const formatMountList: (mounts: ReadonlyArray<PendingMount>) => string;
|
|
125
|
+
/** Resolves the first pending Mount that matches the given matcher and feeds
|
|
126
|
+
* its result through update. Returns `undefined` when no pending Mount
|
|
127
|
+
* matches. Definition matchers match by name; Instance matchers match by
|
|
128
|
+
* name + args. */
|
|
129
|
+
export declare const resolveMountByMatcher: <Model, Message>(internal: BaseInternal<Model, Message, unknown>, pendingMounts: ReadonlyArray<PendingMount>, matcher: MountMatcher, resolverMessage: Message) => Readonly<{
|
|
103
130
|
internal: BaseInternal<Model, Message, unknown>;
|
|
104
131
|
pendingMounts: ReadonlyArray<PendingMount>;
|
|
105
132
|
}> | undefined;
|
|
106
|
-
/** Throws if any of the given
|
|
107
|
-
*
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
133
|
+
/** Throws if any of the given matchers are missing from the pending mount
|
|
134
|
+
* list. Definition matchers match by name; Instance matchers match by
|
|
135
|
+
* name + structural-equal args. */
|
|
136
|
+
export declare const assertHasMounts: (pendingMounts: ReadonlyArray<PendingMount>, matchers: ReadonlyArray<MountMatcher>) => void;
|
|
137
|
+
/** Throws if the pending Mounts don't match the given matchers exactly. Each
|
|
138
|
+
* matcher must consume exactly one pending Mount. Order-independent.
|
|
139
|
+
* Definition matchers match by name; Instance matchers match by
|
|
140
|
+
* name + structural-equal args. */
|
|
141
|
+
export declare const assertExactMounts: (pendingMounts: ReadonlyArray<PendingMount>, matchers: ReadonlyArray<MountMatcher>) => void;
|
|
112
142
|
/** Throws if there are any pending Mounts. */
|
|
113
143
|
export declare const assertZeroMounts: (pendingMounts: ReadonlyArray<PendingMount>) => void;
|
|
114
144
|
/** Throws when trying to send a Message with unresolved Mounts in the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/test/internal.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/test/internal.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,mBAAmB,CAAA;AAE/E;;;;4BAI4B;AAC5B,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B,CAAC,CAAA;AAEF;;;;;;;;;4EAS4E;AAC5E,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAAA;AAsB5E;2EAC2E;AAC3E,eAAO,MAAM,aAAa,GAAI,SAAS,cA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