@gjermundgaraba-designs/pixel-paper 0.25.0 → 0.27.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 +28 -3
- package/dist/src/adapters/diagram.d.ts +38 -0
- package/dist/src/adapters/diagram.d.ts.map +1 -0
- package/dist/src/adapters/diagram.js +206 -0
- package/dist/src/adapters/mermaid.d.ts +2 -20
- package/dist/src/adapters/mermaid.d.ts.map +1 -1
- package/dist/src/adapters/mermaid.js +9 -229
- package/dist/src/announcer/announcer.d.ts +0 -4
- package/dist/src/announcer/announcer.d.ts.map +1 -1
- package/dist/src/announcer/announcer.js +19 -18
- package/dist/src/attributes/attributes.d.ts.map +1 -1
- package/dist/src/{audioFrame/audioFrame.d.ts → audio-frame/audio-frame.d.ts} +1 -1
- package/dist/src/audio-frame/audio-frame.d.ts.map +1 -0
- package/dist/src/{audioFrame/audioFrame.js → audio-frame/audio-frame.js} +1 -1
- package/dist/src/audio-frame/index.d.ts +3 -0
- package/dist/src/audio-frame/index.d.ts.map +1 -0
- package/dist/src/audio-frame/index.js +1 -0
- package/dist/src/banner/banner.d.ts.map +1 -1
- package/dist/src/banner/index.d.ts.map +1 -1
- package/dist/src/{barChart/barChart.d.ts → bar-chart/bar-chart.d.ts} +2 -2
- package/dist/src/bar-chart/bar-chart.d.ts.map +1 -0
- package/dist/src/{barChart/barChart.js → bar-chart/bar-chart.js} +40 -35
- package/dist/src/bar-chart/index.d.ts +3 -0
- package/dist/src/bar-chart/index.d.ts.map +1 -0
- package/dist/src/bar-chart/index.js +1 -0
- package/dist/src/bench/bench.d.ts.map +1 -1
- package/dist/src/bench/index.d.ts.map +1 -1
- package/dist/src/board/board.d.ts +45 -46
- package/dist/src/board/board.d.ts.map +1 -1
- package/dist/src/board/board.js +76 -102
- package/dist/src/board/index.d.ts +1 -1
- package/dist/src/board/index.d.ts.map +1 -1
- package/dist/src/button/button.d.ts +1 -2
- package/dist/src/button/button.d.ts.map +1 -1
- package/dist/src/button/button.js +7 -5
- package/dist/src/button/index.d.ts +1 -1
- package/dist/src/button/index.d.ts.map +1 -1
- package/dist/src/card/card.d.ts.map +1 -1
- package/dist/src/card/card.js +4 -2
- package/dist/src/card/index.d.ts.map +1 -1
- package/dist/src/{chartTable/chartTable.d.ts → chart-table/chart-table.d.ts} +4 -14
- package/dist/src/chart-table/chart-table.d.ts.map +1 -0
- package/dist/src/{chartTable/chartTable.js → chart-table/chart-table.js} +9 -16
- package/dist/src/chip/chip.d.ts.map +1 -1
- package/dist/src/chip/chip.js +4 -2
- package/dist/src/chip/index.d.ts.map +1 -1
- package/dist/src/choice/choice.d.ts.map +1 -1
- package/dist/src/choice/choice.js +3 -1
- package/dist/src/choice/index.d.ts.map +1 -1
- package/dist/src/choices/choices.d.ts.map +1 -1
- package/dist/src/choices/index.d.ts.map +1 -1
- package/dist/src/{codeEditor/codeEditor.d.ts → code-editor/code-editor.d.ts} +1 -1
- package/dist/src/code-editor/code-editor.d.ts.map +1 -0
- package/dist/src/{codeEditor/codeEditor.js → code-editor/code-editor.js} +2 -2
- package/dist/src/code-editor/index.d.ts +3 -0
- package/dist/src/code-editor/index.d.ts.map +1 -0
- package/dist/src/code-editor/index.js +1 -0
- package/dist/src/{codeSurface/codeSurface.d.ts → code-surface/code-surface.d.ts} +1 -1
- package/dist/src/code-surface/code-surface.d.ts.map +1 -0
- package/dist/src/{codeSurface/codeSurface.js → code-surface/code-surface.js} +6 -1
- package/dist/src/code-surface/index.d.ts +3 -0
- package/dist/src/code-surface/index.d.ts.map +1 -0
- package/dist/src/code-surface/index.js +1 -0
- package/dist/src/{commandPalette/commandPalette.d.ts → command-palette/command-palette.d.ts} +85 -77
- package/dist/src/command-palette/command-palette.d.ts.map +1 -0
- package/dist/src/command-palette/command-palette.js +625 -0
- package/dist/src/{commandPalette → command-palette}/index.d.ts +2 -2
- package/dist/src/command-palette/index.d.ts.map +1 -0
- package/dist/src/{commandPalette → command-palette}/index.js +1 -1
- package/dist/src/{commandPalette → command-palette}/keys.d.ts +0 -21
- package/dist/src/command-palette/keys.d.ts.map +1 -0
- package/dist/src/command-palette/keys.js +85 -0
- package/dist/src/{commandPalette → command-palette}/match.d.ts +5 -11
- package/dist/src/command-palette/match.d.ts.map +1 -0
- package/dist/src/{commandPalette → command-palette}/match.js +20 -24
- package/dist/src/{commandPalette → command-palette}/message.d.ts +37 -26
- package/dist/src/command-palette/message.d.ts.map +1 -0
- package/dist/src/{commandPalette → command-palette}/message.js +8 -20
- package/dist/src/{confirmDialog/confirmDialog.d.ts → confirm-dialog/confirm-dialog.d.ts} +1 -1
- package/dist/src/confirm-dialog/confirm-dialog.d.ts.map +1 -0
- package/dist/src/{confirmDialog/confirmDialog.js → confirm-dialog/confirm-dialog.js} +18 -23
- package/dist/src/confirm-dialog/index.d.ts +3 -0
- package/dist/src/confirm-dialog/index.d.ts.map +1 -0
- package/dist/src/{confirmDialog → confirm-dialog}/index.js +1 -1
- package/dist/src/{contextMenu/contextMenu.d.ts → context-menu/context-menu.d.ts} +18 -21
- package/dist/src/context-menu/context-menu.d.ts.map +1 -0
- package/dist/src/{contextMenu/contextMenu.js → context-menu/context-menu.js} +45 -57
- package/dist/src/{contextMenu → context-menu}/index.d.ts +2 -2
- package/dist/src/context-menu/index.d.ts.map +1 -0
- package/dist/src/{contextMenu → context-menu}/index.js +1 -1
- package/dist/src/{copyButton/copyButton.d.ts → copy-button/copy-button.d.ts} +5 -7
- package/dist/src/copy-button/copy-button.d.ts.map +1 -0
- package/dist/src/{copyButton/copyButton.js → copy-button/copy-button.js} +18 -27
- package/dist/src/copy-button/index.d.ts +3 -0
- package/dist/src/copy-button/index.d.ts.map +1 -0
- package/dist/src/copy-button/index.js +1 -0
- package/dist/src/crumbs/crumbs.d.ts +1 -1
- package/dist/src/crumbs/crumbs.d.ts.map +1 -1
- package/dist/src/crumbs/index.d.ts.map +1 -1
- package/dist/src/deck/deck.d.ts.map +1 -1
- package/dist/src/deck/index.d.ts.map +1 -1
- package/dist/src/dialog/dialog.d.ts +6 -14
- package/dist/src/dialog/dialog.d.ts.map +1 -1
- package/dist/src/dialog/dialog.js +29 -36
- package/dist/src/dialog/fold.d.ts +3 -3
- package/dist/src/dialog/fold.d.ts.map +1 -1
- package/dist/src/dialog/fold.js +5 -4
- package/dist/src/dialog/index.d.ts +1 -1
- package/dist/src/dialog/index.d.ts.map +1 -1
- package/dist/src/disclosure/disclosure.d.ts.map +1 -1
- package/dist/src/disclosure/disclosure.js +3 -1
- package/dist/src/disclosure/index.d.ts.map +1 -1
- package/dist/src/dom/html-element.d.ts +3 -0
- package/dist/src/dom/html-element.d.ts.map +1 -0
- package/dist/src/dom/html-element.js +6 -0
- package/dist/src/drag/drag.d.ts +0 -34
- package/dist/src/drag/drag.d.ts.map +1 -1
- package/dist/src/drag/drag.js +27 -73
- package/dist/src/{dropZone/dropZone.d.ts → drop-zone/drop-zone.d.ts} +3 -3
- package/dist/src/drop-zone/drop-zone.d.ts.map +1 -0
- package/dist/src/{dropZone/dropZone.js → drop-zone/drop-zone.js} +13 -19
- package/dist/src/drop-zone/index.d.ts +3 -0
- package/dist/src/drop-zone/index.d.ts.map +1 -0
- package/dist/src/drop-zone/index.js +1 -0
- package/dist/src/{editableTitle/editableTitle.d.ts → editable-title/editable-title.d.ts} +14 -12
- package/dist/src/editable-title/editable-title.d.ts.map +1 -0
- package/dist/src/{editableTitle/editableTitle.js → editable-title/editable-title.js} +33 -39
- package/dist/src/editable-title/index.d.ts +4 -0
- package/dist/src/editable-title/index.d.ts.map +1 -0
- package/dist/src/{editableTitle → editable-title}/index.js +1 -1
- package/dist/src/{emptyState/emptyState.d.ts → empty-state/empty-state.d.ts} +1 -1
- package/dist/src/empty-state/empty-state.d.ts.map +1 -0
- package/dist/src/{emptyState/emptyState.js → empty-state/empty-state.js} +5 -2
- package/dist/src/empty-state/index.d.ts +3 -0
- package/dist/src/empty-state/index.d.ts.map +1 -0
- package/dist/src/empty-state/index.js +1 -0
- package/dist/src/{errorSummary/errorSummary.d.ts → error-summary/error-summary.d.ts} +2 -2
- package/dist/src/error-summary/error-summary.d.ts.map +1 -0
- package/dist/src/{errorSummary/errorSummary.js → error-summary/error-summary.js} +7 -5
- package/dist/src/error-summary/index.d.ts +3 -0
- package/dist/src/error-summary/index.d.ts.map +1 -0
- package/dist/src/error-summary/index.js +1 -0
- package/dist/src/field/field.d.ts +2 -7
- package/dist/src/field/field.d.ts.map +1 -1
- package/dist/src/field/field.js +12 -13
- package/dist/src/field/index.d.ts.map +1 -1
- package/dist/src/{fieldGrid/fieldGrid.d.ts → field-grid/field-grid.d.ts} +1 -1
- package/dist/src/field-grid/field-grid.d.ts.map +1 -0
- package/dist/src/{fieldGrid/fieldGrid.js → field-grid/field-grid.js} +1 -1
- package/dist/src/field-grid/index.d.ts +3 -0
- package/dist/src/field-grid/index.d.ts.map +1 -0
- package/dist/src/field-grid/index.js +1 -0
- package/dist/src/fields/fields.d.ts.map +1 -1
- package/dist/src/fields/fields.js +4 -1
- package/dist/src/fields/index.d.ts.map +1 -1
- package/dist/src/fieldset/fieldset.d.ts.map +1 -1
- package/dist/src/fieldset/index.d.ts.map +1 -1
- package/dist/src/{fileTree/fileTree.d.ts → file-tree/file-tree.d.ts} +5 -5
- package/dist/src/file-tree/file-tree.d.ts.map +1 -0
- package/dist/src/file-tree/file-tree.js +242 -0
- package/dist/src/file-tree/index.d.ts +3 -0
- package/dist/src/file-tree/index.d.ts.map +1 -0
- package/dist/src/{fileTree → file-tree}/index.js +1 -1
- package/dist/src/{filterChip/filterChip.d.ts → filter-chip/filter-chip.d.ts} +1 -1
- package/dist/src/filter-chip/filter-chip.d.ts.map +1 -0
- package/dist/src/{filterChip/filterChip.js → filter-chip/filter-chip.js} +11 -7
- package/dist/src/filter-chip/index.d.ts +3 -0
- package/dist/src/filter-chip/index.d.ts.map +1 -0
- package/dist/src/filter-chip/index.js +1 -0
- package/dist/src/{filterStrip/filterStrip.d.ts → filter-strip/filter-strip.d.ts} +1 -1
- package/dist/src/filter-strip/filter-strip.d.ts.map +1 -0
- package/dist/src/{filterStrip/filterStrip.js → filter-strip/filter-strip.js} +1 -1
- package/dist/src/filter-strip/index.d.ts +3 -0
- package/dist/src/filter-strip/index.d.ts.map +1 -0
- package/dist/src/filter-strip/index.js +1 -0
- package/dist/src/{flashWord/flashWord.d.ts → flash-word/flash-word.d.ts} +2 -2
- package/dist/src/flash-word/flash-word.d.ts.map +1 -0
- package/dist/src/{flashWord/flashWord.js → flash-word/flash-word.js} +2 -3
- package/dist/src/flash-word/index.d.ts +3 -0
- package/dist/src/flash-word/index.d.ts.map +1 -0
- package/dist/src/flash-word/index.js +1 -0
- package/dist/src/focus/focus.d.ts.map +1 -1
- package/dist/src/focus/focus.js +0 -2
- package/dist/src/format/format.d.ts +0 -7
- package/dist/src/format/format.d.ts.map +1 -1
- package/dist/src/format/format.js +7 -16
- package/dist/src/format/index.d.ts.map +1 -1
- package/dist/src/glyph/glyph.d.ts +1 -2
- package/dist/src/glyph/glyph.d.ts.map +1 -1
- package/dist/src/glyph/glyph.js +0 -2
- package/dist/src/glyph/glyphs.d.ts +19 -4
- package/dist/src/glyph/glyphs.d.ts.map +1 -1
- package/dist/src/glyph/glyphs.js +2577 -2594
- package/dist/src/glyph/index.d.ts.map +1 -1
- package/dist/src/group/group.d.ts.map +1 -1
- package/dist/src/group/index.d.ts.map +1 -1
- package/dist/src/history/history.d.ts +1 -1
- package/dist/src/history/history.d.ts.map +1 -1
- package/dist/src/history/history.js +6 -3
- package/dist/src/history/index.d.ts.map +1 -1
- package/dist/src/{iconButton/iconButton.d.ts → icon-button/icon-button.d.ts} +1 -1
- package/dist/src/icon-button/icon-button.d.ts.map +1 -0
- package/dist/src/{iconButton/iconButton.js → icon-button/icon-button.js} +6 -4
- package/dist/src/icon-button/index.d.ts +3 -0
- package/dist/src/icon-button/index.d.ts.map +1 -0
- package/dist/src/icon-button/index.js +1 -0
- package/dist/src/identity/identity.d.ts.map +1 -1
- package/dist/src/identity/index.d.ts.map +1 -1
- package/dist/src/{imageFrame/imageFrame.d.ts → image-frame/image-frame.d.ts} +1 -1
- package/dist/src/image-frame/image-frame.d.ts.map +1 -0
- package/dist/src/{imageFrame/imageFrame.js → image-frame/image-frame.js} +19 -12
- package/dist/src/image-frame/index.d.ts +3 -0
- package/dist/src/image-frame/index.d.ts.map +1 -0
- package/dist/src/image-frame/index.js +1 -0
- package/dist/src/index.d.ts +41 -41
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +41 -41
- package/dist/src/inline-input/index.d.ts +3 -0
- package/dist/src/inline-input/index.d.ts.map +1 -0
- package/dist/src/{inlineInput → inline-input}/index.js +1 -1
- package/dist/src/{inlineInput/inlineInput.d.ts → inline-input/inline-input.d.ts} +8 -12
- package/dist/src/inline-input/inline-input.d.ts.map +1 -0
- package/dist/src/{inlineInput/inlineInput.js → inline-input/inline-input.js} +60 -75
- package/dist/src/key-help/index.d.ts +3 -0
- package/dist/src/key-help/index.d.ts.map +1 -0
- package/dist/src/{keyHelp → key-help}/index.js +1 -1
- package/dist/src/{keyHelp/keyHelp.d.ts → key-help/key-help.d.ts} +7 -7
- package/dist/src/key-help/key-help.d.ts.map +1 -0
- package/dist/src/{keyHelp/keyHelp.js → key-help/key-help.js} +48 -47
- package/dist/src/key-hint/index.d.ts +4 -0
- package/dist/src/key-hint/index.d.ts.map +1 -0
- package/dist/src/key-hint/index.js +2 -0
- package/dist/src/{keyHint/keyHint.d.ts → key-hint/key-hint.d.ts} +2 -2
- package/dist/src/key-hint/key-hint.d.ts.map +1 -0
- package/dist/src/{keyHint/keyHint.js → key-hint/key-hint.js} +2 -2
- package/dist/src/{keyHint/keyLabel.d.ts → key-hint/key-label.d.ts} +2 -3
- package/dist/src/key-hint/key-label.d.ts.map +1 -0
- package/dist/src/{keyHint/keyLabel.js → key-hint/key-label.js} +29 -24
- package/dist/src/keymap/index.d.ts.map +1 -1
- package/dist/src/keymap/keymap.d.ts +2 -2
- package/dist/src/keymap/keymap.d.ts.map +1 -1
- package/dist/src/keymap/keymap.js +3 -1
- package/dist/src/keys/keys.d.ts +0 -2
- package/dist/src/keys/keys.d.ts.map +1 -1
- package/dist/src/keys/keys.js +0 -2
- package/dist/src/line-chart/index.d.ts +3 -0
- package/dist/src/line-chart/index.d.ts.map +1 -0
- package/dist/src/line-chart/index.js +1 -0
- package/dist/src/{lineChart/lineChart.d.ts → line-chart/line-chart.d.ts} +2 -2
- package/dist/src/line-chart/line-chart.d.ts.map +1 -0
- package/dist/src/{lineChart/lineChart.js → line-chart/line-chart.js} +52 -44
- package/dist/src/line-diff/diff.d.ts +29 -0
- package/dist/src/line-diff/diff.d.ts.map +1 -0
- package/dist/src/line-diff/diff.js +85 -0
- package/dist/src/line-diff/index.d.ts +5 -0
- package/dist/src/line-diff/index.d.ts.map +1 -0
- package/dist/src/line-diff/index.js +2 -0
- package/dist/src/{lineDiff/lineDiff.d.ts → line-diff/line-diff.d.ts} +1 -1
- package/dist/src/line-diff/line-diff.d.ts.map +1 -0
- package/dist/src/{lineDiff/lineDiff.js → line-diff/line-diff.js} +26 -19
- package/dist/src/{lineDiff → line-diff}/patch.d.ts +5 -9
- package/dist/src/line-diff/patch.d.ts.map +1 -0
- package/dist/src/{lineDiff → line-diff}/patch.js +54 -62
- package/dist/src/link-button/index.d.ts +3 -0
- package/dist/src/link-button/index.d.ts.map +1 -0
- package/dist/src/link-button/index.js +1 -0
- package/dist/src/{linkButton/linkButton.d.ts → link-button/link-button.d.ts} +2 -2
- package/dist/src/link-button/link-button.d.ts.map +1 -0
- package/dist/src/{linkButton/linkButton.js → link-button/link-button.js} +1 -1
- package/dist/src/link-state/index.d.ts +3 -0
- package/dist/src/link-state/index.d.ts.map +1 -0
- package/dist/src/link-state/index.js +1 -0
- package/dist/src/{linkState/linkState.d.ts → link-state/link-state.d.ts} +1 -1
- package/dist/src/link-state/link-state.d.ts.map +1 -0
- package/dist/src/link-state/link-state.js +24 -0
- package/dist/src/live-region/index.d.ts +3 -0
- package/dist/src/live-region/index.d.ts.map +1 -0
- package/dist/src/live-region/index.js +1 -0
- package/dist/src/{liveRegion/liveRegion.d.ts → live-region/live-region.d.ts} +6 -3
- package/dist/src/live-region/live-region.d.ts.map +1 -0
- package/dist/src/{liveRegion/liveRegion.js → live-region/live-region.js} +7 -5
- package/dist/src/loading/index.d.ts.map +1 -1
- package/dist/src/loading/loading.d.ts.map +1 -1
- package/dist/src/loading/loading.js +5 -1
- package/dist/src/mark/index.d.ts.map +1 -1
- package/dist/src/mark/mark.d.ts +0 -4
- package/dist/src/mark/mark.d.ts.map +1 -1
- package/dist/src/mark/mark.js +6 -3
- package/dist/src/media/index.d.ts.map +1 -1
- package/dist/src/media/media.d.ts +17 -42
- package/dist/src/media/media.d.ts.map +1 -1
- package/dist/src/media/media.js +106 -104
- package/dist/src/menu/index.d.ts.map +1 -1
- package/dist/src/menu/item.d.ts +8 -8
- package/dist/src/menu/item.d.ts.map +1 -1
- package/dist/src/menu/menu.d.ts +2 -5
- package/dist/src/menu/menu.d.ts.map +1 -1
- package/dist/src/menu/menu.js +19 -30
- package/dist/src/menu/slip.d.ts +4 -18
- package/dist/src/menu/slip.d.ts.map +1 -1
- package/dist/src/menu/slip.js +36 -36
- package/dist/src/meter/index.d.ts.map +1 -1
- package/dist/src/meter/meter.d.ts +1 -1
- package/dist/src/meter/meter.d.ts.map +1 -1
- package/dist/src/meter/meter.js +12 -15
- package/dist/src/monogram/index.d.ts.map +1 -1
- package/dist/src/monogram/monogram.d.ts.map +1 -1
- package/dist/src/monogram/monogram.js +9 -8
- package/dist/src/nav-strip/index.d.ts +3 -0
- package/dist/src/nav-strip/index.d.ts.map +1 -0
- package/dist/src/nav-strip/index.js +1 -0
- package/dist/src/{navStrip/navStrip.d.ts → nav-strip/nav-strip.d.ts} +3 -6
- package/dist/src/nav-strip/nav-strip.d.ts.map +1 -0
- package/dist/src/nav-strip/nav-strip.js +25 -0
- package/dist/src/notice/index.d.ts.map +1 -1
- package/dist/src/notice/notice.d.ts +0 -4
- package/dist/src/notice/notice.d.ts.map +1 -1
- package/dist/src/notice/notice.js +1 -4
- package/dist/src/outcome/index.d.ts.map +1 -1
- package/dist/src/outcome/outcome.d.ts.map +1 -1
- package/dist/src/outcome/outcome.js +1 -1
- package/dist/src/page-head/index.d.ts +3 -0
- package/dist/src/page-head/index.d.ts.map +1 -0
- package/dist/src/page-head/index.js +1 -0
- package/dist/src/{pageHead/pageHead.d.ts → page-head/page-head.d.ts} +1 -1
- package/dist/src/page-head/page-head.d.ts.map +1 -0
- package/dist/src/{pageHead/pageHead.js → page-head/page-head.js} +1 -1
- package/dist/src/panel/index.d.ts.map +1 -1
- package/dist/src/panel/panel.d.ts +0 -1
- package/dist/src/panel/panel.d.ts.map +1 -1
- package/dist/src/panel/panel.js +0 -1
- package/dist/src/password-field/index.d.ts +3 -0
- package/dist/src/password-field/index.d.ts.map +1 -0
- package/dist/src/password-field/index.js +1 -0
- package/dist/src/{passwordField/passwordField.d.ts → password-field/password-field.d.ts} +1 -1
- package/dist/src/password-field/password-field.d.ts.map +1 -0
- package/dist/src/{passwordField/passwordField.js → password-field/password-field.js} +4 -5
- package/dist/src/places/index.d.ts.map +1 -1
- package/dist/src/places/places.d.ts +3 -4
- package/dist/src/places/places.d.ts.map +1 -1
- package/dist/src/places/places.js +8 -2
- package/dist/src/props-list/index.d.ts +3 -0
- package/dist/src/props-list/index.d.ts.map +1 -0
- package/dist/src/props-list/index.js +1 -0
- package/dist/src/{propsList/propsList.d.ts → props-list/props-list.d.ts} +2 -2
- package/dist/src/props-list/props-list.d.ts.map +1 -0
- package/dist/src/{propsList/propsList.js → props-list/props-list.js} +2 -2
- package/dist/src/prose/index.d.ts.map +1 -1
- package/dist/src/prose/prose.d.ts.map +1 -1
- package/dist/src/query-chip/index.d.ts +3 -0
- package/dist/src/query-chip/index.d.ts.map +1 -0
- package/dist/src/query-chip/index.js +1 -0
- package/dist/src/{queryChip/queryChip.d.ts → query-chip/query-chip.d.ts} +1 -1
- package/dist/src/query-chip/query-chip.d.ts.map +1 -0
- package/dist/src/{queryChip/queryChip.js → query-chip/query-chip.js} +7 -4
- package/dist/src/{radioChoices → radio-choices}/index.d.ts +2 -2
- package/dist/src/radio-choices/index.d.ts.map +1 -0
- package/dist/src/{radioChoices → radio-choices}/index.js +1 -1
- package/dist/src/{radioChoices/radioChoices.d.ts → radio-choices/radio-choices.d.ts} +3 -3
- package/dist/src/radio-choices/radio-choices.d.ts.map +1 -0
- package/dist/src/{radioChoices/radioChoices.js → radio-choices/radio-choices.js} +25 -24
- package/dist/src/rail/index.d.ts.map +1 -1
- package/dist/src/rail/rail.d.ts +16 -32
- package/dist/src/rail/rail.d.ts.map +1 -1
- package/dist/src/rail/rail.js +97 -65
- package/dist/src/reel/index.d.ts +1 -1
- package/dist/src/reel/index.d.ts.map +1 -1
- package/dist/src/reel/layout.d.ts +12 -54
- package/dist/src/reel/layout.d.ts.map +1 -1
- package/dist/src/reel/layout.js +120 -145
- package/dist/src/reel/reel.d.ts +35 -34
- package/dist/src/reel/reel.d.ts.map +1 -1
- package/dist/src/reel/reel.js +253 -233
- package/dist/src/remote/index.d.ts.map +1 -1
- package/dist/src/remote/remote.d.ts +2 -2
- package/dist/src/remote/remote.d.ts.map +1 -1
- package/dist/src/remote/remote.js +6 -2
- package/dist/src/rows/index.d.ts.map +1 -1
- package/dist/src/rows/rows.d.ts +2 -2
- package/dist/src/rows/rows.d.ts.map +1 -1
- package/dist/src/rows/rows.js +16 -7
- package/dist/src/scheme/index.d.ts +1 -1
- package/dist/src/scheme/index.d.ts.map +1 -1
- package/dist/src/scheme/index.js +1 -1
- package/dist/src/scheme/{schemeSwitch.d.ts → scheme-switch.d.ts} +2 -2
- package/dist/src/scheme/scheme-switch.d.ts.map +1 -0
- package/dist/src/scheme/{schemeSwitch.js → scheme-switch.js} +33 -38
- package/dist/src/scheme/scheme.d.ts +0 -2
- package/dist/src/scheme/scheme.d.ts.map +1 -1
- package/dist/src/scheme/scheme.js +0 -2
- package/dist/src/secret/index.d.ts.map +1 -1
- package/dist/src/secret/secret.d.ts.map +1 -1
- package/dist/src/segmented/index.d.ts.map +1 -1
- package/dist/src/segmented/segmented.d.ts.map +1 -1
- package/dist/src/segmented/segmented.js +14 -3
- package/dist/src/select-all/index.d.ts +3 -0
- package/dist/src/select-all/index.d.ts.map +1 -0
- package/dist/src/select-all/index.js +1 -0
- package/dist/src/{selectAll/selectAll.d.ts → select-all/select-all.d.ts} +1 -1
- package/dist/src/select-all/select-all.d.ts.map +1 -0
- package/dist/src/{selectAll/selectAll.js → select-all/select-all.js} +2 -2
- package/dist/src/select-field/index.d.ts +3 -0
- package/dist/src/select-field/index.d.ts.map +1 -0
- package/dist/src/select-field/index.js +1 -0
- package/dist/src/{selectField/selectField.d.ts → select-field/select-field.d.ts} +2 -2
- package/dist/src/select-field/select-field.d.ts.map +1 -0
- package/dist/src/{selectField/selectField.js → select-field/select-field.js} +10 -7
- package/dist/src/sheet/index.d.ts.map +1 -1
- package/dist/src/sheet/sheet.d.ts.map +1 -1
- package/dist/src/sheet/sheet.js +4 -1
- package/dist/src/skip-link/index.d.ts +2 -0
- package/dist/src/skip-link/index.d.ts.map +1 -0
- package/dist/src/skip-link/index.js +1 -0
- package/dist/src/{skipLink/skipLink.d.ts → skip-link/skip-link.d.ts} +1 -3
- package/dist/src/skip-link/skip-link.d.ts.map +1 -0
- package/dist/src/{skipLink/skipLink.js → skip-link/skip-link.js} +7 -11
- package/dist/src/slot/slot.d.ts +1 -4
- package/dist/src/slot/slot.d.ts.map +1 -1
- package/dist/src/slot/slot.js +3 -3
- package/dist/src/sortable/index.d.ts.map +1 -1
- package/dist/src/sortable/sortable.d.ts +44 -44
- package/dist/src/sortable/sortable.d.ts.map +1 -1
- package/dist/src/sortable/sortable.js +60 -93
- package/dist/src/stack/index.d.ts.map +1 -1
- package/dist/src/stack/stack.d.ts.map +1 -1
- package/dist/src/stack/stack.js +0 -2
- package/dist/src/stage/index.d.ts.map +1 -1
- package/dist/src/stage/stage.d.ts +1 -1
- package/dist/src/stage/stage.d.ts.map +1 -1
- package/dist/src/stage/stage.js +4 -1
- package/dist/src/stat/index.d.ts.map +1 -1
- package/dist/src/stat/stat.d.ts +1 -1
- package/dist/src/stat/stat.d.ts.map +1 -1
- package/dist/src/stat/stat.js +17 -8
- package/dist/src/status-bar/index.d.ts +4 -0
- package/dist/src/status-bar/index.d.ts.map +1 -0
- package/dist/src/status-bar/index.js +2 -0
- package/dist/src/{statusBar/statusBar.d.ts → status-bar/status-bar.d.ts} +4 -4
- package/dist/src/status-bar/status-bar.d.ts.map +1 -0
- package/dist/src/{statusBar/statusBar.js → status-bar/status-bar.js} +5 -6
- package/dist/src/subscription/{prefixKeys.d.ts → prefix-keys.d.ts} +1 -2
- package/dist/src/subscription/prefix-keys.d.ts.map +1 -0
- package/dist/src/subscription/{prefixKeys.js → prefix-keys.js} +2 -5
- package/dist/src/table/index.d.ts.map +1 -1
- package/dist/src/table/table.d.ts +1 -1
- package/dist/src/table/table.d.ts.map +1 -1
- package/dist/src/table/table.js +19 -7
- package/dist/src/tabs/index.d.ts.map +1 -1
- package/dist/src/tabs/tabs.d.ts +4 -4
- package/dist/src/tabs/tabs.d.ts.map +1 -1
- package/dist/src/tabs/tabs.js +1 -6
- package/dist/src/tag/index.d.ts.map +1 -1
- package/dist/src/tag/tag.d.ts.map +1 -1
- package/dist/src/tag/tag.js +4 -1
- package/dist/src/text-button/index.d.ts +3 -0
- package/dist/src/text-button/index.d.ts.map +1 -0
- package/dist/src/text-button/index.js +1 -0
- package/dist/src/{textButton/textButton.d.ts → text-button/text-button.d.ts} +1 -1
- package/dist/src/text-button/text-button.d.ts.map +1 -0
- package/dist/src/{textButton/textButton.js → text-button/text-button.js} +2 -2
- package/dist/src/textarea-field/index.d.ts +3 -0
- package/dist/src/textarea-field/index.d.ts.map +1 -0
- package/dist/src/textarea-field/index.js +1 -0
- package/dist/src/{textareaField/textareaField.d.ts → textarea-field/textarea-field.d.ts} +1 -1
- package/dist/src/textarea-field/textarea-field.d.ts.map +1 -0
- package/dist/src/{textareaField/textareaField.js → textarea-field/textarea-field.js} +2 -2
- package/dist/src/time/index.d.ts.map +1 -1
- package/dist/src/time/time.d.ts.map +1 -1
- package/dist/src/time/time.js +16 -9
- package/dist/src/tips/index.d.ts.map +1 -1
- package/dist/src/tips/tips.d.ts +7 -18
- package/dist/src/tips/tips.d.ts.map +1 -1
- package/dist/src/tips/tips.js +67 -65
- package/dist/src/toast/index.d.ts.map +1 -1
- package/dist/src/toast/stack.d.ts +53 -60
- package/dist/src/toast/stack.d.ts.map +1 -1
- package/dist/src/toast/stack.js +5 -18
- package/dist/src/toast/toast.d.ts +3 -5
- package/dist/src/toast/toast.d.ts.map +1 -1
- package/dist/src/toast/toast.js +42 -39
- package/dist/src/toc/index.d.ts.map +1 -1
- package/dist/src/toc/toc.d.ts +3 -3
- package/dist/src/toc/toc.d.ts.map +1 -1
- package/dist/src/toc/toc.js +10 -7
- package/dist/src/toolbar/index.d.ts.map +1 -1
- package/dist/src/toolbar/toolbar.d.ts +1 -1
- package/dist/src/toolbar/toolbar.d.ts.map +1 -1
- package/dist/src/toolbar/toolbar.js +27 -24
- package/dist/src/{topBar/barHeight.d.ts → top-bar/bar-height.d.ts} +1 -2
- package/dist/src/top-bar/bar-height.d.ts.map +1 -0
- package/dist/src/{topBar/barHeight.js → top-bar/bar-height.js} +20 -13
- package/dist/src/top-bar/index.d.ts +4 -0
- package/dist/src/top-bar/index.d.ts.map +1 -0
- package/dist/src/top-bar/index.js +2 -0
- package/dist/src/{topBar/topBar.d.ts → top-bar/top-bar.d.ts} +3 -3
- package/dist/src/top-bar/top-bar.d.ts.map +1 -0
- package/dist/src/{topBar/topBar.js → top-bar/top-bar.js} +2 -2
- package/dist/src/video-frame/index.d.ts +3 -0
- package/dist/src/video-frame/index.d.ts.map +1 -0
- package/dist/src/video-frame/index.js +1 -0
- package/dist/src/{videoFrame/videoFrame.d.ts → video-frame/video-frame.d.ts} +1 -1
- package/dist/src/video-frame/video-frame.d.ts.map +1 -0
- package/dist/src/{videoFrame/videoFrame.js → video-frame/video-frame.js} +11 -7
- package/dist/src/wall/index.d.ts.map +1 -1
- package/dist/src/wall/wall.d.ts.map +1 -1
- package/dist/src/window/index.d.ts.map +1 -1
- package/dist/src/window/window.d.ts +2 -2
- package/dist/src/window/window.d.ts.map +1 -1
- package/dist/src/window/window.js +4 -2
- package/dist/src/wordmark/index.d.ts.map +1 -1
- package/dist/src/wordmark/wordmark.d.ts.map +1 -1
- package/dist/src/wrap/index.d.ts.map +1 -1
- package/dist/src/wrap/wrap.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/adapters/diagram.ts +278 -0
- package/src/adapters/mermaid.ts +13 -273
- package/src/announcer/announcer.ts +54 -35
- package/src/attributes/attributes.ts +3 -1
- package/src/{audioFrame/audioFrame.ts → audio-frame/audio-frame.ts} +4 -6
- package/src/audio-frame/index.ts +3 -0
- package/src/banner/banner.ts +5 -4
- package/src/banner/index.ts +1 -0
- package/src/{barChart/barChart.ts → bar-chart/bar-chart.ts} +81 -43
- package/src/bar-chart/index.ts +3 -0
- package/src/bench/bench.ts +5 -4
- package/src/bench/index.ts +1 -0
- package/src/board/board.ts +338 -243
- package/src/board/index.ts +8 -1
- package/src/button/button.ts +24 -16
- package/src/button/index.ts +8 -1
- package/src/card/card.ts +23 -21
- package/src/card/index.ts +1 -0
- package/src/chart-table/chart-table.ts +87 -0
- package/src/chip/chip.ts +13 -9
- package/src/chip/index.ts +1 -0
- package/src/choice/choice.ts +13 -7
- package/src/choice/index.ts +1 -0
- package/src/choices/choices.ts +4 -3
- package/src/choices/index.ts +1 -0
- package/src/{codeEditor/codeEditor.ts → code-editor/code-editor.ts} +5 -4
- package/src/code-editor/index.ts +3 -0
- package/src/{codeSurface/codeSurface.ts → code-surface/code-surface.ts} +11 -5
- package/src/code-surface/index.ts +3 -0
- package/src/{commandPalette/commandPalette.ts → command-palette/command-palette.ts} +470 -295
- package/src/{commandPalette → command-palette}/index.ts +12 -2
- package/src/{commandPalette → command-palette}/keys.ts +44 -43
- package/src/{commandPalette → command-palette}/match.ts +42 -30
- package/src/{commandPalette → command-palette}/message.ts +13 -20
- package/src/{confirmDialog/confirmDialog.ts → confirm-dialog/confirm-dialog.ts} +51 -46
- package/src/{confirmDialog → confirm-dialog}/index.ts +3 -2
- package/src/{contextMenu/contextMenu.ts → context-menu/context-menu.ts} +71 -70
- package/src/{contextMenu → context-menu}/index.ts +4 -2
- package/src/{copyButton/copyButton.ts → copy-button/copy-button.ts} +51 -54
- package/src/{copyButton → copy-button}/index.ts +3 -2
- package/src/crumbs/crumbs.ts +7 -6
- package/src/crumbs/index.ts +1 -0
- package/src/deck/deck.ts +4 -3
- package/src/deck/index.ts +1 -0
- package/src/dialog/dialog.ts +135 -113
- package/src/dialog/fold.ts +44 -25
- package/src/dialog/index.ts +9 -1
- package/src/disclosure/disclosure.ts +14 -8
- package/src/disclosure/index.ts +1 -0
- package/src/dom/html-element.ts +10 -0
- package/src/drag/drag.ts +102 -119
- package/src/{dropZone/dropZone.ts → drop-zone/drop-zone.ts} +43 -43
- package/src/drop-zone/index.ts +11 -0
- package/src/{editableTitle/editableTitle.ts → editable-title/editable-title.ts} +29 -32
- package/src/{editableTitle → editable-title}/index.ts +4 -2
- package/src/{emptyState/emptyState.ts → empty-state/empty-state.ts} +9 -5
- package/src/empty-state/index.ts +3 -0
- package/src/{errorSummary/errorSummary.ts → error-summary/error-summary.ts} +16 -7
- package/src/error-summary/index.ts +3 -0
- package/src/field/field.ts +38 -28
- package/src/field/index.ts +1 -0
- package/src/{fieldGrid/fieldGrid.ts → field-grid/field-grid.ts} +4 -3
- package/src/field-grid/index.ts +3 -0
- package/src/fields/fields.ts +9 -5
- package/src/fields/index.ts +1 -0
- package/src/fieldset/fieldset.ts +6 -5
- package/src/fieldset/index.ts +1 -0
- package/src/{fileTree/fileTree.ts → file-tree/file-tree.ts} +241 -166
- package/src/file-tree/index.ts +12 -0
- package/src/{filterChip/filterChip.ts → filter-chip/filter-chip.ts} +32 -13
- package/src/filter-chip/index.ts +3 -0
- package/src/{filterStrip/filterStrip.ts → filter-strip/filter-strip.ts} +4 -3
- package/src/filter-strip/index.ts +3 -0
- package/src/{flashWord/flashWord.ts → flash-word/flash-word.ts} +9 -7
- package/src/flash-word/index.ts +3 -0
- package/src/focus/focus.ts +5 -5
- package/src/format/format.ts +37 -31
- package/src/format/index.ts +1 -0
- package/src/glyph/glyph.ts +7 -6
- package/src/glyph/glyphs.ts +2601 -2611
- package/src/glyph/index.ts +3 -0
- package/src/group/group.ts +4 -3
- package/src/group/index.ts +1 -0
- package/src/history/history.ts +18 -10
- package/src/history/index.ts +1 -0
- package/src/{iconButton/iconButton.ts → icon-button/icon-button.ts} +13 -7
- package/src/icon-button/index.ts +3 -0
- package/src/identity/identity.ts +7 -6
- package/src/identity/index.ts +1 -0
- package/src/{imageFrame/imageFrame.ts → image-frame/image-frame.ts} +43 -25
- package/src/image-frame/index.ts +3 -0
- package/src/index.ts +139 -41
- package/src/{inlineInput → inline-input}/index.ts +3 -2
- package/src/{inlineInput/inlineInput.ts → inline-input/inline-input.ts} +97 -88
- package/src/{keyHelp → key-help}/index.ts +3 -2
- package/src/{keyHelp/keyHelp.ts → key-help/key-help.ts} +74 -62
- package/src/key-hint/index.ts +5 -0
- package/src/{keyHint/keyHint.ts → key-hint/key-hint.ts} +10 -5
- package/src/{keyHint/keyLabel.ts → key-hint/key-label.ts} +43 -22
- package/src/keymap/index.ts +1 -0
- package/src/keymap/keymap.ts +23 -9
- package/src/keys/keys.ts +0 -2
- package/src/line-chart/index.ts +3 -0
- package/src/{lineChart/lineChart.ts → line-chart/line-chart.ts} +71 -49
- package/src/line-diff/diff.ts +196 -0
- package/src/line-diff/index.ts +7 -0
- package/src/{lineDiff/lineDiff.ts → line-diff/line-diff.ts} +45 -23
- package/src/{lineDiff → line-diff}/patch.ts +104 -76
- package/src/link-button/index.ts +3 -0
- package/src/{linkButton/linkButton.ts → link-button/link-button.ts} +7 -5
- package/src/link-state/index.ts +3 -0
- package/src/{linkState/linkState.ts → link-state/link-state.ts} +20 -9
- package/src/live-region/index.ts +3 -0
- package/src/{liveRegion/liveRegion.ts → live-region/live-region.ts} +15 -11
- package/src/loading/index.ts +1 -0
- package/src/loading/loading.ts +10 -5
- package/src/mark/index.ts +1 -0
- package/src/mark/mark.ts +17 -15
- package/src/media/index.ts +1 -0
- package/src/media/media.ts +255 -157
- package/src/menu/index.ts +4 -0
- package/src/menu/item.ts +10 -11
- package/src/menu/menu.ts +110 -97
- package/src/menu/slip.ts +129 -92
- package/src/meter/index.ts +1 -0
- package/src/meter/meter.ts +52 -33
- package/src/monogram/index.ts +1 -0
- package/src/monogram/monogram.ts +27 -19
- package/src/nav-strip/index.ts +3 -0
- package/src/{navStrip/navStrip.ts → nav-strip/nav-strip.ts} +21 -13
- package/src/notice/index.ts +1 -0
- package/src/notice/notice.ts +24 -16
- package/src/outcome/index.ts +1 -0
- package/src/outcome/outcome.ts +14 -6
- package/src/page-head/index.ts +3 -0
- package/src/{pageHead/pageHead.ts → page-head/page-head.ts} +6 -5
- package/src/panel/index.ts +1 -0
- package/src/panel/panel.ts +6 -6
- package/src/password-field/index.ts +3 -0
- package/src/{passwordField/passwordField.ts → password-field/password-field.ts} +13 -13
- package/src/pixel-paper.css +26 -508
- package/src/places/index.ts +1 -0
- package/src/places/places.ts +22 -11
- package/src/props-list/index.ts +3 -0
- package/src/{propsList/propsList.ts → props-list/props-list.ts} +6 -6
- package/src/prose/index.ts +1 -0
- package/src/prose/prose.ts +4 -4
- package/src/query-chip/index.ts +3 -0
- package/src/{queryChip/queryChip.ts → query-chip/query-chip.ts} +18 -7
- package/src/{radioChoices → radio-choices}/index.ts +3 -2
- package/src/{radioChoices/radioChoices.ts → radio-choices/radio-choices.ts} +79 -65
- package/src/rail/index.ts +1 -0
- package/src/rail/rail.ts +291 -225
- package/src/reel/index.ts +8 -1
- package/src/reel/layout.ts +393 -238
- package/src/reel/reel.ts +750 -452
- package/src/remote/index.ts +1 -0
- package/src/remote/remote.ts +18 -11
- package/src/rows/index.ts +1 -0
- package/src/rows/rows.ts +83 -47
- package/src/scheme/index.ts +3 -1
- package/src/scheme/{schemeSwitch.ts → scheme-switch.ts} +24 -35
- package/src/scheme/scheme.ts +4 -4
- package/src/secret/index.ts +1 -0
- package/src/secret/secret.ts +5 -4
- package/src/segmented/index.ts +1 -0
- package/src/segmented/segmented.ts +22 -10
- package/src/select-all/index.ts +3 -0
- package/src/{selectAll/selectAll.ts → select-all/select-all.ts} +9 -8
- package/src/{selectField → select-field}/index.ts +3 -2
- package/src/{selectField/selectField.ts → select-field/select-field.ts} +25 -11
- package/src/sheet/index.ts +1 -0
- package/src/sheet/sheet.ts +9 -5
- package/src/skip-link/index.ts +1 -0
- package/src/{skipLink/skipLink.ts → skip-link/skip-link.ts} +9 -15
- package/src/slot/slot.ts +5 -6
- package/src/sortable/index.ts +1 -0
- package/src/sortable/sortable.ts +287 -206
- package/src/stack/index.ts +1 -0
- package/src/stack/stack.ts +6 -7
- package/src/stage/index.ts +1 -0
- package/src/stage/stage.ts +12 -8
- package/src/stat/index.ts +1 -0
- package/src/stat/stat.ts +39 -20
- package/src/status-bar/index.ts +5 -0
- package/src/{statusBar/statusBar.ts → status-bar/status-bar.ts} +18 -11
- package/src/subscription/{prefixKeys.ts → prefix-keys.ts} +5 -6
- package/src/table/index.ts +1 -0
- package/src/table/table.ts +49 -24
- package/src/tabs/index.ts +1 -0
- package/src/tabs/tabs.ts +58 -60
- package/src/tag/index.ts +1 -0
- package/src/tag/tag.ts +14 -7
- package/src/text-button/index.ts +3 -0
- package/src/{textButton/textButton.ts → text-button/text-button.ts} +7 -5
- package/src/textarea-field/index.ts +3 -0
- package/src/{textareaField/textareaField.ts → textarea-field/textarea-field.ts} +15 -7
- package/src/time/index.ts +1 -0
- package/src/time/time.ts +58 -25
- package/src/tips/index.ts +1 -0
- package/src/tips/tips.ts +183 -127
- package/src/toast/index.ts +3 -0
- package/src/toast/stack.ts +22 -23
- package/src/toast/toast.ts +168 -100
- package/src/toc/index.ts +1 -0
- package/src/toc/toc.ts +42 -27
- package/src/tokens.css +7 -24
- package/src/toolbar/index.ts +1 -0
- package/src/toolbar/toolbar.ts +78 -40
- package/src/{topBar/barHeight.ts → top-bar/bar-height.ts} +26 -12
- package/src/top-bar/index.ts +5 -0
- package/src/{topBar/topBar.ts → top-bar/top-bar.ts} +13 -7
- package/src/video-frame/index.ts +3 -0
- package/src/{videoFrame/videoFrame.ts → video-frame/video-frame.ts} +31 -18
- package/src/wall/index.ts +1 -0
- package/src/wall/wall.ts +13 -10
- package/src/window/index.ts +1 -0
- package/src/window/window.ts +15 -9
- package/src/wordmark/index.ts +1 -0
- package/src/wordmark/wordmark.ts +4 -3
- package/src/wrap/index.ts +1 -0
- package/src/wrap/wrap.ts +4 -3
- package/dist/src/audioFrame/audioFrame.d.ts.map +0 -1
- package/dist/src/audioFrame/index.d.ts +0 -3
- package/dist/src/audioFrame/index.d.ts.map +0 -1
- package/dist/src/audioFrame/index.js +0 -1
- package/dist/src/barChart/barChart.d.ts.map +0 -1
- package/dist/src/barChart/index.d.ts +0 -3
- package/dist/src/barChart/index.d.ts.map +0 -1
- package/dist/src/barChart/index.js +0 -1
- package/dist/src/chartTable/chartTable.d.ts.map +0 -1
- package/dist/src/codeEditor/codeEditor.d.ts.map +0 -1
- package/dist/src/codeEditor/index.d.ts +0 -3
- package/dist/src/codeEditor/index.d.ts.map +0 -1
- package/dist/src/codeEditor/index.js +0 -1
- package/dist/src/codeSurface/codeSurface.d.ts.map +0 -1
- package/dist/src/codeSurface/index.d.ts +0 -3
- package/dist/src/codeSurface/index.d.ts.map +0 -1
- package/dist/src/codeSurface/index.js +0 -1
- package/dist/src/commandPalette/commandPalette.d.ts.map +0 -1
- package/dist/src/commandPalette/commandPalette.js +0 -611
- package/dist/src/commandPalette/index.d.ts.map +0 -1
- package/dist/src/commandPalette/keys.d.ts.map +0 -1
- package/dist/src/commandPalette/keys.js +0 -102
- package/dist/src/commandPalette/match.d.ts.map +0 -1
- package/dist/src/commandPalette/message.d.ts.map +0 -1
- package/dist/src/confirmDialog/confirmDialog.d.ts.map +0 -1
- package/dist/src/confirmDialog/index.d.ts +0 -3
- package/dist/src/confirmDialog/index.d.ts.map +0 -1
- package/dist/src/contextMenu/contextMenu.d.ts.map +0 -1
- package/dist/src/contextMenu/index.d.ts.map +0 -1
- package/dist/src/copyButton/copyButton.d.ts.map +0 -1
- package/dist/src/copyButton/index.d.ts +0 -3
- package/dist/src/copyButton/index.d.ts.map +0 -1
- package/dist/src/copyButton/index.js +0 -1
- package/dist/src/dropZone/dropZone.d.ts.map +0 -1
- package/dist/src/dropZone/index.d.ts +0 -3
- package/dist/src/dropZone/index.d.ts.map +0 -1
- package/dist/src/dropZone/index.js +0 -1
- package/dist/src/editableTitle/editableTitle.d.ts.map +0 -1
- package/dist/src/editableTitle/index.d.ts +0 -4
- package/dist/src/editableTitle/index.d.ts.map +0 -1
- package/dist/src/emptyState/emptyState.d.ts.map +0 -1
- package/dist/src/emptyState/index.d.ts +0 -3
- package/dist/src/emptyState/index.d.ts.map +0 -1
- package/dist/src/emptyState/index.js +0 -1
- package/dist/src/errorSummary/errorSummary.d.ts.map +0 -1
- package/dist/src/errorSummary/index.d.ts +0 -3
- package/dist/src/errorSummary/index.d.ts.map +0 -1
- package/dist/src/errorSummary/index.js +0 -1
- package/dist/src/fieldGrid/fieldGrid.d.ts.map +0 -1
- package/dist/src/fieldGrid/index.d.ts +0 -3
- package/dist/src/fieldGrid/index.d.ts.map +0 -1
- package/dist/src/fieldGrid/index.js +0 -1
- package/dist/src/fileTree/fileTree.d.ts.map +0 -1
- package/dist/src/fileTree/fileTree.js +0 -230
- package/dist/src/fileTree/index.d.ts +0 -3
- package/dist/src/fileTree/index.d.ts.map +0 -1
- package/dist/src/filterChip/filterChip.d.ts.map +0 -1
- package/dist/src/filterChip/index.d.ts +0 -3
- package/dist/src/filterChip/index.d.ts.map +0 -1
- package/dist/src/filterChip/index.js +0 -1
- package/dist/src/filterStrip/filterStrip.d.ts.map +0 -1
- package/dist/src/filterStrip/index.d.ts +0 -3
- package/dist/src/filterStrip/index.d.ts.map +0 -1
- package/dist/src/filterStrip/index.js +0 -1
- package/dist/src/flashWord/flashWord.d.ts.map +0 -1
- package/dist/src/flashWord/index.d.ts +0 -3
- package/dist/src/flashWord/index.d.ts.map +0 -1
- package/dist/src/flashWord/index.js +0 -1
- package/dist/src/iconButton/iconButton.d.ts.map +0 -1
- package/dist/src/iconButton/index.d.ts +0 -3
- package/dist/src/iconButton/index.d.ts.map +0 -1
- package/dist/src/iconButton/index.js +0 -1
- package/dist/src/imageFrame/imageFrame.d.ts.map +0 -1
- package/dist/src/imageFrame/index.d.ts +0 -3
- package/dist/src/imageFrame/index.d.ts.map +0 -1
- package/dist/src/imageFrame/index.js +0 -1
- package/dist/src/inlineInput/index.d.ts +0 -3
- package/dist/src/inlineInput/index.d.ts.map +0 -1
- package/dist/src/inlineInput/inlineInput.d.ts.map +0 -1
- package/dist/src/keyHelp/index.d.ts +0 -3
- package/dist/src/keyHelp/index.d.ts.map +0 -1
- package/dist/src/keyHelp/keyHelp.d.ts.map +0 -1
- package/dist/src/keyHint/index.d.ts +0 -4
- package/dist/src/keyHint/index.d.ts.map +0 -1
- package/dist/src/keyHint/index.js +0 -2
- package/dist/src/keyHint/keyHint.d.ts.map +0 -1
- package/dist/src/keyHint/keyLabel.d.ts.map +0 -1
- package/dist/src/lineChart/index.d.ts +0 -3
- package/dist/src/lineChart/index.d.ts.map +0 -1
- package/dist/src/lineChart/index.js +0 -1
- package/dist/src/lineChart/lineChart.d.ts.map +0 -1
- package/dist/src/lineDiff/diff.d.ts +0 -41
- package/dist/src/lineDiff/diff.d.ts.map +0 -1
- package/dist/src/lineDiff/diff.js +0 -92
- package/dist/src/lineDiff/index.d.ts +0 -5
- package/dist/src/lineDiff/index.d.ts.map +0 -1
- package/dist/src/lineDiff/index.js +0 -2
- package/dist/src/lineDiff/lineDiff.d.ts.map +0 -1
- package/dist/src/lineDiff/patch.d.ts.map +0 -1
- package/dist/src/linkButton/index.d.ts +0 -3
- package/dist/src/linkButton/index.d.ts.map +0 -1
- package/dist/src/linkButton/index.js +0 -1
- package/dist/src/linkButton/linkButton.d.ts.map +0 -1
- package/dist/src/linkState/index.d.ts +0 -3
- package/dist/src/linkState/index.d.ts.map +0 -1
- package/dist/src/linkState/index.js +0 -1
- package/dist/src/linkState/linkState.d.ts.map +0 -1
- package/dist/src/linkState/linkState.js +0 -14
- package/dist/src/liveRegion/index.d.ts +0 -3
- package/dist/src/liveRegion/index.d.ts.map +0 -1
- package/dist/src/liveRegion/index.js +0 -1
- package/dist/src/liveRegion/liveRegion.d.ts.map +0 -1
- package/dist/src/navStrip/index.d.ts +0 -3
- package/dist/src/navStrip/index.d.ts.map +0 -1
- package/dist/src/navStrip/index.js +0 -1
- package/dist/src/navStrip/navStrip.d.ts.map +0 -1
- package/dist/src/navStrip/navStrip.js +0 -27
- package/dist/src/pageHead/index.d.ts +0 -3
- package/dist/src/pageHead/index.d.ts.map +0 -1
- package/dist/src/pageHead/index.js +0 -1
- package/dist/src/pageHead/pageHead.d.ts.map +0 -1
- package/dist/src/passwordField/index.d.ts +0 -3
- package/dist/src/passwordField/index.d.ts.map +0 -1
- package/dist/src/passwordField/index.js +0 -1
- package/dist/src/passwordField/passwordField.d.ts.map +0 -1
- package/dist/src/propsList/index.d.ts +0 -3
- package/dist/src/propsList/index.d.ts.map +0 -1
- package/dist/src/propsList/index.js +0 -1
- package/dist/src/propsList/propsList.d.ts.map +0 -1
- package/dist/src/queryChip/index.d.ts +0 -3
- package/dist/src/queryChip/index.d.ts.map +0 -1
- package/dist/src/queryChip/index.js +0 -1
- package/dist/src/queryChip/queryChip.d.ts.map +0 -1
- package/dist/src/radioChoices/index.d.ts.map +0 -1
- package/dist/src/radioChoices/radioChoices.d.ts.map +0 -1
- package/dist/src/scheme/schemeSwitch.d.ts.map +0 -1
- package/dist/src/selectAll/index.d.ts +0 -3
- package/dist/src/selectAll/index.d.ts.map +0 -1
- package/dist/src/selectAll/index.js +0 -1
- package/dist/src/selectAll/selectAll.d.ts.map +0 -1
- package/dist/src/selectField/index.d.ts +0 -3
- package/dist/src/selectField/index.d.ts.map +0 -1
- package/dist/src/selectField/index.js +0 -1
- package/dist/src/selectField/selectField.d.ts.map +0 -1
- package/dist/src/skipLink/index.d.ts +0 -2
- package/dist/src/skipLink/index.d.ts.map +0 -1
- package/dist/src/skipLink/index.js +0 -1
- package/dist/src/skipLink/skipLink.d.ts.map +0 -1
- package/dist/src/statusBar/index.d.ts +0 -4
- package/dist/src/statusBar/index.d.ts.map +0 -1
- package/dist/src/statusBar/index.js +0 -2
- package/dist/src/statusBar/statusBar.d.ts.map +0 -1
- package/dist/src/subscription/prefixKeys.d.ts.map +0 -1
- package/dist/src/textButton/index.d.ts +0 -3
- package/dist/src/textButton/index.d.ts.map +0 -1
- package/dist/src/textButton/index.js +0 -1
- package/dist/src/textButton/textButton.d.ts.map +0 -1
- package/dist/src/textareaField/index.d.ts +0 -3
- package/dist/src/textareaField/index.d.ts.map +0 -1
- package/dist/src/textareaField/index.js +0 -1
- package/dist/src/textareaField/textareaField.d.ts.map +0 -1
- package/dist/src/topBar/barHeight.d.ts.map +0 -1
- package/dist/src/topBar/index.d.ts +0 -4
- package/dist/src/topBar/index.d.ts.map +0 -1
- package/dist/src/topBar/index.js +0 -2
- package/dist/src/topBar/topBar.d.ts.map +0 -1
- package/dist/src/videoFrame/index.d.ts +0 -3
- package/dist/src/videoFrame/index.d.ts.map +0 -1
- package/dist/src/videoFrame/index.js +0 -1
- package/dist/src/videoFrame/videoFrame.d.ts.map +0 -1
- package/src/audioFrame/index.ts +0 -2
- package/src/barChart/index.ts +0 -2
- package/src/chartTable/chartTable.ts +0 -88
- package/src/codeEditor/index.ts +0 -2
- package/src/codeSurface/index.ts +0 -2
- package/src/dropZone/index.ts +0 -2
- package/src/emptyState/index.ts +0 -2
- package/src/errorSummary/index.ts +0 -2
- package/src/fieldGrid/index.ts +0 -2
- package/src/fileTree/index.ts +0 -2
- package/src/filterChip/index.ts +0 -2
- package/src/filterStrip/index.ts +0 -2
- package/src/flashWord/index.ts +0 -2
- package/src/iconButton/index.ts +0 -2
- package/src/imageFrame/index.ts +0 -2
- package/src/keyHint/index.ts +0 -3
- package/src/lineChart/index.ts +0 -2
- package/src/lineDiff/diff.ts +0 -182
- package/src/lineDiff/index.ts +0 -4
- package/src/linkButton/index.ts +0 -2
- package/src/linkState/index.ts +0 -2
- package/src/liveRegion/index.ts +0 -2
- package/src/navStrip/index.ts +0 -2
- package/src/pageHead/index.ts +0 -2
- package/src/passwordField/index.ts +0 -2
- package/src/propsList/index.ts +0 -2
- package/src/queryChip/index.ts +0 -2
- package/src/selectAll/index.ts +0 -2
- package/src/skipLink/index.ts +0 -1
- package/src/statusBar/index.ts +0 -3
- package/src/textButton/index.ts +0 -2
- package/src/textareaField/index.ts +0 -2
- package/src/topBar/index.ts +0 -3
- package/src/videoFrame/index.ts +0 -2
|
@@ -1,611 +0,0 @@
|
|
|
1
|
-
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Input as UiInput } from "@foldkit/ui";
|
|
3
|
-
import { Array, Effect, Equal, HashSet, Match, Option, Schema, Stream, String, pipe } from "effect";
|
|
4
|
-
import * as FoldkitCommand from "foldkit/command";
|
|
5
|
-
import * as Dom from "foldkit/dom";
|
|
6
|
-
import { defineMessageUnion } from "foldkit/message";
|
|
7
|
-
import * as Render from "foldkit/render";
|
|
8
|
-
import { modifyFields } from "foldkit/struct";
|
|
9
|
-
import { defineView } from "foldkit/submodel";
|
|
10
|
-
import * as Subscription from "foldkit/subscription";
|
|
11
|
-
import * as Update from "foldkit/update";
|
|
12
|
-
import * as Dialog from "../dialog/dialog.js";
|
|
13
|
-
import { foldDialog } from "../dialog/fold.js";
|
|
14
|
-
import { Focus } from "../focus/focus.js";
|
|
15
|
-
import * as Glyph from "../glyph/glyph.js";
|
|
16
|
-
import * as IconButton from "../iconButton/iconButton.js";
|
|
17
|
-
import { isPlain } from "../keys/keys.js";
|
|
18
|
-
import { LOCALE } from "../locale/locale.js";
|
|
19
|
-
import { slotView } from "../slot/slot.js";
|
|
20
|
-
import { prefixKeys } from "../subscription/prefixKeys.js";
|
|
21
|
-
import { BindPaletteKeys, FIELD_ATTRIBUTE, OPTION_SELECTOR, PAGE_ATTRIBUTE, earlyKeys, shownPageOf, } from "./keys.js";
|
|
22
|
-
import { findCommands, pageChoices } from "./match.js";
|
|
23
|
-
import { Message } from "./message.js";
|
|
24
|
-
// MODEL
|
|
25
|
-
/** An open page: its command, its own query, and its cursor once the reader moved it. */
|
|
26
|
-
const OpenPage = Schema.Struct({
|
|
27
|
-
commandId: Schema.String,
|
|
28
|
-
query: Schema.String,
|
|
29
|
-
maybeCursor: Schema.Option(Schema.String),
|
|
30
|
-
});
|
|
31
|
-
/** Schema for a command palette: its Dialog, the commands' query and cursor (kept while a
|
|
32
|
-
* page is open, so Back restores them), the open page, and the choice being picked. A cursor
|
|
33
|
-
* is a row's id, so it holds to its row while the list changes. The rows are the view's
|
|
34
|
-
* (built from its `commands`), so ↑, ↓ and Enter carry what their render showed: its rows,
|
|
35
|
-
* the row it showed the cursor on, and the query and waiting arrows it was rendered with.
|
|
36
|
-
* When that query is the Model's and the render had applied the waiting arrows, those rows
|
|
37
|
-
* are the list, and update steps among them from the Model's cursor. A key pressed before the
|
|
38
|
-
* view caught up (as the palette opens, or just after typing, while the list still shows the
|
|
39
|
-
* last query's rows) cannot name a row yet: `cursorShift` counts the arrows, which the next
|
|
40
|
-
* render applies from the cursor's row, and `isEnterPending` an Enter. Such a key returns
|
|
41
|
-
* `ReportPendingKeys`, which reads the row the next render shows the cursor on: it becomes
|
|
42
|
-
* the cursor, and a waiting Enter acts on it. */
|
|
43
|
-
export const Model = Schema.Struct({
|
|
44
|
-
dialog: Dialog.Model,
|
|
45
|
-
query: Schema.String,
|
|
46
|
-
maybeCursor: Schema.Option(Schema.String),
|
|
47
|
-
cursorShift: Schema.Number,
|
|
48
|
-
isEnterPending: Schema.Boolean,
|
|
49
|
-
maybePage: Schema.Option(OpenPage),
|
|
50
|
-
maybePicking: Schema.Option(Schema.String),
|
|
51
|
-
});
|
|
52
|
-
// OUT MESSAGE
|
|
53
|
-
/** Union of OutMessages a command palette reports. `SelectedCommand`: run this command; the
|
|
54
|
-
* palette has closed first, so what it opens takes focus. `SelectedChoice`: apply this choice
|
|
55
|
-
* of that command's page; the page holds, the row printing the working cursor, until the
|
|
56
|
-
* caller reports back with `pickSucceeded` or `pickFailed`. `Closed`: the reader dismissed
|
|
57
|
-
* the palette (Escape, a press on the veil), even while a pick was out; a write already
|
|
58
|
-
* running keeps running, and its answer no longer changes the palette. */
|
|
59
|
-
export const OutMessage = defineMessageUnion({
|
|
60
|
-
SelectedCommand: { id: Schema.String },
|
|
61
|
-
SelectedChoice: { commandId: Schema.String, choiceId: Schema.String },
|
|
62
|
-
Closed: {},
|
|
63
|
-
});
|
|
64
|
-
const fieldId = (paletteId) => __foldkitBrandViewResult((`${paletteId}-field`), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#fieldId");
|
|
65
|
-
const listIdOf = (paletteId) => __foldkitBrandViewResult((`${paletteId}-list`), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#listIdOf");
|
|
66
|
-
/** Creates a closed command palette. */
|
|
67
|
-
export const init = (config) => (__foldkitBrandViewResult(({
|
|
68
|
-
dialog: Dialog.init({ id: config.id }),
|
|
69
|
-
query: "",
|
|
70
|
-
maybeCursor: Option.none(),
|
|
71
|
-
cursorShift: 0,
|
|
72
|
-
isEnterPending: false,
|
|
73
|
-
maybePage: Option.none(),
|
|
74
|
-
maybePicking: Option.none(),
|
|
75
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#init"));
|
|
76
|
-
// ACCESSORS
|
|
77
|
-
/** The palette's id, unique in the document. */
|
|
78
|
-
export const id = (model) => __foldkitBrandViewResult((Dialog.id(model.dialog)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#id");
|
|
79
|
-
/** Whether the palette is open. */
|
|
80
|
-
export const isOpen = (model) => __foldkitBrandViewResult((Dialog.isOpen(model.dialog)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isOpen");
|
|
81
|
-
/** The words in the field: the open page's, or the commands'. A page whose choices are a
|
|
82
|
-
* function of what is typed reads it here. */
|
|
83
|
-
export const query = (model) => __foldkitBrandViewResult((Option.match(model.maybePage, { onNone: () => __foldkitBrandViewResult((model.query), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone"), onSome: (page) => __foldkitBrandViewResult((page.query), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#query");
|
|
84
|
-
/** The command whose page is open. */
|
|
85
|
-
export const maybePageId = (model) => __foldkitBrandViewResult((Option.map(model.maybePage, (page) => __foldkitBrandViewResult((page.commandId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePageId");
|
|
86
|
-
/** Whether a picked choice is waiting for the caller's answer. */
|
|
87
|
-
export const isPicking = (model) => __foldkitBrandViewResult((Option.isSome(model.maybePicking)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isPicking");
|
|
88
|
-
// COMMAND
|
|
89
|
-
/** The data attribute on a row: its id. */
|
|
90
|
-
const ROW_ATTRIBUTE = "value";
|
|
91
|
-
/** The data attribute on a command's row that opens a page. */
|
|
92
|
-
const OPENS_PAGE_ATTRIBUTE = "pixel-paper-palette-opens-page";
|
|
93
|
-
/**
|
|
94
|
-
* Scrolls the cursor's row of the palette `paletteId` (its `id`) into view by the least
|
|
95
|
-
* distance, once the view has rendered. The palette returns it itself as the cursor moves, the
|
|
96
|
-
* query changes or a page opens; an application returns it too when the rows change under an
|
|
97
|
-
* open palette (see `maybeCursorId`), or as it opens one on a page whose cursor may be far
|
|
98
|
-
* down, and resolves it with `Message.CompletedScrollToCursor` in a Scene.
|
|
99
|
-
*/
|
|
100
|
-
export const ScrollToCursor = FoldkitCommand.define("ScrollToCursor", {
|
|
101
|
-
args: { paletteId: Schema.String },
|
|
102
|
-
messages: [Message.CompletedScrollToCursor],
|
|
103
|
-
execute: ({ paletteId }) => __foldkitBrandViewResult((Effect.suspend(() => __foldkitBrandViewResult((Dom.scrollIntoView(`#${CSS.escape(listIdOf(paletteId))} [aria-selected="true"]`)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~2")).pipe(Effect.ignore, Effect.as(Message.CompletedScrollToCursor()))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#execute"),
|
|
104
|
-
});
|
|
105
|
-
const shownRowOf = (row) => __foldkitBrandViewResult((Option.map(Option.fromNullishOr(row.getAttribute(`data-${ROW_ATTRIBUTE}`)), (rowId) => (__foldkitBrandViewResult(({
|
|
106
|
-
id: rowId,
|
|
107
|
-
isHeld: row.getAttribute("aria-disabled") === "true",
|
|
108
|
-
hasPage: row.hasAttribute(`data-${OPENS_PAGE_ATTRIBUTE}`),
|
|
109
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~3")))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#shownRowOf");
|
|
110
|
-
// The page the palette's render shows and the row it shows the cursor on, from its markup.
|
|
111
|
-
const shownCursorOf = (paletteId) => {
|
|
112
|
-
const find = (selector) => __foldkitBrandViewResult((Option.fromNullishOr(document.querySelector(selector))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#find");
|
|
113
|
-
return __foldkitBrandViewResult(({
|
|
114
|
-
maybeShownPage: Option.flatMap(find(`#${CSS.escape(paletteId)} [data-${PAGE_ATTRIBUTE}]`), shownPageOf),
|
|
115
|
-
maybeRow: Option.flatMap(find(`#${CSS.escape(listIdOf(paletteId))} ${OPTION_SELECTOR}[aria-selected="true"]`), shownRowOf),
|
|
116
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#shownCursorOf");
|
|
117
|
-
};
|
|
118
|
-
/** Reads, once the next render has committed, the row it shows the cursor on while keys wait
|
|
119
|
-
* for it (see `Model`), with the query and waiting arrows the Model had as they waited, so
|
|
120
|
-
* update knows whether that render is still the list. The palette's update returns it as a
|
|
121
|
-
* key waits; in a Scene, resolve it with `Message.CompletedReportPendingKeys`. */
|
|
122
|
-
export const ReportPendingKeys = FoldkitCommand.define("ReportPendingKeys", {
|
|
123
|
-
args: { paletteId: Schema.String, shownQuery: Schema.String, shownShift: Schema.Number },
|
|
124
|
-
messages: [Message.CompletedReportPendingKeys],
|
|
125
|
-
execute: ({ paletteId, shownQuery, shownShift }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
126
|
-
yield* Render.afterCommit;
|
|
127
|
-
const shown = yield* Effect.sync(() => __foldkitBrandViewResult((shownCursorOf(paletteId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~5"));
|
|
128
|
-
return __foldkitBrandViewResult((Message.CompletedReportPendingKeys({ shownQuery, shownShift, ...shown })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~4");
|
|
129
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#execute~2"),
|
|
130
|
-
});
|
|
131
|
-
const scrollPaletteToCursor = (model) => __foldkitBrandViewResult((ScrollToCursor({ paletteId: id(model) })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#scrollPaletteToCursor");
|
|
132
|
-
const reportPendingKeys = (model) => __foldkitBrandViewResult((ReportPendingKeys({
|
|
133
|
-
paletteId: id(model),
|
|
134
|
-
shownQuery: query(model),
|
|
135
|
-
shownShift: model.cursorShift,
|
|
136
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#reportPendingKeys");
|
|
137
|
-
// Focus goes back to the field as the view changes between the commands and a page (the Back
|
|
138
|
-
// button that had it is gone).
|
|
139
|
-
const focusField = (model) => __foldkitBrandViewResult((Focus({ id: fieldId(id(model)) })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#focusField");
|
|
140
|
-
const toClosed = Dialog.OutMessage.match({
|
|
141
|
-
Closed: () => __foldkitBrandViewResult((OutMessage.Closed()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#Closed"),
|
|
142
|
-
});
|
|
143
|
-
const dialogFold = foldDialog(Dialog, {
|
|
144
|
-
read: (model) => __foldkitBrandViewResult((model.dialog), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#read"),
|
|
145
|
-
write: (model, nextDialog) => __foldkitBrandViewResult((modifyFields(model, { dialog: () => __foldkitBrandViewResult((nextDialog), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#dialog") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#write"),
|
|
146
|
-
toParentMessage: (message) => __foldkitBrandViewResult((Message.GotDialogMessage({ message })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#toParentMessage"),
|
|
147
|
-
toParentOutMessage: toClosed,
|
|
148
|
-
});
|
|
149
|
-
const freshPage = (commandId) => (__foldkitBrandViewResult(({
|
|
150
|
-
commandId,
|
|
151
|
-
query: "",
|
|
152
|
-
maybeCursor: Option.none(),
|
|
153
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#freshPage"));
|
|
154
|
-
/** No key waits for the next render (see `Model`). */
|
|
155
|
-
const clearPendingKeys = (model) => __foldkitBrandViewResult((modifyFields(model, { cursorShift: () => __foldkitBrandViewResult((0), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#cursorShift"), isEnterPending: () => __foldkitBrandViewResult((false), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isEnterPending") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#clearPendingKeys");
|
|
156
|
-
const fresh = (model, maybePage) => __foldkitBrandViewResult((clearPendingKeys(modifyFields(model, {
|
|
157
|
-
query: () => __foldkitBrandViewResult((""), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#query~2"),
|
|
158
|
-
maybeCursor: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybeCursor"),
|
|
159
|
-
maybePage: () => __foldkitBrandViewResult((maybePage), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePage"),
|
|
160
|
-
maybePicking: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePicking"),
|
|
161
|
-
}))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#fresh");
|
|
162
|
-
/** Makes the Model follow what the view showed: a page whose command is gone is dropped (with
|
|
163
|
-
* a pick out on it), so the commands' query and cursor take the reader's input again. */
|
|
164
|
-
const followShown = (model, maybeShownPage) => __foldkitBrandViewResult((Equal.equals(maybePageId(model), maybeShownPage)
|
|
165
|
-
? model
|
|
166
|
-
: clearPendingKeys(modifyFields(model, {
|
|
167
|
-
maybePage: () => __foldkitBrandViewResult((Option.map(maybeShownPage, freshPage)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePage~2"),
|
|
168
|
-
maybePicking: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePicking~2"),
|
|
169
|
-
}))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#followShown");
|
|
170
|
-
const modifyPage = (model, modifyOpenPage) => __foldkitBrandViewResult((modifyFields(model, { maybePage: Option.map(modifyOpenPage) })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#modifyPage");
|
|
171
|
-
const unlessPicking = (model, next) => __foldkitBrandViewResult((isPicking(model) ? { model } : next(model)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#unlessPicking");
|
|
172
|
-
const leavePage = (model) => __foldkitBrandViewResult((isPicking(model) || Option.isNone(model.maybePage)
|
|
173
|
-
? { model }
|
|
174
|
-
: {
|
|
175
|
-
model: clearPendingKeys(modifyFields(model, { maybePage: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePage~3") })),
|
|
176
|
-
commands: [focusField(model), scrollPaletteToCursor(model)],
|
|
177
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#leavePage");
|
|
178
|
-
const openPage = (model, commandId) => (__foldkitBrandViewResult(({
|
|
179
|
-
model: clearPendingKeys(modifyFields(model, { maybePage: () => __foldkitBrandViewResult((Option.some(freshPage(commandId))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePage~4") })),
|
|
180
|
-
commands: [focusField(model), scrollPaletteToCursor(model)],
|
|
181
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#openPage"));
|
|
182
|
-
const selectCommand = (model, commandId) => __foldkitBrandViewResult((pipe(dialogFold.close(model), Update.withOutMessage(OutMessage.SelectedCommand({ id: commandId })))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#selectCommand");
|
|
183
|
-
const moveCursor = (model, cursorId) => __foldkitBrandViewResult((modifyFields(Option.match(model.maybePage, {
|
|
184
|
-
onNone: () => __foldkitBrandViewResult((modifyFields(model, { maybeCursor: () => __foldkitBrandViewResult((Option.some(cursorId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybeCursor~2") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~2"),
|
|
185
|
-
onSome: () => __foldkitBrandViewResult((modifyPage(model, (page) => __foldkitBrandViewResult((modifyFields(page, { maybeCursor: () => __foldkitBrandViewResult((Option.some(cursorId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybeCursor~3") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~6"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~2"),
|
|
186
|
-
}), { cursorShift: () => __foldkitBrandViewResult((0), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#cursorShift~2") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#moveCursor");
|
|
187
|
-
// A pick drops the keys waiting for the next render: the row picked is the one acted on.
|
|
188
|
-
const pick = (model, commandId, choiceId) => (__foldkitBrandViewResult(({
|
|
189
|
-
model: clearPendingKeys(modifyFields(moveCursor(model, choiceId), { maybePicking: () => __foldkitBrandViewResult((Option.some(choiceId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePicking~3") })),
|
|
190
|
-
outMessage: OutMessage.SelectedChoice({ commandId, choiceId }),
|
|
191
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pick"));
|
|
192
|
-
// What a click on a row or Enter on the cursor's does: nothing when it is held, else pick it
|
|
193
|
-
// on a page, open its page, or select it. Never while a pick is out: the click and the keys
|
|
194
|
-
// come through `unlessPicking`, and a pick clears the waiting Enter `settlePending` runs.
|
|
195
|
-
const runRow = (model, row) => {
|
|
196
|
-
if (row.isHeld) {
|
|
197
|
-
return __foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#runRow");
|
|
198
|
-
}
|
|
199
|
-
return __foldkitBrandViewResult((Option.match(maybePageId(model), {
|
|
200
|
-
onSome: (commandId) => __foldkitBrandViewResult((pick(model, commandId, row.id)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~3"),
|
|
201
|
-
onNone: () => (__foldkitBrandViewResult((row.hasPage ? openPage(model, row.id) : selectCommand(model, row.id)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~3")),
|
|
202
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#runRow");
|
|
203
|
-
};
|
|
204
|
-
const maybeCurrentCursor = (model) => __foldkitBrandViewResult((Option.match(model.maybePage, {
|
|
205
|
-
onNone: () => __foldkitBrandViewResult((model.maybeCursor), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~4"),
|
|
206
|
-
onSome: (page) => __foldkitBrandViewResult((page.maybeCursor), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~4"),
|
|
207
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybeCurrentCursor");
|
|
208
|
-
const ARROW_STEP = { ArrowUp: -1, ArrowDown: 1 };
|
|
209
|
-
const isListed = (rows, rowId) => __foldkitBrandViewResult((Array.some(rows, (row) => __foldkitBrandViewResult((row.id === rowId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~7"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isListed");
|
|
210
|
-
// NOTE: where the cursor is among the rows a key carries (see `Model`). With no arrows waiting
|
|
211
|
-
// it is the Model's cursor while that row is listed, else the shown one, so each key acts from
|
|
212
|
-
// where the last left it, also when several come before the next render; with arrows waiting,
|
|
213
|
-
// the shown row once the render has applied them. Rows that are not the list: none, and the
|
|
214
|
-
// key waits for the next render.
|
|
215
|
-
const cursorAsShown = (model, shown) => {
|
|
216
|
-
const { rows, maybeShownCursor, shownQuery, shownShift } = shown;
|
|
217
|
-
const isTheList = shownQuery === query(model);
|
|
218
|
-
if (isTheList && model.cursorShift === 0) {
|
|
219
|
-
return __foldkitBrandViewResult((Option.some(Option.orElse(Option.filter(maybeCurrentCursor(model), (rowId) => __foldkitBrandViewResult((isListed(rows, rowId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~8")), () => __foldkitBrandViewResult((maybeShownCursor), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~9")))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#cursorAsShown");
|
|
220
|
-
}
|
|
221
|
-
else if (isTheList && shownShift === model.cursorShift) {
|
|
222
|
-
return __foldkitBrandViewResult((Option.some(maybeShownCursor)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#cursorAsShown");
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
return __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#cursorAsShown");
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
// The cursor moves to a row and the waiting arrows are spent; a waiting Enter asks for the
|
|
229
|
-
// next render again, which shows the cursor on that row.
|
|
230
|
-
const stepTo = (model, rowId) => {
|
|
231
|
-
const moved = moveCursor(model, rowId);
|
|
232
|
-
return __foldkitBrandViewResult(({
|
|
233
|
-
model: moved,
|
|
234
|
-
commands: [
|
|
235
|
-
scrollPaletteToCursor(model),
|
|
236
|
-
...(moved.isEnterPending ? [reportPendingKeys(moved)] : []),
|
|
237
|
-
],
|
|
238
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#stepTo");
|
|
239
|
-
};
|
|
240
|
-
// The row `steps` rows on from the cursor's, held at the ends. Update's arrows, one at a time,
|
|
241
|
-
// and the view's waiting arrows, all at once, both land through this, so they land alike.
|
|
242
|
-
const rowAfter = (rows, maybeFrom, steps) => __foldkitBrandViewResult((pipe(maybeFrom, Option.flatMap((rowId) => __foldkitBrandViewResult((Array.findFirstIndex(rows, (row) => __foldkitBrandViewResult((row.id === rowId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~11"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~10")), Option.flatMap((index) => __foldkitBrandViewResult((Array.get(rows, Math.min(Math.max(index + steps, 0), rows.length - 1))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~12")))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#rowAfter");
|
|
243
|
-
const stepFrom = (model, key, rows, maybeFrom) => __foldkitBrandViewResult((Option.match(rowAfter(rows, maybeFrom, ARROW_STEP[key]), {
|
|
244
|
-
onNone: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~5")),
|
|
245
|
-
onSome: (row) => __foldkitBrandViewResult((stepTo(model, row.id)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~5"),
|
|
246
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#stepFrom");
|
|
247
|
-
// An arrow that cannot name a row yet waits for the next render, which applies it from the
|
|
248
|
-
// cursor's row (see `Model`).
|
|
249
|
-
const pendArrow = (model, key) => {
|
|
250
|
-
const pending = modifyFields(model, { cursorShift: (shift) => __foldkitBrandViewResult((shift + ARROW_STEP[key]), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#cursorShift~3") });
|
|
251
|
-
return __foldkitBrandViewResult(({ model: pending, commands: [scrollPaletteToCursor(model), reportPendingKeys(pending)] }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pendArrow");
|
|
252
|
-
};
|
|
253
|
-
// An arrow steps one row from the cursor as its render showed it, and stops at the ends.
|
|
254
|
-
const pressArrow = (model, key, shown) => __foldkitBrandViewResult((Option.match(cursorAsShown(model, shown), {
|
|
255
|
-
onNone: () => __foldkitBrandViewResult((pendArrow(model, key)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~6"),
|
|
256
|
-
onSome: (maybeFrom) => __foldkitBrandViewResult((stepFrom(model, key, shown.rows, maybeFrom)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~6"),
|
|
257
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pressArrow");
|
|
258
|
-
const pendEnter = (model) => {
|
|
259
|
-
const pending = modifyFields(model, { isEnterPending: () => __foldkitBrandViewResult((true), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isEnterPending~2") });
|
|
260
|
-
return __foldkitBrandViewResult(({ model: pending, commands: [reportPendingKeys(pending)] }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pendEnter");
|
|
261
|
-
};
|
|
262
|
-
// An Enter acts on the cursor's row as its render showed it, or waits for the next render.
|
|
263
|
-
const pressEnter = (model, shown) => __foldkitBrandViewResult((Option.match(cursorAsShown(model, shown), {
|
|
264
|
-
onNone: () => __foldkitBrandViewResult((pendEnter(model)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~7"),
|
|
265
|
-
onSome: (maybeRowId) => __foldkitBrandViewResult((pipe(maybeRowId, Option.flatMap((rowId) => __foldkitBrandViewResult((Array.findFirst(shown.rows, (row) => __foldkitBrandViewResult((row.id === rowId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~14"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~13")), Option.match({ onNone: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~8")), onSome: (row) => __foldkitBrandViewResult((runRow(model, row)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~8") }))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~7"),
|
|
266
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pressEnter");
|
|
267
|
-
const isPending = (model) => __foldkitBrandViewResult((model.cursorShift !== 0 || model.isEnterPending), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isPending");
|
|
268
|
-
// A report settles the waiting keys (see `Model`) only from the render the Model is at. One from
|
|
269
|
-
// a render it has moved on from (another page, query or count of arrows) is left: the key that
|
|
270
|
-
// moved it on cleared the waiting keys or asked again.
|
|
271
|
-
const settlePending = (model, report) => {
|
|
272
|
-
const { maybeShownPage, shownQuery, shownShift, maybeRow } = report;
|
|
273
|
-
const isCurrent = Equal.equals(maybePageId(model), maybeShownPage) &&
|
|
274
|
-
shownShift === model.cursorShift &&
|
|
275
|
-
shownQuery === query(model);
|
|
276
|
-
if (!isPending(model) || !isCurrent) {
|
|
277
|
-
return __foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#settlePending");
|
|
278
|
-
}
|
|
279
|
-
const settled = clearPendingKeys(model);
|
|
280
|
-
return __foldkitBrandViewResult((Option.match(maybeRow, {
|
|
281
|
-
onNone: () => (__foldkitBrandViewResult(({ model: settled }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~9")),
|
|
282
|
-
onSome: (row) => {
|
|
283
|
-
const moved = moveCursor(settled, row.id);
|
|
284
|
-
const ran = model.isEnterPending ? runRow(moved, row) : { model: moved };
|
|
285
|
-
return __foldkitBrandViewResult(({ ...ran, commands: [scrollPaletteToCursor(model), ...(ran.commands ?? [])] }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~9");
|
|
286
|
-
},
|
|
287
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#settlePending");
|
|
288
|
-
};
|
|
289
|
-
const updateQuery = (model, value) => __foldkitBrandViewResult((clearPendingKeys(Option.match(model.maybePage, {
|
|
290
|
-
onNone: () => __foldkitBrandViewResult((modifyFields(model, { query: () => __foldkitBrandViewResult((value), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#query~3"), maybeCursor: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybeCursor~4") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~10"),
|
|
291
|
-
onSome: () => __foldkitBrandViewResult((modifyPage(model, (page) => __foldkitBrandViewResult((modifyFields(page, { query: () => __foldkitBrandViewResult((value), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#query~4"), maybeCursor: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybeCursor~5") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~15"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~10"),
|
|
292
|
-
}))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#updateQuery");
|
|
293
|
-
/** Processes a command palette Message and returns the next Model, Commands and OutMessage. */
|
|
294
|
-
export const update = (model, message) => __foldkitBrandViewResult((Message.match(message, {
|
|
295
|
-
GotDialogMessage: ({ message: dialogMessage }) => __foldkitBrandViewResult((dialogFold.update(model, dialogMessage)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#GotDialogMessage"),
|
|
296
|
-
UpdatedQuery: ({ value, maybeShownPage }) => __foldkitBrandViewResult((unlessPicking(followShown(model, maybeShownPage), (shown) => (__foldkitBrandViewResult(({
|
|
297
|
-
model: updateQuery(shown, value),
|
|
298
|
-
commands: [scrollPaletteToCursor(shown)],
|
|
299
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~16")))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#UpdatedQuery"),
|
|
300
|
-
PressedArrowKey: ({ key, maybeShownPage, ...shown }) => __foldkitBrandViewResult((unlessPicking(followShown(model, maybeShownPage), (current) => __foldkitBrandViewResult((pressArrow(current, key, shown)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~17"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#PressedArrowKey"),
|
|
301
|
-
PressedEarlyArrowKey: ({ key }) => __foldkitBrandViewResult((unlessPicking(model, (current) => __foldkitBrandViewResult((pendArrow(current, key)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~18"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#PressedEarlyArrowKey"),
|
|
302
|
-
CompletedReportPendingKeys: (report) => __foldkitBrandViewResult((settlePending(model, report)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#CompletedReportPendingKeys"),
|
|
303
|
-
PressedEnter: ({ maybeShownPage, ...shown }) => __foldkitBrandViewResult((unlessPicking(followShown(model, maybeShownPage), (current) => __foldkitBrandViewResult((pressEnter(current, shown)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~19"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#PressedEnter"),
|
|
304
|
-
PressedEarlyEnter: () => __foldkitBrandViewResult((unlessPicking(model, pendEnter)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#PressedEarlyEnter"),
|
|
305
|
-
PressedBackspace: ({ maybeShownPage }) => __foldkitBrandViewResult((leavePage(followShown(model, maybeShownPage))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#PressedBackspace"),
|
|
306
|
-
ClickedRow: ({ row, maybeShownPage }) => __foldkitBrandViewResult((unlessPicking(followShown(model, maybeShownPage), (current) => __foldkitBrandViewResult((runRow(current, row)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~20"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#ClickedRow"),
|
|
307
|
-
ClickedBack: () => __foldkitBrandViewResult((leavePage(model)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#ClickedBack"),
|
|
308
|
-
CompletedScrollToCursor: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#CompletedScrollToCursor")),
|
|
309
|
-
CompletedFocus: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#CompletedFocus")),
|
|
310
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#update");
|
|
311
|
-
/** Opens the palette on the commands, with an empty field and the cursor on the first row.
|
|
312
|
-
* Snapshot what the commands act on (the selected item, its title for `scope`) in the
|
|
313
|
-
* caller's Model as it opens, and build `commands` from that snapshot until it closes. */
|
|
314
|
-
export const open = (model) => __foldkitBrandViewResult((dialogFold.open(fresh(model, Option.none()))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#open");
|
|
315
|
-
/** Opens the palette straight on a command's page. Back still leads to the commands. */
|
|
316
|
-
export const openAt = (model, config) => __foldkitBrandViewResult((dialogFold.open(fresh(model, Option.some(freshPage(config.commandId))))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#openAt");
|
|
317
|
-
/** The caller applied the choice: the palette closes. An answer for a pick that is no longer
|
|
318
|
-
* out (the palette was dismissed, its page left, or a newer pick replaced it) changes
|
|
319
|
-
* nothing; the caller keeps the write it made. */
|
|
320
|
-
export const pickSucceeded = (model, choiceId) => __foldkitBrandViewResult((Option.contains(model.maybePicking, choiceId)
|
|
321
|
-
? dialogFold.close(fresh(model, Option.none()))
|
|
322
|
-
: { model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pickSucceeded");
|
|
323
|
-
/** The caller refused the choice: the page stays with its query, focus and the cursor on that
|
|
324
|
-
* choice; say why in the view's `toDetailView`. An answer for a pick that is no longer out
|
|
325
|
-
* changes nothing. */
|
|
326
|
-
export const pickFailed = (model, choiceId) => __foldkitBrandViewResult((Option.contains(model.maybePicking, choiceId)
|
|
327
|
-
? { model: modifyFields(model, { maybePicking: () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybePicking~4") }) }
|
|
328
|
-
: { model }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pickFailed");
|
|
329
|
-
// SUBSCRIPTIONS
|
|
330
|
-
const earlyKeySubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResult(({
|
|
331
|
-
earlyKeys: entry({ maybeOpenId: Schema.Option(Schema.String) }, {
|
|
332
|
-
modelToDependencies: (model) => (__foldkitBrandViewResult(({
|
|
333
|
-
maybeOpenId: isOpen(model) ? Option.some(id(model)) : Option.none(),
|
|
334
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#modelToDependencies")),
|
|
335
|
-
dependenciesToStream: ({ maybeOpenId }) => __foldkitBrandViewResult((Option.match(maybeOpenId, { onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~11"), onSome: earlyKeys })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#dependenciesToStream"),
|
|
336
|
-
}),
|
|
337
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~21")));
|
|
338
|
-
/** While the palette is open, takes ↑ ↓ and Enter pressed before its field has focus (the
|
|
339
|
-
* field's own are the view's), on the window, before the page's own key bindings see them,
|
|
340
|
-
* so the keys pressed straight after the one that opened it are not lost. Lift it into the
|
|
341
|
-
* application's Subscriptions, once per palette, with a key prefix of the parent's that no
|
|
342
|
-
* other record on the page uses: `subscriptions("palette")` is keyed `paletteEarlyKeys`. */
|
|
343
|
-
export const subscriptions = (keyPrefix) => __foldkitBrandViewResult((prefixKeys(keyPrefix, earlyKeySubscriptions)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#subscriptions");
|
|
344
|
-
const pageOf = (commands, state) => __foldkitBrandViewResult((pipe(Array.findFirst(commands, (command) => __foldkitBrandViewResult((command.id === state.commandId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~22")), Option.flatMap((command) => __foldkitBrandViewResult((Option.fromNullishOr(command.page)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~23")), Option.map((page) => (__foldkitBrandViewResult(({ page, state }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~24"))))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#pageOf");
|
|
345
|
-
const firstListed = (rows, candidates) => __foldkitBrandViewResult((Array.findFirst(Array.getSomes(candidates), (cursorId) => __foldkitBrandViewResult((isListed(rows, cursorId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~25"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#firstListed");
|
|
346
|
-
const firstId = (rows) => __foldkitBrandViewResult((Option.map(Array.head(rows), (row) => __foldkitBrandViewResult((row.id), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~26"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#firstId");
|
|
347
|
-
const shifted = (shown, shift) => (__foldkitBrandViewResult(({
|
|
348
|
-
...shown,
|
|
349
|
-
maybeCursorId: Option.map(rowAfter(shown.rows, shown.maybeCursorId, shift), (row) => __foldkitBrandViewResult((row.id), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~27")),
|
|
350
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#shifted"));
|
|
351
|
-
// NOTE: arrows waiting for the view count from the cursor's row. When that row has left the
|
|
352
|
-
// list (the application changed it in between), they are dropped rather than counted from
|
|
353
|
-
// another row.
|
|
354
|
-
const shownOf = (model, commands) => {
|
|
355
|
-
const unshifted = unshiftedOf(model, commands);
|
|
356
|
-
const isAnchored = Option.match(maybeCurrentCursor(model), {
|
|
357
|
-
onNone: () => __foldkitBrandViewResult((true), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~12"),
|
|
358
|
-
onSome: (rowId) => __foldkitBrandViewResult((Option.contains(unshifted.maybeCursorId, rowId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~11"),
|
|
359
|
-
});
|
|
360
|
-
return __foldkitBrandViewResult((isAnchored ? shifted(unshifted, model.cursorShift) : unshifted), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#shownOf");
|
|
361
|
-
};
|
|
362
|
-
// What the view shows of the Model with `commands`: the open page while its command is
|
|
363
|
-
// listed, the rows its query finds (on a tree page, with the rows they sit under), and the
|
|
364
|
-
// cursor's row: the row the reader moved it to while that row is listed, else the page's
|
|
365
|
-
// `start`, else its `current`, else the first row, these three only among the rows the query
|
|
366
|
-
// finds; none when nothing is listed.
|
|
367
|
-
const unshiftedOf = (model, commands) => {
|
|
368
|
-
const maybePage = Option.flatMap(model.maybePage, (state) => __foldkitBrandViewResult((pageOf(commands, state)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~28"));
|
|
369
|
-
return __foldkitBrandViewResult((Option.match(maybePage, {
|
|
370
|
-
onNone: () => {
|
|
371
|
-
const rows = findCommands(commands, model.query);
|
|
372
|
-
return __foldkitBrandViewResult(({
|
|
373
|
-
maybePage,
|
|
374
|
-
rows,
|
|
375
|
-
contextIds: HashSet.empty(),
|
|
376
|
-
maybeCursorId: pipe(Option.filter(model.maybeCursor, (rowId) => __foldkitBrandViewResult((isListed(rows, rowId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~29")), Option.orElse(() => __foldkitBrandViewResult((firstId(rows)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~30"))),
|
|
377
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~13");
|
|
378
|
-
},
|
|
379
|
-
onSome: ({ page, state }) => {
|
|
380
|
-
const { rows, found, contextIds } = pageChoices(page, state.query);
|
|
381
|
-
return __foldkitBrandViewResult(({
|
|
382
|
-
maybePage,
|
|
383
|
-
rows,
|
|
384
|
-
contextIds,
|
|
385
|
-
maybeCursorId: pipe(Option.filter(state.maybeCursor, (rowId) => __foldkitBrandViewResult((isListed(rows, rowId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~31")), Option.orElse(() => __foldkitBrandViewResult((firstListed(found, [
|
|
386
|
-
Option.fromNullishOr(page.start),
|
|
387
|
-
Option.fromNullishOr(page.current),
|
|
388
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~32")), Option.orElse(() => __foldkitBrandViewResult((firstId(found)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~33"))),
|
|
389
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~12");
|
|
390
|
-
},
|
|
391
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#unshiftedOf");
|
|
392
|
-
};
|
|
393
|
-
/** The row the cursor is on as the view shows it with `commands`: the row the reader moved it
|
|
394
|
-
* to while that row is listed, else the page's `start` or `current` while the query finds it,
|
|
395
|
-
* else the first row the query finds; none when nothing is listed. Compare it before and after
|
|
396
|
-
* the caller's commands change to know when the cursor fell to another row (its row left) and
|
|
397
|
-
* should be scrolled into view with `ScrollToCursor`; a cursor whose row is still listed keeps
|
|
398
|
-
* it, and the list its scroll. */
|
|
399
|
-
export const maybeCursorId = (model, commands) => __foldkitBrandViewResult((shownOf(model, commands).maybeCursorId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#maybeCursorId");
|
|
400
|
-
const isCommand = (row) => __foldkitBrandViewResult(("group" in row), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isCommand");
|
|
401
|
-
const isCurrentRow = (shown, row) => __foldkitBrandViewResult((Option.exists(shown.maybePage, ({ page }) => __foldkitBrandViewResult((page.current === row.id), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~34"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isCurrentRow");
|
|
402
|
-
const isContextRow = (shown, row) => __foldkitBrandViewResult((HashSet.has(shown.contextIds, row.id)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#isContextRow");
|
|
403
|
-
const levelOf = (row) => __foldkitBrandViewResult(("level" in row ? Option.fromNullishOr(row.level) : Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#levelOf");
|
|
404
|
-
// What a row is as this render shows it, which Enter acts on as a click would.
|
|
405
|
-
const shownRowFor = (shown, row) => (__foldkitBrandViewResult(({
|
|
406
|
-
id: row.id,
|
|
407
|
-
isHeld: row.isDisabled === true || isCurrentRow(shown, row),
|
|
408
|
-
hasPage: isCommand(row) && row.page !== undefined,
|
|
409
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#shownRowFor"));
|
|
410
|
-
// The query the shown rows were found by: the open page's, or the commands' when the view
|
|
411
|
-
// shows them (also for a page whose command left).
|
|
412
|
-
const shownQueryOf = (model, shown) => __foldkitBrandViewResult((Option.match(shown.maybePage, { onNone: () => __foldkitBrandViewResult((model.query), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~14"), onSome: ({ state }) => __foldkitBrandViewResult((state.query), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~13") })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#shownQueryOf");
|
|
413
|
-
// The command whose page the view shows.
|
|
414
|
-
const shownPageIdOf = (shown) => __foldkitBrandViewResult((Option.map(shown.maybePage, ({ state }) => __foldkitBrandViewResult((state.commandId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~35"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#shownPageIdOf");
|
|
415
|
-
// NOTE: the field's keys that act on the rows are taken here, where the rows are known, as a
|
|
416
|
-
// Mount on the document cannot know them: ↑, ↓ and Enter carry what this render shows (see
|
|
417
|
-
// `Model`), and each is taken from the field (its default prevented). A modified key and every
|
|
418
|
-
// key while a pick is out are left to the field.
|
|
419
|
-
const fieldKeyDown = (model, shown) => __foldkitBrandViewResult(((key, modifiers) => {
|
|
420
|
-
const list = {
|
|
421
|
-
rows: Array.map(shown.rows, (row) => __foldkitBrandViewResult((shownRowFor(shown, row)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~37")),
|
|
422
|
-
maybeShownCursor: shown.maybeCursorId,
|
|
423
|
-
maybeShownPage: shownPageIdOf(shown),
|
|
424
|
-
shownQuery: shownQueryOf(model, shown),
|
|
425
|
-
shownShift: model.cursorShift,
|
|
426
|
-
};
|
|
427
|
-
return __foldkitBrandViewResult((isPicking(model) || !isPlain(modifiers)
|
|
428
|
-
? Option.none()
|
|
429
|
-
: Match.value(key).pipe(Match.withReturnType(), Match.whenOr("ArrowDown", "ArrowUp", (arrow) => __foldkitBrandViewResult((Option.some(Message.PressedArrowKey({ key: arrow, ...list }))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~38")), Match.when("Enter", () => __foldkitBrandViewResult((Option.some(Message.PressedEnter(list))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~39")), Match.orElse(() => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~40")))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~36");
|
|
430
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#fieldKeyDown");
|
|
431
|
-
const optionId = (paletteId, index) => __foldkitBrandViewResult((`${paletteId}-option-${index}`), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#optionId");
|
|
432
|
-
const NOTHING_FOUND = "nothing matches · try fewer letters";
|
|
433
|
-
const COMMANDS_FOOT = "↑ ↓ move · enter runs · esc closes";
|
|
434
|
-
const PAGE_FOOT = "↑ ↓ move · enter picks · ⌫ back · esc closes";
|
|
435
|
-
const resultWord = (count) => (__foldkitBrandViewResult((count === 1 ? "result" : "results"), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#resultWord"));
|
|
436
|
-
const countWords = (count) => __foldkitBrandViewResult((count === 0 ? "Nothing matches." : `${count.toLocaleString(LOCALE)} ${resultWord(count)}.`), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#countWords");
|
|
437
|
-
const rowPartsView = (model, shown, row, h) => {
|
|
438
|
-
const hint = row.isDisabled === true ? (row.reason ?? row.hint) : row.hint;
|
|
439
|
-
const opens = h.span([h.Class("glyph opens"), h.AriaHidden(true)], [Glyph.view({ name: "caret-right" }, h)]);
|
|
440
|
-
return __foldkitBrandViewResult(([
|
|
441
|
-
...(row.glyph === undefined
|
|
442
|
-
? []
|
|
443
|
-
: [h.span([h.Class("glyph")], [Glyph.view({ name: row.glyph }, h)])]),
|
|
444
|
-
h.span([h.Class("palette-label")], [
|
|
445
|
-
row.label,
|
|
446
|
-
...(isContextRow(shown, row) ? [h.span([h.Class("sr-only")], [" (context)"])] : []),
|
|
447
|
-
]),
|
|
448
|
-
...(Option.contains(model.maybePicking, row.id)
|
|
449
|
-
? [h.span([h.Class("cursor"), h.AriaHidden(true)])]
|
|
450
|
-
: []),
|
|
451
|
-
...(isCurrentRow(shown, row) ? [h.span([h.Class("tag")], ["current"])] : []),
|
|
452
|
-
...(hint === undefined ? [] : [h.span([h.Class("hint")], [hint])]),
|
|
453
|
-
...(shownRowFor(shown, row).hasPage ? [opens] : []),
|
|
454
|
-
]), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#rowPartsView");
|
|
455
|
-
};
|
|
456
|
-
const rowView = (model, shown, row, index, h) => {
|
|
457
|
-
const shownRow = shownRowFor(shown, row);
|
|
458
|
-
return __foldkitBrandViewResult((h.keyed("div")(row.id, [
|
|
459
|
-
h.Id(optionId(id(model), index)),
|
|
460
|
-
h.Role("option"),
|
|
461
|
-
h.AriaSelected(Option.contains(shown.maybeCursorId, row.id)),
|
|
462
|
-
...(shownRow.isHeld ? [h.AriaDisabled(true)] : []),
|
|
463
|
-
h.DataAttribute(ROW_ATTRIBUTE, row.id),
|
|
464
|
-
...(shownRow.hasPage ? [h.DataAttribute(OPENS_PAGE_ATTRIBUTE, "")] : []),
|
|
465
|
-
h.Class(Array.join([
|
|
466
|
-
"palette-row",
|
|
467
|
-
...(row.isAuthored === true ? ["authored"] : []),
|
|
468
|
-
...(isContextRow(shown, row) ? ["context"] : []),
|
|
469
|
-
], " ")),
|
|
470
|
-
...Option.match(levelOf(row), {
|
|
471
|
-
onNone: () => __foldkitBrandViewResult(([]), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~15"),
|
|
472
|
-
onSome: (level) => __foldkitBrandViewResult(([h.Style({ "--palette-level": `${level}` })]), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~14"),
|
|
473
|
-
}),
|
|
474
|
-
...(shownRow.isHeld || isPicking(model)
|
|
475
|
-
? []
|
|
476
|
-
: [h.OnClick(Message.ClickedRow({ row: shownRow, maybeShownPage: shownPageIdOf(shown) }))]),
|
|
477
|
-
], rowPartsView(model, shown, row, h))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#rowView");
|
|
478
|
-
};
|
|
479
|
-
const groupedRows = (model, shown, h) => {
|
|
480
|
-
const indexed = Array.map(shown.rows, (row, index) => (__foldkitBrandViewResult(({ row, index }), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~41")));
|
|
481
|
-
return __foldkitBrandViewResult((Option.match(shown.maybePage, {
|
|
482
|
-
onSome: () => __foldkitBrandViewResult((Array.map(indexed, ({ row, index }) => __foldkitBrandViewResult((rowView(model, shown, row, index, h)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~42"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~15"),
|
|
483
|
-
onNone: () => {
|
|
484
|
-
const groups = Array.dedupe(Array.map(shown.rows, (row) => (__foldkitBrandViewResult((isCommand(row) ? row.group : ""), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~43"))));
|
|
485
|
-
return __foldkitBrandViewResult((Array.map(groups, (group, groupIndex) => {
|
|
486
|
-
const headingId = `${id(model)}-group-${groupIndex}`;
|
|
487
|
-
return __foldkitBrandViewResult((h.keyed("div")(`group-${group}`, [h.Role("group"), h.AriaLabelledBy(headingId)], [
|
|
488
|
-
h.div([h.Id(headingId), h.Role("presentation"), h.Class("palette-group")], [group]),
|
|
489
|
-
...Array.map(Array.filter(indexed, ({ row }) => __foldkitBrandViewResult((isCommand(row) && row.group === group), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~45")), ({ row, index }) => __foldkitBrandViewResult((rowView(model, shown, row, index, h)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~46")),
|
|
490
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~44");
|
|
491
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~16");
|
|
492
|
-
},
|
|
493
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#groupedRows");
|
|
494
|
-
};
|
|
495
|
-
const comboboxAttributes = (model, shown, noun, h) => {
|
|
496
|
-
const paletteId = id(model);
|
|
497
|
-
const maybeCursorIndex = Option.flatMap(shown.maybeCursorId, (cursorId) => __foldkitBrandViewResult((Array.findFirstIndex(shown.rows, (row) => __foldkitBrandViewResult((row.id === cursorId), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~48"))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~47"));
|
|
498
|
-
return __foldkitBrandViewResult(([
|
|
499
|
-
h.OnKeyDownPreventDefault(fieldKeyDown(model, shown)),
|
|
500
|
-
h.Role("combobox"),
|
|
501
|
-
h.AriaExpanded(true),
|
|
502
|
-
h.AriaControls(listIdOf(paletteId)),
|
|
503
|
-
h.AriaAutocomplete("list"),
|
|
504
|
-
...Option.toArray(Option.map(maybeCursorIndex, (index) => __foldkitBrandViewResult((h.AriaActiveDescendant(optionId(paletteId, index))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~49"))),
|
|
505
|
-
h.AriaLabel(Option.match(shown.maybePage, {
|
|
506
|
-
onNone: () => __foldkitBrandViewResult((`Command or ${noun}`), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~17"),
|
|
507
|
-
onSome: ({ page }) => __foldkitBrandViewResult((page.title), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~16"),
|
|
508
|
-
})),
|
|
509
|
-
h.Autocomplete("off"),
|
|
510
|
-
h.DataAttribute(FIELD_ATTRIBUTE, ""),
|
|
511
|
-
]), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#comboboxAttributes");
|
|
512
|
-
};
|
|
513
|
-
const fieldView = (model, shown, noun, render, h) => {
|
|
514
|
-
const maybeShownPage = shownPageIdOf(shown);
|
|
515
|
-
return __foldkitBrandViewResult((UiInput.view({
|
|
516
|
-
id: fieldId(id(model)),
|
|
517
|
-
value: shownQueryOf(model, shown),
|
|
518
|
-
onInput: (value) => __foldkitBrandViewResult((Message.UpdatedQuery({ value, maybeShownPage })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onInput"),
|
|
519
|
-
isReadOnly: isPicking(model),
|
|
520
|
-
placeholder: Option.match(shown.maybePage, {
|
|
521
|
-
onNone: () => __foldkitBrandViewResult((`type a command or a ${noun}`), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~18"),
|
|
522
|
-
onSome: ({ page }) => __foldkitBrandViewResult((page.find ?? "type to narrow"), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~17"),
|
|
523
|
-
}),
|
|
524
|
-
toView: (groups) => __foldkitBrandViewResult((h.input([
|
|
525
|
-
...render.initialFocus,
|
|
526
|
-
...groups.input,
|
|
527
|
-
...comboboxAttributes(model, shown, noun, h),
|
|
528
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#toView"),
|
|
529
|
-
}, h)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#fieldView");
|
|
530
|
-
};
|
|
531
|
-
const headView = (model, shown, scope, field, h) => __foldkitBrandViewResult((h.div([h.Class("palette-q field")], [
|
|
532
|
-
...Option.toArray(Option.map(shown.maybePage, () => __foldkitBrandViewResult((IconButton.view({
|
|
533
|
-
glyph: "arrow-left",
|
|
534
|
-
label: "Back",
|
|
535
|
-
isQuiet: true,
|
|
536
|
-
isDisabled: isPicking(model),
|
|
537
|
-
onClick: Message.ClickedBack(),
|
|
538
|
-
}, h)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~50"))),
|
|
539
|
-
h.span([h.Class("palette-scope")], [scope]),
|
|
540
|
-
...Option.toArray(Option.map(shown.maybePage, ({ page }) => __foldkitBrandViewResult((h.span([h.Class("palette-title")], [page.title])), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~51"))),
|
|
541
|
-
field,
|
|
542
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#headView");
|
|
543
|
-
const listView = (model, shown, h) => __foldkitBrandViewResult((h.div([
|
|
544
|
-
h.Id(listIdOf(id(model))),
|
|
545
|
-
h.Role("listbox"),
|
|
546
|
-
h.AriaLabel(Option.match(shown.maybePage, {
|
|
547
|
-
onNone: () => __foldkitBrandViewResult(("Results"), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~19"),
|
|
548
|
-
onSome: ({ page }) => __foldkitBrandViewResult((page.title), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~18"),
|
|
549
|
-
})),
|
|
550
|
-
...(isPicking(model) ? [h.AriaBusy(true)] : []),
|
|
551
|
-
h.Class("palette-list"),
|
|
552
|
-
], Array.match(shown.rows, {
|
|
553
|
-
onEmpty: () => __foldkitBrandViewResult(([h.div([h.Role("presentation"), h.Class("palette-group")], [NOTHING_FOUND])]), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onEmpty"),
|
|
554
|
-
onNonEmpty: () => __foldkitBrandViewResult((groupedRows(model, shown, h)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNonEmpty"),
|
|
555
|
-
}))), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#listView");
|
|
556
|
-
// The count is said once a query is typed: the status is mounted empty as the card opens (a
|
|
557
|
-
// status mounted holding its words goes unheard), and the rows an empty field lists need no
|
|
558
|
-
// count.
|
|
559
|
-
const countView = (model, shown, h) => {
|
|
560
|
-
const shownQuery = shownQueryOf(model, shown);
|
|
561
|
-
return __foldkitBrandViewResult((h.div([h.Role("status"), h.Class("sr-only")], String.isEmpty(shownQuery)
|
|
562
|
-
? []
|
|
563
|
-
: [countWords(shown.rows.length - HashSet.size(shown.contextIds))])), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#countView");
|
|
564
|
-
};
|
|
565
|
-
const cardView = (model, viewInputs, render, h) => {
|
|
566
|
-
const { commands, scope = "commands", noun = "title", toDetailView = () => __foldkitBrandViewResult(([]), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~52") } = viewInputs;
|
|
567
|
-
const shown = shownOf(model, commands);
|
|
568
|
-
return __foldkitBrandViewResult((h.div([
|
|
569
|
-
...Option.toArray(Option.map(shownPageIdOf(shown), (commandId) => __foldkitBrandViewResult((h.DataAttribute(PAGE_ATTRIBUTE, commandId)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~53"))),
|
|
570
|
-
h.OnMount(BindPaletteKeys()),
|
|
571
|
-
h.Class("card palette"),
|
|
572
|
-
], [
|
|
573
|
-
headView(model, shown, scope, fieldView(model, shown, noun, render, h), h),
|
|
574
|
-
...slotView("div", "palette-detail", toDetailView(), h),
|
|
575
|
-
listView(model, shown, h),
|
|
576
|
-
countView(model, shown, h),
|
|
577
|
-
h.div([h.Class("palette-more")], [Option.match(shown.maybePage, { onNone: () => __foldkitBrandViewResult((COMMANDS_FOOT), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onNone~20"), onSome: () => __foldkitBrandViewResult((PAGE_FOOT), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#onSome~19") })]),
|
|
578
|
-
])), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#cardView");
|
|
579
|
-
};
|
|
580
|
-
/**
|
|
581
|
-
* Type to find a command or a title; one inverted cursor row, moved by ↑ and ↓ only
|
|
582
|
-
* (stopping at the ends; the pointer shades a row but never moves the cursor); Enter or a
|
|
583
|
-
* click selects it, and the palette closes first so what the command opens takes focus. A
|
|
584
|
-
* command with a page opens that page in place: Back, or Backspace in an empty field, returns
|
|
585
|
-
* to the commands with their query and cursor as they were. The choice in force is tagged
|
|
586
|
-
* current and cannot be picked; a picked choice holds the page until the caller answers. Once
|
|
587
|
-
* a query is typed, a polite status says how many rows it finds. Escape closes the whole
|
|
588
|
-
* palette.
|
|
589
|
-
*
|
|
590
|
-
* A pixel-paper Dialog (named "Commands", hung near the top) holding a field built on
|
|
591
|
-
* `@foldkit/ui`'s Input as an ARIA combobox (`aria-activedescendant` on the cursor's row) over
|
|
592
|
-
* an always open `role="listbox"` of `role="option"` rows, grouped under their headings.
|
|
593
|
-
*/
|
|
594
|
-
// NOTE: @foldkit/ui gap: Combobox's popup does not fit an always open list in a card, so the
|
|
595
|
-
// palette is not built on it. Its list is a popup anchored under the field (portaled
|
|
596
|
-
// unless told not to) behind a press-catcher, hidden until positioned; its cursor is an index
|
|
597
|
-
// that wraps and passes disabled rows; pointer movement moves it; leaving the field closes
|
|
598
|
-
// it; and its Escape is handled (default prevented), so the Dialog never sees the Escape that
|
|
599
|
-
// must close the whole palette.
|
|
600
|
-
export const view = defineView((model, viewInputs, h) => __foldkitBrandViewResult((h.submodel({
|
|
601
|
-
slotId: id(model),
|
|
602
|
-
model: model.dialog,
|
|
603
|
-
view: Dialog.view,
|
|
604
|
-
viewInputs: {
|
|
605
|
-
label: "Commands",
|
|
606
|
-
placement: "Top",
|
|
607
|
-
toLiveRegionView: viewInputs.toLiveRegionView,
|
|
608
|
-
toView: (render) => __foldkitBrandViewResult((cardView(model, viewInputs, render, h)), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#toView~2"),
|
|
609
|
-
},
|
|
610
|
-
toParentMessage: (message) => __foldkitBrandViewResult((Message.GotDialogMessage({ message })), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#toParentMessage~2"),
|
|
611
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/commandPalette/commandPalette.js#anonymous~54"));
|