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