@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
package/dist/src/reel/reel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Array, Effect, Equal, Match, Number, Option, Order, Schema, Stream, String } from "effect";
|
|
2
|
+
import { Array, Effect, Equal, Match, Number, Option, Order, Queue, Schema, Stream, String, } from "effect";
|
|
3
3
|
import * as Command from "foldkit/command";
|
|
4
4
|
import { defineMessageUnion } from "foldkit/message";
|
|
5
5
|
import * as Mount from "foldkit/mount";
|
|
@@ -15,21 +15,23 @@ import * as Glyph from "../glyph/glyph.js";
|
|
|
15
15
|
import * as IconButton from "../iconButton/iconButton.js";
|
|
16
16
|
import { isPlain } from "../keys/keys.js";
|
|
17
17
|
import { prefixKeys } from "../subscription/prefixKeys.js";
|
|
18
|
-
import { OutMessage, Resize, Splitter, Step, Subject, Target, WHERE_IT_WAS, apply, columnOfTarget, fill, firstPlace, isSplitterPresent, isTargetPresent, landingWords, nextPreset, originOf, placeAt, placeOf, placeWords, requestOf, resizeOf, steppedTarget, subjectWords, targetAtPoint, whereWords, widthWords, } from "./layout.js";
|
|
18
|
+
import { OutMessage, Resize, Splitter, Step, Subject, Target, WHERE_IT_WAS, apply, columnOfTarget, fill, firstPlace, isChange, isSplitterPresent, isTargetPresent, landingWords, nextPreset, originOf, placeAt, placeOf, placeWords, requestOf, resizeOf, steppedTarget, subjectWords, targetAtPoint, whereWords, widthWords, } from "./layout.js";
|
|
19
19
|
// MODEL
|
|
20
|
+
/** How the keyboard carries what it holds: said on the grip and once it is picked up. */
|
|
21
|
+
const KEYBOARD_MOVES = "Arrow keys move it, space drops it, escape or tab puts it back.";
|
|
20
22
|
/** The words a reel says. `{pane}` is a pane's label, `{subject}` what moves (the held pane,
|
|
21
23
|
* or a column a key moves, by its first pane), `{where}` a place and `{column}` a column's
|
|
22
24
|
* number. */
|
|
23
25
|
const COPY = {
|
|
24
26
|
paneGrip: "Move {pane}",
|
|
25
|
-
gripHelp:
|
|
27
|
+
gripHelp: `Press space to pick it up. ${KEYBOARD_MOVES}`,
|
|
26
28
|
widthLabel: "Width of column {column}",
|
|
27
29
|
heightLabel: "Height of {pane}",
|
|
28
30
|
focused: "{pane}, {where}.",
|
|
29
31
|
moved: "{subject} moved to {where}.",
|
|
30
32
|
widened: "Column {column} takes {width}.",
|
|
31
33
|
pickedUp: "Picked up {subject}.",
|
|
32
|
-
pickedUpByKeyboard:
|
|
34
|
+
pickedUpByKeyboard: `Picked up {subject}. ${KEYBOARD_MOVES}`,
|
|
33
35
|
over: "{subject}, {where}.",
|
|
34
36
|
dropped: "{subject} dropped at {where}.",
|
|
35
37
|
putBack: "{subject} put back where it was.",
|
|
@@ -132,6 +134,8 @@ const focusedPlace = (model, layout) => __foldkitBrandViewResult((Option.orElse(
|
|
|
132
134
|
* now nearest its place; the first pane before any is focused. None for an empty layout. */
|
|
133
135
|
export const focusedPaneId = (model, layout) => __foldkitBrandViewResult((Option.map(focusedPlace(model, layout), ({ pane }) => __foldkitBrandViewResult((pane.id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~4"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#focusedPaneId");
|
|
134
136
|
const isHolding = (model) => __foldkitBrandViewResult((Option.isSome(model.maybeHeld)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#isHolding");
|
|
137
|
+
/** Whether nothing is held and no splitter is dragged: a grip or a splitter may be pressed. */
|
|
138
|
+
const isIdle = (model) => __foldkitBrandViewResult((!isHolding(model) && Option.isNone(model.maybeResizing)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#isIdle");
|
|
135
139
|
/** Whether `held` is carried: by the keyboard, or by a pointer past the threshold. */
|
|
136
140
|
const isCarried = (held) => __foldkitBrandViewResult((By.match(held.by, { Pointer: ({ isCarrying }) => __foldkitBrandViewResult((isCarrying), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#Pointer"), Keyboard: () => __foldkitBrandViewResult((true), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#Keyboard") })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#isCarried");
|
|
137
141
|
// DOM HOOKS
|
|
@@ -206,7 +210,8 @@ const focusOn = (model, place) => __foldkitBrandViewResult((modifyFields(model,
|
|
|
206
210
|
maybeFocus: () => __foldkitBrandViewResult((Option.some({ paneId: place.pane.id, column: place.columnIndex, row: place.row })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#maybeFocus"),
|
|
207
211
|
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#focusOn");
|
|
208
212
|
const announce = (text) => __foldkitBrandViewResult((AnnounceReel({ text })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#announce");
|
|
209
|
-
const
|
|
213
|
+
const heldLabel = (layout, held) => __foldkitBrandViewResult((Option.getOrElse(subjectWords(layout, Subject.Pane({ paneId: held.paneId })), () => __foldkitBrandViewResult((""), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~13"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#heldLabel");
|
|
214
|
+
const heldWords = (layout, held) => __foldkitBrandViewResult((String.capitalize(heldLabel(layout, held))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#heldWords");
|
|
210
215
|
const scrollToTarget = (model, layout, target) => __foldkitBrandViewResult((Array.fromOption(Option.map(columnOfTarget(layout, target), (columnId) => __foldkitBrandViewResult((ScrollIntoView({ hook: columnHook(model, columnId) })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~14")))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#scrollToTarget");
|
|
211
216
|
/** Lets go of the held pane: dropped at its target when it is carried and the drop changes
|
|
212
217
|
* something (reported as the request), put back otherwise, said in `putBack`'s words. */
|
|
@@ -235,7 +240,7 @@ const letGo = (model, layout, held, putBack) => {
|
|
|
235
240
|
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#letGo");
|
|
236
241
|
};
|
|
237
242
|
const cancel = (model, layout, held) => __foldkitBrandViewResult((letGo(model, layout, { ...held, maybeTarget: Option.none() }, COPY.cancelled)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#cancel");
|
|
238
|
-
const lift = (model, layout, paneId, by) => __foldkitBrandViewResult((Option.match(Option.filter(originOf(layout, paneId), () => __foldkitBrandViewResult((
|
|
243
|
+
const lift = (model, layout, paneId, by) => __foldkitBrandViewResult((Option.match(Option.filter(originOf(layout, paneId), () => __foldkitBrandViewResult((isIdle(model)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~17")), {
|
|
239
244
|
onNone: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~3")),
|
|
240
245
|
onSome: (origin) => {
|
|
241
246
|
const held = { paneId, by, maybeTarget: Option.some(origin) };
|
|
@@ -330,7 +335,7 @@ export const update = (model, message, context) => {
|
|
|
330
335
|
onNone: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~8")),
|
|
331
336
|
onSome: (place) => (__foldkitBrandViewResult(({ model: focusOn(model, place) }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~7")),
|
|
332
337
|
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#FocusedPane"),
|
|
333
|
-
PressedSplitter: ({ splitter, pointerId, clientX, clientY }) => __foldkitBrandViewResult((
|
|
338
|
+
PressedSplitter: ({ splitter, pointerId, clientX, clientY }) => __foldkitBrandViewResult((!isIdle(model) || !isSplitterPresent(layout, splitter)
|
|
334
339
|
? { model }
|
|
335
340
|
: {
|
|
336
341
|
model: withResizing(model, Option.some({
|
|
@@ -422,7 +427,7 @@ const focusStep = (model, layout, place) => (__foldkitBrandViewResult(({
|
|
|
422
427
|
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#focusStep"));
|
|
423
428
|
/** Asks for `request` with focus kept on the pane it moves, at its new place, the reel
|
|
424
429
|
* scrolled to it and the move said; nothing where it would change nothing. */
|
|
425
|
-
const requestStep = (model, layout, place, subject, maybeRequest) => __foldkitBrandViewResult((Option.match(Option.filter(maybeRequest, (request) => __foldkitBrandViewResult((
|
|
430
|
+
const requestStep = (model, layout, place, subject, maybeRequest) => __foldkitBrandViewResult((Option.match(Option.filter(maybeRequest, (request) => __foldkitBrandViewResult((isChange(layout, request)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~36")), {
|
|
426
431
|
onNone: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~12")),
|
|
427
432
|
onSome: (request) => {
|
|
428
433
|
const next = apply(layout, request);
|
|
@@ -492,29 +497,36 @@ export const perform = (model, action, context) => {
|
|
|
492
497
|
const EDGE_SCROLL = 40;
|
|
493
498
|
const EDGE_SCROLL_PIXELS_PER_MILLI = 0.8;
|
|
494
499
|
const LONGEST_FRAME_MILLIS = 50;
|
|
495
|
-
/** A column as the pointer reads it from the page: its edges
|
|
496
|
-
|
|
497
|
-
const columnBoxOf = (element, heldId) => {
|
|
500
|
+
/** A column as the pointer reads it from the page: its edges. */
|
|
501
|
+
const columnBoxOf = (element) => {
|
|
498
502
|
const rect = element.getBoundingClientRect();
|
|
499
503
|
return __foldkitBrandViewResult(({
|
|
500
504
|
id: element.getAttribute("data-reel-column") ?? "",
|
|
501
505
|
left: rect.left,
|
|
502
506
|
right: rect.right,
|
|
503
|
-
slotMiddles: Array.map(Array.filter(Array.fromIterable(element.querySelectorAll("[data-reel-slot]")), (slot) => __foldkitBrandViewResult((slot.getAttribute("data-reel-slot") !== heldId), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~60")), (slot) => {
|
|
504
|
-
const slotRect = slot.getBoundingClientRect();
|
|
505
|
-
return __foldkitBrandViewResult((slotRect.top + slotRect.height / 2), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~61");
|
|
506
|
-
}),
|
|
507
507
|
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#columnBoxOf");
|
|
508
508
|
};
|
|
509
|
+
/** The middles of a column's slots but the held pane's. */
|
|
510
|
+
const slotMiddlesOf = (element, heldId) => __foldkitBrandViewResult((Array.map(Array.filter(Array.fromIterable(element.querySelectorAll("[data-reel-slot]")), (slot) => __foldkitBrandViewResult((slot.getAttribute("data-reel-slot") !== heldId), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~60")), (slot) => {
|
|
511
|
+
const slotRect = slot.getBoundingClientRect();
|
|
512
|
+
return __foldkitBrandViewResult((slotRect.top + slotRect.height / 2), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~61");
|
|
513
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#slotMiddlesOf");
|
|
509
514
|
/** Where a pointer at (`clientX`, `clientY`) would drop the pane `paneId` in the reel
|
|
510
|
-
* `reelHook` names, read from where its columns and
|
|
515
|
+
* `reelHook` names, read from where its columns sit and the slots of the one it is over: none
|
|
516
|
+
* outside the reel. */
|
|
511
517
|
const pointerTarget = (reelHook, paneId, clientX, clientY) => __foldkitBrandViewResult((Option.map(Option.filter(scrollerOf(reelHook), (view) => {
|
|
512
518
|
const rect = view.getBoundingClientRect();
|
|
513
519
|
return (__foldkitBrandViewResult((clientX >= rect.left &&
|
|
514
520
|
clientX <= rect.right &&
|
|
515
521
|
clientY >= rect.top &&
|
|
516
522
|
clientY <= rect.bottom), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~62"));
|
|
517
|
-
}), (view) =>
|
|
523
|
+
}), (view) => {
|
|
524
|
+
const columns = Array.fromIterable(view.querySelectorAll("[data-reel-column]"));
|
|
525
|
+
return __foldkitBrandViewResult((targetAtPoint(Array.map(columns, columnBoxOf), clientX, clientY, (index) => __foldkitBrandViewResult((Option.match(Array.get(columns, index), {
|
|
526
|
+
onNone: () => __foldkitBrandViewResult(([]), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~16"),
|
|
527
|
+
onSome: (column) => __foldkitBrandViewResult((slotMiddlesOf(column, paneId)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~15"),
|
|
528
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~64"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~63");
|
|
529
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#pointerTarget");
|
|
518
530
|
const PointerHold = Schema.Struct({
|
|
519
531
|
reelHook: Schema.String,
|
|
520
532
|
paneId: Schema.String,
|
|
@@ -525,12 +537,51 @@ const pointerAt = (hold, event) => (__foldkitBrandViewResult(({
|
|
|
525
537
|
clientY: event.clientY,
|
|
526
538
|
maybeTarget: pointerTarget(hold.reelHook, hold.paneId, event.clientX, event.clientY),
|
|
527
539
|
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#pointerAt"));
|
|
528
|
-
/** The pressing pointer's moves, release and cancel; another pointer's are not the reel's.
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
540
|
+
/** The pressing pointer's moves, release and cancel; another pointer's are not the reel's. A
|
|
541
|
+
* pointer reports moves faster than the page draws, and each reads the reel's layout, so its
|
|
542
|
+
* moves are read once a frame, at the latest; a release first reads the move not read yet,
|
|
543
|
+
* so the pane is carried as far as the pointer went, and a cancel drops it. */
|
|
544
|
+
const pointerMessages = (hold) => __foldkitBrandViewResult((Stream.callback((queue) => __foldkitBrandViewResult((Effect.acquireRelease(Effect.sync(() => {
|
|
545
|
+
const state = { maybeMove: Option.none(), frame: 0 };
|
|
546
|
+
const offer = (message) => {
|
|
547
|
+
Queue.offerUnsafe(queue, message);
|
|
548
|
+
};
|
|
549
|
+
const readMove = () => {
|
|
550
|
+
cancelAnimationFrame(state.frame);
|
|
551
|
+
Option.map(state.maybeMove, (event) => __foldkitBrandViewResult((offer(Message.MovedPointer(pointerAt(hold, event)))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~67"));
|
|
552
|
+
state.maybeMove = Option.none();
|
|
553
|
+
};
|
|
554
|
+
const onMove = (event) => {
|
|
555
|
+
if (event.pointerId === hold.pointerId) {
|
|
556
|
+
if (Option.isNone(state.maybeMove)) {
|
|
557
|
+
state.frame = requestAnimationFrame(readMove);
|
|
558
|
+
}
|
|
559
|
+
state.maybeMove = Option.some(event);
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
const onUp = (event) => {
|
|
563
|
+
if (event.pointerId === hold.pointerId) {
|
|
564
|
+
readMove();
|
|
565
|
+
offer(Message.ReleasedPointer(pointerAt(hold, event)));
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
const onCancel = (event) => {
|
|
569
|
+
if (event.pointerId === hold.pointerId) {
|
|
570
|
+
cancelAnimationFrame(state.frame);
|
|
571
|
+
state.maybeMove = Option.none();
|
|
572
|
+
offer(Message.CancelledPointer());
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
document.addEventListener("pointermove", onMove);
|
|
576
|
+
document.addEventListener("pointerup", onUp);
|
|
577
|
+
document.addEventListener("pointercancel", onCancel);
|
|
578
|
+
return __foldkitBrandViewResult(({ state, onMove, onUp, onCancel }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~66");
|
|
579
|
+
}), ({ state, onMove, onUp, onCancel }) => __foldkitBrandViewResult((Effect.sync(() => {
|
|
580
|
+
cancelAnimationFrame(state.frame);
|
|
581
|
+
document.removeEventListener("pointermove", onMove);
|
|
582
|
+
document.removeEventListener("pointerup", onUp);
|
|
583
|
+
document.removeEventListener("pointercancel", onCancel);
|
|
584
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~68"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~65"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#pointerMessages");
|
|
534
585
|
/** Which way a pointer at `at` scrolls a box from `low` to `high`: towards the edge it is near. */
|
|
535
586
|
const towards = (at, low, high) => {
|
|
536
587
|
if (at < low + EDGE_SCROLL) {
|
|
@@ -568,11 +619,11 @@ const edgeScroll = (hold) => __foldkitBrandViewResult((Stream.callback(() => __f
|
|
|
568
619
|
};
|
|
569
620
|
document.addEventListener("pointermove", onMove);
|
|
570
621
|
state.frame = requestAnimationFrame(step);
|
|
571
|
-
return __foldkitBrandViewResult(({ state, onMove }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
622
|
+
return __foldkitBrandViewResult(({ state, onMove }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~71");
|
|
572
623
|
}), ({ state, onMove }) => __foldkitBrandViewResult((Effect.sync(() => {
|
|
573
624
|
cancelAnimationFrame(state.frame);
|
|
574
625
|
document.removeEventListener("pointermove", onMove);
|
|
575
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
626
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~73")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~75")))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~70"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#edgeScroll");
|
|
576
627
|
const SplitterHold = Schema.Struct({
|
|
577
628
|
reelHook: Schema.String,
|
|
578
629
|
splitter: Splitter,
|
|
@@ -586,12 +637,12 @@ const heightOf = (element) => __foldkitBrandViewResult((element.getBoundingClien
|
|
|
586
637
|
* column's panes' height for a pane splitter. */
|
|
587
638
|
const scaleOf = (hold) => __foldkitBrandViewResult((Option.getOrElse(Option.map(scrollerOf(hold.reelHook), (view) => __foldkitBrandViewResult((Splitter.match(hold.splitter, {
|
|
588
639
|
Width: () => __foldkitBrandViewResult((view.clientWidth -
|
|
589
|
-
Option.getOrElse(Option.map(Option.fromNullishOr(view.querySelector(".reel-gap")), (gap) => __foldkitBrandViewResult((gap.getBoundingClientRect().width), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
640
|
+
Option.getOrElse(Option.map(Option.fromNullishOr(view.querySelector(".reel-gap")), (gap) => __foldkitBrandViewResult((gap.getBoundingClientRect().width), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~77")), () => __foldkitBrandViewResult((0), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~78"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#Width"),
|
|
590
641
|
Split: ({ abovePaneId }) => __foldkitBrandViewResult((Number.sumAll(Array.map(Array.fromIterable(view
|
|
591
642
|
.querySelector(`[data-reel-slot="${CSS.escape(abovePaneId)}"]`)
|
|
592
643
|
?.closest(".reel-column")
|
|
593
644
|
?.querySelectorAll("[data-reel-slot]") ?? []), heightOf))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#Split"),
|
|
594
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
645
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~76")), () => __foldkitBrandViewResult((0), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~79"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#scaleOf");
|
|
595
646
|
/** The dragging pointer's moves, release and cancel, as shares of the splitter's scale. */
|
|
596
647
|
const splitterMessages = (hold) => __foldkitBrandViewResult((Stream.suspend(() => {
|
|
597
648
|
const scale = scaleOf(hold);
|
|
@@ -600,28 +651,28 @@ const splitterMessages = (hold) => __foldkitBrandViewResult((Stream.suspend(() =
|
|
|
600
651
|
return __foldkitBrandViewResult((scale > 0 ? moved / scale : 0), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#shareOf");
|
|
601
652
|
};
|
|
602
653
|
return __foldkitBrandViewResult((dragMessages(hold.pointerId, {
|
|
603
|
-
moved: (event) => __foldkitBrandViewResult((Message.MovedSplitter({ share: shareOf(event) })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#moved
|
|
604
|
-
released: (event) => __foldkitBrandViewResult((Message.ReleasedSplitter({ share: shareOf(event) })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#released
|
|
605
|
-
cancelled: () => __foldkitBrandViewResult((Message.CancelledSplitter()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#cancelled
|
|
606
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
654
|
+
moved: (event) => __foldkitBrandViewResult((Message.MovedSplitter({ share: shareOf(event) })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#moved"),
|
|
655
|
+
released: (event) => __foldkitBrandViewResult((Message.ReleasedSplitter({ share: shareOf(event) })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#released"),
|
|
656
|
+
cancelled: () => __foldkitBrandViewResult((Message.CancelledSplitter()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#cancelled"),
|
|
657
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~80");
|
|
607
658
|
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#splitterMessages");
|
|
608
659
|
const pointerHoldOf = (model, isCarryingOnly) => __foldkitBrandViewResult((Option.flatMap(model.maybeHeld, ({ paneId, by }) => __foldkitBrandViewResult((By.match(by, {
|
|
609
660
|
Keyboard: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#Keyboard~3"),
|
|
610
661
|
Pointer: ({ pointerId, isCarrying }) => __foldkitBrandViewResult((isCarryingOnly && !isCarrying
|
|
611
662
|
? Option.none()
|
|
612
663
|
: Option.some({ reelHook: model.id, paneId, pointerId })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#Pointer~3"),
|
|
613
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
664
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~81"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#pointerHoldOf");
|
|
614
665
|
const reelSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResult(({
|
|
615
666
|
pointer: entry({ maybeHold: Schema.Option(PointerHold) }, {
|
|
616
667
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({ maybeHold: pointerHoldOf(model, false) }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#modelToDependencies")),
|
|
617
668
|
dependenciesToStream: ({ maybeHold }) => __foldkitBrandViewResult((Option.match(maybeHold, {
|
|
618
|
-
onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~
|
|
619
|
-
onSome: (hold) => __foldkitBrandViewResult((Stream.merge(pointerMessages(hold), markDragging)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~
|
|
669
|
+
onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~17"),
|
|
670
|
+
onSome: (hold) => __foldkitBrandViewResult((Stream.merge(pointerMessages(hold), markDragging)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~16"),
|
|
620
671
|
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#dependenciesToStream"),
|
|
621
672
|
}),
|
|
622
673
|
edge: entry({ maybeHold: Schema.Option(PointerHold) }, {
|
|
623
674
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({ maybeHold: pointerHoldOf(model, true) }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#modelToDependencies~2")),
|
|
624
|
-
dependenciesToStream: ({ maybeHold }) => __foldkitBrandViewResult((Option.match(maybeHold, { onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~
|
|
675
|
+
dependenciesToStream: ({ maybeHold }) => __foldkitBrandViewResult((Option.match(maybeHold, { onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~18"), onSome: edgeScroll })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#dependenciesToStream~2"),
|
|
625
676
|
}),
|
|
626
677
|
resize: entry({ maybeHold: Schema.Option(SplitterHold) }, {
|
|
627
678
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({
|
|
@@ -631,20 +682,20 @@ const reelSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResu
|
|
|
631
682
|
pointerId,
|
|
632
683
|
pressX,
|
|
633
684
|
pressY,
|
|
634
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
685
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~83"))),
|
|
635
686
|
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#modelToDependencies~3")),
|
|
636
687
|
dependenciesToStream: ({ maybeHold }) => __foldkitBrandViewResult((Option.match(maybeHold, {
|
|
637
|
-
onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~
|
|
638
|
-
onSome: (hold) => __foldkitBrandViewResult((Stream.merge(splitterMessages(hold), markDragging)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~
|
|
688
|
+
onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~19"),
|
|
689
|
+
onSome: (hold) => __foldkitBrandViewResult((Stream.merge(splitterMessages(hold), markDragging)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~17"),
|
|
639
690
|
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#dependenciesToStream~3"),
|
|
640
691
|
}),
|
|
641
692
|
escape: entry({ isHolding: Schema.Boolean }, {
|
|
642
693
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({
|
|
643
|
-
isHolding:
|
|
694
|
+
isHolding: !isIdle(model),
|
|
644
695
|
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#modelToDependencies~4")),
|
|
645
696
|
dependenciesToStream: ({ isHolding: isHoldingNow }) => __foldkitBrandViewResult((isHoldingNow ? escapeKeys(Message.PressedEscape()) : Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#dependenciesToStream~4"),
|
|
646
697
|
}),
|
|
647
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
698
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~82")));
|
|
648
699
|
/** A held pane follows the pointer (the reel scrolling near its edges), a dragged
|
|
649
700
|
* splitter resizes, and Escape puts either back, before a dialog or the page sees it, from
|
|
650
701
|
* listeners that run only while something is held. Lift them into the application's
|
|
@@ -659,7 +710,7 @@ export const SizeLiftedPane = Mount.define("SizeLiftedPane", {
|
|
|
659
710
|
messages: [Message.CompletedSizeLiftedPane],
|
|
660
711
|
execute: ({ element, sourceSelector, pressX, pressY }) => __foldkitBrandViewResult((Effect.sync(() => {
|
|
661
712
|
measureLift(element, sourceSelector, pressX, pressY);
|
|
662
|
-
return __foldkitBrandViewResult((Message.CompletedSizeLiftedPane()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
713
|
+
return __foldkitBrandViewResult((Message.CompletedSizeLiftedPane()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~84");
|
|
663
714
|
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#execute~5"),
|
|
664
715
|
});
|
|
665
716
|
const helpId = (model) => __foldkitBrandViewResult((`${model.id}-grip-help`), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#helpId");
|
|
@@ -676,31 +727,30 @@ const isDropKey = (key) => __foldkitBrandViewResult((key === " " || key === "Ent
|
|
|
676
727
|
* the pane's place in the id order, which the slot and the pane read from one list. */
|
|
677
728
|
const anchorName = (index) => __foldkitBrandViewResult((`--reel-${index}`), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anchorName");
|
|
678
729
|
/** The panes in their layer's order: by id, which no move changes. */
|
|
679
|
-
const byId = Order.mapInput(Order.String, (pane) => __foldkitBrandViewResult((pane.id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
730
|
+
const byId = Order.mapInput(Order.String, (pane) => __foldkitBrandViewResult((pane.id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~85"));
|
|
680
731
|
/** Where a carried drop would land, marked: none where it would change nothing. */
|
|
681
|
-
const markOf = (model, layout) => __foldkitBrandViewResult((Option.flatMap(Option.filter(model.maybeHeld, isCarried), (held) => __foldkitBrandViewResult((Option.filter(held.maybeTarget, (target) => __foldkitBrandViewResult((Option.isSome(requestOf(layout, held.paneId, target))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
682
|
-
const carriedIdOf = (model) => __foldkitBrandViewResult((Option.map(Option.filter(model.maybeHeld, isCarried), ({ paneId }) => __foldkitBrandViewResult((paneId), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
732
|
+
const markOf = (model, layout) => __foldkitBrandViewResult((Option.flatMap(Option.filter(model.maybeHeld, isCarried), (held) => __foldkitBrandViewResult((Option.filter(held.maybeTarget, (target) => __foldkitBrandViewResult((Option.isSome(requestOf(layout, held.paneId, target))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~87"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~86"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#markOf");
|
|
733
|
+
const carriedIdOf = (model) => __foldkitBrandViewResult((Option.map(Option.filter(model.maybeHeld, isCarried), ({ paneId }) => __foldkitBrandViewResult((paneId), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~88"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#carriedIdOf");
|
|
683
734
|
const gripView = (model, pane, h) => {
|
|
684
|
-
const
|
|
685
|
-
const maybeHeldHere = Option.filter(model.maybeHeld, (held) => __foldkitBrandViewResult((held.paneId === pane.id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~84"));
|
|
735
|
+
const maybeHeldHere = Option.filter(model.maybeHeld, (held) => __foldkitBrandViewResult((held.paneId === pane.id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~89"));
|
|
686
736
|
const isHeld = Option.exists(maybeHeldHere, isCarried);
|
|
687
|
-
const isKeyboardHeld = Option.exists(maybeHeldHere, (held) => __foldkitBrandViewResult((held.by._tag === "Keyboard"), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
737
|
+
const isKeyboardHeld = Option.exists(maybeHeldHere, (held) => __foldkitBrandViewResult((held.by._tag === "Keyboard"), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~90"));
|
|
688
738
|
// the keyboard holds an item on its grip: the keys are the grip's own, and focus leaving the
|
|
689
739
|
// grip puts the item back, so a field reached by Tab types as it should
|
|
690
740
|
const onGripKey = h.OnKeyDownPreventDefault((key, modifiers) => {
|
|
691
741
|
if (!isPlain(modifiers)) {
|
|
692
|
-
return __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
742
|
+
return __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~91");
|
|
693
743
|
}
|
|
694
744
|
else if (isKeyboardHeld) {
|
|
695
745
|
return __foldkitBrandViewResult((isDropKey(key)
|
|
696
746
|
? Option.some(Message.DroppedHeld())
|
|
697
|
-
: Option.map(Option.fromNullishOr(HELD_STEPS[key]), (step) => __foldkitBrandViewResult((Message.SteppedHeld({ step })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
747
|
+
: Option.map(Option.fromNullishOr(HELD_STEPS[key]), (step) => __foldkitBrandViewResult((Message.SteppedHeld({ step })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~92"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~91");
|
|
698
748
|
}
|
|
699
749
|
else {
|
|
700
|
-
return __foldkitBrandViewResult((Option.liftPredicate(Message.PressedGripKey({ paneId: pane.id }), () => __foldkitBrandViewResult((
|
|
750
|
+
return __foldkitBrandViewResult((Option.liftPredicate(Message.PressedGripKey({ paneId: pane.id }), () => __foldkitBrandViewResult((isIdle(model) && isDropKey(key)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~93"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~91");
|
|
701
751
|
}
|
|
702
752
|
});
|
|
703
|
-
const onGripPress = h.OnPointerDown((_pointerType, button, _screenX, _screenY, _time, clientX, clientY, pointerId) => __foldkitBrandViewResult((Option.liftPredicate(Message.PressedGrip({ paneId: pane.id, pointerId, clientX, clientY }), () => __foldkitBrandViewResult((
|
|
753
|
+
const onGripPress = h.OnPointerDown((_pointerType, button, _screenX, _screenY, _time, clientX, clientY, pointerId) => __foldkitBrandViewResult((Option.liftPredicate(Message.PressedGrip({ paneId: pane.id, pointerId, clientX, clientY }), () => __foldkitBrandViewResult((isIdle(model) && button === LEFT_BUTTON), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~95"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~94"));
|
|
704
754
|
return __foldkitBrandViewResult((IconButton.view({
|
|
705
755
|
glyph: "grip",
|
|
706
756
|
label: fill(COPY.paneGrip, { pane: pane.label }),
|
|
@@ -719,20 +769,25 @@ const gripView = (model, pane, h) => {
|
|
|
719
769
|
/** A splitter's handlers: a pointer drags it, and its arrows step it by `SPLITTER_STEP`. */
|
|
720
770
|
const reelSplitterAttributes = (model, splitter, h) => __foldkitBrandViewResult((splitterAttributes({
|
|
721
771
|
orientation: splitter._tag === "Width" ? "vertical" : "horizontal",
|
|
722
|
-
isIdle:
|
|
772
|
+
isIdle: isIdle(model),
|
|
723
773
|
onPress: (pointerId, clientX, clientY) => __foldkitBrandViewResult((Message.PressedSplitter({ splitter, pointerId, clientX, clientY })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onPress"),
|
|
724
774
|
onStep: (direction) => __foldkitBrandViewResult((Message.PressedSplitterKey({ splitter, share: direction * SPLITTER_STEP })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onStep"),
|
|
725
775
|
}, h)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#reelSplitterAttributes");
|
|
726
|
-
|
|
776
|
+
/** The pane a drop into `column` is marked on, and the class that marks it: the pane it would
|
|
777
|
+
* land before, or the last one when it would land at the end, the carried pane left out. */
|
|
778
|
+
const dropMarkOf = (info, column) => __foldkitBrandViewResult((Option.flatMap(info.maybeMark, (mark) => {
|
|
727
779
|
if (mark._tag !== "Into" || mark.columnId !== column.id) {
|
|
728
|
-
return __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
780
|
+
return __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~96");
|
|
729
781
|
}
|
|
730
|
-
const others = Array.filter(column.panes, (pane) => __foldkitBrandViewResult((!Option.contains(info.maybeCarriedId, pane.id)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
731
|
-
return __foldkitBrandViewResult((Option.orElse(Option.map(
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
782
|
+
const others = Array.filter(column.panes, (pane) => __foldkitBrandViewResult((!Option.contains(info.maybeCarriedId, pane.id)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~97"));
|
|
783
|
+
return __foldkitBrandViewResult((Option.orElse(Option.map(Array.get(others, mark.index), ({ id }) => (__foldkitBrandViewResult(({
|
|
784
|
+
paneId: id,
|
|
785
|
+
markClass: " drop-before",
|
|
786
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~98"))), () => __foldkitBrandViewResult((Option.map(Option.filter(Array.last(others), () => __foldkitBrandViewResult((mark.index >= others.length), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~100")), ({ id }) => (__foldkitBrandViewResult(({ paneId: id, markClass: " drop-after" }), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~101")))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~99"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~96");
|
|
787
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#dropMarkOf");
|
|
788
|
+
const isGapMarked = (info, maybeBeforeColumnId) => __foldkitBrandViewResult((Option.exists(info.maybeMark, (mark) => __foldkitBrandViewResult((mark._tag === "Gap" && Equal.equals(mark.maybeBeforeColumnId, maybeBeforeColumnId)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~102"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#isGapMarked");
|
|
789
|
+
const slotView = (anchors, maybeDropMark, pane, h) => __foldkitBrandViewResult((h.keyed("div")(pane.id, [
|
|
790
|
+
h.Class(`reel-slot${Option.match(Option.filter(maybeDropMark, ({ paneId }) => __foldkitBrandViewResult((paneId === pane.id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~103")), { onNone: () => __foldkitBrandViewResult((""), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~20"), onSome: ({ markClass }) => __foldkitBrandViewResult((markClass), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~18") })}`),
|
|
736
791
|
h.DataAttribute("reel-slot", pane.id),
|
|
737
792
|
h.Style({ "--reel-weight": `${pane.weight}`, "--reel-anchor": anchors.get(pane.id) ?? "none" }),
|
|
738
793
|
])), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#slotView");
|
|
@@ -749,12 +804,13 @@ const splitView = (model, above, share, h) => __foldkitBrandViewResult((h.keyed(
|
|
|
749
804
|
])), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#splitView");
|
|
750
805
|
const columnView = (info, anchors, column, index, h) => {
|
|
751
806
|
const { model, layout } = info;
|
|
752
|
-
const total = Number.sumAll(Array.map(column.panes, (pane) => __foldkitBrandViewResult((pane.weight), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
807
|
+
const total = Number.sumAll(Array.map(column.panes, (pane) => __foldkitBrandViewResult((pane.weight), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~104")));
|
|
808
|
+
const maybeDropMark = dropMarkOf(info, column);
|
|
753
809
|
const stack = Array.flatMap(column.panes, (pane, row) => __foldkitBrandViewResult(([
|
|
754
|
-
...Array.fromOption(Option.map(Array.get(column.panes, row - 1), (above) => __foldkitBrandViewResult((splitView(model, above, total > 0 ? above.weight / total : 0, h)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
755
|
-
slotView(
|
|
756
|
-
]), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
757
|
-
const maybeNextId = Option.map(Array.get(layout, index + 1), ({ id }) => __foldkitBrandViewResult((id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
810
|
+
...Array.fromOption(Option.map(Array.get(column.panes, row - 1), (above) => __foldkitBrandViewResult((splitView(model, above, total > 0 ? above.weight / total : 0, h)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~106"))),
|
|
811
|
+
slotView(anchors, maybeDropMark, pane, h),
|
|
812
|
+
]), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~105"));
|
|
813
|
+
const maybeNextId = Option.map(Array.get(layout, index + 1), ({ id }) => __foldkitBrandViewResult((id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~107"));
|
|
758
814
|
return __foldkitBrandViewResult(([
|
|
759
815
|
h.keyed("div")(`column:${column.id}`, [
|
|
760
816
|
h.Class("reel-column"),
|
|
@@ -795,7 +851,7 @@ const paneLayerView = (info, panes, anchors, h) => {
|
|
|
795
851
|
grip: gripView(model, pane, h),
|
|
796
852
|
id: `${model.id}-${pane.id}`,
|
|
797
853
|
}),
|
|
798
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
854
|
+
])), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~108");
|
|
799
855
|
}))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#paneLayerView");
|
|
800
856
|
};
|
|
801
857
|
/** The copy a pointer carries: the held pane's title bar, drawn by the reel from its label,
|
|
@@ -818,14 +874,14 @@ const liftedCopyView = (info, h) => {
|
|
|
818
874
|
h.div([h.Class("panel window")], [
|
|
819
875
|
h.div([h.Class("panel-tb")], [
|
|
820
876
|
h.span([h.Class("panel-lead")], [h.span([h.Class("iconbtn quiet")], [Glyph.view({ name: "grip" }, h)])]),
|
|
821
|
-
h.h2([], [
|
|
877
|
+
h.h2([], [heldLabel(layout, held)]),
|
|
822
878
|
]),
|
|
823
879
|
]),
|
|
824
|
-
]), () => __foldkitBrandViewResult((isCarrying), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
825
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
880
|
+
]), () => __foldkitBrandViewResult((isCarrying), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~110"))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#Pointer~4"),
|
|
881
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~109")))), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#liftedCopyView");
|
|
826
882
|
};
|
|
827
883
|
/** The layout as it prints, with a dragged splitter's resize shown before it is asked for. */
|
|
828
|
-
const previewed = (model, layout) => __foldkitBrandViewResult((Option.match(Option.flatMap(model.maybeResizing, ({ maybeResize }) => __foldkitBrandViewResult((maybeResize), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
884
|
+
const previewed = (model, layout) => __foldkitBrandViewResult((Option.match(Option.flatMap(model.maybeResizing, ({ maybeResize }) => __foldkitBrandViewResult((maybeResize), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~111")), { onNone: () => __foldkitBrandViewResult((layout), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onNone~21"), onSome: (resize) => __foldkitBrandViewResult((apply(layout, resize)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#onSome~19") })), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#previewed");
|
|
829
885
|
/**
|
|
830
886
|
* A row of columns wider than the view when it must be, each a stack of panes, scrolled
|
|
831
887
|
* sideways, and down where a column is taller than the view: `div.reel` holding the scroller
|
|
@@ -843,8 +899,8 @@ const previewed = (model, layout) => __foldkitBrandViewResult((Option.match(Opti
|
|
|
843
899
|
export const view = defineView((model, viewInputs, h) => {
|
|
844
900
|
const { label, toPaneView } = viewInputs;
|
|
845
901
|
const layout = previewed(model, viewInputs.layout);
|
|
846
|
-
const panes = Array.sort(Array.flatMap(layout, (column) => __foldkitBrandViewResult((column.panes), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
847
|
-
const anchors = new Map(Array.map(panes, (pane, index) => __foldkitBrandViewResult(([pane.id, anchorName(index)]), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
902
|
+
const panes = Array.sort(Array.flatMap(layout, (column) => __foldkitBrandViewResult((column.panes), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~113")), byId);
|
|
903
|
+
const anchors = new Map(Array.map(panes, (pane, index) => __foldkitBrandViewResult(([pane.id, anchorName(index)]), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~114")));
|
|
848
904
|
const info = {
|
|
849
905
|
model,
|
|
850
906
|
layout,
|
|
@@ -857,15 +913,15 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
857
913
|
h.div([h.Class("reel-view")], [
|
|
858
914
|
h.div([h.Class("reel-track")], [
|
|
859
915
|
h.keyed("div")("gap:start", [
|
|
860
|
-
h.Class(`reel-gap${isGapMarked(info, Option.map(Array.head(layout), ({ id }) => __foldkitBrandViewResult((id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
916
|
+
h.Class(`reel-gap${isGapMarked(info, Option.map(Array.head(layout), ({ id }) => __foldkitBrandViewResult((id), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~115")))
|
|
861
917
|
? " drop-here"
|
|
862
918
|
: ""}`),
|
|
863
919
|
]),
|
|
864
|
-
...Array.flatMap(layout, (column, index) => __foldkitBrandViewResult((columnView(info, anchors, column, index, h)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
920
|
+
...Array.flatMap(layout, (column, index) => __foldkitBrandViewResult((columnView(info, anchors, column, index, h)), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~116")),
|
|
865
921
|
paneLayerView(info, panes, anchors, h),
|
|
866
922
|
]),
|
|
867
923
|
]),
|
|
868
924
|
h.p([h.Id(helpId(model)), h.Class("sr-only")], [COPY.gripHelp]),
|
|
869
925
|
...liftedCopyView(info, h),
|
|
870
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~
|
|
926
|
+
])), "@gjermundgaraba-designs/pixel-paper/src/reel/reel.js#anonymous~112");
|
|
871
927
|
});
|
|
@@ -10,5 +10,5 @@ export type Palette = typeof Palette.Type;
|
|
|
10
10
|
/** The `data-scheme` value a scheme pins, or none for `System`. */
|
|
11
11
|
export declare const toPinnedValue: (scheme: Scheme) => Option.Option<string>;
|
|
12
12
|
/** The scheme a `data-scheme` value pins. Anything else, or nothing, is `System`. */
|
|
13
|
-
export declare const fromPinnedValue: (value: string | null
|
|
13
|
+
export declare const fromPinnedValue: (value: string | null) => Scheme;
|
|
14
14
|
//# sourceMappingURL=scheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../../src/scheme/scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C;0FAC0F;AAC1F,eAAO,MAAM,MAAM,uDAA+C,CAAC;AACnE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAC;AAExC;uCACuC;AACvC,eAAO,MAAM,OAAO,6CAAqC,CAAC;AAC1D,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C,mEAAmE;AACnE,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAOhE,CAAC;AAEJ,qFAAqF;AACrF,eAAO,MAAM,eAAe,UAAW,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../../src/scheme/scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C;0FAC0F;AAC1F,eAAO,MAAM,MAAM,uDAA+C,CAAC;AACnE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAC;AAExC;uCACuC;AACvC,eAAO,MAAM,OAAO,6CAAqC,CAAC;AAC1D,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C,mEAAmE;AACnE,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAOhE,CAAC;AAEJ,qFAAqF;AACrF,eAAO,MAAM,eAAe,UAAW,MAAM,GAAG,IAAI,KAAG,MAMpD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
-
import type { Attributes } from "../attributes/attributes.ts";
|
|
3
2
|
import type { GlyphName } from "../glyph/glyphs.ts";
|
|
4
3
|
/** One segment: its value, its words, and optionally a glyph printed instead of the words. */
|
|
5
4
|
export type Segment<Value extends string> = Readonly<{
|
|
@@ -15,8 +14,6 @@ export type ViewConfig<Value extends string, Message> = Readonly<{
|
|
|
15
14
|
options: ReadonlyArray<Segment<Value>>;
|
|
16
15
|
value: Value;
|
|
17
16
|
onSelect: (value: Value) => Message;
|
|
18
|
-
/** Further attributes for the group, never a class. */
|
|
19
|
-
attributes?: Attributes<Message>;
|
|
20
17
|
}>;
|
|
21
18
|
/** A choice of one: the pressed segment inverts and is `aria-pressed="true"`, the others
|
|
22
19
|
* `"false"`, in a `role="group"` named by the label. Words print as the nav strip; glyphs print as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented.d.ts","sourceRoot":"","sources":["../../../src/segmented/segmented.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"segmented.d.ts","sourceRoot":"","sources":["../../../src/segmented/segmented.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAItD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,8FAA8F;AAC9F,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,MAAM,IAAI,QAAQ,CAAC;IACnD,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC;AAEH,kEAAkE;AAClE,MAAM,MAAM,UAAU,CAAC,KAAK,SAAS,MAAM,EAAE,OAAO,IAAI,QAAQ,CAAC;IAC/D,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CACrC,CAAC,CAAC;AA0BH;;4DAE4D;AAC5D,eAAO,MAAM,IAAI,GAAI,KAAK,SAAS,MAAM,EAAE,OAAO,UACxC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,KAC/B,WAAW,CAAC,OAAO,CAAC,KACtB,IAOF,CAAC"}
|
|
@@ -18,10 +18,5 @@ const segmentView = (config, option, h) => __foldkitBrandViewResult((UiButton.vi
|
|
|
18
18
|
* a compact switch of 26px cells (a layout, a density). */
|
|
19
19
|
export const view = (config, h) => {
|
|
20
20
|
const isGlyphs = Array.every(config.options, (option) => __foldkitBrandViewResult((option.glyph !== undefined), "@gjermundgaraba-designs/pixel-paper/src/segmented/segmented.js#anonymous"));
|
|
21
|
-
return __foldkitBrandViewResult((h.div([
|
|
22
|
-
...(config.attributes ?? []),
|
|
23
|
-
h.Role("group"),
|
|
24
|
-
h.AriaLabel(config.label),
|
|
25
|
-
h.Class(isGlyphs ? "switch" : "nav"),
|
|
26
|
-
], Array.map(config.options, (option) => __foldkitBrandViewResult((segmentView(config, option, h)), "@gjermundgaraba-designs/pixel-paper/src/segmented/segmented.js#anonymous~2")))), "@gjermundgaraba-designs/pixel-paper/src/segmented/segmented.js#view");
|
|
21
|
+
return __foldkitBrandViewResult((h.div([h.Role("group"), h.AriaLabel(config.label), h.Class(isGlyphs ? "switch" : "nav")], Array.map(config.options, (option) => __foldkitBrandViewResult((segmentView(config, option, h)), "@gjermundgaraba-designs/pixel-paper/src/segmented/segmented.js#anonymous~2")))), "@gjermundgaraba-designs/pixel-paper/src/segmented/segmented.js#view");
|
|
27
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectField.d.ts","sourceRoot":"","sources":["../../../src/selectField/selectField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAMtD,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,CAAC;AAEH,mDAAmD;AACnD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACtC,CAAC,CAAC;AAEH,8DAA8D;AAC9D,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,sEAAsE;IACtE,OAAO,EAAE,aAAa,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC;IACnD,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;uCAEmC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,yFAAyF;IACzF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,CAAC;AAoBH;;;8DAG8D;AAC9D,eAAO,MAAM,IAAI,GAAI,OAAO,UAAU,UAAU,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"selectField.d.ts","sourceRoot":"","sources":["../../../src/selectField/selectField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAMtD,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,CAAC;AAEH,mDAAmD;AACnD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACtC,CAAC,CAAC;AAEH,8DAA8D;AAC9D,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,sEAAsE;IACtE,OAAO,EAAE,aAAa,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC;IACnD,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;uCAEmC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,yFAAyF;IACzF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,CAAC;AAoBH;;;8DAG8D;AAC9D,eAAO,MAAM,IAAI,GAAI,OAAO,UAAU,UAAU,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IA0BpF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import { Select as UiSelect } from "@foldkit/ui";
|
|
3
3
|
import { Array } from "effect";
|
|
4
|
-
import {
|
|
4
|
+
import { controlAttributes, errorView, helpView } from "../field/field.js";
|
|
5
5
|
const isGroup = (entry) => __foldkitBrandViewResult(("options" in entry), "@gjermundgaraba-designs/pixel-paper/src/selectField/selectField.js#isGroup");
|
|
6
6
|
const optionView = (h) => __foldkitBrandViewResult((({ value, label, isDisabled = false }) => __foldkitBrandViewResult((h.keyed("option")(value, [h.Value(value), h.Disabled(isDisabled)], [label])), "@gjermundgaraba-designs/pixel-paper/src/selectField/selectField.js#anonymous")), "@gjermundgaraba-designs/pixel-paper/src/selectField/selectField.js#optionView");
|
|
7
7
|
const entryView = (h) => __foldkitBrandViewResult(((entry) => __foldkitBrandViewResult((isGroup(entry)
|
|
@@ -21,16 +21,9 @@ export const view = (config, h) => {
|
|
|
21
21
|
hasDescription: help !== undefined,
|
|
22
22
|
toView: (groups) => __foldkitBrandViewResult((h.div([h.Class("field")], [
|
|
23
23
|
h.label(groups.label, [label]),
|
|
24
|
-
|
|
25
|
-
h.select([
|
|
26
|
-
...groups.select,
|
|
27
|
-
...describedByError(id, error, help !== undefined, h),
|
|
28
|
-
...(isRequired ? [h.AriaRequired(true)] : []),
|
|
29
|
-
], Array.map(options, entryView(h))),
|
|
24
|
+
h.select([...groups.select, ...controlAttributes(id, error, help, isRequired, h)], Array.map(options, entryView(h))),
|
|
30
25
|
...errorView(id, error, h),
|
|
31
|
-
...(help
|
|
32
|
-
? []
|
|
33
|
-
: [h.p([...groups.description, h.Class("field-help")], [help])]),
|
|
26
|
+
...helpView(help, groups.description, h),
|
|
34
27
|
])), "@gjermundgaraba-designs/pixel-paper/src/selectField/selectField.js#toView"),
|
|
35
28
|
}, h)), "@gjermundgaraba-designs/pixel-paper/src/selectField/selectField.js#view");
|
|
36
29
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AnnounceReorder, Item, Message, Model, OutMessage, SizeLiftedItem, init,
|
|
1
|
+
export { AnnounceReorder, Item, Message, Model, OutMessage, SizeLiftedItem, init, setMovable, subscriptions, update, view, } from "./sortable.ts";
|
|
2
2
|
export type { InitConfig, ItemRender, Layout, ViewInputs } from "./sortable.ts";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sortable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV,cAAc,EACd,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sortable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV,cAAc,EACd,IAAI,EACJ,UAAU,EACV,aAAa,EACb,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AnnounceReorder, Item, Message, Model, OutMessage, SizeLiftedItem, init,
|
|
1
|
+
export { AnnounceReorder, Item, Message, Model, OutMessage, SizeLiftedItem, init, setMovable, subscriptions, update, view, } from "./sortable.js";
|