foldkit 0.101.0 → 0.102.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 +2 -1
- package/dist/canvas/view.d.ts +1 -1
- package/dist/canvas/view.d.ts.map +1 -1
- package/dist/canvas/view.js +5 -5
- package/dist/command/index.d.ts +71 -0
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +34 -1
- package/dist/command/public.d.ts +1 -1
- package/dist/command/public.d.ts.map +1 -1
- package/dist/command/public.js +1 -1
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +137 -110
- package/dist/dom/dom.d.ts +8 -11
- package/dist/dom/dom.d.ts.map +1 -1
- package/dist/dom/dom.js +8 -11
- package/dist/dom/elementMovement.d.ts +1 -3
- package/dist/dom/elementMovement.d.ts.map +1 -1
- package/dist/dom/elementMovement.js +1 -3
- package/dist/dom/inert.d.ts +2 -4
- package/dist/dom/inert.d.ts.map +1 -1
- package/dist/dom/inert.js +2 -4
- package/dist/dom/scrollLock.d.ts +2 -2
- package/dist/dom/scrollLock.js +2 -2
- package/dist/dom/waitForAnimation.d.ts +1 -1
- package/dist/dom/waitForAnimation.js +1 -1
- package/dist/html/boundary.d.ts +98 -0
- package/dist/html/boundary.d.ts.map +1 -0
- package/dist/html/boundary.js +176 -0
- package/dist/html/childAttribute.d.ts +44 -0
- package/dist/html/childAttribute.d.ts.map +1 -0
- package/dist/html/childAttribute.js +34 -0
- package/dist/html/index.d.ts +70 -23
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +639 -575
- package/dist/html/lazy.d.ts +12 -7
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +30 -11
- package/dist/html/public.d.ts +2 -2
- package/dist/html/public.d.ts.map +1 -1
- package/dist/html/public.js +1 -1
- package/dist/html/runtimeSingleton.d.ts +72 -0
- package/dist/html/runtimeSingleton.d.ts.map +1 -0
- package/dist/html/runtimeSingleton.js +112 -0
- package/dist/html/submodel.d.ts +98 -0
- package/dist/html/submodel.d.ts.map +1 -0
- package/dist/html/submodel.js +190 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/render/render.d.ts +1 -1
- package/dist/render/render.js +1 -1
- package/dist/runtime/messagePriority.d.ts +5 -1
- package/dist/runtime/messagePriority.d.ts.map +1 -1
- package/dist/runtime/messagePriority.js +25 -4
- package/dist/runtime/runtime.d.ts +3 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +123 -67
- package/dist/submodel/public.d.ts +4 -0
- package/dist/submodel/public.d.ts.map +1 -0
- package/dist/submodel/public.js +1 -0
- package/dist/submodel/submodel.d.ts +32 -0
- package/dist/submodel/submodel.d.ts.map +1 -0
- package/dist/submodel/submodel.js +1 -0
- package/dist/test/apps/disabledButton.d.ts +4 -5
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +16 -16
- package/dist/test/scene.d.ts +8 -8
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +25 -13
- package/dist/test/story.d.ts +15 -8
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +21 -9
- package/dist/ui/animation/index.d.ts +30 -14
- package/dist/ui/animation/index.d.ts.map +1 -1
- package/dist/ui/animation/index.js +9 -19
- package/dist/ui/animation/public.d.ts +2 -2
- package/dist/ui/animation/public.d.ts.map +1 -1
- package/dist/ui/animation/public.js +1 -1
- package/dist/ui/calendar/index.d.ts +199 -84
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +129 -140
- package/dist/ui/calendar/public.d.ts +2 -2
- package/dist/ui/calendar/public.d.ts.map +1 -1
- package/dist/ui/calendar/public.js +1 -1
- package/dist/ui/checkbox/index.d.ts +93 -21
- package/dist/ui/checkbox/index.d.ts.map +1 -1
- package/dist/ui/checkbox/index.js +62 -33
- package/dist/ui/checkbox/public.d.ts +2 -2
- package/dist/ui/checkbox/public.d.ts.map +1 -1
- package/dist/ui/checkbox/public.js +1 -1
- package/dist/ui/combobox/multi.d.ts +35 -91
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/multi.js +34 -17
- package/dist/ui/combobox/multiPublic.d.ts +2 -2
- package/dist/ui/combobox/multiPublic.d.ts.map +1 -1
- package/dist/ui/combobox/multiPublic.js +1 -1
- package/dist/ui/combobox/public.d.ts +3 -3
- package/dist/ui/combobox/public.d.ts.map +1 -1
- package/dist/ui/combobox/public.js +2 -2
- package/dist/ui/combobox/shared.d.ts +56 -31
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +333 -322
- package/dist/ui/combobox/single.d.ts +46 -93
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/combobox/single.js +44 -17
- package/dist/ui/datePicker/index.d.ts +256 -48
- package/dist/ui/datePicker/index.d.ts.map +1 -1
- package/dist/ui/datePicker/index.js +149 -104
- package/dist/ui/datePicker/public.d.ts +2 -2
- package/dist/ui/datePicker/public.d.ts.map +1 -1
- package/dist/ui/datePicker/public.js +1 -1
- package/dist/ui/dialog/index.d.ts +95 -39
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +71 -62
- package/dist/ui/dialog/public.d.ts +2 -2
- package/dist/ui/dialog/public.d.ts.map +1 -1
- package/dist/ui/dialog/public.js +1 -1
- package/dist/ui/disclosure/index.d.ts +71 -31
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +57 -62
- package/dist/ui/disclosure/public.d.ts +2 -2
- package/dist/ui/disclosure/public.d.ts.map +1 -1
- package/dist/ui/disclosure/public.js +1 -1
- package/dist/ui/dragAndDrop/index.d.ts +6 -6
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +7 -7
- package/dist/ui/dragAndDrop/public.d.ts +1 -1
- package/dist/ui/dragAndDrop/public.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/public.js +1 -1
- package/dist/ui/fileDrop/index.d.ts +42 -46
- package/dist/ui/fileDrop/index.d.ts.map +1 -1
- package/dist/ui/fileDrop/index.js +30 -46
- package/dist/ui/fileDrop/public.d.ts +2 -2
- package/dist/ui/fileDrop/public.d.ts.map +1 -1
- package/dist/ui/fileDrop/public.js +1 -1
- package/dist/ui/listbox/multi.d.ts +39 -84
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/multi.js +38 -20
- package/dist/ui/listbox/multiPublic.d.ts +2 -2
- package/dist/ui/listbox/multiPublic.d.ts.map +1 -1
- package/dist/ui/listbox/multiPublic.js +1 -1
- package/dist/ui/listbox/public.d.ts +3 -3
- package/dist/ui/listbox/public.d.ts.map +1 -1
- package/dist/ui/listbox/public.js +2 -2
- package/dist/ui/listbox/shared.d.ts +71 -30
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +319 -296
- package/dist/ui/listbox/single.d.ts +57 -85
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/listbox/single.js +48 -24
- package/dist/ui/menu/index.d.ts +80 -36
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +117 -86
- package/dist/ui/menu/public.d.ts +2 -2
- package/dist/ui/menu/public.d.ts.map +1 -1
- package/dist/ui/menu/public.js +1 -1
- package/dist/ui/popover/index.d.ts +117 -44
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +88 -101
- package/dist/ui/popover/public.d.ts +2 -2
- package/dist/ui/popover/public.d.ts.map +1 -1
- package/dist/ui/popover/public.js +1 -1
- package/dist/ui/radioGroup/index.d.ts +122 -45
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +111 -72
- package/dist/ui/radioGroup/public.d.ts +2 -2
- package/dist/ui/radioGroup/public.d.ts.map +1 -1
- package/dist/ui/radioGroup/public.js +1 -1
- package/dist/ui/slider/index.d.ts +72 -34
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +40 -49
- package/dist/ui/slider/public.d.ts +2 -2
- package/dist/ui/slider/public.d.ts.map +1 -1
- package/dist/ui/slider/public.js +1 -1
- package/dist/ui/switch/index.d.ts +74 -21
- package/dist/ui/switch/index.d.ts.map +1 -1
- package/dist/ui/switch/index.js +62 -33
- package/dist/ui/switch/public.d.ts +2 -2
- package/dist/ui/switch/public.d.ts.map +1 -1
- package/dist/ui/switch/public.js +1 -1
- package/dist/ui/tabs/index.d.ts +107 -45
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +99 -81
- package/dist/ui/tabs/public.d.ts +2 -2
- package/dist/ui/tabs/public.d.ts.map +1 -1
- package/dist/ui/tabs/public.js +1 -1
- package/dist/ui/toast/index.d.ts +93 -109
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +16 -29
- package/dist/ui/toast/schema.d.ts +15 -4
- package/dist/ui/toast/schema.d.ts.map +1 -1
- package/dist/ui/toast/schema.js +11 -4
- package/dist/ui/toast/update.d.ts +36 -18
- package/dist/ui/toast/update.d.ts.map +1 -1
- package/dist/ui/toast/update.js +33 -14
- package/dist/ui/tooltip/index.d.ts +94 -42
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +64 -73
- package/dist/ui/tooltip/public.d.ts +2 -2
- package/dist/ui/tooltip/public.d.ts.map +1 -1
- package/dist/ui/tooltip/public.js +1 -1
- package/dist/ui/virtualList/index.d.ts +18 -41
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +17 -37
- package/dist/ui/virtualList/public.d.ts +2 -2
- package/dist/ui/virtualList/public.d.ts.map +1 -1
- package/dist/ui/virtualList/public.js +1 -1
- package/dist/vdom.d.ts +3 -2
- package/dist/vdom.d.ts.map +1 -1
- package/dist/vdom.js +44 -0
- package/package.json +1 -1
package/dist/devTools/overlay.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Array as Array_, Context, Effect, Equal, Function, HashSet, Match as M,
|
|
|
3
3
|
import * as Command from '../command/index.js';
|
|
4
4
|
import { lockScroll, unlockScroll } from '../dom/scrollLock.js';
|
|
5
5
|
import { OptionExt } from '../effectExtensions/index.js';
|
|
6
|
-
import { DEVTOOLS_HOST_ID, createKeyedLazy, createLazy, html, } from '../html/index.js';
|
|
6
|
+
import { DEVTOOLS_HOST_ID, childAttributes, createKeyedLazy, createLazy, html, } from '../html/index.js';
|
|
7
7
|
import { m } from '../message/index.js';
|
|
8
8
|
import { makeProgram } from '../runtime/runtime.js';
|
|
9
9
|
import * as Subscription from '../runtime/subscription.js';
|
|
@@ -15,6 +15,7 @@ import { overlayStyles } from './overlay-styles.js';
|
|
|
15
15
|
import { toInspectableValue } from './serialize.js';
|
|
16
16
|
import { INIT_INDEX, } from './store.js';
|
|
17
17
|
import { GOT_MESSAGE_PATTERN, extractSubmodelInfo, isTagged, } from './submodelPath.js';
|
|
18
|
+
const SubmodelFilterListbox = Listbox.create();
|
|
18
19
|
// MODEL
|
|
19
20
|
const DisplayCommand = S.Struct({
|
|
20
21
|
name: S.String,
|
|
@@ -43,6 +44,13 @@ const InspectorTabsModel = S.Struct({
|
|
|
43
44
|
focusedIndex: S.Number,
|
|
44
45
|
activationMode: S.Literals(['Automatic', 'Manual']),
|
|
45
46
|
});
|
|
47
|
+
const INSPECTOR_TABS = [
|
|
48
|
+
'Model',
|
|
49
|
+
'Message',
|
|
50
|
+
'Commands',
|
|
51
|
+
'Mounts',
|
|
52
|
+
];
|
|
53
|
+
const InspectorTabs = Tabs.create();
|
|
46
54
|
/**
|
|
47
55
|
* `S.Unknown` whose equivalence is reference equality. Effect 4's default
|
|
48
56
|
* equivalence for `S.Unknown` is `Equal.equals`, which walks the value
|
|
@@ -133,9 +141,6 @@ const ReceivedStoreUpdate = m('ReceivedStoreUpdate', {
|
|
|
133
141
|
const GotSubmodelFilterMessage = m('GotSubmodelFilterMessage', {
|
|
134
142
|
message: Listbox.Message,
|
|
135
143
|
});
|
|
136
|
-
const SelectedSubmodelFilter = m('SelectedSubmodelFilter', {
|
|
137
|
-
tag: S.String,
|
|
138
|
-
});
|
|
139
144
|
// NOTE: suspend for the same init-order reason as scrubberSlider above.
|
|
140
145
|
const GotScrubberSliderMessage = m('GotScrubberSliderMessage', {
|
|
141
146
|
message: S.suspend(() => Slider.Message),
|
|
@@ -160,7 +165,6 @@ const Message = S.Union([
|
|
|
160
165
|
GotInspectorTabsMessage,
|
|
161
166
|
ReceivedStoreUpdate,
|
|
162
167
|
GotSubmodelFilterMessage,
|
|
163
|
-
SelectedSubmodelFilter,
|
|
164
168
|
GotScrubberSliderMessage,
|
|
165
169
|
]);
|
|
166
170
|
// HELPERS
|
|
@@ -224,7 +228,6 @@ const objectPreview = (value) => pipe(value, Record.keys, Array_.filter(key => k
|
|
|
224
228
|
},
|
|
225
229
|
}));
|
|
226
230
|
const collapsedPreview = (value) => M.value(value).pipe(M.when(Array.isArray, array => `(${array.length})`), M.when(Predicate.isObject, objectPreview), M.orElse(() => ''));
|
|
227
|
-
// UPDATE
|
|
228
231
|
class StoreService extends Context.Service()('foldkit/DevToolsStore') {
|
|
229
232
|
}
|
|
230
233
|
class ShadowRootService extends Context.Service()('foldkit/DevToolsShadowRoot') {
|
|
@@ -361,14 +364,14 @@ const makeUpdate = (store, shadow, mode) => {
|
|
|
361
364
|
[],
|
|
362
365
|
],
|
|
363
366
|
GotInspectorTabsMessage: ({ message: tabsMessage }) => {
|
|
364
|
-
const [nextTabsModel, tabsCommands] =
|
|
367
|
+
const [nextTabsModel, tabsCommands] = InspectorTabs.update(model.inspectorTabs,
|
|
365
368
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
366
369
|
tabsMessage);
|
|
367
370
|
return [
|
|
368
371
|
evo(model, {
|
|
369
372
|
inspectorTabs: () => nextTabsModel,
|
|
370
373
|
}),
|
|
371
|
-
|
|
374
|
+
Command.mapMessages(tabsCommands, innerMessage => GotInspectorTabsMessage({ message: innerMessage })),
|
|
372
375
|
];
|
|
373
376
|
},
|
|
374
377
|
ToggledTreeNode: ({ path }) => [
|
|
@@ -409,7 +412,7 @@ const makeUpdate = (store, shadow, mode) => {
|
|
|
409
412
|
const targetSliderValue = isPaused
|
|
410
413
|
? hostIndexToSliderValue(pausedAtIndex, startIndex)
|
|
411
414
|
: sliderMax;
|
|
412
|
-
return Slider.
|
|
415
|
+
return Slider.reflectValue(Slider.reflectRange(current, { min: 0, max: sliderMax }), targetSliderValue);
|
|
413
416
|
},
|
|
414
417
|
}),
|
|
415
418
|
[
|
|
@@ -419,27 +422,27 @@ const makeUpdate = (store, shadow, mode) => {
|
|
|
419
422
|
];
|
|
420
423
|
},
|
|
421
424
|
GotSubmodelFilterMessage: ({ message: listboxMessage }) => {
|
|
422
|
-
const [nextListboxModel, listboxCommands] =
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
425
|
+
const [nextListboxModel, listboxCommands, maybeOutMessage] = SubmodelFilterListbox.update(model.submodelFilterListbox, listboxMessage);
|
|
426
|
+
const mappedCommands = Command.mapMessages(listboxCommands, innerMessage => GotSubmodelFilterMessage({ message: innerMessage }));
|
|
427
|
+
return Option.match(maybeOutMessage, {
|
|
428
|
+
onNone: () => [
|
|
429
|
+
evo(model, { submodelFilterListbox: () => nextListboxModel }),
|
|
430
|
+
mappedCommands,
|
|
431
|
+
],
|
|
432
|
+
onSome: M.type().pipe(M.withReturnType(), M.tagsExhaustive({
|
|
433
|
+
Selected: ({ value }) => [
|
|
434
|
+
evo(model, {
|
|
435
|
+
maybeSubmodelFilter: () => Option.liftPredicate(value, String_.isNonEmpty),
|
|
436
|
+
submodelFilterListbox: () => nextListboxModel,
|
|
437
|
+
}),
|
|
438
|
+
mappedCommands,
|
|
439
|
+
],
|
|
440
|
+
})),
|
|
441
|
+
});
|
|
439
442
|
},
|
|
440
443
|
GotScrubberSliderMessage: ({ message: sliderMessage }) => {
|
|
441
444
|
const [nextSlider, sliderCommands, maybeOutMessage] = Slider.update(model.scrubberSlider, sliderMessage);
|
|
442
|
-
const mappedSliderCommands =
|
|
445
|
+
const mappedSliderCommands = Command.mapMessages(sliderCommands, innerMessage => GotScrubberSliderMessage({ message: innerMessage }));
|
|
443
446
|
const additionalCommands = Option.match(maybeOutMessage, {
|
|
444
447
|
onNone: () => [],
|
|
445
448
|
onSome: outMessage => M.value(outMessage).pipe(M.tagsExhaustive({
|
|
@@ -502,14 +505,23 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
502
505
|
const lazyTabContent = createKeyedLazy();
|
|
503
506
|
const lazyMessageList = createLazy();
|
|
504
507
|
// JSON TREE
|
|
505
|
-
const leafValueView = (value) => M.value(value).pipe(M.when(Predicate.isNull, () => h.span([h.Class('json-null italic')], ['null'])), M.when(Predicate.isUndefined, () => h.span([h.Class('json-null italic')], ['undefined'])), M.when(Predicate.isString, stringValue => h.span([h.Class('json-string')], [`"${stringValue}"`])), M.when(Predicate.isNumber, numberValue => h.span([h.Class('json-number')], [String(numberValue)])), M.when(Predicate.isBoolean, booleanValue => h.span([h.Class('json-boolean')], [String(booleanValue)])), M.orElse(unknownValue => h.span([h.Class('json-null')], [String(unknownValue)])));
|
|
506
|
-
|
|
508
|
+
const leafValueView = (value) => M.value(value).pipe(M.when(Predicate.isNull, () => h.span([h.Key('value'), h.Class('json-null italic')], ['null'])), M.when(Predicate.isUndefined, () => h.span([h.Key('value'), h.Class('json-null italic')], ['undefined'])), M.when(Predicate.isString, stringValue => h.span([h.Key('value'), h.Class('json-string')], [`"${stringValue}"`])), M.when(Predicate.isNumber, numberValue => h.span([h.Key('value'), h.Class('json-number')], [String(numberValue)])), M.when(Predicate.isBoolean, booleanValue => h.span([h.Key('value'), h.Class('json-boolean')], [String(booleanValue)])), M.orElse(unknownValue => h.span([h.Key('value'), h.Class('json-null')], [String(unknownValue)])));
|
|
509
|
+
// NOTE: each row-child view declares an explicit key. snabbdom's
|
|
510
|
+
// `sameVnode` only checks `key + sel`, and foldkit element vnodes carry
|
|
511
|
+
// `sel = tagName` with classes stored in `data.class`. Without per-role
|
|
512
|
+
// keys, two unkeyed spans with different classes (e.g. `.json-key` and
|
|
513
|
+
// `.diff-dot`) are sameVnode to snabbdom, so a single DOM span gets
|
|
514
|
+
// recycled across roles as rows transition shape \u2014 and the text-node
|
|
515
|
+
// children from the old role can leak into the new role's element.
|
|
516
|
+
// Keying by role pins each slot to its own DOM element.
|
|
517
|
+
const keyView = (key) => h.span([h.Key('key'), h.Class('json-key')], [`${key}:\u00a0`]);
|
|
507
518
|
const CHEVRON_RIGHT = 'M8.25 4.5l7.5 7.5-7.5 7.5';
|
|
508
519
|
const CHEVRON_DOWN = 'M19.5 8.25l-7.5 7.5-7.5-7.5';
|
|
509
520
|
const arrowView = (isExpanded) => h.svg([
|
|
521
|
+
h.Key('arrow'),
|
|
510
522
|
h.AriaHidden(true),
|
|
511
523
|
h.Class('json-arrow shrink-0'),
|
|
512
|
-
h.Xmlns('http://www.w3.org/2000/
|
|
524
|
+
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
513
525
|
h.Fill('none'),
|
|
514
526
|
h.ViewBox('0 0 24 24'),
|
|
515
527
|
h.StrokeWidth('2'),
|
|
@@ -521,8 +533,8 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
521
533
|
h.D(isExpanded ? CHEVRON_DOWN : CHEVRON_RIGHT),
|
|
522
534
|
], []),
|
|
523
535
|
]);
|
|
524
|
-
const tagLabelView = (tag) => h.span([h.Class('json-tag')], [tag]);
|
|
525
|
-
const diffDotView = h.span([h.Class('diff-dot')], []);
|
|
536
|
+
const tagLabelView = (tag) => h.span([h.Key('tag'), h.Class('json-tag')], [tag]);
|
|
537
|
+
const diffDotView = h.span([h.Key('diffdot'), h.Class('diff-dot')], []);
|
|
526
538
|
const inlineDiffDotView = h.span([h.Class('diff-dot-inline')], []);
|
|
527
539
|
const flattenTree = ({ value, treePath, depth, key, ...shared }) => {
|
|
528
540
|
const { rootPath, expandedPaths, changedPaths, affectedPaths, accumulator, indentRootChildren, } = shared;
|
|
@@ -599,7 +611,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
599
611
|
...(!isRoot && hasDiffDot ? [diffDotView] : []),
|
|
600
612
|
...(String_.isNonEmpty(key) ? [keyView(key)] : []),
|
|
601
613
|
...(String_.isNonEmpty(tag) ? [tagLabelView(tag)] : []),
|
|
602
|
-
h.span([h.Class('json-preview')], [preview]),
|
|
614
|
+
h.span([h.Key('value'), h.Class('json-preview')], [preview]),
|
|
603
615
|
]);
|
|
604
616
|
};
|
|
605
617
|
const renderFlatNode = (node) => lazyTreeNode(node.treePath, flatNodeView, [
|
|
@@ -653,15 +665,9 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
653
665
|
const emptyInspectorView = h.div([
|
|
654
666
|
h.Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
655
667
|
], ['Click a message to inspect']);
|
|
656
|
-
const INSPECTOR_TABS = [
|
|
657
|
-
'Model',
|
|
658
|
-
'Message',
|
|
659
|
-
'Commands',
|
|
660
|
-
'Mounts',
|
|
661
|
-
];
|
|
662
668
|
const noMessageView = h.div([
|
|
663
669
|
h.Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
664
|
-
], ['init
|
|
670
|
+
], ['init: no Message']);
|
|
665
671
|
const modelTabContent = (inspectedModel, expandedPaths, changedPaths, affectedPaths) => treeView(inspectedModel, 'root', expandedPaths, changedPaths, affectedPaths, Option.none(), true);
|
|
666
672
|
const unwrapIfFiltered = (message, maybeSubmodelFilter) => {
|
|
667
673
|
if (Option.isNone(maybeSubmodelFilter)) {
|
|
@@ -836,25 +842,36 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
836
842
|
const inspectorPaneView = (model) => h.div([
|
|
837
843
|
h.Class('flex flex-col border-l min-w-0 min-h-0 flex-1 dt-inspector-pane'),
|
|
838
844
|
], [
|
|
839
|
-
|
|
845
|
+
h.submodel({
|
|
846
|
+
slotId: model.inspectorTabs.id,
|
|
840
847
|
model: model.inspectorTabs,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
848
|
+
view: InspectorTabs.view,
|
|
849
|
+
viewInputs: {
|
|
850
|
+
tabs: INSPECTOR_TABS,
|
|
851
|
+
ariaLabel: 'Inspector tabs',
|
|
852
|
+
toView: ({ tablist, tabs, activeIndex }) => h.div([h.Class('flex flex-col flex-1 min-h-0')], [
|
|
853
|
+
h.div([...tablist, h.Class('flex border-b shrink-0')], tabs.map(tab => h.button([
|
|
854
|
+
...tab.tab,
|
|
855
|
+
h.Class(clsx('dt-tab-button cursor-pointer text-base font-mono px-3 py-1', tab.isActive
|
|
856
|
+
? 'text-dt dt-tab-active'
|
|
857
|
+
: 'text-dt-muted')),
|
|
858
|
+
], [h.span([], [tab.value])]))),
|
|
859
|
+
...tabs.map(tab => h.div([
|
|
860
|
+
...tab.panel,
|
|
861
|
+
h.Class('flex flex-col flex-1 min-h-0 min-w-0'),
|
|
862
|
+
h.Hidden(tab.index !== activeIndex),
|
|
863
|
+
...(tab.index === activeIndex
|
|
864
|
+
? []
|
|
865
|
+
: [h.Style({ display: 'none' })]),
|
|
866
|
+
], [
|
|
867
|
+
Option.match(model.maybeInspectedModel, {
|
|
868
|
+
onNone: () => emptyInspectorView,
|
|
869
|
+
onSome: inspectedModel => inspectorTabContent(model, tab.value, inspectedModel),
|
|
870
|
+
}),
|
|
871
|
+
])),
|
|
872
|
+
]),
|
|
873
|
+
},
|
|
874
|
+
toParentMessage: message => GotInspectorTabsMessage({ message }),
|
|
858
875
|
}),
|
|
859
876
|
]);
|
|
860
877
|
// MESSAGE LIST
|
|
@@ -866,7 +883,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
866
883
|
model.isOpen
|
|
867
884
|
? h.svg([
|
|
868
885
|
h.AriaHidden(true),
|
|
869
|
-
h.Xmlns('http://www.w3.org/2000/
|
|
886
|
+
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
870
887
|
h.Fill('none'),
|
|
871
888
|
h.ViewBox('0 0 24 24'),
|
|
872
889
|
h.StrokeWidth('1.5'),
|
|
@@ -892,7 +909,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
892
909
|
const checkIconView = h.svg([
|
|
893
910
|
h.AriaHidden(true),
|
|
894
911
|
h.Class('dt-filter-check shrink-0'),
|
|
895
|
-
h.Xmlns('http://www.w3.org/2000/
|
|
912
|
+
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
896
913
|
h.Fill('none'),
|
|
897
914
|
h.ViewBox('0 0 24 24'),
|
|
898
915
|
h.StrokeWidth('2'),
|
|
@@ -905,7 +922,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
905
922
|
const arrowUpIconView = h.svg([
|
|
906
923
|
h.AriaHidden(true),
|
|
907
924
|
h.Class('dt-scroll-pill-icon shrink-0'),
|
|
908
|
-
h.Xmlns('http://www.w3.org/2000/
|
|
925
|
+
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
909
926
|
h.Fill('none'),
|
|
910
927
|
h.ViewBox('0 0 24 24'),
|
|
911
928
|
h.StrokeWidth('2'),
|
|
@@ -926,38 +943,41 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
926
943
|
onNone: () => 'All Messages',
|
|
927
944
|
onSome: submodelLabel,
|
|
928
945
|
});
|
|
929
|
-
return
|
|
946
|
+
return h.submodel({
|
|
947
|
+
slotId: 'submodel-filter',
|
|
930
948
|
model: model.submodelFilterListbox,
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
949
|
+
view: SubmodelFilterListbox.view,
|
|
950
|
+
viewInputs: {
|
|
951
|
+
items: [ALL_MESSAGES_VALUE, ...model.submodelTags],
|
|
952
|
+
itemToConfig: item => ({
|
|
953
|
+
className: 'dt-filter-item',
|
|
954
|
+
content: h.div([h.Class('flex items-center gap-2')], [checkIconView, h.span([], [filterItemLabel(item)])]),
|
|
955
|
+
}),
|
|
956
|
+
buttonContent: h.span([h.Class('flex flex-1 items-center justify-between')], [
|
|
957
|
+
h.span([], [buttonLabel]),
|
|
958
|
+
h.svg([
|
|
959
|
+
h.AriaHidden(true),
|
|
960
|
+
h.Class('json-arrow shrink-0'),
|
|
961
|
+
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
962
|
+
h.Fill('none'),
|
|
963
|
+
h.ViewBox('0 0 24 24'),
|
|
964
|
+
h.StrokeWidth('2'),
|
|
965
|
+
h.Stroke('currentColor'),
|
|
966
|
+
], [
|
|
967
|
+
h.path([
|
|
968
|
+
h.D(CHEVRON_DOWN),
|
|
969
|
+
h.StrokeLinecap('round'),
|
|
970
|
+
h.StrokeLinejoin('round'),
|
|
971
|
+
], []),
|
|
972
|
+
]),
|
|
954
973
|
]),
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
974
|
+
buttonClassName: 'dt-filter-button',
|
|
975
|
+
itemsClassName: 'dt-filter-items',
|
|
976
|
+
className: 'dt-filter-wrapper',
|
|
977
|
+
attributes: childAttributes([h.Key('submodel-filter')]),
|
|
978
|
+
backdropClassName: 'dt-filter-backdrop',
|
|
979
|
+
},
|
|
980
|
+
toParentMessage: message => GotSubmodelFilterMessage({ message }),
|
|
961
981
|
});
|
|
962
982
|
};
|
|
963
983
|
const headerView = (model) => {
|
|
@@ -1000,7 +1020,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1000
1020
|
const pauseIconView = h.svg([
|
|
1001
1021
|
h.AriaHidden(true),
|
|
1002
1022
|
h.Class('dt-pause-icon'),
|
|
1003
|
-
h.Xmlns('http://www.w3.org/2000/
|
|
1023
|
+
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
1004
1024
|
h.Fill('none'),
|
|
1005
1025
|
h.ViewBox('0 0 24 24'),
|
|
1006
1026
|
h.StrokeWidth('2.5'),
|
|
@@ -1080,28 +1100,35 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1080
1100
|
const current = String(model.scrubberSlider.value).padStart(3, '0');
|
|
1081
1101
|
return `${current} / ${total}`;
|
|
1082
1102
|
};
|
|
1083
|
-
const scrubberView = (model) =>
|
|
1103
|
+
const scrubberView = (model) => h.submodel({
|
|
1104
|
+
slotId: model.scrubberSlider.id,
|
|
1084
1105
|
model: model.scrubberSlider,
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
h.
|
|
1091
|
-
|
|
1092
|
-
h.div([
|
|
1093
|
-
...attributes.root,
|
|
1094
|
-
h.Class('dt-scrubber-control flex-1 flex items-center'),
|
|
1106
|
+
view: Slider.view,
|
|
1107
|
+
viewInputs: {
|
|
1108
|
+
ariaLabel: 'Session scrubber',
|
|
1109
|
+
getTrackRoot: () => shadow,
|
|
1110
|
+
formatValue: value => value === 0 ? 'init' : `Message ${String(value)}`,
|
|
1111
|
+
toView: attributes => h.div([
|
|
1112
|
+
h.Class('dt-scrubber-row flex items-center gap-3 px-3 py-2 border-t shrink-0'),
|
|
1095
1113
|
], [
|
|
1096
|
-
h.div([
|
|
1097
|
-
|
|
1098
|
-
h.
|
|
1114
|
+
h.div([
|
|
1115
|
+
...attributes.root,
|
|
1116
|
+
h.Class('dt-scrubber-control flex-1 flex items-center'),
|
|
1117
|
+
], [
|
|
1118
|
+
h.div([...attributes.track, h.Class('dt-scrubber-track')], [
|
|
1119
|
+
h.div([
|
|
1120
|
+
...attributes.filledTrack,
|
|
1121
|
+
h.Class('dt-scrubber-fill'),
|
|
1122
|
+
], []),
|
|
1123
|
+
h.div([...attributes.thumb, h.Class('dt-scrubber-thumb')], []),
|
|
1124
|
+
]),
|
|
1099
1125
|
]),
|
|
1126
|
+
h.span([
|
|
1127
|
+
h.Class('dt-scrubber-position text-2xs text-dt-muted font-mono shrink-0 tabular-nums'),
|
|
1128
|
+
], [scrubberPositionLabel(model)]),
|
|
1100
1129
|
]),
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
], [scrubberPositionLabel(model)]),
|
|
1104
|
-
]),
|
|
1130
|
+
},
|
|
1131
|
+
toParentMessage: message => GotScrubberSliderMessage({ message }),
|
|
1105
1132
|
});
|
|
1106
1133
|
// PANEL
|
|
1107
1134
|
const isScrubberVisible = mode === 'TimeTravel';
|
package/dist/dom/dom.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ import { ElementNotFound } from './error.js';
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* Dom.focus('#email-input')
|
|
34
|
+
* Dom.focus('#email-input')
|
|
35
35
|
* Dom.focus('#section', { preventScroll: true, makeFocusable: true })
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
@@ -50,8 +50,8 @@ export declare const focus: (selector: string, options?: Readonly<{
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```typescript
|
|
53
|
-
* Dom.showModal('#my-dialog')
|
|
54
|
-
* Dom.showModal('#my-dialog', { focusSelector: '#search-input' })
|
|
53
|
+
* Dom.showModal('#my-dialog')
|
|
54
|
+
* Dom.showModal('#my-dialog', { focusSelector: '#search-input' })
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
57
|
export declare const showModal: (selector: string, options?: Readonly<{
|
|
@@ -64,7 +64,7 @@ export declare const showModal: (selector: string, options?: Readonly<{
|
|
|
64
64
|
*
|
|
65
65
|
* @example
|
|
66
66
|
* ```typescript
|
|
67
|
-
* Dom.closeModal('#my-dialog')
|
|
67
|
+
* Dom.closeModal('#my-dialog')
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
70
|
export declare const closeModal: (selector: string) => Effect.Effect<void, ElementNotFound>;
|
|
@@ -74,7 +74,7 @@ export declare const closeModal: (selector: string) => Effect.Effect<void, Eleme
|
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
76
|
* ```typescript
|
|
77
|
-
* Dom.clickElement('#menu-item-2')
|
|
77
|
+
* Dom.clickElement('#menu-item-2')
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
80
|
export declare const clickElement: (selector: string) => Effect.Effect<void, ElementNotFound>;
|
|
@@ -89,7 +89,7 @@ export declare const clickElement: (selector: string) => Effect.Effect<void, Ele
|
|
|
89
89
|
*
|
|
90
90
|
* @example
|
|
91
91
|
* ```typescript
|
|
92
|
-
* Dom.scrollIntoView('#active-item')
|
|
92
|
+
* Dom.scrollIntoView('#active-item')
|
|
93
93
|
* Dom.scrollIntoView('#section-2', { block: 'start' })
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
@@ -113,10 +113,7 @@ export declare const scrollIntoView: (selector: string, options?: Readonly<{
|
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
115
|
* ```typescript
|
|
116
|
-
* Dom.scrollIntoViewAfterPaint('#overview')
|
|
117
|
-
* Effect.ignore,
|
|
118
|
-
* Effect.as(CompletedScrollIntoViewAfterPaint()),
|
|
119
|
-
* )
|
|
116
|
+
* Dom.scrollIntoViewAfterPaint('#overview')
|
|
120
117
|
* Dom.scrollIntoViewAfterPaint(`#${hash}`, { block: 'start' })
|
|
121
118
|
* ```
|
|
122
119
|
*/
|
|
@@ -131,7 +128,7 @@ export type FocusDirection = 'Next' | 'Previous';
|
|
|
131
128
|
*
|
|
132
129
|
* @example
|
|
133
130
|
* ```typescript
|
|
134
|
-
* Dom.advanceFocus('#menu-button', 'Next')
|
|
131
|
+
* Dom.advanceFocus('#menu-button', 'Next')
|
|
135
132
|
* ```
|
|
136
133
|
*/
|
|
137
134
|
export declare const advanceFocus: (selector: string, direction: FocusDirection) => Effect.Effect<void, ElementNotFound>;
|
package/dist/dom/dom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/dom/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAMP,MAAM,QAAQ,CAAA;AAGf,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6B5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,KAAK,GAChB,UAAU,MAAM,EAChB,UAAU,QAAQ,CAAC;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,KACvE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAQlC,CAAA;AAEJ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU,MAAM,EAChB,UAAU,QAAQ,CAAC;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,KAC7C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAgDlC,CAAA;AAuBJ;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAclC,CAAA;AAEJ;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAKlC,CAAA;AAEJ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,EAChB,UAAU,QAAQ,CAAC;IAAE,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC,KACpD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAKlC,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/dom/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAMP,MAAM,QAAQ,CAAA;AAGf,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6B5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,KAAK,GAChB,UAAU,MAAM,EAChB,UAAU,QAAQ,CAAC;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,KACvE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAQlC,CAAA;AAEJ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU,MAAM,EAChB,UAAU,QAAQ,CAAC;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,KAC7C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAgDlC,CAAA;AAuBJ;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAclC,CAAA;AAEJ;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAKlC,CAAA;AAEJ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,EAChB,UAAU,QAAQ,CAAC;IAAE,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC,KACpD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAKlC,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,MAAM,EAChB,UAAU,QAAQ,CAAC;IAAE,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC,KACpD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAKlC,CAAA;AAEJ,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAA;AAEhD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAChB,WAAW,cAAc,KACxB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAiClC,CAAA"}
|
package/dist/dom/dom.js
CHANGED
|
@@ -49,7 +49,7 @@ const queryHTMLElement = (selector) => Effect.suspend(() => {
|
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
51
|
* ```typescript
|
|
52
|
-
* Dom.focus('#email-input')
|
|
52
|
+
* Dom.focus('#email-input')
|
|
53
53
|
* Dom.focus('#section', { preventScroll: true, makeFocusable: true })
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
@@ -72,8 +72,8 @@ export const focus = (selector, options) => Effect.gen(function* () {
|
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```typescript
|
|
75
|
-
* Dom.showModal('#my-dialog')
|
|
76
|
-
* Dom.showModal('#my-dialog', { focusSelector: '#search-input' })
|
|
75
|
+
* Dom.showModal('#my-dialog')
|
|
76
|
+
* Dom.showModal('#my-dialog', { focusSelector: '#search-input' })
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
export const showModal = (selector, options) => Effect.gen(function* () {
|
|
@@ -132,7 +132,7 @@ const trapFocusWithinDialog = (event, dialog) => {
|
|
|
132
132
|
*
|
|
133
133
|
* @example
|
|
134
134
|
* ```typescript
|
|
135
|
-
* Dom.closeModal('#my-dialog')
|
|
135
|
+
* Dom.closeModal('#my-dialog')
|
|
136
136
|
* ```
|
|
137
137
|
*/
|
|
138
138
|
export const closeModal = (selector) => Effect.suspend(() => {
|
|
@@ -155,7 +155,7 @@ export const closeModal = (selector) => Effect.suspend(() => {
|
|
|
155
155
|
*
|
|
156
156
|
* @example
|
|
157
157
|
* ```typescript
|
|
158
|
-
* Dom.clickElement('#menu-item-2')
|
|
158
|
+
* Dom.clickElement('#menu-item-2')
|
|
159
159
|
* ```
|
|
160
160
|
*/
|
|
161
161
|
export const clickElement = (selector) => Effect.gen(function* () {
|
|
@@ -174,7 +174,7 @@ export const clickElement = (selector) => Effect.gen(function* () {
|
|
|
174
174
|
*
|
|
175
175
|
* @example
|
|
176
176
|
* ```typescript
|
|
177
|
-
* Dom.scrollIntoView('#active-item')
|
|
177
|
+
* Dom.scrollIntoView('#active-item')
|
|
178
178
|
* Dom.scrollIntoView('#section-2', { block: 'start' })
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
@@ -200,10 +200,7 @@ export const scrollIntoView = (selector, options) => Effect.gen(function* () {
|
|
|
200
200
|
*
|
|
201
201
|
* @example
|
|
202
202
|
* ```typescript
|
|
203
|
-
* Dom.scrollIntoViewAfterPaint('#overview')
|
|
204
|
-
* Effect.ignore,
|
|
205
|
-
* Effect.as(CompletedScrollIntoViewAfterPaint()),
|
|
206
|
-
* )
|
|
203
|
+
* Dom.scrollIntoViewAfterPaint('#overview')
|
|
207
204
|
* Dom.scrollIntoViewAfterPaint(`#${hash}`, { block: 'start' })
|
|
208
205
|
* ```
|
|
209
206
|
*/
|
|
@@ -218,7 +215,7 @@ export const scrollIntoViewAfterPaint = (selector, options) => Effect.gen(functi
|
|
|
218
215
|
*
|
|
219
216
|
* @example
|
|
220
217
|
* ```typescript
|
|
221
|
-
* Dom.advanceFocus('#menu-button', 'Next')
|
|
218
|
+
* Dom.advanceFocus('#menu-button', 'Next')
|
|
222
219
|
* ```
|
|
223
220
|
*/
|
|
224
221
|
export const advanceFocus = (selector, direction) => Effect.gen(function* () {
|
|
@@ -12,9 +12,7 @@ import { Effect } from 'effect';
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
15
|
-
* Dom.detectElementMovement('#menu-button')
|
|
16
|
-
* Effect.as(DetectedButtonMovement()),
|
|
17
|
-
* )
|
|
15
|
+
* Dom.detectElementMovement('#menu-button')
|
|
18
16
|
* ```
|
|
19
17
|
*/
|
|
20
18
|
export declare const detectElementMovement: (selector: string) => Effect.Effect<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementMovement.d.ts","sourceRoot":"","sources":["../../src/dom/elementMovement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAM/B
|
|
1
|
+
{"version":3,"file":"elementMovement.d.ts","sourceRoot":"","sources":["../../src/dom/elementMovement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAM/B;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAmCvE,CAAA"}
|
|
@@ -14,9 +14,7 @@ const rectToPosition = (rect) => `${rect.x},${rect.y}`;
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* Dom.detectElementMovement('#menu-button')
|
|
18
|
-
* Effect.as(DetectedButtonMovement()),
|
|
19
|
-
* )
|
|
17
|
+
* Dom.detectElementMovement('#menu-button')
|
|
20
18
|
* ```
|
|
21
19
|
*/
|
|
22
20
|
export const detectElementMovement = (selector) => Effect.gen(function* () {
|
package/dist/dom/inert.d.ts
CHANGED
|
@@ -7,9 +7,7 @@ import { Effect } from 'effect';
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
|
-
* Dom.inertOthers('my-menu', ['#menu-button', '#menu-items'])
|
|
11
|
-
* Effect.as(CompletedSetupInert()),
|
|
12
|
-
* )
|
|
10
|
+
* Dom.inertOthers('my-menu', ['#menu-button', '#menu-items'])
|
|
13
11
|
* ```
|
|
14
12
|
*/
|
|
15
13
|
export declare const inertOthers: (id: string, allowedSelectors: ReadonlyArray<string>) => Effect.Effect<void>;
|
|
@@ -20,7 +18,7 @@ export declare const inertOthers: (id: string, allowedSelectors: ReadonlyArray<s
|
|
|
20
18
|
*
|
|
21
19
|
* @example
|
|
22
20
|
* ```typescript
|
|
23
|
-
* Dom.restoreInert('my-menu')
|
|
21
|
+
* Dom.restoreInert('my-menu')
|
|
24
22
|
* ```
|
|
25
23
|
*/
|
|
26
24
|
export declare const restoreInert: (id: string) => Effect.Effect<void>;
|
package/dist/dom/inert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../src/dom/inert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAA2C,MAAM,QAAQ,CAAA;AAuF/E
|
|
1
|
+
{"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../src/dom/inert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAA2C,MAAM,QAAQ,CAAA;AAuF/E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GACtB,IAAI,MAAM,EACV,kBAAkB,aAAa,CAAC,MAAM,CAAC,KACtC,MAAM,CAAC,MAAM,CAAC,IAAI,CAajB,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAQxD,CAAA"}
|
package/dist/dom/inert.js
CHANGED
|
@@ -56,9 +56,7 @@ const inertableSiblings = (parent, allowedElements) => pipe(parent.children, Arr
|
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* ```typescript
|
|
59
|
-
* Dom.inertOthers('my-menu', ['#menu-button', '#menu-items'])
|
|
60
|
-
* Effect.as(CompletedSetupInert()),
|
|
61
|
-
* )
|
|
59
|
+
* Dom.inertOthers('my-menu', ['#menu-button', '#menu-items'])
|
|
62
60
|
* ```
|
|
63
61
|
*/
|
|
64
62
|
export const inertOthers = (id, allowedSelectors) => Effect.sync(() => {
|
|
@@ -73,7 +71,7 @@ export const inertOthers = (id, allowedSelectors) => Effect.sync(() => {
|
|
|
73
71
|
*
|
|
74
72
|
* @example
|
|
75
73
|
* ```typescript
|
|
76
|
-
* Dom.restoreInert('my-menu')
|
|
74
|
+
* Dom.restoreInert('my-menu')
|
|
77
75
|
* ```
|
|
78
76
|
*/
|
|
79
77
|
export const restoreInert = (id) => Effect.sync(() => {
|
package/dist/dom/scrollLock.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Effect } from 'effect';
|
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```typescript
|
|
12
|
-
* Dom.lockScroll
|
|
12
|
+
* Dom.lockScroll
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
export declare const lockScroll: Effect.Effect<void>;
|
|
@@ -20,7 +20,7 @@ export declare const lockScroll: Effect.Effect<void>;
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```typescript
|
|
23
|
-
* Dom.unlockScroll
|
|
23
|
+
* Dom.unlockScroll
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export declare const unlockScroll: Effect.Effect<void>;
|