@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,22 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { AnyBlock } from "../../lib/document.js";
|
|
3
|
+
import type { Text } from "../../lib/rich-text.js";
|
|
4
|
+
import type { AnyExtension } from "./kinds.js";
|
|
5
|
+
/** How much room a document takes: a page of its own, or `compact`, inside a list or card. */
|
|
6
|
+
export type Density = "page" | "compact";
|
|
7
|
+
export declare function Spans({ text }: {
|
|
8
|
+
text: Text;
|
|
9
|
+
}): import("react").JSX.Element[];
|
|
10
|
+
/** Draws `blocks`. Pass the same `extensions` the editor was given, for an app's own blocks. */
|
|
11
|
+
export declare function DocumentView({ blocks, extensions, density, className }: {
|
|
12
|
+
blocks: AnyBlock[];
|
|
13
|
+
extensions?: AnyExtension[];
|
|
14
|
+
density?: Density;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/** The blocks of one level, lists run together. An extension's `View` uses this for its children. */
|
|
18
|
+
export declare function Blocks({ blocks, depth }: {
|
|
19
|
+
blocks: AnyBlock[];
|
|
20
|
+
depth?: number;
|
|
21
|
+
}): ReactNode[];
|
|
22
|
+
//# sourceMappingURL=document-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-view.d.ts","sourceRoot":"","sources":["../../../src/components/editor/document-view.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,KAAK,EAAE,QAAQ,EAAS,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAQ,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa/C,8FAA8F;AAC9F,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAKzC,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,iCAE7C;AA6BD,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAgB,EAAE,SAAS,EAAE,EAAE;IAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAU3K;AAED,qGAAqG;AACrG,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,KAAS,EAAE,EAAE;IAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,eAsDnF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { ExternalLink, Globe } from "lucide-react";
|
|
5
|
+
import { hostOf, isSafeHref, videoEmbed } from "../../lib/embed.js";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import { Image } from "../ui/image.js";
|
|
8
|
+
import { CODE_CLASSES } from "../../lib/rich-text-dom.js";
|
|
9
|
+
import { BulletMark, CheckMark, HEADINGS as PAGE_HEADINGS, MARK_GUTTER, QUOTE } from "./look.js";
|
|
10
|
+
import { withKitBlocks } from "./extensions/kit-blocks.js";
|
|
11
|
+
/*
|
|
12
|
+
* A document read-only, for readers: what DocumentEditor writes, drawn as React
|
|
13
|
+
* elements, never as HTML. A link that is not a web or mail address is dropped
|
|
14
|
+
* to its words. An app's own blocks are drawn by their extension's `View`.
|
|
15
|
+
*/
|
|
16
|
+
const Extensions = createContext(new Map());
|
|
17
|
+
const Dense = createContext("page");
|
|
18
|
+
const safe = isSafeHref;
|
|
19
|
+
export function Spans({ text }) {
|
|
20
|
+
return text.map((span, i) => _jsx(SpanView, { span: span }, i));
|
|
21
|
+
}
|
|
22
|
+
function SpanView({ span }) {
|
|
23
|
+
let node = span.text;
|
|
24
|
+
if (span.code)
|
|
25
|
+
node = _jsx("code", { className: CODE_CLASSES, children: node });
|
|
26
|
+
if (span.bold)
|
|
27
|
+
node = _jsx("strong", { className: "font-semibold", children: node });
|
|
28
|
+
if (span.italic)
|
|
29
|
+
node = _jsx("em", { children: node });
|
|
30
|
+
if (span.strike)
|
|
31
|
+
node = _jsx("s", { children: node });
|
|
32
|
+
if (span.page !== undefined)
|
|
33
|
+
node = _jsx("span", { className: "font-medium text-accent-text", children: node });
|
|
34
|
+
else if (span.href !== undefined && safe(span.href)) {
|
|
35
|
+
node = (_jsx("a", { href: span.href, target: "_blank", rel: "noreferrer nofollow ugc", className: "link", children: node }));
|
|
36
|
+
}
|
|
37
|
+
return node;
|
|
38
|
+
}
|
|
39
|
+
const HEADINGS = {
|
|
40
|
+
page: PAGE_HEADINGS,
|
|
41
|
+
// Inside a list, a heading ranks by weight more than size, so it never outgrows what holds it.
|
|
42
|
+
compact: { 1: "text-lead font-semibold mt-4 mb-0.5", 2: "text-body font-semibold mt-3 mb-0.5", 3: "text-sm font-semibold mt-2" },
|
|
43
|
+
};
|
|
44
|
+
const SPACE = {
|
|
45
|
+
page: { p: "my-2 leading-prose", quote: cn("my-4", QUOTE), figure: "my-6", divider: "my-6", list: "my-1" },
|
|
46
|
+
compact: { p: "my-1", quote: cn("my-2", QUOTE, "px-3 text-body"), figure: "my-3", divider: "my-3", list: "my-0.5" },
|
|
47
|
+
};
|
|
48
|
+
/** Draws `blocks`. Pass the same `extensions` the editor was given, for an app's own blocks. */
|
|
49
|
+
export function DocumentView({ blocks, extensions, density = "page", className }) {
|
|
50
|
+
return (_jsx(Extensions, { value: new Map(withKitBlocks(extensions).map((x) => [x.type, x])), children: _jsx(Dense, { value: density, children: _jsx("div", { className: cn("text-ink", className), children: _jsx(Blocks, { blocks: blocks }) }) }) }));
|
|
51
|
+
}
|
|
52
|
+
/** The blocks of one level, lists run together. An extension's `View` uses this for its children. */
|
|
53
|
+
export function Blocks({ blocks, depth = 0 }) {
|
|
54
|
+
const extensions = useContext(Extensions);
|
|
55
|
+
const space = SPACE[useContext(Dense)];
|
|
56
|
+
const out = [];
|
|
57
|
+
for (let i = 0; i < blocks.length; i += 1) {
|
|
58
|
+
const block = blocks[i];
|
|
59
|
+
const extension = extensions.get(block.type);
|
|
60
|
+
if (extension !== undefined) {
|
|
61
|
+
if (extension.View !== undefined)
|
|
62
|
+
out.push(_jsx(extension.View, { block: block, depth: depth }, block.id));
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const b = block;
|
|
66
|
+
if (b.type === "bullet" || b.type === "numbered" || b.type === "check") {
|
|
67
|
+
const run = [];
|
|
68
|
+
while (i < blocks.length && blocks[i].type === b.type)
|
|
69
|
+
run.push(blocks[i++]);
|
|
70
|
+
i -= 1;
|
|
71
|
+
const List = b.type === "numbered" ? "ol" : "ul";
|
|
72
|
+
out.push(
|
|
73
|
+
// The marks are drawn as the editor draws them (the list's own markers are
|
|
74
|
+
// off), so a saved page reads as it was written.
|
|
75
|
+
_jsx(List, { className: cn(space.list, "list-none"), children: run.map((item, n) => (_jsxs("li", { className: "py-[3px]", children: [_jsxs("span", { className: "flex items-start", children: [_jsx("span", { className: MARK_GUTTER, children: item.type === "check" ? (_jsxs(_Fragment, { children: [_jsx(CheckMark, { checked: item.checked }), _jsx("span", { className: "sr-only", children: item.checked ? "Done: " : "To do: " })] })) : item.type === "numbered" ? (_jsxs("span", { "aria-hidden": true, className: "tabular-nums", children: [n + 1, "."] })) : (_jsx(BulletMark, { depth: depth })) }), _jsx("span", { className: cn("flex-1 min-w-0", item.type === "check" && item.checked && "text-ink-secondary line-through decoration-ink-tertiary"), children: _jsx(Spans, { text: item.text }) })] }), item.children.length > 0 && (_jsx("div", { className: "pl-6", children: _jsx(Blocks, { blocks: item.children, depth: depth + 1 }) }))] }, item.id))) }, b.id));
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
out.push(_jsx(BlockView, { block: b }, b.id));
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
function BlockView({ block }) {
|
|
83
|
+
const density = useContext(Dense);
|
|
84
|
+
const space = SPACE[density];
|
|
85
|
+
switch (block.type) {
|
|
86
|
+
case "paragraph":
|
|
87
|
+
return (_jsx("p", { className: cn("min-h-[1.5em]", space.p), children: _jsx(Spans, { text: block.text }) }));
|
|
88
|
+
case "heading":
|
|
89
|
+
return (_jsx("div", { role: "heading", "aria-level": block.level + 1, className: cn("text-accent-text first:mt-0", HEADINGS[density][block.level]), children: _jsx(Spans, { text: block.text }) }));
|
|
90
|
+
case "quote":
|
|
91
|
+
return (_jsx("blockquote", { className: space.quote, children: _jsx(Spans, { text: block.text }) }));
|
|
92
|
+
case "divider":
|
|
93
|
+
return _jsx("hr", { className: cn("border-hairline-strong", space.divider) });
|
|
94
|
+
case "image":
|
|
95
|
+
if (block.src === undefined)
|
|
96
|
+
return null;
|
|
97
|
+
return (_jsxs("figure", { className: cn("mx-auto", space.figure), style: { width: `${block.width * 100}%` }, children: [_jsx(Image, { src: block.src, aspect: block.aspect, alt: "", loading: "lazy", className: "rounded-surface" }), block.caption.length > 0 && (_jsx("figcaption", { className: "mt-2 text-center text-sm text-ink-secondary", children: _jsx(Spans, { text: block.caption }) }))] }));
|
|
98
|
+
case "video": {
|
|
99
|
+
const embed = block.url === "" ? null : videoEmbed(block.url);
|
|
100
|
+
if (embed === null)
|
|
101
|
+
return null;
|
|
102
|
+
return (_jsxs("figure", { className: space.figure, children: [_jsx("div", { className: "aspect-video overflow-hidden rounded-surface bg-surface-sunken", children: _jsx("iframe", { src: embed, title: `Video from ${hostOf(embed)}`, className: "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" }) }), block.caption.length > 0 && (_jsx("figcaption", { className: "mt-2 text-sm text-ink-secondary", children: _jsx(Spans, { text: block.caption }) }))] }));
|
|
103
|
+
}
|
|
104
|
+
case "bookmark":
|
|
105
|
+
if (block.url === "" || !safe(block.url))
|
|
106
|
+
return null;
|
|
107
|
+
return (_jsxs("a", { href: block.url, target: "_blank", rel: "noreferrer nofollow ugc", className: cn(density === "compact" ? "my-2" : "my-4", "flex items-center gap-3 rounded-surface px-3.5 py-3 shadow-edge transition-colors duration-(--duration-fast) hover:bg-tint-hover"), children: [_jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-control bg-accent-tint text-accent-text", children: _jsx(Globe, { className: "size-4" }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium text-ink", children: block.title || hostOf(block.url) }), _jsx("span", { className: "block truncate text-sm text-ink-tertiary", children: block.url })] }), _jsx(ExternalLink, { className: "size-4 shrink-0 text-ink-secondary" })] }));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=document-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-view.js","sourceRoot":"","sources":["../../../src/components/editor/document-view.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAiB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,IAAI,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,WAAY,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA6B,CAAC;AAE5D;;;;GAIG;AAEH,MAAM,UAAU,GAAG,aAAa,CAA4B,IAAI,GAAG,EAAE,CAAC,CAAC;AAIvE,MAAM,KAAK,GAAG,aAAa,CAAU,MAAM,CAAC,CAAC;AAE7C,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI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,EAAC,kGAAkG,YAC9G,KAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,GAAG,GACzB,EACP,gBAAM,SAAS,EAAC,gBAAgB,aAC5B,eAAM,SAAS,EAAC,qCAAqC,YAAE,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAQ,EAC/F,eAAM,SAAS,EAAC,0CAA0C,YAAE,KAAK,CAAC,GAAG,GAAQ,IAC1E,EACP,KAAC,YAAY,IAAC,SAAS,EAAC,oCAAoC,GAAG,IAC/D,CACP,CAAC;IACV,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from "react";
|
|
2
|
+
import type { AnyBlock } from "../../lib/document.js";
|
|
3
|
+
import { type AnyExtension, type Draft, type BuiltinNode, type KindOptions, type Node, type Schema } from "./kinds.js";
|
|
4
|
+
type FocusAt = number | "end";
|
|
5
|
+
type Drop = {
|
|
6
|
+
id: number;
|
|
7
|
+
side: "before" | "after";
|
|
8
|
+
};
|
|
9
|
+
/** Uploads a picture and says where it can be loaded from; see DocumentEditor. */
|
|
10
|
+
export type UploadImage = (file: File, progress: (share: number) => void) => Promise<{
|
|
11
|
+
src: string;
|
|
12
|
+
ref?: string;
|
|
13
|
+
aspect?: number;
|
|
14
|
+
}>;
|
|
15
|
+
/** Refuses a link a reader's browser would load or open: why, or null to take it. */
|
|
16
|
+
export type CheckLink = (url: string, kind: "image" | "video" | "bookmark") => string | null;
|
|
17
|
+
/** A click on a link or page mention in the text. Without it, links open in a new tab and mentions do nothing. */
|
|
18
|
+
export type OnLink = (link: {
|
|
19
|
+
href?: string;
|
|
20
|
+
page?: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
export type ImageNode = Extract<BuiltinNode, {
|
|
23
|
+
type: "image";
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Extras for the kit's picture block, per block: `more` beside its file and link
|
|
27
|
+
* fields (a picker of the app's own pictures), `actions` over a picture once it
|
|
28
|
+
* has one (Replace), and `placeholder`, a tiny version shown blurred while it
|
|
29
|
+
* loads. `set` changes the block, as the picture block itself does.
|
|
30
|
+
*/
|
|
31
|
+
export type ImageExtras = (block: ImageNode, set: (patch: Partial<ImageNode>) => void) => {
|
|
32
|
+
more?: ReactNode;
|
|
33
|
+
actions?: ReactNode;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
};
|
|
36
|
+
type Editor = {
|
|
37
|
+
schema: Schema;
|
|
38
|
+
uploadImage?: UploadImage;
|
|
39
|
+
checkLink?: CheckLink;
|
|
40
|
+
onLink?: OnLink;
|
|
41
|
+
imageExtras?: ImageExtras;
|
|
42
|
+
/** The editor's own element: keys and focus are looked for inside it only. */
|
|
43
|
+
root: RefObject<HTMLDivElement | null>;
|
|
44
|
+
blocks: Node[];
|
|
45
|
+
/** Bumped when a block's text is replaced from outside its own element. */
|
|
46
|
+
rev: (id: number) => number;
|
|
47
|
+
/** Changes a block and tells the owner, saying whether it was typing. */
|
|
48
|
+
edit: (id: number, fn: (node: Node) => Node, opts?: {
|
|
49
|
+
typing?: boolean;
|
|
50
|
+
rewrite?: boolean;
|
|
51
|
+
}) => void;
|
|
52
|
+
create: (parentId: number | null, afterId: number | null, draft: Draft, opts?: {
|
|
53
|
+
focus?: boolean;
|
|
54
|
+
}) => number;
|
|
55
|
+
remove: (id: number) => void;
|
|
56
|
+
move: (id: number, parentId: number | null, afterId: number | null) => void;
|
|
57
|
+
/** One place up (-1) or down (1) among its siblings; nothing at either end. */
|
|
58
|
+
moveBy: (id: number, by: -1 | 1) => void;
|
|
59
|
+
/** The caret into a block: its text, an extension's `focus`, or else the block selected whole. */
|
|
60
|
+
focus: (id: number, at?: FocusAt) => void;
|
|
61
|
+
/**
|
|
62
|
+
* The block picked as a whole — a picture, video, link card or divider, which
|
|
63
|
+
* have no caret of their own. While one is, Backspace or Delete removes it,
|
|
64
|
+
* Enter starts a line below it and the arrows move on, as in Notion.
|
|
65
|
+
*/
|
|
66
|
+
selected: number | null;
|
|
67
|
+
select: (id: number | null) => void;
|
|
68
|
+
/** Toggles folded shut in this editor (a reader's choice, not saved in the document). */
|
|
69
|
+
folded: (id: number) => boolean;
|
|
70
|
+
fold: (id: number, shut: boolean) => void;
|
|
71
|
+
/** Every block in reading order, leaving out what is inside a folded toggle: what the arrows walk. */
|
|
72
|
+
order: () => Node[];
|
|
73
|
+
drag: {
|
|
74
|
+
id: number | null;
|
|
75
|
+
drop: Drop | null;
|
|
76
|
+
start: (id: number) => void;
|
|
77
|
+
over: (drop: Drop | null) => void;
|
|
78
|
+
end: () => void;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export declare function useEditor(): Editor;
|
|
82
|
+
/**
|
|
83
|
+
* Holds a document's tree. Edits apply here, and `onChange` hears every one, with
|
|
84
|
+
* the document in its stored shape and whether it was typing (save after a
|
|
85
|
+
* pause) or a change of structure (save soon). Saving is the owner's.
|
|
86
|
+
*/
|
|
87
|
+
export type ProviderProps = {
|
|
88
|
+
initial: AnyBlock[];
|
|
89
|
+
onChange?: (blocks: AnyBlock[], cause: "typing" | "change") => void;
|
|
90
|
+
uploadImage?: UploadImage;
|
|
91
|
+
checkLink?: CheckLink;
|
|
92
|
+
onLink?: OnLink;
|
|
93
|
+
imageExtras?: ImageExtras;
|
|
94
|
+
extensions?: AnyExtension[];
|
|
95
|
+
kinds?: KindOptions;
|
|
96
|
+
/**
|
|
97
|
+
* The id for a new block. By default one above the highest in the document,
|
|
98
|
+
* which is unique within it; give your own where ids must be unique more
|
|
99
|
+
* widely, for example a store that keeps every page's blocks in one table.
|
|
100
|
+
*/
|
|
101
|
+
newId?: () => number;
|
|
102
|
+
};
|
|
103
|
+
export declare function DocumentProvider({ initial, onChange, uploadImage, checkLink, onLink, imageExtras, extensions, kinds, newId, children, }: ProviderProps & {
|
|
104
|
+
children: ReactNode;
|
|
105
|
+
}): import("react").JSX.Element;
|
|
106
|
+
export {};
|
|
107
|
+
//# source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CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACN,WAAW,EACX,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,GACX,EAAE,aAAa,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BA0LzC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { contains, insert, locate, remove, update } from "../../lib/tree.js";
|
|
5
|
+
import { setCaret } from "../../lib/rich-text-dom.js";
|
|
6
|
+
import { hasText, schemaFor, toBlocks, toNodes } from "./kinds.js";
|
|
7
|
+
const Ctx = createContext(null);
|
|
8
|
+
export function useEditor() {
|
|
9
|
+
const editor = useContext(Ctx);
|
|
10
|
+
if (!editor)
|
|
11
|
+
throw new Error("useEditor outside DocumentProvider");
|
|
12
|
+
return editor;
|
|
13
|
+
}
|
|
14
|
+
const TYPING = 1;
|
|
15
|
+
const CHANGE = 0;
|
|
16
|
+
/** New blocks are numbered here, above any the document already has, so one can be focused before it is saved. */
|
|
17
|
+
const nextId = (nodes) => nodes.reduce((max, n) => Math.max(max, n.id, nextId(n.children) - 1), 0) + 1;
|
|
18
|
+
export function DocumentProvider({ initial, onChange, uploadImage, checkLink, onLink, imageExtras, extensions, kinds, newId, children, }) {
|
|
19
|
+
// Built once: an app's extensions and kinds are fixed for the life of an editor.
|
|
20
|
+
const [schema] = useState(() => schemaFor(extensions, kinds));
|
|
21
|
+
const root = useRef(null);
|
|
22
|
+
const [blocks, setBlocks] = useState(() => toNodes(initial));
|
|
23
|
+
const [revs, setRevs] = useState({});
|
|
24
|
+
const [dragId, setDragId] = useState(null);
|
|
25
|
+
const [drop, setDrop] = useState(null);
|
|
26
|
+
const [pendingFocus, setPendingFocus] = useState(null);
|
|
27
|
+
const [selected, setSelected] = useState(null);
|
|
28
|
+
const [shut, setShut] = useState(() => new Set());
|
|
29
|
+
const shutRef = useRef(shut);
|
|
30
|
+
shutRef.current = shut;
|
|
31
|
+
const visible = (nodes) => nodes.flatMap((n) => [n, ...(shutRef.current.has(n.id) ? [] : visible(n.children))]);
|
|
32
|
+
const tree = useRef(blocks);
|
|
33
|
+
const counter = useRef(nextId(blocks));
|
|
34
|
+
const mint = useRef(newId);
|
|
35
|
+
mint.current = newId;
|
|
36
|
+
const fresh = useCallback(() => mint.current?.() ?? counter.current++, []);
|
|
37
|
+
const listener = useRef(onChange);
|
|
38
|
+
listener.current = onChange;
|
|
39
|
+
const schedule = useCallback((cause) => {
|
|
40
|
+
listener.current?.(toBlocks(tree.current, schema), cause === TYPING ? "typing" : "change");
|
|
41
|
+
}, [schema]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!pendingFocus)
|
|
44
|
+
return;
|
|
45
|
+
setPendingFocus(null);
|
|
46
|
+
const { id, at } = pendingFocus;
|
|
47
|
+
const el = root.current?.querySelector(`[data-text="${id}"]`);
|
|
48
|
+
if (el)
|
|
49
|
+
return setCaret(el, at);
|
|
50
|
+
// A block without words: its extension may take the caret, or it is selected.
|
|
51
|
+
const node = locate(tree.current, id)?.node;
|
|
52
|
+
const block = root.current?.querySelector(`[data-block="${id}"]`);
|
|
53
|
+
const extension = node && schema.extension(node.type);
|
|
54
|
+
if (block && extension?.focus?.(block, at))
|
|
55
|
+
return;
|
|
56
|
+
if (node)
|
|
57
|
+
setSelected(id);
|
|
58
|
+
}, [pendingFocus, schema]);
|
|
59
|
+
const commit = useCallback((next) => {
|
|
60
|
+
tree.current = next;
|
|
61
|
+
setBlocks(next);
|
|
62
|
+
}, []);
|
|
63
|
+
/** Puts the caret in a block with text, or selects one without. */
|
|
64
|
+
const land = useCallback((node, at) => {
|
|
65
|
+
if (hasText(node)) {
|
|
66
|
+
setSelected(null);
|
|
67
|
+
setPendingFocus({ id: node.id, at });
|
|
68
|
+
}
|
|
69
|
+
else
|
|
70
|
+
setSelected(node.id);
|
|
71
|
+
}, []);
|
|
72
|
+
// The keys of a selected block. On the window, because a selected block holds
|
|
73
|
+
// no caret: the text that had one is blurred, so typing cannot edit it unseen.
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (selected === null)
|
|
76
|
+
return;
|
|
77
|
+
document.activeElement?.blur?.();
|
|
78
|
+
const onKey = (e) => {
|
|
79
|
+
if (e.defaultPrevented)
|
|
80
|
+
return;
|
|
81
|
+
// The target is an element when focus is somewhere, the window or document otherwise.
|
|
82
|
+
// Keys meant for anything outside this editor, such as a dialog opened from the
|
|
83
|
+
// selected block, are not the selection's: only those on the page itself are.
|
|
84
|
+
if (e.target instanceof Element && e.target !== document.body && !root.current?.contains(e.target))
|
|
85
|
+
return;
|
|
86
|
+
if (e.target instanceof Element && e.target.closest("input, textarea, select, [contenteditable=true], [role=dialog], [role=menu]"))
|
|
87
|
+
return;
|
|
88
|
+
const order = visible(tree.current);
|
|
89
|
+
const index = order.findIndex((n) => n.id === selected);
|
|
90
|
+
const node = order[index];
|
|
91
|
+
if (node === undefined)
|
|
92
|
+
return setSelected(null);
|
|
93
|
+
const place = locate(tree.current, selected);
|
|
94
|
+
if (e.key === "Backspace" || e.key === "Delete") {
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
const before = order[index - 1];
|
|
97
|
+
const after = order.slice(index + 1).find((n) => !contains(node, n.id));
|
|
98
|
+
commit(remove(tree.current, selected));
|
|
99
|
+
schedule(CHANGE);
|
|
100
|
+
setSelected(null);
|
|
101
|
+
// Where the caret goes next: the block above, else below, else a fresh line.
|
|
102
|
+
if (before !== undefined)
|
|
103
|
+
land(before, "end");
|
|
104
|
+
else if (after !== undefined)
|
|
105
|
+
land(after, 0);
|
|
106
|
+
else {
|
|
107
|
+
const id = fresh();
|
|
108
|
+
commit(insert(tree.current, null, null, { type: "paragraph", text: [], id, children: [] }));
|
|
109
|
+
schedule(CHANGE);
|
|
110
|
+
setPendingFocus({ id, at: 0 });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else if (e.key === "Enter") {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
const id = fresh();
|
|
116
|
+
commit(insert(tree.current, place.parent?.id ?? null, selected, { type: "paragraph", text: [], id, children: [] }));
|
|
117
|
+
schedule(CHANGE);
|
|
118
|
+
setSelected(null);
|
|
119
|
+
setPendingFocus({ id, at: 0 });
|
|
120
|
+
}
|
|
121
|
+
else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
122
|
+
const to = order[index + (e.key === "ArrowUp" ? -1 : 1)];
|
|
123
|
+
if (to === undefined)
|
|
124
|
+
return;
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
land(to, e.key === "ArrowUp" ? "end" : 0);
|
|
127
|
+
}
|
|
128
|
+
else if (e.key === "Escape")
|
|
129
|
+
setSelected(null);
|
|
130
|
+
};
|
|
131
|
+
// A press anywhere but on the selected block lets it go.
|
|
132
|
+
const onDown = (e) => {
|
|
133
|
+
if (!(e.target instanceof Element && e.target.closest(`[data-block="${selected}"]`)))
|
|
134
|
+
setSelected(null);
|
|
135
|
+
};
|
|
136
|
+
window.addEventListener("keydown", onKey);
|
|
137
|
+
window.addEventListener("pointerdown", onDown);
|
|
138
|
+
return () => {
|
|
139
|
+
window.removeEventListener("keydown", onKey);
|
|
140
|
+
window.removeEventListener("pointerdown", onDown);
|
|
141
|
+
};
|
|
142
|
+
}, [selected, commit, land, fresh]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
143
|
+
const editor = useMemo(() => ({
|
|
144
|
+
schema,
|
|
145
|
+
uploadImage,
|
|
146
|
+
checkLink,
|
|
147
|
+
onLink,
|
|
148
|
+
imageExtras,
|
|
149
|
+
root,
|
|
150
|
+
blocks,
|
|
151
|
+
rev: (id) => revs[id] ?? 0,
|
|
152
|
+
edit: (id, fn, opts) => {
|
|
153
|
+
commit(update(tree.current, id, fn));
|
|
154
|
+
if (opts?.rewrite)
|
|
155
|
+
setRevs((r) => ({ ...r, [id]: (r[id] ?? 0) + 1 }));
|
|
156
|
+
schedule(opts?.typing ? TYPING : CHANGE);
|
|
157
|
+
},
|
|
158
|
+
create: (parentId, afterId, draft, opts) => {
|
|
159
|
+
const id = fresh();
|
|
160
|
+
commit(insert(tree.current, parentId, afterId, { ...draft, id, children: [] }));
|
|
161
|
+
if (opts?.focus)
|
|
162
|
+
setPendingFocus({ id, at: 0 });
|
|
163
|
+
schedule(CHANGE);
|
|
164
|
+
return id;
|
|
165
|
+
},
|
|
166
|
+
remove: (id) => {
|
|
167
|
+
commit(remove(tree.current, id));
|
|
168
|
+
schedule(CHANGE);
|
|
169
|
+
},
|
|
170
|
+
move: (id, parentId, afterId) => {
|
|
171
|
+
const place = locate(tree.current, id);
|
|
172
|
+
if (!place || id === afterId || id === parentId || contains(place.node, parentId ?? -1))
|
|
173
|
+
return;
|
|
174
|
+
commit(insert(remove(tree.current, id), parentId, afterId, place.node));
|
|
175
|
+
schedule(CHANGE);
|
|
176
|
+
},
|
|
177
|
+
moveBy: (id, by) => {
|
|
178
|
+
const place = locate(tree.current, id);
|
|
179
|
+
if (!place)
|
|
180
|
+
return;
|
|
181
|
+
const to = place.index + by;
|
|
182
|
+
if (to < 0 || to >= place.siblings.length)
|
|
183
|
+
return;
|
|
184
|
+
// After the sibling two above (moving up) or the one below (moving down).
|
|
185
|
+
const afterId = by === -1 ? (place.siblings[to - 1]?.id ?? null) : place.siblings[to].id;
|
|
186
|
+
commit(insert(remove(tree.current, id), place.parent?.id ?? null, afterId, place.node));
|
|
187
|
+
schedule(CHANGE);
|
|
188
|
+
},
|
|
189
|
+
focus: (id, at = "end") => {
|
|
190
|
+
setSelected(null);
|
|
191
|
+
// A line inside a folded toggle is unfolded to, rather than focused unseen.
|
|
192
|
+
const inside = new Set();
|
|
193
|
+
for (let p = locate(tree.current, id)?.parent; p; p = locate(tree.current, p.id)?.parent)
|
|
194
|
+
inside.add(p.id);
|
|
195
|
+
if ([...inside].some((p) => shutRef.current.has(p)))
|
|
196
|
+
setShut((s) => new Set([...s].filter((x) => !inside.has(x))));
|
|
197
|
+
setPendingFocus({ id, at });
|
|
198
|
+
},
|
|
199
|
+
folded: (id) => shut.has(id),
|
|
200
|
+
fold: (id, close) => setShut((s) => (close ? new Set([...s, id]) : new Set([...s].filter((x) => x !== id)))),
|
|
201
|
+
order: () => visible(tree.current),
|
|
202
|
+
selected,
|
|
203
|
+
select: setSelected,
|
|
204
|
+
drag: {
|
|
205
|
+
id: dragId,
|
|
206
|
+
drop,
|
|
207
|
+
start: setDragId,
|
|
208
|
+
over: setDrop,
|
|
209
|
+
end: () => {
|
|
210
|
+
setDragId(null);
|
|
211
|
+
setDrop(null);
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
}), [schema, uploadImage, checkLink, onLink, imageExtras, blocks, revs, dragId, drop, commit, schedule, selected, fresh, shut]);
|
|
215
|
+
return _jsx(Ctx.Provider, { value: editor, children: children });
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=editor-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-state.js","sourceRoot":"","sources":["../../../src/components/editor/editor-state.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkC,MAAM,OAAO,CAAC;AAErI,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAm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AAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAC7H,CAAC;IAEF,OAAO,KAAC,GAAG,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YAAG,QAAQ,GAAgB,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AnyBlock } from "../../../lib/document.js";
|
|
2
|
+
import type { Text } from "../../../lib/rich-text.js";
|
|
3
|
+
import type { BlockExtension } from "../kinds.js";
|
|
4
|
+
export declare const toggleBlock: BlockExtension<{
|
|
5
|
+
text: Text;
|
|
6
|
+
children?: AnyBlock[];
|
|
7
|
+
}>;
|
|
8
|
+
declare const CALLOUT_COLORS: readonly ["gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"];
|
|
9
|
+
type CalloutColor = (typeof CALLOUT_COLORS)[number];
|
|
10
|
+
export declare const calloutBlock: BlockExtension<{
|
|
11
|
+
text: Text;
|
|
12
|
+
icon?: string;
|
|
13
|
+
color?: CalloutColor;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const codeBlock: BlockExtension<{
|
|
16
|
+
code?: string;
|
|
17
|
+
language?: string;
|
|
18
|
+
}>;
|
|
19
|
+
type Grid = string[][];
|
|
20
|
+
export declare const tableBlock: BlockExtension<{
|
|
21
|
+
rows?: Grid;
|
|
22
|
+
header?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
/** The kit's own extra blocks, given to every editor and view before an app's. */
|
|
25
|
+
export declare const KIT_BLOCKS: BlockExtension<{
|
|
26
|
+
text: Text;
|
|
27
|
+
children?: AnyBlock[];
|
|
28
|
+
}>[];
|
|
29
|
+
/** An app's extensions with the kit's blocks before them; an app's own block of the same type wins. */
|
|
30
|
+
export declare const withKitBlocks: <X extends {
|
|
31
|
+
type: string;
|
|
32
|
+
}>(extensions?: readonly X[]) => (X | (typeof KIT_BLOCKS)[number])[];
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=kit-blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kit-blocks.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/extensions/kit-blocks.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAWtD,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAuElE,eAAO,MAAM,WAAW,EAAE,cAAc,CAAC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAA;CAAE,CAO7E,CAAC;AAQF,QAAA,MAAM,cAAc,0FAA2F,CAAC;AAChH,KAAK,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AA0DpD,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAE,CAK5F,CAAC;AA8FF,eAAO,MAAM,SAAS,EAAE,cAAc,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAW1E,CAAC;AAQF,KAAK,IAAI,GAAG,MAAM,EAAE,EAAE,CAAC;AA0IvB,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAyBxE,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU;UAtW0B,IAAI;eAAa,QAAQ,EAAE;IAsWA,CAAC;AAE7E,uGAAuG;A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