foldkit 0.128.1 → 0.130.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/THIRD-PARTY-NOTICES.md +30 -0
- package/dist/brand/brand.d.ts +25 -0
- package/dist/brand/brand.d.ts.map +1 -0
- package/dist/brand/brand.js +50 -0
- package/dist/brand/index.d.ts +2 -0
- package/dist/brand/index.d.ts.map +1 -0
- package/dist/brand/index.js +1 -0
- package/dist/brand/public.d.ts +2 -0
- package/dist/brand/public.d.ts.map +1 -0
- package/dist/brand/public.js +1 -0
- package/dist/canvas/view.d.ts.map +1 -1
- package/dist/canvas/view.js +1 -1
- package/dist/command/index.d.ts +6 -1
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/interruptible/index.d.ts +2 -0
- package/dist/command/interruptible/index.d.ts.map +1 -0
- package/dist/command/interruptible/index.js +1 -0
- package/dist/command/interruptible/interruptible.d.ts +177 -0
- package/dist/command/interruptible/interruptible.d.ts.map +1 -0
- package/dist/command/interruptible/interruptible.js +155 -0
- package/dist/command/interruptible/public.d.ts +3 -0
- package/dist/command/interruptible/public.d.ts.map +1 -0
- package/dist/command/interruptible/public.js +1 -0
- package/dist/command/public.d.ts +1 -0
- package/dist/command/public.d.ts.map +1 -1
- package/dist/command/public.js +1 -0
- package/dist/devTools/protocol.d.ts +1 -1
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +1 -1
- package/dist/devTools/store.js +2 -2
- package/dist/devTools/webSocketBridge.d.ts +1 -1
- package/dist/devTools/webSocketBridge.js +1 -1
- package/dist/html/index.d.ts +18 -18
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +530 -460
- package/dist/html/lazy.d.ts +1 -1
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +11 -2
- package/dist/propsModule.d.ts +1 -1
- package/dist/propsModule.d.ts.map +1 -1
- package/dist/propsModule.js +6 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +472 -279
- package/dist/snabbdom/attributes.d.ts +4 -0
- package/dist/snabbdom/attributes.d.ts.map +1 -0
- package/dist/snabbdom/attributes.js +63 -0
- package/dist/snabbdom/class.d.ts +4 -0
- package/dist/snabbdom/class.d.ts.map +1 -0
- package/dist/snabbdom/class.js +31 -0
- package/dist/snabbdom/dataset.d.ts +4 -0
- package/dist/snabbdom/dataset.d.ts.map +1 -0
- package/dist/snabbdom/dataset.js +42 -0
- package/dist/snabbdom/eventlisteners.d.ts +11 -0
- package/dist/snabbdom/eventlisteners.d.ts.map +1 -0
- package/dist/snabbdom/eventlisteners.js +85 -0
- package/dist/snabbdom/h.d.ts +11 -0
- package/dist/snabbdom/h.d.ts.map +1 -0
- package/dist/snabbdom/h.js +61 -0
- package/dist/snabbdom/hooks.d.ts +24 -0
- package/dist/snabbdom/hooks.d.ts.map +1 -0
- package/dist/snabbdom/hooks.js +1 -0
- package/dist/snabbdom/htmldomapi.d.ts +34 -0
- package/dist/snabbdom/htmldomapi.d.ts.map +1 -0
- package/dist/snabbdom/htmldomapi.js +111 -0
- package/dist/snabbdom/index.d.ts +15 -0
- package/dist/snabbdom/index.d.ts.map +1 -0
- package/dist/snabbdom/index.js +9 -0
- package/dist/snabbdom/init.d.ts +14 -0
- package/dist/snabbdom/init.d.ts.map +1 -0
- package/dist/snabbdom/init.js +486 -0
- package/dist/snabbdom/is.d.ts +3 -0
- package/dist/snabbdom/is.d.ts.map +1 -0
- package/dist/snabbdom/is.js +7 -0
- package/dist/snabbdom/module.d.ts +11 -0
- package/dist/snabbdom/module.d.ts.map +1 -0
- package/dist/snabbdom/module.js +1 -0
- package/dist/snabbdom/props.d.ts +2 -0
- package/dist/snabbdom/props.d.ts.map +1 -0
- package/dist/snabbdom/props.js +1 -0
- package/dist/snabbdom/style.d.ts +9 -0
- package/dist/snabbdom/style.d.ts.map +1 -0
- package/dist/snabbdom/style.js +123 -0
- package/dist/snabbdom/tovnode.d.ts +4 -0
- package/dist/snabbdom/tovnode.d.ts.map +1 -0
- package/dist/snabbdom/tovnode.js +69 -0
- package/dist/snabbdom/vnode.d.ts +46 -0
- package/dist/snabbdom/vnode.d.ts.map +1 -0
- package/dist/snabbdom/vnode.js +13 -0
- package/dist/test/apps/uploads.d.ts +81 -0
- package/dist/test/apps/uploads.d.ts.map +1 -0
- package/dist/test/apps/uploads.js +102 -0
- package/dist/test/internal.d.ts +16 -2
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +20 -4
- package/dist/vdom.d.ts +2 -2
- package/dist/vdom.d.ts.map +1 -1
- package/dist/vdom.js +1 -1
- package/package.json +7 -5
- package/dist/runtime/messagePriority.d.ts +0 -17
- package/dist/runtime/messagePriority.d.ts.map +0 -1
- package/dist/runtime/messagePriority.js +0 -33
- package/dist/runtime/renderLoop.d.ts +0 -27
- package/dist/runtime/renderLoop.d.ts.map +0 -1
- package/dist/runtime/renderLoop.js +0 -25
package/dist/html/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Array, Context, Data, Effect, Fiber, Function,
|
|
2
|
-
import { h } from 'snabbdom';
|
|
1
|
+
import { Array, Context, Data, Effect, Fiber, Function, Option, Stream, } from 'effect';
|
|
3
2
|
import { MountTracker } from '../mount/index.js';
|
|
3
|
+
import { VNodeDataMask, h, vnodeDataMaskKey, } from '../snabbdom/index.js';
|
|
4
4
|
import { isChildAttribute } from './childAttribute.js';
|
|
5
5
|
import { checkScheduledLeave, clearDragZoneAfterDrop, getDragZoneState, processDragEnter, processDragLeave, } from './dragZoneTracking.js';
|
|
6
6
|
import { clearRuntime, requireBoundaryMappers, requireDispatch, requireRuntimeContext, requireUnmountResolver, setRuntime, } from './runtimeSingleton.js';
|
|
@@ -87,18 +87,46 @@ export { Prop, OnCustomEvent };
|
|
|
87
87
|
const setData = (ctx, key, value) => {
|
|
88
88
|
ctx.data[key] = value;
|
|
89
89
|
};
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
const addVNodeDataMask = (ctx, dataMask) => {
|
|
91
|
+
ctx.data[vnodeDataMaskKey] = (ctx.data[vnodeDataMaskKey] ?? 0) | dataMask;
|
|
92
|
+
};
|
|
93
|
+
const setModuleData = (ctx, key, value, dataMask) => {
|
|
94
|
+
ctx.data[key] = value;
|
|
95
|
+
addVNodeDataMask(ctx, dataMask);
|
|
96
|
+
};
|
|
97
|
+
// NOTE: single-key fast paths. The bulk of attribute handlers set exactly
|
|
98
|
+
// one prop, attr, or event handler; writing it directly into the vnode data
|
|
99
|
+
// avoids allocating a `{ key: value }` literal and merging it per attribute.
|
|
100
|
+
const setDataProp = (ctx, key, value) => {
|
|
101
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
102
|
+
const props = (ctx.data.props ??= {});
|
|
103
|
+
props[key] = value;
|
|
104
|
+
addVNodeDataMask(ctx, VNodeDataMask.Props);
|
|
105
|
+
};
|
|
106
|
+
const setDataAttr = (ctx, key, value) => {
|
|
107
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
108
|
+
const attrs = (ctx.data.attrs ??= {});
|
|
109
|
+
attrs[key] = value;
|
|
110
|
+
addVNodeDataMask(ctx, VNodeDataMask.Attrs);
|
|
111
|
+
};
|
|
112
|
+
const addDataOn = (ctx, eventName, handler) => {
|
|
113
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
114
|
+
const on = (ctx.data.on ??= {});
|
|
115
|
+
addVNodeDataMask(ctx, VNodeDataMask.On);
|
|
116
|
+
const existingHandler = on[eventName];
|
|
117
|
+
if (existingHandler === undefined) {
|
|
118
|
+
on[eventName] = handler;
|
|
95
119
|
}
|
|
96
120
|
else {
|
|
97
|
-
|
|
121
|
+
// NOTE: chain in registration order, mirroring updateDataOn.
|
|
122
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
123
|
+
const previous = existingHandler;
|
|
124
|
+
on[eventName] = (...args) => {
|
|
125
|
+
previous(...args);
|
|
126
|
+
handler(...args);
|
|
127
|
+
};
|
|
98
128
|
}
|
|
99
129
|
};
|
|
100
|
-
const updateDataProps = (ctx, props) => updateData(ctx, 'props', props);
|
|
101
|
-
const updateDataAttrs = (ctx, attrs) => updateData(ctx, 'attrs', attrs);
|
|
102
130
|
// Event handlers chain per DOM event in spread order. Without this,
|
|
103
131
|
// `Object.assign` would silently drop earlier handlers for the same
|
|
104
132
|
// event when a consumer spreads published ChildAttributes alongside
|
|
@@ -108,6 +136,7 @@ const updateDataAttrs = (ctx, attrs) => updateData(ctx, 'attrs', attrs);
|
|
|
108
136
|
// earlier handler throws, later handlers do not run (mirroring native
|
|
109
137
|
// exception propagation, not silently swallowing bugs).
|
|
110
138
|
const updateDataOn = (ctx, on) => {
|
|
139
|
+
addVNodeDataMask(ctx, VNodeDataMask.On);
|
|
111
140
|
if (ctx.data.on === undefined) {
|
|
112
141
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
113
142
|
ctx.data.on = on;
|
|
@@ -135,40 +164,55 @@ const updateDataOn = (ctx, on) => {
|
|
|
135
164
|
}
|
|
136
165
|
};
|
|
137
166
|
const updatePropsWithPostpatch = (ctx, propName, value) => {
|
|
138
|
-
|
|
139
|
-
ctx.
|
|
167
|
+
setDataProp(ctx, propName, value);
|
|
168
|
+
ctx.getPostpatchProps().push({ propName, value });
|
|
140
169
|
};
|
|
141
|
-
// NOTE:
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
// NOTE: class strings repeat heavily across elements and renders, so the
|
|
171
|
+
// parsed class object is cached per distinct string. Cached objects are
|
|
172
|
+
// shared across vnodes; snabbdom's classModule only reads them, and the
|
|
173
|
+
// Class handler installs them via `setData` (never merged into), so sharing
|
|
174
|
+
// is safe. Class strings interpolated from model data can take unboundedly
|
|
175
|
+
// many values, so the cache clears at a size cap instead of retaining every
|
|
176
|
+
// string for the page lifetime; the render after a clear re-parses and
|
|
177
|
+
// re-caches what it actually uses.
|
|
178
|
+
const CLASS_OBJECT_CACHE_LIMIT = 10_000;
|
|
179
|
+
const classObjectCache = new Map();
|
|
180
|
+
const classObjectFor = (value) => {
|
|
181
|
+
const cached = classObjectCache.get(value);
|
|
182
|
+
if (cached !== undefined) {
|
|
183
|
+
return cached;
|
|
184
|
+
}
|
|
185
|
+
const classObject = {};
|
|
186
|
+
for (const className of value.split(/\s+/)) {
|
|
187
|
+
if (className !== '') {
|
|
188
|
+
classObject[className] = true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (classObjectCache.size >= CLASS_OBJECT_CACHE_LIMIT) {
|
|
192
|
+
classObjectCache.clear();
|
|
193
|
+
}
|
|
194
|
+
classObjectCache.set(value, classObject);
|
|
195
|
+
return classObject;
|
|
196
|
+
};
|
|
197
|
+
const attributeHandlers = {
|
|
198
|
+
Key: ({ value }, ctx) => setData(ctx, 'key', value),
|
|
199
|
+
Class: ({ value }, ctx) => setModuleData(ctx, 'class', classObjectFor(value), VNodeDataMask.Class),
|
|
200
|
+
Id: ({ value }, ctx) => setDataProp(ctx, 'id', value),
|
|
201
|
+
Title: ({ value }, ctx) => setDataProp(ctx, 'title', value),
|
|
202
|
+
Lang: ({ value }, ctx) => setDataProp(ctx, 'lang', value),
|
|
203
|
+
Dir: ({ value }, ctx) => setDataProp(ctx, 'dir', value),
|
|
204
|
+
Tabindex: ({ value }, ctx) => setDataProp(ctx, 'tabIndex', value),
|
|
205
|
+
Hidden: ({ value }, ctx) => setDataProp(ctx, 'hidden', value),
|
|
206
|
+
Contenteditable: ({ value }, ctx) => setDataAttr(ctx, 'contenteditable', value),
|
|
207
|
+
Draggable: ({ value }, ctx) => setDataProp(ctx, 'draggable', value),
|
|
208
|
+
Accesskey: ({ value }, ctx) => setDataAttr(ctx, 'accesskey', value),
|
|
209
|
+
Translate: ({ value }, ctx) => setDataAttr(ctx, 'translate', value),
|
|
210
|
+
Inert: ({ value }, ctx) => setDataProp(ctx, 'inert', value),
|
|
211
|
+
Popover: ({ value }, ctx) => setDataAttr(ctx, 'popover', value),
|
|
212
|
+
Popovertarget: ({ value }, ctx) => setDataAttr(ctx, 'popovertarget', value),
|
|
213
|
+
Popovertargetaction: ({ value }, ctx) => setDataAttr(ctx, 'popovertargetaction', value),
|
|
214
|
+
OnClick: ({ message }, ctx) => addDataOn(ctx, 'click', () => ctx.dispatch(message)),
|
|
215
|
+
OnClickFocus: ({ focusSelector, message }, ctx) => updateDataOn(ctx, {
|
|
172
216
|
click: () => {
|
|
173
217
|
const focusTarget = document.querySelector(focusSelector);
|
|
174
218
|
if (focusTarget instanceof HTMLElement) {
|
|
@@ -177,61 +221,61 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
177
221
|
ctx.dispatch(message);
|
|
178
222
|
},
|
|
179
223
|
}),
|
|
180
|
-
OnDoubleClick: ({ message }
|
|
181
|
-
OnMouseDown: ({ message }
|
|
182
|
-
OnMouseUp: ({ message }
|
|
183
|
-
OnMouseEnter: ({ message }
|
|
184
|
-
OnMouseLeave: ({ message }
|
|
185
|
-
OnMouseOver: ({ message }
|
|
186
|
-
OnMouseOut: ({ message }
|
|
187
|
-
OnMouseMove: ({ message }
|
|
188
|
-
OnPointerMove: ({ f }
|
|
224
|
+
OnDoubleClick: ({ message }, ctx) => addDataOn(ctx, 'dblclick', () => ctx.dispatch(message)),
|
|
225
|
+
OnMouseDown: ({ message }, ctx) => addDataOn(ctx, 'mousedown', () => ctx.dispatch(message)),
|
|
226
|
+
OnMouseUp: ({ message }, ctx) => addDataOn(ctx, 'mouseup', () => ctx.dispatch(message)),
|
|
227
|
+
OnMouseEnter: ({ message }, ctx) => addDataOn(ctx, 'mouseenter', () => ctx.dispatch(message)),
|
|
228
|
+
OnMouseLeave: ({ message }, ctx) => addDataOn(ctx, 'mouseleave', () => ctx.dispatch(message)),
|
|
229
|
+
OnMouseOver: ({ message }, ctx) => addDataOn(ctx, 'mouseover', () => ctx.dispatch(message)),
|
|
230
|
+
OnMouseOut: ({ message }, ctx) => addDataOn(ctx, 'mouseout', () => ctx.dispatch(message)),
|
|
231
|
+
OnMouseMove: ({ message }, ctx) => addDataOn(ctx, 'mousemove', () => ctx.dispatch(message)),
|
|
232
|
+
OnPointerMove: ({ f: toMaybeMessage }, ctx) => updateDataOn(ctx, {
|
|
189
233
|
pointermove: (event) => {
|
|
190
|
-
const maybeMessage =
|
|
234
|
+
const maybeMessage = toMaybeMessage(event.screenX, event.screenY, event.pointerType);
|
|
191
235
|
if (Option.isSome(maybeMessage)) {
|
|
192
236
|
ctx.dispatch(maybeMessage.value);
|
|
193
237
|
}
|
|
194
238
|
},
|
|
195
239
|
}),
|
|
196
|
-
OnPointerLeave: ({ f }
|
|
240
|
+
OnPointerLeave: ({ f: toMaybeMessage }, ctx) => updateDataOn(ctx, {
|
|
197
241
|
pointerleave: (event) => {
|
|
198
|
-
const maybeMessage =
|
|
242
|
+
const maybeMessage = toMaybeMessage(event.pointerType);
|
|
199
243
|
if (Option.isSome(maybeMessage)) {
|
|
200
244
|
ctx.dispatch(maybeMessage.value);
|
|
201
245
|
}
|
|
202
246
|
},
|
|
203
247
|
}),
|
|
204
|
-
OnPointerDown: ({ f }
|
|
248
|
+
OnPointerDown: ({ f: toMaybeMessage }, ctx) => updateDataOn(ctx, {
|
|
205
249
|
pointerdown: (event) => {
|
|
206
|
-
const maybeMessage =
|
|
250
|
+
const maybeMessage = toMaybeMessage(event.pointerType, event.button, event.screenX, event.screenY, event.timeStamp, event.clientX, event.clientY);
|
|
207
251
|
if (Option.isSome(maybeMessage)) {
|
|
208
252
|
ctx.dispatch(maybeMessage.value);
|
|
209
253
|
}
|
|
210
254
|
},
|
|
211
255
|
}),
|
|
212
|
-
OnPointerUp: ({ f }
|
|
256
|
+
OnPointerUp: ({ f: toMaybeMessage }, ctx) => updateDataOn(ctx, {
|
|
213
257
|
pointerup: (event) => {
|
|
214
|
-
const maybeMessage =
|
|
258
|
+
const maybeMessage = toMaybeMessage(event.screenX, event.screenY, event.pointerType, event.timeStamp);
|
|
215
259
|
if (Option.isSome(maybeMessage)) {
|
|
216
260
|
ctx.dispatch(maybeMessage.value);
|
|
217
261
|
}
|
|
218
262
|
},
|
|
219
263
|
}),
|
|
220
|
-
OnKeyDown: ({ f }
|
|
221
|
-
keydown: (event) => ctx.dispatch(
|
|
264
|
+
OnKeyDown: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
265
|
+
keydown: (event) => ctx.dispatch(toMessage(event.key, keyboardModifiers(event))),
|
|
222
266
|
}),
|
|
223
|
-
OnKeyDownPreventDefault: ({ f }
|
|
267
|
+
OnKeyDownPreventDefault: ({ f: toMaybeMessage }, ctx) => updateDataOn(ctx, {
|
|
224
268
|
keydown: (event) => {
|
|
225
|
-
const maybeMessage =
|
|
269
|
+
const maybeMessage = toMaybeMessage(event.key, keyboardModifiers(event));
|
|
226
270
|
if (Option.isSome(maybeMessage)) {
|
|
227
271
|
event.preventDefault();
|
|
228
272
|
ctx.dispatch(maybeMessage.value);
|
|
229
273
|
}
|
|
230
274
|
},
|
|
231
275
|
}),
|
|
232
|
-
OnKeyDownFocus: ({ f }
|
|
276
|
+
OnKeyDownFocus: ({ f: toMaybeFocusAndMessage }, ctx) => updateDataOn(ctx, {
|
|
233
277
|
keydown: (event) => {
|
|
234
|
-
const maybeResult =
|
|
278
|
+
const maybeResult = toMaybeFocusAndMessage(event.key, keyboardModifiers(event));
|
|
235
279
|
if (Option.isSome(maybeResult)) {
|
|
236
280
|
event.preventDefault();
|
|
237
281
|
const { focusSelector, message } = maybeResult.value;
|
|
@@ -243,23 +287,23 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
243
287
|
}
|
|
244
288
|
},
|
|
245
289
|
}),
|
|
246
|
-
OnKeyUp: ({ f }
|
|
247
|
-
keyup: (event) => ctx.dispatch(
|
|
290
|
+
OnKeyUp: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
291
|
+
keyup: (event) => ctx.dispatch(toMessage(event.key, keyboardModifiers(event))),
|
|
248
292
|
}),
|
|
249
|
-
OnKeyUpPreventDefault: ({ f }
|
|
293
|
+
OnKeyUpPreventDefault: ({ f: toMaybeMessage }, ctx) => updateDataOn(ctx, {
|
|
250
294
|
keyup: (event) => {
|
|
251
|
-
const maybeMessage =
|
|
295
|
+
const maybeMessage = toMaybeMessage(event.key, keyboardModifiers(event));
|
|
252
296
|
if (Option.isSome(maybeMessage)) {
|
|
253
297
|
event.preventDefault();
|
|
254
298
|
ctx.dispatch(maybeMessage.value);
|
|
255
299
|
}
|
|
256
300
|
},
|
|
257
301
|
}),
|
|
258
|
-
OnKeyPress: ({ f }
|
|
259
|
-
keypress: (event) => ctx.dispatch(
|
|
302
|
+
OnKeyPress: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
303
|
+
keypress: (event) => ctx.dispatch(toMessage(event.key, keyboardModifiers(event))),
|
|
260
304
|
}),
|
|
261
|
-
OnFocus: ({ message }
|
|
262
|
-
OnBlur: ({ message }
|
|
305
|
+
OnFocus: ({ message }, ctx) => addDataOn(ctx, 'focus', () => ctx.dispatch(message)),
|
|
306
|
+
OnBlur: ({ message }, ctx) => updateDataOn(ctx, {
|
|
263
307
|
blur: (event) => {
|
|
264
308
|
if (event.relatedTarget instanceof Element &&
|
|
265
309
|
event.relatedTarget.id === DEVTOOLS_HOST_ID) {
|
|
@@ -268,17 +312,17 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
268
312
|
ctx.dispatch(message);
|
|
269
313
|
},
|
|
270
314
|
}),
|
|
271
|
-
OnInput: ({ f }
|
|
315
|
+
OnInput: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
272
316
|
input: (event) =>
|
|
273
317
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
274
|
-
ctx.dispatch(
|
|
318
|
+
ctx.dispatch(toMessage(event.target.value)),
|
|
275
319
|
}),
|
|
276
|
-
OnChange: ({ f }
|
|
320
|
+
OnChange: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
277
321
|
change: (event) =>
|
|
278
322
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
279
|
-
ctx.dispatch(
|
|
323
|
+
ctx.dispatch(toMessage(event.target.value)),
|
|
280
324
|
}),
|
|
281
|
-
OnFileChange: ({ f }
|
|
325
|
+
OnFileChange: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
282
326
|
change: tagAsFileHandler((event) => {
|
|
283
327
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
284
328
|
const target = event.target;
|
|
@@ -286,36 +330,36 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
286
330
|
? Array.fromIterable(target.files)
|
|
287
331
|
: Array.empty();
|
|
288
332
|
target.value = '';
|
|
289
|
-
ctx.dispatch(
|
|
333
|
+
ctx.dispatch(toMessage(files));
|
|
290
334
|
}, 'OnFileChange'),
|
|
291
335
|
}),
|
|
292
|
-
OnSubmit: ({ message }
|
|
336
|
+
OnSubmit: ({ message }, ctx) => updateDataOn(ctx, {
|
|
293
337
|
submit: (event) => {
|
|
294
338
|
event.preventDefault();
|
|
295
339
|
ctx.dispatch(message);
|
|
296
340
|
},
|
|
297
341
|
}),
|
|
298
|
-
OnReset: ({ message }
|
|
299
|
-
OnScroll: ({ f }
|
|
342
|
+
OnReset: ({ message }, ctx) => addDataOn(ctx, 'reset', () => ctx.dispatch(message)),
|
|
343
|
+
OnScroll: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
300
344
|
scroll: (event) =>
|
|
301
345
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
302
|
-
ctx.dispatch(
|
|
346
|
+
ctx.dispatch(toMessage(event.target.scrollTop)),
|
|
303
347
|
}),
|
|
304
|
-
OnWheel: ({ message }
|
|
305
|
-
OnCopy: ({ message }
|
|
306
|
-
OnCut: ({ message }
|
|
307
|
-
OnPaste: ({ message }
|
|
308
|
-
OnPastePreventDefault: ({ f }
|
|
348
|
+
OnWheel: ({ message }, ctx) => addDataOn(ctx, 'wheel', () => ctx.dispatch(message)),
|
|
349
|
+
OnCopy: ({ message }, ctx) => addDataOn(ctx, 'copy', () => ctx.dispatch(message)),
|
|
350
|
+
OnCut: ({ message }, ctx) => addDataOn(ctx, 'cut', () => ctx.dispatch(message)),
|
|
351
|
+
OnPaste: ({ message }, ctx) => addDataOn(ctx, 'paste', () => ctx.dispatch(message)),
|
|
352
|
+
OnPastePreventDefault: ({ f: toMaybeMessage }, ctx) => updateDataOn(ctx, {
|
|
309
353
|
paste: (event) => {
|
|
310
354
|
const text = event.clipboardData?.getData('text/plain') ?? '';
|
|
311
|
-
const maybeMessage =
|
|
355
|
+
const maybeMessage = toMaybeMessage(text);
|
|
312
356
|
if (Option.isSome(maybeMessage)) {
|
|
313
357
|
event.preventDefault();
|
|
314
358
|
ctx.dispatch(maybeMessage.value);
|
|
315
359
|
}
|
|
316
360
|
},
|
|
317
361
|
}),
|
|
318
|
-
OnCopyText: ({ text }
|
|
362
|
+
OnCopyText: ({ text }, ctx) => updateDataOn(ctx, {
|
|
319
363
|
copy: (event) => {
|
|
320
364
|
if (event.clipboardData) {
|
|
321
365
|
event.clipboardData.setData('text/plain', text);
|
|
@@ -323,7 +367,7 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
323
367
|
}
|
|
324
368
|
},
|
|
325
369
|
}),
|
|
326
|
-
OnCutText: ({ text, message }
|
|
370
|
+
OnCutText: ({ text, message }, ctx) => updateDataOn(ctx, {
|
|
327
371
|
cut: (event) => {
|
|
328
372
|
if (event.clipboardData) {
|
|
329
373
|
event.clipboardData.setData('text/plain', text);
|
|
@@ -332,27 +376,27 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
332
376
|
}
|
|
333
377
|
},
|
|
334
378
|
}),
|
|
335
|
-
OnCancel: ({ message }
|
|
379
|
+
OnCancel: ({ message }, ctx) => updateDataOn(ctx, {
|
|
336
380
|
cancel: (event) => {
|
|
337
381
|
event.preventDefault();
|
|
338
382
|
ctx.dispatch(message);
|
|
339
383
|
},
|
|
340
384
|
}),
|
|
341
|
-
OnToggle: ({ f }
|
|
385
|
+
OnToggle: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
342
386
|
toggle: event =>
|
|
343
387
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
344
|
-
ctx.dispatch(
|
|
388
|
+
ctx.dispatch(toMessage(event.target.open)),
|
|
345
389
|
}),
|
|
346
|
-
OnContextMenu: ({ message }
|
|
390
|
+
OnContextMenu: ({ message }, ctx) => updateDataOn(ctx, {
|
|
347
391
|
contextmenu: (event) => {
|
|
348
392
|
event.preventDefault();
|
|
349
393
|
ctx.dispatch(message);
|
|
350
394
|
},
|
|
351
395
|
}),
|
|
352
|
-
OnDragStart: ({ message }
|
|
353
|
-
OnDrag: ({ message }
|
|
354
|
-
OnDragEnd: ({ message }
|
|
355
|
-
OnDragEnter: ({ message }
|
|
396
|
+
OnDragStart: ({ message }, ctx) => addDataOn(ctx, 'dragstart', () => ctx.dispatch(message)),
|
|
397
|
+
OnDrag: ({ message }, ctx) => addDataOn(ctx, 'drag', () => ctx.dispatch(message)),
|
|
398
|
+
OnDragEnd: ({ message }, ctx) => addDataOn(ctx, 'dragend', () => ctx.dispatch(message)),
|
|
399
|
+
OnDragEnter: ({ message }, ctx) => updateDataOn(ctx, {
|
|
356
400
|
dragenter: (event) => {
|
|
357
401
|
event.preventDefault();
|
|
358
402
|
const zone = event.currentTarget;
|
|
@@ -366,7 +410,7 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
366
410
|
}
|
|
367
411
|
},
|
|
368
412
|
}),
|
|
369
|
-
OnDragLeave: ({ message }
|
|
413
|
+
OnDragLeave: ({ message }, ctx) => updateDataOn(ctx, {
|
|
370
414
|
dragleave: (event) => {
|
|
371
415
|
const zone = event.currentTarget;
|
|
372
416
|
if (!(zone instanceof Element)) {
|
|
@@ -383,18 +427,18 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
383
427
|
}
|
|
384
428
|
},
|
|
385
429
|
}),
|
|
386
|
-
OnDragOver: ({ message }
|
|
430
|
+
OnDragOver: ({ message }, ctx) => updateDataOn(ctx, {
|
|
387
431
|
dragover: (event) => {
|
|
388
432
|
event.preventDefault();
|
|
389
433
|
ctx.dispatch(message);
|
|
390
434
|
},
|
|
391
435
|
}),
|
|
392
|
-
AllowDrop: (
|
|
436
|
+
AllowDrop: (_attribute, ctx) => updateDataOn(ctx, {
|
|
393
437
|
dragover: (event) => {
|
|
394
438
|
event.preventDefault();
|
|
395
439
|
},
|
|
396
440
|
}),
|
|
397
|
-
OnDrop: ({ message }
|
|
441
|
+
OnDrop: ({ message }, ctx) => updateDataOn(ctx, {
|
|
398
442
|
drop: (event) => {
|
|
399
443
|
event.preventDefault();
|
|
400
444
|
const zone = event.currentTarget;
|
|
@@ -404,7 +448,7 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
404
448
|
ctx.dispatch(message);
|
|
405
449
|
},
|
|
406
450
|
}),
|
|
407
|
-
OnDropFiles: ({ f }
|
|
451
|
+
OnDropFiles: ({ f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
408
452
|
drop: tagAsFileHandler((event) => {
|
|
409
453
|
event.preventDefault();
|
|
410
454
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
@@ -416,260 +460,260 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
416
460
|
const files = dragEvent.dataTransfer?.files
|
|
417
461
|
? Array.fromIterable(dragEvent.dataTransfer.files)
|
|
418
462
|
: Array.empty();
|
|
419
|
-
ctx.dispatch(
|
|
463
|
+
ctx.dispatch(toMessage(files));
|
|
420
464
|
}, 'OnDropFiles'),
|
|
421
465
|
}),
|
|
422
|
-
OnTouchStart: ({ message }
|
|
423
|
-
OnTouchEnd: ({ message }
|
|
424
|
-
OnTouchMove: ({ message }
|
|
425
|
-
OnTouchCancel: ({ message }
|
|
426
|
-
OnAnimationStart: ({ message }
|
|
427
|
-
OnAnimationEnd: ({ message }
|
|
428
|
-
OnAnimationIteration: ({ message }
|
|
429
|
-
OnTransitionEnd: ({ message }
|
|
430
|
-
OnLoad: ({ message }
|
|
431
|
-
OnError: ({ message }
|
|
432
|
-
OnPlay: ({ message }
|
|
433
|
-
OnPause: ({ message }
|
|
434
|
-
OnEnded: ({ message }
|
|
435
|
-
OnTimeUpdate: ({ message }
|
|
436
|
-
OnVolumeChange: ({ message }
|
|
437
|
-
OnSelect: ({ message }
|
|
438
|
-
Value: ({ value }
|
|
439
|
-
Checked: ({ value }
|
|
440
|
-
Selected: ({ value }
|
|
441
|
-
Open: ({ value }
|
|
442
|
-
Placeholder: ({ value }
|
|
443
|
-
Name: ({ value }
|
|
444
|
-
Disabled: ({ value }
|
|
445
|
-
Readonly: ({ value }
|
|
446
|
-
Required: ({ value }
|
|
447
|
-
Autofocus: ({ value }
|
|
448
|
-
Spellcheck: ({ value }
|
|
449
|
-
Autocorrect: ({ value }
|
|
450
|
-
Autocapitalize: ({ value }
|
|
451
|
-
InputMode: ({ value }
|
|
452
|
-
EnterKeyHint: ({ value }
|
|
453
|
-
Multiple: ({ value }
|
|
454
|
-
Type: ({ value }
|
|
455
|
-
Accept: ({ value }
|
|
456
|
-
Autocomplete: ({ value }
|
|
457
|
-
Pattern: ({ value }
|
|
458
|
-
Maxlength: ({ value }
|
|
459
|
-
Minlength: ({ value }
|
|
460
|
-
Size: ({ value }
|
|
461
|
-
Cols: ({ value }
|
|
462
|
-
Rows: ({ value }
|
|
463
|
-
Max: ({ value }
|
|
464
|
-
Min: ({ value }
|
|
465
|
-
Step: ({ value }
|
|
466
|
-
For: ({ value }
|
|
467
|
-
Href: ({ value }
|
|
468
|
-
Src: ({ value }
|
|
469
|
-
Alt: ({ value }
|
|
470
|
-
Target: ({ value }
|
|
471
|
-
Rel: ({ value }
|
|
472
|
-
Download: ({ value }
|
|
473
|
-
Action: ({ value }
|
|
474
|
-
Method: ({ value }
|
|
475
|
-
Enctype: ({ value }
|
|
476
|
-
Novalidate: ({ value }
|
|
477
|
-
Formaction: ({ value }
|
|
478
|
-
Formmethod: ({ value }
|
|
479
|
-
Formnovalidate: ({ value }
|
|
480
|
-
Formtarget: ({ value }
|
|
481
|
-
Formenctype: ({ value }
|
|
482
|
-
Colspan: ({ value }
|
|
483
|
-
Rowspan: ({ value }
|
|
484
|
-
Scope: ({ value }
|
|
485
|
-
Headers: ({ value }
|
|
486
|
-
Span: ({ value }
|
|
487
|
-
Start: ({ value }
|
|
488
|
-
Reversed: ({ value }
|
|
489
|
-
CiteAttr: ({ value }
|
|
490
|
-
Datetime: ({ value }
|
|
491
|
-
Wrap: ({ value }
|
|
492
|
-
List: ({ value }
|
|
493
|
-
FormAttr: ({ value }
|
|
494
|
-
LabelAttr: ({ value }
|
|
495
|
-
ContentAttr: ({ value }
|
|
496
|
-
Charset: ({ value }
|
|
497
|
-
HttpEquiv: ({ value }
|
|
498
|
-
Srcset: ({ value }
|
|
499
|
-
Sizes: ({ value }
|
|
500
|
-
Loading: ({ value }
|
|
501
|
-
Decoding: ({ value }
|
|
502
|
-
Fetchpriority: ({ value }
|
|
503
|
-
Crossorigin: ({ value }
|
|
504
|
-
Referrerpolicy: ({ value }
|
|
505
|
-
Integrity: ({ value }
|
|
506
|
-
Hreflang: ({ value }
|
|
507
|
-
Ping: ({ value }
|
|
508
|
-
Sandbox: ({ value }
|
|
509
|
-
Allow: ({ value }
|
|
510
|
-
Srcdoc: ({ value }
|
|
511
|
-
Autoplay: ({ value }
|
|
512
|
-
Controls: ({ value }
|
|
513
|
-
Loop: ({ value }
|
|
514
|
-
Muted: ({ value }
|
|
515
|
-
Poster: ({ value }
|
|
516
|
-
Preload: ({ value }
|
|
517
|
-
Playsinline: ({ value }
|
|
518
|
-
High: ({ value }
|
|
519
|
-
Low: ({ value }
|
|
520
|
-
Optimum: ({ value }
|
|
521
|
-
Usemap: ({ value }
|
|
522
|
-
Ismap: ({ value }
|
|
523
|
-
Role: ({ value }
|
|
524
|
-
AriaLabel: ({ value }
|
|
525
|
-
AriaLabelledBy: ({ value }
|
|
526
|
-
AriaDescribedBy: ({ value }
|
|
527
|
-
AriaHidden: ({ value }
|
|
528
|
-
AriaExpanded: ({ value }
|
|
529
|
-
AriaSelected: ({ value }
|
|
530
|
-
AriaChecked: ({ value }
|
|
531
|
-
AriaDisabled: ({ value }
|
|
532
|
-
AriaRequired: ({ value }
|
|
533
|
-
AriaInvalid: ({ value }
|
|
534
|
-
AriaLive: ({ value }
|
|
535
|
-
AriaControls: ({ value }
|
|
536
|
-
AriaCurrent: ({ value }
|
|
537
|
-
AriaOrientation: ({ value }
|
|
538
|
-
AriaPressed: ({ value }
|
|
539
|
-
AriaHasPopup: ({ value }
|
|
540
|
-
AriaActiveDescendant: ({ value }
|
|
541
|
-
AriaSort: ({ value }
|
|
542
|
-
AriaMultiSelectable: ({ value }
|
|
543
|
-
AriaModal: ({ value }
|
|
544
|
-
AriaBusy: ({ value }
|
|
545
|
-
AriaErrorMessage: ({ value }
|
|
546
|
-
AriaRoleDescription: ({ value }
|
|
547
|
-
AriaAtomic: ({ value }
|
|
548
|
-
AriaAutocomplete: ({ value }
|
|
549
|
-
AriaColcount: ({ value }
|
|
550
|
-
AriaColindex: ({ value }
|
|
551
|
-
AriaColspan: ({ value }
|
|
552
|
-
AriaDescription: ({ value }
|
|
553
|
-
AriaDetails: ({ value }
|
|
554
|
-
AriaFlowto: ({ value }
|
|
555
|
-
AriaKeyshortcuts: ({ value }
|
|
556
|
-
AriaLevel: ({ value }
|
|
557
|
-
AriaOwns: ({ value }
|
|
558
|
-
AriaPlaceholder: ({ value }
|
|
559
|
-
AriaPosinset: ({ value }
|
|
560
|
-
AriaReadonly: ({ value }
|
|
561
|
-
AriaRelevant: ({ value }
|
|
562
|
-
AriaRowcount: ({ value }
|
|
563
|
-
AriaRowindex: ({ value }
|
|
564
|
-
AriaRowspan: ({ value }
|
|
565
|
-
AriaSetsize: ({ value }
|
|
566
|
-
AriaValuemax: ({ value }
|
|
567
|
-
AriaValuemin: ({ value }
|
|
568
|
-
AriaValuenow: ({ value }
|
|
569
|
-
AriaValuetext: ({ value }
|
|
570
|
-
Attribute: ({ key, value }
|
|
571
|
-
DataAttribute: ({ key, value }
|
|
572
|
-
Style: ({ value }
|
|
573
|
-
InnerHTML: ({ value }
|
|
574
|
-
ViewBox: ({ value }
|
|
575
|
-
Xmlns: ({ value }
|
|
576
|
-
Fill: ({ value }
|
|
577
|
-
FillRule: ({ value }
|
|
578
|
-
ClipRule: ({ value }
|
|
579
|
-
Stroke: ({ value }
|
|
580
|
-
StrokeWidth: ({ value }
|
|
581
|
-
StrokeLinecap: ({ value }
|
|
582
|
-
StrokeLinejoin: ({ value }
|
|
583
|
-
D: ({ value }
|
|
584
|
-
Cx: ({ value }
|
|
585
|
-
Cy: ({ value }
|
|
586
|
-
R: ({ value }
|
|
587
|
-
X: ({ value }
|
|
588
|
-
Y: ({ value }
|
|
589
|
-
Width: ({ value }
|
|
590
|
-
Height: ({ value }
|
|
591
|
-
X1: ({ value }
|
|
592
|
-
Y1: ({ value }
|
|
593
|
-
X2: ({ value }
|
|
594
|
-
Y2: ({ value }
|
|
595
|
-
Points: ({ value }
|
|
596
|
-
Transform: ({ value }
|
|
597
|
-
Opacity: ({ value }
|
|
598
|
-
StrokeDasharray: ({ value }
|
|
599
|
-
StrokeDashoffset: ({ value }
|
|
600
|
-
Dx: ({ value }
|
|
601
|
-
Dy: ({ value }
|
|
602
|
-
Rotate: ({ value }
|
|
603
|
-
TextAnchor: ({ value }
|
|
604
|
-
DominantBaseline: ({ value }
|
|
605
|
-
AlignmentBaseline: ({ value }
|
|
606
|
-
BaselineShift: ({ value }
|
|
607
|
-
TextLength: ({ value }
|
|
608
|
-
LengthAdjust: ({ value }
|
|
609
|
-
FontFamily: ({ value }
|
|
610
|
-
FontSize: ({ value }
|
|
611
|
-
FontWeight: ({ value }
|
|
612
|
-
FontStyle: ({ value }
|
|
613
|
-
LetterSpacing: ({ value }
|
|
614
|
-
WordSpacing: ({ value }
|
|
615
|
-
TextDecoration: ({ value }
|
|
616
|
-
WritingMode: ({ value }
|
|
617
|
-
Rx: ({ value }
|
|
618
|
-
Ry: ({ value }
|
|
619
|
-
PathLength: ({ value }
|
|
620
|
-
FillOpacity: ({ value }
|
|
621
|
-
StrokeOpacity: ({ value }
|
|
622
|
-
StrokeMiterlimit: ({ value }
|
|
623
|
-
PaintOrder: ({ value }
|
|
624
|
-
VectorEffect: ({ value }
|
|
625
|
-
Color: ({ value }
|
|
626
|
-
Visibility: ({ value }
|
|
627
|
-
Display: ({ value }
|
|
628
|
-
Overflow: ({ value }
|
|
629
|
-
PointerEvents: ({ value }
|
|
630
|
-
Cursor: ({ value }
|
|
631
|
-
ShapeRendering: ({ value }
|
|
632
|
-
TextRendering: ({ value }
|
|
633
|
-
ImageRendering: ({ value }
|
|
634
|
-
ClipPath: ({ value }
|
|
635
|
-
Mask: ({ value }
|
|
636
|
-
Filter: ({ value }
|
|
637
|
-
ClipPathUnits: ({ value }
|
|
638
|
-
MaskUnits: ({ value }
|
|
639
|
-
MaskContentUnits: ({ value }
|
|
640
|
-
FilterUnits: ({ value }
|
|
641
|
-
PrimitiveUnits: ({ value }
|
|
642
|
-
Offset: ({ value }
|
|
643
|
-
StopColor: ({ value }
|
|
644
|
-
StopOpacity: ({ value }
|
|
645
|
-
GradientUnits: ({ value }
|
|
646
|
-
GradientTransform: ({ value }
|
|
647
|
-
SpreadMethod: ({ value }
|
|
648
|
-
Fx: ({ value }
|
|
649
|
-
Fy: ({ value }
|
|
650
|
-
Fr: ({ value }
|
|
651
|
-
PatternUnits: ({ value }
|
|
652
|
-
PatternContentUnits: ({ value }
|
|
653
|
-
PatternTransform: ({ value }
|
|
654
|
-
MarkerStart: ({ value }
|
|
655
|
-
MarkerMid: ({ value }
|
|
656
|
-
MarkerEnd: ({ value }
|
|
657
|
-
MarkerWidth: ({ value }
|
|
658
|
-
MarkerHeight: ({ value }
|
|
659
|
-
MarkerUnits: ({ value }
|
|
660
|
-
RefX: ({ value }
|
|
661
|
-
RefY: ({ value }
|
|
662
|
-
Orient: ({ value }
|
|
663
|
-
PreserveAspectRatio: ({ value }
|
|
664
|
-
Prop: ({ key, value }
|
|
665
|
-
OnCustomEvent: ({ name, f }
|
|
466
|
+
OnTouchStart: ({ message }, ctx) => addDataOn(ctx, 'touchstart', () => ctx.dispatch(message)),
|
|
467
|
+
OnTouchEnd: ({ message }, ctx) => addDataOn(ctx, 'touchend', () => ctx.dispatch(message)),
|
|
468
|
+
OnTouchMove: ({ message }, ctx) => addDataOn(ctx, 'touchmove', () => ctx.dispatch(message)),
|
|
469
|
+
OnTouchCancel: ({ message }, ctx) => addDataOn(ctx, 'touchcancel', () => ctx.dispatch(message)),
|
|
470
|
+
OnAnimationStart: ({ message }, ctx) => addDataOn(ctx, 'animationstart', () => ctx.dispatch(message)),
|
|
471
|
+
OnAnimationEnd: ({ message }, ctx) => addDataOn(ctx, 'animationend', () => ctx.dispatch(message)),
|
|
472
|
+
OnAnimationIteration: ({ message }, ctx) => addDataOn(ctx, 'animationiteration', () => ctx.dispatch(message)),
|
|
473
|
+
OnTransitionEnd: ({ message }, ctx) => addDataOn(ctx, 'transitionend', () => ctx.dispatch(message)),
|
|
474
|
+
OnLoad: ({ message }, ctx) => addDataOn(ctx, 'load', () => ctx.dispatch(message)),
|
|
475
|
+
OnError: ({ message }, ctx) => addDataOn(ctx, 'error', () => ctx.dispatch(message)),
|
|
476
|
+
OnPlay: ({ message }, ctx) => addDataOn(ctx, 'play', () => ctx.dispatch(message)),
|
|
477
|
+
OnPause: ({ message }, ctx) => addDataOn(ctx, 'pause', () => ctx.dispatch(message)),
|
|
478
|
+
OnEnded: ({ message }, ctx) => addDataOn(ctx, 'ended', () => ctx.dispatch(message)),
|
|
479
|
+
OnTimeUpdate: ({ message }, ctx) => addDataOn(ctx, 'timeupdate', () => ctx.dispatch(message)),
|
|
480
|
+
OnVolumeChange: ({ message }, ctx) => addDataOn(ctx, 'volumechange', () => ctx.dispatch(message)),
|
|
481
|
+
OnSelect: ({ message }, ctx) => addDataOn(ctx, 'select', () => ctx.dispatch(message)),
|
|
482
|
+
Value: ({ value }, ctx) => updatePropsWithPostpatch(ctx, 'value', value),
|
|
483
|
+
Checked: ({ value }, ctx) => updatePropsWithPostpatch(ctx, 'checked', value),
|
|
484
|
+
Selected: ({ value }, ctx) => updatePropsWithPostpatch(ctx, 'selected', value),
|
|
485
|
+
Open: ({ value }, ctx) => updatePropsWithPostpatch(ctx, 'open', value),
|
|
486
|
+
Placeholder: ({ value }, ctx) => setDataProp(ctx, 'placeholder', value),
|
|
487
|
+
Name: ({ value }, ctx) => setDataProp(ctx, 'name', value),
|
|
488
|
+
Disabled: ({ value }, ctx) => setDataProp(ctx, 'disabled', value),
|
|
489
|
+
Readonly: ({ value }, ctx) => setDataProp(ctx, 'readOnly', value),
|
|
490
|
+
Required: ({ value }, ctx) => setDataProp(ctx, 'required', value),
|
|
491
|
+
Autofocus: ({ value }, ctx) => setDataProp(ctx, 'autofocus', value),
|
|
492
|
+
Spellcheck: ({ value }, ctx) => setDataAttr(ctx, 'spellcheck', value.toString()),
|
|
493
|
+
Autocorrect: ({ value }, ctx) => setDataAttr(ctx, 'autocorrect', value),
|
|
494
|
+
Autocapitalize: ({ value }, ctx) => setDataAttr(ctx, 'autocapitalize', value),
|
|
495
|
+
InputMode: ({ value }, ctx) => setDataAttr(ctx, 'inputmode', value),
|
|
496
|
+
EnterKeyHint: ({ value }, ctx) => setDataAttr(ctx, 'enterkeyhint', value),
|
|
497
|
+
Multiple: ({ value }, ctx) => setDataProp(ctx, 'multiple', value),
|
|
498
|
+
Type: ({ value }, ctx) => setDataProp(ctx, 'type', value),
|
|
499
|
+
Accept: ({ value }, ctx) => setDataProp(ctx, 'accept', value),
|
|
500
|
+
Autocomplete: ({ value }, ctx) => setDataProp(ctx, 'autocomplete', value),
|
|
501
|
+
Pattern: ({ value }, ctx) => setDataProp(ctx, 'pattern', value),
|
|
502
|
+
Maxlength: ({ value }, ctx) => setDataProp(ctx, 'maxLength', value),
|
|
503
|
+
Minlength: ({ value }, ctx) => setDataProp(ctx, 'minLength', value),
|
|
504
|
+
Size: ({ value }, ctx) => setDataProp(ctx, 'size', value),
|
|
505
|
+
Cols: ({ value }, ctx) => setDataProp(ctx, 'cols', value),
|
|
506
|
+
Rows: ({ value }, ctx) => setDataProp(ctx, 'rows', value),
|
|
507
|
+
Max: ({ value }, ctx) => setDataProp(ctx, 'max', value),
|
|
508
|
+
Min: ({ value }, ctx) => setDataProp(ctx, 'min', value),
|
|
509
|
+
Step: ({ value }, ctx) => setDataProp(ctx, 'step', value),
|
|
510
|
+
For: ({ value }, ctx) => setDataProp(ctx, 'htmlFor', value),
|
|
511
|
+
Href: ({ value }, ctx) => setDataProp(ctx, 'href', value),
|
|
512
|
+
Src: ({ value }, ctx) => setDataProp(ctx, 'src', value),
|
|
513
|
+
Alt: ({ value }, ctx) => setDataProp(ctx, 'alt', value),
|
|
514
|
+
Target: ({ value }, ctx) => setDataProp(ctx, 'target', value),
|
|
515
|
+
Rel: ({ value }, ctx) => setDataProp(ctx, 'rel', value),
|
|
516
|
+
Download: ({ value }, ctx) => setDataProp(ctx, 'download', value),
|
|
517
|
+
Action: ({ value }, ctx) => setDataProp(ctx, 'action', value),
|
|
518
|
+
Method: ({ value }, ctx) => setDataProp(ctx, 'method', value),
|
|
519
|
+
Enctype: ({ value }, ctx) => setDataProp(ctx, 'enctype', value),
|
|
520
|
+
Novalidate: ({ value }, ctx) => setDataProp(ctx, 'noValidate', value),
|
|
521
|
+
Formaction: ({ value }, ctx) => setDataProp(ctx, 'formAction', value),
|
|
522
|
+
Formmethod: ({ value }, ctx) => setDataProp(ctx, 'formMethod', value),
|
|
523
|
+
Formnovalidate: ({ value }, ctx) => setDataProp(ctx, 'formNoValidate', value),
|
|
524
|
+
Formtarget: ({ value }, ctx) => setDataProp(ctx, 'formTarget', value),
|
|
525
|
+
Formenctype: ({ value }, ctx) => setDataProp(ctx, 'formEnctype', value),
|
|
526
|
+
Colspan: ({ value }, ctx) => setDataProp(ctx, 'colSpan', value),
|
|
527
|
+
Rowspan: ({ value }, ctx) => setDataProp(ctx, 'rowSpan', value),
|
|
528
|
+
Scope: ({ value }, ctx) => setDataAttr(ctx, 'scope', value),
|
|
529
|
+
Headers: ({ value }, ctx) => setDataAttr(ctx, 'headers', value),
|
|
530
|
+
Span: ({ value }, ctx) => setDataProp(ctx, 'span', value),
|
|
531
|
+
Start: ({ value }, ctx) => setDataProp(ctx, 'start', value),
|
|
532
|
+
Reversed: ({ value }, ctx) => setDataProp(ctx, 'reversed', value),
|
|
533
|
+
CiteAttr: ({ value }, ctx) => setDataProp(ctx, 'cite', value),
|
|
534
|
+
Datetime: ({ value }, ctx) => setDataProp(ctx, 'dateTime', value),
|
|
535
|
+
Wrap: ({ value }, ctx) => setDataProp(ctx, 'wrap', value),
|
|
536
|
+
List: ({ value }, ctx) => setDataAttr(ctx, 'list', value),
|
|
537
|
+
FormAttr: ({ value }, ctx) => setDataAttr(ctx, 'form', value),
|
|
538
|
+
LabelAttr: ({ value }, ctx) => setDataProp(ctx, 'label', value),
|
|
539
|
+
ContentAttr: ({ value }, ctx) => setDataAttr(ctx, 'content', value),
|
|
540
|
+
Charset: ({ value }, ctx) => setDataAttr(ctx, 'charset', value),
|
|
541
|
+
HttpEquiv: ({ value }, ctx) => setDataAttr(ctx, 'http-equiv', value),
|
|
542
|
+
Srcset: ({ value }, ctx) => setDataAttr(ctx, 'srcset', value),
|
|
543
|
+
Sizes: ({ value }, ctx) => setDataAttr(ctx, 'sizes', value),
|
|
544
|
+
Loading: ({ value }, ctx) => setDataAttr(ctx, 'loading', value),
|
|
545
|
+
Decoding: ({ value }, ctx) => setDataAttr(ctx, 'decoding', value),
|
|
546
|
+
Fetchpriority: ({ value }, ctx) => setDataAttr(ctx, 'fetchpriority', value),
|
|
547
|
+
Crossorigin: ({ value }, ctx) => setDataAttr(ctx, 'crossorigin', value),
|
|
548
|
+
Referrerpolicy: ({ value }, ctx) => setDataAttr(ctx, 'referrerpolicy', value),
|
|
549
|
+
Integrity: ({ value }, ctx) => setDataAttr(ctx, 'integrity', value),
|
|
550
|
+
Hreflang: ({ value }, ctx) => setDataAttr(ctx, 'hreflang', value),
|
|
551
|
+
Ping: ({ value }, ctx) => setDataAttr(ctx, 'ping', value),
|
|
552
|
+
Sandbox: ({ value }, ctx) => setDataAttr(ctx, 'sandbox', value),
|
|
553
|
+
Allow: ({ value }, ctx) => setDataAttr(ctx, 'allow', value),
|
|
554
|
+
Srcdoc: ({ value }, ctx) => setDataAttr(ctx, 'srcdoc', value),
|
|
555
|
+
Autoplay: ({ value }, ctx) => setDataProp(ctx, 'autoplay', value),
|
|
556
|
+
Controls: ({ value }, ctx) => setDataProp(ctx, 'controls', value),
|
|
557
|
+
Loop: ({ value }, ctx) => setDataProp(ctx, 'loop', value),
|
|
558
|
+
Muted: ({ value }, ctx) => updatePropsWithPostpatch(ctx, 'muted', value),
|
|
559
|
+
Poster: ({ value }, ctx) => setDataProp(ctx, 'poster', value),
|
|
560
|
+
Preload: ({ value }, ctx) => setDataProp(ctx, 'preload', value),
|
|
561
|
+
Playsinline: ({ value }, ctx) => setDataProp(ctx, 'playsInline', value),
|
|
562
|
+
High: ({ value }, ctx) => setDataProp(ctx, 'high', value),
|
|
563
|
+
Low: ({ value }, ctx) => setDataProp(ctx, 'low', value),
|
|
564
|
+
Optimum: ({ value }, ctx) => setDataProp(ctx, 'optimum', value),
|
|
565
|
+
Usemap: ({ value }, ctx) => setDataAttr(ctx, 'usemap', value),
|
|
566
|
+
Ismap: ({ value }, ctx) => setDataProp(ctx, 'isMap', value),
|
|
567
|
+
Role: ({ value }, ctx) => setDataAttr(ctx, 'role', value),
|
|
568
|
+
AriaLabel: ({ value }, ctx) => setDataAttr(ctx, 'aria-label', value),
|
|
569
|
+
AriaLabelledBy: ({ value }, ctx) => setDataAttr(ctx, 'aria-labelledby', value),
|
|
570
|
+
AriaDescribedBy: ({ value }, ctx) => setDataAttr(ctx, 'aria-describedby', value),
|
|
571
|
+
AriaHidden: ({ value }, ctx) => setDataAttr(ctx, 'aria-hidden', value.toString()),
|
|
572
|
+
AriaExpanded: ({ value }, ctx) => setDataAttr(ctx, 'aria-expanded', value.toString()),
|
|
573
|
+
AriaSelected: ({ value }, ctx) => setDataAttr(ctx, 'aria-selected', value.toString()),
|
|
574
|
+
AriaChecked: ({ value }, ctx) => setDataAttr(ctx, 'aria-checked', value.toString()),
|
|
575
|
+
AriaDisabled: ({ value }, ctx) => setDataAttr(ctx, 'aria-disabled', value.toString()),
|
|
576
|
+
AriaRequired: ({ value }, ctx) => setDataAttr(ctx, 'aria-required', value.toString()),
|
|
577
|
+
AriaInvalid: ({ value }, ctx) => setDataAttr(ctx, 'aria-invalid', value.toString()),
|
|
578
|
+
AriaLive: ({ value }, ctx) => setDataAttr(ctx, 'aria-live', value),
|
|
579
|
+
AriaControls: ({ value }, ctx) => setDataAttr(ctx, 'aria-controls', value),
|
|
580
|
+
AriaCurrent: ({ value }, ctx) => setDataAttr(ctx, 'aria-current', value),
|
|
581
|
+
AriaOrientation: ({ value }, ctx) => setDataAttr(ctx, 'aria-orientation', value),
|
|
582
|
+
AriaPressed: ({ value }, ctx) => setDataAttr(ctx, 'aria-pressed', value),
|
|
583
|
+
AriaHasPopup: ({ value }, ctx) => setDataAttr(ctx, 'aria-haspopup', value),
|
|
584
|
+
AriaActiveDescendant: ({ value }, ctx) => setDataAttr(ctx, 'aria-activedescendant', value),
|
|
585
|
+
AriaSort: ({ value }, ctx) => setDataAttr(ctx, 'aria-sort', value),
|
|
586
|
+
AriaMultiSelectable: ({ value }, ctx) => setDataAttr(ctx, 'aria-multiselectable', value.toString()),
|
|
587
|
+
AriaModal: ({ value }, ctx) => setDataAttr(ctx, 'aria-modal', value.toString()),
|
|
588
|
+
AriaBusy: ({ value }, ctx) => setDataAttr(ctx, 'aria-busy', value.toString()),
|
|
589
|
+
AriaErrorMessage: ({ value }, ctx) => setDataAttr(ctx, 'aria-errormessage', value),
|
|
590
|
+
AriaRoleDescription: ({ value }, ctx) => setDataAttr(ctx, 'aria-roledescription', value),
|
|
591
|
+
AriaAtomic: ({ value }, ctx) => setDataAttr(ctx, 'aria-atomic', value.toString()),
|
|
592
|
+
AriaAutocomplete: ({ value }, ctx) => setDataAttr(ctx, 'aria-autocomplete', value),
|
|
593
|
+
AriaColcount: ({ value }, ctx) => setDataAttr(ctx, 'aria-colcount', value.toString()),
|
|
594
|
+
AriaColindex: ({ value }, ctx) => setDataAttr(ctx, 'aria-colindex', value.toString()),
|
|
595
|
+
AriaColspan: ({ value }, ctx) => setDataAttr(ctx, 'aria-colspan', value.toString()),
|
|
596
|
+
AriaDescription: ({ value }, ctx) => setDataAttr(ctx, 'aria-description', value),
|
|
597
|
+
AriaDetails: ({ value }, ctx) => setDataAttr(ctx, 'aria-details', value),
|
|
598
|
+
AriaFlowto: ({ value }, ctx) => setDataAttr(ctx, 'aria-flowto', value),
|
|
599
|
+
AriaKeyshortcuts: ({ value }, ctx) => setDataAttr(ctx, 'aria-keyshortcuts', value),
|
|
600
|
+
AriaLevel: ({ value }, ctx) => setDataAttr(ctx, 'aria-level', value.toString()),
|
|
601
|
+
AriaOwns: ({ value }, ctx) => setDataAttr(ctx, 'aria-owns', value),
|
|
602
|
+
AriaPlaceholder: ({ value }, ctx) => setDataAttr(ctx, 'aria-placeholder', value),
|
|
603
|
+
AriaPosinset: ({ value }, ctx) => setDataAttr(ctx, 'aria-posinset', value.toString()),
|
|
604
|
+
AriaReadonly: ({ value }, ctx) => setDataAttr(ctx, 'aria-readonly', value.toString()),
|
|
605
|
+
AriaRelevant: ({ value }, ctx) => setDataAttr(ctx, 'aria-relevant', value),
|
|
606
|
+
AriaRowcount: ({ value }, ctx) => setDataAttr(ctx, 'aria-rowcount', value.toString()),
|
|
607
|
+
AriaRowindex: ({ value }, ctx) => setDataAttr(ctx, 'aria-rowindex', value.toString()),
|
|
608
|
+
AriaRowspan: ({ value }, ctx) => setDataAttr(ctx, 'aria-rowspan', value.toString()),
|
|
609
|
+
AriaSetsize: ({ value }, ctx) => setDataAttr(ctx, 'aria-setsize', value.toString()),
|
|
610
|
+
AriaValuemax: ({ value }, ctx) => setDataAttr(ctx, 'aria-valuemax', value.toString()),
|
|
611
|
+
AriaValuemin: ({ value }, ctx) => setDataAttr(ctx, 'aria-valuemin', value.toString()),
|
|
612
|
+
AriaValuenow: ({ value }, ctx) => setDataAttr(ctx, 'aria-valuenow', value.toString()),
|
|
613
|
+
AriaValuetext: ({ value }, ctx) => setDataAttr(ctx, 'aria-valuetext', value),
|
|
614
|
+
Attribute: ({ key, value }, ctx) => setDataAttr(ctx, key, value),
|
|
615
|
+
DataAttribute: ({ key, value }, ctx) => setDataAttr(ctx, `data-${key}`, value),
|
|
616
|
+
Style: ({ value }, ctx) => setModuleData(ctx, 'style', value, VNodeDataMask.Style),
|
|
617
|
+
InnerHTML: ({ value }, ctx) => setDataProp(ctx, 'innerHTML', value),
|
|
618
|
+
ViewBox: ({ value }, ctx) => setDataAttr(ctx, 'viewBox', value),
|
|
619
|
+
Xmlns: ({ value }, ctx) => setDataAttr(ctx, 'xmlns', value),
|
|
620
|
+
Fill: ({ value }, ctx) => setDataAttr(ctx, 'fill', value),
|
|
621
|
+
FillRule: ({ value }, ctx) => setDataAttr(ctx, 'fill-rule', value),
|
|
622
|
+
ClipRule: ({ value }, ctx) => setDataAttr(ctx, 'clip-rule', value),
|
|
623
|
+
Stroke: ({ value }, ctx) => setDataAttr(ctx, 'stroke', value),
|
|
624
|
+
StrokeWidth: ({ value }, ctx) => setDataAttr(ctx, 'stroke-width', value),
|
|
625
|
+
StrokeLinecap: ({ value }, ctx) => setDataAttr(ctx, 'stroke-linecap', value),
|
|
626
|
+
StrokeLinejoin: ({ value }, ctx) => setDataAttr(ctx, 'stroke-linejoin', value),
|
|
627
|
+
D: ({ value }, ctx) => setDataAttr(ctx, 'd', value),
|
|
628
|
+
Cx: ({ value }, ctx) => setDataAttr(ctx, 'cx', value),
|
|
629
|
+
Cy: ({ value }, ctx) => setDataAttr(ctx, 'cy', value),
|
|
630
|
+
R: ({ value }, ctx) => setDataAttr(ctx, 'r', value),
|
|
631
|
+
X: ({ value }, ctx) => setDataAttr(ctx, 'x', value),
|
|
632
|
+
Y: ({ value }, ctx) => setDataAttr(ctx, 'y', value),
|
|
633
|
+
Width: ({ value }, ctx) => setDataAttr(ctx, 'width', value),
|
|
634
|
+
Height: ({ value }, ctx) => setDataAttr(ctx, 'height', value),
|
|
635
|
+
X1: ({ value }, ctx) => setDataAttr(ctx, 'x1', value),
|
|
636
|
+
Y1: ({ value }, ctx) => setDataAttr(ctx, 'y1', value),
|
|
637
|
+
X2: ({ value }, ctx) => setDataAttr(ctx, 'x2', value),
|
|
638
|
+
Y2: ({ value }, ctx) => setDataAttr(ctx, 'y2', value),
|
|
639
|
+
Points: ({ value }, ctx) => setDataAttr(ctx, 'points', value),
|
|
640
|
+
Transform: ({ value }, ctx) => setDataAttr(ctx, 'transform', value),
|
|
641
|
+
Opacity: ({ value }, ctx) => setDataAttr(ctx, 'opacity', value),
|
|
642
|
+
StrokeDasharray: ({ value }, ctx) => setDataAttr(ctx, 'stroke-dasharray', value),
|
|
643
|
+
StrokeDashoffset: ({ value }, ctx) => setDataAttr(ctx, 'stroke-dashoffset', value),
|
|
644
|
+
Dx: ({ value }, ctx) => setDataAttr(ctx, 'dx', value),
|
|
645
|
+
Dy: ({ value }, ctx) => setDataAttr(ctx, 'dy', value),
|
|
646
|
+
Rotate: ({ value }, ctx) => setDataAttr(ctx, 'rotate', value),
|
|
647
|
+
TextAnchor: ({ value }, ctx) => setDataAttr(ctx, 'text-anchor', value),
|
|
648
|
+
DominantBaseline: ({ value }, ctx) => setDataAttr(ctx, 'dominant-baseline', value),
|
|
649
|
+
AlignmentBaseline: ({ value }, ctx) => setDataAttr(ctx, 'alignment-baseline', value),
|
|
650
|
+
BaselineShift: ({ value }, ctx) => setDataAttr(ctx, 'baseline-shift', value),
|
|
651
|
+
TextLength: ({ value }, ctx) => setDataAttr(ctx, 'textLength', value),
|
|
652
|
+
LengthAdjust: ({ value }, ctx) => setDataAttr(ctx, 'lengthAdjust', value),
|
|
653
|
+
FontFamily: ({ value }, ctx) => setDataAttr(ctx, 'font-family', value),
|
|
654
|
+
FontSize: ({ value }, ctx) => setDataAttr(ctx, 'font-size', value),
|
|
655
|
+
FontWeight: ({ value }, ctx) => setDataAttr(ctx, 'font-weight', value),
|
|
656
|
+
FontStyle: ({ value }, ctx) => setDataAttr(ctx, 'font-style', value),
|
|
657
|
+
LetterSpacing: ({ value }, ctx) => setDataAttr(ctx, 'letter-spacing', value),
|
|
658
|
+
WordSpacing: ({ value }, ctx) => setDataAttr(ctx, 'word-spacing', value),
|
|
659
|
+
TextDecoration: ({ value }, ctx) => setDataAttr(ctx, 'text-decoration', value),
|
|
660
|
+
WritingMode: ({ value }, ctx) => setDataAttr(ctx, 'writing-mode', value),
|
|
661
|
+
Rx: ({ value }, ctx) => setDataAttr(ctx, 'rx', value),
|
|
662
|
+
Ry: ({ value }, ctx) => setDataAttr(ctx, 'ry', value),
|
|
663
|
+
PathLength: ({ value }, ctx) => setDataAttr(ctx, 'pathLength', value),
|
|
664
|
+
FillOpacity: ({ value }, ctx) => setDataAttr(ctx, 'fill-opacity', value),
|
|
665
|
+
StrokeOpacity: ({ value }, ctx) => setDataAttr(ctx, 'stroke-opacity', value),
|
|
666
|
+
StrokeMiterlimit: ({ value }, ctx) => setDataAttr(ctx, 'stroke-miterlimit', value),
|
|
667
|
+
PaintOrder: ({ value }, ctx) => setDataAttr(ctx, 'paint-order', value),
|
|
668
|
+
VectorEffect: ({ value }, ctx) => setDataAttr(ctx, 'vector-effect', value),
|
|
669
|
+
Color: ({ value }, ctx) => setDataAttr(ctx, 'color', value),
|
|
670
|
+
Visibility: ({ value }, ctx) => setDataAttr(ctx, 'visibility', value),
|
|
671
|
+
Display: ({ value }, ctx) => setDataAttr(ctx, 'display', value),
|
|
672
|
+
Overflow: ({ value }, ctx) => setDataAttr(ctx, 'overflow', value),
|
|
673
|
+
PointerEvents: ({ value }, ctx) => setDataAttr(ctx, 'pointer-events', value),
|
|
674
|
+
Cursor: ({ value }, ctx) => setDataAttr(ctx, 'cursor', value),
|
|
675
|
+
ShapeRendering: ({ value }, ctx) => setDataAttr(ctx, 'shape-rendering', value),
|
|
676
|
+
TextRendering: ({ value }, ctx) => setDataAttr(ctx, 'text-rendering', value),
|
|
677
|
+
ImageRendering: ({ value }, ctx) => setDataAttr(ctx, 'image-rendering', value),
|
|
678
|
+
ClipPath: ({ value }, ctx) => setDataAttr(ctx, 'clip-path', value),
|
|
679
|
+
Mask: ({ value }, ctx) => setDataAttr(ctx, 'mask', value),
|
|
680
|
+
Filter: ({ value }, ctx) => setDataAttr(ctx, 'filter', value),
|
|
681
|
+
ClipPathUnits: ({ value }, ctx) => setDataAttr(ctx, 'clipPathUnits', value),
|
|
682
|
+
MaskUnits: ({ value }, ctx) => setDataAttr(ctx, 'maskUnits', value),
|
|
683
|
+
MaskContentUnits: ({ value }, ctx) => setDataAttr(ctx, 'maskContentUnits', value),
|
|
684
|
+
FilterUnits: ({ value }, ctx) => setDataAttr(ctx, 'filterUnits', value),
|
|
685
|
+
PrimitiveUnits: ({ value }, ctx) => setDataAttr(ctx, 'primitiveUnits', value),
|
|
686
|
+
Offset: ({ value }, ctx) => setDataAttr(ctx, 'offset', value),
|
|
687
|
+
StopColor: ({ value }, ctx) => setDataAttr(ctx, 'stop-color', value),
|
|
688
|
+
StopOpacity: ({ value }, ctx) => setDataAttr(ctx, 'stop-opacity', value),
|
|
689
|
+
GradientUnits: ({ value }, ctx) => setDataAttr(ctx, 'gradientUnits', value),
|
|
690
|
+
GradientTransform: ({ value }, ctx) => setDataAttr(ctx, 'gradientTransform', value),
|
|
691
|
+
SpreadMethod: ({ value }, ctx) => setDataAttr(ctx, 'spreadMethod', value),
|
|
692
|
+
Fx: ({ value }, ctx) => setDataAttr(ctx, 'fx', value),
|
|
693
|
+
Fy: ({ value }, ctx) => setDataAttr(ctx, 'fy', value),
|
|
694
|
+
Fr: ({ value }, ctx) => setDataAttr(ctx, 'fr', value),
|
|
695
|
+
PatternUnits: ({ value }, ctx) => setDataAttr(ctx, 'patternUnits', value),
|
|
696
|
+
PatternContentUnits: ({ value }, ctx) => setDataAttr(ctx, 'patternContentUnits', value),
|
|
697
|
+
PatternTransform: ({ value }, ctx) => setDataAttr(ctx, 'patternTransform', value),
|
|
698
|
+
MarkerStart: ({ value }, ctx) => setDataAttr(ctx, 'marker-start', value),
|
|
699
|
+
MarkerMid: ({ value }, ctx) => setDataAttr(ctx, 'marker-mid', value),
|
|
700
|
+
MarkerEnd: ({ value }, ctx) => setDataAttr(ctx, 'marker-end', value),
|
|
701
|
+
MarkerWidth: ({ value }, ctx) => setDataAttr(ctx, 'markerWidth', value),
|
|
702
|
+
MarkerHeight: ({ value }, ctx) => setDataAttr(ctx, 'markerHeight', value),
|
|
703
|
+
MarkerUnits: ({ value }, ctx) => setDataAttr(ctx, 'markerUnits', value),
|
|
704
|
+
RefX: ({ value }, ctx) => setDataAttr(ctx, 'refX', value),
|
|
705
|
+
RefY: ({ value }, ctx) => setDataAttr(ctx, 'refY', value),
|
|
706
|
+
Orient: ({ value }, ctx) => setDataAttr(ctx, 'orient', value),
|
|
707
|
+
PreserveAspectRatio: ({ value }, ctx) => setDataAttr(ctx, 'preserveAspectRatio', value),
|
|
708
|
+
Prop: ({ key, value }, ctx) => setDataProp(ctx, key, value),
|
|
709
|
+
OnCustomEvent: ({ name, f: toMessage }, ctx) => updateDataOn(ctx, {
|
|
666
710
|
[name]: (event) => {
|
|
667
711
|
if (event instanceof CustomEvent) {
|
|
668
|
-
ctx.dispatch(
|
|
712
|
+
ctx.dispatch(toMessage(event));
|
|
669
713
|
}
|
|
670
714
|
},
|
|
671
715
|
}),
|
|
672
|
-
OnMount: ({ action }
|
|
716
|
+
OnMount: ({ action }, ctx) => {
|
|
673
717
|
const capturedContext = ctx.getCapturedContext();
|
|
674
718
|
const maybeTracker = Context.getOption(capturedContext, MountTracker);
|
|
675
719
|
const notifyStarted = Option.isSome(maybeTracker)
|
|
@@ -714,7 +758,7 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
714
758
|
},
|
|
715
759
|
};
|
|
716
760
|
},
|
|
717
|
-
OnUnmount: ({ message }
|
|
761
|
+
OnUnmount: ({ message }, ctx) => {
|
|
718
762
|
// NOTE: resolve the boundary wrapping chain eagerly, while the boundary
|
|
719
763
|
// is still live this render. The destroy hook fires during the patch
|
|
720
764
|
// that removes the element, after the Submodel's own destroy hook has
|
|
@@ -734,130 +778,156 @@ const attributeMatcher = Match.type().pipe(Match.tagsExhaustive({
|
|
|
734
778
|
},
|
|
735
779
|
};
|
|
736
780
|
},
|
|
737
|
-
}
|
|
738
|
-
const
|
|
739
|
-
//
|
|
740
|
-
//
|
|
741
|
-
//
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
781
|
+
};
|
|
782
|
+
const applyAttribute = (attribute, ctx) => {
|
|
783
|
+
// NOTE: the mapped record type correlates each handler's attribute
|
|
784
|
+
// parameter with its tag, which TypeScript cannot re-derive at this
|
|
785
|
+
// widened call site.
|
|
786
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
787
|
+
const handler = attributeHandlers[attribute._tag];
|
|
788
|
+
handler(attribute, ctx);
|
|
789
|
+
};
|
|
790
|
+
// NOTE: tolerate the absence of a runtime frame. Static elements
|
|
791
|
+
// (`h.code([h.Class('x')], ['text'])`) and prose fragments built at module
|
|
792
|
+
// top level (`const fragment = inlineCode('foo')` at import time) must
|
|
793
|
+
// construct without an active render frame. They never invoke the fallback
|
|
794
|
+
// dispatcher because they have no event handlers; event-bearing Html
|
|
795
|
+
// constructed outside a render reaches the fallback only at event-fire time,
|
|
796
|
+
// which surfaces a clear error rather than failing at import time. The
|
|
797
|
+
// fallbacks are module-level constants so element construction allocates no
|
|
798
|
+
// per-element closures for them.
|
|
799
|
+
const fallbackDispatch = () => {
|
|
800
|
+
throw new Error('Foldkit: an event-bearing Html attribute fired without an ' +
|
|
801
|
+
'active runtime frame. This typically means an Html element ' +
|
|
802
|
+
'with event handlers (OnClick, OnInput, etc.) was constructed ' +
|
|
803
|
+
'at module top level outside of a view function.');
|
|
804
|
+
};
|
|
805
|
+
const fallbackUnmountResolver = () => () => {
|
|
806
|
+
throw new Error('Foldkit: an OnUnmount attribute fired without an active runtime ' +
|
|
807
|
+
'frame. This typically means an Html element with OnUnmount was ' +
|
|
808
|
+
'constructed at module top level outside of a view function.');
|
|
809
|
+
};
|
|
810
|
+
const currentDispatchOrFallback = () => {
|
|
811
|
+
try {
|
|
812
|
+
return requireDispatch();
|
|
813
|
+
}
|
|
814
|
+
catch {
|
|
815
|
+
return fallbackDispatch;
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
const currentUnmountResolverOrFallback = () => {
|
|
819
|
+
try {
|
|
820
|
+
return requireUnmountResolver();
|
|
821
|
+
}
|
|
822
|
+
catch {
|
|
823
|
+
return fallbackUnmountResolver;
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
const capturedContextOrEmpty = () => {
|
|
827
|
+
try {
|
|
828
|
+
return requireRuntimeContext();
|
|
829
|
+
}
|
|
830
|
+
catch {
|
|
831
|
+
return Context.empty();
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
const attachPostpatchHook = (data, postpatchProps) => {
|
|
835
|
+
data.hook = {
|
|
836
|
+
...data.hook,
|
|
837
|
+
postpatch: (_oldVnode, vnode) => {
|
|
838
|
+
if (vnode.elm) {
|
|
839
|
+
Array.forEach(postpatchProps, ({ propName, value }) => {
|
|
840
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
841
|
+
if (vnode.elm[propName] !== value) {
|
|
842
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
843
|
+
;
|
|
844
|
+
vnode.elm[propName] = value;
|
|
845
|
+
}
|
|
846
|
+
});
|
|
788
847
|
}
|
|
789
|
-
}
|
|
790
|
-
return cachedCapturedContext;
|
|
848
|
+
},
|
|
791
849
|
};
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
//
|
|
799
|
-
//
|
|
800
|
-
//
|
|
801
|
-
//
|
|
850
|
+
};
|
|
851
|
+
const buildVNodeData = (attributes) => {
|
|
852
|
+
const data = { [vnodeDataMaskKey]: 0 };
|
|
853
|
+
if (attributes.length === 0) {
|
|
854
|
+
return data;
|
|
855
|
+
}
|
|
856
|
+
// NOTE: most attributes route through the current frame's dispatch.
|
|
857
|
+
// ChildAttribute items carry a different dispatcher (captured by
|
|
858
|
+
// `childAttributes` in a Submodel's own boundary), so they need their own
|
|
859
|
+
// BuildContext closed over that dispatch. The handler record itself is
|
|
860
|
+
// module-level and shared. The main ctx is built lazily. Static-only
|
|
861
|
+
// attribute arrays (Class, Id, etc. with no event handlers) skip
|
|
862
|
+
// `requireDispatch` entirely so Html can be constructed at module top
|
|
863
|
+
// level. The boundary ctx map is only allocated when a ChildAttribute is
|
|
864
|
+
// actually present.
|
|
802
865
|
let mainCtx;
|
|
803
|
-
|
|
866
|
+
let boundaryCtxByDispatch;
|
|
867
|
+
let sharedPostpatchProps;
|
|
868
|
+
const getSharedPostpatchProps = () => (sharedPostpatchProps ??= []);
|
|
804
869
|
for (const item of attributes) {
|
|
805
870
|
if (isChildAttribute(item)) {
|
|
871
|
+
boundaryCtxByDispatch ??= new Map();
|
|
806
872
|
let ctx = boundaryCtxByDispatch.get(item.dispatch);
|
|
807
873
|
if (ctx === undefined) {
|
|
808
874
|
ctx = {
|
|
809
875
|
data,
|
|
810
|
-
|
|
876
|
+
getPostpatchProps: getSharedPostpatchProps,
|
|
811
877
|
dispatch: item.dispatch,
|
|
812
878
|
resolveUnmount: item.resolveUnmount,
|
|
813
879
|
boundaryMappers: item.boundaryMappers,
|
|
814
|
-
getCapturedContext,
|
|
880
|
+
getCapturedContext: capturedContextOrEmpty,
|
|
815
881
|
};
|
|
816
882
|
boundaryCtxByDispatch.set(item.dispatch, ctx);
|
|
817
883
|
}
|
|
818
884
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
819
|
-
|
|
885
|
+
applyAttribute(item.attribute, ctx);
|
|
820
886
|
}
|
|
821
887
|
else {
|
|
822
888
|
if (mainCtx === undefined) {
|
|
823
889
|
mainCtx = {
|
|
824
890
|
data,
|
|
825
|
-
|
|
826
|
-
dispatch:
|
|
827
|
-
resolveUnmount:
|
|
891
|
+
getPostpatchProps: getSharedPostpatchProps,
|
|
892
|
+
dispatch: currentDispatchOrFallback(),
|
|
893
|
+
resolveUnmount: currentUnmountResolverOrFallback(),
|
|
828
894
|
boundaryMappers: requireBoundaryMappers(),
|
|
829
|
-
getCapturedContext,
|
|
895
|
+
getCapturedContext: capturedContextOrEmpty,
|
|
830
896
|
};
|
|
831
897
|
}
|
|
832
898
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
833
|
-
|
|
899
|
+
applyAttribute(item, mainCtx);
|
|
834
900
|
}
|
|
835
901
|
}
|
|
836
|
-
if (
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
postpatch: (_oldVnode, vnode) => {
|
|
840
|
-
if (vnode.elm) {
|
|
841
|
-
Array.forEach(postpatchProps, ({ propName, value }) => {
|
|
842
|
-
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
843
|
-
if (vnode.elm[propName] !== value) {
|
|
844
|
-
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
845
|
-
;
|
|
846
|
-
vnode.elm[propName] = value;
|
|
847
|
-
}
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
},
|
|
851
|
-
};
|
|
902
|
+
if (sharedPostpatchProps !== undefined &&
|
|
903
|
+
Array.isReadonlyArrayNonEmpty(sharedPostpatchProps)) {
|
|
904
|
+
attachPostpatchHook(data, sharedPostpatchProps);
|
|
852
905
|
}
|
|
853
906
|
return data;
|
|
854
907
|
};
|
|
855
|
-
|
|
856
|
-
|
|
908
|
+
// NOTE: one fresh mutable array per element in a single pass: `h.empty`
|
|
909
|
+
// children (null) are dropped, and snabbdom's `h` converts primitive
|
|
910
|
+
// children to text vnodes in place, so the caller's array must never be
|
|
911
|
+
// handed over directly.
|
|
912
|
+
const copyChildrenDroppingEmpty = (children) => {
|
|
913
|
+
const next = [];
|
|
914
|
+
for (let index = 0; index < children.length; index++) {
|
|
915
|
+
const child = children[index];
|
|
916
|
+
if (child !== null && child !== undefined) {
|
|
917
|
+
next.push(child);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
return next;
|
|
921
|
+
};
|
|
922
|
+
const createElement = (tagName, attributes = [], children = []) => h(tagName, buildVNodeData(attributes), copyChildrenDroppingEmpty(children));
|
|
857
923
|
const element = () => (tagName) => (attributes = [], children = []) => createElement(tagName, attributes, children);
|
|
858
924
|
export const customElement = () => (tagName) => (attributes = [], children = []) => createElement(tagName, attributes, children);
|
|
859
925
|
const voidElement = () => (tagName) => (attributes = []) => createElement(tagName, attributes, []);
|
|
860
|
-
const keyed = () => (tagName) => (key, attributes = [], children = []) =>
|
|
926
|
+
const keyed = () => (tagName) => (key, attributes = [], children = []) => {
|
|
927
|
+
const data = buildVNodeData(attributes);
|
|
928
|
+
data.key = key;
|
|
929
|
+
return h(tagName, data, copyChildrenDroppingEmpty(children));
|
|
930
|
+
};
|
|
861
931
|
const htmlElements = () => {
|
|
862
932
|
const el = element();
|
|
863
933
|
const voidEl = voidElement();
|
|
@@ -1137,12 +1207,12 @@ const htmlAttributes = () => ({
|
|
|
1137
1207
|
OnMouseOver: (message) => OnMouseOver({ message }),
|
|
1138
1208
|
OnMouseOut: (message) => OnMouseOut({ message }),
|
|
1139
1209
|
OnMouseMove: (message) => OnMouseMove({ message }),
|
|
1140
|
-
OnPointerMove: (
|
|
1141
|
-
OnPointerLeave: (
|
|
1142
|
-
OnPointerDown: (
|
|
1143
|
-
OnPointerUp: (
|
|
1144
|
-
OnKeyDown: (
|
|
1145
|
-
OnKeyDownPreventDefault: (
|
|
1210
|
+
OnPointerMove: (toMaybeMessage) => OnPointerMove({ f: toMaybeMessage }),
|
|
1211
|
+
OnPointerLeave: (toMaybeMessage) => OnPointerLeave({ f: toMaybeMessage }),
|
|
1212
|
+
OnPointerDown: (toMaybeMessage) => OnPointerDown({ f: toMaybeMessage }),
|
|
1213
|
+
OnPointerUp: (toMaybeMessage) => OnPointerUp({ f: toMaybeMessage }),
|
|
1214
|
+
OnKeyDown: (toMessage) => OnKeyDown({ f: toMessage }),
|
|
1215
|
+
OnKeyDownPreventDefault: (toMaybeMessage) => OnKeyDownPreventDefault({ f: toMaybeMessage }),
|
|
1146
1216
|
/**
|
|
1147
1217
|
* Keydown handler that, for a handled key, synchronously focuses the element
|
|
1148
1218
|
* matching `focusSelector` and dispatches `message`, both inside the
|
|
@@ -1165,18 +1235,18 @@ const htmlAttributes = () => ({
|
|
|
1165
1235
|
* )
|
|
1166
1236
|
* ```
|
|
1167
1237
|
*/
|
|
1168
|
-
OnKeyDownFocus: (
|
|
1169
|
-
OnKeyUp: (
|
|
1170
|
-
OnKeyUpPreventDefault: (
|
|
1171
|
-
OnKeyPress: (
|
|
1238
|
+
OnKeyDownFocus: (toMaybeFocusAndMessage) => OnKeyDownFocus({ f: toMaybeFocusAndMessage }),
|
|
1239
|
+
OnKeyUp: (toMessage) => OnKeyUp({ f: toMessage }),
|
|
1240
|
+
OnKeyUpPreventDefault: (toMaybeMessage) => OnKeyUpPreventDefault({ f: toMaybeMessage }),
|
|
1241
|
+
OnKeyPress: (toMessage) => OnKeyPress({ f: toMessage }),
|
|
1172
1242
|
OnFocus: (message) => OnFocus({ message }),
|
|
1173
1243
|
OnBlur: (message) => OnBlur({ message }),
|
|
1174
|
-
OnInput: (
|
|
1175
|
-
OnChange: (
|
|
1176
|
-
OnFileChange: (
|
|
1244
|
+
OnInput: (toMessage) => OnInput({ f: toMessage }),
|
|
1245
|
+
OnChange: (toMessage) => OnChange({ f: toMessage }),
|
|
1246
|
+
OnFileChange: (toMessage) => OnFileChange({ f: toMessage }),
|
|
1177
1247
|
OnSubmit: (message) => OnSubmit({ message }),
|
|
1178
1248
|
OnReset: (message) => OnReset({ message }),
|
|
1179
|
-
OnScroll: (
|
|
1249
|
+
OnScroll: (toMessage) => OnScroll({ f: toMessage }),
|
|
1180
1250
|
OnWheel: (message) => OnWheel({ message }),
|
|
1181
1251
|
OnCopy: (message) => OnCopy({ message }),
|
|
1182
1252
|
OnCut: (message) => OnCut({ message }),
|
|
@@ -1198,7 +1268,7 @@ const htmlAttributes = () => ({
|
|
|
1198
1268
|
* h.OnPastePreventDefault(text => Option.some(PastedText({ text })))
|
|
1199
1269
|
* ```
|
|
1200
1270
|
*/
|
|
1201
|
-
OnPastePreventDefault: (
|
|
1271
|
+
OnPastePreventDefault: (toMaybeMessage) => OnPastePreventDefault({ f: toMaybeMessage }),
|
|
1202
1272
|
/**
|
|
1203
1273
|
* Copy handler that synchronously writes `text` to the clipboard as
|
|
1204
1274
|
* `text/plain` and calls `preventDefault`, replacing the browser's default
|
|
@@ -1227,7 +1297,7 @@ const htmlAttributes = () => ({
|
|
|
1227
1297
|
*/
|
|
1228
1298
|
OnCutText: (text, message) => OnCutText({ text, message }),
|
|
1229
1299
|
OnCancel: (message) => OnCancel({ message }),
|
|
1230
|
-
OnToggle: (
|
|
1300
|
+
OnToggle: (toMessage) => OnToggle({ f: toMessage }),
|
|
1231
1301
|
OnContextMenu: (message) => OnContextMenu({ message }),
|
|
1232
1302
|
OnDragStart: (message) => OnDragStart({ message }),
|
|
1233
1303
|
OnDrag: (message) => OnDrag({ message }),
|
|
@@ -1237,7 +1307,7 @@ const htmlAttributes = () => ({
|
|
|
1237
1307
|
OnDragOver: (message) => OnDragOver({ message }),
|
|
1238
1308
|
AllowDrop: () => AllowDrop(),
|
|
1239
1309
|
OnDrop: (message) => OnDrop({ message }),
|
|
1240
|
-
OnDropFiles: (
|
|
1310
|
+
OnDropFiles: (toMessage) => OnDropFiles({ f: toMessage }),
|
|
1241
1311
|
OnTouchStart: (message) => OnTouchStart({ message }),
|
|
1242
1312
|
OnTouchEnd: (message) => OnTouchEnd({ message }),
|
|
1243
1313
|
OnTouchMove: (message) => OnTouchMove({ message }),
|