@kujoforall/paper-ui 0.0.0-stage → 0.2.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/CHANGELOG.md +93 -0
- package/LICENSE +21 -0
- package/README.md +295 -2
- package/dist/components/editor/block-text.d.ts +8 -0
- package/dist/components/editor/block-text.d.ts.map +1 -0
- package/dist/components/editor/block-text.js +248 -0
- package/dist/components/editor/block-text.js.map +1 -0
- package/dist/components/editor/blocks.d.ts +33 -0
- package/dist/components/editor/blocks.d.ts.map +1 -0
- package/dist/components/editor/blocks.js +191 -0
- package/dist/components/editor/blocks.js.map +1 -0
- package/dist/components/editor/document-editor.d.ts +27 -0
- package/dist/components/editor/document-editor.d.ts.map +1 -0
- package/dist/components/editor/document-editor.js +42 -0
- package/dist/components/editor/document-editor.js.map +1 -0
- package/dist/components/editor/document-view.d.ts +22 -0
- package/dist/components/editor/document-view.d.ts.map +1 -0
- package/dist/components/editor/document-view.js +110 -0
- package/dist/components/editor/document-view.js.map +1 -0
- package/dist/components/editor/editor-state.d.ts +107 -0
- package/dist/components/editor/editor-state.d.ts.map +1 -0
- package/dist/components/editor/editor-state.js +217 -0
- package/dist/components/editor/editor-state.js.map +1 -0
- package/dist/components/editor/extensions/kit-blocks.d.ts +34 -0
- package/dist/components/editor/extensions/kit-blocks.d.ts.map +1 -0
- package/dist/components/editor/extensions/kit-blocks.js +201 -0
- package/dist/components/editor/extensions/kit-blocks.js.map +1 -0
- package/dist/components/editor/extensions/spoiler.d.ts +8 -0
- package/dist/components/editor/extensions/spoiler.d.ts.map +1 -0
- package/dist/components/editor/extensions/spoiler.js +36 -0
- package/dist/components/editor/extensions/spoiler.js.map +1 -0
- package/dist/components/editor/index.d.ts +10 -0
- package/dist/components/editor/index.d.ts.map +1 -0
- package/dist/components/editor/index.js +10 -0
- package/dist/components/editor/index.js.map +1 -0
- package/dist/components/editor/kinds.d.ts +99 -0
- package/dist/components/editor/kinds.d.ts.map +1 -0
- package/dist/components/editor/kinds.js +74 -0
- package/dist/components/editor/kinds.js.map +1 -0
- package/dist/components/editor/look.d.ts +18 -0
- package/dist/components/editor/look.d.ts.map +1 -0
- package/dist/components/editor/look.js +21 -0
- package/dist/components/editor/look.js.map +1 -0
- package/dist/components/sketch/rough.d.ts +38 -0
- package/dist/components/sketch/rough.d.ts.map +1 -0
- package/dist/components/sketch/rough.js +57 -0
- package/dist/components/sketch/rough.js.map +1 -0
- package/dist/components/three/model-viewer.d.ts +36 -0
- package/dist/components/three/model-viewer.d.ts.map +1 -0
- package/dist/components/three/model-viewer.js +338 -0
- package/dist/components/three/model-viewer.js.map +1 -0
- package/dist/components/ui/accent-picker.d.ts +2 -0
- package/dist/components/ui/accent-picker.d.ts.map +1 -0
- package/dist/components/ui/accent-picker.js +44 -0
- package/dist/components/ui/accent-picker.js.map +1 -0
- package/dist/components/ui/address-field.d.ts +10 -0
- package/dist/components/ui/address-field.d.ts.map +1 -0
- package/dist/components/ui/address-field.js +24 -0
- package/dist/components/ui/address-field.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +29 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +72 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/animated-height.d.ts +6 -0
- package/dist/components/ui/animated-height.d.ts.map +1 -0
- package/dist/components/ui/animated-height.js +26 -0
- package/dist/components/ui/animated-height.js.map +1 -0
- package/dist/components/ui/app-shell.d.ts +26 -0
- package/dist/components/ui/app-shell.d.ts.map +1 -0
- package/dist/components/ui/app-shell.js +71 -0
- package/dist/components/ui/app-shell.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +30 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +19 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +62 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/banner.d.ts +33 -0
- package/dist/components/ui/banner.d.ts.map +1 -0
- package/dist/components/ui/banner.js +21 -0
- package/dist/components/ui/banner.js.map +1 -0
- package/dist/components/ui/breadcrumbs.d.ts +10 -0
- package/dist/components/ui/breadcrumbs.d.ts.map +1 -0
- package/dist/components/ui/breadcrumbs.js +9 -0
- package/dist/components/ui/breadcrumbs.js.map +1 -0
- package/dist/components/ui/button.d.ts +15 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +110 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +5 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +65 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/callout.d.ts +32 -0
- package/dist/components/ui/callout.d.ts.map +1 -0
- package/dist/components/ui/callout.js +40 -0
- package/dist/components/ui/callout.js.map +1 -0
- package/dist/components/ui/card.d.ts +18 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +28 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +11 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +30 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/choice-label.d.ts +13 -0
- package/dist/components/ui/choice-label.d.ts.map +1 -0
- package/dist/components/ui/choice-label.js +17 -0
- package/dist/components/ui/choice-label.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +10 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +21 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/collection-layout.d.ts +24 -0
- package/dist/components/ui/collection-layout.d.ts.map +1 -0
- package/dist/components/ui/collection-layout.js +16 -0
- package/dist/components/ui/collection-layout.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +10 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +93 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command-menu.d.ts +18 -0
- package/dist/components/ui/command-menu.d.ts.map +1 -0
- package/dist/components/ui/command-menu.js +49 -0
- package/dist/components/ui/command-menu.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +19 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +42 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/copy-button.d.ts +11 -0
- package/dist/components/ui/copy-button.d.ts.map +1 -0
- package/dist/components/ui/copy-button.js +48 -0
- package/dist/components/ui/copy-button.js.map +1 -0
- package/dist/components/ui/database/calendar-view.d.ts +10 -0
- package/dist/components/ui/database/calendar-view.d.ts.map +1 -0
- package/dist/components/ui/database/calendar-view.js +65 -0
- package/dist/components/ui/database/calendar-view.js.map +1 -0
- package/dist/components/ui/database/card-views.d.ts +22 -0
- package/dist/components/ui/database/card-views.d.ts.map +1 -0
- package/dist/components/ui/database/card-views.js +74 -0
- package/dist/components/ui/database/card-views.js.map +1 -0
- package/dist/components/ui/database/cells.d.ts +20 -0
- package/dist/components/ui/database/cells.d.ts.map +1 -0
- package/dist/components/ui/database/cells.js +132 -0
- package/dist/components/ui/database/cells.js.map +1 -0
- package/dist/components/ui/database/database.d.ts +19 -0
- package/dist/components/ui/database/database.d.ts.map +1 -0
- package/dist/components/ui/database/database.js +102 -0
- package/dist/components/ui/database/database.js.map +1 -0
- package/dist/components/ui/database/icons.d.ts +5 -0
- package/dist/components/ui/database/icons.d.ts.map +1 -0
- package/dist/components/ui/database/icons.js +13 -0
- package/dist/components/ui/database/icons.js.map +1 -0
- package/dist/components/ui/database/table-view.d.ts +11 -0
- package/dist/components/ui/database/table-view.d.ts.map +1 -0
- package/dist/components/ui/database/table-view.js +157 -0
- package/dist/components/ui/database/table-view.js.map +1 -0
- package/dist/components/ui/date-picker.d.ts +40 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/date-picker.js +64 -0
- package/dist/components/ui/date-picker.js.map +1 -0
- package/dist/components/ui/date-time-picker.d.ts +21 -0
- package/dist/components/ui/date-time-picker.d.ts.map +1 -0
- package/dist/components/ui/date-time-picker.js +34 -0
- package/dist/components/ui/date-time-picker.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +21 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +63 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/document-layout.d.ts +15 -0
- package/dist/components/ui/document-layout.d.ts.map +1 -0
- package/dist/components/ui/document-layout.js +15 -0
- package/dist/components/ui/document-layout.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +24 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +65 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/editable-text.d.ts +24 -0
- package/dist/components/ui/editable-text.d.ts.map +1 -0
- package/dist/components/ui/editable-text.js +85 -0
- package/dist/components/ui/editable-text.js.map +1 -0
- package/dist/components/ui/empty-state.d.ts +11 -0
- package/dist/components/ui/empty-state.d.ts.map +1 -0
- package/dist/components/ui/empty-state.js +9 -0
- package/dist/components/ui/empty-state.js.map +1 -0
- package/dist/components/ui/error-state.d.ts +20 -0
- package/dist/components/ui/error-state.d.ts.map +1 -0
- package/dist/components/ui/error-state.js +17 -0
- package/dist/components/ui/error-state.js.map +1 -0
- package/dist/components/ui/field-button.d.ts +15 -0
- package/dist/components/ui/field-button.d.ts.map +1 -0
- package/dist/components/ui/field-button.js +18 -0
- package/dist/components/ui/field-button.js.map +1 -0
- package/dist/components/ui/file-preview.d.ts +5 -0
- package/dist/components/ui/file-preview.d.ts.map +1 -0
- package/dist/components/ui/file-preview.js +66 -0
- package/dist/components/ui/file-preview.js.map +1 -0
- package/dist/components/ui/file-uploader.d.ts +39 -0
- package/dist/components/ui/file-uploader.d.ts.map +1 -0
- package/dist/components/ui/file-uploader.js +111 -0
- package/dist/components/ui/file-uploader.js.map +1 -0
- package/dist/components/ui/filter-builder.d.ts +18 -0
- package/dist/components/ui/filter-builder.d.ts.map +1 -0
- package/dist/components/ui/filter-builder.js +98 -0
- package/dist/components/ui/filter-builder.js.map +1 -0
- package/dist/components/ui/focus-shell.d.ts +14 -0
- package/dist/components/ui/focus-shell.d.ts.map +1 -0
- package/dist/components/ui/focus-shell.js +13 -0
- package/dist/components/ui/focus-shell.js.map +1 -0
- package/dist/components/ui/handle-row.d.ts +25 -0
- package/dist/components/ui/handle-row.d.ts.map +1 -0
- package/dist/components/ui/handle-row.js +110 -0
- package/dist/components/ui/handle-row.js.map +1 -0
- package/dist/components/ui/header-bar.d.ts +5 -0
- package/dist/components/ui/header-bar.d.ts.map +1 -0
- package/dist/components/ui/header-bar.js +10 -0
- package/dist/components/ui/header-bar.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +13 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/image-block.d.ts +31 -0
- package/dist/components/ui/image-block.d.ts.map +1 -0
- package/dist/components/ui/image-block.js +103 -0
- package/dist/components/ui/image-block.js.map +1 -0
- package/dist/components/ui/image-card.d.ts +17 -0
- package/dist/components/ui/image-card.d.ts.map +1 -0
- package/dist/components/ui/image-card.js +39 -0
- package/dist/components/ui/image-card.js.map +1 -0
- package/dist/components/ui/image-framer.d.ts +24 -0
- package/dist/components/ui/image-framer.d.ts.map +1 -0
- package/dist/components/ui/image-framer.js +89 -0
- package/dist/components/ui/image-framer.js.map +1 -0
- package/dist/components/ui/image-viewer.d.ts +31 -0
- package/dist/components/ui/image-viewer.d.ts.map +1 -0
- package/dist/components/ui/image-viewer.js +114 -0
- package/dist/components/ui/image-viewer.js.map +1 -0
- package/dist/components/ui/image.d.ts +33 -0
- package/dist/components/ui/image.d.ts.map +1 -0
- package/dist/components/ui/image.js +61 -0
- package/dist/components/ui/image.js.map +1 -0
- package/dist/components/ui/index.d.ts +92 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +92 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/input.d.ts +75 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +245 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/link-block.d.ts +13 -0
- package/dist/components/ui/link-block.d.ts.map +1 -0
- package/dist/components/ui/link-block.js +21 -0
- package/dist/components/ui/link-block.js.map +1 -0
- package/dist/components/ui/list-detail.d.ts +23 -0
- package/dist/components/ui/list-detail.d.ts.map +1 -0
- package/dist/components/ui/list-detail.js +33 -0
- package/dist/components/ui/list-detail.js.map +1 -0
- package/dist/components/ui/listbox.d.ts +7 -0
- package/dist/components/ui/listbox.d.ts.map +1 -0
- package/dist/components/ui/listbox.js +29 -0
- package/dist/components/ui/listbox.js.map +1 -0
- package/dist/components/ui/mac-card.d.ts +15 -0
- package/dist/components/ui/mac-card.d.ts.map +1 -0
- package/dist/components/ui/mac-card.js +9 -0
- package/dist/components/ui/mac-card.js.map +1 -0
- package/dist/components/ui/month-picker.d.ts +13 -0
- package/dist/components/ui/month-picker.d.ts.map +1 -0
- package/dist/components/ui/month-picker.js +53 -0
- package/dist/components/ui/month-picker.js.map +1 -0
- package/dist/components/ui/multi-select.d.ts +22 -0
- package/dist/components/ui/multi-select.d.ts.map +1 -0
- package/dist/components/ui/multi-select.js +88 -0
- package/dist/components/ui/multi-select.js.map +1 -0
- package/dist/components/ui/nav-tree.d.ts +16 -0
- package/dist/components/ui/nav-tree.d.ts.map +1 -0
- package/dist/components/ui/nav-tree.js +41 -0
- package/dist/components/ui/nav-tree.js.map +1 -0
- package/dist/components/ui/page.d.ts +23 -0
- package/dist/components/ui/page.d.ts.map +1 -0
- package/dist/components/ui/page.js +28 -0
- package/dist/components/ui/page.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +26 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +54 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/picker-panel.d.ts +13 -0
- package/dist/components/ui/picker-panel.d.ts.map +1 -0
- package/dist/components/ui/picker-panel.js +19 -0
- package/dist/components/ui/picker-panel.js.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +18 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +19 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +22 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/property.d.ts +11 -0
- package/dist/components/ui/property.d.ts.map +1 -0
- package/dist/components/ui/property.js +18 -0
- package/dist/components/ui/property.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +8 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +18 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/rating.d.ts +14 -0
- package/dist/components/ui/rating.d.ts.map +1 -0
- package/dist/components/ui/rating.js +61 -0
- package/dist/components/ui/rating.js.map +1 -0
- package/dist/components/ui/save-status.d.ts +8 -0
- package/dist/components/ui/save-status.d.ts.map +1 -0
- package/dist/components/ui/save-status.js +31 -0
- package/dist/components/ui/save-status.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +21 -0
- package/dist/components/ui/segmented.d.ts.map +1 -0
- package/dist/components/ui/segmented.js +12 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select-menu.d.ts +12 -0
- package/dist/components/ui/select-menu.d.ts.map +1 -0
- package/dist/components/ui/select-menu.js +10 -0
- package/dist/components/ui/select-menu.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +45 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/selection-bar.d.ts +12 -0
- package/dist/components/ui/selection-bar.d.ts.map +1 -0
- package/dist/components/ui/selection-bar.js +15 -0
- package/dist/components/ui/selection-bar.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +12 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/settings-layout.d.ts +34 -0
- package/dist/components/ui/settings-layout.d.ts.map +1 -0
- package/dist/components/ui/settings-layout.js +16 -0
- package/dist/components/ui/settings-layout.js.map +1 -0
- package/dist/components/ui/share-link.d.ts +14 -0
- package/dist/components/ui/share-link.d.ts.map +1 -0
- package/dist/components/ui/share-link.js +16 -0
- package/dist/components/ui/share-link.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +21 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +53 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +82 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +258 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +8 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +15 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +12 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +14 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/spotlight.d.ts +23 -0
- package/dist/components/ui/spotlight.d.ts.map +1 -0
- package/dist/components/ui/spotlight.js +110 -0
- package/dist/components/ui/spotlight.js.map +1 -0
- package/dist/components/ui/stat-tile.d.ts +8 -0
- package/dist/components/ui/stat-tile.d.ts.map +1 -0
- package/dist/components/ui/stat-tile.js +9 -0
- package/dist/components/ui/stat-tile.js.map +1 -0
- package/dist/components/ui/step-dialog.d.ts +20 -0
- package/dist/components/ui/step-dialog.d.ts.map +1 -0
- package/dist/components/ui/step-dialog.js +36 -0
- package/dist/components/ui/step-dialog.js.map +1 -0
- package/dist/components/ui/steps-layout.d.ts +20 -0
- package/dist/components/ui/steps-layout.d.ts.map +1 -0
- package/dist/components/ui/steps-layout.js +26 -0
- package/dist/components/ui/steps-layout.js.map +1 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +16 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +76 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +19 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/theme-toggle.d.ts +16 -0
- package/dist/components/ui/theme-toggle.d.ts.map +1 -0
- package/dist/components/ui/theme-toggle.js +65 -0
- package/dist/components/ui/theme-toggle.js.map +1 -0
- package/dist/components/ui/time-list.d.ts +16 -0
- package/dist/components/ui/time-list.d.ts.map +1 -0
- package/dist/components/ui/time-list.js +49 -0
- package/dist/components/ui/time-list.js.map +1 -0
- package/dist/components/ui/time-picker.d.ts +47 -0
- package/dist/components/ui/time-picker.d.ts.map +1 -0
- package/dist/components/ui/time-picker.js +141 -0
- package/dist/components/ui/time-picker.js.map +1 -0
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +77 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +15 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +55 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +15 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +32 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/top-bar.d.ts +25 -0
- package/dist/components/ui/top-bar.d.ts.map +1 -0
- package/dist/components/ui/top-bar.js +23 -0
- package/dist/components/ui/top-bar.js.map +1 -0
- package/dist/components/ui/typography.d.ts +40 -0
- package/dist/components/ui/typography.d.ts.map +1 -0
- package/dist/components/ui/typography.js +98 -0
- package/dist/components/ui/typography.js.map +1 -0
- package/dist/components/ui/video-block.d.ts +14 -0
- package/dist/components/ui/video-block.d.ts.map +1 -0
- package/dist/components/ui/video-block.js +22 -0
- package/dist/components/ui/video-block.js.map +1 -0
- package/dist/hooks/use-dismiss.d.ts +5 -0
- package/dist/hooks/use-dismiss.d.ts.map +1 -0
- package/dist/hooks/use-dismiss.js +23 -0
- package/dist/hooks/use-dismiss.js.map +1 -0
- package/dist/hooks/use-escape-first.d.ts +3 -0
- package/dist/hooks/use-escape-first.d.ts.map +1 -0
- package/dist/hooks/use-escape-first.js +27 -0
- package/dist/hooks/use-escape-first.js.map +1 -0
- package/dist/hooks/use-media-query.d.ts +5 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +16 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-save-queue.d.ts +13 -0
- package/dist/hooks/use-save-queue.d.ts.map +1 -0
- package/dist/hooks/use-save-queue.js +57 -0
- package/dist/hooks/use-save-queue.js.map +1 -0
- package/dist/hooks/use-selection.d.ts +10 -0
- package/dist/hooks/use-selection.d.ts.map +1 -0
- package/dist/hooks/use-selection.js +52 -0
- package/dist/hooks/use-selection.js.map +1 -0
- package/dist/hooks/use-shared-transition.d.ts +3 -0
- package/dist/hooks/use-shared-transition.d.ts.map +1 -0
- package/dist/hooks/use-shared-transition.js +38 -0
- package/dist/hooks/use-shared-transition.js.map +1 -0
- package/dist/hooks/use-upload-queue.d.ts +22 -0
- package/dist/hooks/use-upload-queue.d.ts.map +1 -0
- package/dist/hooks/use-upload-queue.js +78 -0
- package/dist/hooks/use-upload-queue.js.map +1 -0
- package/dist/lib/accent.d.ts +5 -0
- package/dist/lib/accent.d.ts.map +1 -0
- package/dist/lib/accent.js +10 -0
- package/dist/lib/accent.js.map +1 -0
- package/dist/lib/bento.d.ts +17 -0
- package/dist/lib/bento.d.ts.map +1 -0
- package/dist/lib/bento.js +92 -0
- package/dist/lib/bento.js.map +1 -0
- package/dist/lib/database.d.ts +92 -0
- package/dist/lib/database.d.ts.map +1 -0
- package/dist/lib/database.js +272 -0
- package/dist/lib/database.js.map +1 -0
- package/dist/lib/dates.d.ts +30 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +61 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/document.d.ts +79 -0
- package/dist/lib/document.d.ts.map +1 -0
- package/dist/lib/document.js +11 -0
- package/dist/lib/document.js.map +1 -0
- package/dist/lib/embed.d.ts +14 -0
- package/dist/lib/embed.d.ts.map +1 -0
- package/dist/lib/embed.js +63 -0
- package/dist/lib/embed.js.map +1 -0
- package/dist/lib/files.d.ts +23 -0
- package/dist/lib/files.d.ts.map +1 -0
- package/dist/lib/files.js +69 -0
- package/dist/lib/files.js.map +1 -0
- package/dist/lib/justified.d.ts +50 -0
- package/dist/lib/justified.d.ts.map +1 -0
- package/dist/lib/justified.js +78 -0
- package/dist/lib/justified.js.map +1 -0
- package/dist/lib/keys.d.ts +18 -0
- package/dist/lib/keys.d.ts.map +1 -0
- package/dist/lib/keys.js +66 -0
- package/dist/lib/keys.js.map +1 -0
- package/dist/lib/number.d.ts +4 -0
- package/dist/lib/number.d.ts.map +1 -0
- package/dist/lib/number.js +33 -0
- package/dist/lib/number.js.map +1 -0
- package/dist/lib/pointer.d.ts +2 -0
- package/dist/lib/pointer.d.ts.map +1 -0
- package/dist/lib/pointer.js +4 -0
- package/dist/lib/pointer.js.map +1 -0
- package/dist/lib/prepare-image.d.ts +43 -0
- package/dist/lib/prepare-image.d.ts.map +1 -0
- package/dist/lib/prepare-image.js +105 -0
- package/dist/lib/prepare-image.js.map +1 -0
- package/dist/lib/rich-text-dom.d.ts +16 -0
- package/dist/lib/rich-text-dom.d.ts.map +1 -0
- package/dist/lib/rich-text-dom.js +145 -0
- package/dist/lib/rich-text-dom.js.map +1 -0
- package/dist/lib/rich-text.d.ts +15 -0
- package/dist/lib/rich-text.d.ts.map +1 -0
- package/dist/lib/rich-text.js +35 -0
- package/dist/lib/rich-text.js.map +1 -0
- package/dist/lib/spotlight.d.ts +22 -0
- package/dist/lib/spotlight.d.ts.map +1 -0
- package/dist/lib/spotlight.js +66 -0
- package/dist/lib/spotlight.js.map +1 -0
- package/dist/lib/theme.d.ts +6 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +15 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/time.d.ts +19 -0
- package/dist/lib/time.d.ts.map +1 -0
- package/dist/lib/time.js +91 -0
- package/dist/lib/time.js.map +1 -0
- package/dist/lib/tree.d.ts +17 -0
- package/dist/lib/tree.d.ts.map +1 -0
- package/dist/lib/tree.js +35 -0
- package/dist/lib/tree.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +24 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles/notion.css +817 -0
- package/package.json +129 -5
- package/src/components/editor/block-text.tsx +271 -0
- package/src/components/editor/blocks.tsx +373 -0
- package/src/components/editor/document-editor.tsx +106 -0
- package/src/components/editor/document-view.tsx +205 -0
- package/src/components/editor/editor-state.tsx +298 -0
- package/src/components/editor/extensions/kit-blocks.tsx +452 -0
- package/src/components/editor/extensions/spoiler.tsx +81 -0
- package/src/components/editor/index.ts +10 -0
- package/src/components/editor/kinds.ts +158 -0
- package/src/components/editor/look.tsx +36 -0
- package/src/components/sketch/rough.tsx +90 -0
- package/src/components/three/model-viewer.tsx +514 -0
- package/src/components/ui/accent-picker.tsx +72 -0
- package/src/components/ui/address-field.tsx +57 -0
- package/src/components/ui/alert-dialog.tsx +136 -0
- package/src/components/ui/animated-height.tsx +34 -0
- package/src/components/ui/app-shell.tsx +140 -0
- package/src/components/ui/avatar.tsx +106 -0
- package/src/components/ui/badge.tsx +81 -0
- package/src/components/ui/banner.tsx +53 -0
- package/src/components/ui/breadcrumbs.tsx +25 -0
- package/src/components/ui/button.tsx +147 -0
- package/src/components/ui/calendar.tsx +101 -0
- package/src/components/ui/callout.tsx +61 -0
- package/src/components/ui/card.tsx +59 -0
- package/src/components/ui/checkbox.tsx +66 -0
- package/src/components/ui/choice-label.tsx +43 -0
- package/src/components/ui/collapsible.tsx +58 -0
- package/src/components/ui/collection-layout.tsx +69 -0
- package/src/components/ui/combobox.tsx +155 -0
- package/src/components/ui/command-menu.tsx +102 -0
- package/src/components/ui/context-menu.tsx +89 -0
- package/src/components/ui/copy-button.tsx +80 -0
- package/src/components/ui/database/calendar-view.tsx +180 -0
- package/src/components/ui/database/card-views.tsx +221 -0
- package/src/components/ui/database/cells.tsx +237 -0
- package/src/components/ui/database/database.tsx +279 -0
- package/src/components/ui/database/icons.ts +15 -0
- package/src/components/ui/database/table-view.tsx +311 -0
- package/src/components/ui/date-picker.tsx +208 -0
- package/src/components/ui/date-time-picker.tsx +123 -0
- package/src/components/ui/dialog.tsx +151 -0
- package/src/components/ui/document-layout.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +185 -0
- package/src/components/ui/editable-text.tsx +142 -0
- package/src/components/ui/empty-state.tsx +35 -0
- package/src/components/ui/error-state.tsx +67 -0
- package/src/components/ui/field-button.tsx +70 -0
- package/src/components/ui/file-preview.tsx +80 -0
- package/src/components/ui/file-uploader.tsx +375 -0
- package/src/components/ui/filter-builder.tsx +304 -0
- package/src/components/ui/focus-shell.tsx +48 -0
- package/src/components/ui/handle-row.tsx +252 -0
- package/src/components/ui/header-bar.tsx +15 -0
- package/src/components/ui/hover-card.tsx +30 -0
- package/src/components/ui/image-block.tsx +238 -0
- package/src/components/ui/image-card.tsx +95 -0
- package/src/components/ui/image-framer.tsx +160 -0
- package/src/components/ui/image-viewer.tsx +230 -0
- package/src/components/ui/image.tsx +200 -0
- package/src/components/ui/index.ts +178 -0
- package/src/components/ui/input.tsx +471 -0
- package/src/components/ui/link-block.tsx +85 -0
- package/src/components/ui/list-detail.tsx +115 -0
- package/src/components/ui/listbox.ts +26 -0
- package/src/components/ui/mac-card.tsx +46 -0
- package/src/components/ui/month-picker.tsx +119 -0
- package/src/components/ui/multi-select.tsx +221 -0
- package/src/components/ui/nav-tree.tsx +92 -0
- package/src/components/ui/page.tsx +73 -0
- package/src/components/ui/pagination.tsx +143 -0
- package/src/components/ui/picker-panel.tsx +69 -0
- package/src/components/ui/popover.tsx +42 -0
- package/src/components/ui/progress.tsx +76 -0
- package/src/components/ui/property.tsx +33 -0
- package/src/components/ui/radio-group.tsx +61 -0
- package/src/components/ui/rating.tsx +122 -0
- package/src/components/ui/save-status.tsx +53 -0
- package/src/components/ui/segmented.tsx +74 -0
- package/src/components/ui/select-menu.tsx +54 -0
- package/src/components/ui/select.tsx +147 -0
- package/src/components/ui/selection-bar.tsx +50 -0
- package/src/components/ui/separator.tsx +30 -0
- package/src/components/ui/settings-layout.tsx +117 -0
- package/src/components/ui/share-link.tsx +66 -0
- package/src/components/ui/sheet.tsx +90 -0
- package/src/components/ui/sidebar.tsx +627 -0
- package/src/components/ui/skeleton.tsx +22 -0
- package/src/components/ui/spinner.tsx +28 -0
- package/src/components/ui/spotlight.tsx +222 -0
- package/src/components/ui/stat-tile.tsx +25 -0
- package/src/components/ui/step-dialog.tsx +104 -0
- package/src/components/ui/steps-layout.tsx +91 -0
- package/src/components/ui/switch.tsx +55 -0
- package/src/components/ui/table.tsx +99 -0
- package/src/components/ui/tabs.tsx +41 -0
- package/src/components/ui/theme-toggle.tsx +80 -0
- package/src/components/ui/time-list.tsx +106 -0
- package/src/components/ui/time-picker.tsx +344 -0
- package/src/components/ui/toast.tsx +132 -0
- package/src/components/ui/toggle.tsx +76 -0
- package/src/components/ui/tooltip.tsx +78 -0
- package/src/components/ui/top-bar.tsx +118 -0
- package/src/components/ui/typography.tsx +204 -0
- package/src/components/ui/video-block.tsx +66 -0
- package/src/hooks/use-dismiss.ts +24 -0
- package/src/hooks/use-escape-first.ts +25 -0
- package/src/hooks/use-media-query.ts +23 -0
- package/src/hooks/use-save-queue.ts +78 -0
- package/src/hooks/use-selection.ts +51 -0
- package/src/hooks/use-shared-transition.ts +40 -0
- package/src/hooks/use-upload-queue.ts +111 -0
- package/src/lib/accent.ts +11 -0
- package/src/lib/bento.ts +87 -0
- package/src/lib/database.ts +322 -0
- package/src/lib/dates.ts +75 -0
- package/src/lib/document.ts +55 -0
- package/src/lib/embed.ts +62 -0
- package/src/lib/files.ts +73 -0
- package/src/lib/justified.ts +106 -0
- package/src/lib/keys.ts +72 -0
- package/src/lib/number.ts +29 -0
- package/src/lib/pointer.ts +3 -0
- package/src/lib/prepare-image.ts +141 -0
- package/src/lib/rich-text-dom.ts +138 -0
- package/src/lib/rich-text.ts +50 -0
- package/src/lib/spotlight.ts +78 -0
- package/src/lib/theme.ts +18 -0
- package/src/lib/time.ts +83 -0
- package/src/lib/tree.ts +41 -0
- package/src/lib/utils.ts +25 -0
- package/src/styles/notion.css +817 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type Point = [number, number];
|
|
3
|
+
export type Shape = {
|
|
4
|
+
kind: "rect";
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
w: number;
|
|
8
|
+
h: number;
|
|
9
|
+
} | {
|
|
10
|
+
kind: "polygon";
|
|
11
|
+
points: Point[];
|
|
12
|
+
} | {
|
|
13
|
+
kind: "line";
|
|
14
|
+
from: Point;
|
|
15
|
+
to: Point;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "path";
|
|
18
|
+
d: string;
|
|
19
|
+
};
|
|
20
|
+
export type Pen = {
|
|
21
|
+
seed: number;
|
|
22
|
+
stroke?: string;
|
|
23
|
+
fill?: string;
|
|
24
|
+
fillStyle?: "hachure" | "cross-hatch" | "solid";
|
|
25
|
+
dashed?: boolean;
|
|
26
|
+
strokeWidth?: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function RoughPaths({ shape, pen }: {
|
|
29
|
+
shape: Shape;
|
|
30
|
+
pen: Pen;
|
|
31
|
+
}): import("react").JSX.Element[];
|
|
32
|
+
export declare function RoughBox({ pen, className, children }: {
|
|
33
|
+
pen: Pen;
|
|
34
|
+
className?: string;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=rough.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rough.d.ts","sourceRoot":"","sources":["../../../src/components/sketch/rough.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAyD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9F,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B,MAAM,MAAM,KAAK,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,KAAK,CAAA;CAAE,GAExC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,MAAM,MAAM,GAAG,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,OAAO,CAAC;IAChD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAIF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,iCA8BpE;AAID,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAwB3G"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import rough from "roughjs";
|
|
4
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
// One generator for the page. Every shape passes a seed, so a drawing is the same
|
|
7
|
+
// on each render instead of shimmering.
|
|
8
|
+
const gen = rough.generator();
|
|
9
|
+
/* Hand-drawn SVG paths for a shape. Colours go on as styles, not attributes, because
|
|
10
|
+
an SVG attribute cannot hold var(). */
|
|
11
|
+
export function RoughPaths({ shape, pen }) {
|
|
12
|
+
const options = {
|
|
13
|
+
seed: pen.seed,
|
|
14
|
+
roughness: 1.3,
|
|
15
|
+
bowing: 1.2,
|
|
16
|
+
strokeWidth: pen.strokeWidth ?? 1.4,
|
|
17
|
+
fill: pen.fill ? "fill" : undefined,
|
|
18
|
+
fillStyle: pen.fillStyle ?? "hachure",
|
|
19
|
+
hachureGap: 5,
|
|
20
|
+
fillWeight: 1,
|
|
21
|
+
strokeLineDash: pen.dashed ? [6, 5] : undefined,
|
|
22
|
+
};
|
|
23
|
+
const drawable = shape.kind === "rect"
|
|
24
|
+
? gen.rectangle(shape.x, shape.y, shape.w, shape.h, options)
|
|
25
|
+
: shape.kind === "polygon"
|
|
26
|
+
? gen.polygon(shape.points, options)
|
|
27
|
+
: shape.kind === "path"
|
|
28
|
+
? gen.path(shape.d, options)
|
|
29
|
+
: gen.line(...shape.from, ...shape.to, options);
|
|
30
|
+
return gen.toPaths(drawable).map((path, i) => {
|
|
31
|
+
// rough marks fill strokes by giving them the fill colour as their stroke.
|
|
32
|
+
const isFill = path.stroke === "fill" || path.fill === "fill";
|
|
33
|
+
const solid = isFill && path.fill === "fill";
|
|
34
|
+
const style = solid
|
|
35
|
+
? { fill: pen.fill, stroke: "none" }
|
|
36
|
+
: { fill: "none", stroke: isFill ? pen.fill : (pen.stroke ?? "currentColor"), strokeWidth: path.strokeWidth, strokeLinecap: "round" };
|
|
37
|
+
return _jsx("path", { d: path.d, style: style, strokeDasharray: !isFill && pen.dashed ? "6 5" : undefined }, i);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/* A box with a hand-drawn border. The content lays itself out with ordinary CSS;
|
|
41
|
+
the border is an SVG stretched over it and redrawn whenever the box resizes. */
|
|
42
|
+
export function RoughBox({ pen, className, children }) {
|
|
43
|
+
const ref = useRef(null);
|
|
44
|
+
const [size, setSize] = useState(null);
|
|
45
|
+
useLayoutEffect(() => {
|
|
46
|
+
const el = ref.current;
|
|
47
|
+
if (!el)
|
|
48
|
+
return;
|
|
49
|
+
const measure = () => setSize({ w: el.offsetWidth, h: el.offsetHeight });
|
|
50
|
+
measure();
|
|
51
|
+
const observer = new ResizeObserver(measure);
|
|
52
|
+
observer.observe(el);
|
|
53
|
+
return () => observer.disconnect();
|
|
54
|
+
}, []);
|
|
55
|
+
return (_jsxs("div", { ref: ref, className: cn("relative", className), children: [size && (_jsx("svg", { "aria-hidden": true, width: size.w, height: size.h, className: "pointer-events-none absolute inset-0 overflow-visible", children: _jsx(RoughPaths, { shape: { kind: "rect", x: 2, y: 2, w: size.w - 4, h: size.h - 4 }, pen: pen }) })), _jsx("div", { className: "relative", children: children })] }));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=rough.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rough.js","sourceRoot":"","sources":["../../../src/components/sketch/rough.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,kFAAkF;AAClF,wCAAwC;AACxC,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;AAoB9B;4CAC4C;AAC5C,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,EAA8B;IACjE,MAAM,OAAO,GAAY;QACrB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,SAAS,EAAE,GAAG;QACd,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,GAAG;QACnC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QACnC,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,SAAS;QACrC,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,CAAC;QACb,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;KAClD,CAAC;IACF,MAAM,QAAQ,GACV,KAAK,CAAC,IAAI,KAAK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,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,GAAI,GACzF,CACT,EACD,cAAK,SAAS,EAAC,UAAU,YAAE,QAAQ,GAAO,IACxC,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ImageRatio } from "../ui/image.js";
|
|
3
|
+
export type ModelInfo = {
|
|
4
|
+
animations: string[];
|
|
5
|
+
size: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
z: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function ModelViewer({ src, alt, ratio, autoRotate, animation, autoPlay, draco, pending, controls, background, onLoad, onError, className, children, }: {
|
|
12
|
+
src: string;
|
|
13
|
+
/** What the model is, for a screen reader. */
|
|
14
|
+
alt: string;
|
|
15
|
+
ratio?: ImageRatio;
|
|
16
|
+
/** Turn slowly on its own (not under reduced motion). */
|
|
17
|
+
autoRotate?: boolean;
|
|
18
|
+
/** Which of the model's animations to play, by name or number; null for none. */
|
|
19
|
+
animation?: string | number | null;
|
|
20
|
+
/** Start the animation playing; by default it waits, at its first frame, for Play. */
|
|
21
|
+
autoPlay?: boolean;
|
|
22
|
+
/** Where the Draco decoder lives, for a compressed model (e.g. "https://www.gstatic.com/draco/versioned/decoders/1.5.7/"). */
|
|
23
|
+
draco?: string;
|
|
24
|
+
/** The model is on its way but its address is not known yet (still uploading): shows the loading state. */
|
|
25
|
+
pending?: boolean;
|
|
26
|
+
/** Show the buttons. */
|
|
27
|
+
controls?: boolean;
|
|
28
|
+
/** A CSS colour behind the model; the surface's own by default. */
|
|
29
|
+
background?: string;
|
|
30
|
+
onLoad?: (info: ModelInfo) => void;
|
|
31
|
+
onError?: (error: Error) => void;
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Over the model, top left: a caption, a badge. */
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=model-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/three/model-viewer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA0D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS/F,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAuB3D,MAAM,MAAM,SAAS,GAAG;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAE5F,wBAAgB,WAAW,CAAC,EACxB,GAAG,EACH,GAAG,EACH,KAAmB,EACnB,UAAkB,EAClB,SAAa,EACb,QAAgB,EAChB,KAAK,EACL,OAAe,EACf,QAAe,EACf,UAAU,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,GACX,EAAE;IACC,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACnC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8HAA8H;IAC9H,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2GAA2G;IAC3G,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,+BAuYA"}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Maximize, Minimize, Pause, Play, RotateCcw, Rotate3d } from "lucide-react";
|
|
4
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
7
|
+
import { RoomEnvironment } from "three/examples/jsm/environments/RoomEnvironment.js";
|
|
8
|
+
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
9
|
+
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
10
|
+
import { useMediaQuery } from "../../hooks/use-media-query.js";
|
|
11
|
+
import { cn } from "../../lib/utils.js";
|
|
12
|
+
import { Button } from "../ui/button.js";
|
|
13
|
+
import { ratioOf } from "../ui/image.js";
|
|
14
|
+
import { Tooltip } from "../ui/tooltip.js";
|
|
15
|
+
export function ModelViewer({ src, alt, ratio = "landscape", autoRotate = false, animation = 0, autoPlay = false, draco, pending = false, controls = true, background, onLoad, onError, className, children, }) {
|
|
16
|
+
const box = useRef(null);
|
|
17
|
+
const canvasHost = useRef(null);
|
|
18
|
+
const help = useId();
|
|
19
|
+
const reduced = useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
20
|
+
const [progress, setProgress] = useState(0);
|
|
21
|
+
const [state, setState] = useState("loading");
|
|
22
|
+
const [error, setError] = useState(null);
|
|
23
|
+
const [rotating, setRotating] = useState(autoRotate);
|
|
24
|
+
const [playing, setPlaying] = useState(autoPlay);
|
|
25
|
+
const [clips, setClips] = useState([]);
|
|
26
|
+
const [full, setFull] = useState(false);
|
|
27
|
+
const [touched, setTouched] = useState(false);
|
|
28
|
+
// The live scene, for the buttons and keys to reach.
|
|
29
|
+
const world = useRef(null);
|
|
30
|
+
const latest = useRef({ onLoad, onError, reduced });
|
|
31
|
+
latest.current = { onLoad, onError, reduced };
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const host = canvasHost.current;
|
|
34
|
+
if (!host)
|
|
35
|
+
return;
|
|
36
|
+
let disposed = false;
|
|
37
|
+
setState("loading");
|
|
38
|
+
setProgress(pending ? null : 0);
|
|
39
|
+
setError(null);
|
|
40
|
+
if (pending)
|
|
41
|
+
return;
|
|
42
|
+
let renderer;
|
|
43
|
+
try {
|
|
44
|
+
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
setState("error");
|
|
48
|
+
setError("This browser can't show 3D models.");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
|
52
|
+
renderer.outputColorSpace = THREE.SRGBColorSpace;
|
|
53
|
+
renderer.toneMapping = THREE.ACESFilmicToneMapping;
|
|
54
|
+
renderer.domElement.style.display = "block";
|
|
55
|
+
renderer.domElement.setAttribute("aria-hidden", "true");
|
|
56
|
+
host.appendChild(renderer.domElement);
|
|
57
|
+
const scene = new THREE.Scene();
|
|
58
|
+
const pmrem = new THREE.PMREMGenerator(renderer);
|
|
59
|
+
const room = new RoomEnvironment();
|
|
60
|
+
const environment = pmrem.fromScene(room, 0.04);
|
|
61
|
+
scene.environment = environment.texture;
|
|
62
|
+
const camera = new THREE.PerspectiveCamera(35, 1, 0.01, 1000);
|
|
63
|
+
const orbit = new OrbitControls(camera, renderer.domElement);
|
|
64
|
+
orbit.enableDamping = true;
|
|
65
|
+
orbit.dampingFactor = 0.08;
|
|
66
|
+
orbit.autoRotateSpeed = 1.2;
|
|
67
|
+
// The time between frames, kept by hand: THREE.Clock is deprecated from r185,
|
|
68
|
+
// and its replacement is not in every three this supports (from 0.160).
|
|
69
|
+
let lastFrame = performance.now();
|
|
70
|
+
let mixer = null;
|
|
71
|
+
let model = null;
|
|
72
|
+
let visible = true;
|
|
73
|
+
let dirty = true;
|
|
74
|
+
// A camera flight (the entrance, a reset): from, to, start time, length.
|
|
75
|
+
let flight = null;
|
|
76
|
+
let grow = null;
|
|
77
|
+
const ease = (t) => 1 - Math.pow(1 - t, 3);
|
|
78
|
+
const flyTo = (position, target, ms = 450) => {
|
|
79
|
+
if (latest.current.reduced) {
|
|
80
|
+
camera.position.copy(position);
|
|
81
|
+
orbit.target.copy(target);
|
|
82
|
+
orbit.update();
|
|
83
|
+
dirty = true;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
flight = { from: [camera.position.clone(), orbit.target.clone()], to: [position.clone(), target.clone()], start: performance.now(), ms };
|
|
87
|
+
};
|
|
88
|
+
const size = () => {
|
|
89
|
+
const { clientWidth: w, clientHeight: h } = host;
|
|
90
|
+
if (!w || !h)
|
|
91
|
+
return;
|
|
92
|
+
renderer.setSize(w, h, false);
|
|
93
|
+
renderer.domElement.style.width = "100%";
|
|
94
|
+
renderer.domElement.style.height = "100%";
|
|
95
|
+
camera.aspect = w / h;
|
|
96
|
+
camera.updateProjectionMatrix();
|
|
97
|
+
dirty = true;
|
|
98
|
+
};
|
|
99
|
+
const resize = new ResizeObserver(size);
|
|
100
|
+
resize.observe(host);
|
|
101
|
+
size();
|
|
102
|
+
const seen = new IntersectionObserver(([entry]) => (visible = entry?.isIntersecting ?? true));
|
|
103
|
+
seen.observe(host);
|
|
104
|
+
orbit.addEventListener("change", () => (dirty = true));
|
|
105
|
+
orbit.addEventListener("start", () => setTouched(true));
|
|
106
|
+
renderer.setAnimationLoop(() => {
|
|
107
|
+
// Off screen or in a hidden tab: nothing drawn, and the clock kept current, so
|
|
108
|
+
// the animation picks up where it was rather than jumping ahead.
|
|
109
|
+
if (!visible || document.hidden) {
|
|
110
|
+
lastFrame = performance.now();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const now = performance.now();
|
|
114
|
+
const delta = (now - lastFrame) / 1000;
|
|
115
|
+
lastFrame = now;
|
|
116
|
+
if (flight) {
|
|
117
|
+
const t = Math.min(1, (now - flight.start) / flight.ms);
|
|
118
|
+
camera.position.lerpVectors(flight.from[0], flight.to[0], ease(t));
|
|
119
|
+
orbit.target.lerpVectors(flight.from[1], flight.to[1], ease(t));
|
|
120
|
+
if (t === 1)
|
|
121
|
+
flight = null;
|
|
122
|
+
dirty = true;
|
|
123
|
+
}
|
|
124
|
+
if (grow && model) {
|
|
125
|
+
const t = Math.min(1, (now - grow.start) / grow.ms);
|
|
126
|
+
model.scale.setScalar(0.9 + 0.1 * ease(t));
|
|
127
|
+
if (t === 1)
|
|
128
|
+
grow = null;
|
|
129
|
+
dirty = true;
|
|
130
|
+
}
|
|
131
|
+
if (mixer && mixer.timeScale !== 0) {
|
|
132
|
+
mixer.update(delta);
|
|
133
|
+
dirty = true;
|
|
134
|
+
}
|
|
135
|
+
// Damping and turning on its own move the camera inside update().
|
|
136
|
+
if (orbit.update() || orbit.autoRotate)
|
|
137
|
+
dirty = true;
|
|
138
|
+
if (dirty) {
|
|
139
|
+
renderer.render(scene, camera);
|
|
140
|
+
dirty = false;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const loader = new GLTFLoader();
|
|
144
|
+
let dracoLoader = null;
|
|
145
|
+
if (draco) {
|
|
146
|
+
dracoLoader = new DRACOLoader();
|
|
147
|
+
dracoLoader.setDecoderPath(draco);
|
|
148
|
+
loader.setDRACOLoader(dracoLoader);
|
|
149
|
+
}
|
|
150
|
+
loader.load(src, (gltf) => {
|
|
151
|
+
if (disposed)
|
|
152
|
+
return;
|
|
153
|
+
model = gltf.scene;
|
|
154
|
+
// Frame it: centred on the origin, the camera far enough back to see all of it.
|
|
155
|
+
const bounds = new THREE.Box3().setFromObject(model);
|
|
156
|
+
const sizeOf = bounds.getSize(new THREE.Vector3());
|
|
157
|
+
const centre = bounds.getCenter(new THREE.Vector3());
|
|
158
|
+
model.position.sub(centre);
|
|
159
|
+
const pivot = new THREE.Group();
|
|
160
|
+
pivot.add(model);
|
|
161
|
+
scene.add(pivot);
|
|
162
|
+
model = pivot;
|
|
163
|
+
const radius = sizeOf.length() / 2 || 1;
|
|
164
|
+
const distance = radius / Math.sin(THREE.MathUtils.degToRad(camera.fov / 2)) * 1.05;
|
|
165
|
+
const home = { position: new THREE.Vector3(0.55, 0.3, 1).normalize().multiplyScalar(distance), target: new THREE.Vector3() };
|
|
166
|
+
camera.near = distance / 100;
|
|
167
|
+
camera.far = distance * 20;
|
|
168
|
+
camera.updateProjectionMatrix();
|
|
169
|
+
orbit.minDistance = radius * 0.6;
|
|
170
|
+
orbit.maxDistance = distance * 4;
|
|
171
|
+
orbit.target.copy(home.target);
|
|
172
|
+
if (latest.current.reduced) {
|
|
173
|
+
camera.position.copy(home.position);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
camera.position.copy(home.position).multiplyScalar(1.35);
|
|
177
|
+
flyTo(home.position, home.target, 900);
|
|
178
|
+
grow = { start: performance.now(), ms: 700 };
|
|
179
|
+
pivot.scale.setScalar(0.9);
|
|
180
|
+
}
|
|
181
|
+
orbit.update();
|
|
182
|
+
const clipsByName = new Map();
|
|
183
|
+
const actions = [];
|
|
184
|
+
if (gltf.animations.length) {
|
|
185
|
+
mixer = new THREE.AnimationMixer(gltf.scene);
|
|
186
|
+
for (const clip of gltf.animations) {
|
|
187
|
+
const action = mixer.clipAction(clip);
|
|
188
|
+
actions.push(action);
|
|
189
|
+
clipsByName.set(clip.name, action);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
world.current = { camera, controls: orbit, home, mixer, actions, clipsByName, flyTo, wake: () => (dirty = true) };
|
|
193
|
+
setClips(gltf.animations.map((clip) => clip.name));
|
|
194
|
+
setProgress(1);
|
|
195
|
+
setState("ready");
|
|
196
|
+
dirty = true;
|
|
197
|
+
latest.current.onLoad?.({ animations: gltf.animations.map((clip) => clip.name), size: { x: sizeOf.x, y: sizeOf.y, z: sizeOf.z } });
|
|
198
|
+
}, (event) => {
|
|
199
|
+
if (!disposed)
|
|
200
|
+
setProgress(event.lengthComputable && event.total ? event.loaded / event.total : null);
|
|
201
|
+
}, (err) => {
|
|
202
|
+
if (disposed)
|
|
203
|
+
return;
|
|
204
|
+
setState("error");
|
|
205
|
+
setError("This model couldn't be loaded.");
|
|
206
|
+
latest.current.onError?.(err instanceof Error ? err : new Error(String(err)));
|
|
207
|
+
});
|
|
208
|
+
return () => {
|
|
209
|
+
disposed = true;
|
|
210
|
+
world.current = null;
|
|
211
|
+
renderer.setAnimationLoop(null);
|
|
212
|
+
resize.disconnect();
|
|
213
|
+
seen.disconnect();
|
|
214
|
+
orbit.dispose();
|
|
215
|
+
mixer?.stopAllAction();
|
|
216
|
+
scene.traverse((object) => {
|
|
217
|
+
const mesh = object;
|
|
218
|
+
mesh.geometry?.dispose();
|
|
219
|
+
const materials = Array.isArray(mesh.material) ? mesh.material : mesh.material ? [mesh.material] : [];
|
|
220
|
+
for (const material of materials) {
|
|
221
|
+
for (const value of Object.values(material))
|
|
222
|
+
if (value instanceof THREE.Texture)
|
|
223
|
+
value.dispose();
|
|
224
|
+
material.dispose();
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
environment.dispose();
|
|
228
|
+
room.dispose?.();
|
|
229
|
+
pmrem.dispose();
|
|
230
|
+
dracoLoader?.dispose();
|
|
231
|
+
renderer.dispose();
|
|
232
|
+
// Let the browser have the context back now: switching models makes a new one,
|
|
233
|
+
// and browsers allow only a handful at once.
|
|
234
|
+
renderer.forceContextLoss();
|
|
235
|
+
renderer.domElement.remove();
|
|
236
|
+
};
|
|
237
|
+
}, [src, draco, pending]);
|
|
238
|
+
// Turning on its own, never under reduced motion.
|
|
239
|
+
useEffect(() => {
|
|
240
|
+
const w = world.current;
|
|
241
|
+
if (!w)
|
|
242
|
+
return;
|
|
243
|
+
w.controls.autoRotate = rotating && !reduced;
|
|
244
|
+
w.wake();
|
|
245
|
+
}, [rotating, reduced, state]);
|
|
246
|
+
// The chosen animation, playing or held.
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
const w = world.current;
|
|
249
|
+
if (!w?.mixer)
|
|
250
|
+
return;
|
|
251
|
+
const chosen = animation === null ? undefined : typeof animation === "number" ? w.actions[animation] : w.clipsByName.get(animation);
|
|
252
|
+
w.mixer.timeScale = playing ? 1 : 0;
|
|
253
|
+
if (playing) {
|
|
254
|
+
for (const action of w.actions)
|
|
255
|
+
if (action !== chosen)
|
|
256
|
+
action.fadeOut(0.3);
|
|
257
|
+
chosen?.reset().fadeIn(0.3).play();
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
// Paused, there is no time for a crossfade: show the chosen one's first frame.
|
|
261
|
+
for (const action of w.actions)
|
|
262
|
+
if (action !== chosen)
|
|
263
|
+
action.stop();
|
|
264
|
+
chosen?.reset().setEffectiveWeight(1).play();
|
|
265
|
+
w.mixer.update(0);
|
|
266
|
+
}
|
|
267
|
+
w.wake();
|
|
268
|
+
}, [animation, playing, state]);
|
|
269
|
+
useEffect(() => {
|
|
270
|
+
const onChange = () => setFull(document.fullscreenElement === box.current);
|
|
271
|
+
document.addEventListener("fullscreenchange", onChange);
|
|
272
|
+
return () => document.removeEventListener("fullscreenchange", onChange);
|
|
273
|
+
}, []);
|
|
274
|
+
const reset = () => {
|
|
275
|
+
const w = world.current;
|
|
276
|
+
if (w)
|
|
277
|
+
w.flyTo(w.home.position, w.home.target);
|
|
278
|
+
};
|
|
279
|
+
const onKeyDown = (e) => {
|
|
280
|
+
const w = world.current;
|
|
281
|
+
if (!w || e.target !== e.currentTarget)
|
|
282
|
+
return;
|
|
283
|
+
const offset = w.camera.position.clone().sub(w.controls.target);
|
|
284
|
+
const spherical = new THREE.Spherical().setFromVector3(offset);
|
|
285
|
+
const turn = THREE.MathUtils.degToRad(e.shiftKey ? 45 : 15);
|
|
286
|
+
if (e.key === "ArrowLeft")
|
|
287
|
+
spherical.theta -= turn;
|
|
288
|
+
else if (e.key === "ArrowRight")
|
|
289
|
+
spherical.theta += turn;
|
|
290
|
+
else if (e.key === "ArrowUp")
|
|
291
|
+
spherical.phi = Math.max(0.1, spherical.phi - turn);
|
|
292
|
+
else if (e.key === "ArrowDown")
|
|
293
|
+
spherical.phi = Math.min(Math.PI - 0.1, spherical.phi + turn);
|
|
294
|
+
else if (e.key === "+" || e.key === "=")
|
|
295
|
+
spherical.radius = Math.max(w.controls.minDistance, spherical.radius * 0.8);
|
|
296
|
+
else if (e.key === "-" || e.key === "_")
|
|
297
|
+
spherical.radius = Math.min(w.controls.maxDistance, spherical.radius * 1.25);
|
|
298
|
+
else if (e.key === "0" || e.key === "Home")
|
|
299
|
+
return (e.preventDefault(), reset());
|
|
300
|
+
else
|
|
301
|
+
return;
|
|
302
|
+
e.preventDefault();
|
|
303
|
+
setTouched(true);
|
|
304
|
+
w.flyTo(new THREE.Vector3().setFromSpherical(spherical).add(w.controls.target), w.controls.target.clone(), 220);
|
|
305
|
+
};
|
|
306
|
+
const loading = state === "loading";
|
|
307
|
+
const canFull = typeof document !== "undefined" && document.fullscreenEnabled;
|
|
308
|
+
return (_jsxs("div", { ref: box, role: "application", "aria-roledescription": "3D model", "aria-label": alt, "aria-describedby": help, "aria-busy": loading || undefined, tabIndex: 0, onKeyDown: onKeyDown, style: { aspectRatio: full ? undefined : ratioOf(ratio), background: background ?? undefined }, className: cn("group/model @container relative bg-surface-sunken rounded-surface overflow-hidden outline-offset-2 select-none", full && "rounded-none", className), children: [_jsx("span", { id: help, className: "sr-only", children: "Drag, or use the arrow keys, to turn it. Scroll, pinch, or plus and minus, to zoom. Zero puts it back." }), _jsx("div", { ref: canvasHost, className: cn("absolute inset-0 transition-opacity duration-(--duration-reveal) ease-out-notion cursor-grab active:cursor-grabbing", loading || state === "error" ? "opacity-0" : "opacity-100") }), _jsxs("div", { "aria-hidden": !loading, className: cn("absolute inset-0 flex flex-col justify-center items-center gap-3 transition-opacity duration-(--duration-slow) pointer-events-none", loading ? "opacity-100" : "opacity-0"), children: [_jsx("span", { className: "absolute inset-0 bg-tint-hover animate-pulse motion-reduce:animate-none" }), _jsx(TracingBox, {}), _jsx("span", { className: cn("relative bg-hairline rounded-full w-24 h-0.5 overflow-hidden", progress === null && "invisible"), children: _jsx("span", { className: "block bg-accent h-full transition-[width] duration-(--duration-slow) ease-out-notion", style: { width: `${Math.round((progress ?? 0) * 100)}%` } }) }), _jsx("span", { role: "status", className: "relative tabular-nums text-caption text-ink-secondary", children: loading ? (progress === null ? "Loading the model…" : `Loading the model, ${Math.round(progress * 100)}%`) : "" })] }), state === "error" && (_jsxs("div", { role: "alert", className: "absolute inset-0 flex flex-col justify-center items-center gap-1.5 p-4 text-caption text-center text-ink-tertiary", children: [_jsx(Rotate3d, { className: "size-6", strokeWidth: 1.5 }), _jsx("span", { className: "hidden @min-[12rem]:inline", children: error })] })), children !== undefined && _jsx("div", { className: "top-3 left-3 absolute", children: children }), state === "ready" && (_jsxs("span", { "aria-hidden": true, className: cn("bottom-3 left-3 absolute flex items-center gap-1 bg-on-media-strong px-1.5 py-0.5 rounded-control text-caption text-on-media-ink transition-opacity duration-(--duration-slow) pointer-events-none", "@max-[20rem]:hidden", touched && "opacity-0"), children: [_jsx(Rotate3d, { className: "size-3.5" }), " Drag to turn"] })), controls && state === "ready" && (_jsxs("div", { className: "right-2 bottom-2 absolute flex items-center gap-0.5 bg-on-media-strong p-0.5 rounded-control text-on-media-ink [&_button]:text-on-media-ink [&_button:hover]:bg-on-media", children: [clips.length > 0 && animation !== null && (_jsx(Tooltip, { content: playing ? "Pause" : "Play", children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": playing ? "Pause the animation" : "Play the animation", onClick: () => setPlaying((p) => !p), children: playing ? _jsx(Pause, {}) : _jsx(Play, {}) }) })), !reduced && (_jsx(Tooltip, { content: rotating ? "Stop turning" : "Turn on its own", children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Turn on its own", "aria-pressed": rotating, onClick: () => setRotating((r) => !r), className: "aria-pressed:bg-on-media", children: _jsx(Rotate3d, {}) }) })), _jsx(Tooltip, { content: "Reset the view", shortcut: "0", children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Reset the view", onClick: reset, children: _jsx(RotateCcw, {}) }) }), canFull && (_jsx(Tooltip, { content: full ? "Exit full screen" : "Full screen", children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": full ? "Exit full screen" : "Full screen", onClick: () => (full ? document.exitFullscreen() : box.current?.requestFullscreen()), children: full ? _jsx(Minimize, {}) : _jsx(Maximize, {}) }) }))] }))] }));
|
|
309
|
+
}
|
|
310
|
+
/* A wireframe box drawn edge by edge, like a circuit being traced: the three
|
|
311
|
+
edges at its back first (faint), then the back, the edges running forward and
|
|
312
|
+
the front face, each
|
|
313
|
+
a step after the last, then all fade and it draws again. Under reduced
|
|
314
|
+
motion it stands drawn. */
|
|
315
|
+
// The front face, and the back face up and to the right of it.
|
|
316
|
+
const F = { tl: [12, 24], tr: [40, 24], br: [40, 52], bl: [12, 52] };
|
|
317
|
+
const B = { tl: [24, 12], tr: [52, 12], br: [52, 40], bl: [24, 40] };
|
|
318
|
+
const line = (a, b) => `M${a[0]} ${a[1]} L${b[0]} ${b[1]}`;
|
|
319
|
+
const EDGES = [
|
|
320
|
+
// Behind: the hidden corner's three edges, faint.
|
|
321
|
+
{ d: line(B.bl, B.tl), back: true },
|
|
322
|
+
{ d: line(B.bl, B.br), back: true },
|
|
323
|
+
{ d: line(B.bl, F.bl), back: true },
|
|
324
|
+
// The back's top and side, the edges running forward, then the front face.
|
|
325
|
+
{ d: line(B.tl, B.tr) },
|
|
326
|
+
{ d: line(B.tr, B.br) },
|
|
327
|
+
{ d: line(B.tl, F.tl) },
|
|
328
|
+
{ d: line(B.tr, F.tr) },
|
|
329
|
+
{ d: line(B.br, F.br) },
|
|
330
|
+
{ d: line(F.tl, F.tr) },
|
|
331
|
+
{ d: line(F.tr, F.br) },
|
|
332
|
+
{ d: line(F.br, F.bl) },
|
|
333
|
+
{ d: line(F.bl, F.tl) },
|
|
334
|
+
];
|
|
335
|
+
function TracingBox() {
|
|
336
|
+
return (_jsxs("svg", { viewBox: "0 0 64 64", className: "relative size-20", "aria-hidden": true, fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [EDGES.map((edge, i) => (_jsx("path", { d: edge.d, pathLength: 1, strokeDasharray: "1 1", strokeWidth: edge.back ? 1.25 : 1.75, className: cn(edge.back ? "stroke-hairline-strong" : "stroke-accent", "animate-trace motion-reduce:animate-none"), style: { animationDelay: `${i * 90}ms` } }, i))), _jsx("circle", { cx: F.tr[0], cy: F.tr[1], r: 1.75, className: "fill-accent animate-trace motion-reduce:animate-none", style: { animationDelay: "500ms" } })] }));
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=model-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-viewer.js","sourceRoot":"","sources":["../../../src/components/three/model-viewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,UAAU,EAAa,M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AE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;CAC1B,CAAC;AAEF,SAAS,UAAU;IACf,OAAO,CACH,eAAK,OAAO,EAAC,WAAW,EAAC,SAAS,EAAC,kBAAkB,uBAAa,IAAI,EAAC,MAAM,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,aACrH,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACpB,eAEI,CAAC,EAAE,IAAI,CAAC,CAAC,EACT,UAAU,EAAE,CAAC,EACb,eAAe,EAAC,KAAK,EACrB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACpC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,eAAe,EAAE,0CAA0C,CAAC,EACjH,KAAK,EAAE,EAAE,cAAc,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IANnC,CAAC,CAOR,CACL,CAAC,EAEF,iBAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAC,sDAAsD,EAAC,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,GAAI,IAChJ,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accent-picker.d.ts","sourceRoot":"","sources":["../../../src/components/ui/accent-picker.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,YAAY,gCAkD3B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
6
|
+
import { ACCENTS, ACCENT_KEY } from "../../lib/accent.js";
|
|
7
|
+
const label = (accent) => accent[0].toUpperCase() + accent.slice(1);
|
|
8
|
+
// A dot in a theme's colour. It carries its own data-accent, so it shows that
|
|
9
|
+
// theme's colour in whichever mode is on, whatever the page's theme is. Paper has no
|
|
10
|
+
// colour of its own, so its dot is a plain one with a ring.
|
|
11
|
+
function Swatch({ accent }) {
|
|
12
|
+
if (accent === "paper")
|
|
13
|
+
return _jsx("span", { className: "size-3 shrink-0 rounded-full bg-tag-gray-bg shadow-[inset_0_0_0_1px_var(--hairline-strong)]" });
|
|
14
|
+
return _jsx("span", { "data-accent": accent, className: "size-3 shrink-0 rounded-full bg-accent" });
|
|
15
|
+
}
|
|
16
|
+
/* The colour theme: which colour titles, markers and controls take, and the wash it
|
|
17
|
+
gives every surface, so the background matches. Separate from light and dark, and
|
|
18
|
+
remembered per browser. One row in the sidebar shows the current theme and opens
|
|
19
|
+
the list of them. */
|
|
20
|
+
export function AccentPicker() {
|
|
21
|
+
const [accent, setAccent] = useState("paper");
|
|
22
|
+
// The <head> script has already applied the stored choice; this only reads it back.
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const stored = document.documentElement.dataset.accent;
|
|
25
|
+
if (stored && ACCENTS.includes(stored))
|
|
26
|
+
setAccent(stored);
|
|
27
|
+
}, []);
|
|
28
|
+
const choose = (next) => {
|
|
29
|
+
setAccent(next);
|
|
30
|
+
// Paper is the absence of a theme, so the stylesheet's defaults apply.
|
|
31
|
+
if (next === "paper")
|
|
32
|
+
delete document.documentElement.dataset.accent;
|
|
33
|
+
else
|
|
34
|
+
document.documentElement.dataset.accent = next;
|
|
35
|
+
try {
|
|
36
|
+
localStorage.setItem(ACCENT_KEY, next);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Private mode: the choice lasts for this page view only.
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-label": `Colour theme: ${label(accent)}`, className: "flex h-control-sm w-full items-center gap-2 rounded-control px-2 text-sm font-medium text-ink-secondary transition-colors duration-(--duration-fast) hover:bg-tint-hover data-[state=open]:bg-tint-hover", children: [_jsx("span", { className: "flex size-5 items-center justify-center", children: _jsx(Swatch, { accent: accent }) }), _jsx("span", { className: "min-w-0 flex-1 truncate text-left", children: "Colour" }), _jsx("span", { className: "text-ink-tertiary", children: label(accent) }), _jsx(ChevronsUpDown, { className: "size-3.5 text-ink-tertiary" })] }) }), _jsxs(DropdownMenuContent, { side: "top", align: "start", className: "w-(--radix-dropdown-menu-trigger-width)", children: [_jsx(DropdownMenuLabel, { children: "Colour theme" }), _jsx(DropdownMenuRadioGroup, { value: accent, onValueChange: (next) => choose(next), children: ACCENTS.map((a) => (_jsxs(DropdownMenuRadioItem, { value: a, children: [_jsx(Swatch, { accent: a }), label(a)] }, a))) })] })] }));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=accent-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accent-picker.js","sourceRoot":"","sources":["../../../src/components/ui/accent-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oBAAqB,CAAC;AAC/J,OAAO,EAAE,OAAO,EAAE,UAAU,EAAe,MAAM,qBAAqB,C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mB,IAAC,OAAO,kBACxB,kBACI,IAAI,EAAC,QAAQ,gBACD,iBAAiB,KAAK,CAAC,MAAM,CAAC,EAAE,EAC5C,SAAS,EAAC,0MAA0M,aAEpN,eAAM,SAAS,EAAC,yCAAyC,YACrD,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,GAAI,GACvB,EACP,eAAM,SAAS,EAAC,mCAAmC,uBAAc,EACjE,eAAM,SAAS,EAAC,mBAAmB,YAAE,KAAK,CAAC,MAAM,CAAC,GAAQ,EAC1D,KAAC,cAAc,IAAC,SAAS,EAAC,4BAA4B,GAAG,IACpD,GACS,EACtB,MAAC,mBAAmB,IAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,yCAAyC,aAC7F,KAAC,iBAAiB,+BAAiC,EACnD,KAAC,sBAAsB,IAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAc,CAAC,YACjF,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,MAAC,qBAAqB,IAAS,KAAK,EAAE,CAAC,aACnC,KAAC,MAAM,IAAC,MAAM,EAAE,CAAC,GAAI,EACpB,KAAK,CAAC,CAAC,CAAC,KAFe,CAAC,CAGL,CAC3B,CAAC,GACmB,IACP,IACX,CAClB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function AddressField({ icon, placeholder, check, onCommit, autoFocus, className, }: {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
check: (url: string) => string | null;
|
|
6
|
+
onCommit: (url: string) => void;
|
|
7
|
+
autoFocus?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=address-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/address-field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMjD,wBAAgB,YAAY,CAAC,EACzB,IAAI,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,SAAgB,EAChB,SAAS,GACZ,EAAE;IACC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAkCA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Where an empty block asks for a link: one field that commits on Enter, and
|
|
6
|
+
says why when what was pasted will not do. `check` returns that reason, or
|
|
7
|
+
null for an address it accepts. */
|
|
8
|
+
export function AddressField({ icon, placeholder, check, onCommit, autoFocus = true, className, }) {
|
|
9
|
+
const [value, setValue] = useState("");
|
|
10
|
+
const [error, setError] = useState(null);
|
|
11
|
+
return (_jsxs("form", { className: cn("flex flex-wrap items-center gap-2 rounded-surface bg-tint-hover px-4 py-3 text-sm", className), onSubmit: (e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
const url = value.trim();
|
|
14
|
+
const problem = check(url);
|
|
15
|
+
if (problem === null)
|
|
16
|
+
onCommit(url);
|
|
17
|
+
else
|
|
18
|
+
setError(problem);
|
|
19
|
+
}, children: [icon && _jsx("span", { className: "text-ink-tertiary [&_svg]:size-4", children: icon }), _jsx("input", { autoFocus: autoFocus, value: value, onChange: (e) => {
|
|
20
|
+
setValue(e.target.value);
|
|
21
|
+
setError(null);
|
|
22
|
+
}, placeholder: placeholder, "aria-label": placeholder, "aria-invalid": error !== null || undefined, className: "h-8 min-w-0 flex-1 bg-transparent text-ink outline-none placeholder:text-ink-tertiary" }), error !== null && (_jsx("span", { role: "alert", className: "w-full text-danger", children: error }))] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=address-field.js.map
|