foldkit 0.37.0 → 1.1.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.
Files changed (61) hide show
  1. package/dist/command/index.d.ts +20 -16
  2. package/dist/command/index.d.ts.map +1 -1
  3. package/dist/command/index.js +16 -4
  4. package/dist/command/public.d.ts +2 -2
  5. package/dist/command/public.d.ts.map +1 -1
  6. package/dist/command/public.js +1 -1
  7. package/dist/devtools/overlay.d.ts.map +1 -1
  8. package/dist/devtools/overlay.js +25 -17
  9. package/dist/runtime/managedResource.d.ts +1 -1
  10. package/dist/runtime/managedResource.js +1 -1
  11. package/dist/runtime/runtime.d.ts.map +1 -1
  12. package/dist/runtime/runtime.js +2 -2
  13. package/dist/runtime/subscription.d.ts +5 -5
  14. package/dist/runtime/subscription.d.ts.map +1 -1
  15. package/dist/runtime/subscription.js +2 -2
  16. package/dist/task/dom.d.ts +6 -6
  17. package/dist/task/dom.js +6 -6
  18. package/dist/task/inert.d.ts +2 -2
  19. package/dist/task/inert.js +2 -2
  20. package/dist/task/scrollLock.d.ts +2 -2
  21. package/dist/task/scrollLock.js +2 -2
  22. package/dist/task/time.d.ts +1 -1
  23. package/dist/task/time.js +1 -1
  24. package/dist/ui/combobox/multi.d.ts +11 -11
  25. package/dist/ui/combobox/multi.d.ts.map +1 -1
  26. package/dist/ui/combobox/public.d.ts +1 -1
  27. package/dist/ui/combobox/shared.d.ts +29 -30
  28. package/dist/ui/combobox/shared.d.ts.map +1 -1
  29. package/dist/ui/combobox/shared.js +34 -24
  30. package/dist/ui/combobox/single.d.ts +11 -11
  31. package/dist/ui/combobox/single.d.ts.map +1 -1
  32. package/dist/ui/dialog/index.d.ts +7 -7
  33. package/dist/ui/dialog/index.d.ts.map +1 -1
  34. package/dist/ui/dialog/index.js +15 -11
  35. package/dist/ui/dialog/public.d.ts +1 -1
  36. package/dist/ui/dialog/public.js +1 -1
  37. package/dist/ui/disclosure/index.d.ts +4 -4
  38. package/dist/ui/disclosure/index.d.ts.map +1 -1
  39. package/dist/ui/disclosure/index.js +6 -5
  40. package/dist/ui/disclosure/public.d.ts +1 -1
  41. package/dist/ui/listbox/multi.d.ts +11 -11
  42. package/dist/ui/listbox/multi.d.ts.map +1 -1
  43. package/dist/ui/listbox/public.d.ts +1 -1
  44. package/dist/ui/listbox/shared.d.ts +25 -25
  45. package/dist/ui/listbox/shared.d.ts.map +1 -1
  46. package/dist/ui/listbox/shared.js +41 -29
  47. package/dist/ui/listbox/single.d.ts +11 -11
  48. package/dist/ui/listbox/single.d.ts.map +1 -1
  49. package/dist/ui/menu/index.d.ts +16 -16
  50. package/dist/ui/menu/index.d.ts.map +1 -1
  51. package/dist/ui/menu/index.js +46 -34
  52. package/dist/ui/popover/index.d.ts +12 -12
  53. package/dist/ui/popover/index.d.ts.map +1 -1
  54. package/dist/ui/popover/index.js +34 -25
  55. package/dist/ui/radioGroup/index.d.ts +4 -4
  56. package/dist/ui/radioGroup/index.d.ts.map +1 -1
  57. package/dist/ui/radioGroup/index.js +5 -4
  58. package/dist/ui/tabs/index.d.ts +2 -2
  59. package/dist/ui/tabs/index.d.ts.map +1 -1
  60. package/dist/ui/tabs/index.js +6 -5
  61. package/package.json +1 -1
@@ -69,23 +69,23 @@ export const MovedPointerOverItem = m('MovedPointerOverItem', {
69
69
  screenY: S.Number,
70
70
  });
71
71
  /** Sent when the focus-items command completes after opening the menu. */
72
- export const CompletedItemsFocus = m('CompletedItemsFocus');
72
+ export const CompletedFocusItems = m('CompletedFocusItems');
73
73
  /** Sent when the focus-button command completes after closing or selecting. */
74
- export const CompletedButtonFocus = m('CompletedButtonFocus');
74
+ export const CompletedFocusButton = m('CompletedFocusButton');
75
75
  /** Sent when the scroll lock command completes. */
76
- export const CompletedScrollLock = m('CompletedScrollLock');
76
+ export const CompletedLockScroll = m('CompletedLockScroll');
77
77
  /** Sent when the scroll unlock command completes. */
78
- export const CompletedScrollUnlock = m('CompletedScrollUnlock');
78
+ export const CompletedUnlockScroll = m('CompletedUnlockScroll');
79
79
  /** Sent when the inert-others command completes. */
80
- export const CompletedInertSetup = m('CompletedInertSetup');
80
+ export const CompletedSetupInert = m('CompletedSetupInert');
81
81
  /** Sent when the restore-inert command completes. */
82
- export const CompletedInertTeardown = m('CompletedInertTeardown');
82
+ export const CompletedTeardownInert = m('CompletedTeardownInert');
83
83
  /** Sent when the scroll-into-view command completes after keyboard activation. */
84
84
  export const CompletedScrollIntoView = m('CompletedScrollIntoView');
85
85
  /** Sent when the programmatic click command completes. */
86
- export const CompletedItemClick = m('CompletedItemClick');
86
+ export const CompletedClickItem = m('CompletedClickItem');
87
87
  /** Sent when the advance-focus command completes. */
88
- export const CompletedFocusAdvance = m('CompletedFocusAdvance');
88
+ export const CompletedAdvanceFocus = m('CompletedAdvanceFocus');
89
89
  /** Sent when a mouse click on the button is ignored because pointer-down already handled the toggle. */
90
90
  export const IgnoredMouseClick = m('IgnoredMouseClick');
91
91
  /** Sent when a Space key-up is captured to prevent page scrolling. */
@@ -111,7 +111,7 @@ export const ReleasedPointerOnItems = m('ReleasedPointerOnItems', {
111
111
  timeStamp: S.Number,
112
112
  });
113
113
  /** Union of all messages the menu component can produce. */
114
- export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick, Searched, ClearedSearch, CompletedItemsFocus, CompletedButtonFocus, CompletedScrollLock, CompletedScrollUnlock, CompletedInertSetup, CompletedInertTeardown, CompletedScrollIntoView, CompletedItemClick, CompletedFocusAdvance, IgnoredMouseClick, SuppressedSpaceScroll, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement, PressedPointerOnButton, ReleasedPointerOnItems);
114
+ export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick, Searched, ClearedSearch, CompletedFocusItems, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedScrollIntoView, CompletedClickItem, CompletedAdvanceFocus, IgnoredMouseClick, SuppressedSpaceScroll, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement, PressedPointerOnButton, ReleasedPointerOnItems);
115
115
  // INIT
116
116
  const SEARCH_DEBOUNCE_MILLISECONDS = 350;
117
117
  const LEFT_MOUSE_BUTTON = 0;
@@ -148,16 +148,28 @@ const buttonSelector = (id) => `#${id}-button`;
148
148
  const itemsSelector = (id) => `#${id}-items`;
149
149
  const itemSelector = (id, index) => `#${id}-item-${index}`;
150
150
  const withUpdateReturn = M.withReturnType();
151
+ const RequestFrame = Command.define('RequestFrame');
152
+ const LockScroll = Command.define('LockScroll');
153
+ const UnlockScroll = Command.define('UnlockScroll');
154
+ const InertOthers = Command.define('InertOthers');
155
+ const RestoreInert = Command.define('RestoreInert');
156
+ const FocusItems = Command.define('FocusItems');
157
+ const FocusButton = Command.define('FocusButton');
158
+ const ScrollIntoView = Command.define('ScrollIntoView');
159
+ const ClickItem = Command.define('ClickItem');
160
+ const DelayClearSearch = Command.define('DelayClearSearch');
161
+ const WaitForTransitions = Command.define('WaitForTransitions');
162
+ const DetectMovementOrTransitionEnd = Command.define('DetectMovementOrTransitionEnd');
151
163
  /** Processes a menu message and returns the next model and commands. */
152
164
  export const update = (model, message) => {
153
- const maybeNextFrame = OptionExt.when(model.isAnimated, Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()), Command.make('RequestFrame')));
154
- const maybeLockScroll = OptionExt.when(model.isModal, Task.lockScroll.pipe(Effect.as(CompletedScrollLock()), Command.make('LockScroll')));
155
- const maybeUnlockScroll = OptionExt.when(model.isModal, Task.unlockScroll.pipe(Effect.as(CompletedScrollUnlock()), Command.make('UnlockScroll')));
156
- const maybeInertOthers = OptionExt.when(model.isModal, Task.inertOthers(model.id, [
165
+ const maybeNextFrame = OptionExt.when(model.isAnimated, RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()))));
166
+ const maybeLockScroll = OptionExt.when(model.isModal, LockScroll(Task.lockScroll.pipe(Effect.as(CompletedLockScroll()))));
167
+ const maybeUnlockScroll = OptionExt.when(model.isModal, UnlockScroll(Task.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))));
168
+ const maybeInertOthers = OptionExt.when(model.isModal, InertOthers(Task.inertOthers(model.id, [
157
169
  buttonSelector(model.id),
158
170
  itemsSelector(model.id),
159
- ]).pipe(Effect.as(CompletedInertSetup()), Command.make('InertOthers')));
160
- const maybeRestoreInert = OptionExt.when(model.isModal, Task.restoreInert(model.id).pipe(Effect.as(CompletedInertTeardown()), Command.make('RestoreInert')));
171
+ ]).pipe(Effect.as(CompletedSetupInert()))));
172
+ const maybeRestoreInert = OptionExt.when(model.isModal, RestoreInert(Task.restoreInert(model.id).pipe(Effect.as(CompletedTeardownInert()))));
161
173
  return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
162
174
  Opened: ({ maybeActiveItemIndex }) => {
163
175
  const nextModel = evo(model, {
@@ -174,7 +186,7 @@ export const update = (model, message) => {
174
186
  });
175
187
  return [
176
188
  nextModel,
177
- pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedItemsFocus()), Command.make('FocusItems')))),
189
+ pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusItems(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusItems()))))),
178
190
  ];
179
191
  },
180
192
  Closed: () => [
@@ -183,7 +195,7 @@ export const update = (model, message) => {
183
195
  maybeNextFrame,
184
196
  maybeUnlockScroll,
185
197
  maybeRestoreInert,
186
- ]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedButtonFocus()), Command.make('FocusButton')))),
198
+ ]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
187
199
  ],
188
200
  ClosedByTab: () => [
189
201
  closedModel(model),
@@ -196,7 +208,7 @@ export const update = (model, message) => {
196
208
  }),
197
209
  activationTrigger === 'Keyboard'
198
210
  ? [
199
- Task.scrollIntoView(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView()), Command.make('ScrollIntoView')),
211
+ ScrollIntoView(Task.scrollIntoView(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView()))),
200
212
  ]
201
213
  : [],
202
214
  ],
@@ -223,12 +235,12 @@ export const update = (model, message) => {
223
235
  maybeNextFrame,
224
236
  maybeUnlockScroll,
225
237
  maybeRestoreInert,
226
- ]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedButtonFocus()), Command.make('FocusButton')))),
238
+ ]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
227
239
  ],
228
240
  RequestedItemClick: ({ index }) => [
229
241
  model,
230
242
  [
231
- Task.clickElement(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedItemClick()), Command.make('ClickItem')),
243
+ ClickItem(Task.clickElement(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedClickItem()))),
232
244
  ],
233
245
  ],
234
246
  Searched: ({ key, maybeTargetIndex }) => {
@@ -241,7 +253,7 @@ export const update = (model, message) => {
241
253
  maybeActiveItemIndex: () => Option.orElse(maybeTargetIndex, () => model.maybeActiveItemIndex),
242
254
  }),
243
255
  [
244
- Task.delay(SEARCH_DEBOUNCE_MILLISECONDS).pipe(Effect.as(ClearedSearch({ version: nextSearchVersion })), Command.make('DelayClearSearch')),
256
+ DelayClearSearch(Task.delay(SEARCH_DEBOUNCE_MILLISECONDS).pipe(Effect.as(ClearedSearch({ version: nextSearchVersion })))),
245
257
  ],
246
258
  ];
247
259
  },
@@ -254,12 +266,12 @@ export const update = (model, message) => {
254
266
  AdvancedTransitionFrame: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => [
255
267
  evo(model, { transitionState: () => 'EnterAnimating' }),
256
268
  [
257
- Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition()), Command.make('WaitForTransitions')),
269
+ WaitForTransitions(Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition()))),
258
270
  ],
259
271
  ]), M.when('LeaveStart', () => [
260
272
  evo(model, { transitionState: () => 'LeaveAnimating' }),
261
273
  [
262
- Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition()))).pipe(Command.make('DetectMovementOrTransitionEnd')),
274
+ DetectMovementOrTransitionEnd(Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition())))),
263
275
  ],
264
276
  ]), M.orElse(() => [model, []])),
265
277
  EndedTransition: () => M.value(model.transitionState).pipe(withUpdateReturn, M.whenOr('EnterAnimating', 'LeaveAnimating', () => [
@@ -284,7 +296,7 @@ export const update = (model, message) => {
284
296
  maybeNextFrame,
285
297
  maybeUnlockScroll,
286
298
  maybeRestoreInert,
287
- ]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedButtonFocus()), Command.make('FocusButton')))),
299
+ ]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
288
300
  ];
289
301
  }
290
302
  const nextModel = evo(withPointerType, {
@@ -299,7 +311,7 @@ export const update = (model, message) => {
299
311
  });
300
312
  return [
301
313
  nextModel,
302
- pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedItemsFocus()), Command.make('FocusItems')))),
314
+ pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusItems(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusItems()))))),
303
315
  ];
304
316
  },
305
317
  ReleasedPointerOnItems: ({ screenX, screenY, timeStamp }) => {
@@ -319,19 +331,19 @@ export const update = (model, message) => {
319
331
  return [
320
332
  model,
321
333
  [
322
- Task.clickElement(itemSelector(model.id, model.maybeActiveItemIndex.value)).pipe(Effect.ignore, Effect.as(CompletedItemClick()), Command.make('ClickItem')),
334
+ ClickItem(Task.clickElement(itemSelector(model.id, model.maybeActiveItemIndex.value)).pipe(Effect.ignore, Effect.as(CompletedClickItem()))),
323
335
  ],
324
336
  ];
325
337
  },
326
- CompletedItemsFocus: () => [model, []],
327
- CompletedButtonFocus: () => [model, []],
328
- CompletedScrollLock: () => [model, []],
329
- CompletedScrollUnlock: () => [model, []],
330
- CompletedInertSetup: () => [model, []],
331
- CompletedInertTeardown: () => [model, []],
338
+ CompletedFocusItems: () => [model, []],
339
+ CompletedFocusButton: () => [model, []],
340
+ CompletedLockScroll: () => [model, []],
341
+ CompletedUnlockScroll: () => [model, []],
342
+ CompletedSetupInert: () => [model, []],
343
+ CompletedTeardownInert: () => [model, []],
332
344
  CompletedScrollIntoView: () => [model, []],
333
- CompletedItemClick: () => [model, []],
334
- CompletedFocusAdvance: () => [model, []],
345
+ CompletedClickItem: () => [model, []],
346
+ CompletedAdvanceFocus: () => [model, []],
335
347
  IgnoredMouseClick: () => [model, []],
336
348
  SuppressedSpaceScroll: () => [model, []],
337
349
  }));
@@ -24,17 +24,17 @@ export declare const PressedPointerOnButton: import("../../schema").CallableTagg
24
24
  button: typeof S.Number;
25
25
  }>;
26
26
  /** Sent when the focus-panel command completes after opening the popover. */
27
- export declare const CompletedPanelFocus: import("../../schema").CallableTaggedStruct<"CompletedPanelFocus", {}>;
27
+ export declare const CompletedFocusPanel: import("../../schema").CallableTaggedStruct<"CompletedFocusPanel", {}>;
28
28
  /** Sent when the focus-button command completes after closing. */
29
- export declare const CompletedButtonFocus: import("../../schema").CallableTaggedStruct<"CompletedButtonFocus", {}>;
29
+ export declare const CompletedFocusButton: import("../../schema").CallableTaggedStruct<"CompletedFocusButton", {}>;
30
30
  /** Sent when the scroll lock command completes. */
31
- export declare const CompletedScrollLock: import("../../schema").CallableTaggedStruct<"CompletedScrollLock", {}>;
31
+ export declare const CompletedLockScroll: import("../../schema").CallableTaggedStruct<"CompletedLockScroll", {}>;
32
32
  /** Sent when the scroll unlock command completes. */
33
- export declare const CompletedScrollUnlock: import("../../schema").CallableTaggedStruct<"CompletedScrollUnlock", {}>;
33
+ export declare const CompletedUnlockScroll: import("../../schema").CallableTaggedStruct<"CompletedUnlockScroll", {}>;
34
34
  /** Sent when the inert-others command completes. */
35
- export declare const CompletedInertSetup: import("../../schema").CallableTaggedStruct<"CompletedInertSetup", {}>;
35
+ export declare const CompletedSetupInert: import("../../schema").CallableTaggedStruct<"CompletedSetupInert", {}>;
36
36
  /** Sent when the restore-inert command completes. */
37
- export declare const CompletedInertTeardown: import("../../schema").CallableTaggedStruct<"CompletedInertTeardown", {}>;
37
+ export declare const CompletedTeardownInert: import("../../schema").CallableTaggedStruct<"CompletedTeardownInert", {}>;
38
38
  /** Sent when a mouse click on the button is ignored because pointer-down already handled the toggle. */
39
39
  export declare const IgnoredMouseClick: import("../../schema").CallableTaggedStruct<"IgnoredMouseClick", {}>;
40
40
  /** Sent when a Space key-up is captured to prevent page scrolling. */
@@ -51,12 +51,12 @@ export declare const Message: S.Union<[
51
51
  typeof Closed,
52
52
  typeof ClosedByTab,
53
53
  typeof PressedPointerOnButton,
54
- typeof CompletedPanelFocus,
55
- typeof CompletedButtonFocus,
56
- typeof CompletedScrollLock,
57
- typeof CompletedScrollUnlock,
58
- typeof CompletedInertSetup,
59
- typeof CompletedInertTeardown,
54
+ typeof CompletedFocusPanel,
55
+ typeof CompletedFocusButton,
56
+ typeof CompletedLockScroll,
57
+ typeof CompletedUnlockScroll,
58
+ typeof CompletedSetupInert,
59
+ typeof CompletedTeardownInert,
60
60
  typeof IgnoredMouseClick,
61
61
  typeof SuppressedSpaceScroll,
62
62
  typeof AdvancedTransitionFrame,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAE7E,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAoB,MAAM,YAAY,CAAA;AAKxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,sGAAsG;AACtG,eAAO,MAAM,KAAK;;;;;;;EAOhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,2EAA2E;AAC3E,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC,kGAAkG;AAClG,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC,iGAAiG;AACjG,eAAO,MAAM,WAAW,gEAAmB,CAAA;AAC3C,qHAAqH;AACrH,eAAO,MAAM,sBAAsB;;;EAGjC,CAAA;AACF,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,wEAA2B,CAAA;AAC3D,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,yEAA4B,CAAA;AAC7D,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,wEAA2B,CAAA;AAC3D,qDAAqD;AACrD,eAAO,MAAM,qBAAqB,0EAA6B,CAAA;AAC/D,oDAAoD;AACpD,eAAO,MAAM,mBAAmB,wEAA2B,CAAA;AAC3D,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,2EAA8B,CAAA;AACjE,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,sEAAyB,CAAA;AACvD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C6E;AAC7E,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,KAC7D,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,CAgBtE,CAAA"}
@@ -30,17 +30,17 @@ export const PressedPointerOnButton = m('PressedPointerOnButton', {
30
30
  button: S.Number,
31
31
  });
32
32
  /** Sent when the focus-panel command completes after opening the popover. */
33
- export const CompletedPanelFocus = m('CompletedPanelFocus');
33
+ export const CompletedFocusPanel = m('CompletedFocusPanel');
34
34
  /** Sent when the focus-button command completes after closing. */
35
- export const CompletedButtonFocus = m('CompletedButtonFocus');
35
+ export const CompletedFocusButton = m('CompletedFocusButton');
36
36
  /** Sent when the scroll lock command completes. */
37
- export const CompletedScrollLock = m('CompletedScrollLock');
37
+ export const CompletedLockScroll = m('CompletedLockScroll');
38
38
  /** Sent when the scroll unlock command completes. */
39
- export const CompletedScrollUnlock = m('CompletedScrollUnlock');
39
+ export const CompletedUnlockScroll = m('CompletedUnlockScroll');
40
40
  /** Sent when the inert-others command completes. */
41
- export const CompletedInertSetup = m('CompletedInertSetup');
41
+ export const CompletedSetupInert = m('CompletedSetupInert');
42
42
  /** Sent when the restore-inert command completes. */
43
- export const CompletedInertTeardown = m('CompletedInertTeardown');
43
+ export const CompletedTeardownInert = m('CompletedTeardownInert');
44
44
  /** Sent when a mouse click on the button is ignored because pointer-down already handled the toggle. */
45
45
  export const IgnoredMouseClick = m('IgnoredMouseClick');
46
46
  /** Sent when a Space key-up is captured to prevent page scrolling. */
@@ -52,7 +52,7 @@ export const EndedTransition = m('EndedTransition');
52
52
  /** Sent internally when the popover button moves in the viewport during a leave transition, cancelling the animation. */
53
53
  export const DetectedButtonMovement = m('DetectedButtonMovement');
54
54
  /** Union of all messages the popover component can produce. */
55
- export const Message = S.Union(Opened, Closed, ClosedByTab, PressedPointerOnButton, CompletedPanelFocus, CompletedButtonFocus, CompletedScrollLock, CompletedScrollUnlock, CompletedInertSetup, CompletedInertTeardown, IgnoredMouseClick, SuppressedSpaceScroll, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement);
55
+ export const Message = S.Union(Opened, Closed, ClosedByTab, PressedPointerOnButton, CompletedFocusPanel, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, IgnoredMouseClick, SuppressedSpaceScroll, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement);
56
56
  // INIT
57
57
  const LEFT_MOUSE_BUTTON = 0;
58
58
  /** Creates an initial popover model from a config. Defaults to closed. */
@@ -73,16 +73,25 @@ const closedModel = (model) => evo(model, {
73
73
  const buttonSelector = (id) => `#${id}-button`;
74
74
  const panelSelector = (id) => `#${id}-panel`;
75
75
  const withUpdateReturn = M.withReturnType();
76
+ const RequestFrame = Command.define('RequestFrame');
77
+ const LockScroll = Command.define('LockScroll');
78
+ const UnlockScroll = Command.define('UnlockScroll');
79
+ const InertOthers = Command.define('InertOthers');
80
+ const RestoreInert = Command.define('RestoreInert');
81
+ const FocusPanel = Command.define('FocusPanel');
82
+ const FocusButton = Command.define('FocusButton');
83
+ const WaitForTransitions = Command.define('WaitForTransitions');
84
+ const DetectMovementOrTransitionEnd = Command.define('DetectMovementOrTransitionEnd');
76
85
  /** Processes a popover message and returns the next model and commands. */
77
86
  export const update = (model, message) => {
78
- const maybeNextFrame = OptionExt.when(model.isAnimated, Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()), Command.make('RequestFrame')));
79
- const maybeLockScroll = OptionExt.when(model.isModal, Task.lockScroll.pipe(Effect.as(CompletedScrollLock()), Command.make('LockScroll')));
80
- const maybeUnlockScroll = OptionExt.when(model.isModal, Task.unlockScroll.pipe(Effect.as(CompletedScrollUnlock()), Command.make('UnlockScroll')));
81
- const maybeInertOthers = OptionExt.when(model.isModal, Task.inertOthers(model.id, [
87
+ const maybeNextFrame = OptionExt.when(model.isAnimated, RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()))));
88
+ const maybeLockScroll = OptionExt.when(model.isModal, LockScroll(Task.lockScroll.pipe(Effect.as(CompletedLockScroll()))));
89
+ const maybeUnlockScroll = OptionExt.when(model.isModal, UnlockScroll(Task.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))));
90
+ const maybeInertOthers = OptionExt.when(model.isModal, InertOthers(Task.inertOthers(model.id, [
82
91
  buttonSelector(model.id),
83
92
  panelSelector(model.id),
84
- ]).pipe(Effect.as(CompletedInertSetup()), Command.make('InertOthers')));
85
- const maybeRestoreInert = OptionExt.when(model.isModal, Task.restoreInert(model.id).pipe(Effect.as(CompletedInertTeardown()), Command.make('RestoreInert')));
93
+ ]).pipe(Effect.as(CompletedSetupInert()))));
94
+ const maybeRestoreInert = OptionExt.when(model.isModal, RestoreInert(Task.restoreInert(model.id).pipe(Effect.as(CompletedTeardownInert()))));
86
95
  return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
87
96
  Opened: () => {
88
97
  const nextModel = evo(model, {
@@ -91,7 +100,7 @@ export const update = (model, message) => {
91
100
  });
92
101
  return [
93
102
  nextModel,
94
- pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedPanelFocus()), Command.make('FocusPanel')))),
103
+ pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusPanel(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusPanel()))))),
95
104
  ];
96
105
  },
97
106
  Closed: () => [
@@ -100,7 +109,7 @@ export const update = (model, message) => {
100
109
  maybeNextFrame,
101
110
  maybeUnlockScroll,
102
111
  maybeRestoreInert,
103
- ]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedButtonFocus()), Command.make('FocusButton')))),
112
+ ]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
104
113
  ],
105
114
  ClosedByTab: () => [
106
115
  closedModel(model),
@@ -120,7 +129,7 @@ export const update = (model, message) => {
120
129
  maybeNextFrame,
121
130
  maybeUnlockScroll,
122
131
  maybeRestoreInert,
123
- ]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedButtonFocus()), Command.make('FocusButton')))),
132
+ ]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
124
133
  ];
125
134
  }
126
135
  const nextModel = evo(withPointerType, {
@@ -129,18 +138,18 @@ export const update = (model, message) => {
129
138
  });
130
139
  return [
131
140
  nextModel,
132
- pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedPanelFocus()), Command.make('FocusPanel')))),
141
+ pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusPanel(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusPanel()))))),
133
142
  ];
134
143
  },
135
144
  AdvancedTransitionFrame: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => [
136
145
  evo(model, { transitionState: () => 'EnterAnimating' }),
137
146
  [
138
- Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()), Command.make('WaitForTransitions')),
147
+ WaitForTransitions(Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()))),
139
148
  ],
140
149
  ]), M.when('LeaveStart', () => [
141
150
  evo(model, { transitionState: () => 'LeaveAnimating' }),
142
151
  [
143
- Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()))).pipe(Command.make('DetectMovementOrTransitionEnd')),
152
+ DetectMovementOrTransitionEnd(Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition())))),
144
153
  ],
145
154
  ]), M.orElse(() => [model, []])),
146
155
  EndedTransition: () => M.value(model.transitionState).pipe(withUpdateReturn, M.whenOr('EnterAnimating', 'LeaveAnimating', () => [
@@ -151,12 +160,12 @@ export const update = (model, message) => {
151
160
  evo(model, { transitionState: () => 'Idle' }),
152
161
  [],
153
162
  ]), M.orElse(() => [model, []])),
154
- CompletedPanelFocus: () => [model, []],
155
- CompletedButtonFocus: () => [model, []],
156
- CompletedScrollLock: () => [model, []],
157
- CompletedScrollUnlock: () => [model, []],
158
- CompletedInertSetup: () => [model, []],
159
- CompletedInertTeardown: () => [model, []],
163
+ CompletedFocusPanel: () => [model, []],
164
+ CompletedFocusButton: () => [model, []],
165
+ CompletedLockScroll: () => [model, []],
166
+ CompletedUnlockScroll: () => [model, []],
167
+ CompletedSetupInert: () => [model, []],
168
+ CompletedTeardownInert: () => [model, []],
160
169
  IgnoredMouseClick: () => [model, []],
161
170
  SuppressedSpaceScroll: () => [model, []],
162
171
  }));
@@ -17,14 +17,14 @@ export declare const SelectedOption: import("../../schema").CallableTaggedStruct
17
17
  index: typeof S.Number;
18
18
  }>;
19
19
  /** Sent when the focus-option command completes. */
20
- export declare const CompletedOptionFocus: import("../../schema").CallableTaggedStruct<"CompletedOptionFocus", {}>;
20
+ export declare const CompletedFocusOption: import("../../schema").CallableTaggedStruct<"CompletedFocusOption", {}>;
21
21
  /** Union of all messages the radio group component can produce. */
22
22
  export declare const Message: S.Union<[
23
23
  typeof SelectedOption,
24
- typeof CompletedOptionFocus
24
+ typeof CompletedFocusOption
25
25
  ]>;
26
26
  export type SelectedOption = typeof SelectedOption.Type;
27
- export type CompletedOptionFocus = typeof CompletedOptionFocus.Type;
27
+ export type CompletedFocusOption = typeof CompletedFocusOption.Type;
28
28
  export type Message = typeof Message.Type;
29
29
  /** Configuration for creating a radio group model with `init`. */
30
30
  export type InitConfig = Readonly<{
@@ -58,7 +58,7 @@ export type NarrowedSelectedOption<RadioOption extends string> = Readonly<{
58
58
  /** Configuration for rendering a radio group with `view`. */
59
59
  export type ViewConfig<Message, RadioOption extends string> = Readonly<{
60
60
  model: Model;
61
- toMessage: (message: NarrowedSelectedOption<RadioOption> | CompletedOptionFocus) => Message;
61
+ toMessage: (message: NarrowedSelectedOption<RadioOption> | CompletedFocusOption) => Message;
62
62
  options: ReadonlyArray<RadioOption>;
63
63
  optionToConfig: (option: RadioOption, context: Readonly<{
64
64
  isSelected: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/radioGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAoB,MAAM,YAAY,CAAA;AAQxE,+FAA+F;AAC/F,eAAO,MAAM,WAAW,uCAAsC,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,iGAAiG;AACjG,eAAO,MAAM,KAAK;;;;EAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,6EAA6E;AAC7E,eAAO,MAAM,cAAc;;;EAGzB,CAAA;AACF,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,yEAA4B,CAAA;AAE7D,mEAAmE;AACnE,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IAAC,OAAO,cAAc;IAAE,OAAO,oBAAoB;CAAC,CACL,CAAA;AAEjD,M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,WAAW,CAAC,GAAG,oBAAoB,KAChE,OAAO,CAAA;IACZ,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IACnC,cAAc,EAAE,CACd,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,QAAQ,CAAC;QAChB,UAAU,EAAE,OAAO,CAAA;QACnB,QAAQ,EAAE,OAAO,CAAA;QACjB,UAAU,EAAE,OAAO,CAAA;KACpB,CAAC,KACC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IAClE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC,CAAA;AAQF,6IAA6I;AAC7I,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,WAAW,SAAS,MAAM,EACtD,QAAQ,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,KACvC,IA6OF,CAAA;AAED;6EAC6E;AAC7E,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,WAAW,SAAS,MAAM,EACtD,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,KAC1E,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,WAAW,CAAC,KACrD,IAAI,CAgBR,CAAA"}
@@ -21,9 +21,9 @@ export const SelectedOption = m('SelectedOption', {
21
21
  index: S.Number,
22
22
  });
23
23
  /** Sent when the focus-option command completes. */
24
- export const CompletedOptionFocus = m('CompletedOptionFocus');
24
+ export const CompletedFocusOption = m('CompletedFocusOption');
25
25
  /** Union of all messages the radio group component can produce. */
26
- export const Message = S.Union(SelectedOption, CompletedOptionFocus);
26
+ export const Message = S.Union(SelectedOption, CompletedFocusOption);
27
27
  /** Creates an initial radio group model from a config. Defaults to no selection and vertical orientation. */
28
28
  export const init = (config) => ({
29
29
  id: config.id,
@@ -32,6 +32,7 @@ export const init = (config) => ({
32
32
  });
33
33
  // UPDATE
34
34
  const optionId = (id, index) => `${id}-option-${index}`;
35
+ const FocusOption = Command.define('FocusOption');
35
36
  /** Processes a radio group message and returns the next model and commands. */
36
37
  export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
37
38
  SelectedOption: ({ value, index }) => {
@@ -39,11 +40,11 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
39
40
  return [
40
41
  evo(model, { selectedValue: () => Option.some(value) }),
41
42
  [
42
- Task.focus(selector).pipe(Effect.ignore, Effect.as(CompletedOptionFocus()), Command.make('FocusOption')),
43
+ FocusOption(Task.focus(selector).pipe(Effect.ignore, Effect.as(CompletedFocusOption()))),
43
44
  ],
44
45
  ];
45
46
  },
46
- CompletedOptionFocus: () => [model, []],
47
+ CompletedFocusOption: () => [model, []],
47
48
  }));
48
49
  const labelId = (id, index) => `${id}-option-${index}-label`;
49
50
  const descriptionId = (id, index) => `${id}-option-${index}-description`;
@@ -25,12 +25,12 @@ export declare const TabFocused: import("../../schema").CallableTaggedStruct<"Ta
25
25
  index: typeof S.Number;
26
26
  }>;
27
27
  /** Sent when the focus-tab command completes. */
28
- export declare const CompletedTabFocus: import("../../schema").CallableTaggedStruct<"CompletedTabFocus", {}>;
28
+ export declare const CompletedFocusTab: import("../../schema").CallableTaggedStruct<"CompletedFocusTab", {}>;
29
29
  /** Union of all messages the tabs component can produce. */
30
30
  export declare const Message: S.Union<[
31
31
  typeof TabSelected,
32
32
  typeof TabFocused,
33
- typeof CompletedTabFocus
33
+ typeof CompletedFocusTab
34
34
  ]>;
35
35
  export type TabSelected = typeof TabSelected.Type;
36
36
  export type TabFocused = typeof TabFocused.Type;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,OAAO,EAGb,MAAM,YAAY,CAAA;AAMnB,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI1E,yFAAyF;AACzF,eAAO,MAAM,WAAW,uCAAsC,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,yGAAyG;AACzG,eAAO,MAAM,cAAc,oCAAmC,CAAA;AAC9D,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD,kGAAkG;AAClG,eAAO,MAAM,KAAK;;;;;EAKhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,sGAAsG;AACtG,eAAO,MAAM,WAAW;;EAAwC,CAAA;AAChE,wFAAwF;AACxF,eAAO,MAAM,UAAU;;EAAuC,CAAA;AAC9D,iDAAiD;AACjD,eAAO,MAAM,iBAAiB,sEAAyB,CAAA;AAEvD,4DAA4D;AAC5D,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IAAC,OAAO,WAAW;IAAE,OAAO,UAAU;IAAE,OAAO,iBAAiB;CAAC,CACZ,CAAA;AAEvD,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AACjD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAE/C,MAAM,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,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACrD,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAC,CAAA;AAMF,yGAAyG;AACzG,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,GAAG,SAAS,MAAM,EAC9C,QAAQ,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,KAC/B,IAsMF,CAAA;AAED;6EAC6E;AAC7E,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,GAAG,SAAS,MAAM,EAC9C,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,KAClE,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,WAAW,CAAC,KAC7C,IAAI,CAgBR,CAAA"}
@@ -24,9 +24,9 @@ export const TabSelected = m('TabSelected', { index: S.Number });
24
24
  /** Sent when a tab receives keyboard focus in `Manual` mode without being activated. */
25
25
  export const TabFocused = m('TabFocused', { index: S.Number });
26
26
  /** Sent when the focus-tab command completes. */
27
- export const CompletedTabFocus = m('CompletedTabFocus');
27
+ export const CompletedFocusTab = m('CompletedFocusTab');
28
28
  /** Union of all messages the tabs component can produce. */
29
- export const Message = S.Union(TabSelected, TabFocused, CompletedTabFocus);
29
+ export const Message = S.Union(TabSelected, TabFocused, CompletedFocusTab);
30
30
  /** Creates an initial tabs model from a config. Defaults to first tab and automatic activation. */
31
31
  export const init = (config) => {
32
32
  const activeIndex = config.activeIndex ?? 0;
@@ -38,6 +38,7 @@ export const init = (config) => {
38
38
  };
39
39
  };
40
40
  // UPDATE
41
+ const FocusTab = Command.define('FocusTab');
41
42
  /** Processes a tabs message and returns the next model and commands. */
42
43
  export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
43
44
  TabSelected: ({ index }) => {
@@ -48,7 +49,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
48
49
  focusedIndex: () => index,
49
50
  }),
50
51
  [
51
- Task.focus(tabSelector).pipe(Effect.ignore, Effect.as(CompletedTabFocus()), Command.make('FocusTab')),
52
+ FocusTab(Task.focus(tabSelector).pipe(Effect.ignore, Effect.as(CompletedFocusTab()))),
52
53
  ],
53
54
  ];
54
55
  },
@@ -57,11 +58,11 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
57
58
  return [
58
59
  evo(model, { focusedIndex: () => index }),
59
60
  [
60
- Task.focus(tabSelector).pipe(Effect.ignore, Effect.as(CompletedTabFocus()), Command.make('FocusTab')),
61
+ FocusTab(Task.focus(tabSelector).pipe(Effect.ignore, Effect.as(CompletedFocusTab()))),
61
62
  ],
62
63
  ];
63
64
  },
64
- CompletedTabFocus: () => [model, []],
65
+ CompletedFocusTab: () => [model, []],
65
66
  }));
66
67
  const tabPanelId = (id, index) => `${id}-panel-${index}`;
67
68
  const tabId = (id, index) => `${id}-tab-${index}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit",
3
- "version": "0.37.0",
3
+ "version": "1.1.0",
4
4
  "description": "A frontend framework for TypeScript, built on Effect, using The Elm Architecture",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",