@kujoforall/paper-ui 0.1.0 → 0.2.1
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 +94 -0
- package/README.md +50 -7
- package/dist/components/editor/block-text.d.ts.map +1 -1
- package/dist/components/editor/block-text.js +52 -17
- package/dist/components/editor/block-text.js.map +1 -1
- package/dist/components/editor/blocks.d.ts.map +1 -1
- package/dist/components/editor/blocks.js +17 -13
- package/dist/components/editor/blocks.js.map +1 -1
- package/dist/components/editor/document-editor.d.ts.map +1 -1
- package/dist/components/editor/document-editor.js +4 -2
- package/dist/components/editor/document-editor.js.map +1 -1
- package/dist/components/editor/document-view.d.ts.map +1 -1
- package/dist/components/editor/document-view.js +17 -12
- package/dist/components/editor/document-view.js.map +1 -1
- package/dist/components/editor/editor-state.d.ts +7 -0
- package/dist/components/editor/editor-state.d.ts.map +1 -1
- package/dist/components/editor/editor-state.js +28 -3
- package/dist/components/editor/editor-state.js.map +1 -1
- 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.map +1 -1
- package/dist/components/editor/extensions/spoiler.js +2 -2
- package/dist/components/editor/extensions/spoiler.js.map +1 -1
- package/dist/components/editor/index.d.ts +1 -0
- package/dist/components/editor/index.d.ts.map +1 -1
- package/dist/components/editor/index.js +1 -0
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/editor/kinds.js +1 -1
- package/dist/components/editor/kinds.js.map +1 -1
- 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/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.js +1 -1
- package/dist/components/ui/accent-picker.js.map +1 -1
- 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 +1 -0
- package/dist/components/ui/app-shell.d.ts.map +1 -1
- package/dist/components/ui/app-shell.js +5 -3
- package/dist/components/ui/app-shell.js.map +1 -1
- 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 +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +2 -2
- package/dist/components/ui/badge.js.map +1 -1
- 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.js +1 -1
- package/dist/components/ui/breadcrumbs.js.map +1 -1
- package/dist/components/ui/button.d.ts +8 -6
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +91 -26
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +6 -5
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/callout.d.ts +23 -4
- package/dist/components/ui/callout.d.ts.map +1 -1
- package/dist/components/ui/callout.js +28 -15
- package/dist/components/ui/callout.js.map +1 -1
- package/dist/components/ui/card.d.ts +13 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +10 -9
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +9 -4
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +25 -5
- package/dist/components/ui/checkbox.js.map +1 -1
- 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 +5 -2
- package/dist/components/ui/command-menu.d.ts.map +1 -1
- package/dist/components/ui/command-menu.js +31 -6
- package/dist/components/ui/command-menu.js.map +1 -1
- 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 +6 -1
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/date-picker.js +20 -12
- package/dist/components/ui/date-picker.js.map +1 -1
- package/dist/components/ui/date-time-picker.d.ts +3 -1
- package/dist/components/ui/date-time-picker.d.ts.map +1 -1
- package/dist/components/ui/date-time-picker.js +17 -15
- package/dist/components/ui/date-time-picker.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +13 -9
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +33 -3
- package/dist/components/ui/dialog.js.map +1 -1
- 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 +14 -10
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +22 -13
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/editable-text.d.ts +9 -2
- package/dist/components/ui/editable-text.d.ts.map +1 -1
- package/dist/components/ui/editable-text.js +27 -10
- package/dist/components/ui/editable-text.js.map +1 -1
- 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 +2 -1
- package/dist/components/ui/field-button.d.ts.map +1 -1
- package/dist/components/ui/field-button.js +7 -5
- package/dist/components/ui/field-button.js.map +1 -1
- package/dist/components/ui/file-preview.js +1 -1
- package/dist/components/ui/file-preview.js.map +1 -1
- package/dist/components/ui/file-uploader.d.ts.map +1 -1
- package/dist/components/ui/file-uploader.js +5 -4
- package/dist/components/ui/file-uploader.js.map +1 -1
- 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 +11 -1
- package/dist/components/ui/handle-row.d.ts.map +1 -1
- package/dist/components/ui/handle-row.js +101 -32
- package/dist/components/ui/handle-row.js.map +1 -1
- 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.js +4 -4
- package/dist/components/ui/image-block.js.map +1 -1
- package/dist/components/ui/image-card.d.ts.map +1 -1
- package/dist/components/ui/image-card.js +5 -4
- package/dist/components/ui/image-card.js.map +1 -1
- 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.map +1 -1
- package/dist/components/ui/image-viewer.js +38 -5
- package/dist/components/ui/image-viewer.js.map +1 -1
- package/dist/components/ui/image.d.ts +25 -3
- package/dist/components/ui/image.d.ts.map +1 -1
- package/dist/components/ui/image.js +50 -21
- package/dist/components/ui/image.js.map +1 -1
- package/dist/components/ui/index.d.ts +54 -11
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +53 -10
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/input.d.ts +71 -12
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +236 -23
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/link-block.d.ts.map +1 -1
- package/dist/components/ui/link-block.js +1 -1
- package/dist/components/ui/link-block.js.map +1 -1
- 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.js +1 -1
- package/dist/components/ui/mac-card.js.map +1 -1
- 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.map +1 -1
- package/dist/components/ui/nav-tree.js +10 -3
- package/dist/components/ui/nav-tree.js.map +1 -1
- package/dist/components/ui/page.d.ts +16 -5
- package/dist/components/ui/page.d.ts.map +1 -1
- package/dist/components/ui/page.js +23 -10
- package/dist/components/ui/page.js.map +1 -1
- 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 +2 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +11 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +17 -4
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/property.d.ts +2 -6
- package/dist/components/ui/property.d.ts.map +1 -1
- package/dist/components/ui/property.js +6 -22
- package/dist/components/ui/property.js.map +1 -1
- 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 +15 -7
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +8 -6
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select-menu.d.ts +3 -1
- package/dist/components/ui/select-menu.d.ts.map +1 -1
- package/dist/components/ui/select-menu.js +2 -2
- package/dist/components/ui/select-menu.js.map +1 -1
- package/dist/components/ui/select.d.ts +7 -2
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +19 -5
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/selection-bar.js +1 -1
- package/dist/components/ui/selection-bar.js.map +1 -1
- 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.map +1 -1
- package/dist/components/ui/spotlight.js +14 -11
- package/dist/components/ui/spotlight.js.map +1 -1
- package/dist/components/ui/step-dialog.js +3 -3
- package/dist/components/ui/step-dialog.js.map +1 -1
- 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 +13 -5
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +65 -12
- package/dist/components/ui/table.js.map +1 -1
- 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 +14 -0
- package/dist/components/ui/theme-toggle.d.ts.map +1 -1
- package/dist/components/ui/theme-toggle.js +69 -41
- package/dist/components/ui/theme-toggle.js.map +1 -1
- 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 +37 -11
- package/dist/components/ui/time-picker.d.ts.map +1 -1
- package/dist/components/ui/time-picker.js +130 -52
- package/dist/components/ui/time-picker.js.map +1 -1
- 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 +1 -1
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -2
- package/dist/components/ui/tooltip.js.map +1 -1
- 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 +11 -5
- package/dist/components/ui/typography.d.ts.map +1 -1
- package/dist/components/ui/typography.js +31 -5
- package/dist/components/ui/typography.js.map +1 -1
- package/dist/components/ui/video-block.d.ts.map +1 -1
- package/dist/components/ui/video-block.js +5 -1
- package/dist/components/ui/video-block.js.map +1 -1
- 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.map +1 -1
- package/dist/hooks/use-save-queue.js +19 -7
- package/dist/hooks/use-save-queue.js.map +1 -1
- package/dist/hooks/use-selection.d.ts.map +1 -1
- package/dist/hooks/use-selection.js +10 -1
- package/dist/hooks/use-selection.js.map +1 -1
- 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 +16 -0
- package/dist/lib/dates.d.ts.map +1 -1
- package/dist/lib/dates.js +27 -0
- package/dist/lib/dates.js.map +1 -1
- 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 +2 -0
- package/dist/lib/rich-text-dom.d.ts.map +1 -1
- package/dist/lib/rich-text-dom.js +5 -3
- package/dist/lib/rich-text-dom.js.map +1 -1
- 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/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +20 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles/notion.css +342 -51
- package/package.json +27 -4
- package/src/components/editor/block-text.tsx +58 -17
- package/src/components/editor/blocks.tsx +19 -14
- package/src/components/editor/document-editor.tsx +7 -2
- package/src/components/editor/document-view.tsx +37 -24
- package/src/components/editor/editor-state.tsx +31 -3
- package/src/components/editor/extensions/kit-blocks.tsx +452 -0
- package/src/components/editor/extensions/spoiler.tsx +9 -4
- package/src/components/editor/index.ts +1 -0
- package/src/components/editor/kinds.ts +1 -1
- package/src/components/editor/look.tsx +36 -0
- package/src/components/three/model-viewer.tsx +514 -0
- package/src/components/ui/accent-picker.tsx +2 -2
- 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 +9 -7
- package/src/components/ui/avatar.tsx +106 -0
- package/src/components/ui/badge.tsx +4 -4
- package/src/components/ui/banner.tsx +53 -0
- package/src/components/ui/breadcrumbs.tsx +1 -1
- package/src/components/ui/button.tsx +115 -41
- package/src/components/ui/calendar.tsx +8 -7
- package/src/components/ui/callout.tsx +41 -42
- package/src/components/ui/card.tsx +27 -58
- package/src/components/ui/checkbox.tsx +53 -19
- 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 +61 -31
- 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 +99 -61
- package/src/components/ui/date-time-picker.tsx +68 -62
- package/src/components/ui/dialog.tsx +48 -21
- package/src/components/ui/document-layout.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +33 -31
- package/src/components/ui/editable-text.tsx +40 -7
- 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 +11 -9
- package/src/components/ui/file-preview.tsx +1 -1
- package/src/components/ui/file-uploader.tsx +23 -24
- 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 +176 -40
- 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 +6 -6
- package/src/components/ui/image-card.tsx +18 -25
- package/src/components/ui/image-framer.tsx +160 -0
- package/src/components/ui/image-viewer.tsx +53 -10
- package/src/components/ui/image.tsx +133 -29
- package/src/components/ui/index.ts +106 -11
- package/src/components/ui/input.tsx +437 -65
- package/src/components/ui/link-block.tsx +5 -2
- package/src/components/ui/list-detail.tsx +115 -0
- package/src/components/ui/listbox.ts +26 -0
- package/src/components/ui/mac-card.tsx +5 -5
- 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 +11 -5
- package/src/components/ui/page.tsx +63 -15
- package/src/components/ui/pagination.tsx +143 -0
- package/src/components/ui/picker-panel.tsx +69 -0
- package/src/components/ui/popover.tsx +3 -3
- package/src/components/ui/progress.tsx +56 -16
- package/src/components/ui/property.tsx +6 -37
- 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 +48 -16
- package/src/components/ui/select-menu.tsx +11 -3
- package/src/components/ui/select.tsx +33 -10
- package/src/components/ui/selection-bar.tsx +1 -1
- 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 +21 -21
- package/src/components/ui/step-dialog.tsx +6 -6
- package/src/components/ui/steps-layout.tsx +91 -0
- package/src/components/ui/switch.tsx +55 -0
- package/src/components/ui/table.tsx +75 -18
- package/src/components/ui/tabs.tsx +41 -0
- package/src/components/ui/theme-toggle.tsx +74 -83
- package/src/components/ui/time-list.tsx +106 -0
- package/src/components/ui/time-picker.tsx +305 -134
- package/src/components/ui/toast.tsx +132 -0
- package/src/components/ui/toggle.tsx +76 -0
- package/src/components/ui/tooltip.tsx +20 -6
- package/src/components/ui/top-bar.tsx +118 -0
- package/src/components/ui/typography.tsx +45 -9
- package/src/components/ui/video-block.tsx +9 -3
- 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 +19 -7
- package/src/hooks/use-selection.ts +8 -1
- package/src/lib/database.ts +322 -0
- package/src/lib/dates.ts +36 -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 +5 -3
- package/src/lib/theme.ts +18 -0
- package/src/lib/time.ts +83 -0
- package/src/lib/utils.ts +21 -2
- package/src/styles/notion.css +342 -51
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
|
-
import type
|
|
3
|
-
type
|
|
2
|
+
import { type ComponentProps, type ComponentPropsWithoutRef, type ElementType, type ReactNode } from "react";
|
|
3
|
+
import { type Platform } from "../../lib/keys.js";
|
|
4
|
+
type HeadingLevel = "display" | "title" | 1 | 2 | 3;
|
|
4
5
|
export interface HeadingProps extends Omit<ComponentPropsWithoutRef<"h1">, "color"> {
|
|
5
6
|
level?: HeadingLevel;
|
|
6
7
|
as?: ElementType;
|
|
@@ -9,8 +10,8 @@ export interface HeadingProps extends Omit<ComponentPropsWithoutRef<"h1">, "colo
|
|
|
9
10
|
}
|
|
10
11
|
export declare function Heading({ level, as, flush, className, ...props }: HeadingProps): import("react").JSX.Element;
|
|
11
12
|
declare const textVariants: (props?: ({
|
|
12
|
-
tone?: "
|
|
13
|
-
size?: "body" | "
|
|
13
|
+
tone?: "accent" | "default" | "disabled" | "secondary" | "tertiary" | "success" | "warning" | "info" | "danger" | null | undefined;
|
|
14
|
+
size?: "caption" | "lead" | "body" | "micro" | "sm" | null | undefined;
|
|
14
15
|
weight?: "normal" | "medium" | "semibold" | null | undefined;
|
|
15
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
17
|
export interface TextProps extends Omit<ComponentPropsWithoutRef<"p">, "color">, VariantProps<typeof textVariants> {
|
|
@@ -19,7 +20,12 @@ export interface TextProps extends Omit<ComponentPropsWithoutRef<"p">, "color">,
|
|
|
19
20
|
export declare function Text({ as, tone, size, weight, className, ...props }: TextProps): import("react").JSX.Element;
|
|
20
21
|
/** Inline code. Tinted, not boxed — a box would outrank the paragraph. */
|
|
21
22
|
export declare function Code({ className, ...props }: ComponentPropsWithoutRef<"code">): import("react").JSX.Element;
|
|
22
|
-
export declare function Kbd({ className, ...props }:
|
|
23
|
+
export declare function Kbd({ className, ...props }: ComponentProps<"kbd">): import("react").JSX.Element;
|
|
24
|
+
export declare function usePlatform(): Platform;
|
|
25
|
+
export declare function Shortcut({ keys, className }: {
|
|
26
|
+
keys: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
23
29
|
/**
|
|
24
30
|
* Long-form content wrapper. Applies the reading measure plus the
|
|
25
31
|
* vertical rhythm Notion uses between blocks. Wrap raw markdown output
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/components/ui/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/components/ui/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAwB,KAAK,cAAc,EAAE,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnI,OAAO,EAAyC,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAwBzF,KAAK,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAUpD,MAAM,WAAW,YACb,SAAQ,IAAI,CAAC,wBAAwB,CAAC,IA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|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
+
import { useSyncExternalStore } from "react";
|
|
4
|
+
import { platform, shortcutKeys, speakShortcut } from "../../lib/keys.js";
|
|
3
5
|
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { CODE_CLASSES } from "../../lib/rich-text-dom.js";
|
|
4
7
|
/* ────────────────────────────────────────────────────────────────────────
|
|
5
8
|
Typography carries the entire hierarchy in this system. There are no
|
|
6
9
|
boxes around headings, no coloured section bars, no rules above titles.
|
|
@@ -10,6 +13,7 @@ import { cn } from "../../lib/utils.js";
|
|
|
10
13
|
const headingVariants = cva("text-ink font-sans text-balance", {
|
|
11
14
|
variants: {
|
|
12
15
|
level: {
|
|
16
|
+
display: "text-display mt-0 mb-2",
|
|
13
17
|
title: "text-title mt-0 mb-2",
|
|
14
18
|
1: "text-h1 mt-8 mb-1",
|
|
15
19
|
2: "text-h2 mt-6 mb-1",
|
|
@@ -19,6 +23,7 @@ const headingVariants = cva("text-ink font-sans text-balance", {
|
|
|
19
23
|
defaultVariants: { level: 1 },
|
|
20
24
|
});
|
|
21
25
|
const defaultTag = {
|
|
26
|
+
display: "h1",
|
|
22
27
|
title: "h1",
|
|
23
28
|
1: "h1",
|
|
24
29
|
2: "h2",
|
|
@@ -34,13 +39,20 @@ const textVariants = cva("font-sans", {
|
|
|
34
39
|
default: "text-ink",
|
|
35
40
|
secondary: "text-ink-secondary",
|
|
36
41
|
tertiary: "text-ink-tertiary",
|
|
37
|
-
|
|
42
|
+
disabled: "text-ink-disabled",
|
|
43
|
+
// Words in the accent: pulled toward the ink, so they read as text.
|
|
44
|
+
accent: "text-accent-text",
|
|
45
|
+
success: "text-success",
|
|
46
|
+
warning: "text-warning",
|
|
47
|
+
info: "text-info",
|
|
38
48
|
danger: "text-danger",
|
|
39
49
|
},
|
|
40
50
|
size: {
|
|
51
|
+
lead: "text-lead",
|
|
41
52
|
body: "text-body",
|
|
42
53
|
sm: "text-sm",
|
|
43
54
|
caption: "text-caption",
|
|
55
|
+
micro: "text-micro",
|
|
44
56
|
},
|
|
45
57
|
weight: {
|
|
46
58
|
normal: "font-normal",
|
|
@@ -56,10 +68,24 @@ export function Text({ as, tone, size, weight, className, ...props }) {
|
|
|
56
68
|
}
|
|
57
69
|
/** Inline code. Tinted, not boxed — a box would outrank the paragraph. */
|
|
58
70
|
export function Code({ className, ...props }) {
|
|
59
|
-
return (_jsx("code", { className: cn(
|
|
71
|
+
return (_jsx("code", { className: cn(CODE_CLASSES, className), ...props }));
|
|
60
72
|
}
|
|
73
|
+
/* One key, as printed on a keyboard. For a combination, use Shortcut. */
|
|
61
74
|
export function Kbd({ className, ...props }) {
|
|
62
|
-
return (_jsx("kbd", { className: cn("inline-flex justify-center items-center bg-surface shadow-xs px-1.5 rounded-
|
|
75
|
+
return (_jsx("kbd", { className: cn("inline-flex justify-center items-center bg-surface shadow-xs px-1.5 rounded-small min-w-5 h-5 font-sans font-medium text-ink-secondary text-caption", className), ...props }));
|
|
76
|
+
}
|
|
77
|
+
/* Which platform's keys to show. "other" on the server and in the first render
|
|
78
|
+
after it, so a server-rendered page hydrates cleanly; the right one next. */
|
|
79
|
+
export function usePlatform() {
|
|
80
|
+
return useSyncExternalStore(noSubscription, platform, () => "other");
|
|
81
|
+
}
|
|
82
|
+
const noSubscription = () => () => { };
|
|
83
|
+
/* A keyboard shortcut written once ("mod+shift+k") and shown right where it is
|
|
84
|
+
read: ⌘ ⇧ K on a Mac, Ctrl Shift K elsewhere. A screen reader hears the keys by
|
|
85
|
+
name ("Command Shift K"), not the symbols. */
|
|
86
|
+
export function Shortcut({ keys, className }) {
|
|
87
|
+
const on = usePlatform();
|
|
88
|
+
return (_jsxs("span", { className: cn("inline-flex items-center gap-0.5 align-middle", className), children: [_jsx("span", { className: "sr-only", children: speakShortcut(keys, on) }), shortcutKeys(keys, on).map((key, i) => (_jsx(Kbd, { "aria-hidden": true, children: key.shown }, i)))] }));
|
|
63
89
|
}
|
|
64
90
|
/**
|
|
65
91
|
* Long-form content wrapper. Applies the reading measure plus the
|
|
@@ -67,6 +93,6 @@ export function Kbd({ className, ...props }) {
|
|
|
67
93
|
* in this and it looks intentional with no further work.
|
|
68
94
|
*/
|
|
69
95
|
export function Prose({ children, className, serif, }) {
|
|
70
|
-
return (_jsx("div", { className: cn("measure text-ink text-body", serif && "font-serif", "[&>*+*]:mt-3", "[&_p]:text-ink [&_p]:leading-
|
|
96
|
+
return (_jsx("div", { className: cn("measure text-ink text-body", serif && "font-serif", "[&>*+*]:mt-3", "[&_p]:text-ink [&_p]:leading-prose", "[&_a]:link", "[&_strong]:font-semibold", "[&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6", "[&_li]:mt-1 [&_li]:leading-prose", "[&_blockquote]:border-ink/40 [&_blockquote]:pl-4 [&_blockquote]:border-l-2 [&_blockquote]:text-ink", "[&_hr]:my-6 [&_hr]:border-hairline", className), children: children }));
|
|
71
97
|
}
|
|
72
98
|
//# sourceMappingURL=typography.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../../src/components/ui/typography.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../../src/components/ui/typography.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAwF,MAAM,OAAO,CAAC;AACnI,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAiB,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAA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,GAAG,EAAE,GAAE,CAAC,CAAC;AAEtC;;gDAEgD;AAChD,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAwC;IAC9E,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,OAAO,CACH,gBAAM,SAAS,EAAE,EAAE,CAAC,+CAA+C,EAAE,SAAS,CAAC,aAC3E,eAAM,SAAS,EAAC,SAAS,YAAE,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,GAAQ,EACzD,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACpC,KAAC,GAAG,mCACC,GAAG,CAAC,KAAK,IADJ,CAAC,CAEL,CACT,CAAC,IACC,CACV,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,EAClB,QAAQ,EACR,SAAS,EACT,KAAK,GAKR;IACG,OAAO,CACH,cACI,SAAS,EAAE,EAAE,CACT,4BAA4B,EAC5B,KAAK,IAAI,YAAY,EACrB,cAAc,EACd,oCAAoC,EACpC,YAAY,EACZ,0BAA0B,EAC1B,8DAA8D,EAC9D,kCAAkC,EAClC,oGAAoG,EACpG,oCAAoC,EACpC,SAAS,CACZ,YAEA,QAAQ,GACP,CACT,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-block.d.ts","sourceRoot":"","sources":["../../../src/components/ui/video-block.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video-block.d.ts","sourceRoot":"","sources":["../../../src/components/ui/video-block.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,wBAAgB,UAAU,CAAC,EACvB,GAAG,EACH,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAe,EACf,SAAS,GACZ,EAAE;IACC,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uFAAuF;IACvF,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACvC,gDAAgD;IAChD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,sCAiCA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
3
4
|
import { SquarePlay } from "lucide-react";
|
|
4
5
|
import { videoEmbed } from "../../lib/embed.js";
|
|
5
6
|
import { AddressField } from "./address-field.js";
|
|
@@ -13,6 +14,9 @@ export function VideoBlock({ url, onLink, check, caption, title = "Video", class
|
|
|
13
14
|
const embed = url ? videoEmbed(url) : null;
|
|
14
15
|
if (embed === null)
|
|
15
16
|
return onLink ? (_jsx(AddressField, { icon: _jsx(SquarePlay, {}), placeholder: "Paste a YouTube or Vimeo link, then Enter", check: (link) => (videoEmbed(link) === null ? "That is not a YouTube or Vimeo link." : null) ?? check?.(link) ?? null, onCommit: onLink, className: className })) : null;
|
|
16
|
-
return (
|
|
17
|
+
return (
|
|
18
|
+
// min-w-0: in a grid or flex row the player shrinks to the room there is; an
|
|
19
|
+
// iframe's natural width otherwise pushed a phone's page sideways.
|
|
20
|
+
_jsxs("figure", { className: cn("w-full min-w-0", className), children: [_jsx("div", { className: "relative bg-surface-sunken rounded-surface w-full overflow-hidden aspect-video", children: _jsx("iframe", { src: embed, title: title, className: "absolute inset-0 size-full", allow: "fullscreen; picture-in-picture; encrypted-media", sandbox: "allow-scripts allow-same-origin allow-presentation allow-popups", referrerPolicy: "strict-origin-when-cross-origin", loading: "lazy" }) }), caption !== undefined && _jsx("figcaption", { className: "mt-1.5 text-sm text-ink-secondary", children: caption })] }));
|
|
17
21
|
}
|
|
18
22
|
//# sourceMappingURL=video-block.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-block.js","sourceRoot":"","sources":["../../../src/components/ui/video-block.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAqB,CAAC;AAEnD;;;;;wCAKwC;AACxC,MAAM,UAAU,UAAU,CAAC,EACvB,GAAG,EACH,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAK,GAAG,OAAO,EACf,SAAS,GAYZ;IACG,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3C,IAAI,KAAK,KAAK,IAAI;QACd,OAAO,MAAM,CAAC,CAAC,CAAC,CACZ,KAAC,YAAY,IACT,IAAI,EAAE,KAAC,UAAU,KAAG,EACpB,WAAW,EAAC,2CAA2C,EACvD,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,EACrH,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,GACtB,CACL,CAAC,CAAC,CAAC,IAAI,CAAC;IACb,OAAO,
|
|
1
|
+
{"version":3,"file":"video-block.js","sourceRoot":"","sources":["../../../src/components/ui/video-block.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EA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N,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-dismiss.d.ts","sourceRoot":"","sources":["../../src/hooks/use-dismiss.ts"],"names":[],"mappings":"AAaA,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAUtF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
// A little longer than the dialog's closing animation.
|
|
4
|
+
const CLOSING_MS = 170;
|
|
5
|
+
/* For a dialog that only exists while it is open (`{thing && <ThingDialog />}`).
|
|
6
|
+
Unmounting it on close would skip its closing animation, so it first closes,
|
|
7
|
+
then tells its parent once the animation has played. Pass `open` to the Dialog and
|
|
8
|
+
call `dismiss` wherever `onClose` would have gone.
|
|
9
|
+
|
|
10
|
+
From endgame, 2026-12-05. */
|
|
11
|
+
export function useDismiss(onClose) {
|
|
12
|
+
const [open, setOpen] = useState(true);
|
|
13
|
+
const done = useRef(false);
|
|
14
|
+
const dismiss = useCallback(() => {
|
|
15
|
+
if (done.current)
|
|
16
|
+
return;
|
|
17
|
+
done.current = true;
|
|
18
|
+
setOpen(false);
|
|
19
|
+
setTimeout(onClose, CLOSING_MS);
|
|
20
|
+
}, [onClose]);
|
|
21
|
+
return { open, dismiss };
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=use-dismiss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-dismiss.js","sourceRoot":"","sources":["../../src/hooks/use-dismiss.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtD,uDAAuD;AACvD,MAAM,UAAU,GAAG,GAAG,CAAC;AAEvB;;;;;+BAK+B;AAC/B,MAAM,UAAU,UAAU,CAAC,OAAmB;IAC1C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,CAAC;QACf,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACd,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-escape-first.d.ts","sourceRoot":"","sources":["../../src/hooks/use-escape-first.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO1D,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,QAe9I"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
/* Escape, while `active`, does `onEscape` and nothing else: a list closes without
|
|
4
|
+
closing the dialog around it. A Radix dialog listens for Escape on the document as
|
|
5
|
+
the key travels down the tree, before the field hears it, so stopping it in the
|
|
6
|
+
field's own handler is too late; the window hears it first of all. Only keys from
|
|
7
|
+
`target` (an element, or a test of the event's target) count. */
|
|
8
|
+
export function useEscapeFirst(active, target, onEscape) {
|
|
9
|
+
const latest = useRef(onEscape);
|
|
10
|
+
latest.current = onEscape;
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!active)
|
|
13
|
+
return;
|
|
14
|
+
const onKey = (e) => {
|
|
15
|
+
if (e.key !== "Escape" || e.isComposing)
|
|
16
|
+
return;
|
|
17
|
+
const ours = typeof target === "function" ? target(e.target) : e.target === target.current;
|
|
18
|
+
if (!ours)
|
|
19
|
+
return;
|
|
20
|
+
e.stopPropagation();
|
|
21
|
+
latest.current();
|
|
22
|
+
};
|
|
23
|
+
window.addEventListener("keydown", onKey, { capture: true });
|
|
24
|
+
return () => window.removeEventListener("keydown", onKey, { capture: true });
|
|
25
|
+
}, [active, target]);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=use-escape-first.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-escape-first.js","sourceRoot":"","sources":["../../src/hooks/use-escape-first.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAE1D;;;;mEAImE;AACnE,MAAM,UAAU,cAAc,CAAC,MAAe,EAAE,MAAyE,EAAE,QAAoB;IAC3I,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC1B,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,MAAM,KAAK,GAAG,CAAC,CAAgB,EAAE,EAAE;YAC/B,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,WAAW;gBAAE,OAAO;YAChD,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,CAAC;YAC3F,IAAI,CAAC,IAAI;gBAAE,OAAO;YAClB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function useMediaQuery(query: string): boolean;
|
|
2
|
+
/** Narrower than Tailwind's `md` (48rem): where the kit's layouts switch to their phone shape. */
|
|
3
|
+
export declare const PHONE_QUERY = "(max-width: 47.99rem)";
|
|
4
|
+
export declare const useIsPhone: () => boolean;
|
|
5
|
+
//# sourceMappingURL=use-media-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-media-query.d.ts","sourceRoot":"","sources":["../../src/hooks/use-media-query.ts"],"names":[],"mappings":"AAOA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAUpD;AAED,kGAAkG;AAClG,eAAO,MAAM,WAAW,0BAA0B,CAAC;AAEnD,eAAO,MAAM,UAAU,QAAO,OAAqC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSyncExternalStore } from "react";
|
|
3
|
+
/* Whether a media query matches now, kept up to date as the window changes. False
|
|
4
|
+
on the server and in the first render after it, so a server-rendered page and
|
|
5
|
+
its hydration agree; it settles on the next render. */
|
|
6
|
+
export function useMediaQuery(query) {
|
|
7
|
+
return useSyncExternalStore((onChange) => {
|
|
8
|
+
const list = window.matchMedia(query);
|
|
9
|
+
list.addEventListener("change", onChange);
|
|
10
|
+
return () => list.removeEventListener("change", onChange);
|
|
11
|
+
}, () => window.matchMedia(query).matches, () => false);
|
|
12
|
+
}
|
|
13
|
+
/** Narrower than Tailwind's `md` (48rem): where the kit's layouts switch to their phone shape. */
|
|
14
|
+
export const PHONE_QUERY = "(max-width: 47.99rem)";
|
|
15
|
+
export const useIsPhone = () => useMediaQuery(PHONE_QUERY);
|
|
16
|
+
//# sourceMappingURL=use-media-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-media-query.js","sourceRoot":"","sources":["../../src/hooks/use-media-query.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C;;yDAEyD;AACzD,MAAM,UAAU,aAAa,CAAC,KAAa;IACvC,OAAO,oBAAoB,CACvB,CAAC,QAAQ,EAAE,EAAE;QACT,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC,EACD,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,EACtC,GAAG,EAAE,CAAC,KAAK,CACd,CAAC;AACN,CAAC;AAED,kGAAkG;AAClG,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAEnD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-save-queue.d.ts","sourceRoot":"","sources":["../../src/hooks/use-save-queue.ts"],"names":[],"mappings":"AAcA,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC5B,IAAI,EACJ,KAAW,GACd,EAAE;IAGC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;;mBAQqC,MAAM,OAAO,CAAC,OAAO,CAAC;oBAkB9C,CAAC;iBARD,CAAC;kBANsB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-save-queue.d.ts","sourceRoot":"","sources":["../../src/hooks/use-save-queue.ts"],"names":[],"mappings":"AAcA,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC5B,IAAI,EACJ,KAAW,GACd,EAAE;IAGC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;;mBAQqC,MAAM,OAAO,CAAC,OAAO,CAAC;oBAkB9C,CAAC;iBARD,CAAC;kBANsB,CAAC;EA2CrC"}
|
|
@@ -8,7 +8,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
8
8
|
|
|
9
9
|
Everything goes to the server one request at a time, in the order it was asked
|
|
10
10
|
for, so a move can never overtake the edit before it. Pending saves are flushed
|
|
11
|
-
when the page is hidden. The first failure is kept in `error` and nothing is
|
|
11
|
+
when the page is hidden or closed, at once and as keepalive requests. The first failure is kept in `error` and nothing is
|
|
12
12
|
retried: show it and offer a reload, rather than guess what the server holds. */
|
|
13
13
|
export function useSaveQueue({ save, delay = 600, }) {
|
|
14
14
|
const [error, setError] = useState(null);
|
|
@@ -18,7 +18,7 @@ export function useSaveQueue({ save, delay = 600, }) {
|
|
|
18
18
|
const saver = useRef(save);
|
|
19
19
|
saver.current = save;
|
|
20
20
|
const enqueue = useCallback((job) => {
|
|
21
|
-
queue.current = queue.current.then(job).catch((err) => setError(err.message));
|
|
21
|
+
queue.current = queue.current.then(job).catch((err) => setError((first) => first ?? err.message));
|
|
22
22
|
}, []);
|
|
23
23
|
const cancel = useCallback((key) => {
|
|
24
24
|
clearTimeout(timers.current.get(key));
|
|
@@ -33,13 +33,25 @@ export function useSaveQueue({ save, delay = 600, }) {
|
|
|
33
33
|
timers.current.set(key, setTimeout(() => flush(key), delay));
|
|
34
34
|
}, [cancel, flush, delay]);
|
|
35
35
|
useEffect(() => {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
// The page is going (closed, or hidden on a phone, which may be the last
|
|
37
|
+
// signal before the app is killed): pending saves go now, as keepalive
|
|
38
|
+
// requests, not behind one already on its way, which may never finish.
|
|
39
|
+
const sendNow = () => {
|
|
40
|
+
for (const key of [...timers.current.keys()]) {
|
|
41
|
+
cancel(key);
|
|
42
|
+
saver.current(key, { keepalive: true }).catch((err) => setError((first) => first ?? err.message));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const onHidden = () => document.visibilityState === "hidden" && sendNow();
|
|
46
|
+
window.addEventListener("pagehide", sendNow);
|
|
47
|
+
document.addEventListener("visibilitychange", onHidden);
|
|
38
48
|
return () => {
|
|
39
|
-
window.removeEventListener("pagehide",
|
|
40
|
-
|
|
49
|
+
window.removeEventListener("pagehide", sendNow);
|
|
50
|
+
document.removeEventListener("visibilitychange", onHidden);
|
|
51
|
+
// Unmounting within a living page: saved in their turn.
|
|
52
|
+
[...timers.current.keys()].forEach((key) => flush(key));
|
|
41
53
|
};
|
|
42
|
-
}, [flush]);
|
|
54
|
+
}, [flush, cancel]);
|
|
43
55
|
return { error, enqueue, schedule, flush, cancel };
|
|
44
56
|
}
|
|
45
57
|
//# sourceMappingURL=use-save-queue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-save-queue.js","sourceRoot":"","sources":["../../src/hooks/use-save-queue.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,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AAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../src/hooks/use-selection.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,CAAC;AAQ3F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;IAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../src/hooks/use-selection.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,CAAC;AAQ3F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;IAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAsClH"}
|
|
@@ -17,7 +17,16 @@ export function useSelection(order) {
|
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
if (!selecting)
|
|
19
19
|
return;
|
|
20
|
-
|
|
20
|
+
// Escape ends the selection, unless it was meant for something over the page:
|
|
21
|
+
// the confirm() asked about deleting the selection, a menu, a list. That
|
|
22
|
+
// closes, and the selection stays.
|
|
23
|
+
const onKey = (event) => {
|
|
24
|
+
if (event.key !== "Escape" || event.defaultPrevented)
|
|
25
|
+
return;
|
|
26
|
+
if (document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))
|
|
27
|
+
return;
|
|
28
|
+
stop();
|
|
29
|
+
};
|
|
21
30
|
window.addEventListener("keydown", onKey);
|
|
22
31
|
return () => window.removeEventListener("keydown", onKey);
|
|
23
32
|
}, [selecting]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-selection.js","sourceRoot":"","sources":["../../src/hooks/use-selection.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;;YAKY;AACZ,MAAM,UAAU,YAAY,CAAC,KAAe;IACxC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,GAAG,KAAK,IAAI,CAAC;IAE/B,MAAM,IAAI,GAAG,GAAG,EAAE;QACd,MAAM,CAAC,IAAI,CAAC,CAAC;QACb,SAAS,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,MAAM,KAAK,GAAG,CAAC,KAAoB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"use-selection.js","sourceRoot":"","sources":["../../src/hooks/use-selection.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;;YAKY;AACZ,MAAM,UAAU,YAAY,CAAC,KAAe;IACxC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,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AI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;oBAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrG,CAAC;iBAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;;gBACpC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AACtG,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export type PropertyType = "title" | "text" | "number" | "select" | "multiSelect" | "date" | "checkbox" | "url";
|
|
2
|
+
export type TagColor = "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
|
|
3
|
+
export type PropertyOption = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
color: TagColor;
|
|
7
|
+
};
|
|
8
|
+
export type Property = {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
type: PropertyType;
|
|
12
|
+
options?: PropertyOption[];
|
|
13
|
+
};
|
|
14
|
+
export type Value = string | number | boolean | string[] | null;
|
|
15
|
+
export type Row = {
|
|
16
|
+
id: string;
|
|
17
|
+
values: Record<string, Value>;
|
|
18
|
+
cover?: string | null;
|
|
19
|
+
};
|
|
20
|
+
export type FilterOp = "contains" | "notContains" | "is" | "isNot" | "isEmpty" | "isNotEmpty" | "gt" | "lt" | "gte" | "lte" | "before" | "after" | "onOrBefore" | "onOrAfter";
|
|
21
|
+
export type Filter = {
|
|
22
|
+
id: string;
|
|
23
|
+
property: string;
|
|
24
|
+
op: FilterOp;
|
|
25
|
+
value?: Value;
|
|
26
|
+
};
|
|
27
|
+
export type Match = "all" | "any";
|
|
28
|
+
export type Sort = {
|
|
29
|
+
property: string;
|
|
30
|
+
direction: "asc" | "desc";
|
|
31
|
+
};
|
|
32
|
+
/** What can be asked of each kind of property, in the order a menu shows them, with their words. */
|
|
33
|
+
export declare const OPS: Record<PropertyType, readonly {
|
|
34
|
+
op: FilterOp;
|
|
35
|
+
label: string;
|
|
36
|
+
}[]>;
|
|
37
|
+
/** Whether an op needs a value to compare with (is empty does not). */
|
|
38
|
+
export declare const needsValue: (op: FilterOp) => op is "before" | "after" | "is" | "contains" | "notContains" | "isNot" | "gt" | "lt" | "gte" | "lte" | "onOrBefore" | "onOrAfter";
|
|
39
|
+
export declare const isEmpty: (v: Value | undefined) => boolean;
|
|
40
|
+
/** A filter just added for `property`: its first op, and for a checkbox, checked. */
|
|
41
|
+
export declare function newFilter(property: Property, id: string): Filter;
|
|
42
|
+
/** Whether `row` passes `filter`. A filter still missing its value lets everything through, so a half-written one never empties the view. */
|
|
43
|
+
export declare function passes(row: Row, filter: Filter, property: Property | undefined): boolean;
|
|
44
|
+
/** Whether a filter says anything yet: its property exists, and it has a value if it needs one. */
|
|
45
|
+
export declare function isActive(filter: Filter, property: Property | undefined): boolean;
|
|
46
|
+
/** Rows passing all (or any) of the filters. Filters that say nothing yet (a deleted property, a value not given) are left out,
|
|
47
|
+
so with "any" a half-written one does not let every row through. */
|
|
48
|
+
export declare function filterRows(rows: readonly Row[], properties: readonly Property[], filters: readonly Filter[], match?: Match): Row[];
|
|
49
|
+
/** How two values of `property` order, ascending. Empty sorts last, whichever way. */
|
|
50
|
+
export declare function compareValues(a: Value | undefined, b: Value | undefined, property: Property): number;
|
|
51
|
+
/** Sorted by each sort in turn; rows equal on all of them keep their order. */
|
|
52
|
+
export declare function sortRows(rows: readonly Row[], properties: readonly Property[], sorts: readonly Sort[]): Row[];
|
|
53
|
+
export type Group = {
|
|
54
|
+
key: string | null;
|
|
55
|
+
option: PropertyOption | null;
|
|
56
|
+
rows: Row[];
|
|
57
|
+
};
|
|
58
|
+
/** Rows by a select (or a checkbox): a group per option in its order, then "No value". Empty groups are kept, for a board's columns. */
|
|
59
|
+
export declare function groupRows(rows: readonly Row[], property: Property): Group[];
|
|
60
|
+
/** The first title property, which names a row. */
|
|
61
|
+
export declare const titleOf: (properties: readonly Property[]) => Property | undefined;
|
|
62
|
+
/** A value as words, for a screen reader or a plain cell. */
|
|
63
|
+
export declare function valueText(v: Value | undefined, property: Property): string;
|
|
64
|
+
export type ViewKind = "table" | "board" | "gallery" | "list" | "calendar";
|
|
65
|
+
/** One way of seeing the rows. A view keeps its own filter, sort, hidden properties and, per kind, what it groups or dates by. */
|
|
66
|
+
export type View = {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
kind: ViewKind;
|
|
70
|
+
sort: Sort[];
|
|
71
|
+
filter: Filter[];
|
|
72
|
+
match?: Match;
|
|
73
|
+
/** A board's columns: a select property. */
|
|
74
|
+
groupBy?: string;
|
|
75
|
+
/** A calendar's days: a date property. */
|
|
76
|
+
dateProperty?: string;
|
|
77
|
+
/** Properties not shown (a table's columns, a card's lines). */
|
|
78
|
+
hidden: string[];
|
|
79
|
+
/** A table's column widths, in px, by property. */
|
|
80
|
+
widths?: Record<string, number>;
|
|
81
|
+
/** A table's column order, by property id; any not listed follow in the properties' order. */
|
|
82
|
+
order?: string[];
|
|
83
|
+
};
|
|
84
|
+
/** Rows whose words (title, text, url, select and multi-select names) contain `query`, ignoring case. */
|
|
85
|
+
export declare function searchRows(rows: readonly Row[], properties: readonly Property[], query: string): Row[];
|
|
86
|
+
/** What a view shows: searched, filtered, then sorted. */
|
|
87
|
+
export declare function applyView(rows: readonly Row[], properties: readonly Property[], view: Pick<View, "filter" | "sort" | "match">, query?: string): Row[];
|
|
88
|
+
/** A view's properties to show, in its order, without the hidden ones. The title always shows. */
|
|
89
|
+
export declare function shownProperties(properties: readonly Property[], view: Pick<View, "hidden" | "order">): Property[];
|
|
90
|
+
/** A fresh view of `kind`, choosing what a board groups by and a calendar dates by. */
|
|
91
|
+
export declare function newView(kind: ViewKind, properties: readonly Property[], id: string, name?: string): View;
|
|
92
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/lib/database.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAEhH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7G,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC;AAEpG,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;AAEhE,MAAM,MAAM,GAAG,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EA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