foldkit 0.100.0 → 0.101.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 (60) hide show
  1. package/README.md +38 -36
  2. package/dist/devTools/overlay.d.ts.map +1 -1
  3. package/dist/devTools/overlay.js +25 -40
  4. package/dist/devTools/store.d.ts.map +1 -1
  5. package/dist/devTools/store.js +50 -49
  6. package/dist/runtime/runtime.d.ts +10 -10
  7. package/dist/runtime/runtime.d.ts.map +1 -1
  8. package/dist/runtime/runtime.js +3 -2
  9. package/dist/runtime/subscription.d.ts +139 -19
  10. package/dist/runtime/subscription.d.ts.map +1 -1
  11. package/dist/runtime/subscription.js +90 -9
  12. package/dist/subscription/animationFrame.d.ts +23 -26
  13. package/dist/subscription/animationFrame.d.ts.map +1 -1
  14. package/dist/subscription/animationFrame.js +17 -18
  15. package/dist/subscription/public.d.ts +2 -2
  16. package/dist/subscription/public.d.ts.map +1 -1
  17. package/dist/subscription/public.js +1 -1
  18. package/dist/test/apps/bubbling.d.ts.map +1 -1
  19. package/dist/test/apps/bubbling.js +7 -5
  20. package/dist/test/apps/counter.d.ts.map +1 -1
  21. package/dist/test/apps/counter.js +8 -6
  22. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  23. package/dist/test/apps/disabledButton.js +32 -21
  24. package/dist/test/apps/fileUpload.d.ts.map +1 -1
  25. package/dist/test/apps/fileUpload.js +18 -16
  26. package/dist/test/apps/interactions.d.ts.map +1 -1
  27. package/dist/test/apps/interactions.js +21 -19
  28. package/dist/test/apps/keypress.d.ts.map +1 -1
  29. package/dist/test/apps/keypress.js +12 -10
  30. package/dist/test/apps/login.d.ts.map +1 -1
  31. package/dist/test/apps/login.js +38 -36
  32. package/dist/test/apps/logoutButton.d.ts.map +1 -1
  33. package/dist/test/apps/logoutButton.js +4 -2
  34. package/dist/test/apps/mountPanel.d.ts.map +1 -1
  35. package/dist/test/apps/mountPanel.js +29 -21
  36. package/dist/test/apps/multiRole.d.ts.map +1 -1
  37. package/dist/test/apps/multiRole.js +6 -4
  38. package/dist/test/apps/pointer.d.ts.map +1 -1
  39. package/dist/test/apps/pointer.js +15 -13
  40. package/dist/test/apps/resumeUpload.d.ts.map +1 -1
  41. package/dist/test/apps/resumeUpload.js +20 -15
  42. package/dist/ui/dragAndDrop/index.d.ts +383 -101
  43. package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
  44. package/dist/ui/dragAndDrop/index.js +19 -24
  45. package/dist/ui/dragAndDrop/public.d.ts +1 -1
  46. package/dist/ui/dragAndDrop/public.d.ts.map +1 -1
  47. package/dist/ui/dragAndDrop/public.js +1 -1
  48. package/dist/ui/slider/index.d.ts +193 -87
  49. package/dist/ui/slider/index.d.ts.map +1 -1
  50. package/dist/ui/slider/index.js +12 -19
  51. package/dist/ui/slider/public.d.ts +1 -1
  52. package/dist/ui/slider/public.d.ts.map +1 -1
  53. package/dist/ui/slider/public.js +1 -1
  54. package/dist/ui/virtualList/index.d.ts +45 -39
  55. package/dist/ui/virtualList/index.d.ts.map +1 -1
  56. package/dist/ui/virtualList/index.js +5 -12
  57. package/dist/ui/virtualList/public.d.ts +1 -1
  58. package/dist/ui/virtualList/public.d.ts.map +1 -1
  59. package/dist/ui/virtualList/public.js +1 -1
  60. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Effect, Option, Schema as S } from 'effect';
1
+ import { Effect, Equivalence, Option, Schema as S, Stream } from 'effect';
2
2
  import * as Command from '../../command/index.js';
3
3
  import { type Attribute } from '../../html/index.js';
4
4
  declare const DropTarget: S.Struct<{
@@ -151,119 +151,401 @@ type UpdateReturn = readonly [
151
151
  ];
152
152
  /** Processes a drag-and-drop message and returns the next model, commands, and an optional out-message for the parent. */
153
153
  export declare const update: (model: Model, message: Message) => UpdateReturn;
154
- /** Schema describing the subscription dependencies for document-level drag tracking. */
155
- export declare const SubscriptionDependencies: S.Struct<{
156
- readonly documentPointer: S.Struct<{
157
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
158
- readonly orientation: S.Literals<readonly ["Horizontal", "Vertical"]>;
159
- }>;
160
- readonly documentEscape: S.Struct<{
161
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
162
- }>;
163
- readonly documentKeyboard: S.Struct<{
164
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
165
- }>;
166
- readonly autoScroll: S.Struct<{
167
- readonly isDragging: S.Boolean;
168
- readonly clientY: S.Number;
169
- }>;
170
- }>;
171
154
  /** Document-level subscriptions for pointer and keyboard events during drag operations. */
172
- export declare const subscriptions: import("../../runtime/subscription.js").Subscriptions<{
173
- readonly id: string;
174
- readonly orientation: "Vertical" | "Horizontal";
175
- readonly activationThreshold: number;
176
- readonly dragState: {
177
- readonly _tag: "Idle";
178
- } | {
179
- readonly _tag: "Pending";
180
- readonly itemId: string;
181
- readonly containerId: string;
182
- readonly index: number;
183
- readonly origin: {
155
+ export declare const subscriptions: {
156
+ readonly documentPointer: {
157
+ readonly dependenciesSchema: S.Schema<{
158
+ readonly dragActivity: "Idle" | "Active";
159
+ readonly orientation: "Vertical" | "Horizontal";
160
+ }> & {
161
+ readonly fields: S.Struct.Fields;
162
+ };
163
+ readonly modelToDependencies: (model: {
164
+ readonly id: string;
165
+ readonly orientation: "Vertical" | "Horizontal";
166
+ readonly activationThreshold: number;
167
+ readonly dragState: {
168
+ readonly _tag: "Idle";
169
+ } | {
170
+ readonly _tag: "Pending";
171
+ readonly itemId: string;
172
+ readonly containerId: string;
173
+ readonly index: number;
174
+ readonly origin: {
175
+ readonly screenX: number;
176
+ readonly screenY: number;
177
+ };
178
+ } | {
179
+ readonly _tag: "Dragging";
180
+ readonly itemId: string;
181
+ readonly sourceContainerId: string;
182
+ readonly sourceIndex: number;
183
+ readonly origin: {
184
+ readonly screenX: number;
185
+ readonly screenY: number;
186
+ };
187
+ readonly current: {
188
+ readonly clientX: number;
189
+ readonly clientY: number;
190
+ };
191
+ readonly maybeDropTarget: Option.Option<{
192
+ readonly containerId: string;
193
+ readonly index: number;
194
+ }>;
195
+ } | {
196
+ readonly _tag: "KeyboardDragging";
197
+ readonly itemId: string;
198
+ readonly sourceContainerId: string;
199
+ readonly sourceIndex: number;
200
+ readonly targetContainerId: string;
201
+ readonly targetIndex: number;
202
+ };
203
+ }) => {
204
+ readonly dragActivity: "Idle" | "Active";
205
+ readonly orientation: "Vertical" | "Horizontal";
206
+ };
207
+ readonly keepAliveEquivalence?: never;
208
+ readonly dependenciesToStream: (dependencies: {
209
+ readonly dragActivity: "Idle" | "Active";
210
+ readonly orientation: "Vertical" | "Horizontal";
211
+ }) => Stream.Stream<{
212
+ readonly _tag: "CancelledDrag";
213
+ } | {
214
+ readonly _tag: "PressedDraggable";
215
+ readonly itemId: string;
216
+ readonly containerId: string;
217
+ readonly index: number;
184
218
  readonly screenX: number;
185
219
  readonly screenY: number;
186
- };
187
- } | {
188
- readonly _tag: "Dragging";
189
- readonly itemId: string;
190
- readonly sourceContainerId: string;
191
- readonly sourceIndex: number;
192
- readonly origin: {
220
+ } | {
221
+ readonly _tag: "MovedPointer";
193
222
  readonly screenX: number;
194
223
  readonly screenY: number;
224
+ readonly clientX: number;
225
+ readonly clientY: number;
226
+ readonly maybeDropTarget: Option.Option<{
227
+ readonly containerId: string;
228
+ readonly index: number;
229
+ }>;
230
+ } | {
231
+ readonly _tag: "ReleasedPointer";
232
+ } | {
233
+ readonly _tag: "ActivatedKeyboardDrag";
234
+ readonly itemId: string;
235
+ readonly containerId: string;
236
+ readonly index: number;
237
+ } | {
238
+ readonly _tag: "ResolvedKeyboardMove";
239
+ readonly targetContainerId: string;
240
+ readonly targetIndex: number;
241
+ } | {
242
+ readonly _tag: "ConfirmedKeyboardDrop";
243
+ } | {
244
+ readonly _tag: "PressedArrowKey";
245
+ readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
246
+ } | {
247
+ readonly _tag: "CompletedAutoScroll";
248
+ } | {
249
+ readonly _tag: "CompletedFocusItem";
250
+ }, never, never>;
251
+ } & {
252
+ readonly __subscription: never;
253
+ };
254
+ readonly documentEscape: {
255
+ readonly dependenciesSchema: S.Schema<{
256
+ readonly dragActivity: "Idle" | "Active";
257
+ }> & {
258
+ readonly fields: S.Struct.Fields;
259
+ };
260
+ readonly modelToDependencies: (model: {
261
+ readonly id: string;
262
+ readonly orientation: "Vertical" | "Horizontal";
263
+ readonly activationThreshold: number;
264
+ readonly dragState: {
265
+ readonly _tag: "Idle";
266
+ } | {
267
+ readonly _tag: "Pending";
268
+ readonly itemId: string;
269
+ readonly containerId: string;
270
+ readonly index: number;
271
+ readonly origin: {
272
+ readonly screenX: number;
273
+ readonly screenY: number;
274
+ };
275
+ } | {
276
+ readonly _tag: "Dragging";
277
+ readonly itemId: string;
278
+ readonly sourceContainerId: string;
279
+ readonly sourceIndex: number;
280
+ readonly origin: {
281
+ readonly screenX: number;
282
+ readonly screenY: number;
283
+ };
284
+ readonly current: {
285
+ readonly clientX: number;
286
+ readonly clientY: number;
287
+ };
288
+ readonly maybeDropTarget: Option.Option<{
289
+ readonly containerId: string;
290
+ readonly index: number;
291
+ }>;
292
+ } | {
293
+ readonly _tag: "KeyboardDragging";
294
+ readonly itemId: string;
295
+ readonly sourceContainerId: string;
296
+ readonly sourceIndex: number;
297
+ readonly targetContainerId: string;
298
+ readonly targetIndex: number;
299
+ };
300
+ }) => {
301
+ readonly dragActivity: "Idle" | "Active";
195
302
  };
196
- readonly current: {
303
+ readonly keepAliveEquivalence?: never;
304
+ readonly dependenciesToStream: (dependencies: {
305
+ readonly dragActivity: "Idle" | "Active";
306
+ }) => Stream.Stream<{
307
+ readonly _tag: "CancelledDrag";
308
+ } | {
309
+ readonly _tag: "PressedDraggable";
310
+ readonly itemId: string;
311
+ readonly containerId: string;
312
+ readonly index: number;
313
+ readonly screenX: number;
314
+ readonly screenY: number;
315
+ } | {
316
+ readonly _tag: "MovedPointer";
317
+ readonly screenX: number;
318
+ readonly screenY: number;
197
319
  readonly clientX: number;
198
320
  readonly clientY: number;
321
+ readonly maybeDropTarget: Option.Option<{
322
+ readonly containerId: string;
323
+ readonly index: number;
324
+ }>;
325
+ } | {
326
+ readonly _tag: "ReleasedPointer";
327
+ } | {
328
+ readonly _tag: "ActivatedKeyboardDrag";
329
+ readonly itemId: string;
330
+ readonly containerId: string;
331
+ readonly index: number;
332
+ } | {
333
+ readonly _tag: "ResolvedKeyboardMove";
334
+ readonly targetContainerId: string;
335
+ readonly targetIndex: number;
336
+ } | {
337
+ readonly _tag: "ConfirmedKeyboardDrop";
338
+ } | {
339
+ readonly _tag: "PressedArrowKey";
340
+ readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
341
+ } | {
342
+ readonly _tag: "CompletedAutoScroll";
343
+ } | {
344
+ readonly _tag: "CompletedFocusItem";
345
+ }, never, never>;
346
+ } & {
347
+ readonly __subscription: never;
348
+ };
349
+ readonly documentKeyboard: {
350
+ readonly dependenciesSchema: S.Schema<{
351
+ readonly dragActivity: "Idle" | "Active";
352
+ }> & {
353
+ readonly fields: S.Struct.Fields;
354
+ };
355
+ readonly modelToDependencies: (model: {
356
+ readonly id: string;
357
+ readonly orientation: "Vertical" | "Horizontal";
358
+ readonly activationThreshold: number;
359
+ readonly dragState: {
360
+ readonly _tag: "Idle";
361
+ } | {
362
+ readonly _tag: "Pending";
363
+ readonly itemId: string;
364
+ readonly containerId: string;
365
+ readonly index: number;
366
+ readonly origin: {
367
+ readonly screenX: number;
368
+ readonly screenY: number;
369
+ };
370
+ } | {
371
+ readonly _tag: "Dragging";
372
+ readonly itemId: string;
373
+ readonly sourceContainerId: string;
374
+ readonly sourceIndex: number;
375
+ readonly origin: {
376
+ readonly screenX: number;
377
+ readonly screenY: number;
378
+ };
379
+ readonly current: {
380
+ readonly clientX: number;
381
+ readonly clientY: number;
382
+ };
383
+ readonly maybeDropTarget: Option.Option<{
384
+ readonly containerId: string;
385
+ readonly index: number;
386
+ }>;
387
+ } | {
388
+ readonly _tag: "KeyboardDragging";
389
+ readonly itemId: string;
390
+ readonly sourceContainerId: string;
391
+ readonly sourceIndex: number;
392
+ readonly targetContainerId: string;
393
+ readonly targetIndex: number;
394
+ };
395
+ }) => {
396
+ readonly dragActivity: "Idle" | "Active";
199
397
  };
200
- readonly maybeDropTarget: Option.Option<{
398
+ readonly keepAliveEquivalence?: never;
399
+ readonly dependenciesToStream: (dependencies: {
400
+ readonly dragActivity: "Idle" | "Active";
401
+ }) => Stream.Stream<{
402
+ readonly _tag: "CancelledDrag";
403
+ } | {
404
+ readonly _tag: "PressedDraggable";
405
+ readonly itemId: string;
406
+ readonly containerId: string;
407
+ readonly index: number;
408
+ readonly screenX: number;
409
+ readonly screenY: number;
410
+ } | {
411
+ readonly _tag: "MovedPointer";
412
+ readonly screenX: number;
413
+ readonly screenY: number;
414
+ readonly clientX: number;
415
+ readonly clientY: number;
416
+ readonly maybeDropTarget: Option.Option<{
417
+ readonly containerId: string;
418
+ readonly index: number;
419
+ }>;
420
+ } | {
421
+ readonly _tag: "ReleasedPointer";
422
+ } | {
423
+ readonly _tag: "ActivatedKeyboardDrag";
424
+ readonly itemId: string;
201
425
  readonly containerId: string;
202
426
  readonly index: number;
427
+ } | {
428
+ readonly _tag: "ResolvedKeyboardMove";
429
+ readonly targetContainerId: string;
430
+ readonly targetIndex: number;
431
+ } | {
432
+ readonly _tag: "ConfirmedKeyboardDrop";
433
+ } | {
434
+ readonly _tag: "PressedArrowKey";
435
+ readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
436
+ } | {
437
+ readonly _tag: "CompletedAutoScroll";
438
+ } | {
439
+ readonly _tag: "CompletedFocusItem";
440
+ }, never, never>;
441
+ } & {
442
+ readonly __subscription: never;
443
+ };
444
+ readonly autoScroll: {
445
+ readonly dependenciesSchema: S.Schema<{
446
+ readonly isDragging: boolean;
447
+ readonly clientY: number;
448
+ }> & {
449
+ readonly fields: S.Struct.Fields;
450
+ };
451
+ readonly modelToDependencies: (model: {
452
+ readonly id: string;
453
+ readonly orientation: "Vertical" | "Horizontal";
454
+ readonly activationThreshold: number;
455
+ readonly dragState: {
456
+ readonly _tag: "Idle";
457
+ } | {
458
+ readonly _tag: "Pending";
459
+ readonly itemId: string;
460
+ readonly containerId: string;
461
+ readonly index: number;
462
+ readonly origin: {
463
+ readonly screenX: number;
464
+ readonly screenY: number;
465
+ };
466
+ } | {
467
+ readonly _tag: "Dragging";
468
+ readonly itemId: string;
469
+ readonly sourceContainerId: string;
470
+ readonly sourceIndex: number;
471
+ readonly origin: {
472
+ readonly screenX: number;
473
+ readonly screenY: number;
474
+ };
475
+ readonly current: {
476
+ readonly clientX: number;
477
+ readonly clientY: number;
478
+ };
479
+ readonly maybeDropTarget: Option.Option<{
480
+ readonly containerId: string;
481
+ readonly index: number;
482
+ }>;
483
+ } | {
484
+ readonly _tag: "KeyboardDragging";
485
+ readonly itemId: string;
486
+ readonly sourceContainerId: string;
487
+ readonly sourceIndex: number;
488
+ readonly targetContainerId: string;
489
+ readonly targetIndex: number;
490
+ };
491
+ }) => {
492
+ readonly isDragging: boolean;
493
+ readonly clientY: number;
494
+ };
495
+ readonly keepAliveEquivalence: Equivalence.Equivalence<{
496
+ readonly isDragging: boolean;
497
+ readonly clientY: number;
203
498
  }>;
204
- } | {
205
- readonly _tag: "KeyboardDragging";
206
- readonly itemId: string;
207
- readonly sourceContainerId: string;
208
- readonly sourceIndex: number;
209
- readonly targetContainerId: string;
210
- readonly targetIndex: number;
499
+ readonly dependenciesToStream: (dependencies: {
500
+ readonly isDragging: boolean;
501
+ readonly clientY: number;
502
+ }, readDependencies: () => {
503
+ readonly isDragging: boolean;
504
+ readonly clientY: number;
505
+ }) => Stream.Stream<{
506
+ readonly _tag: "CancelledDrag";
507
+ } | {
508
+ readonly _tag: "PressedDraggable";
509
+ readonly itemId: string;
510
+ readonly containerId: string;
511
+ readonly index: number;
512
+ readonly screenX: number;
513
+ readonly screenY: number;
514
+ } | {
515
+ readonly _tag: "MovedPointer";
516
+ readonly screenX: number;
517
+ readonly screenY: number;
518
+ readonly clientX: number;
519
+ readonly clientY: number;
520
+ readonly maybeDropTarget: Option.Option<{
521
+ readonly containerId: string;
522
+ readonly index: number;
523
+ }>;
524
+ } | {
525
+ readonly _tag: "ReleasedPointer";
526
+ } | {
527
+ readonly _tag: "ActivatedKeyboardDrag";
528
+ readonly itemId: string;
529
+ readonly containerId: string;
530
+ readonly index: number;
531
+ } | {
532
+ readonly _tag: "ResolvedKeyboardMove";
533
+ readonly targetContainerId: string;
534
+ readonly targetIndex: number;
535
+ } | {
536
+ readonly _tag: "ConfirmedKeyboardDrop";
537
+ } | {
538
+ readonly _tag: "PressedArrowKey";
539
+ readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
540
+ } | {
541
+ readonly _tag: "CompletedAutoScroll";
542
+ } | {
543
+ readonly _tag: "CompletedFocusItem";
544
+ }, never, never>;
545
+ } & {
546
+ readonly __subscription: never;
211
547
  };
212
- }, {
213
- readonly _tag: "CancelledDrag";
214
- } | {
215
- readonly _tag: "PressedDraggable";
216
- readonly itemId: string;
217
- readonly containerId: string;
218
- readonly index: number;
219
- readonly screenX: number;
220
- readonly screenY: number;
221
- } | {
222
- readonly _tag: "MovedPointer";
223
- readonly screenX: number;
224
- readonly screenY: number;
225
- readonly clientX: number;
226
- readonly clientY: number;
227
- readonly maybeDropTarget: Option.Option<{
228
- readonly containerId: string;
229
- readonly index: number;
230
- }>;
231
- } | {
232
- readonly _tag: "ReleasedPointer";
233
- } | {
234
- readonly _tag: "ActivatedKeyboardDrag";
235
- readonly itemId: string;
236
- readonly containerId: string;
237
- readonly index: number;
238
- } | {
239
- readonly _tag: "ResolvedKeyboardMove";
240
- readonly targetContainerId: string;
241
- readonly targetIndex: number;
242
- } | {
243
- readonly _tag: "ConfirmedKeyboardDrop";
244
- } | {
245
- readonly _tag: "PressedArrowKey";
246
- readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
247
- } | {
248
- readonly _tag: "CompletedAutoScroll";
249
- } | {
250
- readonly _tag: "CompletedFocusItem";
251
- }, S.Struct<{
252
- readonly documentPointer: S.Struct<{
253
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
254
- readonly orientation: S.Literals<readonly ["Horizontal", "Vertical"]>;
255
- }>;
256
- readonly documentEscape: S.Struct<{
257
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
258
- }>;
259
- readonly documentKeyboard: S.Struct<{
260
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
261
- }>;
262
- readonly autoScroll: S.Struct<{
263
- readonly isDragging: S.Boolean;
264
- readonly clientY: S.Number;
265
- }>;
266
- }>, never>;
548
+ };
267
549
  /** Messages the draggable view helper can dispatch. */
268
550
  export type DraggableMessage = typeof PressedDraggable.Type | typeof ActivatedKeyboardDrag.Type;
269
551
  /** Configuration for creating draggable attributes with `draggable`. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dragAndDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAIN,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EAAE,KAAK,SAAS,EAAQ,MAAM,qBAAqB,CAAA;AAoB1D,QAAA,MAAM,UAAU;;;EAGd,CAAA;AA8BF,mHAAmH;AACnH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,sDAAsD;AACtD,eAAO,MAAM,gBAAgB;;;;;;EAM3B,CAAA;AACF,yEAAyE;AACzE,eAAO,MAAM,YAAY;;;;;;;;;EAMvB,CAAA;AACF,gCAAgC;AAChC,eAAO,MAAM,eAAe,6EAAuB,CAA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AA;IAC7D,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC,CAAA;AAEF,0HAA0H;AAC1H,eAAO,MAAM,SAAS,GAAI,aAAa,EACrC,QAAQ,eAAe,CAAC,aAAa,CAAC,KACrC,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CA6DxC,CAAA;AAED,+EAA+E;AAC/E,eAAO,MAAM,SAAS,GAAI,aAAa,EACrC,aAAa,MAAM,EACnB,QAAQ,MAAM,KACb,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAOxC,CAAA;AAED,8GAA8G;AAC9G,eAAO,MAAM,QAAQ,GAAI,aAAa,EACpC,QAAQ,MAAM,KACb,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAGxC,CAAA;AAKD,kGAAkG;AAClG,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcpC,CAAA;AAEH,kFAAkF;AAClF,eAAO,MAAM,UAAU,GAAI,yBAAyB,KAAK,KAAG,OACR,CAAA;AAEpD,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,GAAI,OAAO,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAMnE,CAAA;AAEH,oJAAoJ;AACpJ,eAAO,MAAM,eAAe,GAC1B,OAAO,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,IAAI,CAUpC,CAAA"}
@@ -3,7 +3,7 @@ import * as Command from '../../command/index.js';
3
3
  import * as Dom from '../../dom/index.js';
4
4
  import { html } from '../../html/index.js';
5
5
  import { m } from '../../message/index.js';
6
- import { makeSubscriptions } from '../../runtime/subscription.js';
6
+ import * as Subscription from '../../runtime/subscription.js';
7
7
  import { ts } from '../../schema/index.js';
8
8
  import { evo } from '../../struct/index.js';
9
9
  // MODEL
@@ -365,22 +365,12 @@ const autoScroll = (clientY) => {
365
365
  const pointerDragActivityFromModel = (model) => M.value(model.dragState).pipe(M.withReturnType(), M.tag('Pending', 'Dragging', () => 'Active'), M.orElse(() => 'Idle'));
366
366
  const dragActivityFromModel = (model) => M.value(model.dragState).pipe(M.withReturnType(), M.tag('Idle', () => 'Idle'), M.orElse(() => 'Active'));
367
367
  const keyboardDragActivityFromModel = (model) => M.value(model.dragState).pipe(M.withReturnType(), M.tag('KeyboardDragging', () => 'Active'), M.orElse(() => 'Idle'));
368
- /** Schema describing the subscription dependencies for document-level drag tracking. */
369
- export const SubscriptionDependencies = S.Struct({
370
- documentPointer: S.Struct({
368
+ /** Document-level subscriptions for pointer and keyboard events during drag operations. */
369
+ export const subscriptions = Subscription.make()(entry => ({
370
+ documentPointer: entry({
371
371
  dragActivity: PointerDragActivity,
372
372
  orientation: Orientation,
373
- }),
374
- documentEscape: S.Struct({ dragActivity: DragActivity }),
375
- documentKeyboard: S.Struct({ dragActivity: KeyboardDragActivity }),
376
- autoScroll: S.Struct({
377
- isDragging: S.Boolean,
378
- clientY: S.Number,
379
- }),
380
- });
381
- /** Document-level subscriptions for pointer and keyboard events during drag operations. */
382
- export const subscriptions = makeSubscriptions(SubscriptionDependencies)({
383
- documentPointer: {
373
+ }, {
384
374
  modelToDependencies: model => ({
385
375
  dragActivity: pointerDragActivityFromModel(model),
386
376
  orientation: model.orientation,
@@ -410,14 +400,14 @@ export const subscriptions = makeSubscriptions(SubscriptionDependencies)({
410
400
  })).pipe(Effect.flatMap(() => Effect.never)));
411
401
  return Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => dragActivity === 'Active'));
412
402
  },
413
- },
414
- documentEscape: {
403
+ }),
404
+ documentEscape: entry({ dragActivity: DragActivity }, {
415
405
  modelToDependencies: model => ({
416
406
  dragActivity: dragActivityFromModel(model),
417
407
  }),
418
408
  dependenciesToStream: ({ dragActivity }) => Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => key === 'Escape'), Stream.map(() => CancelledDrag())), Effect.sync(() => dragActivity === 'Active')),
419
- },
420
- documentKeyboard: {
409
+ }),
410
+ documentKeyboard: entry({ dragActivity: KeyboardDragActivity }, {
421
411
  modelToDependencies: model => ({
422
412
  dragActivity: keyboardDragActivityFromModel(model),
423
413
  }),
@@ -445,15 +435,20 @@ export const subscriptions = makeSubscriptions(SubscriptionDependencies)({
445
435
  return PressedArrowKey({ direction });
446
436
  });
447
437
  })), Stream.filter(Option.isSome), Stream.map(option => option.value)), Effect.sync(() => dragActivity === 'Active')),
448
- },
449
- autoScroll: {
438
+ }),
439
+ autoScroll: entry({
440
+ isDragging: S.Boolean,
441
+ clientY: S.Number,
442
+ }, {
450
443
  modelToDependencies: model => ({
451
444
  isDragging: model.dragState._tag === 'Dragging',
452
445
  clientY: model.dragState._tag === 'Dragging'
453
446
  ? model.dragState.current.clientY
454
447
  : 0,
455
448
  }),
456
- equivalence: Equivalence.Struct({ isDragging: Equivalence.Boolean }),
449
+ keepAliveEquivalence: Equivalence.Struct({
450
+ isDragging: Equivalence.Boolean,
451
+ }),
457
452
  dependenciesToStream: ({ isDragging }, readDependencies) => Stream.when(Stream.callback(queue => Effect.acquireRelease(Effect.sync(() => {
458
453
  const ref = { id: 0 };
459
454
  const step = () => {
@@ -464,8 +459,8 @@ export const subscriptions = makeSubscriptions(SubscriptionDependencies)({
464
459
  ref.id = requestAnimationFrame(step);
465
460
  return ref;
466
461
  }), ref => Effect.sync(() => cancelAnimationFrame(ref.id))).pipe(Effect.flatMap(() => Effect.never))), Effect.sync(() => isDragging)),
467
- },
468
- });
462
+ }),
463
+ }));
469
464
  // VIEW
470
465
  const LEFT_MOUSE_BUTTON = 0;
471
466
  const arrowKeyToDirection = (key) => M.value(key).pipe(M.withReturnType(), M.when('ArrowUp', () => 'Up'), M.when('ArrowDown', () => 'Down'), M.when('ArrowLeft', () => 'Left'), M.when('ArrowRight', () => 'Right'), M.option);
@@ -1,3 +1,3 @@
1
- export { init, update, draggable, droppable, sortable, ghostStyle, isDragging, maybeDraggedItemId, maybeDropTarget, subscriptions, SubscriptionDependencies, Model, Message, OutMessage, PressedDraggable, MovedPointer, ReleasedPointer, CancelledDrag, ActivatedKeyboardDrag, ResolvedKeyboardMove, ConfirmedKeyboardDrop, PressedArrowKey, CompletedAutoScroll, CompletedFocusItem, FocusItem, ResolveKeyboardMove, Reordered, Cancelled, } from './index.js';
1
+ export { init, update, draggable, droppable, sortable, ghostStyle, isDragging, maybeDraggedItemId, maybeDropTarget, subscriptions, Model, Message, OutMessage, PressedDraggable, MovedPointer, ReleasedPointer, CancelledDrag, ActivatedKeyboardDrag, ResolvedKeyboardMove, ConfirmedKeyboardDrop, PressedArrowKey, CompletedAutoScroll, CompletedFocusItem, FocusItem, ResolveKeyboardMove, Reordered, Cancelled, } from './index.js';
2
2
  export type { InitConfig, DraggableConfig, DraggableMessage } from './index.js';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/dragAndDrop/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,KAAK,EACL,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,SAAS,GACV,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/dragAndDrop/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,KAAK,EACL,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,SAAS,GACV,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA"}
@@ -1 +1 @@
1
- export { init, update, draggable, droppable, sortable, ghostStyle, isDragging, maybeDraggedItemId, maybeDropTarget, subscriptions, SubscriptionDependencies, Model, Message, OutMessage, PressedDraggable, MovedPointer, ReleasedPointer, CancelledDrag, ActivatedKeyboardDrag, ResolvedKeyboardMove, ConfirmedKeyboardDrop, PressedArrowKey, CompletedAutoScroll, CompletedFocusItem, FocusItem, ResolveKeyboardMove, Reordered, Cancelled, } from './index.js';
1
+ export { init, update, draggable, droppable, sortable, ghostStyle, isDragging, maybeDraggedItemId, maybeDropTarget, subscriptions, Model, Message, OutMessage, PressedDraggable, MovedPointer, ReleasedPointer, CancelledDrag, ActivatedKeyboardDrag, ResolvedKeyboardMove, ConfirmedKeyboardDrop, PressedArrowKey, CompletedAutoScroll, CompletedFocusItem, FocusItem, ResolveKeyboardMove, Reordered, Cancelled, } from './index.js';