@panphora/bevel 0.1.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/LICENSE +16 -0
- package/README.md +226 -0
- package/bevel-fonts.css +16 -0
- package/bevel.css +3075 -0
- package/bevel.js +2126 -0
- package/dist/react/components/activity-feed.d.ts +89 -0
- package/dist/react/components/activity-feed.js +54 -0
- package/dist/react/components/alert-dialog.d.ts +14 -0
- package/dist/react/components/alert-dialog.js +19 -0
- package/dist/react/components/app-shell.d.ts +98 -0
- package/dist/react/components/app-shell.js +86 -0
- package/dist/react/components/app-toolbar.d.ts +19 -0
- package/dist/react/components/app-toolbar.js +22 -0
- package/dist/react/components/avatar-group.d.ts +67 -0
- package/dist/react/components/avatar-group.js +49 -0
- package/dist/react/components/badge-and-pill.d.ts +34 -0
- package/dist/react/components/badge-and-pill.js +12 -0
- package/dist/react/components/breadcrumbs.d.ts +56 -0
- package/dist/react/components/breadcrumbs.js +44 -0
- package/dist/react/components/bulk-bar.d.ts +22 -0
- package/dist/react/components/bulk-bar.js +59 -0
- package/dist/react/components/button.d.ts +15 -0
- package/dist/react/components/button.js +20 -0
- package/dist/react/components/callout-and-hint.d.ts +17 -0
- package/dist/react/components/callout-and-hint.js +8 -0
- package/dist/react/components/checkbox.d.ts +5 -0
- package/dist/react/components/checkbox.js +13 -0
- package/dist/react/components/chip.d.ts +149 -0
- package/dist/react/components/chip.js +29 -0
- package/dist/react/components/code-block.d.ts +50 -0
- package/dist/react/components/code-block.js +77 -0
- package/dist/react/components/code-editor.d.ts +122 -0
- package/dist/react/components/code-editor.js +695 -0
- package/dist/react/components/column-manager.d.ts +28 -0
- package/dist/react/components/column-manager.js +85 -0
- package/dist/react/components/combobox.d.ts +32 -0
- package/dist/react/components/combobox.js +37 -0
- package/dist/react/components/data-grid.d.ts +108 -0
- package/dist/react/components/data-grid.js +159 -0
- package/dist/react/components/data-table.d.ts +2 -0
- package/dist/react/components/data-table.js +6 -0
- package/dist/react/components/date.d.ts +23 -0
- package/dist/react/components/date.js +11 -0
- package/dist/react/components/details.d.ts +13 -0
- package/dist/react/components/details.js +20 -0
- package/dist/react/components/dialog.d.ts +74 -0
- package/dist/react/components/dialog.js +31 -0
- package/dist/react/components/diff-view.d.ts +73 -0
- package/dist/react/components/diff-view.js +68 -0
- package/dist/react/components/documents.d.ts +70 -0
- package/dist/react/components/documents.js +10 -0
- package/dist/react/components/drawer.d.ts +45 -0
- package/dist/react/components/drawer.js +35 -0
- package/dist/react/components/editable-grid-cells.d.ts +32 -0
- package/dist/react/components/editable-grid-cells.js +116 -0
- package/dist/react/components/eyebrow-kicker-lede-pull-quote.d.ts +39 -0
- package/dist/react/components/eyebrow-kicker-lede-pull-quote.js +12 -0
- package/dist/react/components/field.d.ts +32 -0
- package/dist/react/components/field.js +27 -0
- package/dist/react/components/file-tree.d.ts +75 -0
- package/dist/react/components/file-tree.js +247 -0
- package/dist/react/components/file.d.ts +43 -0
- package/dist/react/components/file.js +73 -0
- package/dist/react/components/files-table.d.ts +174 -0
- package/dist/react/components/files-table.js +237 -0
- package/dist/react/components/filter-builder.d.ts +37 -0
- package/dist/react/components/filter-builder.js +109 -0
- package/dist/react/components/form-error-summary.d.ts +16 -0
- package/dist/react/components/form-error-summary.js +49 -0
- package/dist/react/components/icon-button.d.ts +8 -0
- package/dist/react/components/icon-button.js +14 -0
- package/dist/react/components/icon.d.ts +7 -0
- package/dist/react/components/icon.js +15 -0
- package/dist/react/components/image.d.ts +72 -0
- package/dist/react/components/image.js +24 -0
- package/dist/react/components/inline-edit.d.ts +70 -0
- package/dist/react/components/inline-edit.js +149 -0
- package/dist/react/components/input.d.ts +29 -0
- package/dist/react/components/input.js +20 -0
- package/dist/react/components/kanban-board.d.ts +140 -0
- package/dist/react/components/kanban-board.js +374 -0
- package/dist/react/components/layout.d.ts +51 -0
- package/dist/react/components/layout.js +28 -0
- package/dist/react/components/list.d.ts +28 -0
- package/dist/react/components/list.js +6 -0
- package/dist/react/components/masthead-and-verdict.d.ts +60 -0
- package/dist/react/components/masthead-and-verdict.js +8 -0
- package/dist/react/components/menu.d.ts +26 -0
- package/dist/react/components/menu.js +31 -0
- package/dist/react/components/multi-select-picker.d.ts +49 -0
- package/dist/react/components/multi-select-picker.js +20 -0
- package/dist/react/components/note.d.ts +33 -0
- package/dist/react/components/note.js +8 -0
- package/dist/react/components/number-field.d.ts +16 -0
- package/dist/react/components/number-field.js +17 -0
- package/dist/react/components/pagination.d.ts +45 -0
- package/dist/react/components/pagination.js +87 -0
- package/dist/react/components/persistent-action-banner.d.ts +71 -0
- package/dist/react/components/persistent-action-banner.js +39 -0
- package/dist/react/components/popconfirm.d.ts +42 -0
- package/dist/react/components/popconfirm.js +59 -0
- package/dist/react/components/popover.d.ts +16 -0
- package/dist/react/components/popover.js +21 -0
- package/dist/react/components/progress-and-gauge.d.ts +44 -0
- package/dist/react/components/progress-and-gauge.js +19 -0
- package/dist/react/components/radio.d.ts +7 -0
- package/dist/react/components/radio.js +13 -0
- package/dist/react/components/rich-text-toolbar.d.ts +26 -0
- package/dist/react/components/rich-text-toolbar.js +64 -0
- package/dist/react/components/rows-and-card.d.ts +88 -0
- package/dist/react/components/rows-and-card.js +10 -0
- package/dist/react/components/save-status-indicator.d.ts +11 -0
- package/dist/react/components/save-status-indicator.js +33 -0
- package/dist/react/components/segmented-control.d.ts +21 -0
- package/dist/react/components/segmented-control.js +15 -0
- package/dist/react/components/select.d.ts +29 -0
- package/dist/react/components/select.js +29 -0
- package/dist/react/components/selectable-cards.d.ts +30 -0
- package/dist/react/components/selectable-cards.js +29 -0
- package/dist/react/components/settings-rows.d.ts +51 -0
- package/dist/react/components/settings-rows.js +8 -0
- package/dist/react/components/sidebar-nav.d.ts +77 -0
- package/dist/react/components/sidebar-nav.js +41 -0
- package/dist/react/components/skeleton-and-empty.d.ts +51 -0
- package/dist/react/components/skeleton-and-empty.js +14 -0
- package/dist/react/components/slider.d.ts +19 -0
- package/dist/react/components/slider.js +17 -0
- package/dist/react/components/small-charts.d.ts +60 -0
- package/dist/react/components/small-charts.js +76 -0
- package/dist/react/components/sortable.d.ts +30 -0
- package/dist/react/components/sortable.js +85 -0
- package/dist/react/components/split-button.d.ts +38 -0
- package/dist/react/components/split-button.js +43 -0
- package/dist/react/components/split-panes.d.ts +35 -0
- package/dist/react/components/split-panes.js +102 -0
- package/dist/react/components/stat-tiles.d.ts +54 -0
- package/dist/react/components/stat-tiles.js +8 -0
- package/dist/react/components/steps.d.ts +11 -0
- package/dist/react/components/steps.js +13 -0
- package/dist/react/components/switch.d.ts +6 -0
- package/dist/react/components/switch.js +13 -0
- package/dist/react/components/table.d.ts +61 -0
- package/dist/react/components/table.js +6 -0
- package/dist/react/components/tabs.d.ts +7 -0
- package/dist/react/components/tabs.js +13 -0
- package/dist/react/components/tags.d.ts +33 -0
- package/dist/react/components/tags.js +83 -0
- package/dist/react/components/textarea.d.ts +10 -0
- package/dist/react/components/textarea.js +6 -0
- package/dist/react/components/toast.d.ts +35 -0
- package/dist/react/components/toast.js +90 -0
- package/dist/react/components/tooltip-and-key.d.ts +20 -0
- package/dist/react/components/tooltip-and-key.js +20 -0
- package/dist/react/components/tree-view.d.ts +34 -0
- package/dist/react/components/tree-view.js +118 -0
- package/dist/react/components/upload-dropzone.d.ts +92 -0
- package/dist/react/components/upload-dropzone.js +116 -0
- package/dist/react/components/wizard-shell.d.ts +78 -0
- package/dist/react/components/wizard-shell.js +176 -0
- package/dist/react/fonts.css.d.ts +1 -0
- package/dist/react/index.d.ts +76 -0
- package/dist/react/index.js +77 -0
- package/dist/react/integrations/quickcrop.d.ts +58 -0
- package/dist/react/integrations/quickcrop.js +137 -0
- package/dist/react/integrations/richclay.d.ts +43 -0
- package/dist/react/integrations/richclay.js +129 -0
- package/dist/react/internal/classes.d.ts +3 -0
- package/dist/react/internal/classes.js +10 -0
- package/dist/react/internal/close-mark.d.ts +1 -0
- package/dist/react/internal/close-mark.js +10 -0
- package/dist/react/internal/controllable-state.d.ts +9 -0
- package/dist/react/internal/controllable-state.js +22 -0
- package/dist/react/internal/drop-effect.d.ts +28 -0
- package/dist/react/internal/drop-effect.js +8 -0
- package/dist/react/internal/form-reset.d.ts +2 -0
- package/dist/react/internal/form-reset.js +22 -0
- package/dist/react/internal/format.d.ts +1 -0
- package/dist/react/internal/format.js +14 -0
- package/dist/react/internal/link.d.ts +2 -0
- package/dist/react/internal/link.js +8 -0
- package/dist/react/internal/part.d.ts +20 -0
- package/dist/react/internal/part.js +47 -0
- package/dist/react/internal/pointer-session.d.ts +8 -0
- package/dist/react/internal/pointer-session.js +60 -0
- package/dist/react/internal/refs.d.ts +2 -0
- package/dist/react/internal/refs.js +22 -0
- package/dist/react/internal/rich-text.d.ts +28 -0
- package/dist/react/internal/rich-text.js +4 -0
- package/dist/react/internal/table-context.d.ts +39 -0
- package/dist/react/internal/table-context.js +12 -0
- package/dist/react/internal/use-object-url.d.ts +1 -0
- package/dist/react/internal/use-object-url.js +15 -0
- package/dist/react/layout.css +274 -0
- package/dist/react/layout.css.d.ts +1 -0
- package/dist/react/models/filter.d.ts +31 -0
- package/dist/react/models/filter.js +79 -0
- package/dist/react/models/kanban.d.ts +51 -0
- package/dist/react/models/kanban.js +35 -0
- package/dist/react/models/reorder.d.ts +9 -0
- package/dist/react/models/reorder.js +23 -0
- package/dist/react/models/table.d.ts +85 -0
- package/dist/react/models/table.js +144 -0
- package/dist/react/models/tree.d.ts +16 -0
- package/dist/react/models/tree.js +26 -0
- package/dist/react/provider.d.ts +18 -0
- package/dist/react/provider.js +31 -0
- package/dist/react/recipes/context-hypercms.d.ts +17 -0
- package/dist/react/recipes/context-hypercms.js +71 -0
- package/dist/react/recipes/context-quickcrop.d.ts +8 -0
- package/dist/react/recipes/context-quickcrop.js +49 -0
- package/dist/react/theme.css +8004 -0
- package/dist/react/theme.css.d.ts +1 -0
- package/examples/README.md +34 -0
- package/examples/components/activity-feed.html +28 -0
- package/examples/components/app-shell.html +12 -0
- package/examples/components/app-toolbar.html +38 -0
- package/examples/components/avatar-group.html +27 -0
- package/examples/components/breadcrumbs.html +26 -0
- package/examples/components/bulk-bar.html +22 -0
- package/examples/components/code-block.html +12 -0
- package/examples/components/code-editor.html +25 -0
- package/examples/components/column-manager.html +9 -0
- package/examples/components/combobox.html +13 -0
- package/examples/components/context-hypercms.css +41 -0
- package/examples/components/context-hypercms.html +40 -0
- package/examples/components/context-hypercms.js +62 -0
- package/examples/components/context-quickcrop.html +137 -0
- package/examples/components/diff-view.html +9 -0
- package/examples/components/drawer.html +11 -0
- package/examples/components/editable-grid-cells.html +9 -0
- package/examples/components/file-browser.html +53 -0
- package/examples/components/file-tree.html +34 -0
- package/examples/components/files-table.html +80 -0
- package/examples/components/filter-builder.html +11 -0
- package/examples/components/form-error-summary.html +11 -0
- package/examples/components/index.html +51 -0
- package/examples/components/inline-edit.html +42 -0
- package/examples/components/kanban-board.html +42 -0
- package/examples/components/manifest.json +3279 -0
- package/examples/components/modal.html +11 -0
- package/examples/components/multi-select-picker.html +13 -0
- package/examples/components/pagination.html +32 -0
- package/examples/components/persistent-action-banner.html +23 -0
- package/examples/components/popconfirm.html +13 -0
- package/examples/components/popover-menu.html +13 -0
- package/examples/components/reference/baseline/DECISIONS.md +85 -0
- package/examples/components/reference/baseline/README.md +58 -0
- package/examples/components/reference/baseline/bevel-fonts.css +16 -0
- package/examples/components/reference/baseline/bevel.css +1339 -0
- package/examples/components/reference/baseline/bevel.js +496 -0
- package/examples/components/reference/baseline/fonts/LICENSE-ibm-plex-mono.txt +93 -0
- package/examples/components/reference/baseline/fonts/LICENSE-ibm-plex-sans.txt +93 -0
- package/examples/components/reference/baseline/fonts/LICENSE-newsreader.txt +93 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-400-italic.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/newsreader-latin-opsz-italic.woff2 +0 -0
- package/examples/components/reference/baseline/fonts/newsreader-latin-opsz-normal.woff2 +0 -0
- package/examples/components/reference/fable/IMPROVEMENTS.md +106 -0
- package/examples/components/reference/fable/PARENT-REPAIRS.md +17 -0
- package/examples/components/reference/fable/__pycache__/build_repairs.cpython-311.pyc +0 -0
- package/examples/components/reference/fable/__pycache__/kanban.cpython-311.pyc +0 -0
- package/examples/components/reference/fable/as-authored/IMPROVEMENTS-completed.md +106 -0
- package/examples/components/reference/fable/as-authored/base-astra.css +17 -0
- package/examples/components/reference/fable/as-authored/base-parent.css +416 -0
- package/examples/components/reference/fable/as-authored/build.py +858 -0
- package/examples/components/reference/fable/as-authored/fable.css +823 -0
- package/examples/components/reference/fable/as-authored/kanban-completed.css +235 -0
- package/examples/components/reference/fable/as-authored/kanban-completed.html +53 -0
- package/examples/components/reference/fable/as-authored/kanban-completed.py +212 -0
- package/examples/components/reference/fable/as-authored/kanban.py +207 -0
- package/examples/components/reference/fable/base-astra.css +17 -0
- package/examples/components/reference/fable/base-parent.css +416 -0
- package/examples/components/reference/fable/build.py +858 -0
- package/examples/components/reference/fable/build_repairs.py +25 -0
- package/examples/components/reference/fable/components/activity-feed.html +3 -0
- package/examples/components/reference/fable/components/app-toolbar.html +3 -0
- package/examples/components/reference/fable/components/avatar-group.html +4 -0
- package/examples/components/reference/fable/components/breadcrumbs.html +3 -0
- package/examples/components/reference/fable/components/code-block.html +9 -0
- package/examples/components/reference/fable/components/column-manager.html +3 -0
- package/examples/components/reference/fable/components/combobox.html +6 -0
- package/examples/components/reference/fable/components/context-hypercms.html +3 -0
- package/examples/components/reference/fable/components/context-quickcrop.html +4 -0
- package/examples/components/reference/fable/components/diff-view.html +13 -0
- package/examples/components/reference/fable/components/drawer.html +3 -0
- package/examples/components/reference/fable/components/editable-grid-cells.html +3 -0
- package/examples/components/reference/fable/components/filter-builder.html +3 -0
- package/examples/components/reference/fable/components/form-error-summary.html +4 -0
- package/examples/components/reference/fable/components/inline-edit.html +3 -0
- package/examples/components/reference/fable/components/kanban-board.html +53 -0
- package/examples/components/reference/fable/components/modal.html +3 -0
- package/examples/components/reference/fable/components/multi-select-picker.html +5 -0
- package/examples/components/reference/fable/components/pagination.html +3 -0
- package/examples/components/reference/fable/components/persistent-action-banner.html +4 -0
- package/examples/components/reference/fable/components/popconfirm.html +5 -0
- package/examples/components/reference/fable/components/popover-menu.html +3 -0
- package/examples/components/reference/fable/components/rich-text-toolbar.html +3 -0
- package/examples/components/reference/fable/components/save-status-indicator.html +2 -0
- package/examples/components/reference/fable/components/selectable-cards.html +3 -0
- package/examples/components/reference/fable/components/settings-rows.html +3 -0
- package/examples/components/reference/fable/components/sidebar-nav.html +4 -0
- package/examples/components/reference/fable/components/small-charts.html +5 -0
- package/examples/components/reference/fable/components/split-button.html +4 -0
- package/examples/components/reference/fable/components/split-panes.html +8 -0
- package/examples/components/reference/fable/components/stat-tiles.html +3 -0
- package/examples/components/reference/fable/components/toast-stack.html +5 -0
- package/examples/components/reference/fable/components/tree-view.html +4 -0
- package/examples/components/reference/fable/components/upload-dropzone.html +6 -0
- package/examples/components/reference/fable/components/wizard-shell.html +3 -0
- package/examples/components/reference/fable/coverage.json +414 -0
- package/examples/components/reference/fable/fable.css +823 -0
- package/examples/components/reference/fable/index.html +5 -0
- package/examples/components/reference/fable/kanban.css +237 -0
- package/examples/components/reference/fable/kanban.py +212 -0
- package/examples/components/reference/fable/parent-repairs.css +9 -0
- package/examples/components/reference/fixtures/data.json +102 -0
- package/examples/components/reference/fixtures/host.js +47 -0
- package/examples/components/reference/fixtures/static-host.js +39 -0
- package/examples/components/reference/fixtures/workspace.jpg +0 -0
- package/examples/components/reference/parent/CHANGES.md +179 -0
- package/examples/components/reference/parent/__pycache__/kanban.cpython-311.pyc +0 -0
- package/examples/components/reference/parent/base-astra.css +17 -0
- package/examples/components/reference/parent/base-parent.css +416 -0
- package/examples/components/reference/parent/build.py +148 -0
- package/examples/components/reference/parent/components/activity-feed.html +2 -0
- package/examples/components/reference/parent/components/app-toolbar.html +2 -0
- package/examples/components/reference/parent/components/avatar-group.html +4 -0
- package/examples/components/reference/parent/components/breadcrumbs.html +2 -0
- package/examples/components/reference/parent/components/code-block.html +8 -0
- package/examples/components/reference/parent/components/column-manager.html +2 -0
- package/examples/components/reference/parent/components/combobox.html +6 -0
- package/examples/components/reference/parent/components/context-hypercms.html +2 -0
- package/examples/components/reference/parent/components/context-quickcrop.html +4 -0
- package/examples/components/reference/parent/components/diff-view.html +4 -0
- package/examples/components/reference/parent/components/drawer.html +2 -0
- package/examples/components/reference/parent/components/editable-grid-cells.html +2 -0
- package/examples/components/reference/parent/components/filter-builder.html +2 -0
- package/examples/components/reference/parent/components/form-error-summary.html +2 -0
- package/examples/components/reference/parent/components/inline-edit.html +2 -0
- package/examples/components/reference/parent/components/kanban-board.html +84 -0
- package/examples/components/reference/parent/components/modal.html +2 -0
- package/examples/components/reference/parent/components/multi-select-picker.html +5 -0
- package/examples/components/reference/parent/components/pagination.html +2 -0
- package/examples/components/reference/parent/components/persistent-action-banner.html +4 -0
- package/examples/components/reference/parent/components/popconfirm.html +5 -0
- package/examples/components/reference/parent/components/popover-menu.html +2 -0
- package/examples/components/reference/parent/components/rich-text-toolbar.html +2 -0
- package/examples/components/reference/parent/components/save-status-indicator.html +2 -0
- package/examples/components/reference/parent/components/selectable-cards.html +2 -0
- package/examples/components/reference/parent/components/settings-rows.html +2 -0
- package/examples/components/reference/parent/components/sidebar-nav.html +4 -0
- package/examples/components/reference/parent/components/small-charts.html +2 -0
- package/examples/components/reference/parent/components/split-button.html +5 -0
- package/examples/components/reference/parent/components/split-panes.html +8 -0
- package/examples/components/reference/parent/components/stat-tiles.html +2 -0
- package/examples/components/reference/parent/components/toast-stack.html +5 -0
- package/examples/components/reference/parent/components/tree-view.html +4 -0
- package/examples/components/reference/parent/components/upload-dropzone.html +6 -0
- package/examples/components/reference/parent/components/wizard-shell.html +2 -0
- package/examples/components/reference/parent/coverage.json +414 -0
- package/examples/components/reference/parent/index.html +1 -0
- package/examples/components/reference/parent/kanban.css +114 -0
- package/examples/components/reference/parent/kanban.py +55 -0
- package/examples/components/reference/parent/refinement.css +53 -0
- package/examples/components/reference/selected/build.py +70 -0
- package/examples/components/reference/selected/components/activity-feed.html +3 -0
- package/examples/components/reference/selected/components/app-toolbar.html +3 -0
- package/examples/components/reference/selected/components/avatar-group.html +4 -0
- package/examples/components/reference/selected/components/breadcrumbs.html +3 -0
- package/examples/components/reference/selected/components/code-block.html +9 -0
- package/examples/components/reference/selected/components/column-manager.html +3 -0
- package/examples/components/reference/selected/components/combobox.html +6 -0
- package/examples/components/reference/selected/components/context-hypercms.html +3 -0
- package/examples/components/reference/selected/components/context-quickcrop.html +4 -0
- package/examples/components/reference/selected/components/diff-view.html +13 -0
- package/examples/components/reference/selected/components/drawer.html +3 -0
- package/examples/components/reference/selected/components/editable-grid-cells.html +3 -0
- package/examples/components/reference/selected/components/filter-builder.html +3 -0
- package/examples/components/reference/selected/components/form-error-summary.html +4 -0
- package/examples/components/reference/selected/components/inline-edit.html +3 -0
- package/examples/components/reference/selected/components/kanban-board.html +53 -0
- package/examples/components/reference/selected/components/modal.html +2 -0
- package/examples/components/reference/selected/components/multi-select-picker.html +5 -0
- package/examples/components/reference/selected/components/pagination.html +3 -0
- package/examples/components/reference/selected/components/persistent-action-banner.html +4 -0
- package/examples/components/reference/selected/components/popconfirm.html +5 -0
- package/examples/components/reference/selected/components/popover-menu.html +3 -0
- package/examples/components/reference/selected/components/rich-text-toolbar.html +3 -0
- package/examples/components/reference/selected/components/save-status-indicator.html +2 -0
- package/examples/components/reference/selected/components/selectable-cards.html +3 -0
- package/examples/components/reference/selected/components/settings-rows.html +3 -0
- package/examples/components/reference/selected/components/sidebar-nav.html +4 -0
- package/examples/components/reference/selected/components/small-charts.html +5 -0
- package/examples/components/reference/selected/components/split-button.html +4 -0
- package/examples/components/reference/selected/components/split-panes.html +8 -0
- package/examples/components/reference/selected/components/stat-tiles.html +3 -0
- package/examples/components/reference/selected/components/toast-stack.html +5 -0
- package/examples/components/reference/selected/components/tree-view.html +4 -0
- package/examples/components/reference/selected/components/upload-dropzone.html +6 -0
- package/examples/components/reference/selected/components/wizard-shell.html +3 -0
- package/examples/components/reference/selected/corrections.css +11 -0
- package/examples/components/reference/selected/coverage.json +413 -0
- package/examples/components/reference/selected/gallery-build.mjs +49 -0
- package/examples/components/reference/selected/gallery-spec.json +12 -0
- package/examples/components/reference/selected/index.html +1 -0
- package/examples/components/reference/selected/kanban-comparison.json +6 -0
- package/examples/components/reference/selected/manifest.json +476 -0
- package/examples/components/reference/sha256.json +142 -0
- package/examples/components/reference/sources/diagonal-close.svg +1 -0
- package/examples/components/reference/sources/hyperclay/public-assets/css/hyperclay-app-source.css +614 -0
- package/examples/components/reference/sources/hyperclay/public-assets/js/app.js +94 -0
- package/examples/components/reference/sources/hyperclayjs/src/ui/theModal.js +897 -0
- package/examples/components/reference/sources/hypercms/scripts/build-theme.js +203 -0
- package/examples/components/reference/sources/hypercms/src/anchor.js +24 -0
- package/examples/components/reference/sources/hypercms/src/apply-loop.js +167 -0
- package/examples/components/reference/sources/hypercms/src/diagnostics.js +44 -0
- package/examples/components/reference/sources/hypercms/src/enhance.js +173 -0
- package/examples/components/reference/sources/hypercms/src/events.js +955 -0
- package/examples/components/reference/sources/hypercms/src/form-builder.js +518 -0
- package/examples/components/reference/sources/hypercms/src/form-rules.js +208 -0
- package/examples/components/reference/sources/hypercms/src/hooks.js +100 -0
- package/examples/components/reference/sources/hypercms/src/hypercms-bundle.js +10 -0
- package/examples/components/reference/sources/hypercms/src/hypercms.js +347 -0
- package/examples/components/reference/sources/hypercms/src/morph.js +10 -0
- package/examples/components/reference/sources/hypercms/src/path.js +61 -0
- package/examples/components/reference/sources/hypercms/src/place.js +131 -0
- package/examples/components/reference/sources/hypercms/src/platform.js +131 -0
- package/examples/components/reference/sources/hypercms/src/refresh.js +87 -0
- package/examples/components/reference/sources/hypercms/src/richclay-bridge.js +140 -0
- package/examples/components/reference/sources/hypercms/src/row-identity.js +111 -0
- package/examples/components/reference/sources/hypercms/src/scaffold.js +10 -0
- package/examples/components/reference/sources/hypercms/src/session.js +303 -0
- package/examples/components/reference/sources/hypercms/src/shell.js +248 -0
- package/examples/components/reference/sources/hypercms/src/styles.css +298 -0
- package/examples/components/reference/sources/hypercms/src/targets.js +144 -0
- package/examples/components/reference/sources/hypercms/src/templates.js +656 -0
- package/examples/components/reference/sources/hypercms/src/theme/pixel-quiet.overrides.css +761 -0
- package/examples/components/reference/sources/hypercms/src/theme.generated.css +1772 -0
- package/examples/components/reference/sources/hypercms/src/toggle.js +666 -0
- package/examples/components/reference/sources/hypercms/src/unresolved.js +211 -0
- package/examples/components/reference/sources/hypercms/src/vendor/mirk.vendor.js +212 -0
- package/examples/components/reference/sources/hypercms/src/views/inline-layer.js +421 -0
- package/examples/components/reference/sources/hypercms/src/views/inline.js +1072 -0
- package/examples/components/reference/sources/hypercms/src/views/sidebar.js +97 -0
- package/examples/components/reference/sources/modal-reference.html +301 -0
- package/examples/components/reference/sources/quickcrop/quickcrop.css +124 -0
- package/examples/components/reference/sources/quickcrop/quickcrop.js +400 -0
- package/examples/components/reference/sources/richclay/richclay.css +416 -0
- package/examples/components/reference/sources/richclay/richclay.js +2962 -0
- package/examples/components/reference/sources/richclay/src/a11y.js +67 -0
- package/examples/components/reference/sources/richclay/src/browser-global.js +7 -0
- package/examples/components/reference/sources/richclay/src/buttons.js +254 -0
- package/examples/components/reference/sources/richclay/src/hyperclay.js +470 -0
- package/examples/components/reference/sources/richclay/src/normalize.js +380 -0
- package/examples/components/reference/sources/richclay/src/richclay.js +1356 -0
- package/examples/components/reference/sources/richclay/src/sanitize.js +189 -0
- package/examples/components/reference/sources/richclay/src/styles.js +23 -0
- package/examples/components/reference/sources/richclay/src/toolbar-float.js +175 -0
- package/examples/components/reference/sources/richclay/src/toolbar.js +394 -0
- package/examples/components/reference/sources/richclay/src/vendor-bundle.js +15 -0
- package/examples/components/reference/sources/richclay/vendor/DOMPURIFY-LICENSE +202 -0
- package/examples/components/reference/sources/richclay/vendor/DOMPURIFY-LICENSE-MPL +373 -0
- package/examples/components/reference/sources/richclay/vendor/SQUIRE-LICENSE +21 -0
- package/examples/components/reference/sources/richclay/vendor/purify.es.mjs +2249 -0
- package/examples/components/reference/sources/richclay/vendor/purify.min.js +3 -0
- package/examples/components/reference/sources/richclay/vendor/squire.js +22 -0
- package/examples/components/reference/sources/richclay/vendor/squire.mjs +22 -0
- package/examples/components/reference/sources/richclay/vendor/squire.provenance.json +19 -0
- package/examples/components/rich-text-toolbar.html +43 -0
- package/examples/components/save-status-indicator.html +11 -0
- package/examples/components/selectable-cards.html +9 -0
- package/examples/components/settings-rows.html +10 -0
- package/examples/components/sidebar-nav.html +9 -0
- package/examples/components/small-charts.html +21 -0
- package/examples/components/split-button.html +13 -0
- package/examples/components/split-panes-editor.html +6 -0
- package/examples/components/split-panes.html +9 -0
- package/examples/components/stat-tiles.html +23 -0
- package/examples/components/toast-stack.html +21 -0
- package/examples/components/tree-view.html +9 -0
- package/examples/components/upload-dropzone.html +88 -0
- package/examples/components/wizard-shell.html +50 -0
- package/examples/datastar/index.html +38 -0
- package/examples/datastar/server.mjs +31 -0
- package/examples/fixtures/field-guide.pdf +14 -0
- package/examples/fixtures/workspace.jpg +0 -0
- package/examples/setup-peers.mjs +35 -0
- package/fonts/LICENSE-ibm-plex-mono.txt +93 -0
- package/fonts/LICENSE-ibm-plex-sans.txt +93 -0
- package/fonts/LICENSE-newsreader.txt +93 -0
- package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-400-italic.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/fonts/newsreader-latin-opsz-italic.woff2 +0 -0
- package/fonts/newsreader-latin-opsz-normal.woff2 +0 -0
- package/icons/LICENSE +21 -0
- package/icons/house.json +71 -0
- package/icons/icons.d.ts +17 -0
- package/icons/icons.js +648 -0
- package/icons/icons.svg +126 -0
- package/icons/marks/build-tray.source.mjs +45 -0
- package/icons/marks/hyperclay-local.svg +11 -0
- package/icons/phosphor.json +53 -0
- package/icons/round.json +8 -0
- package/integrations/datastar.js +202 -0
- package/integrations/quickcrop.css +26 -0
- package/integrations/quickcrop.js +56 -0
- package/integrations/richclay.css +100 -0
- package/integrations/richclay.js +131 -0
- package/package.json +630 -0
- package/react/README.md +244 -0
- package/src/README.md +83 -0
- package/vendor/datastar/datastar-1.0.3.js +10 -0
- package/vendor/datastar/provenance.json +6 -0
- package/vendor/floating-ui/LICENSE-core +20 -0
- package/vendor/floating-ui/LICENSE-dom +20 -0
- package/vendor/floating-ui/floating-ui.core.umd.min.js +1 -0
- package/vendor/floating-ui/floating-ui.dom.umd.min.js +1 -0
- package/vendor/floating-ui/provenance.json +17 -0
- package/vendor/richclay/LICENSE +16 -0
- package/vendor/richclay/THIRD-PARTY-NOTICES.md +45 -0
- package/vendor/richclay/provenance.json +17 -0
- package/vendor/richclay/richclay.css +404 -0
- package/vendor/richclay/richclay.js +2940 -0
- package/vendor/richclay/vendor/DOMPURIFY-LICENSE +202 -0
- package/vendor/richclay/vendor/DOMPURIFY-LICENSE-MPL +373 -0
- package/vendor/richclay/vendor/SQUIRE-LICENSE +21 -0
- package/vendor/richclay/vendor/purify.min.js +3 -0
- package/vendor/richclay/vendor/squire.js +22 -0
- package/vendor/richclay/vendor/squire.provenance.json +30 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import domAdapter from 'hyper-html-api/dom'
|
|
2
|
+
import { ruleAttrIndex, DOM_PROPERTIES_READ_ONLY_SET } from 'hyper-html-api/engine'
|
|
3
|
+
|
|
4
|
+
const PREFIX = '[hypercms]'
|
|
5
|
+
|
|
6
|
+
// The opts every other engine call in hypercms uses: never traverse into the
|
|
7
|
+
// sidebar's own form, never count a [cms-template] seed as content.
|
|
8
|
+
const FIND_OPTS = { skip: '[data-hcms-shell]', templateAttr: 'cms-template' }
|
|
9
|
+
// templateAttr:null includes seeds. An empty list still holding its seed can be
|
|
10
|
+
// grown back from it, so it is not dead.
|
|
11
|
+
const SEED_OPTS = { skip: '[data-hcms-shell]', templateAttr: null }
|
|
12
|
+
|
|
13
|
+
export class InvalidRuleSelector extends Error {
|
|
14
|
+
constructor(path, selector, cause) {
|
|
15
|
+
super(`hypercms: rule at "${path}" has an invalid CSS selector: "${selector}"`)
|
|
16
|
+
this.name = 'InvalidRuleSelector'
|
|
17
|
+
this.path = path
|
|
18
|
+
this.selector = selector
|
|
19
|
+
this.cause = cause
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Report a field only when writing to it would be silently discarded, which is
|
|
24
|
+
// exactly when apply() finds no element and returns having done nothing.
|
|
25
|
+
// An extracted null is NOT that test: a present-but-empty attribute reads null
|
|
26
|
+
// too (extract.js readPropOrAttr), and that field saves perfectly. So this
|
|
27
|
+
// resolves each rule's selector and counts matches instead of reading values.
|
|
28
|
+
export function findUnresolved(root, rules) {
|
|
29
|
+
const missing = []
|
|
30
|
+
const twins = []
|
|
31
|
+
const readOnly = []
|
|
32
|
+
walk(root, rules, [], missing, twins, readOnly)
|
|
33
|
+
return { missing: unique(missing), twins: uniqueTwins(twins), readOnly: unique(readOnly) }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// The rules to WRITE with. Extract keeps the full tree, because a read-only
|
|
37
|
+
// projection still READS (".box@classList" reads its class list) and dropping
|
|
38
|
+
// it would change what onChange reports. apply() ignores data keys its rules do
|
|
39
|
+
// not mention, so narrowing only the write side costs nothing and removes the
|
|
40
|
+
// failure class: apply throws RuleTargetReadOnly part-way through its walk, and
|
|
41
|
+
// the ordinary edit path does not snapshot, so the writes ordered before the
|
|
42
|
+
// throw stay and the ones after never happen.
|
|
43
|
+
export function stripReadOnly(rules) {
|
|
44
|
+
return strip(rules)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function strip(rule) {
|
|
48
|
+
if (typeof rule === 'string') return isReadOnlyRule(rule) ? undefined : rule
|
|
49
|
+
if (Array.isArray(rule)) {
|
|
50
|
+
const [selector, shape] = rule
|
|
51
|
+
// Keep the tuple even when the item shape strips to nothing. The selector is
|
|
52
|
+
// what engine.apply needs in order to add, remove and reorder rows, so
|
|
53
|
+
// dropping it made every structural operation on a list whose only field is
|
|
54
|
+
// read-only report success while the page did not change. An undefined item
|
|
55
|
+
// shape writes no value and leaves row reconciliation intact.
|
|
56
|
+
return [selector, strip(shape)]
|
|
57
|
+
}
|
|
58
|
+
if (rule && typeof rule === 'object') {
|
|
59
|
+
const out = {}
|
|
60
|
+
for (const [key, sub] of Object.entries(rule)) {
|
|
61
|
+
const kept = strip(sub)
|
|
62
|
+
if (kept !== undefined) out[key] = kept
|
|
63
|
+
}
|
|
64
|
+
return out
|
|
65
|
+
}
|
|
66
|
+
return rule
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function walk(ctx, rule, path, missing, twins, readOnly) {
|
|
70
|
+
if (typeof rule === 'string') {
|
|
71
|
+
const selector = selectorOf(rule)
|
|
72
|
+
// Resolve the selector even for a read-only rule, so an invalid one still
|
|
73
|
+
// becomes InvalidRuleSelector here rather than a raw SyntaxError out of the
|
|
74
|
+
// extract that follows.
|
|
75
|
+
const matches = selector ? find(ctx, selector, FIND_OPTS, path) : []
|
|
76
|
+
// Reported on its own and never also as missing: the selector may well
|
|
77
|
+
// match, and the reason the edit cannot land is the property, not the
|
|
78
|
+
// element.
|
|
79
|
+
if (isReadOnlyRule(rule)) {
|
|
80
|
+
readOnly.push(pathStr(path))
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
if (!selector) return
|
|
84
|
+
if (rule.endsWith('[]')) {
|
|
85
|
+
if (matches.length === 0 && find(ctx, selector, SEED_OPTS, path).length === 0) {
|
|
86
|
+
missing.push(pathStr(path))
|
|
87
|
+
}
|
|
88
|
+
return
|
|
89
|
+
}
|
|
90
|
+
if (matches.length === 0) missing.push(pathStr(path))
|
|
91
|
+
else if (matches.length > 1) twins.push({ path: pathStr(path), count: matches.length })
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (Array.isArray(rule)) {
|
|
96
|
+
const [selector, shape] = rule
|
|
97
|
+
if (typeof selector !== 'string' || !selector) return
|
|
98
|
+
const matches = find(ctx, selector, FIND_OPTS, path)
|
|
99
|
+
if (matches.length === 0) {
|
|
100
|
+
if (find(ctx, selector, SEED_OPTS, path).length === 0) missing.push(pathStr(path))
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
// Rows collapse to one '*' segment, so a field broken on every row is
|
|
104
|
+
// reported once rather than once per row.
|
|
105
|
+
for (const node of matches) walk(node, shape, [...path, '*'], missing, twins, readOnly)
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (rule && typeof rule === 'object') {
|
|
110
|
+
for (const [key, sub] of Object.entries(rule)) walk(ctx, sub, [...path, key], missing, twins, readOnly)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function find(ctx, selector, opts, path) {
|
|
115
|
+
try {
|
|
116
|
+
return domAdapter.find(ctx, selector, opts)
|
|
117
|
+
} catch (err) {
|
|
118
|
+
throw new InvalidRuleSelector(pathStr(path), selector, err)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Mirrors the engine's scalar parsing: a trailing [] strips, "." and a leading
|
|
123
|
+
// @ read the context node itself so they can never fail to resolve, and
|
|
124
|
+
// otherwise the selector is the part before the separator @ (the last one that
|
|
125
|
+
// is not inside brackets or quotes, so a mailto address stays in the selector).
|
|
126
|
+
function selectorOf(rule) {
|
|
127
|
+
if (rule === '.' || rule.startsWith('@')) return null
|
|
128
|
+
if (rule.endsWith('[]')) return rule.slice(0, -2) || null
|
|
129
|
+
const at = ruleAttrIndex(rule)
|
|
130
|
+
return (at === -1 ? rule : rule.slice(0, at)) || null
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// The attribute or property half of a scalar rule, or null when the rule is a
|
|
134
|
+
// bare selector, an array rule, or ".". ruleAttrIndex returns the index of the
|
|
135
|
+
// last top-level @, so a leading @ (the context node itself) resolves here too.
|
|
136
|
+
function attrOf(rule) {
|
|
137
|
+
if (rule.endsWith('[]')) return null
|
|
138
|
+
const at = ruleAttrIndex(rule)
|
|
139
|
+
return at === -1 ? null : rule.slice(at + 1) || null
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isReadOnlyRule(rule) {
|
|
143
|
+
const attr = attrOf(rule)
|
|
144
|
+
return attr != null && DOM_PROPERTIES_READ_ONLY_SET.has(attr)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function applyUnresolvedState(ctx) {
|
|
148
|
+
renderNotice(ctx)
|
|
149
|
+
warnTwins(ctx)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// States the fact and stops. Regenerating a CMS replaces the rules tag
|
|
153
|
+
// wholesale, so a notice that reads as a repair prompt would walk anyone with a
|
|
154
|
+
// hand-edited config into losing it.
|
|
155
|
+
function renderNotice(ctx) {
|
|
156
|
+
const el = ctx.noticeEl
|
|
157
|
+
if (!el) return
|
|
158
|
+
const missing = (ctx.unresolved && ctx.unresolved.missing) || []
|
|
159
|
+
const readOnly = (ctx.unresolved && ctx.unresolved.readOnly) || []
|
|
160
|
+
if (missing.length === 0 && readOnly.length === 0) {
|
|
161
|
+
el.textContent = ''
|
|
162
|
+
el.hidden = true
|
|
163
|
+
return
|
|
164
|
+
}
|
|
165
|
+
const lines = []
|
|
166
|
+
if (missing.length) {
|
|
167
|
+
const count = missing.length === 1
|
|
168
|
+
? '1 field no longer matches this page'
|
|
169
|
+
: `${missing.length} fields no longer match this page`
|
|
170
|
+
lines.push(`${count}: ${missing.join(', ')}`)
|
|
171
|
+
}
|
|
172
|
+
if (readOnly.length) {
|
|
173
|
+
const count = readOnly.length === 1
|
|
174
|
+
? '1 field reads a property the browser will not let anything write'
|
|
175
|
+
: `${readOnly.length} fields read properties the browser will not let anything write`
|
|
176
|
+
lines.push(`${count}: ${readOnly.join(', ')}`)
|
|
177
|
+
}
|
|
178
|
+
el.textContent = lines.join('\n')
|
|
179
|
+
el.hidden = false
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Two elements matching one scalar rule still works, since the write lands on
|
|
183
|
+
// the first, so this is a console note rather than a notice. Runtime duplicates
|
|
184
|
+
// (a carousel cloning slides, a dialog holding a second copy) are ordinary.
|
|
185
|
+
// Signature-gated because the walk reruns on every refresh.
|
|
186
|
+
function warnTwins(ctx) {
|
|
187
|
+
const twins = (ctx.unresolved && ctx.unresolved.twins) || []
|
|
188
|
+
const signature = twins.map((t) => `${t.path}:${t.count}`).join('|')
|
|
189
|
+
if (signature === ctx.lastTwinSignature) return
|
|
190
|
+
ctx.lastTwinSignature = signature
|
|
191
|
+
for (const { path, count } of twins) {
|
|
192
|
+
console.warn(`${PREFIX} "${path}" matches ${count} elements; edits go to the first one.`)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function unique(list) {
|
|
197
|
+
return [...new Set(list)]
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function uniqueTwins(list) {
|
|
201
|
+
const byPath = new Map()
|
|
202
|
+
for (const twin of list) {
|
|
203
|
+
const seen = byPath.get(twin.path)
|
|
204
|
+
if (!seen || twin.count > seen.count) byPath.set(twin.path, twin)
|
|
205
|
+
}
|
|
206
|
+
return [...byPath.values()]
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function pathStr(path) {
|
|
210
|
+
return path.length ? path.join('.') : '(whole page)'
|
|
211
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/* VENDORED from mirk-interface/mirk.js — DO NOT EDIT. Regenerate: npm run build:theme */
|
|
2
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
3
|
+
/*
|
|
4
|
+
* mirk.js — the delegated runtime for the mirk UI kit, v2.
|
|
5
|
+
* https://github.com/panphora/mirk-interface
|
|
6
|
+
*
|
|
7
|
+
* One listener per interaction on `document`. No init(), no MutationObserver:
|
|
8
|
+
* every current AND future element is handled, so injected / re-rendered /
|
|
9
|
+
* saved-and-reopened markup just works. Idempotent; safe to include twice.
|
|
10
|
+
*
|
|
11
|
+
* The markup carries the initial state — chips are real DOM, the slider fill is
|
|
12
|
+
* an inline --mirk-value, native inputs hold their own value — so the page is
|
|
13
|
+
* correct before this script runs. JS only enhances the transitions.
|
|
14
|
+
*/
|
|
15
|
+
(function () {
|
|
16
|
+
if (window.__mirk) return;
|
|
17
|
+
window.__mirk = true;
|
|
18
|
+
|
|
19
|
+
// Crisp × for remove affordances — a font glyph renders at a different weight
|
|
20
|
+
// and baseline in every typeface, so draw it as a tiny square-capped vector.
|
|
21
|
+
const X_SVG = '<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4 12 12M12 4 4 12" stroke="currentColor" stroke-width="2" stroke-linecap="square" fill="none"/></svg>';
|
|
22
|
+
|
|
23
|
+
// Number stepper — bevel buttons drive the native input.
|
|
24
|
+
document.addEventListener("click", (e) => {
|
|
25
|
+
const step = e.target.closest(".mirk-number__step");
|
|
26
|
+
if (!step) return;
|
|
27
|
+
const input = step.closest(".mirk-number").querySelector("input[type=number]");
|
|
28
|
+
if (!input) return;
|
|
29
|
+
step.dataset.step === "up" ? input.stepUp() : input.stepDown();
|
|
30
|
+
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Slider — mirror the value into --mirk-value on the wrapper (fill width + nub
|
|
34
|
+
// left both read it). The markup ships an inline --mirk-value matching value=,
|
|
35
|
+
// so the fill is correct before this runs; this only handles dragging.
|
|
36
|
+
document.addEventListener("input", (e) => {
|
|
37
|
+
const input = e.target.closest(".mirk-slider__input");
|
|
38
|
+
if (!input) return;
|
|
39
|
+
input.closest(".mirk-slider").style.setProperty("--mirk-value", `${input.value}%`);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// File picker — show the chosen file as a link to it, with a × to clear. The kit
|
|
43
|
+
// has no upload, so the link is a local object URL; an app swaps in the uploaded
|
|
44
|
+
// URL. State lives in the input's files.
|
|
45
|
+
document.addEventListener("change", (e) => {
|
|
46
|
+
const input = e.target.closest(".mirk-file__input");
|
|
47
|
+
if (!input || !input.files.length) return;
|
|
48
|
+
const root = input.closest(".mirk-file");
|
|
49
|
+
const slot = root.querySelector(".mirk-file__name");
|
|
50
|
+
if (!slot) return;
|
|
51
|
+
const file = input.files[0];
|
|
52
|
+
const link = document.createElement("a");
|
|
53
|
+
link.className = "mirk-file__name";
|
|
54
|
+
link.dataset.filled = "";
|
|
55
|
+
link.href = URL.createObjectURL(file);
|
|
56
|
+
link.target = "_blank";
|
|
57
|
+
link.rel = "noopener";
|
|
58
|
+
link.textContent = file.name;
|
|
59
|
+
slot.replaceWith(link);
|
|
60
|
+
if (!root.querySelector(".mirk-file__remove")) {
|
|
61
|
+
const remove = document.createElement("button");
|
|
62
|
+
remove.type = "button";
|
|
63
|
+
remove.className = "mirk-file__remove";
|
|
64
|
+
remove.setAttribute("aria-label", "Remove file");
|
|
65
|
+
remove.innerHTML = X_SVG;
|
|
66
|
+
link.after(remove);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Image input — FileReader thumbnail preview.
|
|
71
|
+
document.addEventListener("change", (e) => {
|
|
72
|
+
const input = e.target.closest(".mirk-image__input");
|
|
73
|
+
if (!input || !input.files.length) return;
|
|
74
|
+
const root = input.closest(".mirk-image");
|
|
75
|
+
const preview = root.querySelector(".mirk-image__preview");
|
|
76
|
+
if (!preview) return;
|
|
77
|
+
const placeholder = root.querySelector(".mirk-image__placeholder");
|
|
78
|
+
const reader = new FileReader();
|
|
79
|
+
reader.onload = (ev) => {
|
|
80
|
+
preview.src = ev.target.result;
|
|
81
|
+
preview.removeAttribute("hidden");
|
|
82
|
+
if (placeholder) placeholder.setAttribute("hidden", "");
|
|
83
|
+
// compact variant: swap the upload button for the thumbnail
|
|
84
|
+
root.querySelector(".mirk-image__thumb")?.removeAttribute("hidden");
|
|
85
|
+
root.querySelector(".mirk-image__upload")?.setAttribute("hidden", "");
|
|
86
|
+
};
|
|
87
|
+
reader.readAsDataURL(input.files[0]);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// File / image remove — clear the field and return to the empty state.
|
|
91
|
+
document.addEventListener("click", (e) => {
|
|
92
|
+
const fileRemove = e.target.closest(".mirk-file__remove");
|
|
93
|
+
if (fileRemove) {
|
|
94
|
+
const root = fileRemove.closest(".mirk-file");
|
|
95
|
+
const input = root?.querySelector(".mirk-file__input");
|
|
96
|
+
const link = root?.querySelector(".mirk-file__name");
|
|
97
|
+
if (input) input.value = "";
|
|
98
|
+
if (link) {
|
|
99
|
+
const span = document.createElement("span");
|
|
100
|
+
span.className = "mirk-file__name";
|
|
101
|
+
span.textContent = "No file chosen";
|
|
102
|
+
link.replaceWith(span);
|
|
103
|
+
}
|
|
104
|
+
fileRemove.remove();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const imageRemove = e.target.closest(".mirk-image__remove");
|
|
108
|
+
if (imageRemove) {
|
|
109
|
+
const root = imageRemove.closest(".mirk-image");
|
|
110
|
+
const input = root?.querySelector(".mirk-image__input");
|
|
111
|
+
const preview = root?.querySelector(".mirk-image__preview");
|
|
112
|
+
if (input) input.value = "";
|
|
113
|
+
if (preview) { preview.removeAttribute("src"); preview.setAttribute("hidden", ""); }
|
|
114
|
+
root?.querySelector(".mirk-image__thumb")?.setAttribute("hidden", "");
|
|
115
|
+
root?.querySelector(".mirk-image__upload")?.removeAttribute("hidden");
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Tags — Enter / comma adds a real chip, × or Backspace-on-empty removes one.
|
|
120
|
+
// Chips are DOM elements (and carry a hidden input), so outerHTML keeps them.
|
|
121
|
+
function makeChip(value, round) {
|
|
122
|
+
const text = document.createElement("span");
|
|
123
|
+
text.textContent = value;
|
|
124
|
+
const hidden = document.createElement("input");
|
|
125
|
+
hidden.type = "hidden"; hidden.name = "tags[]"; hidden.value = value;
|
|
126
|
+
const remove = document.createElement("button");
|
|
127
|
+
remove.type = "button"; remove.className = "mirk-tags__remove"; remove.textContent = "×";
|
|
128
|
+
|
|
129
|
+
const chip = document.createElement("span");
|
|
130
|
+
chip.className = "mirk-tags__chip";
|
|
131
|
+
if (round) {
|
|
132
|
+
const inner = document.createElement("span");
|
|
133
|
+
inner.className = "mirk-tags__chip-inner";
|
|
134
|
+
inner.append(text, hidden, remove);
|
|
135
|
+
chip.append(inner);
|
|
136
|
+
} else {
|
|
137
|
+
chip.append(text, hidden, remove);
|
|
138
|
+
}
|
|
139
|
+
return chip;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
document.addEventListener("keydown", (e) => {
|
|
143
|
+
const input = e.target.closest(".mirk-tags__input");
|
|
144
|
+
if (!input) return;
|
|
145
|
+
const tags = input.closest(".mirk-tags");
|
|
146
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
147
|
+
const value = input.value.trim();
|
|
148
|
+
if (!value) return;
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
input.before(makeChip(value, tags.classList.contains("mirk-tags--round")));
|
|
151
|
+
input.value = "";
|
|
152
|
+
} else if (e.key === "Backspace" && !input.value) {
|
|
153
|
+
const chips = tags.querySelectorAll(".mirk-tags__chip");
|
|
154
|
+
chips[chips.length - 1]?.remove();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
document.addEventListener("click", (e) => {
|
|
159
|
+
const remove = e.target.closest(".mirk-tags__remove");
|
|
160
|
+
if (remove) { remove.closest(".mirk-tags__chip").remove(); return; }
|
|
161
|
+
const tags = e.target.closest(".mirk-tags");
|
|
162
|
+
if (tags && e.target === tags) tags.querySelector(".mirk-tags__input")?.focus();
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// Collapsible chip — open the panel, collapse back to the chip, toggle the
|
|
166
|
+
// before/after field table. State lives in classes on the markup, so a
|
|
167
|
+
// saved-and-reopened chip keeps whatever it was; this only flips them live.
|
|
168
|
+
document.addEventListener("click", (e) => {
|
|
169
|
+
const t = e.target.closest("[data-mirk-chip]");
|
|
170
|
+
if (!t) return;
|
|
171
|
+
const action = t.getAttribute("data-mirk-chip");
|
|
172
|
+
if (action === "open") t.closest(".mirk-chip")?.classList.add("mirk-chip--open");
|
|
173
|
+
else if (action === "collapse") t.closest(".mirk-chip")?.classList.remove("mirk-chip--open");
|
|
174
|
+
else if (action === "changes") {
|
|
175
|
+
const on = t.closest(".mirk-chip__panel")?.classList.toggle("is-changes");
|
|
176
|
+
t.textContent = on ? "(hide changes)" : "(view changes)";
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// Copy button — delegated so dynamically-added buttons work too.
|
|
181
|
+
// [data-copy] copies the component's innerHTML (clean markup).
|
|
182
|
+
// [data-copy="text"] copies textContent (for <pre>/<code> source blocks
|
|
183
|
+
// whose displayed HTML must paste as raw characters).
|
|
184
|
+
document.addEventListener("click", (e) => {
|
|
185
|
+
const btn = e.target.closest("[data-copy-btn]");
|
|
186
|
+
if (!btn) return;
|
|
187
|
+
const copyable = btn.closest("[data-copy]");
|
|
188
|
+
if (!copyable) return;
|
|
189
|
+
|
|
190
|
+
const clone = copyable.cloneNode(true);
|
|
191
|
+
clone.querySelectorAll("[data-copy-btn]").forEach((b) => b.remove());
|
|
192
|
+
|
|
193
|
+
const mode = copyable.getAttribute("data-copy");
|
|
194
|
+
const payload = mode === "text"
|
|
195
|
+
? clone.textContent.replace(/^\s+|\s+$/g, "")
|
|
196
|
+
: clone.innerHTML
|
|
197
|
+
.replace(/\s+data-copy(="[^"]*")?/g, "")
|
|
198
|
+
.replace(/^\s*\n/gm, "")
|
|
199
|
+
.trim();
|
|
200
|
+
|
|
201
|
+
navigator.clipboard.writeText(payload).then(() => {
|
|
202
|
+
const original = btn.textContent;
|
|
203
|
+
btn.textContent = "copied";
|
|
204
|
+
btn.dataset.copied = "";
|
|
205
|
+
setTimeout(() => { btn.textContent = original; delete btn.dataset.copied; }, 1200);
|
|
206
|
+
}).catch(() => {
|
|
207
|
+
btn.textContent = "error";
|
|
208
|
+
setTimeout(() => { btn.textContent = "copy"; }, 1200);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
})();
|
|
212
|
+
}
|