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
package/dist/runtime/crashUI.js
CHANGED
|
@@ -18,8 +18,8 @@ const colors = {
|
|
|
18
18
|
const fontStack = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
|
|
19
19
|
const monoStack = 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace';
|
|
20
20
|
export const defaultCrashView = (context, viewError) => {
|
|
21
|
-
const
|
|
22
|
-
const codeBlockStyle = Style({
|
|
21
|
+
const h = html();
|
|
22
|
+
const codeBlockStyle = h.Style({
|
|
23
23
|
fontFamily: monoStack,
|
|
24
24
|
color: colors.textPrimary,
|
|
25
25
|
margin: '0',
|
|
@@ -29,13 +29,13 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
29
29
|
padding: '0.75rem 1rem',
|
|
30
30
|
borderRadius: '0.375rem',
|
|
31
31
|
});
|
|
32
|
-
const labelStyle = Style({
|
|
32
|
+
const labelStyle = h.Style({
|
|
33
33
|
color: colors.textSecondary,
|
|
34
34
|
margin: '0 0 0.5rem 0',
|
|
35
35
|
fontSize: '0.875rem',
|
|
36
36
|
fontWeight: '500',
|
|
37
37
|
});
|
|
38
|
-
const inlineCodeStyle = Style({
|
|
38
|
+
const inlineCodeStyle = h.Style({
|
|
39
39
|
fontFamily: monoStack,
|
|
40
40
|
backgroundColor: colors.codeBg,
|
|
41
41
|
padding: '0.125rem 0.375rem',
|
|
@@ -45,7 +45,7 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
45
45
|
const introText = viewError
|
|
46
46
|
? [
|
|
47
47
|
'Your custom ',
|
|
48
|
-
span([inlineCodeStyle], ['crash.view']),
|
|
48
|
+
h.span([inlineCodeStyle], ['crash.view']),
|
|
49
49
|
' threw an error while rendering.',
|
|
50
50
|
]
|
|
51
51
|
: [
|
|
@@ -53,18 +53,18 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
53
53
|
];
|
|
54
54
|
const errorContent = viewError
|
|
55
55
|
? [
|
|
56
|
-
div([Style({ margin: '0 0 1rem 0' })], [
|
|
57
|
-
p([labelStyle], ['Original error']),
|
|
58
|
-
p([codeBlockStyle], [context.error.message]),
|
|
56
|
+
h.div([h.Style({ margin: '0 0 1rem 0' })], [
|
|
57
|
+
h.p([labelStyle], ['Original error']),
|
|
58
|
+
h.p([codeBlockStyle], [context.error.message]),
|
|
59
59
|
]),
|
|
60
|
-
div([Style({ margin: '0 0 1.25rem 0' })], [
|
|
61
|
-
p([labelStyle], ['crash.view error']),
|
|
62
|
-
p([codeBlockStyle], [viewErrorMessage]),
|
|
60
|
+
h.div([h.Style({ margin: '0 0 1.25rem 0' })], [
|
|
61
|
+
h.p([labelStyle], ['crash.view error']),
|
|
62
|
+
h.p([codeBlockStyle], [viewErrorMessage]),
|
|
63
63
|
]),
|
|
64
64
|
]
|
|
65
65
|
: [
|
|
66
|
-
p([
|
|
67
|
-
Style({
|
|
66
|
+
h.p([
|
|
67
|
+
h.Style({
|
|
68
68
|
fontFamily: monoStack,
|
|
69
69
|
color: colors.textPrimary,
|
|
70
70
|
margin: '0 0 1.25rem 0',
|
|
@@ -79,8 +79,8 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
79
79
|
const footerText = viewError
|
|
80
80
|
? []
|
|
81
81
|
: [
|
|
82
|
-
p([
|
|
83
|
-
Style({
|
|
82
|
+
h.p([
|
|
83
|
+
h.Style({
|
|
84
84
|
color: colors.textSecondary,
|
|
85
85
|
margin: '1.5rem 0 0 0',
|
|
86
86
|
fontSize: '0.875rem',
|
|
@@ -90,14 +90,14 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
90
90
|
}),
|
|
91
91
|
], [
|
|
92
92
|
'This is the default crash view. You can customize it by providing a ',
|
|
93
|
-
span([inlineCodeStyle], ['crash.view']),
|
|
93
|
+
h.span([inlineCodeStyle], ['crash.view']),
|
|
94
94
|
' function to ',
|
|
95
|
-
span([inlineCodeStyle], ['makeProgram']),
|
|
95
|
+
h.span([inlineCodeStyle], ['makeProgram']),
|
|
96
96
|
'.',
|
|
97
97
|
]),
|
|
98
98
|
];
|
|
99
|
-
const body = div([
|
|
100
|
-
Style({
|
|
99
|
+
const body = h.div([
|
|
100
|
+
h.Style({
|
|
101
101
|
fontFamily: fontStack,
|
|
102
102
|
padding: '2rem',
|
|
103
103
|
minHeight: '100vh',
|
|
@@ -107,8 +107,8 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
107
107
|
justifyContent: 'center',
|
|
108
108
|
}),
|
|
109
109
|
], [
|
|
110
|
-
div([
|
|
111
|
-
Style({
|
|
110
|
+
h.div([
|
|
111
|
+
h.Style({
|
|
112
112
|
width: '100%',
|
|
113
113
|
maxWidth: '960px',
|
|
114
114
|
margin: '0 auto',
|
|
@@ -119,8 +119,8 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
119
119
|
padding: '1.5rem',
|
|
120
120
|
}),
|
|
121
121
|
], [
|
|
122
|
-
h1([
|
|
123
|
-
Style({
|
|
122
|
+
h.h1([
|
|
123
|
+
h.Style({
|
|
124
124
|
color: colors.errorAccent,
|
|
125
125
|
margin: '0 0 0.75rem 0',
|
|
126
126
|
fontSize: '1.25rem',
|
|
@@ -128,8 +128,8 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
128
128
|
lineHeight: '1.5',
|
|
129
129
|
}),
|
|
130
130
|
], ['Application Crash']),
|
|
131
|
-
p([
|
|
132
|
-
Style({
|
|
131
|
+
h.p([
|
|
132
|
+
h.Style({
|
|
133
133
|
color: colors.textPrimary,
|
|
134
134
|
margin: '0 0 1rem 0',
|
|
135
135
|
fontSize: '1rem',
|
|
@@ -137,8 +137,8 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
137
137
|
}),
|
|
138
138
|
], introText),
|
|
139
139
|
...errorContent,
|
|
140
|
-
p([
|
|
141
|
-
Style({
|
|
140
|
+
h.p([
|
|
141
|
+
h.Style({
|
|
142
142
|
color: colors.textPrimary,
|
|
143
143
|
margin: '0 0 1.5rem 0',
|
|
144
144
|
fontSize: '1rem',
|
|
@@ -147,8 +147,8 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
147
147
|
], [
|
|
148
148
|
'→ Check the browser console for the full stack trace with source-mapped line numbers.',
|
|
149
149
|
]),
|
|
150
|
-
button([
|
|
151
|
-
Style({
|
|
150
|
+
h.button([
|
|
151
|
+
h.Style({
|
|
152
152
|
fontFamily: fontStack,
|
|
153
153
|
backgroundColor: colors.buttonBg,
|
|
154
154
|
color: colors.buttonText,
|
|
@@ -159,7 +159,7 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
159
159
|
fontWeight: '500',
|
|
160
160
|
cursor: 'pointer',
|
|
161
161
|
}),
|
|
162
|
-
Attribute('onclick', 'location.reload()'),
|
|
162
|
+
h.Attribute('onclick', 'location.reload()'),
|
|
163
163
|
], ['Reload']),
|
|
164
164
|
...footerText,
|
|
165
165
|
]),
|
|
@@ -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;AASlD,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,GACZ,UAAU,GACV,SAAS,CAAA;AAEb,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,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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
|
@@ -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 = () => {
|
|
@@ -24,8 +24,8 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
24
24
|
],
|
|
25
25
|
}));
|
|
26
26
|
// VIEW
|
|
27
|
-
const
|
|
28
|
-
export const view = (model) => div([], [
|
|
29
|
-
div([Role('option'), OnClick(ClickedContainer())], [span([], [`clicks=${model.clicks}`])]),
|
|
30
|
-
div([Role('listitem'), OnDoubleClick(DoubleClickedContainer())], [span([], [`dbl=${model.doubleClicks}`])]),
|
|
27
|
+
const h = html();
|
|
28
|
+
export const view = (model) => h.div([], [
|
|
29
|
+
h.div([h.Role('option'), h.OnClick(ClickedContainer())], [h.span([], [`clicks=${model.clicks}`])]),
|
|
30
|
+
h.div([h.Role('listitem'), h.OnDoubleClick(DoubleClickedContainer())], [h.span([], [`dbl=${model.doubleClicks}`])]),
|
|
31
31
|
]);
|
|
@@ -33,19 +33,19 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
33
33
|
},
|
|
34
34
|
}));
|
|
35
35
|
// VIEW
|
|
36
|
-
const
|
|
37
|
-
const submitButton = (isEnabled) => button([
|
|
38
|
-
Class('submit'),
|
|
39
|
-
...(isEnabled ? [OnClick(ClickedSubmit())] : [Disabled(true)]),
|
|
36
|
+
const h = html();
|
|
37
|
+
const submitButton = (isEnabled) => h.button([
|
|
38
|
+
h.Class('submit'),
|
|
39
|
+
...(isEnabled ? [h.OnClick(ClickedSubmit())] : [h.Disabled(true)]),
|
|
40
40
|
], ['Submit']);
|
|
41
41
|
/** Plain view — no dialog wrapper. */
|
|
42
|
-
export const view = (model) => div([], [
|
|
43
|
-
button([OnClick(ClickedToggle())], ['Toggle']),
|
|
42
|
+
export const view = (model) => h.div([], [
|
|
43
|
+
h.button([h.OnClick(ClickedToggle())], ['Toggle']),
|
|
44
44
|
submitButton(model.isEnabled),
|
|
45
45
|
]);
|
|
46
46
|
/** View with submit button inside a dialog's panelContent. */
|
|
47
|
-
export const viewWithDialog = (model) => div([], [
|
|
48
|
-
button([OnClick(ClickedToggle())], ['Toggle']),
|
|
47
|
+
export const viewWithDialog = (model) => h.div([], [
|
|
48
|
+
h.button([h.OnClick(ClickedToggle())], ['Toggle']),
|
|
49
49
|
Dialog.view({
|
|
50
50
|
model: model.dialog,
|
|
51
51
|
toParentMessage: (dialogMessage) => GotDialogMessage({ message: dialogMessage }),
|
|
@@ -54,7 +54,7 @@ export const viewWithDialog = (model) => div([], [
|
|
|
54
54
|
]);
|
|
55
55
|
/** View using Dialog.lazy with panelContent passed dynamically. */
|
|
56
56
|
const lazyDialogView = Dialog.lazy({});
|
|
57
|
-
export const viewWithLazyDialog = (model) => div([], [
|
|
58
|
-
button([OnClick(ClickedToggle())], ['Toggle']),
|
|
57
|
+
export const viewWithLazyDialog = (model) => h.div([], [
|
|
58
|
+
h.button([h.OnClick(ClickedToggle())], ['Toggle']),
|
|
59
59
|
lazyDialogView(model.dialog, (dialogMessage) => GotDialogMessage({ message: dialogMessage }), submitButton(model.isEnabled)),
|
|
60
60
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileUpload.d.ts","sourceRoot":"","sources":["../../../src/test/apps/fileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,qBAAqB,CAAA;AAKrD,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;CACnC,CAAC,CAAA;AAEF,eAAO,MAAM,YAAY,EAAE,KAA6B,CAAA;AAIxD,eAAO,MAAM,aAAa;;EAA+C,CAAA;AAEzE,eAAO,MAAM,OAAO;;IAA2B,CAAA;AAC/C,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAMrC,CAAA;
|
|
1
|
+
{"version":3,"file":"fileUpload.d.ts","sourceRoot":"","sources":["../../../src/test/apps/fileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,qBAAqB,CAAA;AAKrD,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;CACnC,CAAC,CAAA;AAEF,eAAO,MAAM,YAAY,EAAE,KAA6B,CAAA;AAIxD,eAAO,MAAM,aAAa;;EAA+C,CAAA;AAEzE,eAAO,MAAM,OAAO;;IAA2B,CAAA;AAC/C,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAMrC,CAAA;AAMH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,IA2BjC,CAAA"}
|
|
@@ -11,19 +11,19 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
11
11
|
ReceivedFiles: ({ files }) => [{ ...model, receivedFiles: files }, []],
|
|
12
12
|
}));
|
|
13
13
|
// VIEW
|
|
14
|
-
const
|
|
15
|
-
export const view = (model) => div([], [
|
|
16
|
-
input([
|
|
17
|
-
Key('file-input'),
|
|
18
|
-
AriaLabel('resume'),
|
|
19
|
-
Type('file'),
|
|
20
|
-
OnFileChange(files => ReceivedFiles({ files })),
|
|
14
|
+
const h = html();
|
|
15
|
+
export const view = (model) => h.div([], [
|
|
16
|
+
h.input([
|
|
17
|
+
h.Key('file-input'),
|
|
18
|
+
h.AriaLabel('resume'),
|
|
19
|
+
h.Type('file'),
|
|
20
|
+
h.OnFileChange(files => ReceivedFiles({ files })),
|
|
21
21
|
]),
|
|
22
|
-
div([
|
|
23
|
-
Key('drop-zone'),
|
|
24
|
-
AriaLabel('attachments'),
|
|
25
|
-
OnDropFiles(files => ReceivedFiles({ files })),
|
|
22
|
+
h.div([
|
|
23
|
+
h.Key('drop-zone'),
|
|
24
|
+
h.AriaLabel('attachments'),
|
|
25
|
+
h.OnDropFiles(files => ReceivedFiles({ files })),
|
|
26
26
|
], ['Drop files here']),
|
|
27
|
-
div([Key('received-count')], [`count=${String(model.receivedFiles.length)}`]),
|
|
28
|
-
div([Key('received-names')], [`names=${model.receivedFiles.map(file => file.name).join(',')}`]),
|
|
27
|
+
h.div([h.Key('received-count')], [`count=${String(model.receivedFiles.length)}`]),
|
|
28
|
+
h.div([h.Key('received-names')], [`names=${model.receivedFiles.map(file => file.name).join(',')}`]),
|
|
29
29
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../../src/test/apps/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,qBAAqB,CAAA;AAKrD,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,aAAa;;EAA0C,CAAA;AAEpE,eAAO,MAAM,OAAO;;IAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAcrC,CAAA;
|
|
1
|
+
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../../src/test/apps/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,qBAAqB,CAAA;AAKrD,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,aAAa;;EAA0C,CAAA;AAEpE,eAAO,MAAM,OAAO;;IAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAcrC,CAAA;AAMH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,IA2BjC,CAAA"}
|
|
@@ -45,22 +45,22 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
45
45
|
ChangedSelect: ({ value }) => [{ ...model, changed: value }, []],
|
|
46
46
|
}));
|
|
47
47
|
// VIEW
|
|
48
|
-
const
|
|
49
|
-
export const view = (model) => div([], [
|
|
50
|
-
button([
|
|
51
|
-
OnClick(ClickedButton()),
|
|
52
|
-
OnDoubleClick(DoubleClickedButton()),
|
|
53
|
-
OnMouseEnter(HoveredTarget()),
|
|
54
|
-
AriaLabel('action'),
|
|
48
|
+
const h = html();
|
|
49
|
+
export const view = (model) => h.div([], [
|
|
50
|
+
h.button([
|
|
51
|
+
h.OnClick(ClickedButton()),
|
|
52
|
+
h.OnDoubleClick(DoubleClickedButton()),
|
|
53
|
+
h.OnMouseEnter(HoveredTarget()),
|
|
54
|
+
h.AriaLabel('action'),
|
|
55
55
|
], [`clicks=${model.clicks} dbl=${model.doubleClicks}`]),
|
|
56
|
-
input([
|
|
57
|
-
Role('textbox'),
|
|
58
|
-
AriaLabel('name'),
|
|
59
|
-
OnFocus(FocusedInput()),
|
|
60
|
-
OnBlur(BlurredInput()),
|
|
56
|
+
h.input([
|
|
57
|
+
h.Role('textbox'),
|
|
58
|
+
h.AriaLabel('name'),
|
|
59
|
+
h.OnFocus(FocusedInput()),
|
|
60
|
+
h.OnBlur(BlurredInput()),
|
|
61
61
|
]),
|
|
62
|
-
select([AriaLabel('fruit'), OnChange(value => ChangedSelect({ value }))], [
|
|
63
|
-
option([Value('apple')], ['Apple']),
|
|
64
|
-
option([Value('banana')], ['Banana']),
|
|
62
|
+
h.select([h.AriaLabel('fruit'), h.OnChange(value => ChangedSelect({ value }))], [
|
|
63
|
+
h.option([h.Value('apple')], ['Apple']),
|
|
64
|
+
h.option([h.Value('banana')], ['Banana']),
|
|
65
65
|
]),
|
|
66
66
|
]);
|
|
@@ -27,13 +27,13 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
27
27
|
],
|
|
28
28
|
}));
|
|
29
29
|
// VIEW
|
|
30
|
-
const
|
|
31
|
-
export const view = (model) => div([
|
|
32
|
-
Id('key-app'),
|
|
33
|
-
Role('application'),
|
|
34
|
-
AriaLabel('Key press area'),
|
|
35
|
-
OnKeyDown((key, modifiers) => modifiers.shiftKey ? PressedShiftKey({ key }) : PressedKey({ key })),
|
|
30
|
+
const h = html();
|
|
31
|
+
export const view = (model) => h.div([
|
|
32
|
+
h.Id('key-app'),
|
|
33
|
+
h.Role('application'),
|
|
34
|
+
h.AriaLabel('Key press area'),
|
|
35
|
+
h.OnKeyDown((key, modifiers) => modifiers.shiftKey ? PressedShiftKey({ key }) : PressedKey({ key })),
|
|
36
36
|
], [
|
|
37
|
-
span([Class('last-key'), AriaLabel('Last key')], [model.lastKey]),
|
|
38
|
-
span([Class('shifted'), AriaLabel('Shift pressed')], [model.isShifted ? 'true' : 'false']),
|
|
37
|
+
h.span([h.Class('last-key'), h.AriaLabel('Last key')], [model.lastKey]),
|
|
38
|
+
h.span([h.Class('shifted'), h.AriaLabel('Shift pressed')], [model.isShifted ? 'true' : 'false']),
|
|
39
39
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/test/apps/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,qBAAqB,CAAA;AAKrD,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,YAAY;;EAAyC,CAAA;AAClE,eAAO,MAAM,eAAe;;EAA4C,CAAA;AACxE,eAAO,MAAM,cAAc,4EAAsB,CAAA;AACjD,eAAO,MAAM,qBAAqB;;EAEhC,CAAA;AACF,eAAO,MAAM,kBAAkB;;EAA+C,CAAA;AAC9E,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAE/C,eAAO,MAAM,OAAO;;;;;;;;+EAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY;;;iBAIyC,CAAA;AAIlE,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAyBxD,CAAA;
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/test/apps/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,qBAAqB,CAAA;AAKrD,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,YAAY;;EAAyC,CAAA;AAClE,eAAO,MAAM,eAAe;;EAA4C,CAAA;AACxE,eAAO,MAAM,cAAc,4EAAsB,CAAA;AACjD,eAAO,MAAM,qBAAqB;;EAEhC,CAAA;AACF,eAAO,MAAM,kBAAkB;;EAA+C,CAAA;AAC9E,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAE/C,eAAO,MAAM,OAAO;;;;;;;;+EAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY;;;iBAIyC,CAAA;AAIlE,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAyBxD,CAAA;AAMH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,IA6EjC,CAAA"}
|
package/dist/test/apps/login.js
CHANGED
|
@@ -59,31 +59,39 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
59
59
|
],
|
|
60
60
|
}));
|
|
61
61
|
// VIEW
|
|
62
|
-
const
|
|
63
|
-
export const view = (model) => div([Id('app')], [
|
|
64
|
-
M.value(model.status).pipe(M.withReturnType(), M.when('Submitting', () => form([Class('login-form'), Disabled(true)], [button([Type('submit'), Disabled(true)], ['Signing in...'])])), M.when('LoggedIn', () => div([
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
const h = html();
|
|
63
|
+
export const view = (model) => h.div([h.Id('app')], [
|
|
64
|
+
M.value(model.status).pipe(M.withReturnType(), M.when('Submitting', () => h.form([h.Class('login-form'), h.Disabled(true)], [h.button([h.Type('submit'), h.Disabled(true)], ['Signing in...'])])), M.when('LoggedIn', () => h.div([
|
|
65
|
+
h.Class('logged-in'),
|
|
66
|
+
h.Role('region'),
|
|
67
|
+
h.AriaLabel('User session'),
|
|
68
|
+
], [
|
|
69
|
+
h.span([h.Class('greeting'), h.Role('status')], [`Welcome, ${model.username}!`]),
|
|
70
|
+
h.button([
|
|
71
|
+
h.OnClick(ClickedLogout()),
|
|
72
|
+
h.Role('button'),
|
|
73
|
+
h.AriaExpanded(false),
|
|
74
|
+
], ['Log out']),
|
|
75
|
+
])), M.when('Error', () => h.div([], [
|
|
76
|
+
h.p([h.Class('error'), h.Role('alert')], [model.error]),
|
|
77
|
+
h.button([h.OnClick(SubmittedLogin()), h.Class('retry')], ['Retry']),
|
|
78
|
+
])), M.when('Idle', () => h.form([h.OnSubmit(SubmittedLogin()), h.Class('login-form')], [
|
|
79
|
+
h.label([h.For('email'), h.Class('sr-only')], ['Email']),
|
|
80
|
+
h.input([
|
|
81
|
+
h.Id('email'),
|
|
82
|
+
h.Type('email'),
|
|
83
|
+
h.Placeholder('Email'),
|
|
84
|
+
h.Value(model.email),
|
|
85
|
+
h.OnInput(value => UpdatedEmail({ value })),
|
|
78
86
|
]),
|
|
79
|
-
label([For('password'), Class('sr-only')], ['Password']),
|
|
80
|
-
input([
|
|
81
|
-
Id('password'),
|
|
82
|
-
Type('password'),
|
|
83
|
-
Placeholder('Password'),
|
|
84
|
-
Value(model.password),
|
|
85
|
-
OnInput(value => UpdatedPassword({ value })),
|
|
87
|
+
h.label([h.For('password'), h.Class('sr-only')], ['Password']),
|
|
88
|
+
h.input([
|
|
89
|
+
h.Id('password'),
|
|
90
|
+
h.Type('password'),
|
|
91
|
+
h.Placeholder('Password'),
|
|
92
|
+
h.Value(model.password),
|
|
93
|
+
h.OnInput(value => UpdatedPassword({ value })),
|
|
86
94
|
]),
|
|
87
|
-
button([Type('submit'), Class('primary'), Disabled(false)], ['Sign in']),
|
|
95
|
+
h.button([h.Type('submit'), h.Class('primary'), h.Disabled(false)], ['Sign in']),
|
|
88
96
|
])), M.exhaustive),
|
|
89
97
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logoutButton.d.ts","sourceRoot":"","sources":["../../../src/test/apps/logoutButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAM/C,eAAO,MAAM,KAAK;;EAAgC,CAAA;AAClD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,OAAO,4KAA4C,CAAA;AAChE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,UAAU,iGAA6B,CAAA;AACpD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,eAAO,MAAM,YAAY,EAAE,KAA4B,CAAA;AAIvD,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAShE,CAAA;AAMH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,
|
|
1
|
+
{"version":3,"file":"logoutButton.d.ts","sourceRoot":"","sources":["../../../src/test/apps/logoutButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAM/C,eAAO,MAAM,KAAK;;EAAgC,CAAA;AAClD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,OAAO,4KAA4C,CAAA;AAChE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,UAAU,iGAA6B,CAAA;AACpD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,eAAO,MAAM,YAAY,EAAE,KAA4B,CAAA;AAIvD,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAShE,CAAA;AAMH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,IAIjC,CAAA"}
|
|
@@ -18,5 +18,5 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
18
18
|
CompletedAction: () => [model, [], Option.none()],
|
|
19
19
|
}));
|
|
20
20
|
// VIEW
|
|
21
|
-
const
|
|
22
|
-
export const view = (model) => div([], [button([OnClick(ClickedLogout()), Role('button')], [model.label])]);
|
|
21
|
+
const h = html();
|
|
22
|
+
export const view = (model) => h.div([], [h.button([h.OnClick(ClickedLogout()), h.Role('button')], [model.label])]);
|
|
@@ -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":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mountPanel.d.ts","sourceRoot":"","sources":["../../../src/test/apps/mountPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAG1E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAI7C,eAAO,MAAM,KAAK;;;;EAIhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,aAAa;;EAA0C,CAAA;AACpE,eAAO,MAAM,oBAAoB,kFAA4B,CAAA;AAC7D,eAAO,MAAM,kBAAkB;;EAAgD,CAAA;AAC/E,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,UAAU;;EAAwC,CAAA;AAE/D,eAAO,MAAM,OAAO;;;;;;IAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAWzC,eAAO,MAAM,YAAY;;;;;;EASxB,CAAA;AAED,eAAO,MAAM,WAAW;;EAQvB,CAAA;AAED,eAAO,MAAM,UAAU;;;;;EAgBtB,CAAA;AAID,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAcrC,CAAA;AAMH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,IA2BjC,CAAA;AAEH;;4BAE4B;AAC5B,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,IAWzC,CAAA;AAEH;;;2DAG2D;AAC3D,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,IAI7C,CAAA"}
|
|
@@ -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,23 +63,16 @@ 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
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
cleanup: () => { },
|
|
49
|
-
}));
|
|
50
|
-
const focusButton = FocusButton(() => Effect.succeed({
|
|
51
|
-
message: CompletedFocusButton(),
|
|
52
|
-
cleanup: () => { },
|
|
53
|
-
}));
|
|
54
|
-
export const view = (model) => div([Class('panel-test')], [
|
|
55
|
-
button([Key('toggle'), OnClick(ClickedToggle()), OnMount(focusButton)], [model.isOpen ? 'Close' : 'Open']),
|
|
69
|
+
const h = html();
|
|
70
|
+
export const view = (model) => h.div([h.Class('panel-test')], [
|
|
71
|
+
h.button([h.Key('toggle'), h.OnClick(ClickedToggle()), h.OnMount(FocusButton())], [model.isOpen ? 'Close' : 'Open']),
|
|
56
72
|
...(model.isOpen
|
|
57
73
|
? [
|
|
58
|
-
div([Key('panel'), OnMount(
|
|
59
|
-
span([], [
|
|
74
|
+
h.div([h.Key('panel'), h.OnMount(MeasurePanel())], [
|
|
75
|
+
h.span([], [
|
|
60
76
|
Option.match(model.measuredWidth, {
|
|
61
77
|
onNone: () => 'unmeasured',
|
|
62
78
|
onSome: width => `width: ${width}`,
|
|
@@ -69,8 +85,13 @@ export const view = (model) => div([Class('panel-test')], [
|
|
|
69
85
|
/** A view that always renders both the toggle button and the panel, exposing
|
|
70
86
|
* two MeasurePanel mounts simultaneously so we can exercise the (name,
|
|
71
87
|
* occurrence) tracking. */
|
|
72
|
-
export const twoPanelView = (model) => div([Class('two-panels')], [
|
|
73
|
-
div([Key('panel-a'), OnMount(
|
|
74
|
-
div([Key('panel-b'), OnMount(
|
|
75
|
-
button([Key('inc'), OnClick(ClickedIncrement())], [`count: ${model.count}`]),
|
|
88
|
+
export const twoPanelView = (model) => h.div([h.Class('two-panels')], [
|
|
89
|
+
h.div([h.Key('panel-a'), h.OnMount(MeasurePanel())], [h.span([], ['A'])]),
|
|
90
|
+
h.div([h.Key('panel-b'), h.OnMount(MeasurePanel())], [h.span([], ['B'])]),
|
|
91
|
+
h.button([h.Key('inc'), h.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) => h.div([h.Class('scroll-list')], [h.div([h.Key('list'), h.OnMount(ScrollList({ offset }))], [])]);
|
|
@@ -13,7 +13,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
13
13
|
ClickedFallback: () => [{ ...model, clicks: model.clicks + 1 }, []],
|
|
14
14
|
}));
|
|
15
15
|
// VIEW
|
|
16
|
-
const
|
|
17
|
-
export const view = (model) => div([], [
|
|
18
|
-
div([Role('doc-subtitle heading'), OnClick(ClickedFallback())], [`Fallback element clicks=${model.clicks}`]),
|
|
16
|
+
const h = html();
|
|
17
|
+
export const view = (model) => h.div([], [
|
|
18
|
+
h.div([h.Role('doc-subtitle heading'), h.OnClick(ClickedFallback())], [`Fallback element clicks=${model.clicks}`]),
|
|
19
19
|
]);
|