@foldkit/ui 0.166.0-canary.085b787da0a5 → 0.166.0-canary.5f7e2470d703

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dragAndDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,WAAW,EAEX,MAAM,EAEN,MAAM,EACN,MAAM,EAEP,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAmB,MAAM,cAAc,CAAA;AAIhF,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAkBxC,QAAA,MAAM,UAAU;;;EAGd,CAAA;AAEF,6DAA6D;AAC7D,eAAO,MAAM,SAAS;;;QAGlB,MAAM;QACN,WAAW;QACX,KAAK;QACL,MAAM;;;;;;QAGN,MAAM;QACN,iBAAiB;QACjB,WAAW;QACX,MAAM;;;;QACN,OAAO;;;;QACP,eAAe;;;;;;QAGf,MAAM;QACN,iBAAiB;QACjB,WAAW;QACX,iBAAiB;QACjB,WAAW;;EAEb,CAAA;AACF,8CAA8C;AAC9C,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C,mHAAmH;AACnH,eAAO,MAAM,KAAK;;;;;;;YAzBd,MAAM;YACN,WAAW;YACX,KAAK;YACL,MAAM;;;;;;YAGN,MAAM;YACN,iBAAiB;YACjB,WAAW;YACX,MAAM;;;;YACN,OAAO;;;;YACP,eAAe;;;;;;YAGf,MAAM;YACN,iBAAiB;YACjB,WAAW;YACX,iBAAiB;YACjB,WAAW;;;EAYb,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,qEAAq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D,kGAAkG;AAClG,eAAO,MAAM,UAAU,UACd,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcpC,CAAA;AAEH,kFAAkF;AAClF,eAAO,MAAM,UAAU,4BAA6B,KAAK,KAAG,OACR,CAAA;AAEpD,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAMnE,CAAA;AAEH,oJAAoJ;AACpJ,eAAO,MAAM,eAAe,UACnB,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,IAAI,CAUpC,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
2
  import { Array, Effect, Equal, Equivalence, Match, Option, Queue, Schema, Stream, pipe, } from 'effect';
3
+ import * as Browser from 'foldkit/browser';
3
4
  import * as Command from 'foldkit/command';
4
5
  import * as Dom from 'foldkit/dom';
5
6
  import { inertHtml as ih } from 'foldkit/html';
@@ -8,6 +9,7 @@ import { defineTaggedUnion } from 'foldkit/schema';
8
9
  import { modifyFields } from 'foldkit/struct';
9
10
  import * as Subscription from 'foldkit/subscription';
10
11
  import * as Update from 'foldkit/update';
12
+ import { documentDragStyles } from '../internal/documentDragStyles.js';
11
13
  import { attributeSelector } from '../internal/selectors.js';
12
14
  // MODEL
13
15
  const Orientation = Schema.Literals(['Horizontal', 'Vertical']);
@@ -362,35 +364,20 @@ export const subscriptions = Subscription.make()(entry => (__foldkitBrandViewRes
362
364
  clientY: event.clientY,
363
365
  maybeDropTarget: resolveDropTarget(event.clientX, event.clientY, orientation),
364
366
  })), "@foldkit/ui/dragAndDrop/index.js#anonymous~39"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~38"))), Stream.fromEventListener(document, 'pointerup').pipe(Stream.map(() => __foldkitBrandViewResult((Message.ReleasedPointer()), "@foldkit/ui/dragAndDrop/index.js#anonymous~40"))));
365
- // NOTE: prevents text selection and locks cursor to grabbing during
366
- // pointer drag. Uses a <style> element for cursor because inline styles
367
- // on <html> don't override descendant elements' cursor values.
368
- const documentDragStyles = Stream.callback(() => __foldkitBrandViewResult((Effect.acquireRelease(Effect.sync(() => {
369
- document.documentElement.style.setProperty('user-select', 'none');
370
- document.documentElement.style.setProperty('-webkit-user-select', 'none');
371
- const cursorStyle = document.createElement('style');
372
- cursorStyle.textContent = '* { cursor: grabbing !important; }';
373
- document.head.appendChild(cursorStyle);
374
- return __foldkitBrandViewResult((cursorStyle), "@foldkit/ui/dragAndDrop/index.js#anonymous~42");
375
- }), cursorStyle => __foldkitBrandViewResult((Effect.sync(() => {
376
- document.documentElement.style.removeProperty('user-select');
377
- document.documentElement.style.removeProperty('-webkit-user-select');
378
- cursorStyle.remove();
379
- })), "@foldkit/ui/dragAndDrop/index.js#anonymous~43")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@foldkit/ui/dragAndDrop/index.js#anonymous~45")))), "@foldkit/ui/dragAndDrop/index.js#anonymous~41"));
380
- return __foldkitBrandViewResult((Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~46")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream");
367
+ return __foldkitBrandViewResult((Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~41")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream");
381
368
  },
382
369
  }),
383
370
  documentEscape: entry({ dragActivity: DragActivity }, {
384
371
  modelToDependencies: model => (__foldkitBrandViewResult(({
385
372
  dragActivity: dragActivityFromModel(model),
386
373
  }), "@foldkit/ui/dragAndDrop/index.js#modelToDependencies~2")),
387
- dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => __foldkitBrandViewResult((key === 'Escape'), "@foldkit/ui/dragAndDrop/index.js#anonymous~47")), Stream.map(() => __foldkitBrandViewResult((Message.CancelledDrag()), "@foldkit/ui/dragAndDrop/index.js#anonymous~48"))), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~49")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~2"),
374
+ dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => __foldkitBrandViewResult((key === 'Escape'), "@foldkit/ui/dragAndDrop/index.js#anonymous~42")), Stream.map(() => __foldkitBrandViewResult((Message.CancelledDrag()), "@foldkit/ui/dragAndDrop/index.js#anonymous~43"))), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~44")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~2"),
388
375
  }),
389
376
  documentKeyboard: entry({ dragActivity: KeyboardDragActivity }, {
390
377
  modelToDependencies: model => (__foldkitBrandViewResult(({
391
378
  dragActivity: keyboardDragActivityFromModel(model),
392
379
  }), "@foldkit/ui/dragAndDrop/index.js#modelToDependencies~3")),
393
- dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Subscription.fromEventFilterMapPreventDefault({
380
+ dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Browser.streamFromEventFilterMapPreventDefault({
394
381
  target: document,
395
382
  type: 'keydown',
396
383
  filterMapEvent: event => {
@@ -404,9 +391,9 @@ export const subscriptions = Subscription.make()(entry => (__foldkitBrandViewRes
404
391
  direction: event.shiftKey
405
392
  ? 'PreviousContainer'
406
393
  : 'NextContainer',
407
- }))), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Match.whenOr(' ', 'Enter', () => __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~51")), Match.orElse(key => __foldkitBrandViewResult((Option.map(arrowKeyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~52")))), "@foldkit/ui/dragAndDrop/index.js#filterMapEvent");
394
+ }))), "@foldkit/ui/dragAndDrop/index.js#anonymous~45")), Match.whenOr(' ', 'Enter', () => __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~46")), Match.orElse(key => __foldkitBrandViewResult((Option.map(arrowKeyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~48"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~47")))), "@foldkit/ui/dragAndDrop/index.js#filterMapEvent");
408
395
  },
409
- }), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~54")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~3"),
396
+ }), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~49")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~3"),
410
397
  }),
411
398
  autoScroll: entry({
412
399
  isDragging: Schema.Boolean,
@@ -429,13 +416,13 @@ export const subscriptions = Subscription.make()(entry => (__foldkitBrandViewRes
429
416
  ref.id = requestAnimationFrame(step);
430
417
  };
431
418
  ref.id = requestAnimationFrame(step);
432
- return __foldkitBrandViewResult((ref), "@foldkit/ui/dragAndDrop/index.js#anonymous~56");
433
- }), ref => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((cancelAnimationFrame(ref.id)), "@foldkit/ui/dragAndDrop/index.js#anonymous~58"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~57")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@foldkit/ui/dragAndDrop/index.js#anonymous~59")))), "@foldkit/ui/dragAndDrop/index.js#anonymous~55")), Effect.sync(() => __foldkitBrandViewResult((isDragging), "@foldkit/ui/dragAndDrop/index.js#anonymous~60")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~4"),
419
+ return __foldkitBrandViewResult((ref), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
420
+ }), ref => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((cancelAnimationFrame(ref.id)), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~52")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@foldkit/ui/dragAndDrop/index.js#anonymous~54")))), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Effect.sync(() => __foldkitBrandViewResult((isDragging), "@foldkit/ui/dragAndDrop/index.js#anonymous~55")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~4"),
434
421
  }),
435
422
  }), "@foldkit/ui/dragAndDrop/index.js#anonymous~37")));
436
423
  // VIEW
437
424
  const LEFT_MOUSE_BUTTON = 0;
438
- const arrowKeyToDirection = (key) => __foldkitBrandViewResult((Match.value(key).pipe(Match.withReturnType(), Match.when('ArrowUp', () => __foldkitBrandViewResult(('Up'), "@foldkit/ui/dragAndDrop/index.js#anonymous~61")), Match.when('ArrowDown', () => __foldkitBrandViewResult(('Down'), "@foldkit/ui/dragAndDrop/index.js#anonymous~62")), Match.when('ArrowLeft', () => __foldkitBrandViewResult(('Left'), "@foldkit/ui/dragAndDrop/index.js#anonymous~63")), Match.when('ArrowRight', () => __foldkitBrandViewResult(('Right'), "@foldkit/ui/dragAndDrop/index.js#anonymous~64")), Match.option)), "@foldkit/ui/dragAndDrop/index.js#arrowKeyToDirection");
425
+ const arrowKeyToDirection = (key) => __foldkitBrandViewResult((Match.value(key).pipe(Match.withReturnType(), Match.when('ArrowUp', () => __foldkitBrandViewResult(('Up'), "@foldkit/ui/dragAndDrop/index.js#anonymous~56")), Match.when('ArrowDown', () => __foldkitBrandViewResult(('Down'), "@foldkit/ui/dragAndDrop/index.js#anonymous~57")), Match.when('ArrowLeft', () => __foldkitBrandViewResult(('Left'), "@foldkit/ui/dragAndDrop/index.js#anonymous~58")), Match.when('ArrowRight', () => __foldkitBrandViewResult(('Right'), "@foldkit/ui/dragAndDrop/index.js#anonymous~59")), Match.option)), "@foldkit/ui/dragAndDrop/index.js#arrowKeyToDirection");
439
426
  /** Returns attributes the parent attaches to a draggable element. Handles pointer-down, keyboard activation, and ARIA. */
440
427
  export const draggable = (config, h) => {
441
428
  const isKeyboardDragActivationKey = (key) => __foldkitBrandViewResult((key === ' ' || key === 'Enter'), "@foldkit/ui/dragAndDrop/index.js#isKeyboardDragActivationKey");
@@ -462,7 +449,7 @@ export const draggable = (config, h) => {
462
449
  index: config.index,
463
450
  screenX,
464
451
  screenY,
465
- }))), "@foldkit/ui/dragAndDrop/index.js#anonymous~66")))), "@foldkit/ui/dragAndDrop/index.js#anonymous~65")),
452
+ }))), "@foldkit/ui/dragAndDrop/index.js#anonymous~61")))), "@foldkit/ui/dragAndDrop/index.js#anonymous~60")),
466
453
  h.OnKeyDownPreventDefault(handleKeyDown),
467
454
  h.Style({
468
455
  'touch-action': 'none',
@@ -495,13 +482,13 @@ export const ghostStyle = (model) => __foldkitBrandViewResult((Match.value(model
495
482
  transform: ghostTransform(dragging.current.clientX, dragging.current.clientY),
496
483
  'pointer-events': 'none',
497
484
  'z-index': '9999',
498
- }), "@foldkit/ui/dragAndDrop/index.js#anonymous~67"))), Match.option)), "@foldkit/ui/dragAndDrop/index.js#ghostStyle");
485
+ }), "@foldkit/ui/dragAndDrop/index.js#anonymous~62"))), Match.option)), "@foldkit/ui/dragAndDrop/index.js#ghostStyle");
499
486
  /** Returns true when the component is actively dragging (pointer or keyboard). */
500
487
  export const isDragging = ({ dragState: { _tag } }) => __foldkitBrandViewResult((_tag === 'Dragging' || _tag === 'KeyboardDragging'), "@foldkit/ui/dragAndDrop/index.js#isDragging");
501
488
  /** Returns the ID of the item currently being dragged or pending, if any. */
502
- export const maybeDraggedItemId = (model) => __foldkitBrandViewResult((Match.value(model.dragState).pipe(Match.tag('Pending', pending => __foldkitBrandViewResult((pending.itemId), "@foldkit/ui/dragAndDrop/index.js#anonymous~68")), Match.tag('Dragging', dragging => __foldkitBrandViewResult((dragging.itemId), "@foldkit/ui/dragAndDrop/index.js#anonymous~69")), Match.tag('KeyboardDragging', keyboardDragging => __foldkitBrandViewResult((keyboardDragging.itemId), "@foldkit/ui/dragAndDrop/index.js#anonymous~70")), Match.option)), "@foldkit/ui/dragAndDrop/index.js#maybeDraggedItemId");
489
+ export const maybeDraggedItemId = (model) => __foldkitBrandViewResult((Match.value(model.dragState).pipe(Match.tag('Pending', pending => __foldkitBrandViewResult((pending.itemId), "@foldkit/ui/dragAndDrop/index.js#anonymous~63")), Match.tag('Dragging', dragging => __foldkitBrandViewResult((dragging.itemId), "@foldkit/ui/dragAndDrop/index.js#anonymous~64")), Match.tag('KeyboardDragging', keyboardDragging => __foldkitBrandViewResult((keyboardDragging.itemId), "@foldkit/ui/dragAndDrop/index.js#anonymous~65")), Match.option)), "@foldkit/ui/dragAndDrop/index.js#maybeDraggedItemId");
503
490
  /** Returns the current drop target, if any. Populated during pointer drag (from collision detection) and keyboard drag (from resolved position). */
504
- export const maybeDropTarget = (model) => __foldkitBrandViewResult((Match.value(model.dragState).pipe(Match.tag('Dragging', dragging => __foldkitBrandViewResult((dragging.maybeDropTarget), "@foldkit/ui/dragAndDrop/index.js#anonymous~71")), Match.tag('KeyboardDragging', keyboardDragging => __foldkitBrandViewResult((Option.some({
491
+ export const maybeDropTarget = (model) => __foldkitBrandViewResult((Match.value(model.dragState).pipe(Match.tag('Dragging', dragging => __foldkitBrandViewResult((dragging.maybeDropTarget), "@foldkit/ui/dragAndDrop/index.js#anonymous~66")), Match.tag('KeyboardDragging', keyboardDragging => __foldkitBrandViewResult((Option.some({
505
492
  containerId: keyboardDragging.targetContainerId,
506
493
  index: keyboardDragging.targetIndex,
507
- })), "@foldkit/ui/dragAndDrop/index.js#anonymous~72")), Match.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/dragAndDrop/index.js#anonymous~73")))), "@foldkit/ui/dragAndDrop/index.js#maybeDropTarget");
494
+ })), "@foldkit/ui/dragAndDrop/index.js#anonymous~67")), Match.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/dragAndDrop/index.js#anonymous~68")))), "@foldkit/ui/dragAndDrop/index.js#maybeDropTarget");
@@ -0,0 +1,3 @@
1
+ import { Stream } from 'effect';
2
+ export declare const documentDragStyles: Stream.Stream<never, never, never>;
3
+ //# sourceMappingURL=documentDragStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentDragStyles.d.ts","sourceRoot":"","sources":["../../src/internal/documentDragStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEvC,eAAO,MAAM,kBAAkB,oCAkB9B,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { Effect, Stream } from 'effect';
3
+ export const documentDragStyles = Stream.callback(() => __foldkitBrandViewResult((Effect.acquireRelease(Effect.sync(() => {
4
+ const styleElement = document.createElement('style');
5
+ styleElement.textContent = `
6
+ :root {
7
+ user-select: none !important;
8
+ -webkit-user-select: none !important;
9
+ }
10
+ * {
11
+ cursor: grabbing !important;
12
+ }
13
+ `;
14
+ document.head.appendChild(styleElement);
15
+ return __foldkitBrandViewResult((styleElement), "@foldkit/ui/internal/documentDragStyles.js#anonymous~2");
16
+ }), styleElement => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((styleElement.remove()), "@foldkit/ui/internal/documentDragStyles.js#anonymous~4"))), "@foldkit/ui/internal/documentDragStyles.js#anonymous~3")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@foldkit/ui/internal/documentDragStyles.js#anonymous~5")))), "@foldkit/ui/internal/documentDragStyles.js#anonymous"));
@@ -79,21 +79,21 @@ export declare const update: (model: {
79
79
  readonly maybeLastButtonPointerType: Option.Option<string>;
80
80
  };
81
81
  commands?: Update.Commands<{
82
- readonly _tag: "DeactivatedItem";
82
+ readonly _tag: "CompletedClickItem";
83
83
  } | {
84
- readonly _tag: "SuppressedItemCommit";
84
+ readonly _tag: "CompletedInertOthers";
85
85
  } | {
86
86
  readonly _tag: "CompletedLockScroll";
87
- } | {
88
- readonly _tag: "CompletedUnlockScroll";
89
- } | {
90
- readonly _tag: "CompletedInertOthers";
91
87
  } | {
92
88
  readonly _tag: "CompletedRestoreInert";
93
89
  } | {
94
90
  readonly _tag: "CompletedScrollIntoView";
95
91
  } | {
96
- readonly _tag: "CompletedClickItem";
92
+ readonly _tag: "CompletedUnlockScroll";
93
+ } | {
94
+ readonly _tag: "DeactivatedItem";
95
+ } | {
96
+ readonly _tag: "SuppressedItemCommit";
97
97
  } | {
98
98
  readonly _tag: "Closed";
99
99
  } | {
@@ -227,9 +227,7 @@ export declare const DetectMovementOrAnimationEnd: Command.CommandDefinitionWith
227
227
  export declare const makeUpdate: <Model extends BaseModel>(handleSelectedItem: (model: Model, item: string, context: SelectedItemContext<Model>) => Update.ReturnWithOutMessage<Model, Message, OutMessage>) => (model: Model, message: Message) => Readonly<{
228
228
  model: Model;
229
229
  commands?: Update.Commands<{
230
- readonly _tag: "IgnoredMouseClick";
231
- } | {
232
- readonly _tag: "SuppressedSpaceScroll";
230
+ readonly _tag: "Closed";
233
231
  } | {
234
232
  readonly _tag: "CompletedFocusButton";
235
233
  } | {
@@ -241,15 +239,9 @@ export declare const makeUpdate: <Model extends BaseModel>(handleSelectedItem: (
241
239
  } | {
242
240
  readonly _tag: "CompletedUnlockScroll";
243
241
  } | {
244
- readonly _tag: "Closed";
245
- } | {
246
- readonly _tag: "CompletedClickItem";
247
- } | {
248
- readonly _tag: "CompletedScrollIntoView";
249
- } | {
250
- readonly _tag: "DeactivatedItem";
242
+ readonly _tag: "IgnoredMouseClick";
251
243
  } | {
252
- readonly _tag: "SuppressedItemCommit";
244
+ readonly _tag: "SuppressedSpaceScroll";
253
245
  } | {
254
246
  readonly _tag: "Opened";
255
247
  readonly maybeActiveItemIndex: Option.Option<number>;
@@ -259,6 +251,8 @@ export declare const makeUpdate: <Model extends BaseModel>(handleSelectedItem: (
259
251
  readonly _tag: "ActivatedItem";
260
252
  readonly index: number;
261
253
  readonly activationTrigger: "Keyboard" | "Pointer";
254
+ } | {
255
+ readonly _tag: "DeactivatedItem";
262
256
  } | {
263
257
  readonly _tag: "SelectedItem";
264
258
  readonly item: string;
@@ -277,16 +271,22 @@ export declare const makeUpdate: <Model extends BaseModel>(handleSelectedItem: (
277
271
  } | {
278
272
  readonly _tag: "CompletedDelayClearSearch";
279
273
  readonly version: number;
274
+ } | {
275
+ readonly _tag: "SuppressedItemCommit";
280
276
  } | {
281
277
  readonly _tag: "PressedPointerOnButton";
282
278
  readonly pointerType: string;
283
279
  readonly button: number;
284
280
  } | {
285
281
  readonly _tag: "CompletedAnchorListbox";
282
+ } | {
283
+ readonly _tag: "CompletedClickItem";
286
284
  } | {
287
285
  readonly _tag: "CompletedFocusItems";
288
286
  } | {
289
287
  readonly _tag: "CompletedPortalListboxBackdrop";
288
+ } | {
289
+ readonly _tag: "CompletedScrollIntoView";
290
290
  } | {
291
291
  readonly _tag: "GotAnimationMessage";
292
292
  readonly message: {
@@ -78,21 +78,23 @@ export declare const update: (model: {
78
78
  readonly maybeLastButtonPointerType: Option.Option<string>;
79
79
  };
80
80
  commands?: Update.Commands<{
81
- readonly _tag: "Closed";
82
- } | {
83
- readonly _tag: "CompletedFocusButton";
81
+ readonly _tag: "DeactivatedItem";
84
82
  } | {
85
- readonly _tag: "CompletedInertOthers";
83
+ readonly _tag: "SuppressedItemCommit";
86
84
  } | {
87
85
  readonly _tag: "CompletedLockScroll";
86
+ } | {
87
+ readonly _tag: "CompletedUnlockScroll";
88
+ } | {
89
+ readonly _tag: "CompletedInertOthers";
88
90
  } | {
89
91
  readonly _tag: "CompletedRestoreInert";
90
92
  } | {
91
- readonly _tag: "CompletedUnlockScroll";
93
+ readonly _tag: "CompletedScrollIntoView";
92
94
  } | {
93
- readonly _tag: "IgnoredMouseClick";
95
+ readonly _tag: "CompletedClickItem";
94
96
  } | {
95
- readonly _tag: "SuppressedSpaceScroll";
97
+ readonly _tag: "Closed";
96
98
  } | {
97
99
  readonly _tag: "ActivatedItem";
98
100
  readonly index: number;
@@ -101,19 +103,15 @@ export declare const update: (model: {
101
103
  readonly _tag: "BlurredItems";
102
104
  } | {
103
105
  readonly _tag: "CompletedAnchorListbox";
104
- } | {
105
- readonly _tag: "CompletedClickItem";
106
106
  } | {
107
107
  readonly _tag: "CompletedDelayClearSearch";
108
108
  readonly version: number;
109
+ } | {
110
+ readonly _tag: "CompletedFocusButton";
109
111
  } | {
110
112
  readonly _tag: "CompletedFocusItems";
111
113
  } | {
112
114
  readonly _tag: "CompletedPortalListboxBackdrop";
113
- } | {
114
- readonly _tag: "CompletedScrollIntoView";
115
- } | {
116
- readonly _tag: "DeactivatedItem";
117
115
  } | {
118
116
  readonly _tag: "GotAnimationMessage";
119
117
  readonly message: {
@@ -127,6 +125,8 @@ export declare const update: (model: {
127
125
  } | {
128
126
  readonly _tag: "Showed";
129
127
  };
128
+ } | {
129
+ readonly _tag: "IgnoredMouseClick";
130
130
  } | {
131
131
  readonly _tag: "MovedPointerOverItem";
132
132
  readonly index: number;
@@ -150,7 +150,7 @@ export declare const update: (model: {
150
150
  readonly _tag: "SelectedItem";
151
151
  readonly item: string;
152
152
  } | {
153
- readonly _tag: "SuppressedItemCommit";
153
+ readonly _tag: "SuppressedSpaceScroll";
154
154
  }, never>;
155
155
  outMessage?: Readonly<{
156
156
  readonly _tag: 'Selected';
@@ -253,31 +253,31 @@ export declare const update: (model: Model, message: Message) => Readonly<{
253
253
  }>;
254
254
  };
255
255
  commands?: Update.Commands<{
256
- readonly _tag: "Closed";
256
+ readonly _tag: "DeactivatedItem";
257
257
  } | {
258
- readonly _tag: "CompletedFocusButton";
258
+ readonly _tag: "CompletedLockScroll";
259
259
  } | {
260
- readonly _tag: "CompletedInertOthers";
260
+ readonly _tag: "CompletedUnlockScroll";
261
261
  } | {
262
- readonly _tag: "CompletedLockScroll";
262
+ readonly _tag: "CompletedInertOthers";
263
263
  } | {
264
264
  readonly _tag: "CompletedRestoreInert";
265
265
  } | {
266
- readonly _tag: "CompletedUnlockScroll";
266
+ readonly _tag: "CompletedScrollIntoView";
267
267
  } | {
268
- readonly _tag: "IgnoredMouseClick";
268
+ readonly _tag: "CompletedClickItem";
269
269
  } | {
270
- readonly _tag: "SuppressedSpaceScroll";
270
+ readonly _tag: "Closed";
271
271
  } | {
272
272
  readonly _tag: "BlurredItems";
273
273
  } | {
274
- readonly _tag: "CompletedClickItem";
274
+ readonly _tag: "CompletedFocusButton";
275
275
  } | {
276
276
  readonly _tag: "CompletedFocusItems";
277
277
  } | {
278
- readonly _tag: "CompletedScrollIntoView";
278
+ readonly _tag: "IgnoredMouseClick";
279
279
  } | {
280
- readonly _tag: "DeactivatedItem";
280
+ readonly _tag: "SuppressedSpaceScroll";
281
281
  } | {
282
282
  readonly _tag: "ActivatedItem";
283
283
  readonly index: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,MAAM,EAIP,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAI9E,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AA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EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;yEAEqE;IACrE,YAAY,CAAC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAA;CAC3C,CAAC,CAAA;AAEF;;;;uEAIuE;AACvE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAhDf;8EAC0E;WACnE,MAAM;YACL,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI;IAC9C;0DACsD;kBACxC,WAAW;IACzB;;;;wEAIoE;qBACnD,cAAc;IAC/B;;;iEAG6D;gBACjD,MAAM;gBACN,MAAM;qBACD,MAAM;kBACT,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM;IACvC;;;gCAG4B;iBACf,OAAO;IACpB;;;;;;;;eAQW;iBACE,OAAO;WACb,MAAM;IACb;;yEAEqE;mBACtD,MAAM,QAAQ,GAAG,UAAU;GA2J3C,CAAA"}
@@ -7,6 +7,7 @@ import { modifyFields } from 'foldkit/struct';
7
7
  import { defineView } from 'foldkit/submodel';
8
8
  import * as Subscription from 'foldkit/subscription';
9
9
  import { accessibleNameAttributes } from '../internal/accessibleName.js';
10
+ import { documentDragStyles } from '../internal/documentDragStyles.js';
10
11
  import { clamp, fractionOfValue, percentageFromFraction, } from '../internal/range.js';
11
12
  import { attributeSelector, idSelector } from '../internal/selectors.js';
12
13
  export { fractionOfValue } from '../internal/range.js';
@@ -221,36 +222,22 @@ export const subscriptionsForRoot = (getTrackRoot) => __foldkitBrandViewResult((
221
222
  const pointerEvents = Stream.merge(Stream.fromEventListener(document, 'pointermove').pipe(Stream.mapEffect(event => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((Option.map(findTrackElement(id, getTrackRoot()), track => __foldkitBrandViewResult((Message.MovedDragPointer({
222
223
  value: valueFromPointer(event.clientX, event.clientY, track, min, max),
223
224
  })), "@foldkit/ui/slider/index.js#anonymous~24"))), "@foldkit/ui/slider/index.js#anonymous~23"))), "@foldkit/ui/slider/index.js#anonymous~22")), Stream.filter(Option.isSome), Stream.map(option => __foldkitBrandViewResult((option.value), "@foldkit/ui/slider/index.js#anonymous~25"))), Stream.fromEventListener(document, 'pointerup').pipe(Stream.map(() => __foldkitBrandViewResult((Message.ReleasedDragPointer()), "@foldkit/ui/slider/index.js#anonymous~26"))));
224
- // NOTE: prevents text selection and locks cursor to grabbing while the
225
- // user drags the thumb. Matches the approach used in drag-and-drop.
226
- const documentDragStyles = Stream.callback(() => __foldkitBrandViewResult((Effect.acquireRelease(Effect.sync(() => {
227
- document.documentElement.style.setProperty('user-select', 'none');
228
- document.documentElement.style.setProperty('-webkit-user-select', 'none');
229
- const cursorStyle = document.createElement('style');
230
- cursorStyle.textContent = '* { cursor: grabbing !important; }';
231
- document.head.appendChild(cursorStyle);
232
- return __foldkitBrandViewResult((cursorStyle), "@foldkit/ui/slider/index.js#anonymous~28");
233
- }), cursorStyle => __foldkitBrandViewResult((Effect.sync(() => {
234
- document.documentElement.style.removeProperty('user-select');
235
- document.documentElement.style.removeProperty('-webkit-user-select');
236
- cursorStyle.remove();
237
- })), "@foldkit/ui/slider/index.js#anonymous~29")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@foldkit/ui/slider/index.js#anonymous~31")))), "@foldkit/ui/slider/index.js#anonymous~27"));
238
- return __foldkitBrandViewResult((Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/slider/index.js#anonymous~32")))), "@foldkit/ui/slider/index.js#dependenciesToStream");
225
+ return __foldkitBrandViewResult((Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/slider/index.js#anonymous~27")))), "@foldkit/ui/slider/index.js#dependenciesToStream");
239
226
  },
240
227
  }),
241
228
  dragEscape: entry({ dragActivity: DragActivity }, {
242
229
  modelToDependencies: model => (__foldkitBrandViewResult(({
243
230
  dragActivity: dragActivityFromModel(model),
244
231
  }), "@foldkit/ui/slider/index.js#modelToDependencies~2")),
245
- dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => __foldkitBrandViewResult((key === 'Escape'), "@foldkit/ui/slider/index.js#anonymous~33")), Stream.map(() => __foldkitBrandViewResult((Message.CancelledDrag()), "@foldkit/ui/slider/index.js#anonymous~34"))), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/slider/index.js#anonymous~35")))), "@foldkit/ui/slider/index.js#dependenciesToStream~2"),
232
+ dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => __foldkitBrandViewResult((key === 'Escape'), "@foldkit/ui/slider/index.js#anonymous~28")), Stream.map(() => __foldkitBrandViewResult((Message.CancelledDrag()), "@foldkit/ui/slider/index.js#anonymous~29"))), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/slider/index.js#anonymous~30")))), "@foldkit/ui/slider/index.js#dependenciesToStream~2"),
246
233
  }),
247
234
  }), "@foldkit/ui/slider/index.js#anonymous~21")))), "@foldkit/ui/slider/index.js#subscriptionsForRoot");
248
235
  /** Default drag Subscriptions, with the track looked up via `document`. */
249
- export const subscriptions = subscriptionsForRoot(() => __foldkitBrandViewResult((document), "@foldkit/ui/slider/index.js#anonymous~36"));
236
+ export const subscriptions = subscriptionsForRoot(() => __foldkitBrandViewResult((document), "@foldkit/ui/slider/index.js#anonymous~31"));
250
237
  // VIEW
251
238
  const LEFT_MOUSE_BUTTON = 0;
252
239
  const labelId = (id) => __foldkitBrandViewResult((`${id}-label`), "@foldkit/ui/slider/index.js#labelId");
253
- const keyToDirection = (key) => __foldkitBrandViewResult((Match.value(key).pipe(Match.withReturnType(), Match.whenOr('ArrowRight', 'ArrowUp', () => __foldkitBrandViewResult(('StepIncrement'), "@foldkit/ui/slider/index.js#anonymous~37")), Match.whenOr('ArrowLeft', 'ArrowDown', () => __foldkitBrandViewResult(('StepDecrement'), "@foldkit/ui/slider/index.js#anonymous~38")), Match.when('PageUp', () => __foldkitBrandViewResult(('PageIncrement'), "@foldkit/ui/slider/index.js#anonymous~39")), Match.when('PageDown', () => __foldkitBrandViewResult(('PageDecrement'), "@foldkit/ui/slider/index.js#anonymous~40")), Match.when('Home', () => __foldkitBrandViewResult(('Min'), "@foldkit/ui/slider/index.js#anonymous~41")), Match.when('End', () => __foldkitBrandViewResult(('Max'), "@foldkit/ui/slider/index.js#anonymous~42")), Match.option)), "@foldkit/ui/slider/index.js#keyToDirection");
240
+ const keyToDirection = (key) => __foldkitBrandViewResult((Match.value(key).pipe(Match.withReturnType(), Match.whenOr('ArrowRight', 'ArrowUp', () => __foldkitBrandViewResult(('StepIncrement'), "@foldkit/ui/slider/index.js#anonymous~32")), Match.whenOr('ArrowLeft', 'ArrowDown', () => __foldkitBrandViewResult(('StepDecrement'), "@foldkit/ui/slider/index.js#anonymous~33")), Match.when('PageUp', () => __foldkitBrandViewResult(('PageIncrement'), "@foldkit/ui/slider/index.js#anonymous~34")), Match.when('PageDown', () => __foldkitBrandViewResult(('PageDecrement'), "@foldkit/ui/slider/index.js#anonymous~35")), Match.when('Home', () => __foldkitBrandViewResult(('Min'), "@foldkit/ui/slider/index.js#anonymous~36")), Match.when('End', () => __foldkitBrandViewResult(('Max'), "@foldkit/ui/slider/index.js#anonymous~37")), Match.option)), "@foldkit/ui/slider/index.js#keyToDirection");
254
241
  /** Direction in which the Slider lays out its track and maps pointer input. */
255
242
  export const Orientation = Schema.Literals(['Horizontal', 'Vertical']);
256
243
  /** Whether the thumb's center or outer edge aligns with the track endpoints. */
@@ -263,7 +250,7 @@ const filledTrackStyle = (orientation, thumbAlignment, thumbSize, fraction) => _
263
250
  height: percentageFromFraction(fraction),
264
251
  width: '100%',
265
252
  'pointer-events': 'none',
266
- }), "@foldkit/ui/slider/index.js#anonymous~43"))), Match.when({ orientation: 'Vertical', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
253
+ }), "@foldkit/ui/slider/index.js#anonymous~38"))), Match.when({ orientation: 'Vertical', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
267
254
  position: 'absolute',
268
255
  bottom: '0',
269
256
  left: '0',
@@ -271,60 +258,60 @@ const filledTrackStyle = (orientation, thumbAlignment, thumbSize, fraction) => _
271
258
  height: `calc((100% - ${thumbSize}) * ${fraction} + ${thumbSize} / 2)`,
272
259
  width: '100%',
273
260
  'pointer-events': 'none',
274
- }), "@foldkit/ui/slider/index.js#anonymous~44"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Center' }, () => (__foldkitBrandViewResult(({
261
+ }), "@foldkit/ui/slider/index.js#anonymous~39"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Center' }, () => (__foldkitBrandViewResult(({
275
262
  position: 'absolute',
276
263
  left: '0',
277
264
  top: '0',
278
265
  bottom: '0',
279
266
  width: percentageFromFraction(fraction),
280
267
  'pointer-events': 'none',
281
- }), "@foldkit/ui/slider/index.js#anonymous~45"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
268
+ }), "@foldkit/ui/slider/index.js#anonymous~40"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
282
269
  position: 'absolute',
283
270
  left: '0',
284
271
  top: '0',
285
272
  bottom: '0',
286
273
  width: `calc((100% - ${thumbSize}) * ${fraction} + ${thumbSize} / 2)`,
287
274
  'pointer-events': 'none',
288
- }), "@foldkit/ui/slider/index.js#anonymous~46"))), Match.exhaustive)), "@foldkit/ui/slider/index.js#filledTrackStyle");
275
+ }), "@foldkit/ui/slider/index.js#anonymous~41"))), Match.exhaustive)), "@foldkit/ui/slider/index.js#filledTrackStyle");
289
276
  const thumbStyle = (orientation, thumbAlignment, thumbSize, fraction) => __foldkitBrandViewResult((Match.value({ orientation, thumbAlignment }).pipe(Match.withReturnType(), Match.when({ orientation: 'Vertical', thumbAlignment: 'Center' }, () => (__foldkitBrandViewResult(({
290
277
  position: 'absolute',
291
278
  bottom: percentageFromFraction(fraction),
292
279
  left: '50%',
293
280
  transform: 'translateX(-50%) translateY(50%)',
294
281
  'touch-action': 'none',
295
- }), "@foldkit/ui/slider/index.js#anonymous~47"))), Match.when({ orientation: 'Vertical', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
282
+ }), "@foldkit/ui/slider/index.js#anonymous~42"))), Match.when({ orientation: 'Vertical', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
296
283
  position: 'absolute',
297
284
  bottom: `calc((100% - ${thumbSize}) * ${fraction})`,
298
285
  left: '50%',
299
286
  transform: 'translateX(-50%)',
300
287
  'touch-action': 'none',
301
- }), "@foldkit/ui/slider/index.js#anonymous~48"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Center' }, () => (__foldkitBrandViewResult(({
288
+ }), "@foldkit/ui/slider/index.js#anonymous~43"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Center' }, () => (__foldkitBrandViewResult(({
302
289
  position: 'absolute',
303
290
  left: percentageFromFraction(fraction),
304
291
  transform: 'translateX(-50%)',
305
292
  'touch-action': 'none',
306
- }), "@foldkit/ui/slider/index.js#anonymous~49"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
293
+ }), "@foldkit/ui/slider/index.js#anonymous~44"))), Match.when({ orientation: 'Horizontal', thumbAlignment: 'Edge' }, () => (__foldkitBrandViewResult(({
307
294
  position: 'absolute',
308
295
  left: `calc((100% - ${thumbSize}) * ${fraction})`,
309
296
  'touch-action': 'none',
310
- }), "@foldkit/ui/slider/index.js#anonymous~50"))), Match.exhaustive)), "@foldkit/ui/slider/index.js#thumbStyle");
297
+ }), "@foldkit/ui/slider/index.js#anonymous~45"))), Match.exhaustive)), "@foldkit/ui/slider/index.js#thumbStyle");
311
298
  /** Renders an accessible slider by building ARIA attribute groups and
312
299
  * delegating layout to the consumer's `toView` callback. Follows the
313
300
  * WAI-ARIA slider pattern: role="slider" on the thumb, aria-valuemin /
314
301
  * aria-valuemax / aria-valuenow, keyboard navigation by step / page / home /
315
302
  * end. Pointer drag is handled by the Slider's drag Subscriptions. */
316
303
  export const view = defineView((model, viewInputs, h) => {
317
- const { value, formatValue, isDisabled = false, isReadOnly = false, name, orientation = 'Horizontal', thumbAlignment = 'Center', thumbSize = '0.75rem', getTrackRoot = () => __foldkitBrandViewResult((document), "@foldkit/ui/slider/index.js#anonymous~52"), } = viewInputs;
304
+ const { value, formatValue, isDisabled = false, isReadOnly = false, name, orientation = 'Horizontal', thumbAlignment = 'Center', thumbSize = '0.75rem', getTrackRoot = () => __foldkitBrandViewResult((document), "@foldkit/ui/slider/index.js#anonymous~47"), } = viewInputs;
318
305
  const { id, min, max } = model;
319
306
  const isDragging = model.dragState._tag === 'Dragging';
320
307
  const fraction = fractionOfValue(value, min, max);
321
- const handleKeyDown = (key) => __foldkitBrandViewResult((Option.map(keyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedKeyboardNavigation({ direction, value })), "@foldkit/ui/slider/index.js#anonymous~53"))), "@foldkit/ui/slider/index.js#handleKeyDown");
308
+ const handleKeyDown = (key) => __foldkitBrandViewResult((Option.map(keyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedKeyboardNavigation({ direction, value })), "@foldkit/ui/slider/index.js#anonymous~48"))), "@foldkit/ui/slider/index.js#handleKeyDown");
322
309
  const pressedPointerMessageAt = (clientX, clientY) => __foldkitBrandViewResult((Option.map(findTrackElement(id, getTrackRoot()), track => __foldkitBrandViewResult((Message.PressedPointer({
323
310
  value: valueFromPointer(clientX, clientY, track, min, max),
324
311
  originValue: value,
325
- })), "@foldkit/ui/slider/index.js#anonymous~54"))), "@foldkit/ui/slider/index.js#pressedPointerMessageAt");
326
- const trackPointerHandler = (_pointerType, button, _screenX, _screenY, _timeStamp, clientX, clientY) => __foldkitBrandViewResult((pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.flatMap(() => __foldkitBrandViewResult((pressedPointerMessageAt(clientX, clientY)), "@foldkit/ui/slider/index.js#anonymous~55")))), "@foldkit/ui/slider/index.js#trackPointerHandler");
327
- const thumbPointerHandler = (_pointerType, button) => __foldkitBrandViewResult((pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.map(() => __foldkitBrandViewResult((Message.PressedThumb({ originValue: value })), "@foldkit/ui/slider/index.js#anonymous~56")))), "@foldkit/ui/slider/index.js#thumbPointerHandler");
312
+ })), "@foldkit/ui/slider/index.js#anonymous~49"))), "@foldkit/ui/slider/index.js#pressedPointerMessageAt");
313
+ const trackPointerHandler = (_pointerType, button, _screenX, _screenY, _timeStamp, clientX, clientY) => __foldkitBrandViewResult((pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.flatMap(() => __foldkitBrandViewResult((pressedPointerMessageAt(clientX, clientY)), "@foldkit/ui/slider/index.js#anonymous~50")))), "@foldkit/ui/slider/index.js#trackPointerHandler");
314
+ const thumbPointerHandler = (_pointerType, button) => __foldkitBrandViewResult((pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.map(() => __foldkitBrandViewResult((Message.PressedThumb({ originValue: value })), "@foldkit/ui/slider/index.js#anonymous~51")))), "@foldkit/ui/slider/index.js#thumbPointerHandler");
328
315
  const stateAttributes = [
329
316
  ...(isDragging ? [h.DataAttribute('dragging', '')] : []),
330
317
  ...(isDisabled ? [h.DataAttribute('disabled', '')] : []),
@@ -393,5 +380,5 @@ export const view = defineView((model, viewInputs, h) => {
393
380
  thumb: childAttributes(thumbAttributes),
394
381
  label: childAttributes(labelAttributes),
395
382
  hiddenInput: childAttributes(hiddenInputAttributes),
396
- })), "@foldkit/ui/slider/index.js#anonymous~51");
383
+ })), "@foldkit/ui/slider/index.js#anonymous~46");
397
384
  });
@@ -71,9 +71,9 @@ export declare const update: (model: Model, message: Message) => Readonly<{
71
71
  } | {
72
72
  readonly _tag: "GotDialogMessage";
73
73
  readonly message: {
74
- readonly _tag: "RequestedOpen";
75
- } | {
76
74
  readonly _tag: "RequestedClose";
75
+ } | {
76
+ readonly _tag: "RequestedOpen";
77
77
  } | {
78
78
  readonly _tag: "CompletedCloseDialog";
79
79
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,EAGP,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAaxC,OAAO,EAIL,KAAK,UAAU,EAIf,UAAU,EACV,KAAK,OAAO,EAKb,MAAM,aAAa,CAAA;AAIpB;;oDAEoD;AACpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF;gFACgF;AAChF,eAAO,MAAM,mBAAmB;;;;;;;;iBAY9B,CAAA;AAIF;qEACqE;AACrE,eAAO,MAAM,mBAAmB;;;;;;;iBAW9B,CAAA;AAEF;;6EAE6E;AAC7E,eAAO,MAAM,WAAW,eAAgB,OAAO,UAAU,CAAC,IAAI,KAAG,MAM7D,CAAA;AAoCJ;;;;;;4EAM4E;AAC5E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiG/C,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
2
  import { Array, Duration, Effect, Match, Number, Option, Schema, Stream, pipe, } from 'effect';
3
+ import * as Browser from 'foldkit/browser';
3
4
  import * as Command from 'foldkit/command';
4
5
  import { modifyFields } from 'foldkit/struct';
5
6
  import * as Subscription from 'foldkit/subscription';
@@ -385,7 +386,7 @@ export const makeRuntime = (payloadSchema) => {
385
386
  }, {
386
387
  modelToDependencies: swipeDependencies,
387
388
  dependenciesToStream: ({ isSwipeEnabled, isAnyDragging }) => {
388
- const pointerMoveStream = Subscription.fromEvent({
389
+ const pointerMoveStream = Browser.streamFromEvent({
389
390
  target: document,
390
391
  type: 'pointermove',
391
392
  mapEvent: event => __foldkitBrandViewResult((MessageSchema.MovedSwipePointer({
@@ -393,7 +394,7 @@ export const makeRuntime = (payloadSchema) => {
393
394
  clientX: event.clientX,
394
395
  })), "@foldkit/ui/toast/update.js#mapEvent"),
395
396
  });
396
- const pointerUpStream = Subscription.fromEvent({
397
+ const pointerUpStream = Browser.streamFromEvent({
397
398
  target: document,
398
399
  type: 'pointerup',
399
400
  mapEvent: event => __foldkitBrandViewResult((MessageSchema.ReleasedSwipePointer({
@@ -401,7 +402,7 @@ export const makeRuntime = (payloadSchema) => {
401
402
  clientX: event.clientX,
402
403
  })), "@foldkit/ui/toast/update.js#mapEvent~2"),
403
404
  });
404
- const pointerCancelStream = Subscription.fromEvent({
405
+ const pointerCancelStream = Browser.streamFromEvent({
405
406
  target: document,
406
407
  type: 'pointercancel',
407
408
  mapEvent: event => __foldkitBrandViewResult((MessageSchema.CancelledSwipe({ pointerId: event.pointerId })), "@foldkit/ui/toast/update.js#mapEvent~3"),
@@ -415,7 +416,7 @@ export const makeRuntime = (payloadSchema) => {
415
416
  isAnyDragging: Schema.Boolean,
416
417
  }, {
417
418
  modelToDependencies: swipeDependencies,
418
- dependenciesToStream: ({ isSwipeEnabled, isAnyDragging }) => __foldkitBrandViewResult((Stream.when(Subscription.fromEventFilterMap({
419
+ dependenciesToStream: ({ isSwipeEnabled, isAnyDragging }) => __foldkitBrandViewResult((Stream.when(Browser.streamFromEventFilterMap({
419
420
  target: document,
420
421
  type: 'keydown',
421
422
  filterMapEvent: event => __foldkitBrandViewResult((pipe(Option.liftPredicate(event.key, key => __foldkitBrandViewResult((key === 'Escape'), "@foldkit/ui/toast/update.js#anonymous~49")), Option.map(() => __foldkitBrandViewResult((MessageSchema.PressedEscape()), "@foldkit/ui/toast/update.js#anonymous~50")))), "@foldkit/ui/toast/update.js#filterMapEvent"),