@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,79 @@
|
|
|
1
|
+
const filterOperators = {
|
|
2
|
+
text: ["equals", "contains", "starts-with", "is-empty"],
|
|
3
|
+
number: ["eq", "ne", "gt", "gte", "lt", "lte", "is-empty"],
|
|
4
|
+
date: ["before", "on", "after", "is-empty"],
|
|
5
|
+
enum: ["is", "is-not", "is-empty"]
|
|
6
|
+
};
|
|
7
|
+
function parseNumber(value) {
|
|
8
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
9
|
+
if (typeof value !== "string" || !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(value.trim())) return null;
|
|
10
|
+
const number = Number(value);
|
|
11
|
+
return Number.isFinite(number) ? number : null;
|
|
12
|
+
}
|
|
13
|
+
function isISODate(value) {
|
|
14
|
+
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
|
|
15
|
+
const date = /* @__PURE__ */ new Date(`${value}T00:00:00Z`);
|
|
16
|
+
return Number.isFinite(date.valueOf()) && date.toISOString().slice(0, 10) === value;
|
|
17
|
+
}
|
|
18
|
+
function validateFilter(expression, fields) {
|
|
19
|
+
const definitions = new Map(fields.map((field) => [field.id, field]));
|
|
20
|
+
const errors = [];
|
|
21
|
+
const ids = /* @__PURE__ */ new Set();
|
|
22
|
+
for (const rule of expression.rules) {
|
|
23
|
+
const field = definitions.get(rule.field);
|
|
24
|
+
let message = "";
|
|
25
|
+
if (!rule.id || ids.has(rule.id)) message = "Each rule needs a unique ID.";
|
|
26
|
+
else if (!field) message = "Choose an available field.";
|
|
27
|
+
else if (!filterOperators[field.type ?? "text"].includes(rule.operator)) message = "Choose an operator for this field.";
|
|
28
|
+
else if (rule.operator !== "is-empty") {
|
|
29
|
+
if (field.type === "number" && parseNumber(rule.value) === null) message = "Enter a number.";
|
|
30
|
+
if (field.type === "date" && !isISODate(rule.value)) message = "Enter a real date in YYYY-MM-DD format.";
|
|
31
|
+
if (field.type === "enum" && field.options && !field.options.some((option) => option.id === rule.value)) message = "Choose an available value.";
|
|
32
|
+
}
|
|
33
|
+
ids.add(rule.id);
|
|
34
|
+
if (message) errors.push({ ruleId: rule.id, message });
|
|
35
|
+
}
|
|
36
|
+
return errors;
|
|
37
|
+
}
|
|
38
|
+
function matchesFilter(row, expression, fields) {
|
|
39
|
+
if (validateFilter(expression, fields).length) return false;
|
|
40
|
+
const definitions = new Map(fields.map((field) => [field.id, field]));
|
|
41
|
+
const matches = (rule) => {
|
|
42
|
+
const field = definitions.get(rule.field);
|
|
43
|
+
const actual = field.getValue ? field.getValue(row) : row[field.id];
|
|
44
|
+
if (rule.operator === "is-empty") return actual == null || actual === "";
|
|
45
|
+
if (field.type === "number") {
|
|
46
|
+
const a2 = parseNumber(actual), b2 = parseNumber(rule.value);
|
|
47
|
+
if (a2 === null || b2 === null) return false;
|
|
48
|
+
switch (rule.operator) {
|
|
49
|
+
case "eq":
|
|
50
|
+
return a2 === b2;
|
|
51
|
+
case "ne":
|
|
52
|
+
return a2 !== b2;
|
|
53
|
+
case "gt":
|
|
54
|
+
return a2 > b2;
|
|
55
|
+
case "gte":
|
|
56
|
+
return a2 >= b2;
|
|
57
|
+
case "lt":
|
|
58
|
+
return a2 < b2;
|
|
59
|
+
case "lte":
|
|
60
|
+
return a2 <= b2;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (field.type === "date") {
|
|
64
|
+
if (!isISODate(actual)) return false;
|
|
65
|
+
return rule.operator === "before" ? actual < rule.value : rule.operator === "after" ? actual > rule.value : actual === rule.value;
|
|
66
|
+
}
|
|
67
|
+
if (field.type === "enum") return rule.operator === "is" ? String(actual) === rule.value : String(actual) !== rule.value;
|
|
68
|
+
const a = String(actual ?? "").toLowerCase(), b = rule.value.toLowerCase();
|
|
69
|
+
return rule.operator === "equals" ? a === b : rule.operator === "contains" ? a.includes(b) : a.startsWith(b);
|
|
70
|
+
};
|
|
71
|
+
return expression.rules.length === 0 || (expression.match === "any" ? expression.rules.some(matches) : expression.rules.every(matches));
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
filterOperators,
|
|
75
|
+
isISODate,
|
|
76
|
+
matchesFilter,
|
|
77
|
+
parseNumber,
|
|
78
|
+
validateFilter
|
|
79
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface KanbanCheck {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface KanbanCard {
|
|
7
|
+
id: string;
|
|
8
|
+
columnId: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
assignee?: string;
|
|
12
|
+
priority?: 'low' | 'normal' | 'high' | 'urgent';
|
|
13
|
+
due?: string;
|
|
14
|
+
labels?: readonly string[];
|
|
15
|
+
checklist?: readonly KanbanCheck[];
|
|
16
|
+
archived?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface KanbanColumn {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
cardIds: readonly string[];
|
|
23
|
+
wip?: number;
|
|
24
|
+
done?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface KanbanValue {
|
|
27
|
+
columns: readonly KanbanColumn[];
|
|
28
|
+
cards: readonly KanbanCard[];
|
|
29
|
+
}
|
|
30
|
+
export interface KanbanFilter {
|
|
31
|
+
query?: string;
|
|
32
|
+
assignee?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
priority?: string;
|
|
35
|
+
dueFrom?: string;
|
|
36
|
+
dueTo?: string;
|
|
37
|
+
due?: 'set' | 'empty';
|
|
38
|
+
archived?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface KanbanMove {
|
|
41
|
+
cardId: string;
|
|
42
|
+
fromColumnId: string;
|
|
43
|
+
toColumnId: string;
|
|
44
|
+
index: number;
|
|
45
|
+
}
|
|
46
|
+
export declare function validateKanban(value: KanbanValue): void;
|
|
47
|
+
export declare function matchesKanban(card: KanbanCard, filter: KanbanFilter): boolean | undefined;
|
|
48
|
+
export declare function moveKanbanCard(value: KanbanValue, cardId: string, toColumnId: string, index: number): {
|
|
49
|
+
value: KanbanValue;
|
|
50
|
+
move: KanbanMove;
|
|
51
|
+
} | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isISODate } from "./filter.js";
|
|
2
|
+
import { moveBetweenColumns } from "./reorder.js";
|
|
3
|
+
function validateKanban(value) {
|
|
4
|
+
const cards = new Map(value.cards.map((card) => [card.id, card])), seen = /* @__PURE__ */ new Set();
|
|
5
|
+
if (cards.size !== value.cards.length || new Set(value.columns.map((column) => column.id)).size !== value.columns.length) throw new Error("Kanban cards and columns need unique IDs.");
|
|
6
|
+
for (const column of value.columns) for (const id of column.cardIds) {
|
|
7
|
+
if (seen.has(id) || !cards.has(id) || cards.get(id).columnId !== column.id) throw new Error("Each Kanban card must belong to exactly one matching column.");
|
|
8
|
+
seen.add(id);
|
|
9
|
+
}
|
|
10
|
+
if (seen.size !== cards.size) throw new Error("Each Kanban card must appear in its column.");
|
|
11
|
+
for (const card of value.cards) if (new Set(card.checklist?.map((item) => item.id)).size !== (card.checklist?.length ?? 0)) throw new Error("Checklist IDs must be unique within a card.");
|
|
12
|
+
}
|
|
13
|
+
function matchesKanban(card, filter) {
|
|
14
|
+
if (Boolean(card.archived) !== Boolean(filter.archived)) return false;
|
|
15
|
+
if (filter.dueFrom && !isISODate(filter.dueFrom) || filter.dueTo && !isISODate(filter.dueTo)) return false;
|
|
16
|
+
const query = filter.query?.trim().toLowerCase();
|
|
17
|
+
return (!query || [card.title, card.description, card.assignee, ...card.labels ?? []].join(" ").toLowerCase().includes(query)) && (!filter.assignee || card.assignee === filter.assignee) && (!filter.label || card.labels?.includes(filter.label)) && (!filter.priority || card.priority === filter.priority) && (!filter.dueFrom || Boolean(card.due && card.due >= filter.dueFrom)) && (!filter.dueTo || Boolean(card.due && card.due <= filter.dueTo)) && (!filter.due || (filter.due === "set" ? Boolean(card.due) : !card.due));
|
|
18
|
+
}
|
|
19
|
+
function moveKanbanCard(value, cardId, toColumnId, index) {
|
|
20
|
+
const card = value.cards.find((card2) => card2.id === cardId), destination = value.columns.find((column) => column.id === toColumnId);
|
|
21
|
+
if (!card || card.disabled || !destination) return null;
|
|
22
|
+
const position = Math.max(0, Math.min(destination.cardIds.filter((id) => id !== cardId).length, Math.trunc(index) || 0));
|
|
23
|
+
const source = value.columns.find((column) => column.id === card.columnId);
|
|
24
|
+
if (source.id === destination.id && source.cardIds.indexOf(cardId) === position) return null;
|
|
25
|
+
const order = moveBetweenColumns(value.columns, cardId, toColumnId, position);
|
|
26
|
+
return {
|
|
27
|
+
value: { columns: value.columns.map((column) => ({ ...column, cardIds: order.find((item) => item.id === column.id).cardIds })), cards: value.cards.map((item) => item.id === cardId ? { ...item, columnId: toColumnId } : item) },
|
|
28
|
+
move: { cardId, fromColumnId: card.columnId, toColumnId, index: position }
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
matchesKanban,
|
|
33
|
+
moveKanbanCard,
|
|
34
|
+
validateKanban
|
|
35
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function moveItem<Value>(items: readonly Value[], from: number, to: number): Value[];
|
|
2
|
+
export declare function moveId(ids: readonly string[], id: string, to: number): string[];
|
|
3
|
+
export declare function moveBetweenColumns(columns: ReadonlyArray<{
|
|
4
|
+
id: string;
|
|
5
|
+
cardIds: readonly string[];
|
|
6
|
+
}>, cardId: string, toColumnId: string, index: number): readonly {
|
|
7
|
+
id: string;
|
|
8
|
+
cardIds: readonly string[];
|
|
9
|
+
}[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function moveItem(items, from, to) {
|
|
2
|
+
if (from < 0 || from >= items.length || to < 0 || to >= items.length || from === to) return [...items];
|
|
3
|
+
const result = [...items];
|
|
4
|
+
result.splice(to, 0, result.splice(from, 1)[0]);
|
|
5
|
+
return result;
|
|
6
|
+
}
|
|
7
|
+
function moveId(ids, id, to) {
|
|
8
|
+
return moveItem(ids, ids.indexOf(id), Math.max(0, Math.min(ids.length - 1, to)));
|
|
9
|
+
}
|
|
10
|
+
function moveBetweenColumns(columns, cardId, toColumnId, index) {
|
|
11
|
+
const from = columns.find((column) => column.cardIds.includes(cardId));
|
|
12
|
+
if (!from || !columns.some((column) => column.id === toColumnId)) return columns;
|
|
13
|
+
return columns.map((column) => {
|
|
14
|
+
const cardIds = column.cardIds.filter((id) => id !== cardId);
|
|
15
|
+
if (column.id === toColumnId) cardIds.splice(Math.max(0, Math.min(cardIds.length, index)), 0, cardId);
|
|
16
|
+
return { ...column, cardIds };
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
moveBetweenColumns,
|
|
21
|
+
moveId,
|
|
22
|
+
moveItem
|
|
23
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type FilterExpression, type FilterType } from './filter.js';
|
|
2
|
+
export type RowId = string;
|
|
3
|
+
export type ColumnId = string;
|
|
4
|
+
export type Sort = {
|
|
5
|
+
columnId: ColumnId;
|
|
6
|
+
direction: 'ascending' | 'descending';
|
|
7
|
+
} | null;
|
|
8
|
+
export interface ColumnState {
|
|
9
|
+
id: ColumnId;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
pinned: boolean;
|
|
12
|
+
width?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface TableState {
|
|
15
|
+
query: string;
|
|
16
|
+
sort: Sort;
|
|
17
|
+
page: number;
|
|
18
|
+
pageSize: number;
|
|
19
|
+
selectedIds: RowId[];
|
|
20
|
+
expandedIds: RowId[];
|
|
21
|
+
columns: ColumnState[];
|
|
22
|
+
filter: FilterExpression;
|
|
23
|
+
view: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface ColumnDef<Row> {
|
|
26
|
+
id: ColumnId;
|
|
27
|
+
label: string;
|
|
28
|
+
type?: FilterType;
|
|
29
|
+
getValue: (row: Row) => unknown;
|
|
30
|
+
compare?: (a: Row, b: Row) => number;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
minWidth?: number;
|
|
33
|
+
maxWidth?: number;
|
|
34
|
+
options?: ReadonlyArray<{
|
|
35
|
+
id: string;
|
|
36
|
+
label: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export interface TableView<Row> {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
matches: (row: Row) => boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface TableOptions<Row> {
|
|
45
|
+
rows: readonly Row[];
|
|
46
|
+
getRowId: (row: Row) => string;
|
|
47
|
+
columns: readonly ColumnDef<Row>[];
|
|
48
|
+
state: TableState;
|
|
49
|
+
mode?: 'client' | 'manual';
|
|
50
|
+
totalRows?: number;
|
|
51
|
+
hasNextPage?: boolean;
|
|
52
|
+
groupBy?: (row: Row) => string;
|
|
53
|
+
views?: readonly TableView<Row>[];
|
|
54
|
+
viewCounts?: Record<string, number>;
|
|
55
|
+
getSearchText?: (row: Row) => string;
|
|
56
|
+
isRowSelectable?: (row: Row) => boolean;
|
|
57
|
+
aggregate?: (rows: readonly Row[]) => Record<string, unknown>;
|
|
58
|
+
aggregates?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export declare function normalizeColumns<Row>(columns: readonly ColumnDef<Row>[], state: readonly ColumnState[]): ColumnState[];
|
|
61
|
+
export declare function createTableState<Row>(columns: readonly ColumnDef<Row>[], initial?: Partial<TableState>): TableState;
|
|
62
|
+
export declare function updateTableState(state: TableState, patch: Partial<TableState>): TableState;
|
|
63
|
+
export declare function setColumnVisibility<Row>(columns: readonly ColumnDef<Row>[], state: readonly ColumnState[], id: string, visible: boolean): ColumnState[];
|
|
64
|
+
export declare function deriveTable<Row>(options: TableOptions<Row>): {
|
|
65
|
+
rows: Row[];
|
|
66
|
+
matchingRows: Row[];
|
|
67
|
+
columns: ColumnState[];
|
|
68
|
+
visibleColumns: ColumnState[];
|
|
69
|
+
total: number | undefined;
|
|
70
|
+
pageCount: number | undefined;
|
|
71
|
+
page: number;
|
|
72
|
+
pageSize: number;
|
|
73
|
+
start: number;
|
|
74
|
+
end: number;
|
|
75
|
+
hasNextPage: boolean;
|
|
76
|
+
hasPreviousPage: boolean;
|
|
77
|
+
eligibleIds: string[];
|
|
78
|
+
allSelected: boolean;
|
|
79
|
+
mixedSelection: boolean;
|
|
80
|
+
selectedCount: number;
|
|
81
|
+
aggregates: Record<string, unknown>;
|
|
82
|
+
viewCounts: Record<string, number>;
|
|
83
|
+
};
|
|
84
|
+
export declare function toggleVisibleSelection(selectedIds: readonly string[], eligibleIds: readonly string[], selected: boolean): string[];
|
|
85
|
+
export declare function pageItems(page: number, pageCount: number, radius?: number): Array<number | 'ellipsis'>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { matchesFilter, parseNumber } from "./filter.js";
|
|
2
|
+
function normalizeColumns(columns, state) {
|
|
3
|
+
const definitions = new Map(columns.map((column) => [column.id, column]));
|
|
4
|
+
if (definitions.size !== columns.length) throw new Error("Table column IDs must be unique.");
|
|
5
|
+
const result = [];
|
|
6
|
+
for (const item of [...state, ...columns.map((column) => ({ id: column.id, visible: true, pinned: Boolean(column.required) }))]) {
|
|
7
|
+
const column = definitions.get(item.id);
|
|
8
|
+
if (!column || result.some((existing) => existing.id === item.id)) continue;
|
|
9
|
+
const requested = "width" in item && typeof item.width === "number" && Number.isFinite(item.width) ? item.width : 160;
|
|
10
|
+
const width = Math.max(column.minWidth ?? 80, Math.min(column.maxWidth ?? 800, requested));
|
|
11
|
+
result.push({ id: item.id, visible: column.required || item.visible, pinned: column.required || item.pinned, width });
|
|
12
|
+
}
|
|
13
|
+
const optional = result.filter((item) => !definitions.get(item.id)?.required);
|
|
14
|
+
if (optional.length && !optional.some((item) => item.visible)) optional[0].visible = true;
|
|
15
|
+
const required = columns.filter((column) => column.required).map((column) => result.find((item) => item.id === column.id));
|
|
16
|
+
return [...required, ...result.filter((item) => !definitions.get(item.id)?.required && item.pinned), ...result.filter((item) => !item.pinned)];
|
|
17
|
+
}
|
|
18
|
+
function createTableState(columns, initial = {}) {
|
|
19
|
+
return {
|
|
20
|
+
query: "",
|
|
21
|
+
sort: null,
|
|
22
|
+
page: 1,
|
|
23
|
+
pageSize: 10,
|
|
24
|
+
selectedIds: [],
|
|
25
|
+
expandedIds: [],
|
|
26
|
+
filter: { match: "all", rules: [] },
|
|
27
|
+
view: null,
|
|
28
|
+
...initial,
|
|
29
|
+
columns: normalizeColumns(columns, initial.columns ?? [])
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function updateTableState(state, patch) {
|
|
33
|
+
const reset = ["query", "filter", "view", "pageSize"].some((key) => key in patch && !Object.is(patch[key], state[key]));
|
|
34
|
+
return { ...state, ...patch, ...reset ? { page: 1 } : {} };
|
|
35
|
+
}
|
|
36
|
+
function setColumnVisibility(columns, state, id, visible) {
|
|
37
|
+
const current = normalizeColumns(columns, state);
|
|
38
|
+
const definition = columns.find((column) => column.id === id);
|
|
39
|
+
if (!definition || definition.required) return current;
|
|
40
|
+
if (!visible && current.filter((item) => item.visible && !columns.find((column) => column.id === item.id)?.required).length <= 1) return current;
|
|
41
|
+
return current.map((column) => column.id === id ? { ...column, visible } : column);
|
|
42
|
+
}
|
|
43
|
+
function compareValues(a, b, type = "text") {
|
|
44
|
+
const av = type === "number" ? parseNumber(a) : a, bv = type === "number" ? parseNumber(b) : b;
|
|
45
|
+
if (av == null || av === "") return bv == null || bv === "" ? 0 : 1;
|
|
46
|
+
if (bv == null || bv === "") return -1;
|
|
47
|
+
if (type === "number") return av - bv;
|
|
48
|
+
return String(av).localeCompare(String(bv), "en", { numeric: true, sensitivity: "base" });
|
|
49
|
+
}
|
|
50
|
+
function deriveTable(options) {
|
|
51
|
+
const { state, columns, getRowId, groupBy, mode = "client" } = options;
|
|
52
|
+
const pageSize = Math.max(1, Math.trunc(state.pageSize) || 1);
|
|
53
|
+
const ids = options.rows.map(getRowId);
|
|
54
|
+
if (new Set(ids).size !== ids.length) throw new Error("Table row IDs must be unique.");
|
|
55
|
+
const normalizedColumns = normalizeColumns(columns, state.columns);
|
|
56
|
+
const fields = columns.map((column) => ({ ...column }));
|
|
57
|
+
const query = state.query.trim().toLowerCase();
|
|
58
|
+
const filtered = mode === "manual" ? [...options.rows] : options.rows.filter((row) => (!query || (options.getSearchText ? options.getSearchText(row) : columns.map((column) => String(column.getValue(row) ?? "")).join(" ")).toLowerCase().includes(query)) && matchesFilter(row, state.filter, fields));
|
|
59
|
+
const viewCounts = mode === "manual" ? options.viewCounts ?? {} : Object.fromEntries((options.views ?? []).map((view2) => [view2.id, filtered.filter(view2.matches).length]));
|
|
60
|
+
const view = options.views?.find((view2) => view2.id === state.view);
|
|
61
|
+
const matching = mode === "manual" || !view ? filtered : filtered.filter(view.matches);
|
|
62
|
+
const sortColumn = state.sort && columns.find((column) => column.id === state.sort?.columnId);
|
|
63
|
+
let ordered = [...matching];
|
|
64
|
+
if (mode !== "manual" && sortColumn) {
|
|
65
|
+
const direction = state.sort?.direction === "descending" ? -1 : 1;
|
|
66
|
+
const sort = (rows2) => rows2.sort((a, b) => direction * (sortColumn.compare ? sortColumn.compare(a, b) : compareValues(sortColumn.getValue(a), sortColumn.getValue(b), sortColumn.type)));
|
|
67
|
+
if (groupBy) {
|
|
68
|
+
const groups = /* @__PURE__ */ new Map();
|
|
69
|
+
for (const row of ordered) {
|
|
70
|
+
const group = groupBy(row);
|
|
71
|
+
const rows2 = groups.get(group) ?? [];
|
|
72
|
+
rows2.push(row);
|
|
73
|
+
groups.set(group, rows2);
|
|
74
|
+
}
|
|
75
|
+
ordered = [...groups.values()].flatMap(sort);
|
|
76
|
+
} else sort(ordered);
|
|
77
|
+
} else if (mode !== "manual" && groupBy) {
|
|
78
|
+
const groups = /* @__PURE__ */ new Map();
|
|
79
|
+
for (const row of ordered) {
|
|
80
|
+
const group = groupBy(row);
|
|
81
|
+
const rows2 = groups.get(group) ?? [];
|
|
82
|
+
rows2.push(row);
|
|
83
|
+
groups.set(group, rows2);
|
|
84
|
+
}
|
|
85
|
+
ordered = [...groups.values()].flat();
|
|
86
|
+
}
|
|
87
|
+
const total = mode === "manual" ? options.totalRows : ordered.length;
|
|
88
|
+
const pageCount = total === void 0 ? void 0 : Math.max(1, Math.ceil(Math.max(0, total) / pageSize));
|
|
89
|
+
const page = Math.max(1, Math.min(pageCount ?? Infinity, Math.trunc(state.page) || 1));
|
|
90
|
+
const rows = mode === "manual" ? ordered : ordered.slice((page - 1) * pageSize, page * pageSize);
|
|
91
|
+
const eligibleIds = rows.filter((row) => options.isRowSelectable?.(row) !== false).map(getRowId);
|
|
92
|
+
const selected = new Set(state.selectedIds);
|
|
93
|
+
const selectedVisible = eligibleIds.filter((id) => selected.has(id)).length;
|
|
94
|
+
const start = rows.length ? (page - 1) * pageSize + 1 : 0;
|
|
95
|
+
return {
|
|
96
|
+
rows,
|
|
97
|
+
matchingRows: matching,
|
|
98
|
+
columns: normalizedColumns,
|
|
99
|
+
visibleColumns: normalizedColumns.filter((column) => column.visible),
|
|
100
|
+
total,
|
|
101
|
+
pageCount,
|
|
102
|
+
page,
|
|
103
|
+
pageSize,
|
|
104
|
+
start,
|
|
105
|
+
end: rows.length ? start + rows.length - 1 : 0,
|
|
106
|
+
hasNextPage: pageCount === void 0 ? Boolean(options.hasNextPage) : page < pageCount,
|
|
107
|
+
hasPreviousPage: page > 1,
|
|
108
|
+
eligibleIds,
|
|
109
|
+
allSelected: eligibleIds.length > 0 && selectedVisible === eligibleIds.length,
|
|
110
|
+
mixedSelection: selectedVisible > 0 && selectedVisible < eligibleIds.length,
|
|
111
|
+
selectedCount: selected.size,
|
|
112
|
+
aggregates: mode === "manual" ? options.aggregates ?? {} : options.aggregate?.(matching) ?? {},
|
|
113
|
+
viewCounts
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function toggleVisibleSelection(selectedIds, eligibleIds, selected) {
|
|
117
|
+
const next = new Set(selectedIds);
|
|
118
|
+
for (const id of eligibleIds) if (selected) next.add(id);
|
|
119
|
+
else next.delete(id);
|
|
120
|
+
return [...next];
|
|
121
|
+
}
|
|
122
|
+
function pageItems(page, pageCount, radius = 1) {
|
|
123
|
+
const last = Math.max(1, Math.trunc(pageCount));
|
|
124
|
+
const current = Math.max(1, Math.min(last, Math.trunc(page)));
|
|
125
|
+
const pages = /* @__PURE__ */ new Set([1, last]);
|
|
126
|
+
for (let value = Math.max(1, current - radius); value <= Math.min(last, current + radius); value++) pages.add(value);
|
|
127
|
+
const sorted = [...pages].sort((a, b) => a - b), result = [];
|
|
128
|
+
sorted.forEach((value, index) => {
|
|
129
|
+
const gap = value - (sorted[index - 1] ?? value);
|
|
130
|
+
if (gap === 2) result.push(value - 1);
|
|
131
|
+
else if (gap > 2) result.push("ellipsis");
|
|
132
|
+
result.push(value);
|
|
133
|
+
});
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
createTableState,
|
|
138
|
+
deriveTable,
|
|
139
|
+
normalizeColumns,
|
|
140
|
+
pageItems,
|
|
141
|
+
setColumnVisibility,
|
|
142
|
+
toggleVisibleSelection,
|
|
143
|
+
updateTableState
|
|
144
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface TreeNode {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
href?: string;
|
|
6
|
+
children?: readonly TreeNode[];
|
|
7
|
+
}
|
|
8
|
+
export interface VisibleTreeNode {
|
|
9
|
+
node: TreeNode;
|
|
10
|
+
level: number;
|
|
11
|
+
parentId: string | null;
|
|
12
|
+
posInSet: number;
|
|
13
|
+
setSize: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function visibleTree(nodes: readonly TreeNode[], expandedIds: readonly string[]): VisibleTreeNode[];
|
|
16
|
+
export declare function treeParent(nodes: readonly TreeNode[], id: string, parent?: string | null): string | null | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function visibleTree(nodes, expandedIds) {
|
|
2
|
+
const expanded = new Set(expandedIds);
|
|
3
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4
|
+
const result = [];
|
|
5
|
+
const visit = (siblings, parentId, level, visible) => {
|
|
6
|
+
siblings.forEach((node, index) => {
|
|
7
|
+
if (seen.has(node.id)) throw new Error(`Duplicate tree ID: ${node.id}`);
|
|
8
|
+
seen.add(node.id);
|
|
9
|
+
if (visible) result.push({ node, level, parentId, posInSet: index + 1, setSize: siblings.length });
|
|
10
|
+
if (node.children) visit(node.children, node.id, level + 1, visible && expanded.has(node.id));
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
visit(nodes, null, 1, true);
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
function treeParent(nodes, id, parent = null) {
|
|
17
|
+
for (const node of nodes) {
|
|
18
|
+
if (node.id === id) return parent;
|
|
19
|
+
const found = node.children && treeParent(node.children, id, node.id);
|
|
20
|
+
if (found !== void 0) return found;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
treeParent,
|
|
25
|
+
visibleTree
|
|
26
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
export type BevelTokens = {
|
|
3
|
+
[name: `--bevel-${string}`]: string | number;
|
|
4
|
+
};
|
|
5
|
+
export type BevelAppearance = 'plain' | 'bevel';
|
|
6
|
+
export type BevelMode = 'system' | 'light' | 'dark';
|
|
7
|
+
export interface BevelTheme {
|
|
8
|
+
appearance: BevelAppearance;
|
|
9
|
+
mode: BevelMode;
|
|
10
|
+
tokens: BevelTokens;
|
|
11
|
+
}
|
|
12
|
+
export declare function useBevel(): BevelTheme;
|
|
13
|
+
export interface BevelProviderProps extends ComponentProps<'div'> {
|
|
14
|
+
appearance?: BevelAppearance;
|
|
15
|
+
mode?: BevelMode;
|
|
16
|
+
tokens?: BevelTokens;
|
|
17
|
+
}
|
|
18
|
+
export declare function BevelProvider({ appearance, mode, tokens, style, children, ...props }: BevelProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useMemo } from "react";
|
|
4
|
+
const defaults = { appearance: "plain", mode: "system", tokens: {} };
|
|
5
|
+
const ThemeContext = createContext(defaults);
|
|
6
|
+
function useBevel() {
|
|
7
|
+
return useContext(ThemeContext);
|
|
8
|
+
}
|
|
9
|
+
function BevelProvider({ appearance, mode, tokens, style, children, ...props }) {
|
|
10
|
+
const parent = useBevel();
|
|
11
|
+
const theme = useMemo(() => ({
|
|
12
|
+
appearance: appearance ?? parent.appearance,
|
|
13
|
+
mode: mode ?? parent.mode,
|
|
14
|
+
tokens: { ...parent.tokens, ...tokens }
|
|
15
|
+
}), [appearance, mode, tokens, parent]);
|
|
16
|
+
return /* @__PURE__ */ jsx(ThemeContext, { value: theme, children: /* @__PURE__ */ jsx(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
...props,
|
|
20
|
+
"data-bevel-scope": "",
|
|
21
|
+
"data-bevel-appearance": theme.appearance,
|
|
22
|
+
"data-bevel-mode": theme.mode,
|
|
23
|
+
style: { ...theme.tokens, ...style },
|
|
24
|
+
children
|
|
25
|
+
}
|
|
26
|
+
) });
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
BevelProvider,
|
|
30
|
+
useBevel
|
|
31
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CMSDocument {
|
|
2
|
+
title: string;
|
|
3
|
+
introduction: string;
|
|
4
|
+
coverURL?: string;
|
|
5
|
+
contributors: readonly {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
export interface CMSContextProps {
|
|
11
|
+
src: string;
|
|
12
|
+
document: CMSDocument;
|
|
13
|
+
onApply: (document: CMSDocument) => void;
|
|
14
|
+
pending?: boolean;
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function CMSContext({ src, document, onApply, pending, error }: CMSContextProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { Dialog } from "../components/dialog.js";
|
|
5
|
+
import { Button } from "../components/button.js";
|
|
6
|
+
import { Field } from "../components/field.js";
|
|
7
|
+
import { Input } from "../components/input.js";
|
|
8
|
+
import { Textarea } from "../components/textarea.js";
|
|
9
|
+
import { Sortable } from "../components/sortable.js";
|
|
10
|
+
import { ImagePreview } from "../components/image.js";
|
|
11
|
+
import { DocumentCard } from "../components/documents.js";
|
|
12
|
+
function CMSContext({ src, document, onApply, pending = false, error }) {
|
|
13
|
+
const [open, setOpen] = useState(false), [draft, setDraft] = useState(document);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setDraft(document);
|
|
16
|
+
setOpen(false);
|
|
17
|
+
}, [document]);
|
|
18
|
+
return /* @__PURE__ */ jsxs("section", { children: [
|
|
19
|
+
/* @__PURE__ */ jsxs(DocumentCard.Root, { children: [
|
|
20
|
+
/* @__PURE__ */ jsx(DocumentCard.Identity, { children: document.title }),
|
|
21
|
+
/* @__PURE__ */ jsx(DocumentCard.Status, { children: "External CMS document" })
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ jsx("iframe", { src, title: `${document.title} CMS host`, style: { width: "100%", minHeight: 320, border: "1px solid currentColor" } }),
|
|
24
|
+
/* @__PURE__ */ jsxs(Dialog.Root, { open, onOpenChange: (value) => {
|
|
25
|
+
if (!pending) {
|
|
26
|
+
if (value) setDraft(document);
|
|
27
|
+
setOpen(value);
|
|
28
|
+
}
|
|
29
|
+
}, children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: "Edit document metadata" }),
|
|
31
|
+
/* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
32
|
+
/* @__PURE__ */ jsx(Dialog.Backdrop, {}),
|
|
33
|
+
/* @__PURE__ */ jsxs(Dialog.Popup, { children: [
|
|
34
|
+
/* @__PURE__ */ jsxs(Dialog.Header, { children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Dialog.Title, { children: "Document metadata" }),
|
|
36
|
+
/* @__PURE__ */ jsx(Dialog.Description, { children: "The application applies these changes to its CMS document." })
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: (event) => {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
if (!pending && draft.title.trim()) onApply({ ...draft, title: draft.title.trim() });
|
|
41
|
+
}, children: [
|
|
42
|
+
/* @__PURE__ */ jsxs(Dialog.Body, { children: [
|
|
43
|
+
/* @__PURE__ */ jsxs(Field.Root, { name: "title", children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Field.Label, { children: "Document title" }),
|
|
45
|
+
/* @__PURE__ */ jsx(Input, { required: true, value: draft.title, disabled: pending, onValueChange: (title) => setDraft({ ...draft, title }) }),
|
|
46
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
49
|
+
"Introduction",
|
|
50
|
+
/* @__PURE__ */ jsx(Textarea, { value: draft.introduction, disabled: pending, onChange: (event) => setDraft({ ...draft, introduction: event.target.value }) })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsx(ImagePreview.Root, { children: /* @__PURE__ */ jsx(ImagePreview.Frame, { children: /* @__PURE__ */ jsx(ImagePreview.Image, { src: draft.coverURL, alt: "Document cover" }) }) }),
|
|
53
|
+
/* @__PURE__ */ jsx(Sortable.Root, { value: draft.contributors.map((person) => person.id), disabled: pending, onValueChange: (ids) => setDraft({ ...draft, contributors: ids.map((id) => draft.contributors.find((person) => person.id === id)) }), children: (order) => order.map((id) => /* @__PURE__ */ jsxs(Sortable.Item, { id, children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Sortable.Handle, { "aria-label": `Move ${draft.contributors.find((person) => person.id === id).name}` }),
|
|
55
|
+
/* @__PURE__ */ jsx(Sortable.Body, { children: draft.contributors.find((person) => person.id === id).name })
|
|
56
|
+
] }, id)) }),
|
|
57
|
+
error && /* @__PURE__ */ jsx("p", { role: "alert", children: error })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
60
|
+
/* @__PURE__ */ jsx(Dialog.Close, { disabled: pending, children: "Cancel metadata" }),
|
|
61
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", disabled: pending, children: "Apply metadata" })
|
|
62
|
+
] })
|
|
63
|
+
] })
|
|
64
|
+
] })
|
|
65
|
+
] })
|
|
66
|
+
] })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
CMSContext
|
|
71
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type QuickcropFunction, type QuickcropResult } from '../integrations/quickcrop.js';
|
|
2
|
+
export interface CropImageFieldProps {
|
|
3
|
+
quickcrop: QuickcropFunction;
|
|
4
|
+
onResult: (result: QuickcropResult) => void;
|
|
5
|
+
onOriginal?: (file: File) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function CropImageField({ quickcrop, onResult, onOriginal, disabled }: CropImageFieldProps): import("react").JSX.Element;
|