@gjermundgaraba-designs/pixel-paper 0.22.1 → 0.23.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.
- package/DESIGN.md +14 -14
- package/dist/src/adapters/mermaid.d.ts.map +1 -1
- package/dist/src/adapters/mermaid.js +0 -24
- package/dist/src/announcer/announcer.d.ts.map +1 -1
- package/dist/src/announcer/announcer.js +12 -12
- package/dist/src/board/board.d.ts +0 -10
- package/dist/src/board/board.d.ts.map +1 -1
- package/dist/src/board/board.js +36 -64
- package/dist/src/board/index.d.ts +2 -1
- package/dist/src/board/index.d.ts.map +1 -1
- package/dist/src/board/index.js +2 -1
- package/dist/src/button/button.d.ts +1 -1
- package/dist/src/button/button.d.ts.map +1 -1
- package/dist/src/chip/chip.d.ts.map +1 -1
- package/dist/src/chip/chip.js +1 -8
- package/dist/src/commandPalette/commandPalette.d.ts.map +1 -1
- package/dist/src/commandPalette/commandPalette.js +78 -83
- package/dist/src/commandPalette/keys.d.ts +2 -2
- package/dist/src/commandPalette/keys.d.ts.map +1 -1
- package/dist/src/commandPalette/keys.js +2 -4
- package/dist/src/commandPalette/match.d.ts.map +1 -1
- package/dist/src/commandPalette/match.js +2 -2
- package/dist/src/confirmDialog/confirmDialog.d.ts.map +1 -1
- package/dist/src/confirmDialog/confirmDialog.js +1 -2
- package/dist/src/copyButton/copyButton.d.ts +0 -5
- package/dist/src/copyButton/copyButton.d.ts.map +1 -1
- package/dist/src/copyButton/copyButton.js +2 -2
- package/dist/src/crumbs/crumbs.d.ts +0 -2
- package/dist/src/crumbs/crumbs.d.ts.map +1 -1
- package/dist/src/crumbs/crumbs.js +2 -2
- package/dist/src/dialog/dialog.d.ts +2 -0
- package/dist/src/dialog/dialog.d.ts.map +1 -1
- package/dist/src/dialog/dialog.js +3 -2
- package/dist/src/drag/drag.d.ts +28 -3
- package/dist/src/drag/drag.d.ts.map +1 -1
- package/dist/src/drag/drag.js +39 -17
- package/dist/src/editableTitle/editableTitle.d.ts +4 -4
- package/dist/src/field/field.d.ts +7 -1
- package/dist/src/field/field.d.ts.map +1 -1
- package/dist/src/field/field.js +14 -6
- package/dist/src/fieldset/fieldset.d.ts.map +1 -1
- package/dist/src/fieldset/fieldset.js +2 -4
- package/dist/src/fileTree/fileTree.d.ts.map +1 -1
- package/dist/src/fileTree/fileTree.js +16 -16
- package/dist/src/inlineInput/inlineInput.d.ts +4 -0
- package/dist/src/inlineInput/inlineInput.d.ts.map +1 -1
- package/dist/src/inlineInput/inlineInput.js +9 -6
- package/dist/src/keyHelp/index.d.ts +1 -1
- package/dist/src/keyHelp/index.d.ts.map +1 -1
- package/dist/src/keyHelp/index.js +1 -1
- package/dist/src/keyHelp/keyHelp.d.ts +1 -3
- package/dist/src/keyHelp/keyHelp.d.ts.map +1 -1
- package/dist/src/keyHelp/keyHelp.js +3 -6
- package/dist/src/keyHint/keyLabel.d.ts +2 -0
- package/dist/src/keyHint/keyLabel.d.ts.map +1 -1
- package/dist/src/keyHint/keyLabel.js +3 -2
- package/dist/src/lineDiff/diff.d.ts +6 -3
- package/dist/src/lineDiff/diff.d.ts.map +1 -1
- package/dist/src/lineDiff/diff.js +40 -28
- package/dist/src/lineDiff/patch.d.ts.map +1 -1
- package/dist/src/lineDiff/patch.js +18 -13
- package/dist/src/linkState/linkState.d.ts.map +1 -1
- package/dist/src/linkState/linkState.js +1 -7
- package/dist/src/menu/slip.js +2 -2
- package/dist/src/meter/meter.d.ts.map +1 -1
- package/dist/src/meter/meter.js +22 -17
- package/dist/src/notice/notice.d.ts +2 -0
- package/dist/src/notice/notice.d.ts.map +1 -1
- package/dist/src/notice/notice.js +2 -1
- package/dist/src/passwordField/passwordField.d.ts.map +1 -1
- package/dist/src/passwordField/passwordField.js +3 -7
- package/dist/src/rail/rail.d.ts +17 -3
- package/dist/src/rail/rail.d.ts.map +1 -1
- package/dist/src/rail/rail.js +7 -7
- package/dist/src/reel/layout.d.ts +9 -5
- package/dist/src/reel/layout.d.ts.map +1 -1
- package/dist/src/reel/layout.js +12 -6
- package/dist/src/reel/reel.d.ts.map +1 -1
- package/dist/src/reel/reel.js +131 -75
- package/dist/src/scheme/scheme.d.ts +1 -1
- package/dist/src/scheme/scheme.d.ts.map +1 -1
- package/dist/src/segmented/segmented.d.ts +0 -3
- package/dist/src/segmented/segmented.d.ts.map +1 -1
- package/dist/src/segmented/segmented.js +1 -6
- package/dist/src/selectField/selectField.d.ts.map +1 -1
- package/dist/src/selectField/selectField.js +3 -10
- package/dist/src/sortable/index.d.ts +1 -1
- package/dist/src/sortable/index.d.ts.map +1 -1
- package/dist/src/sortable/index.js +1 -1
- package/dist/src/sortable/sortable.d.ts +40 -49
- package/dist/src/sortable/sortable.d.ts.map +1 -1
- package/dist/src/sortable/sortable.js +41 -54
- package/dist/src/stack/stack.d.ts +1 -1
- package/dist/src/stack/stack.d.ts.map +1 -1
- package/dist/src/stack/stack.js +1 -1
- package/dist/src/tabs/tabs.d.ts +1 -1
- package/dist/src/tabs/tabs.d.ts.map +1 -1
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textareaField/textareaField.d.ts.map +1 -1
- package/dist/src/textareaField/textareaField.js +3 -7
- package/dist/src/time/time.d.ts.map +1 -1
- package/dist/src/time/time.js +4 -2
- package/dist/src/tips/index.d.ts +1 -1
- package/dist/src/tips/index.d.ts.map +1 -1
- package/dist/src/toast/index.d.ts +1 -1
- package/dist/src/toast/index.d.ts.map +1 -1
- package/dist/src/toast/toast.d.ts +5 -5
- package/dist/src/toast/toast.d.ts.map +1 -1
- package/dist/src/toast/toast.js +1 -6
- package/dist/src/toolbar/toolbar.d.ts +0 -3
- package/dist/src/toolbar/toolbar.d.ts.map +1 -1
- package/dist/src/toolbar/toolbar.js +1 -2
- package/package.json +1 -1
- package/src/adapters/mermaid.ts +0 -24
- package/src/announcer/announcer.ts +13 -17
- package/src/board/board.ts +32 -80
- package/src/board/index.ts +1 -1
- package/src/button/button.ts +1 -1
- package/src/chip/chip.ts +1 -9
- package/src/commandPalette/commandPalette.ts +21 -38
- package/src/commandPalette/keys.ts +2 -4
- package/src/commandPalette/match.ts +3 -3
- package/src/confirmDialog/confirmDialog.ts +5 -3
- package/src/copyButton/copyButton.ts +2 -5
- package/src/crumbs/crumbs.ts +2 -4
- package/src/dialog/dialog.ts +3 -2
- package/src/drag/drag.ts +55 -6
- package/src/field/field.ts +29 -7
- package/src/fieldset/fieldset.ts +2 -4
- package/src/fileTree/fileTree.ts +10 -12
- package/src/inlineInput/inlineInput.ts +11 -2
- package/src/keyHelp/index.ts +0 -1
- package/src/keyHelp/keyHelp.ts +3 -9
- package/src/keyHint/keyLabel.ts +5 -2
- package/src/lineDiff/diff.ts +70 -54
- package/src/lineDiff/patch.ts +27 -14
- package/src/linkState/linkState.ts +1 -8
- package/src/menu/slip.ts +2 -2
- package/src/meter/meter.ts +25 -15
- package/src/notice/notice.ts +2 -1
- package/src/passwordField/passwordField.ts +3 -7
- package/src/pixel-paper.css +84 -133
- package/src/rail/rail.ts +9 -7
- package/src/reel/layout.ts +20 -15
- package/src/reel/reel.ts +146 -77
- package/src/scheme/scheme.ts +1 -1
- package/src/segmented/segmented.ts +1 -9
- package/src/selectField/selectField.ts +3 -10
- package/src/sortable/index.ts +0 -1
- package/src/sortable/sortable.ts +42 -63
- package/src/stack/stack.ts +1 -1
- package/src/tabs/tabs.ts +1 -1
- package/src/textareaField/textareaField.ts +3 -7
- package/src/time/time.ts +6 -7
- package/src/tips/index.ts +1 -1
- package/src/toast/index.ts +1 -1
- package/src/toast/toast.ts +2 -8
- package/src/tokens.css +6 -0
- package/src/toolbar/toolbar.ts +0 -5
- package/dist/src/inlineInput/inline.d.ts +0 -6
- package/dist/src/inlineInput/inline.d.ts.map +0 -1
- package/dist/src/inlineInput/inline.js +0 -7
- package/src/inlineInput/inline.ts +0 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, Option, Schema
|
|
1
|
+
import { Effect, Option, Schema } from "effect";
|
|
2
2
|
import * as Command from "foldkit/command";
|
|
3
3
|
import type { Html } from "foldkit/html";
|
|
4
4
|
import * as Mount from "foldkit/mount";
|
|
@@ -174,8 +174,6 @@ export type InitConfig = Readonly<{
|
|
|
174
174
|
}>;
|
|
175
175
|
/** Creates a sortable whose items may move, with nothing held. */
|
|
176
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
177
|
/** Says a step of a move through the page's live region (as `Announcer.Announce` does). */
|
|
180
178
|
export declare const AnnounceReorder: Command.CommandDefinitionWithArgs<"AnnounceReorder", {
|
|
181
179
|
text: Schema.String;
|
|
@@ -245,6 +243,8 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
245
243
|
}>;
|
|
246
244
|
};
|
|
247
245
|
commands?: Update.Commands<{
|
|
246
|
+
readonly _tag: "PressedEscape";
|
|
247
|
+
} | {
|
|
248
248
|
readonly _tag: "CancelledPointer";
|
|
249
249
|
} | {
|
|
250
250
|
readonly _tag: "CompletedAnnounceReorder";
|
|
@@ -253,6 +253,9 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
253
253
|
} | {
|
|
254
254
|
readonly _tag: "GotDragAndDropMessage";
|
|
255
255
|
readonly message: {
|
|
256
|
+
readonly _tag: "PressedArrowKey";
|
|
257
|
+
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
258
|
+
} | {
|
|
256
259
|
readonly _tag: "ActivatedKeyboardDrag";
|
|
257
260
|
readonly itemId: string;
|
|
258
261
|
readonly containerId: string;
|
|
@@ -279,9 +282,6 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
279
282
|
readonly containerId: string;
|
|
280
283
|
readonly index: number;
|
|
281
284
|
}>;
|
|
282
|
-
} | {
|
|
283
|
-
readonly _tag: "PressedArrowKey";
|
|
284
|
-
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
285
285
|
} | {
|
|
286
286
|
readonly _tag: "PressedDraggable";
|
|
287
287
|
readonly itemId: string;
|
|
@@ -299,8 +299,6 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
299
299
|
readonly clientX: number;
|
|
300
300
|
readonly clientY: number;
|
|
301
301
|
readonly maybeIndex: Option.Option<number>;
|
|
302
|
-
} | {
|
|
303
|
-
readonly _tag: "PressedEscape";
|
|
304
302
|
} | {
|
|
305
303
|
readonly _tag: "PressedGripKey";
|
|
306
304
|
readonly itemId: string;
|
|
@@ -340,21 +338,13 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
340
338
|
/** Lets items move, or stops them: while work runs, nothing moves. Stopping cancels an item
|
|
341
339
|
* that is pressed or held, so no `Moved` arrives for it. */
|
|
342
340
|
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
341
|
/** A held item follows the pointer, the arrows and Space move and drop it, Escape puts it back
|
|
352
342
|
* and the page scrolls near its edges, from listeners that run only while an item is pressed
|
|
353
343
|
* or held. Lift them into the application's Subscriptions, once per list, behind a key prefix
|
|
354
344
|
* of the parent's: `subscriptions("order")` is keyed `orderPointer`, `orderEscape`,
|
|
355
345
|
* `orderKeyboard` and `orderAutoScroll`. */
|
|
356
346
|
export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) => {
|
|
357
|
-
readonly
|
|
347
|
+
readonly pointer: Subscription.EntryWithoutKeepAlive<{
|
|
358
348
|
readonly dragAndDrop: {
|
|
359
349
|
readonly id: string;
|
|
360
350
|
readonly orientation: "Horizontal" | "Vertical";
|
|
@@ -413,6 +403,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
413
403
|
}>;
|
|
414
404
|
}>;
|
|
415
405
|
}, {
|
|
406
|
+
readonly _tag: "PressedEscape";
|
|
407
|
+
} | {
|
|
416
408
|
readonly _tag: "CancelledPointer";
|
|
417
409
|
} | {
|
|
418
410
|
readonly _tag: "CompletedAnnounceReorder";
|
|
@@ -421,6 +413,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
421
413
|
} | {
|
|
422
414
|
readonly _tag: "GotDragAndDropMessage";
|
|
423
415
|
readonly message: {
|
|
416
|
+
readonly _tag: "PressedArrowKey";
|
|
417
|
+
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
418
|
+
} | {
|
|
424
419
|
readonly _tag: "ActivatedKeyboardDrag";
|
|
425
420
|
readonly itemId: string;
|
|
426
421
|
readonly containerId: string;
|
|
@@ -447,9 +442,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
447
442
|
readonly containerId: string;
|
|
448
443
|
readonly index: number;
|
|
449
444
|
}>;
|
|
450
|
-
} | {
|
|
451
|
-
readonly _tag: "PressedArrowKey";
|
|
452
|
-
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
453
445
|
} | {
|
|
454
446
|
readonly _tag: "PressedDraggable";
|
|
455
447
|
readonly itemId: string;
|
|
@@ -467,8 +459,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
467
459
|
readonly clientX: number;
|
|
468
460
|
readonly clientY: number;
|
|
469
461
|
readonly maybeIndex: Option.Option<number>;
|
|
470
|
-
} | {
|
|
471
|
-
readonly _tag: "PressedEscape";
|
|
472
462
|
} | {
|
|
473
463
|
readonly _tag: "PressedGripKey";
|
|
474
464
|
readonly itemId: string;
|
|
@@ -496,11 +486,16 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
496
486
|
readonly clientY: number;
|
|
497
487
|
readonly maybeIndex: Option.Option<number>;
|
|
498
488
|
}, {
|
|
499
|
-
readonly
|
|
489
|
+
readonly maybeHold: Option.Option<{
|
|
490
|
+
readonly listId: string;
|
|
491
|
+
readonly heldHook: string;
|
|
492
|
+
readonly pointerId: number;
|
|
493
|
+
}>;
|
|
500
494
|
}, never> & {
|
|
501
495
|
readonly __subscription: never;
|
|
502
496
|
};
|
|
503
|
-
|
|
497
|
+
} & {
|
|
498
|
+
readonly escape: Subscription.EntryWithoutKeepAlive<{
|
|
504
499
|
readonly dragAndDrop: {
|
|
505
500
|
readonly id: string;
|
|
506
501
|
readonly orientation: "Horizontal" | "Vertical";
|
|
@@ -559,6 +554,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
559
554
|
}>;
|
|
560
555
|
}>;
|
|
561
556
|
}, {
|
|
557
|
+
readonly _tag: "PressedEscape";
|
|
558
|
+
} | {
|
|
562
559
|
readonly _tag: "CancelledPointer";
|
|
563
560
|
} | {
|
|
564
561
|
readonly _tag: "CompletedAnnounceReorder";
|
|
@@ -567,6 +564,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
567
564
|
} | {
|
|
568
565
|
readonly _tag: "GotDragAndDropMessage";
|
|
569
566
|
readonly message: {
|
|
567
|
+
readonly _tag: "PressedArrowKey";
|
|
568
|
+
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
569
|
+
} | {
|
|
570
570
|
readonly _tag: "ActivatedKeyboardDrag";
|
|
571
571
|
readonly itemId: string;
|
|
572
572
|
readonly containerId: string;
|
|
@@ -593,9 +593,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
593
593
|
readonly containerId: string;
|
|
594
594
|
readonly index: number;
|
|
595
595
|
}>;
|
|
596
|
-
} | {
|
|
597
|
-
readonly _tag: "PressedArrowKey";
|
|
598
|
-
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
599
596
|
} | {
|
|
600
597
|
readonly _tag: "PressedDraggable";
|
|
601
598
|
readonly itemId: string;
|
|
@@ -613,8 +610,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
613
610
|
readonly clientX: number;
|
|
614
611
|
readonly clientY: number;
|
|
615
612
|
readonly maybeIndex: Option.Option<number>;
|
|
616
|
-
} | {
|
|
617
|
-
readonly _tag: "PressedEscape";
|
|
618
613
|
} | {
|
|
619
614
|
readonly _tag: "PressedGripKey";
|
|
620
615
|
readonly itemId: string;
|
|
@@ -642,11 +637,7 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
642
637
|
readonly clientY: number;
|
|
643
638
|
readonly maybeIndex: Option.Option<number>;
|
|
644
639
|
}, {
|
|
645
|
-
readonly
|
|
646
|
-
readonly listId: string;
|
|
647
|
-
readonly heldHook: string;
|
|
648
|
-
readonly pointerId: number;
|
|
649
|
-
}>;
|
|
640
|
+
readonly isHolding: boolean;
|
|
650
641
|
}, never> & {
|
|
651
642
|
readonly __subscription: never;
|
|
652
643
|
};
|
|
@@ -710,6 +701,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
710
701
|
}>;
|
|
711
702
|
}>;
|
|
712
703
|
}, {
|
|
704
|
+
readonly _tag: "PressedEscape";
|
|
705
|
+
} | {
|
|
713
706
|
readonly _tag: "CancelledPointer";
|
|
714
707
|
} | {
|
|
715
708
|
readonly _tag: "CompletedAnnounceReorder";
|
|
@@ -718,6 +711,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
718
711
|
} | {
|
|
719
712
|
readonly _tag: "GotDragAndDropMessage";
|
|
720
713
|
readonly message: {
|
|
714
|
+
readonly _tag: "PressedArrowKey";
|
|
715
|
+
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
716
|
+
} | {
|
|
721
717
|
readonly _tag: "ActivatedKeyboardDrag";
|
|
722
718
|
readonly itemId: string;
|
|
723
719
|
readonly containerId: string;
|
|
@@ -744,9 +740,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
744
740
|
readonly containerId: string;
|
|
745
741
|
readonly index: number;
|
|
746
742
|
}>;
|
|
747
|
-
} | {
|
|
748
|
-
readonly _tag: "PressedArrowKey";
|
|
749
|
-
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
750
743
|
} | {
|
|
751
744
|
readonly _tag: "PressedDraggable";
|
|
752
745
|
readonly itemId: string;
|
|
@@ -764,8 +757,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
764
757
|
readonly clientX: number;
|
|
765
758
|
readonly clientY: number;
|
|
766
759
|
readonly maybeIndex: Option.Option<number>;
|
|
767
|
-
} | {
|
|
768
|
-
readonly _tag: "PressedEscape";
|
|
769
760
|
} | {
|
|
770
761
|
readonly _tag: "PressedGripKey";
|
|
771
762
|
readonly itemId: string;
|
|
@@ -857,6 +848,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
857
848
|
}>;
|
|
858
849
|
}>;
|
|
859
850
|
}, {
|
|
851
|
+
readonly _tag: "PressedEscape";
|
|
852
|
+
} | {
|
|
860
853
|
readonly _tag: "CancelledPointer";
|
|
861
854
|
} | {
|
|
862
855
|
readonly _tag: "CompletedAnnounceReorder";
|
|
@@ -865,6 +858,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
865
858
|
} | {
|
|
866
859
|
readonly _tag: "GotDragAndDropMessage";
|
|
867
860
|
readonly message: {
|
|
861
|
+
readonly _tag: "PressedArrowKey";
|
|
862
|
+
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
863
|
+
} | {
|
|
868
864
|
readonly _tag: "ActivatedKeyboardDrag";
|
|
869
865
|
readonly itemId: string;
|
|
870
866
|
readonly containerId: string;
|
|
@@ -891,9 +887,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
891
887
|
readonly containerId: string;
|
|
892
888
|
readonly index: number;
|
|
893
889
|
}>;
|
|
894
|
-
} | {
|
|
895
|
-
readonly _tag: "PressedArrowKey";
|
|
896
|
-
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
897
890
|
} | {
|
|
898
891
|
readonly _tag: "PressedDraggable";
|
|
899
892
|
readonly itemId: string;
|
|
@@ -911,8 +904,6 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
911
904
|
readonly clientX: number;
|
|
912
905
|
readonly clientY: number;
|
|
913
906
|
readonly maybeIndex: Option.Option<number>;
|
|
914
|
-
} | {
|
|
915
|
-
readonly _tag: "PressedEscape";
|
|
916
907
|
} | {
|
|
917
908
|
readonly _tag: "PressedGripKey";
|
|
918
909
|
readonly itemId: string;
|
|
@@ -1055,6 +1046,8 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
1055
1046
|
}>;
|
|
1056
1047
|
}>;
|
|
1057
1048
|
}, {
|
|
1049
|
+
readonly _tag: "PressedEscape";
|
|
1050
|
+
} | {
|
|
1058
1051
|
readonly _tag: "CancelledPointer";
|
|
1059
1052
|
} | {
|
|
1060
1053
|
readonly _tag: "CompletedAnnounceReorder";
|
|
@@ -1063,6 +1056,9 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
1063
1056
|
} | {
|
|
1064
1057
|
readonly _tag: "GotDragAndDropMessage";
|
|
1065
1058
|
readonly message: {
|
|
1059
|
+
readonly _tag: "PressedArrowKey";
|
|
1060
|
+
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
1061
|
+
} | {
|
|
1066
1062
|
readonly _tag: "ActivatedKeyboardDrag";
|
|
1067
1063
|
readonly itemId: string;
|
|
1068
1064
|
readonly containerId: string;
|
|
@@ -1089,9 +1085,6 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
1089
1085
|
readonly containerId: string;
|
|
1090
1086
|
readonly index: number;
|
|
1091
1087
|
}>;
|
|
1092
|
-
} | {
|
|
1093
|
-
readonly _tag: "PressedArrowKey";
|
|
1094
|
-
readonly direction: "Down" | "Left" | "NextContainer" | "PreviousContainer" | "Right" | "Up";
|
|
1095
1088
|
} | {
|
|
1096
1089
|
readonly _tag: "PressedDraggable";
|
|
1097
1090
|
readonly itemId: string;
|
|
@@ -1109,8 +1102,6 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
1109
1102
|
readonly clientX: number;
|
|
1110
1103
|
readonly clientY: number;
|
|
1111
1104
|
readonly maybeIndex: Option.Option<number>;
|
|
1112
|
-
} | {
|
|
1113
|
-
readonly _tag: "PressedEscape";
|
|
1114
1105
|
} | {
|
|
1115
1106
|
readonly _tag: "PressedGripKey";
|
|
1116
1107
|
readonly itemId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortable.d.ts","sourceRoot":"","sources":["../../../src/sortable/sortable.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAAS,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sortable.d.ts","sourceRoot":"","sources":["../../../src/sortable/sortable.ts"],"names":[],"mappings":"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"}
|
|
@@ -10,7 +10,7 @@ import * as Subscription from "foldkit/subscription";
|
|
|
10
10
|
import * as Update from "foldkit/update";
|
|
11
11
|
import * as Announcer from "../announcer/announcer.js";
|
|
12
12
|
import * as Button from "../button/button.js";
|
|
13
|
-
import { LEFT_BUTTON, activatedKeyboardDrag, cancelledDrag,
|
|
13
|
+
import { LEFT_BUTTON, activatedKeyboardDrag, canLift, cancelledDrag, escapeSubscriptions, insertionIndex, isCarrying, markDragging, measureLift, movedPointer, phaseOf, pointerMessages as dragMessages, pressedDraggable, releasedPointer, settle as settleDrag, } from "../drag/drag.js";
|
|
14
14
|
import * as Glyph from "../glyph/glyph.js";
|
|
15
15
|
import * as IconButton from "../iconButton/iconButton.js";
|
|
16
16
|
import { LOCALE } from "../locale/locale.js";
|
|
@@ -19,13 +19,15 @@ import { prefixKeys } from "../subscription/prefixKeys.js";
|
|
|
19
19
|
/** Schema for one item as the list knows it: its id, unique in the list, and its name in
|
|
20
20
|
* words, which the grip and screen readers use. */
|
|
21
21
|
export const Item = Schema.Struct({ id: Schema.String, label: Schema.String });
|
|
22
|
+
/** How the keyboard carries what it holds: said on the grip and once it is picked up. */
|
|
23
|
+
const KEYBOARD_MOVES = "Arrow keys move it one place, space drops it, escape cancels.";
|
|
22
24
|
/** The words a sortable says. `{item}` stands for the item's label, `{position}` and `{total}`
|
|
23
25
|
* for where it is, counted from one. */
|
|
24
26
|
const COPY = {
|
|
25
27
|
gripLabel: "Move {item}",
|
|
26
|
-
gripHelp:
|
|
28
|
+
gripHelp: `Press space to pick the item up. ${KEYBOARD_MOVES}`,
|
|
27
29
|
pickedUp: "Picked up {item}.",
|
|
28
|
-
pickedUpByKeyboard:
|
|
30
|
+
pickedUpByKeyboard: `Picked up {item}, {position} of {total}. ${KEYBOARD_MOVES}`,
|
|
29
31
|
over: "{item}, {position} of {total}.",
|
|
30
32
|
dropped: "{item} dropped at {position} of {total}.",
|
|
31
33
|
putBack: "{item} put back where it was.",
|
|
@@ -108,8 +110,6 @@ export const init = (config) => (__foldkitBrandViewResult(({
|
|
|
108
110
|
// ACCESSORS
|
|
109
111
|
/** The list's id, unique in the document. */
|
|
110
112
|
const id = (model) => __foldkitBrandViewResult((model.dragAndDrop.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#id");
|
|
111
|
-
/** Whether an item is pressed or held. */
|
|
112
|
-
export const isHolding = (model) => __foldkitBrandViewResult((Option.isSome(UiDragAndDrop.maybeDraggedItemId(model.dragAndDrop))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#isHolding");
|
|
113
113
|
// DOM HOOKS
|
|
114
114
|
const itemHook = (model, itemId) => __foldkitBrandViewResult((`${id(model)}/${itemId}`), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#itemHook");
|
|
115
115
|
const GRIP_ATTRIBUTE = "sortable-grip";
|
|
@@ -139,7 +139,7 @@ const placementOf = (model, held, rawIndex) => __foldkitBrandViewResult((Option.
|
|
|
139
139
|
itemId: held.item.id,
|
|
140
140
|
fromIndex,
|
|
141
141
|
toIndex,
|
|
142
|
-
maybeAfterItemId: Option.map(
|
|
142
|
+
maybeAfterItemId: Option.map(Array.get(others, toIndex - 1), (item) => __foldkitBrandViewResult((item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~5")),
|
|
143
143
|
maybeBeforeItemId: Option.map(Array.get(others, toIndex), (item) => __foldkitBrandViewResult((item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~6")),
|
|
144
144
|
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~3");
|
|
145
145
|
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#placementOf");
|
|
@@ -185,28 +185,12 @@ const moveText = (held, previous, next, maybeOutMessage, putBack) => {
|
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
187
|
/** Announces the step a DragAndDrop update took and forgets the held item once it is down. */
|
|
188
|
-
const settle = (previous, putBack = COPY.putBack) => __foldkitBrandViewResult(((dragAndDropUpdate) => {
|
|
189
|
-
const nextModel = phaseOf(dragAndDropUpdate.model.dragAndDrop) === "Idle"
|
|
190
|
-
? modifyFields(dragAndDropUpdate.model, { maybeHeld: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#maybeHeld") })
|
|
191
|
-
: dragAndDropUpdate.model;
|
|
192
|
-
const maybeText = Option.flatMap(previous.maybeHeld, (held) => __foldkitBrandViewResult((moveText(held, previous, dragAndDropUpdate.model, Option.fromNullishOr(dragAndDropUpdate.outMessage), putBack)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~14"));
|
|
193
|
-
return __foldkitBrandViewResult((Update.withOutMessage({
|
|
194
|
-
model: nextModel,
|
|
195
|
-
commands: [
|
|
196
|
-
...(dragAndDropUpdate.commands ?? []),
|
|
197
|
-
...Array.fromOption(Option.map(maybeText, (text) => __foldkitBrandViewResult((AnnounceReorder({ text })), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~15"))),
|
|
198
|
-
],
|
|
199
|
-
}, dragAndDropUpdate.outMessage)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~13");
|
|
200
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#settle");
|
|
201
|
-
// NOTE: @foldkit/ui gap: DragAndDrop's pointer resolves a drop along one axis, which a
|
|
202
|
-
// wrapping grid cannot use, so the list reads the pointer itself and hands DragAndDrop its
|
|
203
|
-
// moves and release.
|
|
204
|
-
const canLift = (model) => __foldkitBrandViewResult((model.isMovable && phaseOf(model.dragAndDrop) === "Idle"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#canLift");
|
|
188
|
+
const settle = (previous, putBack = COPY.putBack) => __foldkitBrandViewResult(((dragAndDropUpdate) => __foldkitBrandViewResult((settleDrag(dragAndDropUpdate, Option.map(Option.flatMap(previous.maybeHeld, (held) => __foldkitBrandViewResult((moveText(held, previous, dragAndDropUpdate.model, Option.fromNullishOr(dragAndDropUpdate.outMessage), putBack)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~14")), (text) => __foldkitBrandViewResult((AnnounceReorder({ text })), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~15")))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~13")), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#settle");
|
|
205
189
|
/** The item `itemId` and its place, when the list may lift it now. */
|
|
206
|
-
const liftable = (model, items, itemId) => __foldkitBrandViewResult((Option.filter(Option.
|
|
190
|
+
const liftable = (model, items, itemId) => __foldkitBrandViewResult((Option.filter(Option.map(Array.findFirstWithIndex(items, (item) => __foldkitBrandViewResult((item.id === itemId), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~16")), ([item, index]) => (__foldkitBrandViewResult(({ index, item }), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~17"))), () => __foldkitBrandViewResult((canLift(model)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~18"))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#liftable");
|
|
207
191
|
/** Lifts `held` with the DragAndDrop Message `lift` and says so. */
|
|
208
192
|
const lift = (model, held, liftMessage) => {
|
|
209
|
-
const pressed = modifyFields(model, { maybeHeld: () => __foldkitBrandViewResult((Option.some(held)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#maybeHeld
|
|
193
|
+
const pressed = modifyFields(model, { maybeHeld: () => __foldkitBrandViewResult((Option.some(held)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#maybeHeld") });
|
|
210
194
|
return __foldkitBrandViewResult((settle(pressed)(foldDragAndDrop(pressed, liftMessage))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#lift");
|
|
211
195
|
};
|
|
212
196
|
const pointerMove = (model, pointer) => __foldkitBrandViewResult((movedPointer({
|
|
@@ -273,6 +257,9 @@ export const setMovable = (model, isMovable) => {
|
|
|
273
257
|
return __foldkitBrandViewResult((isMovable ? { model: next } : cancelDrag(next)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#setMovable");
|
|
274
258
|
};
|
|
275
259
|
// SUBSCRIPTION
|
|
260
|
+
// NOTE: @foldkit/ui gap: DragAndDrop's pointer resolves a drop along one axis, which a
|
|
261
|
+
// wrapping grid cannot use, so the list reads the pointer itself and hands DragAndDrop its
|
|
262
|
+
// moves and release.
|
|
276
263
|
/** Where a pointer at this point would drop the held item in the list `listId`: none when the
|
|
277
264
|
* pointer is not over it. */
|
|
278
265
|
const pointerIndex = (listId, heldHook, clientX, clientY) => __foldkitBrandViewResult((pipe(Array.findFirst(document.elementsFromPoint(clientX, clientY), (element) => __foldkitBrandViewResult((element.getAttribute("data-droppable-id") === listId), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~23")), Option.map((list) => __foldkitBrandViewResult((insertionIndex(list, heldHook, clientX, clientY)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~24")))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#pointerIndex");
|
|
@@ -289,17 +276,21 @@ const pointerAt = (hold, event) => (__foldkitBrandViewResult(({
|
|
|
289
276
|
maybeIndex: pointerIndex(hold.listId, hold.heldHook, event.clientX, event.clientY),
|
|
290
277
|
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#pointerAt"));
|
|
291
278
|
/** The pressing pointer's moves, release and cancel; another pointer's are not the list's. */
|
|
292
|
-
|
|
293
|
-
|
|
279
|
+
const pointerMessages = (hold) => __foldkitBrandViewResult((dragMessages(hold.pointerId, {
|
|
280
|
+
moved: (event) => __foldkitBrandViewResult((Message.MovedPointer(pointerAt(hold, event))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#moved"),
|
|
281
|
+
released: (event) => __foldkitBrandViewResult((Message.ReleasedPointer(pointerAt(hold, event))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#released"),
|
|
282
|
+
cancelled: () => __foldkitBrandViewResult((Message.CancelledPointer()), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#cancelled"),
|
|
283
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#pointerMessages");
|
|
284
|
+
const pointerSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResult(({
|
|
294
285
|
pointer: entry({ maybeHold: Schema.Option(PointerHold) }, {
|
|
295
286
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({
|
|
296
287
|
maybeHold: Option.filter(Option.flatMap(model.maybeHeld, ({ item, maybePress }) => __foldkitBrandViewResult((Option.map(maybePress, ({ pointerId }) => (__foldkitBrandViewResult(({
|
|
297
288
|
listId: id(model),
|
|
298
289
|
heldHook: itemHook(model, item.id),
|
|
299
290
|
pointerId,
|
|
300
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
291
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~27")))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~26")), () => {
|
|
301
292
|
const phase = phaseOf(model.dragAndDrop);
|
|
302
|
-
return __foldkitBrandViewResult((phase === "Pressed" || phase === "PointerDragging"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
293
|
+
return __foldkitBrandViewResult((phase === "Pressed" || phase === "PointerDragging"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~28");
|
|
303
294
|
}),
|
|
304
295
|
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#modelToDependencies")),
|
|
305
296
|
dependenciesToStream: ({ maybeHold }) => __foldkitBrandViewResult((Option.match(maybeHold, {
|
|
@@ -307,11 +298,7 @@ const ownSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResul
|
|
|
307
298
|
onSome: (hold) => __foldkitBrandViewResult((Stream.merge(pointerMessages(hold), markDragging)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#onSome~4"),
|
|
308
299
|
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#dependenciesToStream"),
|
|
309
300
|
}),
|
|
310
|
-
|
|
311
|
-
modelToDependencies: (model) => (__foldkitBrandViewResult(({ isHolding: isHolding(model) }), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#modelToDependencies~2")),
|
|
312
|
-
dependenciesToStream: ({ isHolding: isHoldingNow }) => __foldkitBrandViewResult((isHoldingNow ? escapeKeys(Message.PressedEscape()) : Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#dependenciesToStream~2"),
|
|
313
|
-
}),
|
|
314
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~29")));
|
|
301
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~25")));
|
|
315
302
|
// NOTE: @foldkit/ui gap: DragAndDrop's Subscription keys are fixed, so two of its users on a
|
|
316
303
|
// page would share them. The list lifts the ones it uses under its own names, behind the
|
|
317
304
|
// parent's prefix.
|
|
@@ -322,7 +309,7 @@ const dragSubscriptions = Subscription.lift({
|
|
|
322
309
|
read: (model) => __foldkitBrandViewResult((Option.some(model.dragAndDrop)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#read~2"),
|
|
323
310
|
toParentMessage: toDragAndDropMessage,
|
|
324
311
|
});
|
|
325
|
-
const sortableSubscriptions = Subscription.aggregate(
|
|
312
|
+
const sortableSubscriptions = Subscription.aggregate(pointerSubscriptions, escapeSubscriptions(Message.PressedEscape()), dragSubscriptions);
|
|
326
313
|
/** A held item follows the pointer, the arrows and Space move and drop it, Escape puts it back
|
|
327
314
|
* and the page scrolls near its edges, from listeners that run only while an item is pressed
|
|
328
315
|
* or held. Lift them into the application's Subscriptions, once per list, behind a key prefix
|
|
@@ -337,7 +324,7 @@ export const SizeLiftedItem = Mount.define("SizeLiftedItem", {
|
|
|
337
324
|
messages: [Message.CompletedSizeLiftedItem],
|
|
338
325
|
execute: ({ element, itemHook: hook, pressX, pressY }) => __foldkitBrandViewResult((Effect.sync(() => {
|
|
339
326
|
measureLift(element, `[data-sortable-id="${CSS.escape(hook)}"]`, pressX, pressY);
|
|
340
|
-
return __foldkitBrandViewResult((Message.CompletedSizeLiftedItem()), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
327
|
+
return __foldkitBrandViewResult((Message.CompletedSizeLiftedItem()), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~29");
|
|
341
328
|
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#execute~2"),
|
|
342
329
|
});
|
|
343
330
|
const helpId = (model) => __foldkitBrandViewResult((`${id(model)}-grip-help`), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#helpId");
|
|
@@ -354,7 +341,7 @@ const liftedView = (info, item, h) => __foldkitBrandViewResult((h.div([h.Class("
|
|
|
354
341
|
const gripView = (info, item, h) => {
|
|
355
342
|
const { model, isMovable, items } = info;
|
|
356
343
|
const isIdleNow = phaseOf(model.dragAndDrop) === "Idle";
|
|
357
|
-
const onGripKey = h.OnKeyDownPreventDefault((key) => __foldkitBrandViewResult((Option.liftPredicate(Message.PressedGripKey({ itemId: item.id, items }), () => __foldkitBrandViewResult((isIdleNow && (key === " " || key === "Enter")), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
344
|
+
const onGripKey = h.OnKeyDownPreventDefault((key) => __foldkitBrandViewResult((Option.liftPredicate(Message.PressedGripKey({ itemId: item.id, items }), () => __foldkitBrandViewResult((isIdleNow && (key === " " || key === "Enter")), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~31"))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~30"));
|
|
358
345
|
const onGripPress = h.OnPointerDown((_pointerType, button, screenX, screenY, _time, clientX, clientY, pointerId) => __foldkitBrandViewResult((Option.liftPredicate(Message.PressedItem({
|
|
359
346
|
itemId: item.id,
|
|
360
347
|
pointerId,
|
|
@@ -363,7 +350,7 @@ const gripView = (info, item, h) => {
|
|
|
363
350
|
clientX,
|
|
364
351
|
clientY,
|
|
365
352
|
items,
|
|
366
|
-
}), () => __foldkitBrandViewResult((isIdleNow && button === LEFT_BUTTON), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
353
|
+
}), () => __foldkitBrandViewResult((isIdleNow && button === LEFT_BUTTON), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~33"))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~32"));
|
|
367
354
|
// NOTE: @foldkit/ui gap: DragAndDrop's `draggable` bundle forces `role="option"`, which a
|
|
368
355
|
// plain list's items are not. So the grip carries the ui's `data-draggable-id` by hand, and
|
|
369
356
|
// FocusItem finds the grip by it. While moves are held the grip stays, held, so the focus
|
|
@@ -385,17 +372,17 @@ const gripView = (info, item, h) => {
|
|
|
385
372
|
};
|
|
386
373
|
/** Where a pointer would drop the held item, marked on the item it would land beside: before
|
|
387
374
|
* the other item at its target, or after the last. None where it already was. */
|
|
388
|
-
const dropMarkOf = (model) => __foldkitBrandViewResult((pipe(model.maybeHeld, Option.filter(() => __foldkitBrandViewResult((phaseOf(model.dragAndDrop) === "PointerDragging"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
389
|
-
const others = Array.filter(held.items, (item) => __foldkitBrandViewResult((item.id !== held.item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
375
|
+
const dropMarkOf = (model) => __foldkitBrandViewResult((pipe(model.maybeHeld, Option.filter(() => __foldkitBrandViewResult((phaseOf(model.dragAndDrop) === "PointerDragging"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~34")), Option.flatMap((held) => __foldkitBrandViewResult((pipe(targetIndex(model, held), Option.filter((index) => __foldkitBrandViewResult((!Option.contains(indexOf(held.items, held.item.id), index)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~36")), Option.flatMap((index) => {
|
|
376
|
+
const others = Array.filter(held.items, (item) => __foldkitBrandViewResult((item.id !== held.item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~38"));
|
|
390
377
|
return __foldkitBrandViewResult((Option.orElse(Option.map(Array.get(others, index), (item) => (__foldkitBrandViewResult(({
|
|
391
378
|
itemId: item.id,
|
|
392
379
|
side: "Before",
|
|
393
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
380
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~39"))), () => __foldkitBrandViewResult((Option.map(Array.last(others), (item) => (__foldkitBrandViewResult(({
|
|
394
381
|
itemId: item.id,
|
|
395
382
|
side: "After",
|
|
396
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
397
|
-
}))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
398
|
-
const dropClass = (info, item) => __foldkitBrandViewResult((Option.match(Option.filter(info.maybeDropMark, ({ itemId }) => __foldkitBrandViewResult((itemId === item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
383
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~41")))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~40"))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~37");
|
|
384
|
+
}))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~35")))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#dropMarkOf");
|
|
385
|
+
const dropClass = (info, item) => __foldkitBrandViewResult((Option.match(Option.filter(info.maybeDropMark, ({ itemId }) => __foldkitBrandViewResult((itemId === item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~42")), {
|
|
399
386
|
onNone: () => __foldkitBrandViewResult((""), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#onNone~5"),
|
|
400
387
|
onSome: ({ side }) => (__foldkitBrandViewResult((side === "Before" ? " drop-before" : " drop-after"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#onSome~5")),
|
|
401
388
|
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#dropClass");
|
|
@@ -406,17 +393,17 @@ const itemView = (info, item, h) => __foldkitBrandViewResult((h.keyed("li")(item
|
|
|
406
393
|
* counted as an item. */
|
|
407
394
|
const itemsView = (info, h) => {
|
|
408
395
|
const { model, items } = info;
|
|
409
|
-
const rows = Array.map(items, (item) => (__foldkitBrandViewResult(({ item, html: itemView(info, item, h) }), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
410
|
-
const maybeSlot = pipe(model.maybeHeld, Option.filter(() => __foldkitBrandViewResult((phaseOf(model.dragAndDrop) === "KeyboardDragging"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
396
|
+
const rows = Array.map(items, (item) => (__foldkitBrandViewResult(({ item, html: itemView(info, item, h) }), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~43")));
|
|
397
|
+
const maybeSlot = pipe(model.maybeHeld, Option.filter(() => __foldkitBrandViewResult((phaseOf(model.dragAndDrop) === "KeyboardDragging"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~44")), Option.flatMap((held) => __foldkitBrandViewResult((Option.map(targetIndex(model, held), (index) => (__foldkitBrandViewResult(({ held, index }), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~46")))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~45")));
|
|
411
398
|
return __foldkitBrandViewResult((Option.match(maybeSlot, {
|
|
412
|
-
onNone: () => __foldkitBrandViewResult((Array.map(rows, ({ html }) => __foldkitBrandViewResult((html), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
399
|
+
onNone: () => __foldkitBrandViewResult((Array.map(rows, ({ html }) => __foldkitBrandViewResult((html), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~47"))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#onNone~6"),
|
|
413
400
|
onSome: ({ held, index }) => {
|
|
414
401
|
const slot = h.keyed("li")("sortable-slot", [h.Class("sortable-slot"), h.AriaHidden(true), h.Inert(true)], [liftedView(info, held.item, h)]);
|
|
415
|
-
const others = Array.filter(rows, ({ item }) => __foldkitBrandViewResult((item.id !== held.item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
402
|
+
const others = Array.filter(rows, ({ item }) => __foldkitBrandViewResult((item.id !== held.item.id), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~48"));
|
|
416
403
|
const maybeBefore = Array.get(others, index);
|
|
417
404
|
return __foldkitBrandViewResult((Option.match(maybeBefore, {
|
|
418
|
-
onNone: () => __foldkitBrandViewResult(([...Array.map(rows, ({ html }) => __foldkitBrandViewResult((html), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
419
|
-
onSome: (before) => __foldkitBrandViewResult((Array.flatMap(rows, ({ item, html }) => __foldkitBrandViewResult((item.id === before.item.id ? [slot, html] : [html]), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
405
|
+
onNone: () => __foldkitBrandViewResult(([...Array.map(rows, ({ html }) => __foldkitBrandViewResult((html), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~49")), slot]), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#onNone~7"),
|
|
406
|
+
onSome: (before) => __foldkitBrandViewResult((Array.flatMap(rows, ({ item, html }) => __foldkitBrandViewResult((item.id === before.item.id ? [slot, html] : [html]), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~50"))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#onSome~7"),
|
|
420
407
|
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#onSome~6");
|
|
421
408
|
},
|
|
422
409
|
})), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#itemsView");
|
|
@@ -426,7 +413,7 @@ const liftedCopyView = (info, h) => {
|
|
|
426
413
|
const maybeLifted = Option.all({
|
|
427
414
|
style: UiDragAndDrop.ghostStyle(model.dragAndDrop),
|
|
428
415
|
held: model.maybeHeld,
|
|
429
|
-
press: Option.flatMap(model.maybeHeld, ({ maybePress }) => __foldkitBrandViewResult((maybePress), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
416
|
+
press: Option.flatMap(model.maybeHeld, ({ maybePress }) => __foldkitBrandViewResult((maybePress), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~51")),
|
|
430
417
|
});
|
|
431
418
|
return __foldkitBrandViewResult((Array.fromOption(Option.map(maybeLifted, ({ style, held, press }) => __foldkitBrandViewResult((h.div([
|
|
432
419
|
h.Class("sortable-lift"),
|
|
@@ -438,9 +425,9 @@ const liftedCopyView = (info, h) => {
|
|
|
438
425
|
pressX: press.clientX,
|
|
439
426
|
pressY: press.clientY,
|
|
440
427
|
})),
|
|
441
|
-
], [liftedView(info, held.item, h)])), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
428
|
+
], [liftedView(info, held.item, h)])), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~52")))), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#liftedCopyView");
|
|
442
429
|
};
|
|
443
|
-
const layoutClass = (layout) => __foldkitBrandViewResult((Match.value(layout).pipe(Match.withReturnType(), Match.when("List", () => __foldkitBrandViewResult(("sortable"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
430
|
+
const layoutClass = (layout) => __foldkitBrandViewResult((Match.value(layout).pipe(Match.withReturnType(), Match.when("List", () => __foldkitBrandViewResult(("sortable"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~53")), Match.when("Grid", () => __foldkitBrandViewResult(("sortable grid"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~54")), Match.when("Panels", () => __foldkitBrandViewResult(("sortable panels"), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~55")), Match.exhaustive)), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#layoutClass");
|
|
444
431
|
/**
|
|
445
432
|
* Items the reader puts in order, as rows, as tiles or as panels, built on `@foldkit/ui`'s
|
|
446
433
|
* DragAndDrop: `div.sortable` holding `ul.sortable-items` (named by `label`) of
|
|
@@ -476,5 +463,5 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
476
463
|
], itemsView(info, h)),
|
|
477
464
|
h.p([h.Id(helpId(model)), h.Class("sr-only")], [COPY.gripHelp]),
|
|
478
465
|
...liftedCopyView(info, h),
|
|
479
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~
|
|
466
|
+
])), "@gjermundgaraba-designs/pixel-paper/src/sortable/sortable.js#anonymous~56");
|
|
480
467
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import type { Html, HtmlBuilder } from "foldkit/html";
|
|
3
3
|
/** `S`: things in one line (8px). `M`: the parts of one body (14px). `L`: whole surfaces,
|
|
4
|
-
* panel to panel (24px).
|
|
4
|
+
* panel to panel (24px). */
|
|
5
5
|
export declare const Space: Schema.Literals<readonly ["S", "M", "L"]>;
|
|
6
6
|
export type Space = typeof Space.Type;
|
|
7
7
|
/** Configuration for rendering a stack with `view`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/stack/stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAItD;
|
|
1
|
+
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/stack/stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAItD;6BAC6B;AAC7B,eAAO,MAAM,KAAK,2CAAmC,CAAC;AACtD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AActC,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,IAAI,EAAE,aAAa,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IACnC,qDAAqD;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC;CACb,CAAC,CAAC;AAEH;;iBAEiB;AACjB,eAAO,MAAM,IAAI,GAAI,OAAO,UAAU,UAAU,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IAI3E,CAAC"}
|
package/dist/src/stack/stack.js
CHANGED
|
@@ -2,7 +2,7 @@ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
|
2
2
|
import { Match, Schema } from "effect";
|
|
3
3
|
// SPACE
|
|
4
4
|
/** `S`: things in one line (8px). `M`: the parts of one body (14px). `L`: whole surfaces,
|
|
5
|
-
* panel to panel (24px).
|
|
5
|
+
* panel to panel (24px). */
|
|
6
6
|
export const Space = Schema.Literals(["S", "M", "L"]);
|
|
7
7
|
/** The class that sets a layout's gap. */
|
|
8
8
|
const gapClassName = (gap) => __foldkitBrandViewResult((Match.value(gap).pipe(Match.withReturnType(), Match.when("S", () => __foldkitBrandViewResult(("gap-s"), "@gjermundgaraba-designs/pixel-paper/src/stack/stack.js#anonymous")), Match.when("M", () => __foldkitBrandViewResult(("gap-m"), "@gjermundgaraba-designs/pixel-paper/src/stack/stack.js#anonymous~2")), Match.when("L", () => __foldkitBrandViewResult(("gap-l"), "@gjermundgaraba-designs/pixel-paper/src/stack/stack.js#anonymous~3")), Match.exhaustive)), "@gjermundgaraba-designs/pixel-paper/src/stack/stack.js#gapClassName");
|
package/dist/src/tabs/tabs.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type OutMessage = typeof OutMessage.Type;
|
|
|
40
40
|
export type InitConfig = Readonly<{
|
|
41
41
|
id: string;
|
|
42
42
|
}>;
|
|
43
|
-
/** Creates a tab strip. Arrows select as they move
|
|
43
|
+
/** Creates a tab strip. Arrows select as they move. */
|
|
44
44
|
export declare const init: (config: InitConfig) => Model;
|
|
45
45
|
/** The tab strip's id, unique in the document. */
|
|
46
46
|
export declare const id: (model: Model) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAMzC;yFACyF;AACzF,eAAO,MAAM,KAAK;;;;;;EAEhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAItC,qDAAqD;AACrD,eAAO,MAAM,OAAO;;QACA,OAAO;;;;;;;;;;;EACzB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAI1C;iEACiE;AACjE,eAAO,MAAM,UAAU;;QACT,KAAK;;EACjB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAIhD;2DAC2D;AAC3D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElD,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAMzC;yFACyF;AACzF,eAAO,MAAM,KAAK;;;;;;EAEhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAItC,qDAAqD;AACrD,eAAO,MAAM,OAAO;;QACA,OAAO;;;;;;;;;;;EACzB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAI1C;iEACiE;AACjE,eAAO,MAAM,UAAU;;QACT,KAAK;;EACjB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAIhD;2DAC2D;AAC3D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElD,uDAAuD;AACvD,eAAO,MAAM,IAAI,WAAY,UAAU,KAAG,KAExC,CAAC;AAIH,kDAAkD;AAClD,eAAO,MAAM,EAAE,UAAW,KAAK,KAAG,MAAuB,CAAC;AAgB1D,yFAAyF;AACzF,eAAO,MAAM,MAAM,UAAW,KAAK,WAAW,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;EAGjD,CAAC;AAIL,8EAA8E;AAC9E,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,8EAA8E;AAC9E,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IACzB,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB;;sEAEkE;IAClE,WAAW,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;CACxC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;IAjBf,6CAA6C;WACtC,MAAM;UACP,aAAa,CAAC,GAAG,CAAC;IACxB,yDAAyD;mBAC1C,MAAM;IACrB;;sEAEkE;iBACrD,MAAM,aAAa,CAAC,IAAI,CAAC;GA+CtC,CAAC"}
|
package/dist/src/tabs/tabs.js
CHANGED
|
@@ -23,7 +23,7 @@ export const Message = defineMessageUnion({
|
|
|
23
23
|
export const OutMessage = defineMessageUnion({
|
|
24
24
|
Selected: { value: Schema.String },
|
|
25
25
|
});
|
|
26
|
-
/** Creates a tab strip. Arrows select as they move
|
|
26
|
+
/** Creates a tab strip. Arrows select as they move. */
|
|
27
27
|
export const init = (config) => (__foldkitBrandViewResult(({
|
|
28
28
|
tabs: UiTabs.init({ id: config.id, activationMode: "Automatic" }),
|
|
29
29
|
}), "@gjermundgaraba-designs/pixel-paper/src/tabs/tabs.js#init"));
|