@gjermundgaraba-designs/pixel-paper 0.13.0 → 0.14.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 (130) hide show
  1. package/DESIGN.md +29 -22
  2. package/dist/src/announcer/announcer.d.ts +34 -26
  3. package/dist/src/announcer/announcer.d.ts.map +1 -1
  4. package/dist/src/announcer/announcer.js +42 -32
  5. package/dist/src/announcer/index.d.ts +1 -1
  6. package/dist/src/announcer/index.d.ts.map +1 -1
  7. package/dist/src/announcer/index.js +1 -1
  8. package/dist/src/banner/banner.d.ts +1 -1
  9. package/dist/src/banner/banner.js +1 -1
  10. package/dist/src/barChart/barChart.js +1 -1
  11. package/dist/src/board/board.d.ts +1 -4
  12. package/dist/src/board/board.d.ts.map +1 -1
  13. package/dist/src/board/board.js +8 -71
  14. package/dist/src/button/button.d.ts +1 -1
  15. package/dist/src/button/button.js +1 -1
  16. package/dist/src/card/card.d.ts +35 -9
  17. package/dist/src/card/card.d.ts.map +1 -1
  18. package/dist/src/card/card.js +46 -8
  19. package/dist/src/card/index.d.ts +2 -2
  20. package/dist/src/card/index.d.ts.map +1 -1
  21. package/dist/src/card/index.js +1 -1
  22. package/dist/src/commandPalette/commandPalette.d.ts +4 -0
  23. package/dist/src/commandPalette/commandPalette.d.ts.map +1 -1
  24. package/dist/src/confirmDialog/confirmDialog.d.ts +18 -26
  25. package/dist/src/confirmDialog/confirmDialog.d.ts.map +1 -1
  26. package/dist/src/confirmDialog/confirmDialog.js +21 -19
  27. package/dist/src/confirmDialog/index.d.ts +1 -1
  28. package/dist/src/confirmDialog/index.d.ts.map +1 -1
  29. package/dist/src/confirmDialog/index.js +1 -1
  30. package/dist/src/contextMenu/contextMenu.d.ts +6 -6
  31. package/dist/src/dialog/dialog.d.ts +36 -7
  32. package/dist/src/dialog/dialog.d.ts.map +1 -1
  33. package/dist/src/dialog/dialog.js +32 -12
  34. package/dist/src/dialog/index.d.ts +1 -1
  35. package/dist/src/dialog/index.d.ts.map +1 -1
  36. package/dist/src/dialog/index.js +1 -1
  37. package/dist/src/drag/drag.d.ts +40 -0
  38. package/dist/src/drag/drag.d.ts.map +1 -0
  39. package/dist/src/drag/drag.js +134 -0
  40. package/dist/src/emptyState/emptyState.d.ts +6 -4
  41. package/dist/src/emptyState/emptyState.d.ts.map +1 -1
  42. package/dist/src/emptyState/emptyState.js +1 -1
  43. package/dist/src/errorSummary/errorSummary.d.ts +1 -1
  44. package/dist/src/errorSummary/errorSummary.js +1 -1
  45. package/dist/src/index.d.ts +3 -0
  46. package/dist/src/index.d.ts.map +1 -1
  47. package/dist/src/index.js +3 -0
  48. package/dist/src/keyHelp/keyHelp.d.ts +4 -0
  49. package/dist/src/keyHelp/keyHelp.d.ts.map +1 -1
  50. package/dist/src/lineChart/lineChart.js +1 -1
  51. package/dist/src/liveRegion/index.d.ts +3 -0
  52. package/dist/src/liveRegion/index.d.ts.map +1 -0
  53. package/dist/src/liveRegion/index.js +1 -0
  54. package/dist/src/liveRegion/liveRegion.d.ts +42 -0
  55. package/dist/src/liveRegion/liveRegion.d.ts.map +1 -0
  56. package/dist/src/liveRegion/liveRegion.js +35 -0
  57. package/dist/src/loading/loading.d.ts +8 -3
  58. package/dist/src/loading/loading.d.ts.map +1 -1
  59. package/dist/src/loading/loading.js +4 -3
  60. package/dist/src/menu/menu.d.ts +6 -6
  61. package/dist/src/meter/meter.d.ts +3 -0
  62. package/dist/src/meter/meter.d.ts.map +1 -1
  63. package/dist/src/meter/meter.js +6 -3
  64. package/dist/src/remote/index.d.ts +3 -0
  65. package/dist/src/remote/index.d.ts.map +1 -0
  66. package/dist/src/remote/index.js +1 -0
  67. package/dist/src/remote/remote.d.ts +29 -0
  68. package/dist/src/remote/remote.d.ts.map +1 -0
  69. package/dist/src/remote/remote.js +41 -0
  70. package/dist/src/skipLink/index.d.ts +1 -1
  71. package/dist/src/skipLink/index.d.ts.map +1 -1
  72. package/dist/src/skipLink/index.js +1 -1
  73. package/dist/src/skipLink/skipLink.d.ts +24 -8
  74. package/dist/src/skipLink/skipLink.d.ts.map +1 -1
  75. package/dist/src/skipLink/skipLink.js +27 -8
  76. package/dist/src/sortable/index.d.ts +3 -0
  77. package/dist/src/sortable/index.d.ts.map +1 -0
  78. package/dist/src/sortable/index.js +1 -0
  79. package/dist/src/sortable/sortable.d.ts +1144 -0
  80. package/dist/src/sortable/sortable.d.ts.map +1 -0
  81. package/dist/src/sortable/sortable.js +504 -0
  82. package/dist/src/toast/index.d.ts +1 -1
  83. package/dist/src/toast/index.d.ts.map +1 -1
  84. package/dist/src/toast/index.js +1 -1
  85. package/dist/src/toast/toast.d.ts +32 -20
  86. package/dist/src/toast/toast.d.ts.map +1 -1
  87. package/dist/src/toast/toast.js +8 -3
  88. package/dist/src/topBar/barHeight.d.ts +6 -0
  89. package/dist/src/topBar/barHeight.d.ts.map +1 -1
  90. package/dist/src/topBar/barHeight.js +4 -0
  91. package/dist/src/topBar/index.d.ts +1 -1
  92. package/dist/src/topBar/index.d.ts.map +1 -1
  93. package/dist/src/topBar/index.js +1 -1
  94. package/dist/src/topBar/topBar.d.ts +1 -2
  95. package/dist/src/topBar/topBar.d.ts.map +1 -1
  96. package/package.json +1 -1
  97. package/src/announcer/announcer.ts +48 -32
  98. package/src/announcer/index.ts +1 -1
  99. package/src/banner/banner.ts +1 -1
  100. package/src/barChart/barChart.ts +1 -1
  101. package/src/board/board.ts +18 -87
  102. package/src/button/button.ts +1 -1
  103. package/src/card/card.ts +120 -21
  104. package/src/card/index.ts +2 -2
  105. package/src/confirmDialog/confirmDialog.ts +25 -32
  106. package/src/confirmDialog/index.ts +2 -0
  107. package/src/dialog/dialog.ts +39 -13
  108. package/src/dialog/index.ts +3 -1
  109. package/src/drag/drag.ts +207 -0
  110. package/src/emptyState/emptyState.ts +7 -5
  111. package/src/errorSummary/errorSummary.ts +1 -1
  112. package/src/index.ts +3 -0
  113. package/src/lineChart/lineChart.ts +1 -1
  114. package/src/liveRegion/index.ts +2 -0
  115. package/src/liveRegion/liveRegion.ts +75 -0
  116. package/src/loading/loading.ts +11 -5
  117. package/src/meter/meter.ts +17 -3
  118. package/src/pixel-paper.css +182 -27
  119. package/src/remote/index.ts +2 -0
  120. package/src/remote/remote.ts +76 -0
  121. package/src/skipLink/index.ts +1 -1
  122. package/src/skipLink/skipLink.ts +38 -9
  123. package/src/sortable/index.ts +14 -0
  124. package/src/sortable/sortable.ts +857 -0
  125. package/src/toast/index.ts +1 -0
  126. package/src/toast/toast.ts +9 -3
  127. package/src/tokens.css +13 -11
  128. package/src/topBar/barHeight.ts +6 -0
  129. package/src/topBar/index.ts +1 -1
  130. package/src/topBar/topBar.ts +1 -2
@@ -0,0 +1,1144 @@
1
+ import { Effect, Option, Schema, Stream } from "effect";
2
+ import * as Command from "foldkit/command";
3
+ import type { Html } from "foldkit/html";
4
+ import * as Mount from "foldkit/mount";
5
+ import * as Subscription from "foldkit/subscription";
6
+ import * as Update from "foldkit/update";
7
+ /** Schema for one item as the list knows it: its id, unique in the list, and its name in
8
+ * words, which the grip and screen readers use. */
9
+ export declare const Item: Schema.Struct<{
10
+ readonly id: Schema.String;
11
+ readonly label: Schema.String;
12
+ }>;
13
+ export type Item = typeof Item.Type;
14
+ /** Schema for a sortable: the `@foldkit/ui` DragAndDrop it moves items with, whether items may
15
+ * move, and what it keeps while an item is held. The items are the parent's. */
16
+ export declare const Model: Schema.Struct<{
17
+ readonly dragAndDrop: Schema.Struct<{
18
+ readonly id: Schema.String;
19
+ readonly orientation: Schema.Literals<readonly ["Horizontal", "Vertical"]>;
20
+ readonly activationThreshold: Schema.Number;
21
+ readonly dragState: import("foldkit/schema").TaggedUnion<{
22
+ readonly Idle: {};
23
+ readonly Pending: {
24
+ itemId: Schema.String;
25
+ containerId: Schema.String;
26
+ index: Schema.Number;
27
+ origin: Schema.Struct<{
28
+ readonly screenX: Schema.Number;
29
+ readonly screenY: Schema.Number;
30
+ }>;
31
+ };
32
+ readonly Dragging: {
33
+ itemId: Schema.String;
34
+ sourceContainerId: Schema.String;
35
+ sourceIndex: Schema.Number;
36
+ origin: Schema.Struct<{
37
+ readonly screenX: Schema.Number;
38
+ readonly screenY: Schema.Number;
39
+ }>;
40
+ current: Schema.Struct<{
41
+ readonly clientX: Schema.Number;
42
+ readonly clientY: Schema.Number;
43
+ }>;
44
+ maybeDropTarget: Schema.Option<Schema.Struct<{
45
+ readonly containerId: Schema.String;
46
+ readonly index: Schema.Number;
47
+ }>>;
48
+ };
49
+ readonly KeyboardDragging: {
50
+ itemId: Schema.String;
51
+ sourceContainerId: Schema.String;
52
+ sourceIndex: Schema.Number;
53
+ targetContainerId: Schema.String;
54
+ targetIndex: Schema.Number;
55
+ };
56
+ }>;
57
+ }>;
58
+ readonly isMovable: Schema.Boolean;
59
+ readonly maybeHeld: Schema.Option<Schema.Struct<{
60
+ readonly item: Schema.Struct<{
61
+ readonly id: Schema.String;
62
+ readonly label: Schema.String;
63
+ }>;
64
+ readonly items: Schema.$Array<Schema.Struct<{
65
+ readonly id: Schema.String;
66
+ readonly label: Schema.String;
67
+ }>>;
68
+ readonly maybePress: Schema.Option<Schema.Struct<{
69
+ readonly pointerId: Schema.Number;
70
+ readonly clientX: Schema.Number;
71
+ readonly clientY: Schema.Number;
72
+ }>>;
73
+ }>>;
74
+ }>;
75
+ export type Model = typeof Model.Type;
76
+ /** Union of all Messages a sortable can produce. */
77
+ export declare const Message: import("foldkit/message").MessageUnion<{
78
+ readonly GotDragAndDropMessage: {
79
+ message: import("foldkit/message").MessageUnion<{
80
+ readonly PressedDraggable: {
81
+ itemId: Schema.String;
82
+ containerId: Schema.String;
83
+ index: Schema.Number;
84
+ screenX: Schema.Number;
85
+ screenY: Schema.Number;
86
+ };
87
+ readonly MovedPointer: {
88
+ screenX: Schema.Number;
89
+ screenY: Schema.Number;
90
+ clientX: Schema.Number;
91
+ clientY: Schema.Number;
92
+ maybeDropTarget: Schema.Option<Schema.Struct<{
93
+ readonly containerId: Schema.String;
94
+ readonly index: Schema.Number;
95
+ }>>;
96
+ };
97
+ readonly ReleasedPointer: {};
98
+ readonly CancelledDrag: {};
99
+ readonly ActivatedKeyboardDrag: {
100
+ itemId: Schema.String;
101
+ containerId: Schema.String;
102
+ index: Schema.Number;
103
+ };
104
+ readonly CompletedResolveKeyboardMove: {
105
+ targetContainerId: Schema.String;
106
+ targetIndex: Schema.Number;
107
+ };
108
+ readonly ConfirmedKeyboardDrop: {};
109
+ readonly PressedArrowKey: {
110
+ direction: Schema.Literals<readonly ["Up", "Down", "Left", "Right", "NextContainer", "PreviousContainer"]>;
111
+ };
112
+ readonly AdvancedAutoScrollFrame: {};
113
+ readonly CompletedFocusItem: {};
114
+ }>;
115
+ };
116
+ readonly PressedItem: {
117
+ itemId: Schema.String;
118
+ pointerId: Schema.Number;
119
+ screenX: Schema.Number;
120
+ screenY: Schema.Number;
121
+ clientX: Schema.Number;
122
+ clientY: Schema.Number;
123
+ items: Schema.$Array<Schema.Struct<{
124
+ readonly id: Schema.String;
125
+ readonly label: Schema.String;
126
+ }>>;
127
+ };
128
+ readonly PressedGripKey: {
129
+ itemId: Schema.String;
130
+ items: Schema.$Array<Schema.Struct<{
131
+ readonly id: Schema.String;
132
+ readonly label: Schema.String;
133
+ }>>;
134
+ };
135
+ readonly MovedPointer: {
136
+ screenX: Schema.Number;
137
+ screenY: Schema.Number;
138
+ clientX: Schema.Number;
139
+ clientY: Schema.Number;
140
+ maybeIndex: Schema.Option<Schema.Number>;
141
+ };
142
+ readonly ReleasedPointer: {
143
+ screenX: Schema.Number;
144
+ screenY: Schema.Number;
145
+ clientX: Schema.Number;
146
+ clientY: Schema.Number;
147
+ maybeIndex: Schema.Option<Schema.Number>;
148
+ };
149
+ readonly CancelledPointer: {};
150
+ readonly PressedEscape: {};
151
+ readonly CompletedAnnounceReorder: {};
152
+ readonly CompletedSizeLiftedItem: {};
153
+ }>;
154
+ export type Message = typeof Message.Type;
155
+ /** Union of OutMessages a sortable reports. `Moved`: an item was dropped somewhere new.
156
+ * `toIndex` is its place in the list once moved; `maybeAfterItemId` and `maybeBeforeItemId`
157
+ * name the items it now sits between, the anchors a list ordered by neighbours needs. A drop
158
+ * where the item already was, outside the list, or while items may not move reports nothing.
159
+ * The parent moves the item (or decides not to): the data is its own. */
160
+ export declare const OutMessage: import("foldkit/message").MessageUnion<{
161
+ readonly Moved: {
162
+ itemId: Schema.String;
163
+ fromIndex: Schema.Number;
164
+ toIndex: Schema.Number;
165
+ maybeAfterItemId: Schema.Option<Schema.String>;
166
+ maybeBeforeItemId: Schema.Option<Schema.String>;
167
+ };
168
+ }>;
169
+ export type OutMessage = typeof OutMessage.Type;
170
+ /** Configuration for creating a sortable with `init`. The `id` must be unique in the document;
171
+ * the list's DOM hooks are scoped by it. */
172
+ export type InitConfig = Readonly<{
173
+ id: string;
174
+ }>;
175
+ /** Creates a sortable whose items may move, with nothing held. */
176
+ export declare const init: (config: InitConfig) => Model;
177
+ /** Whether an item is pressed or held. */
178
+ export declare const isHolding: (model: Model) => boolean;
179
+ /** Says a step of a move through the page's live region (as `Announcer.Announce` does). */
180
+ export declare const AnnounceReorder: Command.CommandDefinitionWithArgs<"AnnounceReorder", {
181
+ text: Schema.String;
182
+ }, Effect.Effect<{
183
+ readonly _tag: "CompletedAnnounceReorder";
184
+ }, never, never>>;
185
+ type UpdateReturn = Update.ReturnWithOutMessage<Model, Message, OutMessage>;
186
+ /** Processes a sortable Message and returns the next Model, Commands and OutMessage. */
187
+ export declare const update: (model: Model, message: Message) => Readonly<{
188
+ model: {
189
+ readonly dragAndDrop: {
190
+ readonly id: string;
191
+ readonly orientation: "Horizontal" | "Vertical";
192
+ readonly activationThreshold: number;
193
+ readonly dragState: {
194
+ readonly _tag: "Dragging";
195
+ readonly itemId: string;
196
+ readonly sourceContainerId: string;
197
+ readonly sourceIndex: number;
198
+ readonly origin: {
199
+ readonly screenX: number;
200
+ readonly screenY: number;
201
+ };
202
+ readonly current: {
203
+ readonly clientX: number;
204
+ readonly clientY: number;
205
+ };
206
+ readonly maybeDropTarget: Option.Option<{
207
+ readonly containerId: string;
208
+ readonly index: number;
209
+ }>;
210
+ } | {
211
+ readonly _tag: "Idle";
212
+ } | {
213
+ readonly _tag: "KeyboardDragging";
214
+ readonly itemId: string;
215
+ readonly sourceContainerId: string;
216
+ readonly sourceIndex: number;
217
+ readonly targetContainerId: string;
218
+ readonly targetIndex: number;
219
+ } | {
220
+ readonly _tag: "Pending";
221
+ readonly itemId: string;
222
+ readonly containerId: string;
223
+ readonly index: number;
224
+ readonly origin: {
225
+ readonly screenX: number;
226
+ readonly screenY: number;
227
+ };
228
+ };
229
+ };
230
+ readonly isMovable: boolean;
231
+ readonly maybeHeld: Option.Option<{
232
+ readonly item: {
233
+ readonly id: string;
234
+ readonly label: string;
235
+ };
236
+ readonly items: readonly {
237
+ readonly id: string;
238
+ readonly label: string;
239
+ }[];
240
+ readonly maybePress: Option.Option<{
241
+ readonly pointerId: number;
242
+ readonly clientX: number;
243
+ readonly clientY: number;
244
+ }>;
245
+ }>;
246
+ };
247
+ commands?: Update.Commands<{
248
+ readonly _tag: "CancelledPointer";
249
+ } | {
250
+ readonly _tag: "CompletedAnnounceReorder";
251
+ } | {
252
+ readonly _tag: "CompletedSizeLiftedItem";
253
+ } | {
254
+ readonly _tag: "GotDragAndDropMessage";
255
+ readonly message: {
256
+ readonly _tag: "ActivatedKeyboardDrag";
257
+ readonly itemId: string;
258
+ readonly containerId: string;
259
+ readonly index: number;
260
+ } | {
261
+ readonly _tag: "AdvancedAutoScrollFrame";
262
+ } | {
263
+ readonly _tag: "CancelledDrag";
264
+ } | {
265
+ readonly _tag: "CompletedFocusItem";
266
+ } | {
267
+ readonly _tag: "CompletedResolveKeyboardMove";
268
+ readonly targetContainerId: string;
269
+ readonly targetIndex: number;
270
+ } | {
271
+ readonly _tag: "ConfirmedKeyboardDrop";
272
+ } | {
273
+ readonly _tag: "MovedPointer";
274
+ readonly screenX: number;
275
+ readonly screenY: number;
276
+ readonly clientX: number;
277
+ readonly clientY: number;
278
+ readonly maybeDropTarget: Option.Option<{
279
+ readonly containerId: string;
280
+ readonly index: number;
281
+ }>;
282
+ } | {
283
+ readonly _tag: "PressedArrowKey";
284
+ readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
285
+ } | {
286
+ readonly _tag: "PressedDraggable";
287
+ readonly itemId: string;
288
+ readonly containerId: string;
289
+ readonly index: number;
290
+ readonly screenX: number;
291
+ readonly screenY: number;
292
+ } | {
293
+ readonly _tag: "ReleasedPointer";
294
+ };
295
+ } | {
296
+ readonly _tag: "MovedPointer";
297
+ readonly screenX: number;
298
+ readonly screenY: number;
299
+ readonly clientX: number;
300
+ readonly clientY: number;
301
+ readonly maybeIndex: Option.Option<number>;
302
+ } | {
303
+ readonly _tag: "PressedEscape";
304
+ } | {
305
+ readonly _tag: "PressedGripKey";
306
+ readonly itemId: string;
307
+ readonly items: readonly {
308
+ readonly id: string;
309
+ readonly label: string;
310
+ }[];
311
+ } | {
312
+ readonly _tag: "PressedItem";
313
+ readonly itemId: string;
314
+ readonly pointerId: number;
315
+ readonly screenX: number;
316
+ readonly screenY: number;
317
+ readonly clientX: number;
318
+ readonly clientY: number;
319
+ readonly items: readonly {
320
+ readonly id: string;
321
+ readonly label: string;
322
+ }[];
323
+ } | {
324
+ readonly _tag: "ReleasedPointer";
325
+ readonly screenX: number;
326
+ readonly screenY: number;
327
+ readonly clientX: number;
328
+ readonly clientY: number;
329
+ readonly maybeIndex: Option.Option<number>;
330
+ }, never>;
331
+ outMessage?: {
332
+ readonly _tag: "Moved";
333
+ readonly itemId: string;
334
+ readonly fromIndex: number;
335
+ readonly toIndex: number;
336
+ readonly maybeAfterItemId: Option.Option<string>;
337
+ readonly maybeBeforeItemId: Option.Option<string>;
338
+ };
339
+ }>;
340
+ /** Lets items move, or stops them: while work runs, nothing moves. Stopping cancels an item
341
+ * that is pressed or held, so no `Moved` arrives for it. */
342
+ export declare const setMovable: (model: Model, isMovable: boolean) => UpdateReturn;
343
+ declare const PointerHold: Schema.Struct<{
344
+ readonly listId: Schema.String;
345
+ readonly heldHook: Schema.String;
346
+ readonly pointerId: Schema.Number;
347
+ }>;
348
+ type PointerHold = typeof PointerHold.Type;
349
+ /** The pressing pointer's moves, release and cancel; another pointer's are not the list's. */
350
+ export declare const pointerMessages: (hold: PointerHold) => Stream.Stream<Message>;
351
+ /** A held item follows the pointer, the arrows and Space move and drop it, Escape puts it back
352
+ * and the page scrolls near its edges, from listeners that run only while an item is pressed
353
+ * or held. Lift them into the application's Subscriptions, once per list, behind a key prefix
354
+ * of the parent's: `subscriptions("order")` is keyed `orderPointer`, `orderEscape`,
355
+ * `orderKeyboard` and `orderAutoScroll`. */
356
+ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) => {
357
+ readonly escape: Subscription.EntryWithoutKeepAlive<{
358
+ readonly dragAndDrop: {
359
+ readonly id: string;
360
+ readonly orientation: "Horizontal" | "Vertical";
361
+ readonly activationThreshold: number;
362
+ readonly dragState: {
363
+ readonly _tag: "Dragging";
364
+ readonly itemId: string;
365
+ readonly sourceContainerId: string;
366
+ readonly sourceIndex: number;
367
+ readonly origin: {
368
+ readonly screenX: number;
369
+ readonly screenY: number;
370
+ };
371
+ readonly current: {
372
+ readonly clientX: number;
373
+ readonly clientY: number;
374
+ };
375
+ readonly maybeDropTarget: Option.Option<{
376
+ readonly containerId: string;
377
+ readonly index: number;
378
+ }>;
379
+ } | {
380
+ readonly _tag: "Idle";
381
+ } | {
382
+ readonly _tag: "KeyboardDragging";
383
+ readonly itemId: string;
384
+ readonly sourceContainerId: string;
385
+ readonly sourceIndex: number;
386
+ readonly targetContainerId: string;
387
+ readonly targetIndex: number;
388
+ } | {
389
+ readonly _tag: "Pending";
390
+ readonly itemId: string;
391
+ readonly containerId: string;
392
+ readonly index: number;
393
+ readonly origin: {
394
+ readonly screenX: number;
395
+ readonly screenY: number;
396
+ };
397
+ };
398
+ };
399
+ readonly isMovable: boolean;
400
+ readonly maybeHeld: Option.Option<{
401
+ readonly item: {
402
+ readonly id: string;
403
+ readonly label: string;
404
+ };
405
+ readonly items: readonly {
406
+ readonly id: string;
407
+ readonly label: string;
408
+ }[];
409
+ readonly maybePress: Option.Option<{
410
+ readonly pointerId: number;
411
+ readonly clientX: number;
412
+ readonly clientY: number;
413
+ }>;
414
+ }>;
415
+ }, {
416
+ readonly _tag: "CancelledPointer";
417
+ } | {
418
+ readonly _tag: "CompletedAnnounceReorder";
419
+ } | {
420
+ readonly _tag: "CompletedSizeLiftedItem";
421
+ } | {
422
+ readonly _tag: "GotDragAndDropMessage";
423
+ readonly message: {
424
+ readonly _tag: "ActivatedKeyboardDrag";
425
+ readonly itemId: string;
426
+ readonly containerId: string;
427
+ readonly index: number;
428
+ } | {
429
+ readonly _tag: "AdvancedAutoScrollFrame";
430
+ } | {
431
+ readonly _tag: "CancelledDrag";
432
+ } | {
433
+ readonly _tag: "CompletedFocusItem";
434
+ } | {
435
+ readonly _tag: "CompletedResolveKeyboardMove";
436
+ readonly targetContainerId: string;
437
+ readonly targetIndex: number;
438
+ } | {
439
+ readonly _tag: "ConfirmedKeyboardDrop";
440
+ } | {
441
+ readonly _tag: "MovedPointer";
442
+ readonly screenX: number;
443
+ readonly screenY: number;
444
+ readonly clientX: number;
445
+ readonly clientY: number;
446
+ readonly maybeDropTarget: Option.Option<{
447
+ readonly containerId: string;
448
+ readonly index: number;
449
+ }>;
450
+ } | {
451
+ readonly _tag: "PressedArrowKey";
452
+ readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
453
+ } | {
454
+ readonly _tag: "PressedDraggable";
455
+ readonly itemId: string;
456
+ readonly containerId: string;
457
+ readonly index: number;
458
+ readonly screenX: number;
459
+ readonly screenY: number;
460
+ } | {
461
+ readonly _tag: "ReleasedPointer";
462
+ };
463
+ } | {
464
+ readonly _tag: "MovedPointer";
465
+ readonly screenX: number;
466
+ readonly screenY: number;
467
+ readonly clientX: number;
468
+ readonly clientY: number;
469
+ readonly maybeIndex: Option.Option<number>;
470
+ } | {
471
+ readonly _tag: "PressedEscape";
472
+ } | {
473
+ readonly _tag: "PressedGripKey";
474
+ readonly itemId: string;
475
+ readonly items: readonly {
476
+ readonly id: string;
477
+ readonly label: string;
478
+ }[];
479
+ } | {
480
+ readonly _tag: "PressedItem";
481
+ readonly itemId: string;
482
+ readonly pointerId: number;
483
+ readonly screenX: number;
484
+ readonly screenY: number;
485
+ readonly clientX: number;
486
+ readonly clientY: number;
487
+ readonly items: readonly {
488
+ readonly id: string;
489
+ readonly label: string;
490
+ }[];
491
+ } | {
492
+ readonly _tag: "ReleasedPointer";
493
+ readonly screenX: number;
494
+ readonly screenY: number;
495
+ readonly clientX: number;
496
+ readonly clientY: number;
497
+ readonly maybeIndex: Option.Option<number>;
498
+ }, {
499
+ readonly isHolding: boolean;
500
+ }, never> & {
501
+ readonly __subscription: never;
502
+ };
503
+ readonly pointer: Subscription.EntryWithoutKeepAlive<{
504
+ readonly dragAndDrop: {
505
+ readonly id: string;
506
+ readonly orientation: "Horizontal" | "Vertical";
507
+ readonly activationThreshold: number;
508
+ readonly dragState: {
509
+ readonly _tag: "Dragging";
510
+ readonly itemId: string;
511
+ readonly sourceContainerId: string;
512
+ readonly sourceIndex: number;
513
+ readonly origin: {
514
+ readonly screenX: number;
515
+ readonly screenY: number;
516
+ };
517
+ readonly current: {
518
+ readonly clientX: number;
519
+ readonly clientY: number;
520
+ };
521
+ readonly maybeDropTarget: Option.Option<{
522
+ readonly containerId: string;
523
+ readonly index: number;
524
+ }>;
525
+ } | {
526
+ readonly _tag: "Idle";
527
+ } | {
528
+ readonly _tag: "KeyboardDragging";
529
+ readonly itemId: string;
530
+ readonly sourceContainerId: string;
531
+ readonly sourceIndex: number;
532
+ readonly targetContainerId: string;
533
+ readonly targetIndex: number;
534
+ } | {
535
+ readonly _tag: "Pending";
536
+ readonly itemId: string;
537
+ readonly containerId: string;
538
+ readonly index: number;
539
+ readonly origin: {
540
+ readonly screenX: number;
541
+ readonly screenY: number;
542
+ };
543
+ };
544
+ };
545
+ readonly isMovable: boolean;
546
+ readonly maybeHeld: Option.Option<{
547
+ readonly item: {
548
+ readonly id: string;
549
+ readonly label: string;
550
+ };
551
+ readonly items: readonly {
552
+ readonly id: string;
553
+ readonly label: string;
554
+ }[];
555
+ readonly maybePress: Option.Option<{
556
+ readonly pointerId: number;
557
+ readonly clientX: number;
558
+ readonly clientY: number;
559
+ }>;
560
+ }>;
561
+ }, {
562
+ readonly _tag: "CancelledPointer";
563
+ } | {
564
+ readonly _tag: "CompletedAnnounceReorder";
565
+ } | {
566
+ readonly _tag: "CompletedSizeLiftedItem";
567
+ } | {
568
+ readonly _tag: "GotDragAndDropMessage";
569
+ readonly message: {
570
+ readonly _tag: "ActivatedKeyboardDrag";
571
+ readonly itemId: string;
572
+ readonly containerId: string;
573
+ readonly index: number;
574
+ } | {
575
+ readonly _tag: "AdvancedAutoScrollFrame";
576
+ } | {
577
+ readonly _tag: "CancelledDrag";
578
+ } | {
579
+ readonly _tag: "CompletedFocusItem";
580
+ } | {
581
+ readonly _tag: "CompletedResolveKeyboardMove";
582
+ readonly targetContainerId: string;
583
+ readonly targetIndex: number;
584
+ } | {
585
+ readonly _tag: "ConfirmedKeyboardDrop";
586
+ } | {
587
+ readonly _tag: "MovedPointer";
588
+ readonly screenX: number;
589
+ readonly screenY: number;
590
+ readonly clientX: number;
591
+ readonly clientY: number;
592
+ readonly maybeDropTarget: Option.Option<{
593
+ readonly containerId: string;
594
+ readonly index: number;
595
+ }>;
596
+ } | {
597
+ readonly _tag: "PressedArrowKey";
598
+ readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
599
+ } | {
600
+ readonly _tag: "PressedDraggable";
601
+ readonly itemId: string;
602
+ readonly containerId: string;
603
+ readonly index: number;
604
+ readonly screenX: number;
605
+ readonly screenY: number;
606
+ } | {
607
+ readonly _tag: "ReleasedPointer";
608
+ };
609
+ } | {
610
+ readonly _tag: "MovedPointer";
611
+ readonly screenX: number;
612
+ readonly screenY: number;
613
+ readonly clientX: number;
614
+ readonly clientY: number;
615
+ readonly maybeIndex: Option.Option<number>;
616
+ } | {
617
+ readonly _tag: "PressedEscape";
618
+ } | {
619
+ readonly _tag: "PressedGripKey";
620
+ readonly itemId: string;
621
+ readonly items: readonly {
622
+ readonly id: string;
623
+ readonly label: string;
624
+ }[];
625
+ } | {
626
+ readonly _tag: "PressedItem";
627
+ readonly itemId: string;
628
+ readonly pointerId: number;
629
+ readonly screenX: number;
630
+ readonly screenY: number;
631
+ readonly clientX: number;
632
+ readonly clientY: number;
633
+ readonly items: readonly {
634
+ readonly id: string;
635
+ readonly label: string;
636
+ }[];
637
+ } | {
638
+ readonly _tag: "ReleasedPointer";
639
+ readonly screenX: number;
640
+ readonly screenY: number;
641
+ readonly clientX: number;
642
+ readonly clientY: number;
643
+ readonly maybeIndex: Option.Option<number>;
644
+ }, {
645
+ readonly maybeHold: Option.Option<{
646
+ readonly listId: string;
647
+ readonly heldHook: string;
648
+ readonly pointerId: number;
649
+ }>;
650
+ }, never> & {
651
+ readonly __subscription: never;
652
+ };
653
+ } & {
654
+ readonly autoScroll: Subscription.Subscription<{
655
+ readonly dragAndDrop: {
656
+ readonly id: string;
657
+ readonly orientation: "Horizontal" | "Vertical";
658
+ readonly activationThreshold: number;
659
+ readonly dragState: {
660
+ readonly _tag: "Dragging";
661
+ readonly itemId: string;
662
+ readonly sourceContainerId: string;
663
+ readonly sourceIndex: number;
664
+ readonly origin: {
665
+ readonly screenX: number;
666
+ readonly screenY: number;
667
+ };
668
+ readonly current: {
669
+ readonly clientX: number;
670
+ readonly clientY: number;
671
+ };
672
+ readonly maybeDropTarget: Option.Option<{
673
+ readonly containerId: string;
674
+ readonly index: number;
675
+ }>;
676
+ } | {
677
+ readonly _tag: "Idle";
678
+ } | {
679
+ readonly _tag: "KeyboardDragging";
680
+ readonly itemId: string;
681
+ readonly sourceContainerId: string;
682
+ readonly sourceIndex: number;
683
+ readonly targetContainerId: string;
684
+ readonly targetIndex: number;
685
+ } | {
686
+ readonly _tag: "Pending";
687
+ readonly itemId: string;
688
+ readonly containerId: string;
689
+ readonly index: number;
690
+ readonly origin: {
691
+ readonly screenX: number;
692
+ readonly screenY: number;
693
+ };
694
+ };
695
+ };
696
+ readonly isMovable: boolean;
697
+ readonly maybeHeld: Option.Option<{
698
+ readonly item: {
699
+ readonly id: string;
700
+ readonly label: string;
701
+ };
702
+ readonly items: readonly {
703
+ readonly id: string;
704
+ readonly label: string;
705
+ }[];
706
+ readonly maybePress: Option.Option<{
707
+ readonly pointerId: number;
708
+ readonly clientX: number;
709
+ readonly clientY: number;
710
+ }>;
711
+ }>;
712
+ }, {
713
+ readonly _tag: "CancelledPointer";
714
+ } | {
715
+ readonly _tag: "CompletedAnnounceReorder";
716
+ } | {
717
+ readonly _tag: "CompletedSizeLiftedItem";
718
+ } | {
719
+ readonly _tag: "GotDragAndDropMessage";
720
+ readonly message: {
721
+ readonly _tag: "ActivatedKeyboardDrag";
722
+ readonly itemId: string;
723
+ readonly containerId: string;
724
+ readonly index: number;
725
+ } | {
726
+ readonly _tag: "AdvancedAutoScrollFrame";
727
+ } | {
728
+ readonly _tag: "CancelledDrag";
729
+ } | {
730
+ readonly _tag: "CompletedFocusItem";
731
+ } | {
732
+ readonly _tag: "CompletedResolveKeyboardMove";
733
+ readonly targetContainerId: string;
734
+ readonly targetIndex: number;
735
+ } | {
736
+ readonly _tag: "ConfirmedKeyboardDrop";
737
+ } | {
738
+ readonly _tag: "MovedPointer";
739
+ readonly screenX: number;
740
+ readonly screenY: number;
741
+ readonly clientX: number;
742
+ readonly clientY: number;
743
+ readonly maybeDropTarget: Option.Option<{
744
+ readonly containerId: string;
745
+ readonly index: number;
746
+ }>;
747
+ } | {
748
+ readonly _tag: "PressedArrowKey";
749
+ readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
750
+ } | {
751
+ readonly _tag: "PressedDraggable";
752
+ readonly itemId: string;
753
+ readonly containerId: string;
754
+ readonly index: number;
755
+ readonly screenX: number;
756
+ readonly screenY: number;
757
+ } | {
758
+ readonly _tag: "ReleasedPointer";
759
+ };
760
+ } | {
761
+ readonly _tag: "MovedPointer";
762
+ readonly screenX: number;
763
+ readonly screenY: number;
764
+ readonly clientX: number;
765
+ readonly clientY: number;
766
+ readonly maybeIndex: Option.Option<number>;
767
+ } | {
768
+ readonly _tag: "PressedEscape";
769
+ } | {
770
+ readonly _tag: "PressedGripKey";
771
+ readonly itemId: string;
772
+ readonly items: readonly {
773
+ readonly id: string;
774
+ readonly label: string;
775
+ }[];
776
+ } | {
777
+ readonly _tag: "PressedItem";
778
+ readonly itemId: string;
779
+ readonly pointerId: number;
780
+ readonly screenX: number;
781
+ readonly screenY: number;
782
+ readonly clientX: number;
783
+ readonly clientY: number;
784
+ readonly items: readonly {
785
+ readonly id: string;
786
+ readonly label: string;
787
+ }[];
788
+ } | {
789
+ readonly _tag: "ReleasedPointer";
790
+ readonly screenX: number;
791
+ readonly screenY: number;
792
+ readonly clientX: number;
793
+ readonly clientY: number;
794
+ readonly maybeIndex: Option.Option<number>;
795
+ }, Readonly<{
796
+ maybeDependencies: Option.Option<{
797
+ readonly isDragging: boolean;
798
+ readonly clientY: number;
799
+ }>;
800
+ }>, never>;
801
+ readonly keyboard: Subscription.Subscription<{
802
+ readonly dragAndDrop: {
803
+ readonly id: string;
804
+ readonly orientation: "Horizontal" | "Vertical";
805
+ readonly activationThreshold: number;
806
+ readonly dragState: {
807
+ readonly _tag: "Dragging";
808
+ readonly itemId: string;
809
+ readonly sourceContainerId: string;
810
+ readonly sourceIndex: number;
811
+ readonly origin: {
812
+ readonly screenX: number;
813
+ readonly screenY: number;
814
+ };
815
+ readonly current: {
816
+ readonly clientX: number;
817
+ readonly clientY: number;
818
+ };
819
+ readonly maybeDropTarget: Option.Option<{
820
+ readonly containerId: string;
821
+ readonly index: number;
822
+ }>;
823
+ } | {
824
+ readonly _tag: "Idle";
825
+ } | {
826
+ readonly _tag: "KeyboardDragging";
827
+ readonly itemId: string;
828
+ readonly sourceContainerId: string;
829
+ readonly sourceIndex: number;
830
+ readonly targetContainerId: string;
831
+ readonly targetIndex: number;
832
+ } | {
833
+ readonly _tag: "Pending";
834
+ readonly itemId: string;
835
+ readonly containerId: string;
836
+ readonly index: number;
837
+ readonly origin: {
838
+ readonly screenX: number;
839
+ readonly screenY: number;
840
+ };
841
+ };
842
+ };
843
+ readonly isMovable: boolean;
844
+ readonly maybeHeld: Option.Option<{
845
+ readonly item: {
846
+ readonly id: string;
847
+ readonly label: string;
848
+ };
849
+ readonly items: readonly {
850
+ readonly id: string;
851
+ readonly label: string;
852
+ }[];
853
+ readonly maybePress: Option.Option<{
854
+ readonly pointerId: number;
855
+ readonly clientX: number;
856
+ readonly clientY: number;
857
+ }>;
858
+ }>;
859
+ }, {
860
+ readonly _tag: "CancelledPointer";
861
+ } | {
862
+ readonly _tag: "CompletedAnnounceReorder";
863
+ } | {
864
+ readonly _tag: "CompletedSizeLiftedItem";
865
+ } | {
866
+ readonly _tag: "GotDragAndDropMessage";
867
+ readonly message: {
868
+ readonly _tag: "ActivatedKeyboardDrag";
869
+ readonly itemId: string;
870
+ readonly containerId: string;
871
+ readonly index: number;
872
+ } | {
873
+ readonly _tag: "AdvancedAutoScrollFrame";
874
+ } | {
875
+ readonly _tag: "CancelledDrag";
876
+ } | {
877
+ readonly _tag: "CompletedFocusItem";
878
+ } | {
879
+ readonly _tag: "CompletedResolveKeyboardMove";
880
+ readonly targetContainerId: string;
881
+ readonly targetIndex: number;
882
+ } | {
883
+ readonly _tag: "ConfirmedKeyboardDrop";
884
+ } | {
885
+ readonly _tag: "MovedPointer";
886
+ readonly screenX: number;
887
+ readonly screenY: number;
888
+ readonly clientX: number;
889
+ readonly clientY: number;
890
+ readonly maybeDropTarget: Option.Option<{
891
+ readonly containerId: string;
892
+ readonly index: number;
893
+ }>;
894
+ } | {
895
+ readonly _tag: "PressedArrowKey";
896
+ readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
897
+ } | {
898
+ readonly _tag: "PressedDraggable";
899
+ readonly itemId: string;
900
+ readonly containerId: string;
901
+ readonly index: number;
902
+ readonly screenX: number;
903
+ readonly screenY: number;
904
+ } | {
905
+ readonly _tag: "ReleasedPointer";
906
+ };
907
+ } | {
908
+ readonly _tag: "MovedPointer";
909
+ readonly screenX: number;
910
+ readonly screenY: number;
911
+ readonly clientX: number;
912
+ readonly clientY: number;
913
+ readonly maybeIndex: Option.Option<number>;
914
+ } | {
915
+ readonly _tag: "PressedEscape";
916
+ } | {
917
+ readonly _tag: "PressedGripKey";
918
+ readonly itemId: string;
919
+ readonly items: readonly {
920
+ readonly id: string;
921
+ readonly label: string;
922
+ }[];
923
+ } | {
924
+ readonly _tag: "PressedItem";
925
+ readonly itemId: string;
926
+ readonly pointerId: number;
927
+ readonly screenX: number;
928
+ readonly screenY: number;
929
+ readonly clientX: number;
930
+ readonly clientY: number;
931
+ readonly items: readonly {
932
+ readonly id: string;
933
+ readonly label: string;
934
+ }[];
935
+ } | {
936
+ readonly _tag: "ReleasedPointer";
937
+ readonly screenX: number;
938
+ readonly screenY: number;
939
+ readonly clientX: number;
940
+ readonly clientY: number;
941
+ readonly maybeIndex: Option.Option<number>;
942
+ }, Readonly<{
943
+ maybeDependencies: Option.Option<{
944
+ readonly dragActivity: "Active" | "Idle";
945
+ }>;
946
+ }>, never>;
947
+ } extends infer T ? { readonly [Key in keyof T as `${Prefix}${Capitalize<Key>}`]: T[Key]; } : never;
948
+ /** Sizes the copy that follows the pointer to the item it lifts, and keeps the pointer where
949
+ * it pressed the item. Measures the item once, when the copy appears. */
950
+ export declare const SizeLiftedItem: Mount.MountDefinitionWithArgs<"SizeLiftedItem", {
951
+ itemHook: Schema.String;
952
+ pressX: Schema.Number;
953
+ pressY: Schema.Number;
954
+ }, {
955
+ readonly _tag: "CompletedSizeLiftedItem";
956
+ }>;
957
+ /** How the items lay out: a column of rows, or tiles that wrap. */
958
+ export type Layout = "List" | "Grid";
959
+ /** What the list hands `toItemView` for each item. */
960
+ export type ItemRender = Readonly<{
961
+ /** This render is the held copy: hidden from screen readers and inert. Leave out ids and
962
+ * anything the page must find once. */
963
+ isLifted: boolean;
964
+ }>;
965
+ /** Per-render inputs passed to `view` through `h.submodel`'s `viewInputs`. The `to*` members
966
+ * are functions because they may carry the parent's handlers. */
967
+ export type ViewInputs = Readonly<{
968
+ items: ReadonlyArray<Item>;
969
+ /** Names the list for screen readers. */
970
+ label: string;
971
+ /** `"List"` (the default): rows between 1px rules, for a flush panel. `"Grid"`: tiles that
972
+ * wrap, 180px and up. */
973
+ layout?: Layout;
974
+ /** One item's content, beside its grip. Also called for the held copy, with
975
+ * `render.isLifted`. */
976
+ toItemView: (item: Item, render: ItemRender) => ReadonlyArray<Html>;
977
+ }>;
978
+ /**
979
+ * Items the reader puts in order, as rows or as tiles, built on `@foldkit/ui`'s DragAndDrop:
980
+ * `div.sortable` holding `ul.sortable-items` (named by `label`) of `li.sortable-item`, each its
981
+ * grip and the parent's content. The items are the parent's; a drop reports `Moved`.
982
+ *
983
+ * A mouse drags an item by its body or its grip; touch takes the grip alone, so a finger on
984
+ * an item scrolls the page; the keyboard takes the grip too: Space or Enter picks the item
985
+ * up, every arrow moves it one place in reading order, Space drops it and Escape puts it back.
986
+ * The held item dims in place; a copy, lifted onto the card shadow, follows the pointer or
987
+ * prints where the keyboard would drop it; each step is said through the page's live region.
988
+ * Lift `subscriptions(keyPrefix)` into the application's, or nothing follows the pointer or
989
+ * the keys.
990
+ */
991
+ export declare const view: import("foldkit/submodel").View<{
992
+ readonly dragAndDrop: {
993
+ readonly id: string;
994
+ readonly orientation: "Horizontal" | "Vertical";
995
+ readonly activationThreshold: number;
996
+ readonly dragState: {
997
+ readonly _tag: "Dragging";
998
+ readonly itemId: string;
999
+ readonly sourceContainerId: string;
1000
+ readonly sourceIndex: number;
1001
+ readonly origin: {
1002
+ readonly screenX: number;
1003
+ readonly screenY: number;
1004
+ };
1005
+ readonly current: {
1006
+ readonly clientX: number;
1007
+ readonly clientY: number;
1008
+ };
1009
+ readonly maybeDropTarget: Option.Option<{
1010
+ readonly containerId: string;
1011
+ readonly index: number;
1012
+ }>;
1013
+ } | {
1014
+ readonly _tag: "Idle";
1015
+ } | {
1016
+ readonly _tag: "KeyboardDragging";
1017
+ readonly itemId: string;
1018
+ readonly sourceContainerId: string;
1019
+ readonly sourceIndex: number;
1020
+ readonly targetContainerId: string;
1021
+ readonly targetIndex: number;
1022
+ } | {
1023
+ readonly _tag: "Pending";
1024
+ readonly itemId: string;
1025
+ readonly containerId: string;
1026
+ readonly index: number;
1027
+ readonly origin: {
1028
+ readonly screenX: number;
1029
+ readonly screenY: number;
1030
+ };
1031
+ };
1032
+ };
1033
+ readonly isMovable: boolean;
1034
+ readonly maybeHeld: Option.Option<{
1035
+ readonly item: {
1036
+ readonly id: string;
1037
+ readonly label: string;
1038
+ };
1039
+ readonly items: readonly {
1040
+ readonly id: string;
1041
+ readonly label: string;
1042
+ }[];
1043
+ readonly maybePress: Option.Option<{
1044
+ readonly pointerId: number;
1045
+ readonly clientX: number;
1046
+ readonly clientY: number;
1047
+ }>;
1048
+ }>;
1049
+ }, {
1050
+ readonly _tag: "CancelledPointer";
1051
+ } | {
1052
+ readonly _tag: "CompletedAnnounceReorder";
1053
+ } | {
1054
+ readonly _tag: "CompletedSizeLiftedItem";
1055
+ } | {
1056
+ readonly _tag: "GotDragAndDropMessage";
1057
+ readonly message: {
1058
+ readonly _tag: "ActivatedKeyboardDrag";
1059
+ readonly itemId: string;
1060
+ readonly containerId: string;
1061
+ readonly index: number;
1062
+ } | {
1063
+ readonly _tag: "AdvancedAutoScrollFrame";
1064
+ } | {
1065
+ readonly _tag: "CancelledDrag";
1066
+ } | {
1067
+ readonly _tag: "CompletedFocusItem";
1068
+ } | {
1069
+ readonly _tag: "CompletedResolveKeyboardMove";
1070
+ readonly targetContainerId: string;
1071
+ readonly targetIndex: number;
1072
+ } | {
1073
+ readonly _tag: "ConfirmedKeyboardDrop";
1074
+ } | {
1075
+ readonly _tag: "MovedPointer";
1076
+ readonly screenX: number;
1077
+ readonly screenY: number;
1078
+ readonly clientX: number;
1079
+ readonly clientY: number;
1080
+ readonly maybeDropTarget: Option.Option<{
1081
+ readonly containerId: string;
1082
+ readonly index: number;
1083
+ }>;
1084
+ } | {
1085
+ readonly _tag: "PressedArrowKey";
1086
+ readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
1087
+ } | {
1088
+ readonly _tag: "PressedDraggable";
1089
+ readonly itemId: string;
1090
+ readonly containerId: string;
1091
+ readonly index: number;
1092
+ readonly screenX: number;
1093
+ readonly screenY: number;
1094
+ } | {
1095
+ readonly _tag: "ReleasedPointer";
1096
+ };
1097
+ } | {
1098
+ readonly _tag: "MovedPointer";
1099
+ readonly screenX: number;
1100
+ readonly screenY: number;
1101
+ readonly clientX: number;
1102
+ readonly clientY: number;
1103
+ readonly maybeIndex: Option.Option<number>;
1104
+ } | {
1105
+ readonly _tag: "PressedEscape";
1106
+ } | {
1107
+ readonly _tag: "PressedGripKey";
1108
+ readonly itemId: string;
1109
+ readonly items: readonly {
1110
+ readonly id: string;
1111
+ readonly label: string;
1112
+ }[];
1113
+ } | {
1114
+ readonly _tag: "PressedItem";
1115
+ readonly itemId: string;
1116
+ readonly pointerId: number;
1117
+ readonly screenX: number;
1118
+ readonly screenY: number;
1119
+ readonly clientX: number;
1120
+ readonly clientY: number;
1121
+ readonly items: readonly {
1122
+ readonly id: string;
1123
+ readonly label: string;
1124
+ }[];
1125
+ } | {
1126
+ readonly _tag: "ReleasedPointer";
1127
+ readonly screenX: number;
1128
+ readonly screenY: number;
1129
+ readonly clientX: number;
1130
+ readonly clientY: number;
1131
+ readonly maybeIndex: Option.Option<number>;
1132
+ }, Readonly<{
1133
+ items: ReadonlyArray<Item>;
1134
+ /** Names the list for screen readers. */
1135
+ label: string;
1136
+ /** `"List"` (the default): rows between 1px rules, for a flush panel. `"Grid"`: tiles that
1137
+ * wrap, 180px and up. */
1138
+ layout?: Layout;
1139
+ /** One item's content, beside its grip. Also called for the held copy, with
1140
+ * `render.isLifted`. */
1141
+ toItemView: (item: Item, render: ItemRender) => ReadonlyArray<Html>;
1142
+ }>>;
1143
+ export {};
1144
+ //# sourceMappingURL=sortable.d.ts.map