@gjermundgaraba-designs/pixel-paper 0.26.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 +1 -8
- 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 +6 -6
- 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
package/DESIGN.md
CHANGED
|
@@ -1239,7 +1239,7 @@ Palette: with no `data-scheme` the page follows `prefers-color-scheme`, live, in
|
|
|
1239
1239
|
|
|
1240
1240
|
How a component in this package is made. The components follow these rules, and a new one follows them too; a review finding against one of them is a defect, not a style note.
|
|
1241
1241
|
|
|
1242
|
-
**The two kinds.** A **View** is a stateless render helper, `X.view(config, h)`: the caller owns any state and passes its Messages in the config. Copy `src/button/`, `src/notice/` or `src/card/` (a container with slots). A **Submodel** has a Model, Message, OutMessage, `init`, `update` and a `view` made with `defineView`, embedded with `h.submodel`. Build it over the matching `@foldkit/ui` component when there is one and it fits; one that would need more than one `@foldkit/ui gap` note to fit (the Reel, beside DragAndDrop) holds its own state. Copy `src/dialog/` (over a `@foldkit/ui` component, with a Mount that reads real key events), `src/
|
|
1242
|
+
**The two kinds.** A **View** is a stateless render helper, `X.view(config, h)`: the caller owns any state and passes its Messages in the config. Copy `src/button/`, `src/notice/` or `src/card/` (a container with slots). A **Submodel** has a Model, Message, OutMessage, `init`, `update` and a `view` made with `defineView`, embedded with `h.submodel`. Build it over the matching `@foldkit/ui` component when there is one and it fits; one that would need more than one `@foldkit/ui gap` note to fit (the Reel, beside DragAndDrop) holds its own state. Copy `src/dialog/` (over a `@foldkit/ui` component, with a Mount that reads real key events), `src/confirm-dialog/` (over another Submodel, with OutMessages) or `src/key-help/` (with its own Subscription). Clocks come from the Model (`Time.clockEntry`), keys from `Dom.streamFromKeyBindings`, and browser services through an Effect service the application provides as a Layer in its `resources` (CopyButton's `Clipboard`, from `@effect/platform-browser`); a Command that only touches the page it runs in does so directly, inside its Effect (SchemeSwitch's `PinScheme`).
|
|
1243
1243
|
|
|
1244
1244
|
Each component is `src/<name>/<name>.ts` with an explicit `index.ts`, a colocated `<name>.test.ts` (a Story for update, a Scene for view), an `export * as` line in `src/index.ts`, a section with an example file on the specimen's components page (`site/src/example/`, and its name in `site/src/covers.ts`, which a test holds against `src/index.ts`), and an entry in this document. The `index.ts` is the namespace's public surface and nothing more: `view` and its config types, and for a Submodel its Model, Message, `init`, `update`, Commands, Mounts and accessors. Only `src/index.ts` imports it: inside `src/` a file, a test included, imports the file that defines what it needs (`../button/button.ts`, `../glyph/glyphs.ts`). What several components share and no application imports has a folder with no index: `src/attributes/` (the `Attributes` type), `src/slot/` (`slotView`, an optional slot in its one element), `src/locale/`, `src/keys/`, `src/subscription/`. `src/focus/` has one: its `Focus` Command, which focuses an element by id, is a namespace of its own for the application's focus moves, with the `Message` it reports for code that returns it without a union of its own, and each Submodel that returns it re-exports it too, so a parent's test resolves it by the child's name.
|
|
1245
1245
|
|
|
@@ -1254,14 +1254,39 @@ Each component is `src/<name>/<name>.ts` with an explicit `index.ts`, a colocate
|
|
|
1254
1254
|
9. **A Scene test for every accessibility contract** a component adds beyond `@foldkit/ui`: roles, accessible names, `aria-pressed`, `aria-describedby`, `aria-invalid`, held and disabled states, alerts. Behaviour that only a real event shows (a Mount's key handling) gets a test with real DOM events in happy-dom, no mocks.
|
|
1255
1255
|
10. **Toggles.** `aria-pressed` comes only from `Button.pressedAttribute(isPressed, h)`, present in both states so the control reads as a toggle.
|
|
1256
1256
|
11. **Naming code.** Never put `aria-label` on `code` or `pre` alone; give them `role="group"` and a name.
|
|
1257
|
-
12. **Live regions follow the topmost open dialog.** An open Dialog makes the page outside it inert and hidden from screen readers. Anything that must be heard or reached while it is open (the Announcer's live region, the toast stack) renders inside the topmost open dialog, through its `toLiveRegionView: () => Html` (rendered inside the `<dialog>`, outside the card), and in the body otherwise. Every dialog-like Submodel (ConfirmDialog, KeyHelp, CommandPalette) passes `toLiveRegionView` through. A Menu does not trap focus, so it hosts nothing. `LiveRegion.place` decides which host from the application's Model, and the application lists its dialogs in stacking order (the specimen's `site/src/
|
|
1257
|
+
12. **Live regions follow the topmost open dialog.** An open Dialog makes the page outside it inert and hidden from screen readers. Anything that must be heard or reached while it is open (the Announcer's live region, the toast stack) renders inside the topmost open dialog, through its `toLiveRegionView: () => Html` (rendered inside the `<dialog>`, outside the card), and in the body otherwise. Every dialog-like Submodel (ConfirmDialog, KeyHelp, CommandPalette) passes `toLiveRegionView` through. A Menu does not trap focus, so it hosts nothing. `LiveRegion.place` decides which host from the application's Model, and the application lists its dialogs in stacking order (the specimen's `site/src/live-region.ts`, shown under Setting up). A `role="status"` element stays in the DOM with only its contents swapped; it is never mounted already holding its message, which would go unheard.
|
|
1258
1258
|
13. **The key platform lives in the application's Model** (`KeyHint.KeyPlatform`, starting `"Other"` so server and browser render alike), set once by one init Command that runs `KeyHint.detectKeyPlatform`. Components take `platform` as an input; none detects it.
|
|
1259
1259
|
14. **Shipped Commands for page-wide side effects.** What every application would otherwise write for itself is a Command in its namespace (`Focus.Focus`, `Announcer.Announce`, `Announcer.Flash`, `SkipLink.ScrollToFragment`), reporting a `Completed*` Message from that namespace's `Message` union, which the application's own union declares too (`CompletedAnnounce: {}`), so the tag matches and its update changes nothing for it. One Command per effect, so a Story test resolves it by its one name. A component that says or focuses something as part of its own work keeps a Command named for that work (`Board.AnnounceMove`, `CopyButton.AnnounceCopy`), so its name never collides with the application's.
|
|
1260
1260
|
15. **A Mount reports through the parent.** A View that owns a Mount takes a required `toParentMessage: (message: X.Message) => ParentMessage` (TopBar, StatusBar, Toolbar, the mermaid adapter), and a fire-and-forget Mount maps to a caller `Completed*` Message the parent may ignore. A bare `onX: Message` is used only where the parent's Model acts on the fact (ImageFrame's `onBroken`). In a Scene, resolve the Mount by name with the lifted Message: `Scene.Mount.resolve({ name: X.Mount.name }, toParentMessage(...))`. Where every application's Scene must resolve a component's Mounts to render a page at all, the namespace exports `sceneMounts`, the matchers paired with Messages that change nothing, for `Scene.Mount.resolveAll(...X.sceneMounts)`: `TopBar.sceneMounts(toParentMessage)`, `Toast.sceneMounts` and `Dialog.sceneMounts` (which serves ConfirmDialog, KeyHelp and CommandPalette too).
|
|
1261
1261
|
16. **Fragment links focus through the application.** A link to `#id` (SkipLink, an ErrorSummary's links) needs the application's URL handler to return `SkipLink.ScrollToFragment` for the changed URL, since Foldkit routes the click.
|
|
1262
1262
|
17. **Platform services are the application's.** A component that needs a platform service says so in its TSDoc and here (CopyButton writes through Effect's `Clipboard`), and the application provides the Layer in its `resources`.
|
|
1263
1263
|
18. **Held work gives up.** Work that holds a dialog's ways out (a save, a delete) waits on something outside the page, which can hang, and a hang would shut the reader in. Its Command ends in a timeout mapped to its failure Message (`Effect.timeoutOrElse({ duration, orElse: () => Effect.succeed(FailedSave({ … })) })`), so the hold always ends with the reason in the dialog.
|
|
1264
|
-
19. **Upstream gaps.** Where `@foldkit/ui` lacks a capability, the workaround
|
|
1264
|
+
19. **Upstream gaps.** Where `@foldkit/ui` lacks a capability, the workaround is listed under Upstream gaps below, by component, and the code carries no note. A wrapper that must build a child Message itself has a lint disable on that line alone.
|
|
1265
|
+
|
|
1266
|
+
### Upstream gaps
|
|
1267
|
+
|
|
1268
|
+
What `@foldkit/ui` 0.169.0 and Foldkit lack, and what pixel-paper does instead:
|
|
1269
|
+
|
|
1270
|
+
- **DragAndDrop** (Board, Sortable, `src/drag/`):
|
|
1271
|
+
- It has no accessor for which input holds an item. `ghostStyle` is Some only while a pointer drags, so it tells a pointer drag from a keyboard one.
|
|
1272
|
+
- It exposes no update capability for a press, a keyboard pick-up, a pointer's move and release, or a cancel. So Board and Sortable build those child Messages themselves (`drag.ts`, under a lint disable per line).
|
|
1273
|
+
- Its `draggable` bundle forces `role="option"`, `tabindex` and `data-sortable-id`, and its `droppable` bundle forces `role="listbox"`. So a grip carries `data-draggable-id` by hand, a Board column carries `data-droppable-id` by hand, and FocusItem finds the grip by it. While moves are held a Sortable's grip stays, held, so the focus of a keyboard hold that stopping cancels has somewhere to return.
|
|
1274
|
+
- Its ResolveKeyboardMove walks every `[data-droppable-id]` in the document. A column past a board's first or last is another list's, so the Board does not take that step.
|
|
1275
|
+
- Its pointer resolves a drop along one axis, which a wrapping grid cannot use. So Sortable reads the pointer itself and hands DragAndDrop its moves and release.
|
|
1276
|
+
- Tab while an item is held reaches it as a step to another list. A Sortable has no other list, so the item stays.
|
|
1277
|
+
- Its own Escape cancels the move and lets the key travel on, to a dialog around the list. Board and Sortable take the key first and stop it.
|
|
1278
|
+
- Its Subscription keys are fixed, so two users on a page would share them. Board and Sortable lift the ones they use under their own names, behind the parent's prefix (`prefixKeys`).
|
|
1279
|
+
- **Dialog:** it has no way to hold a close. Escape, a press on the veil and a `closeButton` control all send `RequestedClose`, so a held dialog reads it by its tag and leaves it out. Its `open` is its update on `RequestedOpen`, which reports `Opened`, so `foldDialog` gives every step an OutMessage fold. It ships no Scene resolution for its resources Mount, so `Dialog`'s test helper builds the child Message the Mount would report.
|
|
1280
|
+
- **Combobox:** its popup does not fit an always-open list in a card, so CommandPalette is not built on it. Its list is a popup anchored under the field (portaled unless told not to) behind a press-catcher, hidden until positioned. Its cursor is an index that wraps and passes disabled rows, pointer movement moves it, and leaving the field closes it. Its Escape is handled, so the Dialog never sees the Escape that must close the whole palette.
|
|
1281
|
+
- **Menu:** its rows are always `role="menuitem"` with no hook for a row's role or attributes (no `menuitemradio`, `menuitemcheckbox` or `aria-checked`). Its arrows pass unavailable rows, where the ARIA menu pattern stops on them, and its row ids are private. It opens only under its button, never at a point. So Menu and ContextMenu are hand-built ARIA menus with real focus on their rows, positioned by the public Anchor.
|
|
1282
|
+
- **Toast:** it exports no accessor for its entries or for whether one is leaving, and `show` does not return the id it gave the entry. So the stack reads its Model: an entry stops showing as its leave starts (its animation's `isShowing`), and `show` appends the entry. It holds one slip while the pointer rests on it, with no way to hold them all, and no step that holds or releases a slip from outside. So `Stack.hold` and `Stack.release` build the pointer's two child Messages, and the stack holds every slip while the pointer is on any slip or the keyboard is in the stack. Its container is always a polite live region and cannot be told otherwise, so a slip is read from the stack, and only a stack that mounts already holding it says it through the page's live region (`AnnounceSlip`). Its test helper does not export `LEAVE_TRANSITION_GENERATION`, so `toast.test.ts` keeps a copy.
|
|
1283
|
+
- **Nav:** it renders one item per href it was given, in order, so NavStrip pairs each item with its own.
|
|
1284
|
+
- **RadioGroup:** its `optionId` is private, so `radio-choices.ts` holds its id format, the one place that writes it.
|
|
1285
|
+
- **FileDrop:** it exports no `id` accessor, so DropZone reads its Model's field.
|
|
1286
|
+
- **Input, Select, Textarea:** they have no required option, so Field says it.
|
|
1287
|
+
- **Mounts:** a Mount's teardown runs after the patch that removes it, too late to report a Message. So a Menu or ContextMenu slip that leaves the page while open says so from `OnUnmount`, and a slip opened anew names the opening it was for.
|
|
1288
|
+
- **Scene:** a Scene runs no destroy hooks and no Mount against real DOM. Tests of what only a live runtime shows embed the real view in happy-dom (`src/test/embed.ts`, `src/test/settle.ts`).
|
|
1289
|
+
- **Subscriptions:** `Subscription.aggregate` throws on a duplicate key. TypeScript does not infer template-literal keys built at runtime, so `prefixKeys` states its record's type once, under a file-scoped `no-unsafe-type-assertion` exception.
|
|
1265
1290
|
|
|
1266
1291
|
## Do's and Don'ts
|
|
1267
1292
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import type { Mermaid } from "mermaid";
|
|
3
|
+
import { Palette } from "../scheme/scheme.ts";
|
|
4
|
+
declare const MermaidMissing_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
5
|
+
readonly _tag: "MermaidMissing";
|
|
6
|
+
} & Readonly<A>;
|
|
7
|
+
export declare class MermaidMissing extends MermaidMissing_base<{
|
|
8
|
+
reason: string;
|
|
9
|
+
}> {
|
|
10
|
+
}
|
|
11
|
+
export declare const loadMermaid: Effect.Effect<Mermaid, MermaidMissing>;
|
|
12
|
+
/** What a diagram's box reports. `SucceededDrawDiagram`: the diagram is drawn, in `palette`.
|
|
13
|
+
* `FailedLoadMermaid`: mermaid did not load (the application has not installed it, or its
|
|
14
|
+
* code did not arrive), so no diagram on the page can be drawn. `FailedDrawDiagram`: mermaid
|
|
15
|
+
* loaded but this diagram was not drawn, most often because its source does not parse.
|
|
16
|
+
* `reason` is the whole diagnostic, several lines for a parse error (the line, a caret under
|
|
17
|
+
* the fault, what was expected), so print it as written. */
|
|
18
|
+
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
19
|
+
readonly SucceededDrawDiagram: {
|
|
20
|
+
palette: Schema.Literals<readonly ["Paper", "Plum"]>;
|
|
21
|
+
};
|
|
22
|
+
readonly FailedLoadMermaid: {
|
|
23
|
+
palette: Schema.Literals<readonly ["Paper", "Plum"]>;
|
|
24
|
+
reason: Schema.String;
|
|
25
|
+
};
|
|
26
|
+
readonly FailedDrawDiagram: {
|
|
27
|
+
palette: Schema.Literals<readonly ["Paper", "Plum"]>;
|
|
28
|
+
reason: Schema.String;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
export type Message = typeof Message.Type;
|
|
32
|
+
export declare const drawDiagram: (load: Effect.Effect<Mermaid, MermaidMissing>) => ({ element, source, palette, }: Readonly<{
|
|
33
|
+
element: Element;
|
|
34
|
+
source: string;
|
|
35
|
+
palette: Palette;
|
|
36
|
+
}>) => Effect.Effect<Message>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=diagram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagram.d.ts","sourceRoot":"","sources":["../../../src/adapters/diagram.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAU,MAAM,EAAa,MAAM,QAAQ,CAAC;AAExE,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;;;;AAwK9C,qBAAa,cAAe,SAAQ,oBAAmC;IACrE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;CAAG;AAmBL,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAQ3D,CAAC;AAsCL;;;;;6DAK6D;AAC7D,eAAO,MAAM,OAAO;;QACM,OAAO;;;QACV,OAAO;QAAW,MAAM;;;QACxB,OAAO;QAAW,MAAM;;EAC7C,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C,eAAO,MAAM,WAAW,SACf,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,qCAK1C,QAAQ,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAcvB,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Array, Data, Effect, Record, Schema, Semaphore } from "effect";
|
|
3
|
+
import { defineMessageUnion } from "foldkit/message";
|
|
4
|
+
import { Palette } from "../scheme/scheme.js";
|
|
5
|
+
const COLOURS = {
|
|
6
|
+
ink: "--ink",
|
|
7
|
+
paper: "--paper",
|
|
8
|
+
head: "--head",
|
|
9
|
+
rule: "--rule",
|
|
10
|
+
muted: "--muted",
|
|
11
|
+
red: "--red",
|
|
12
|
+
onHead: "--on-head",
|
|
13
|
+
};
|
|
14
|
+
const readColours = () => {
|
|
15
|
+
const probe = document.createElement("span");
|
|
16
|
+
probe.hidden = true;
|
|
17
|
+
document.documentElement.append(probe);
|
|
18
|
+
const colours = Record.map(COLOURS, (token) => {
|
|
19
|
+
probe.style.color = `var(${token})`;
|
|
20
|
+
return __foldkitBrandViewResult((getComputedStyle(probe).color), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#anonymous");
|
|
21
|
+
});
|
|
22
|
+
probe.remove();
|
|
23
|
+
return __foldkitBrandViewResult((colours), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#readColours");
|
|
24
|
+
};
|
|
25
|
+
const isDark = (rgb) => {
|
|
26
|
+
const [red = 255, green = 255, blue = 255] = Array.map(rgb.match(/[\d.]+/gu) ?? [], Number);
|
|
27
|
+
return __foldkitBrandViewResult((red * 0.299 + green * 0.587 + blue * 0.114 < 128), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#isDark");
|
|
28
|
+
};
|
|
29
|
+
const THEME_CSS = `
|
|
30
|
+
rect, line, path, polygon { shape-rendering: crispedges; }
|
|
31
|
+
|
|
32
|
+
/* nodes: paper in a 2px ink frame, square, on the 3px print shadow */
|
|
33
|
+
.node rect, .node polygon, .node circle, .node ellipse, .node path {
|
|
34
|
+
fill: var(--paper); stroke: var(--ink); stroke-width: var(--line);
|
|
35
|
+
}
|
|
36
|
+
.node rect { rx: 0; ry: 0; }
|
|
37
|
+
.node { filter: drop-shadow(var(--shadow-button)); }
|
|
38
|
+
.label, .label text, .label span, .label p, .nodeLabel {
|
|
39
|
+
font-family: var(--font-body); font-size: var(--type-body); color: var(--ink); fill: var(--ink);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* edges: 2px ink, stepped (the curve is "step"), ink arrowheads */
|
|
43
|
+
.flowchart-link, .edgePaths .path { stroke: var(--ink); stroke-width: var(--line); }
|
|
44
|
+
.marker, .arrowheadPath { fill: var(--ink); stroke: var(--ink); }
|
|
45
|
+
|
|
46
|
+
/* edge labels sit on paper, in the sans a size down */
|
|
47
|
+
.edgeLabel, .edgeLabel p, .edgeLabel span, .labelBkg {
|
|
48
|
+
background-color: var(--paper); color: var(--ink); font-size: var(--type-control);
|
|
49
|
+
}
|
|
50
|
+
.edgeLabel rect { fill: var(--paper); opacity: 1; }
|
|
51
|
+
|
|
52
|
+
/* clusters: a head-tinted area on a 1px rule, named in the label register */
|
|
53
|
+
.cluster rect { fill: var(--head); stroke: var(--rule); stroke-width: var(--hair); rx: 0; ry: 0; }
|
|
54
|
+
.cluster-label span, .cluster-label p, .cluster text, .cluster span {
|
|
55
|
+
font-family: var(--font-px); font-size: var(--type-label); text-transform: uppercase;
|
|
56
|
+
letter-spacing: var(--tracking-label); color: var(--on-head); fill: var(--on-head);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* sequence: actors print like nodes; lifelines are rules; replies dot in 2px cells */
|
|
60
|
+
.actor { fill: var(--paper); stroke: var(--ink); stroke-width: var(--line); }
|
|
61
|
+
rect.actor { filter: drop-shadow(var(--shadow-button)); }
|
|
62
|
+
text.actor > tspan, .messageText { fill: var(--ink); }
|
|
63
|
+
.actor-line { stroke: var(--rule); stroke-width: var(--hair); }
|
|
64
|
+
.messageLine0, .messageLine1 { stroke: var(--ink); stroke-width: var(--line); }
|
|
65
|
+
.messageLine1 { stroke-dasharray: var(--line) var(--line) !important; }
|
|
66
|
+
[id$="-arrowhead"] path, [id$="-crosshead"] path { fill: var(--ink); stroke: var(--ink); }
|
|
67
|
+
.activation0, .activation1, .activation2 { fill: var(--head); stroke: var(--ink); stroke-width: var(--line); }
|
|
68
|
+
|
|
69
|
+
/* a loop or an alt: a 1px rule around it (a dashed line means a drop target here), and its
|
|
70
|
+
word on an inverted tab, like a title bar. Mermaid writes the sans on every text, so the
|
|
71
|
+
pixel face has to insist. */
|
|
72
|
+
.loopLine { stroke: var(--rule); stroke-width: var(--hair); stroke-dasharray: none; }
|
|
73
|
+
.labelBox { fill: var(--ink); stroke: var(--ink); }
|
|
74
|
+
.labelText, .labelText > tspan {
|
|
75
|
+
fill: var(--paper); font-family: var(--font-px) !important; font-size: var(--type-label) !important;
|
|
76
|
+
text-transform: uppercase; letter-spacing: var(--tracking-label);
|
|
77
|
+
}
|
|
78
|
+
.loopText, .loopText > tspan, .sectionTitle, .sectionTitle > tspan { fill: var(--muted); }
|
|
79
|
+
|
|
80
|
+
/* notes: the quiet notice, head tint in a rule frame */
|
|
81
|
+
.note { fill: var(--head); stroke: var(--rule); stroke-width: var(--line); }
|
|
82
|
+
.noteText, .noteText > tspan { fill: var(--on-head); }
|
|
83
|
+
|
|
84
|
+
.sequenceNumber { fill: var(--paper); font-family: var(--font-px) !important; }
|
|
85
|
+
[id$="-sequencenumber"] { fill: var(--ink); }
|
|
86
|
+
`;
|
|
87
|
+
const PIXELS = /^(?<amount>\d*\.?\d+)px$/u;
|
|
88
|
+
const theme = () => {
|
|
89
|
+
const colours = readColours();
|
|
90
|
+
const style = getComputedStyle(document.documentElement);
|
|
91
|
+
const body = style.getPropertyValue("--font-body").trim();
|
|
92
|
+
const type = style.getPropertyValue("--type-body").trim();
|
|
93
|
+
const amount = PIXELS.exec(type)?.groups?.["amount"];
|
|
94
|
+
if (amount === undefined) {
|
|
95
|
+
throw new Error(`--type-body is not a length in pixels: "${type}".`);
|
|
96
|
+
}
|
|
97
|
+
const size = Number(amount);
|
|
98
|
+
return __foldkitBrandViewResult(({
|
|
99
|
+
theme: "base",
|
|
100
|
+
look: "classic",
|
|
101
|
+
fontFamily: body,
|
|
102
|
+
fontSize: size,
|
|
103
|
+
themeCSS: THEME_CSS,
|
|
104
|
+
themeVariables: {
|
|
105
|
+
darkMode: isDark(colours.paper),
|
|
106
|
+
background: colours.paper,
|
|
107
|
+
fontFamily: body,
|
|
108
|
+
fontSize: `${size}px`,
|
|
109
|
+
strokeWidth: 2,
|
|
110
|
+
primaryColor: colours.paper,
|
|
111
|
+
primaryTextColor: colours.ink,
|
|
112
|
+
primaryBorderColor: colours.ink,
|
|
113
|
+
secondaryColor: colours.head,
|
|
114
|
+
secondaryTextColor: colours.onHead,
|
|
115
|
+
secondaryBorderColor: colours.ink,
|
|
116
|
+
tertiaryColor: colours.head,
|
|
117
|
+
tertiaryTextColor: colours.onHead,
|
|
118
|
+
tertiaryBorderColor: colours.rule,
|
|
119
|
+
mainBkg: colours.paper,
|
|
120
|
+
nodeBorder: colours.ink,
|
|
121
|
+
nodeTextColor: colours.ink,
|
|
122
|
+
textColor: colours.ink,
|
|
123
|
+
titleColor: colours.ink,
|
|
124
|
+
lineColor: colours.ink,
|
|
125
|
+
arrowheadColor: colours.ink,
|
|
126
|
+
clusterBkg: colours.head,
|
|
127
|
+
clusterBorder: colours.rule,
|
|
128
|
+
edgeLabelBackground: colours.paper,
|
|
129
|
+
actorBkg: colours.paper,
|
|
130
|
+
actorBorder: colours.ink,
|
|
131
|
+
actorTextColor: colours.ink,
|
|
132
|
+
actorLineColor: colours.rule,
|
|
133
|
+
signalColor: colours.ink,
|
|
134
|
+
signalTextColor: colours.ink,
|
|
135
|
+
labelBoxBkgColor: colours.ink,
|
|
136
|
+
labelBoxBorderColor: colours.ink,
|
|
137
|
+
labelTextColor: colours.paper,
|
|
138
|
+
loopTextColor: colours.muted,
|
|
139
|
+
activationBkgColor: colours.head,
|
|
140
|
+
activationBorderColor: colours.ink,
|
|
141
|
+
noteBkgColor: colours.head,
|
|
142
|
+
noteTextColor: colours.onHead,
|
|
143
|
+
noteBorderColor: colours.rule,
|
|
144
|
+
sequenceNumberColor: colours.paper,
|
|
145
|
+
errorBkgColor: colours.red,
|
|
146
|
+
errorTextColor: colours.red,
|
|
147
|
+
},
|
|
148
|
+
flowchart: { curve: "step", padding: 12, nodeSpacing: 40, rankSpacing: 48 },
|
|
149
|
+
sequence: { rightAngles: true },
|
|
150
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#theme");
|
|
151
|
+
};
|
|
152
|
+
export class MermaidMissing extends Data.TaggedError("MermaidMissing") {
|
|
153
|
+
}
|
|
154
|
+
class DiagramError extends Data.TaggedError("DiagramError") {
|
|
155
|
+
}
|
|
156
|
+
const reasonOf = (cause) => __foldkitBrandViewResult((cause instanceof Error ? cause.message : String(cause)), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#reasonOf");
|
|
157
|
+
const DRAWING = Semaphore.makeUnsafe(1);
|
|
158
|
+
const loadFace = async (family) => {
|
|
159
|
+
const root = getComputedStyle(document.documentElement);
|
|
160
|
+
return __foldkitBrandViewResult((await document.fonts.load(`${root.getPropertyValue("--type-body").trim()} ${root.getPropertyValue(family).trim()}`)), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#loadFace");
|
|
161
|
+
};
|
|
162
|
+
export const loadMermaid = Effect.tryPromise({
|
|
163
|
+
try: async () => {
|
|
164
|
+
const { default: mermaid } = await import("mermaid");
|
|
165
|
+
return __foldkitBrandViewResult((mermaid), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#try");
|
|
166
|
+
},
|
|
167
|
+
catch: (cause) => __foldkitBrandViewResult((new MermaidMissing({ reason: reasonOf(cause) })), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#catch"),
|
|
168
|
+
});
|
|
169
|
+
const loadFaces = Effect.tryPromise({
|
|
170
|
+
try: async () => __foldkitBrandViewResult((await Promise.all([loadFace("--font-px"), loadFace("--font-body")])), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#try~2"),
|
|
171
|
+
catch: (cause) => __foldkitBrandViewResult((new DiagramError({ reason: reasonOf(cause) })), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#catch~2"),
|
|
172
|
+
});
|
|
173
|
+
const renderDiagram = (load, box, source) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
174
|
+
const [mermaid] = yield* Effect.all([load, loadFaces], {
|
|
175
|
+
concurrency: "unbounded",
|
|
176
|
+
});
|
|
177
|
+
return __foldkitBrandViewResult((yield* Effect.tryPromise({
|
|
178
|
+
try: async () => {
|
|
179
|
+
mermaid.initialize({
|
|
180
|
+
startOnLoad: false,
|
|
181
|
+
suppressErrorRendering: true,
|
|
182
|
+
...theme(),
|
|
183
|
+
});
|
|
184
|
+
const { svg } = await mermaid.render(`pixel-paper-diagram-${crypto.randomUUID()}`, source, box);
|
|
185
|
+
return __foldkitBrandViewResult((svg), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#try~3");
|
|
186
|
+
},
|
|
187
|
+
catch: (cause) => __foldkitBrandViewResult((new DiagramError({ reason: reasonOf(cause) })), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#catch~3"),
|
|
188
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#anonymous~2");
|
|
189
|
+
}).pipe(Semaphore.withPermit(DRAWING))), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#renderDiagram");
|
|
190
|
+
/** What a diagram's box reports. `SucceededDrawDiagram`: the diagram is drawn, in `palette`.
|
|
191
|
+
* `FailedLoadMermaid`: mermaid did not load (the application has not installed it, or its
|
|
192
|
+
* code did not arrive), so no diagram on the page can be drawn. `FailedDrawDiagram`: mermaid
|
|
193
|
+
* loaded but this diagram was not drawn, most often because its source does not parse.
|
|
194
|
+
* `reason` is the whole diagnostic, several lines for a parse error (the line, a caret under
|
|
195
|
+
* the fault, what was expected), so print it as written. */
|
|
196
|
+
export const Message = defineMessageUnion({
|
|
197
|
+
SucceededDrawDiagram: { palette: Palette },
|
|
198
|
+
FailedLoadMermaid: { palette: Palette, reason: Schema.String },
|
|
199
|
+
FailedDrawDiagram: { palette: Palette, reason: Schema.String },
|
|
200
|
+
});
|
|
201
|
+
export const drawDiagram = (load) => __foldkitBrandViewResult((({ element, source, palette, }) => __foldkitBrandViewResult((renderDiagram(load, element, source).pipe(Effect.tap((svg) => __foldkitBrandViewResult((Effect.sync(() => {
|
|
202
|
+
element.innerHTML = svg;
|
|
203
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#anonymous~4")), Effect.as(Message.SucceededDrawDiagram({ palette })), Effect.catchTags({
|
|
204
|
+
MermaidMissing: ({ reason }) => __foldkitBrandViewResult((Effect.succeed(Message.FailedLoadMermaid({ palette, reason }))), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#MermaidMissing"),
|
|
205
|
+
DiagramError: ({ reason }) => __foldkitBrandViewResult((Effect.succeed(Message.FailedDrawDiagram({ palette, reason }))), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#DiagramError"),
|
|
206
|
+
}))), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#anonymous~3")), "@gjermundgaraba-designs/pixel-paper/src/adapters/diagram.js#drawDiagram");
|
|
@@ -2,26 +2,8 @@ import { Schema } from "effect";
|
|
|
2
2
|
import type { Html, HtmlBuilder } from "foldkit/html";
|
|
3
3
|
import * as Mount from "foldkit/mount";
|
|
4
4
|
import { Palette } from "../scheme/scheme.ts";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* code did not arrive), so no diagram on the page can be drawn. `FailedDrawDiagram`: mermaid
|
|
8
|
-
* loaded but this diagram was not drawn, most often because its source does not parse.
|
|
9
|
-
* `reason` is the whole diagnostic, several lines for a parse error (the line, a caret under
|
|
10
|
-
* the fault, what was expected), so print it as written. */
|
|
11
|
-
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
12
|
-
readonly SucceededDrawDiagram: {
|
|
13
|
-
palette: Schema.Literals<readonly ["Paper", "Plum"]>;
|
|
14
|
-
};
|
|
15
|
-
readonly FailedLoadMermaid: {
|
|
16
|
-
palette: Schema.Literals<readonly ["Paper", "Plum"]>;
|
|
17
|
-
reason: Schema.String;
|
|
18
|
-
};
|
|
19
|
-
readonly FailedDrawDiagram: {
|
|
20
|
-
palette: Schema.Literals<readonly ["Paper", "Plum"]>;
|
|
21
|
-
reason: Schema.String;
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
export type Message = typeof Message.Type;
|
|
5
|
+
import { Message } from "./diagram.ts";
|
|
6
|
+
export { Message } from "./diagram.ts";
|
|
25
7
|
/** Draws `source` into the box it is mounted on and reports how it went. Its args are read
|
|
26
8
|
* once, so the box is keyed by the palette and the source: either changing mounts a new box
|
|
27
9
|
* and draws again. A View lifts it with `Mount.mapMessage`, which a Scene does not replay:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../../../src/adapters/mermaid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../../../src/adapters/mermaid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAA4B,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;uFAGuF;AACvF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;EAQtB,CAAC;AAEH,yDAAyD;AACzD,MAAM,MAAM,UAAU,CAAC,aAAa,IAAI,QAAQ,CAAC;IAC/C;mBACe;IACf,MAAM,EAAE,MAAM,CAAC;IACf;4EACwE;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB;+BAC2B;IAC3B,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,aAAa,CAAC;CACtD,CAAC,CAAC;AAEH;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,UACxB,UAAU,CAAC,aAAa,CAAC,KAC9B,WAAW,CAAC,aAAa,CAAC,KAC5B,IASF,CAAC"}
|
|
@@ -1,241 +1,21 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
|
|
3
|
-
// faces, in the page's palette. An optional entry point ("./adapters/mermaid"):
|
|
4
|
-
// mermaid is the adopter's own dependency, loaded here only when a diagram is drawn.
|
|
5
|
-
//
|
|
6
|
-
// Two layers. themeCSS repaints with var(…), so the parts it names (nodes, edges, labels,
|
|
7
|
-
// clusters, actors, messages, notes) follow a palette switch in place. themeVariables must be
|
|
8
|
-
// colours, not var() strings (mermaid mixes its own shades from them), so they are read from
|
|
9
|
-
// the page's palette; whatever mermaid bakes from them needs a fresh render, which the
|
|
10
|
-
// palette-keyed box gives it.
|
|
11
|
-
//
|
|
12
|
-
// The faces: what an author writes in a diagram (a node, an edge, a message, an actor, a
|
|
13
|
-
// note) is authored content, so it is set in the sans; mermaid's own words (a loop's or an
|
|
14
|
-
// alt's tab, a cluster's name, a sequence number) are chrome, in the pixel face.
|
|
15
|
-
import { Array, Data, Effect, Record, Schema, Semaphore } from "effect";
|
|
16
|
-
import { defineMessageUnion } from "foldkit/message";
|
|
2
|
+
import { Schema } from "effect";
|
|
17
3
|
import * as Mount from "foldkit/mount";
|
|
18
4
|
import { Palette } from "../scheme/scheme.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
paper: "--paper",
|
|
22
|
-
head: "--head",
|
|
23
|
-
rule: "--rule",
|
|
24
|
-
muted: "--muted",
|
|
25
|
-
red: "--red",
|
|
26
|
-
onHead: "--on-head",
|
|
27
|
-
};
|
|
28
|
-
/** The tokens' colours in the page's palette, as rgb() strings. A token holds light-dark(),
|
|
29
|
-
* so it is read through a probe's computed colour. */
|
|
30
|
-
const readColours = () => {
|
|
31
|
-
const probe = document.createElement("span");
|
|
32
|
-
probe.hidden = true;
|
|
33
|
-
document.documentElement.append(probe);
|
|
34
|
-
const colours = Record.map(COLOURS, (token) => {
|
|
35
|
-
probe.style.color = `var(${token})`;
|
|
36
|
-
return __foldkitBrandViewResult((getComputedStyle(probe).color), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#anonymous");
|
|
37
|
-
});
|
|
38
|
-
probe.remove();
|
|
39
|
-
return __foldkitBrandViewResult((colours), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#readColours");
|
|
40
|
-
};
|
|
41
|
-
/** Plum or paper, by the paper's own lightness. */
|
|
42
|
-
const isDark = (rgb) => {
|
|
43
|
-
const [red = 255, green = 255, blue = 255] = Array.map(rgb.match(/[\d.]+/g) ?? [], Number);
|
|
44
|
-
return __foldkitBrandViewResult((red * 0.299 + green * 0.587 + blue * 0.114 < 128), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#isDark");
|
|
45
|
-
};
|
|
46
|
-
// Selectors are mermaid's own; it scopes every rule to the diagram's id.
|
|
47
|
-
const THEME_CSS = `
|
|
48
|
-
rect, line, path, polygon { shape-rendering: crispedges; }
|
|
49
|
-
|
|
50
|
-
/* nodes: paper in a 2px ink frame, square, on the 3px print shadow */
|
|
51
|
-
.node rect, .node polygon, .node circle, .node ellipse, .node path {
|
|
52
|
-
fill: var(--paper); stroke: var(--ink); stroke-width: var(--line);
|
|
53
|
-
}
|
|
54
|
-
.node rect { rx: 0; ry: 0; }
|
|
55
|
-
.node { filter: drop-shadow(var(--shadow-button)); }
|
|
56
|
-
.label, .label text, .label span, .label p, .nodeLabel {
|
|
57
|
-
font-family: var(--font-body); font-size: var(--type-body); color: var(--ink); fill: var(--ink);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* edges: 2px ink, stepped (the curve is "step"), ink arrowheads */
|
|
61
|
-
.flowchart-link, .edgePaths .path { stroke: var(--ink); stroke-width: var(--line); }
|
|
62
|
-
.marker, .arrowheadPath { fill: var(--ink); stroke: var(--ink); }
|
|
63
|
-
|
|
64
|
-
/* edge labels sit on paper, in the sans a size down */
|
|
65
|
-
.edgeLabel, .edgeLabel p, .edgeLabel span, .labelBkg {
|
|
66
|
-
background-color: var(--paper); color: var(--ink); font-size: var(--type-control);
|
|
67
|
-
}
|
|
68
|
-
.edgeLabel rect { fill: var(--paper); opacity: 1; }
|
|
69
|
-
|
|
70
|
-
/* clusters: a head-tinted area on a 1px rule, named in the label register */
|
|
71
|
-
.cluster rect { fill: var(--head); stroke: var(--rule); stroke-width: var(--hair); rx: 0; ry: 0; }
|
|
72
|
-
.cluster-label span, .cluster-label p, .cluster text, .cluster span {
|
|
73
|
-
font-family: var(--font-px); font-size: var(--type-label); text-transform: uppercase;
|
|
74
|
-
letter-spacing: var(--tracking-label); color: var(--on-head); fill: var(--on-head);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/* sequence: actors print like nodes; lifelines are rules; replies dot in 2px cells */
|
|
78
|
-
.actor { fill: var(--paper); stroke: var(--ink); stroke-width: var(--line); }
|
|
79
|
-
rect.actor { filter: drop-shadow(var(--shadow-button)); }
|
|
80
|
-
text.actor > tspan, .messageText { fill: var(--ink); }
|
|
81
|
-
.actor-line { stroke: var(--rule); stroke-width: var(--hair); }
|
|
82
|
-
.messageLine0, .messageLine1 { stroke: var(--ink); stroke-width: var(--line); }
|
|
83
|
-
.messageLine1 { stroke-dasharray: var(--line) var(--line) !important; }
|
|
84
|
-
[id$="-arrowhead"] path, [id$="-crosshead"] path { fill: var(--ink); stroke: var(--ink); }
|
|
85
|
-
.activation0, .activation1, .activation2 { fill: var(--head); stroke: var(--ink); stroke-width: var(--line); }
|
|
86
|
-
|
|
87
|
-
/* a loop or an alt: a 1px rule around it (a dashed line means a drop target here), and its
|
|
88
|
-
word on an inverted tab, like a title bar. Mermaid writes the sans on every text, so the
|
|
89
|
-
pixel face has to insist. */
|
|
90
|
-
.loopLine { stroke: var(--rule); stroke-width: var(--hair); stroke-dasharray: none; }
|
|
91
|
-
.labelBox { fill: var(--ink); stroke: var(--ink); }
|
|
92
|
-
.labelText, .labelText > tspan {
|
|
93
|
-
fill: var(--paper); font-family: var(--font-px) !important; font-size: var(--type-label) !important;
|
|
94
|
-
text-transform: uppercase; letter-spacing: var(--tracking-label);
|
|
95
|
-
}
|
|
96
|
-
.loopText, .loopText > tspan, .sectionTitle, .sectionTitle > tspan { fill: var(--muted); }
|
|
97
|
-
|
|
98
|
-
/* notes: the quiet notice, head tint in a rule frame */
|
|
99
|
-
.note { fill: var(--head); stroke: var(--rule); stroke-width: var(--line); }
|
|
100
|
-
.noteText, .noteText > tspan { fill: var(--on-head); }
|
|
101
|
-
|
|
102
|
-
.sequenceNumber { fill: var(--paper); font-family: var(--font-px) !important; }
|
|
103
|
-
[id$="-sequencenumber"] { fill: var(--ink); }
|
|
104
|
-
`;
|
|
105
|
-
/** Mermaid's theme in pixel paper, read from the page's palette as it is now. */
|
|
106
|
-
const theme = () => {
|
|
107
|
-
const colours = readColours();
|
|
108
|
-
const style = getComputedStyle(document.documentElement);
|
|
109
|
-
const body = style.getPropertyValue("--font-body").trim();
|
|
110
|
-
const size = Number.parseFloat(style.getPropertyValue("--type-body"));
|
|
111
|
-
return __foldkitBrandViewResult(({
|
|
112
|
-
theme: "base",
|
|
113
|
-
look: "classic",
|
|
114
|
-
fontFamily: body,
|
|
115
|
-
fontSize: size,
|
|
116
|
-
themeCSS: THEME_CSS,
|
|
117
|
-
themeVariables: {
|
|
118
|
-
darkMode: isDark(colours.paper),
|
|
119
|
-
background: colours.paper,
|
|
120
|
-
fontFamily: body,
|
|
121
|
-
fontSize: `${size}px`,
|
|
122
|
-
strokeWidth: 2,
|
|
123
|
-
primaryColor: colours.paper,
|
|
124
|
-
primaryTextColor: colours.ink,
|
|
125
|
-
primaryBorderColor: colours.ink,
|
|
126
|
-
secondaryColor: colours.head,
|
|
127
|
-
secondaryTextColor: colours.onHead,
|
|
128
|
-
secondaryBorderColor: colours.ink,
|
|
129
|
-
tertiaryColor: colours.head,
|
|
130
|
-
tertiaryTextColor: colours.onHead,
|
|
131
|
-
tertiaryBorderColor: colours.rule,
|
|
132
|
-
mainBkg: colours.paper,
|
|
133
|
-
nodeBorder: colours.ink,
|
|
134
|
-
nodeTextColor: colours.ink,
|
|
135
|
-
textColor: colours.ink,
|
|
136
|
-
titleColor: colours.ink,
|
|
137
|
-
lineColor: colours.ink,
|
|
138
|
-
arrowheadColor: colours.ink,
|
|
139
|
-
clusterBkg: colours.head,
|
|
140
|
-
clusterBorder: colours.rule,
|
|
141
|
-
edgeLabelBackground: colours.paper,
|
|
142
|
-
actorBkg: colours.paper,
|
|
143
|
-
actorBorder: colours.ink,
|
|
144
|
-
actorTextColor: colours.ink,
|
|
145
|
-
actorLineColor: colours.rule,
|
|
146
|
-
signalColor: colours.ink,
|
|
147
|
-
signalTextColor: colours.ink,
|
|
148
|
-
labelBoxBkgColor: colours.ink,
|
|
149
|
-
labelBoxBorderColor: colours.ink,
|
|
150
|
-
labelTextColor: colours.paper,
|
|
151
|
-
loopTextColor: colours.muted,
|
|
152
|
-
activationBkgColor: colours.head,
|
|
153
|
-
activationBorderColor: colours.ink,
|
|
154
|
-
noteBkgColor: colours.head,
|
|
155
|
-
noteTextColor: colours.onHead,
|
|
156
|
-
noteBorderColor: colours.rule,
|
|
157
|
-
sequenceNumberColor: colours.paper,
|
|
158
|
-
errorBkgColor: colours.red,
|
|
159
|
-
errorTextColor: colours.red,
|
|
160
|
-
},
|
|
161
|
-
// orthogonal edges: steps, never curves or diagonals
|
|
162
|
-
flowchart: { curve: "step", padding: 12, nodeSpacing: 40, rankSpacing: 48 },
|
|
163
|
-
// a sequence diagram sets every word in fontFamily at fontSize, written on each text
|
|
164
|
-
sequence: { rightAngles: true },
|
|
165
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#theme");
|
|
166
|
-
};
|
|
167
|
-
// ERROR
|
|
168
|
-
/** Mermaid did not load: the application has not installed it (it is an optional peer), or
|
|
169
|
-
* its code failed to arrive. `reason` is the whole of what the import said. */
|
|
170
|
-
class MermaidMissing extends Data.TaggedError("MermaidMissing") {
|
|
171
|
-
}
|
|
172
|
-
/** Mermaid loaded but the diagram was not drawn: its source does not parse, a face did not
|
|
173
|
-
* load, or mermaid failed while drawing. `reason` is the whole of what was said; for a parse
|
|
174
|
-
* error that is several lines (where, the line with a caret under the fault, what was
|
|
175
|
-
* expected), so print it as preformatted text. */
|
|
176
|
-
class DiagramError extends Data.TaggedError("DiagramError") {
|
|
177
|
-
}
|
|
178
|
-
const reasonOf = (cause) => __foldkitBrandViewResult((cause instanceof Error ? cause.message : String(cause)), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#reasonOf");
|
|
179
|
-
// DRAW
|
|
180
|
-
// mermaid's settings are global: one diagram at a time, each with the theme as it is then
|
|
181
|
-
const DRAWING = Semaphore.makeUnsafe(1);
|
|
182
|
-
const loadFace = (family) => {
|
|
183
|
-
const root = getComputedStyle(document.documentElement);
|
|
184
|
-
return __foldkitBrandViewResult((document.fonts.load(`${root.getPropertyValue("--type-body").trim()} ${root.getPropertyValue(family).trim()}`)), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#loadFace");
|
|
185
|
-
};
|
|
186
|
-
const loadMermaid = Effect.tryPromise({
|
|
187
|
-
try: () => __foldkitBrandViewResult((import("mermaid")), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#try"),
|
|
188
|
-
catch: (cause) => __foldkitBrandViewResult((new MermaidMissing({ reason: reasonOf(cause) })), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#catch"),
|
|
189
|
-
});
|
|
190
|
-
const loadFaces = Effect.tryPromise({
|
|
191
|
-
try: () => __foldkitBrandViewResult((Promise.all([loadFace("--font-px"), loadFace("--font-body")])), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#try~2"),
|
|
192
|
-
catch: (cause) => __foldkitBrandViewResult((new DiagramError({ reason: reasonOf(cause) })), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#catch~2"),
|
|
193
|
-
});
|
|
194
|
-
/** Draws `source` in `box` in pixel paper and returns the SVG markup, to put in the box.
|
|
195
|
-
* Loads mermaid and the faces first. Fails with `MermaidMissing` when mermaid does not load,
|
|
196
|
-
* and with `DiagramError` when the diagram is not drawn (most often a source that does not
|
|
197
|
-
* parse). */
|
|
198
|
-
const renderDiagram = (box, source) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
199
|
-
// the faces must be loaded before mermaid measures the words set in them
|
|
200
|
-
const [{ default: mermaid }] = yield* Effect.all([loadMermaid, loadFaces], {
|
|
201
|
-
concurrency: "unbounded",
|
|
202
|
-
});
|
|
203
|
-
return __foldkitBrandViewResult((yield* Effect.tryPromise({
|
|
204
|
-
try: async () => {
|
|
205
|
-
mermaid.initialize({ startOnLoad: false, suppressErrorRendering: true, ...theme() });
|
|
206
|
-
// a fresh id each time, so the drawing on screen is not mistaken for the new one
|
|
207
|
-
const { svg } = await mermaid.render(`pixel-paper-diagram-${crypto.randomUUID()}`, source, box);
|
|
208
|
-
return __foldkitBrandViewResult((svg), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#try~3");
|
|
209
|
-
},
|
|
210
|
-
catch: (cause) => __foldkitBrandViewResult((new DiagramError({ reason: reasonOf(cause) })), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#catch~3"),
|
|
211
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#anonymous~2");
|
|
212
|
-
}).pipe(Semaphore.withPermit(DRAWING))), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#renderDiagram");
|
|
213
|
-
// MESSAGE
|
|
214
|
-
/** What a diagram's box reports. `SucceededDrawDiagram`: the diagram is drawn, in `palette`.
|
|
215
|
-
* `FailedLoadMermaid`: mermaid did not load (the application has not installed it, or its
|
|
216
|
-
* code did not arrive), so no diagram on the page can be drawn. `FailedDrawDiagram`: mermaid
|
|
217
|
-
* loaded but this diagram was not drawn, most often because its source does not parse.
|
|
218
|
-
* `reason` is the whole diagnostic, several lines for a parse error (the line, a caret under
|
|
219
|
-
* the fault, what was expected), so print it as written. */
|
|
220
|
-
export const Message = defineMessageUnion({
|
|
221
|
-
SucceededDrawDiagram: { palette: Palette },
|
|
222
|
-
FailedLoadMermaid: { palette: Palette, reason: Schema.String },
|
|
223
|
-
FailedDrawDiagram: { palette: Palette, reason: Schema.String },
|
|
224
|
-
});
|
|
225
|
-
// MOUNT
|
|
5
|
+
import { Message, drawDiagram, loadMermaid } from "./diagram.js";
|
|
6
|
+
export { Message } from "./diagram.js";
|
|
226
7
|
/** Draws `source` into the box it is mounted on and reports how it went. Its args are read
|
|
227
8
|
* once, so the box is keyed by the palette and the source: either changing mounts a new box
|
|
228
9
|
* and draws again. A View lifts it with `Mount.mapMessage`, which a Scene does not replay:
|
|
229
10
|
* resolve it by name, `{ name: DrawDiagram.name }`, with the caller's own Message. */
|
|
230
11
|
export const DrawDiagram = Mount.define("DrawDiagram", {
|
|
231
12
|
args: { source: Schema.String, palette: Palette },
|
|
232
|
-
messages: [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}))), "@gjermundgaraba-designs/pixel-paper/src/adapters/mermaid.js#execute"),
|
|
13
|
+
messages: [
|
|
14
|
+
Message.SucceededDrawDiagram,
|
|
15
|
+
Message.FailedLoadMermaid,
|
|
16
|
+
Message.FailedDrawDiagram,
|
|
17
|
+
],
|
|
18
|
+
execute: drawDiagram(loadMermaid),
|
|
239
19
|
});
|
|
240
20
|
/** The box a diagram is drawn in, once it is on the page. Empty on the server and until the
|
|
241
21
|
* drawing lands; the caller shows a Loading line or an error Notice beside it. */
|
|
@@ -20,11 +20,7 @@ export declare const ANNOUNCER_ATTRIBUTE = "data-pixel-paper-announcer";
|
|
|
20
20
|
* `LiveRegion.place` puts them where the rule says.
|
|
21
21
|
*/
|
|
22
22
|
export declare const view: <Message>(h: HtmlBuilder<Message>) => Html;
|
|
23
|
-
/** Says `text` to screen readers through the page's live region, once it has rendered. A
|
|
24
|
-
* component that says its own steps (a board's move, a copy) runs it from a Command of its
|
|
25
|
-
* own, named for what it says. */
|
|
26
23
|
export declare const announce: (text: string) => Effect.Effect<void>;
|
|
27
|
-
/** Inverts the element `selector` finds for one beat; `Flash` runs it. */
|
|
28
24
|
export declare const flash: (selector: string) => Effect.Effect<void>;
|
|
29
25
|
/**
|
|
30
26
|
* Says `text` to screen readers through the page's live region (see `view`). Words said in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcer.d.ts","sourceRoot":"","sources":["../../../src/announcer/announcer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,MAAM,EAAU,MAAM,EAAQ,MAAM,QAAQ,CAAC;AACvE,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"announcer.d.ts","sourceRoot":"","sources":["../../../src/announcer/announcer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,MAAM,EAAU,MAAM,EAAQ,MAAM,QAAQ,CAAC;AACvE,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAItD;;sDAEsD;AACtD,eAAO,MAAM,OAAO;;;EAGlB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C;uFACuF;AACvF,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAIhE;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IAMpD,CAAC;AA0DL,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAQtD,CAAC;AAiDL,eAAO,MAAM,KAAK,aAAc,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAWvD,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;iBAKnB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;;iBAKhB,CAAC"}
|