@youcan/celeste 0.6.97 → 0.6.99
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/dist/celeste.css +2034 -2034
- package/dist/cjs/alert.cjs +2 -0
- package/dist/cjs/alpha-slider.cjs +2 -0
- package/dist/cjs/badge.cjs +2 -0
- package/dist/cjs/button.cjs +2 -0
- package/dist/cjs/checkbox-card.cjs +2 -0
- package/dist/cjs/checkbox-label.cjs +2 -0
- package/dist/cjs/checkbox.cjs +2 -0
- package/dist/cjs/chunks/_plugin-vue_export-helper.cjs +13 -0
- package/dist/cjs/chunks/alert.cjs +103 -0
- package/dist/cjs/chunks/alpha-slider.cjs +119 -0
- package/dist/cjs/chunks/badge.cjs +59 -0
- package/dist/cjs/chunks/button.cjs +43 -0
- package/dist/cjs/chunks/checkbox-card.cjs +100 -0
- package/dist/cjs/chunks/checkbox-label.cjs +94 -0
- package/dist/cjs/chunks/checkbox.cjs +40 -0
- package/dist/cjs/chunks/clsx.cjs +21 -0
- package/dist/cjs/chunks/collapsible-content.cjs +30 -0
- package/dist/cjs/chunks/collapsible-trigger.cjs +27 -0
- package/dist/cjs/chunks/collapsible.cjs +31 -0
- package/dist/cjs/chunks/color-area.cjs +174 -0
- package/dist/cjs/chunks/color-picker.cjs +458 -0
- package/dist/cjs/chunks/color-swatch.cjs +65 -0
- package/dist/cjs/chunks/combobox-anchor.cjs +33 -0
- package/dist/cjs/chunks/combobox-empty.cjs +36 -0
- package/dist/cjs/chunks/combobox-group.cjs +43 -0
- package/dist/cjs/chunks/combobox-input.cjs +72 -0
- package/dist/cjs/chunks/combobox-item.cjs +95 -0
- package/dist/cjs/chunks/combobox-list.cjs +66 -0
- package/dist/cjs/chunks/combobox-root.cjs +50 -0
- package/dist/cjs/chunks/combobox-separator.cjs +36 -0
- package/dist/cjs/chunks/combobox-trigger.cjs +45 -0
- package/dist/cjs/chunks/combobox.cjs +199 -0
- package/dist/cjs/chunks/compact-button.cjs +44 -0
- package/dist/cjs/chunks/components.cjs +310 -0
- package/dist/cjs/chunks/content-divider.cjs +60 -0
- package/dist/cjs/chunks/core.cjs +325 -0
- package/dist/cjs/chunks/counter-input.cjs +75 -0
- package/dist/cjs/chunks/digit-input-group.cjs +34 -0
- package/dist/cjs/chunks/digit-input-slot.cjs +33 -0
- package/dist/cjs/chunks/digit-input.cjs +54 -0
- package/dist/cjs/chunks/dist.cjs +12213 -0
- package/dist/cjs/chunks/dist2.cjs +15565 -0
- package/dist/cjs/chunks/dropdown-menu-content.cjs +62 -0
- package/dist/cjs/chunks/dropdown-menu-group.cjs +30 -0
- package/dist/cjs/chunks/dropdown-menu-item.cjs +49 -0
- package/dist/cjs/chunks/dropdown-menu-label.cjs +34 -0
- package/dist/cjs/chunks/dropdown-menu-separator.cjs +31 -0
- package/dist/cjs/chunks/dropdown-menu-sub-content.cjs +59 -0
- package/dist/cjs/chunks/dropdown-menu-sub-trigger.cjs +45 -0
- package/dist/cjs/chunks/dropdown-menu-sub.cjs +28 -0
- package/dist/cjs/chunks/dropdown-menu-trigger.cjs +31 -0
- package/dist/cjs/chunks/dropdown-menu.cjs +38 -0
- package/dist/cjs/chunks/extra-settings.cjs +134 -0
- package/dist/cjs/chunks/fancy-button.cjs +42 -0
- package/dist/cjs/chunks/file-upload-area.cjs +139 -0
- package/dist/cjs/chunks/hint-text.cjs +38 -0
- package/dist/cjs/chunks/hue-slider.cjs +120 -0
- package/dist/cjs/chunks/label.cjs +64 -0
- package/dist/cjs/chunks/link-bubble.cjs +198 -0
- package/dist/cjs/chunks/link-button.cjs +48 -0
- package/dist/cjs/chunks/menus.cjs +1173 -0
- package/dist/cjs/chunks/modal-body.cjs +25 -0
- package/dist/cjs/chunks/modal-close.cjs +27 -0
- package/dist/cjs/chunks/modal-content.cjs +53 -0
- package/dist/cjs/chunks/modal-footer.cjs +25 -0
- package/dist/cjs/chunks/modal-header.cjs +83 -0
- package/dist/cjs/chunks/modal-trigger.cjs +27 -0
- package/dist/cjs/chunks/modal.cjs +29 -0
- package/dist/cjs/chunks/pagination-content.cjs +34 -0
- package/dist/cjs/chunks/pagination-ellipsis.cjs +37 -0
- package/dist/cjs/chunks/pagination-first.cjs +34 -0
- package/dist/cjs/chunks/pagination-item.cjs +37 -0
- package/dist/cjs/chunks/pagination-last.cjs +34 -0
- package/dist/cjs/chunks/pagination-next.cjs +34 -0
- package/dist/cjs/chunks/pagination-previous.cjs +34 -0
- package/dist/cjs/chunks/pagination.cjs +60 -0
- package/dist/cjs/chunks/popover-content.cjs +113 -0
- package/dist/cjs/chunks/popover-trigger.cjs +30 -0
- package/dist/cjs/chunks/popover.cjs +29 -0
- package/dist/cjs/chunks/progress-bar.cjs +73 -0
- package/dist/cjs/chunks/progress-circle.cjs +95 -0
- package/dist/cjs/chunks/radio-group-card.cjs +100 -0
- package/dist/cjs/chunks/radio-group-item.cjs +36 -0
- package/dist/cjs/chunks/radio-group-label.cjs +94 -0
- package/dist/cjs/chunks/radio-group.cjs +41 -0
- package/dist/cjs/chunks/rich-editor.cjs +5187 -0
- package/dist/cjs/chunks/scroll-area.cjs +46 -0
- package/dist/cjs/chunks/scroll-bar.cjs +37 -0
- package/dist/cjs/chunks/segmented-control-item.cjs +43 -0
- package/dist/cjs/chunks/segmented-control.cjs +43 -0
- package/dist/cjs/chunks/select-content.cjs +66 -0
- package/dist/cjs/chunks/select-group.cjs +27 -0
- package/dist/cjs/chunks/select-icon.cjs +27 -0
- package/dist/cjs/chunks/select-item.cjs +43 -0
- package/dist/cjs/chunks/select-label.cjs +35 -0
- package/dist/cjs/chunks/select-separator.cjs +31 -0
- package/dist/cjs/chunks/select-trigger.cjs +41 -0
- package/dist/cjs/chunks/select-value.cjs +35 -0
- package/dist/cjs/chunks/select.cjs +40 -0
- package/dist/cjs/chunks/sheet-close.cjs +32 -0
- package/dist/cjs/chunks/sheet-content.cjs +65 -0
- package/dist/cjs/chunks/sheet-description.cjs +34 -0
- package/dist/cjs/chunks/sheet-footer.cjs +25 -0
- package/dist/cjs/chunks/sheet-header.cjs +25 -0
- package/dist/cjs/chunks/sheet-title.cjs +34 -0
- package/dist/cjs/chunks/sheet-trigger.cjs +27 -0
- package/dist/cjs/chunks/sheet.cjs +29 -0
- package/dist/cjs/chunks/sidebar-content.cjs +25 -0
- package/dist/cjs/chunks/sidebar-element.cjs +33 -0
- package/dist/cjs/chunks/sidebar-footer.cjs +25 -0
- package/dist/cjs/chunks/sidebar-group-content.cjs +28 -0
- package/dist/cjs/chunks/sidebar-group-label.cjs +38 -0
- package/dist/cjs/chunks/sidebar-group.cjs +25 -0
- package/dist/cjs/chunks/sidebar-header.cjs +25 -0
- package/dist/cjs/chunks/sidebar-menu-action.cjs +39 -0
- package/dist/cjs/chunks/sidebar-menu-badge.cjs +43 -0
- package/dist/cjs/chunks/sidebar-menu-button.cjs +44 -0
- package/dist/cjs/chunks/sidebar-menu-item.cjs +25 -0
- package/dist/cjs/chunks/sidebar-menu-sub-button.cjs +47 -0
- package/dist/cjs/chunks/sidebar-menu-sub-item.cjs +25 -0
- package/dist/cjs/chunks/sidebar-menu-sub.cjs +25 -0
- package/dist/cjs/chunks/sidebar-menu.cjs +25 -0
- package/dist/cjs/chunks/sidebar-provider.cjs +73 -0
- package/dist/cjs/chunks/sidebar-trigger.cjs +38 -0
- package/dist/cjs/chunks/sidebar.cjs +69 -0
- package/dist/cjs/chunks/slider.cjs +51 -0
- package/dist/cjs/chunks/social-button.cjs +42 -0
- package/dist/cjs/chunks/sonner-alert.cjs +42 -0
- package/dist/cjs/chunks/sonner.cjs +1222 -0
- package/dist/cjs/chunks/status-badge.cjs +50 -0
- package/dist/cjs/chunks/switch.cjs +40 -0
- package/dist/cjs/chunks/tab-menu-content.cjs +36 -0
- package/dist/cjs/chunks/tab-menu-item.cjs +44 -0
- package/dist/cjs/chunks/tab-menu-list.cjs +35 -0
- package/dist/cjs/chunks/tab-menu.cjs +36 -0
- package/dist/cjs/chunks/table-body.cjs +25 -0
- package/dist/cjs/chunks/table-caption.cjs +25 -0
- package/dist/cjs/chunks/table-cell.cjs +31 -0
- package/dist/cjs/chunks/table-footer.cjs +25 -0
- package/dist/cjs/chunks/table-head.cjs +31 -0
- package/dist/cjs/chunks/table-header.cjs +22 -0
- package/dist/cjs/chunks/table-row.cjs +34 -0
- package/dist/cjs/chunks/table.cjs +45 -0
- package/dist/cjs/chunks/table2.cjs +26 -0
- package/dist/cjs/chunks/tag.cjs +58 -0
- package/dist/cjs/chunks/text-input-affix.cjs +31 -0
- package/dist/cjs/chunks/text-input-button.cjs +39 -0
- package/dist/cjs/chunks/text-input.cjs +118 -0
- package/dist/cjs/chunks/textarea.cjs +61 -0
- package/dist/cjs/chunks/tooltip-content.cjs +108 -0
- package/dist/cjs/chunks/tooltip-provider.cjs +31 -0
- package/dist/cjs/chunks/tooltip-root.cjs +40 -0
- package/dist/cjs/chunks/tooltip-trigger.cjs +27 -0
- package/dist/cjs/chunks/tooltip.cjs +99 -0
- package/dist/cjs/chunks/use-color-model.cjs +943 -0
- package/dist/cjs/collapsible-content.cjs +2 -0
- package/dist/cjs/collapsible-trigger.cjs +2 -0
- package/dist/cjs/collapsible.cjs +2 -0
- package/dist/cjs/color-area.cjs +2 -0
- package/dist/cjs/color-picker.cjs +2 -0
- package/dist/cjs/color-swatch.cjs +2 -0
- package/dist/cjs/color.cjs +104 -0
- package/dist/cjs/combobox-anchor.cjs +2 -0
- package/dist/cjs/combobox-empty.cjs +2 -0
- package/dist/cjs/combobox-group.cjs +2 -0
- package/dist/cjs/combobox-input.cjs +2 -0
- package/dist/cjs/combobox-item.cjs +2 -0
- package/dist/cjs/combobox-list.cjs +2 -0
- package/dist/cjs/combobox-root.cjs +2 -0
- package/dist/cjs/combobox-separator.cjs +2 -0
- package/dist/cjs/combobox-trigger.cjs +2 -0
- package/dist/cjs/combobox.cjs +2 -0
- package/dist/cjs/command-group.cjs +37 -0
- package/dist/cjs/command-input.cjs +42 -0
- package/dist/cjs/command-item.cjs +31 -0
- package/dist/cjs/command-list.cjs +56 -0
- package/dist/cjs/command-root.cjs +51 -0
- package/dist/cjs/command-separator.cjs +31 -0
- package/dist/cjs/compact-button.cjs +2 -0
- package/dist/cjs/config.cjs +301 -0
- package/dist/cjs/content-divider.cjs +2 -0
- package/dist/cjs/counter-input.cjs +2 -0
- package/dist/cjs/crypto.cjs +7 -0
- package/dist/cjs/digit-input-group.cjs +2 -0
- package/dist/cjs/digit-input-slot.cjs +2 -0
- package/dist/cjs/digit-input.cjs +2 -0
- package/dist/cjs/dropdown-menu-content.cjs +2 -0
- package/dist/cjs/dropdown-menu-group.cjs +2 -0
- package/dist/cjs/dropdown-menu-item.cjs +2 -0
- package/dist/cjs/dropdown-menu-label.cjs +2 -0
- package/dist/cjs/dropdown-menu-separator.cjs +2 -0
- package/dist/cjs/dropdown-menu-sub-content.cjs +2 -0
- package/dist/cjs/dropdown-menu-sub-trigger.cjs +2 -0
- package/dist/cjs/dropdown-menu-sub.cjs +2 -0
- package/dist/cjs/dropdown-menu-trigger.cjs +2 -0
- package/dist/cjs/dropdown-menu.cjs +2 -0
- package/dist/cjs/extra-settings.cjs +2 -0
- package/dist/cjs/fancy-button.cjs +2 -0
- package/dist/cjs/file-upload-area.cjs +2 -0
- package/dist/cjs/hint-text.cjs +2 -0
- package/dist/cjs/hue-slider.cjs +2 -0
- package/dist/cjs/index.cjs +375 -0
- package/dist/cjs/label.cjs +2 -0
- package/dist/cjs/link-bubble.cjs +2 -0
- package/dist/cjs/link-button.cjs +2 -0
- package/dist/cjs/modal-body.cjs +2 -0
- package/dist/cjs/modal-close.cjs +2 -0
- package/dist/cjs/modal-content.cjs +2 -0
- package/dist/cjs/modal-footer.cjs +2 -0
- package/dist/cjs/modal-header.cjs +2 -0
- package/dist/cjs/modal-trigger.cjs +2 -0
- package/dist/cjs/modal.cjs +2 -0
- package/dist/cjs/pagination-content.cjs +2 -0
- package/dist/cjs/pagination-ellipsis.cjs +2 -0
- package/dist/cjs/pagination-first.cjs +2 -0
- package/dist/cjs/pagination-item.cjs +2 -0
- package/dist/cjs/pagination-last.cjs +2 -0
- package/dist/cjs/pagination-next.cjs +2 -0
- package/dist/cjs/pagination-previous.cjs +2 -0
- package/dist/cjs/pagination.cjs +2 -0
- package/dist/cjs/popover-content.cjs +2 -0
- package/dist/cjs/popover-trigger.cjs +2 -0
- package/dist/cjs/popover.cjs +2 -0
- package/dist/cjs/progress-bar.cjs +2 -0
- package/dist/cjs/progress-circle.cjs +2 -0
- package/dist/cjs/radio-group-card.cjs +2 -0
- package/dist/cjs/radio-group-item.cjs +2 -0
- package/dist/cjs/radio-group-label.cjs +2 -0
- package/dist/cjs/radio-group.cjs +2 -0
- package/dist/cjs/rich-editor.cjs +2 -0
- package/dist/cjs/scroll-area.cjs +2 -0
- package/dist/cjs/scroll-bar.cjs +2 -0
- package/dist/cjs/segmented-control-item.cjs +2 -0
- package/dist/cjs/segmented-control.cjs +2 -0
- package/dist/cjs/select-content.cjs +2 -0
- package/dist/cjs/select-group.cjs +2 -0
- package/dist/cjs/select-icon.cjs +2 -0
- package/dist/cjs/select-item.cjs +2 -0
- package/dist/cjs/select-label.cjs +2 -0
- package/dist/cjs/select-separator.cjs +2 -0
- package/dist/cjs/select-trigger.cjs +2 -0
- package/dist/cjs/select-value.cjs +2 -0
- package/dist/cjs/select.cjs +2 -0
- package/dist/cjs/sheet-close.cjs +2 -0
- package/dist/cjs/sheet-content.cjs +2 -0
- package/dist/cjs/sheet-description.cjs +2 -0
- package/dist/cjs/sheet-footer.cjs +2 -0
- package/dist/cjs/sheet-header.cjs +2 -0
- package/dist/cjs/sheet-title.cjs +2 -0
- package/dist/cjs/sheet-trigger.cjs +2 -0
- package/dist/cjs/sheet.cjs +2 -0
- package/dist/cjs/shims.cjs +0 -0
- package/dist/cjs/sidebar-content.cjs +2 -0
- package/dist/cjs/sidebar-element.cjs +2 -0
- package/dist/cjs/sidebar-footer.cjs +2 -0
- package/dist/cjs/sidebar-group-content.cjs +2 -0
- package/dist/cjs/sidebar-group-label.cjs +2 -0
- package/dist/cjs/sidebar-group.cjs +2 -0
- package/dist/cjs/sidebar-header.cjs +2 -0
- package/dist/cjs/sidebar-menu-action.cjs +2 -0
- package/dist/cjs/sidebar-menu-badge.cjs +2 -0
- package/dist/cjs/sidebar-menu-button.cjs +2 -0
- package/dist/cjs/sidebar-menu-item.cjs +2 -0
- package/dist/cjs/sidebar-menu-sub-button.cjs +2 -0
- package/dist/cjs/sidebar-menu-sub-item.cjs +2 -0
- package/dist/cjs/sidebar-menu-sub.cjs +2 -0
- package/dist/cjs/sidebar-menu.cjs +2 -0
- package/dist/cjs/sidebar-provider.cjs +2 -0
- package/dist/cjs/sidebar-separator.cjs +2 -0
- package/dist/cjs/sidebar-trigger.cjs +2 -0
- package/dist/cjs/sidebar.cjs +2 -0
- package/dist/cjs/slider.cjs +2 -0
- package/dist/cjs/social-button.cjs +2 -0
- package/dist/cjs/sonner-alert.cjs +2 -0
- package/dist/cjs/sonner.cjs +2 -0
- package/dist/cjs/status-badge.cjs +2 -0
- package/dist/cjs/switch.cjs +2 -0
- package/dist/cjs/tab-menu-content.cjs +2 -0
- package/dist/cjs/tab-menu-item.cjs +2 -0
- package/dist/cjs/tab-menu-list.cjs +2 -0
- package/dist/cjs/tab-menu.cjs +2 -0
- package/dist/cjs/table-body.cjs +2 -0
- package/dist/cjs/table-caption.cjs +2 -0
- package/dist/cjs/table-cell.cjs +2 -0
- package/dist/cjs/table-empty.cjs +2 -0
- package/dist/cjs/table-footer.cjs +2 -0
- package/dist/cjs/table-head.cjs +2 -0
- package/dist/cjs/table-header.cjs +2 -0
- package/dist/cjs/table-row.cjs +2 -0
- package/dist/cjs/table.cjs +2 -0
- package/dist/cjs/tag.cjs +2 -0
- package/dist/cjs/text-input-affix.cjs +2 -0
- package/dist/cjs/text-input-button.cjs +2 -0
- package/dist/cjs/text-input.cjs +2 -0
- package/dist/cjs/textarea.cjs +2 -0
- package/dist/cjs/tooltip-content.cjs +2 -0
- package/dist/cjs/tooltip-provider.cjs +2 -0
- package/dist/cjs/tooltip-root.cjs +2 -0
- package/dist/cjs/tooltip-trigger.cjs +2 -0
- package/dist/cjs/tooltip.cjs +2 -0
- package/dist/cjs/types.cjs +0 -0
- package/dist/cjs/use-color-model.cjs +4 -0
- package/dist/cjs/use-delegated-props.cjs +16 -0
- package/dist/cjs/{use-sidebar.js → use-sidebar.cjs} +10 -9
- package/dist/cjs/use-user-select.cjs +41 -0
- package/dist/components/alert/alert.d.ts +14 -9
- package/dist/components/badge/badge.d.ts +4 -3
- package/dist/components/badge/status-badge.d.ts +4 -3
- package/dist/components/button/button.d.ts +5 -4
- package/dist/components/button/compact-button.d.ts +3 -2
- package/dist/components/button/fancy-button.d.ts +5 -4
- package/dist/components/button/link-button.d.ts +5 -4
- package/dist/components/button/social-button.d.ts +3 -2
- package/dist/components/checkbox/checkbox-card.d.ts +23 -21
- package/dist/components/checkbox/checkbox-label.d.ts +17 -16
- package/dist/components/checkbox/checkbox.d.ts +2 -1
- package/dist/components/collapsible/collapsible-content.d.ts +5 -4
- package/dist/components/collapsible/collapsible-trigger.d.ts +5 -4
- package/dist/components/collapsible/collapsible.d.ts +6 -5
- package/dist/components/color-picker/alpha-slider.d.ts +4 -5
- package/dist/components/color-picker/color-area.d.ts +2 -3
- package/dist/components/color-picker/color-picker.d.ts +5 -4
- package/dist/components/color-picker/color-swatch.d.ts +4 -3
- package/dist/components/color-picker/hue-slider.d.ts +7 -8
- package/dist/components/combobox/combobox-anchor.d.ts +7 -11
- package/dist/components/combobox/combobox-empty.d.ts +7 -11
- package/dist/components/combobox/combobox-group.d.ts +7 -11
- package/dist/components/combobox/combobox-input.d.ts +5 -3
- package/dist/components/combobox/combobox-item.d.ts +7 -5
- package/dist/components/combobox/combobox-list.d.ts +7 -11
- package/dist/components/combobox/combobox-root.d.ts +7 -11
- package/dist/components/combobox/combobox-separator.d.ts +7 -11
- package/dist/components/combobox/combobox-trigger.d.ts +5 -4
- package/dist/components/combobox/combobox.d.ts +9 -7
- package/dist/components/content-divider/content-divider.d.ts +3 -2
- package/dist/components/counter-input/counter-input.d.ts +2 -1
- package/dist/components/digit-input/digit-input-group.d.ts +7 -11
- package/dist/components/digit-input/digit-input-slot.d.ts +2 -1
- package/dist/components/digit-input/digit-input.d.ts +7 -11
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +7 -11
- package/dist/components/dropdown-menu/dropdown-menu-group.d.ts +7 -11
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +11 -13
- package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +7 -11
- package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +2 -1
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +7 -11
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +9 -12
- package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +7 -11
- package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +7 -11
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +7 -11
- package/dist/components/file-upload/file-upload-area.d.ts +8 -9
- package/dist/components/hint-text/hint-text.d.ts +4 -3
- package/dist/components/label/label.d.ts +11 -14
- package/dist/components/modal/modal-body.d.ts +7 -11
- package/dist/components/modal/modal-close.d.ts +7 -11
- package/dist/components/modal/modal-content.d.ts +7 -11
- package/dist/components/modal/modal-footer.d.ts +7 -11
- package/dist/components/modal/modal-header.d.ts +3 -2
- package/dist/components/modal/modal-trigger.d.ts +7 -11
- package/dist/components/modal/modal.d.ts +7 -11
- package/dist/components/pagination/pagination-content.d.ts +6 -5
- package/dist/components/pagination/pagination-ellipsis.d.ts +5 -4
- package/dist/components/pagination/pagination-first.d.ts +5 -4
- package/dist/components/pagination/pagination-item.d.ts +5 -4
- package/dist/components/pagination/pagination-last.d.ts +5 -4
- package/dist/components/pagination/pagination-next.d.ts +5 -4
- package/dist/components/pagination/pagination-previous.d.ts +5 -4
- package/dist/components/pagination/pagination.d.ts +12 -9
- package/dist/components/popover/popover-content.d.ts +7 -5
- package/dist/components/popover/popover-trigger.d.ts +7 -11
- package/dist/components/popover/popover.d.ts +7 -11
- package/dist/components/progress/progress-bar.d.ts +10 -13
- package/dist/components/progress/progress-circle.d.ts +7 -11
- package/dist/components/radio-group/radio-group-card.d.ts +23 -21
- package/dist/components/radio-group/radio-group-item.d.ts +2 -1
- package/dist/components/radio-group/radio-group-label.d.ts +17 -16
- package/dist/components/radio-group/radio-group.d.ts +7 -11
- package/dist/components/rich-editor/extra-settings.d.ts +2 -1
- package/dist/components/rich-editor/link-bubble.d.ts +3 -4
- package/dist/components/rich-editor/rich-editor.d.ts +2 -1
- package/dist/components/scroll-area/scroll-area.d.ts +7 -11
- package/dist/components/scroll-area/scroll-bar.d.ts +2 -1
- package/dist/components/segmented-control/segmented-control-item.d.ts +7 -11
- package/dist/components/segmented-control/segmented-control.d.ts +7 -11
- package/dist/components/select/select-content.d.ts +7 -11
- package/dist/components/select/select-group.d.ts +7 -11
- package/dist/components/select/select-icon.d.ts +7 -11
- package/dist/components/select/select-item.d.ts +7 -11
- package/dist/components/select/select-label.d.ts +7 -11
- package/dist/components/select/select-separator.d.ts +2 -1
- package/dist/components/select/select-trigger.d.ts +7 -11
- package/dist/components/select/select-value.d.ts +7 -11
- package/dist/components/select/select.d.ts +7 -11
- package/dist/components/sheet/sheet-close.d.ts +5 -4
- package/dist/components/sheet/sheet-content.d.ts +5 -4
- package/dist/components/sheet/sheet-description.d.ts +5 -4
- package/dist/components/sheet/sheet-footer.d.ts +5 -4
- package/dist/components/sheet/sheet-header.d.ts +5 -4
- package/dist/components/sheet/sheet-title.d.ts +5 -4
- package/dist/components/sheet/sheet-trigger.d.ts +5 -4
- package/dist/components/sheet/sheet.d.ts +7 -11
- package/dist/components/sidebar/sidebar-content.d.ts +7 -11
- package/dist/components/sidebar/sidebar-element.d.ts +5 -4
- package/dist/components/sidebar/sidebar-footer.d.ts +5 -4
- package/dist/components/sidebar/sidebar-group-content.d.ts +7 -11
- package/dist/components/sidebar/sidebar-group-label.d.ts +7 -11
- package/dist/components/sidebar/sidebar-group.d.ts +7 -11
- package/dist/components/sidebar/sidebar-header.d.ts +5 -4
- package/dist/components/sidebar/sidebar-menu-action.d.ts +5 -4
- package/dist/components/sidebar/sidebar-menu-badge.d.ts +4 -3
- package/dist/components/sidebar/sidebar-menu-button.d.ts +7 -11
- package/dist/components/sidebar/sidebar-menu-item.d.ts +7 -11
- package/dist/components/sidebar/sidebar-menu-sub-button.d.ts +5 -4
- package/dist/components/sidebar/sidebar-menu-sub-item.d.ts +7 -11
- package/dist/components/sidebar/sidebar-menu-sub.d.ts +7 -11
- package/dist/components/sidebar/sidebar-menu.d.ts +7 -11
- package/dist/components/sidebar/sidebar-provider.d.ts +8 -12
- package/dist/components/sidebar/sidebar-separator.d.ts +2 -1
- package/dist/components/sidebar/sidebar-trigger.d.ts +2 -1
- package/dist/components/sidebar/sidebar.d.ts +7 -5
- package/dist/components/slider/slider.d.ts +2 -1
- package/dist/components/sonner/sonner-alert.d.ts +3 -2
- package/dist/components/sonner/sonner.d.ts +2 -1
- package/dist/components/switch/switch.d.ts +2 -1
- package/dist/components/tab-menu/tab-menu-content.d.ts +7 -11
- package/dist/components/tab-menu/tab-menu-item.d.ts +11 -13
- package/dist/components/tab-menu/tab-menu-list.d.ts +7 -11
- package/dist/components/tab-menu/tab-menu.d.ts +7 -11
- package/dist/components/table/table-body.d.ts +5 -4
- package/dist/components/table/table-caption.d.ts +5 -4
- package/dist/components/table/table-cell.d.ts +6 -5
- package/dist/components/table/table-empty.d.ts +5 -4
- package/dist/components/table/table-footer.d.ts +5 -4
- package/dist/components/table/table-head.d.ts +6 -5
- package/dist/components/table/table-header.d.ts +5 -4
- package/dist/components/table/table-row.d.ts +5 -4
- package/dist/components/table/table.d.ts +5 -4
- package/dist/components/tag/tag.d.ts +5 -4
- package/dist/components/text-input/text-input-affix.d.ts +7 -11
- package/dist/components/text-input/text-input-button.d.ts +7 -11
- package/dist/components/text-input/text-input.d.ts +21 -15
- package/dist/components/textarea/textarea.d.ts +9 -8
- package/dist/components/tooltip/tooltip-content.d.ts +5 -4
- package/dist/components/tooltip/tooltip-provider.d.ts +5 -4
- package/dist/components/tooltip/tooltip-root.d.ts +5 -4
- package/dist/components/tooltip/tooltip-trigger.d.ts +5 -4
- package/dist/components/tooltip/tooltip.d.ts +5 -4
- package/dist/es/alert.js +2 -113
- package/dist/es/alpha-slider.js +2 -4
- package/dist/es/badge.js +2 -60
- package/dist/es/button.js +2 -41
- package/dist/es/checkbox-card.js +2 -112
- package/dist/es/checkbox-label.js +2 -111
- package/dist/es/checkbox.js +2 -5
- package/dist/es/chunks/_plugin-vue_export-helper.js +7 -9
- package/dist/es/chunks/alert.js +96 -0
- package/dist/es/chunks/alpha-slider.js +102 -117
- package/dist/es/chunks/badge.js +52 -0
- package/dist/es/chunks/button.js +36 -0
- package/dist/es/chunks/checkbox-card.js +94 -0
- package/dist/es/chunks/checkbox-label.js +88 -0
- package/dist/es/chunks/checkbox.js +33 -37
- package/dist/es/chunks/clsx.js +12 -12
- package/dist/es/chunks/collapsible-content.js +24 -27
- package/dist/es/chunks/collapsible-trigger.js +21 -22
- package/dist/es/chunks/collapsible.js +25 -28
- package/dist/es/chunks/color-area.js +166 -0
- package/dist/es/chunks/color-picker.js +452 -0
- package/dist/es/chunks/color-swatch.js +58 -0
- package/dist/es/chunks/combobox-anchor.js +27 -31
- package/dist/es/chunks/combobox-empty.js +29 -0
- package/dist/es/chunks/combobox-group.js +36 -0
- package/dist/es/chunks/combobox-input.js +65 -0
- package/dist/es/chunks/combobox-item.js +89 -0
- package/dist/es/chunks/combobox-list.js +59 -0
- package/dist/es/chunks/combobox-root.js +43 -0
- package/dist/es/chunks/combobox-separator.js +29 -0
- package/dist/es/chunks/combobox-trigger.js +38 -0
- package/dist/es/chunks/combobox.js +193 -0
- package/dist/es/chunks/compact-button.js +37 -0
- package/dist/es/chunks/components.js +299 -0
- package/dist/es/chunks/content-divider.js +55 -0
- package/dist/es/chunks/core.js +289 -0
- package/dist/es/chunks/counter-input.js +68 -69
- package/dist/es/chunks/digit-input-group.js +27 -0
- package/dist/es/chunks/digit-input-slot.js +26 -0
- package/dist/es/chunks/digit-input.js +47 -0
- package/dist/es/chunks/dist.js +11525 -0
- package/dist/es/chunks/dist2.js +15302 -0
- package/dist/es/chunks/dropdown-menu-content.js +55 -0
- package/dist/es/chunks/dropdown-menu-group.js +23 -0
- package/dist/es/chunks/dropdown-menu-item.js +43 -0
- package/dist/es/chunks/dropdown-menu-label.js +27 -0
- package/dist/es/chunks/dropdown-menu-separator.js +24 -0
- package/dist/es/chunks/dropdown-menu-sub-content.js +52 -0
- package/dist/es/chunks/dropdown-menu-sub-trigger.js +39 -0
- package/dist/es/chunks/dropdown-menu-sub.js +22 -25
- package/dist/es/chunks/dropdown-menu-trigger.js +24 -0
- package/dist/es/chunks/dropdown-menu.js +31 -0
- package/dist/es/chunks/extra-settings.js +127 -0
- package/dist/es/chunks/fancy-button.js +35 -0
- package/dist/es/chunks/file-upload-area.js +132 -0
- package/dist/es/chunks/hint-text.js +31 -0
- package/dist/es/chunks/hue-slider.js +113 -0
- package/dist/es/chunks/label.js +58 -0
- package/dist/es/chunks/link-bubble.js +191 -0
- package/dist/es/chunks/link-button.js +41 -0
- package/dist/es/chunks/menus.js +1173 -0
- package/dist/es/chunks/modal-body.js +17 -0
- package/dist/es/chunks/modal-close.js +21 -22
- package/dist/es/chunks/modal-content.js +46 -0
- package/dist/es/chunks/modal-footer.js +17 -0
- package/dist/es/chunks/modal-header.js +77 -0
- package/dist/es/chunks/modal-trigger.js +21 -22
- package/dist/es/chunks/modal.js +23 -26
- package/dist/es/chunks/pagination-content.js +27 -0
- package/dist/es/chunks/pagination-ellipsis.js +30 -0
- package/dist/es/chunks/pagination-first.js +28 -32
- package/dist/es/chunks/pagination-item.js +31 -32
- package/dist/es/chunks/pagination-last.js +28 -32
- package/dist/es/chunks/pagination-next.js +28 -32
- package/dist/es/chunks/pagination-previous.js +28 -32
- package/dist/es/chunks/pagination.js +54 -0
- package/dist/es/chunks/popover-content.js +107 -0
- package/dist/es/chunks/popover-trigger.js +23 -0
- package/dist/es/chunks/popover.js +23 -26
- package/dist/es/chunks/progress-bar.js +67 -0
- package/dist/es/chunks/progress-circle.js +89 -0
- package/dist/es/chunks/radio-group-card.js +94 -0
- package/dist/es/chunks/radio-group-item.js +29 -33
- package/dist/es/chunks/radio-group-label.js +88 -0
- package/dist/es/chunks/radio-group.js +34 -38
- package/dist/es/chunks/rich-editor.js +5180 -0
- package/dist/es/chunks/scroll-area.js +39 -0
- package/dist/es/chunks/scroll-bar.js +30 -0
- package/dist/es/chunks/segmented-control-item.js +36 -0
- package/dist/es/chunks/segmented-control.js +36 -0
- package/dist/es/chunks/select-content.js +59 -0
- package/dist/es/chunks/select-group.js +21 -22
- package/dist/es/chunks/select-icon.js +19 -0
- package/dist/es/chunks/select-item.js +36 -0
- package/dist/es/chunks/select-label.js +28 -0
- package/dist/es/chunks/select-separator.js +24 -0
- package/dist/es/chunks/select-trigger.js +34 -0
- package/dist/es/chunks/select-value.js +28 -0
- package/dist/es/chunks/select.js +33 -37
- package/dist/es/chunks/sheet-close.js +25 -0
- package/dist/es/chunks/sheet-content.js +58 -0
- package/dist/es/chunks/sheet-description.js +27 -0
- package/dist/es/chunks/sheet-footer.js +17 -0
- package/dist/es/chunks/sheet-header.js +17 -0
- package/dist/es/chunks/sheet-title.js +27 -0
- package/dist/es/chunks/sheet-trigger.js +21 -22
- package/dist/es/chunks/sheet.js +23 -26
- package/dist/es/chunks/sidebar-content.js +18 -21
- package/dist/es/chunks/sidebar-element.js +27 -28
- package/dist/es/chunks/sidebar-footer.js +18 -21
- package/dist/es/chunks/sidebar-group-content.js +20 -0
- package/dist/es/chunks/sidebar-group-label.js +32 -29
- package/dist/es/chunks/sidebar-group.js +18 -21
- package/dist/es/chunks/sidebar-header.js +18 -21
- package/dist/es/chunks/sidebar-menu-action.js +33 -34
- package/dist/es/chunks/sidebar-menu-badge.js +36 -29
- package/dist/es/chunks/sidebar-menu-button.js +38 -39
- package/dist/es/chunks/sidebar-menu-item.js +18 -21
- package/dist/es/chunks/sidebar-menu-sub-button.js +41 -37
- package/dist/es/chunks/sidebar-menu-sub-item.js +18 -21
- package/dist/es/chunks/sidebar-menu-sub.js +18 -21
- package/dist/es/chunks/sidebar-menu.js +18 -21
- package/dist/es/chunks/sidebar-provider.js +67 -0
- package/dist/es/chunks/sidebar-trigger.js +30 -0
- package/dist/es/chunks/sidebar.js +61 -83
- package/dist/es/chunks/slider.js +44 -51
- package/dist/es/chunks/social-button.js +36 -0
- package/dist/es/chunks/sonner-alert.js +34 -0
- package/dist/es/chunks/sonner.js +1163 -1176
- package/dist/es/chunks/status-badge.js +43 -0
- package/dist/es/chunks/switch.js +33 -37
- package/dist/es/chunks/tab-menu-content.js +29 -0
- package/dist/es/chunks/tab-menu-item.js +38 -0
- package/dist/es/chunks/tab-menu-list.js +28 -0
- package/dist/es/chunks/tab-menu.js +29 -0
- package/dist/es/chunks/table-body.js +17 -0
- package/dist/es/chunks/table-caption.js +17 -0
- package/dist/es/chunks/table-cell.js +23 -0
- package/dist/es/chunks/table-footer.js +17 -0
- package/dist/es/chunks/table-head.js +23 -0
- package/dist/es/chunks/table-header.js +15 -20
- package/dist/es/chunks/table-row.js +26 -0
- package/dist/es/chunks/table.js +38 -0
- package/dist/es/chunks/table2.js +19 -0
- package/dist/es/chunks/tag.js +52 -0
- package/dist/es/chunks/text-input-affix.js +23 -0
- package/dist/es/chunks/text-input-button.js +31 -0
- package/dist/es/chunks/text-input.js +112 -0
- package/dist/es/chunks/textarea.js +54 -0
- package/dist/es/chunks/tooltip-content.js +102 -0
- package/dist/es/chunks/tooltip-provider.js +25 -26
- package/dist/es/chunks/tooltip-root.js +33 -35
- package/dist/es/chunks/tooltip-trigger.js +21 -23
- package/dist/es/chunks/tooltip.js +92 -83
- package/dist/es/chunks/use-color-model.js +925 -0
- package/dist/es/collapsible-content.js +2 -5
- package/dist/es/collapsible-trigger.js +2 -4
- package/dist/es/collapsible.js +2 -4
- package/dist/es/color-area.js +2 -177
- package/dist/es/color-picker.js +2 -519
- package/dist/es/color-swatch.js +2 -62
- package/dist/es/color.js +73 -83
- package/dist/es/combobox-anchor.js +2 -4
- package/dist/es/combobox-empty.js +2 -34
- package/dist/es/combobox-group.js +2 -44
- package/dist/es/combobox-input.js +2 -66
- package/dist/es/combobox-item.js +2 -112
- package/dist/es/combobox-list.js +2 -64
- package/dist/es/combobox-root.js +2 -43
- package/dist/es/combobox-separator.js +2 -34
- package/dist/es/combobox-trigger.js +2 -49
- package/dist/es/combobox.js +2 -241
- package/dist/es/command-group.js +35 -42
- package/dist/es/command-input.js +40 -42
- package/dist/es/command-item.js +30 -34
- package/dist/es/command-list.js +55 -52
- package/dist/es/command-root.js +50 -46
- package/dist/es/command-separator.js +29 -33
- package/dist/es/compact-button.js +2 -44
- package/dist/es/config.js +292 -130
- package/dist/es/content-divider.js +2 -4
- package/dist/es/counter-input.js +2 -5
- package/dist/es/crypto.js +4 -6
- package/dist/es/digit-input-group.js +2 -33
- package/dist/es/digit-input-slot.js +2 -30
- package/dist/es/digit-input.js +2 -48
- package/dist/es/dropdown-menu-content.js +2 -55
- package/dist/es/dropdown-menu-group.js +2 -26
- package/dist/es/dropdown-menu-item.js +2 -55
- package/dist/es/dropdown-menu-label.js +2 -33
- package/dist/es/dropdown-menu-separator.js +2 -27
- package/dist/es/dropdown-menu-sub-content.js +2 -52
- package/dist/es/dropdown-menu-sub-trigger.js +2 -46
- package/dist/es/dropdown-menu-sub.js +2 -4
- package/dist/es/dropdown-menu-trigger.js +2 -28
- package/dist/es/dropdown-menu.js +2 -37
- package/dist/es/extra-settings.js +2 -157
- package/dist/es/fancy-button.js +2 -39
- package/dist/es/file-upload-area.js +2 -147
- package/dist/es/hint-text.js +2 -38
- package/dist/es/hue-slider.js +2 -135
- package/dist/es/index.js +206 -520
- package/dist/es/label.js +2 -60
- package/dist/es/link-bubble.js +2 -243
- package/dist/es/link-button.js +2 -45
- package/dist/es/modal-body.js +2 -24
- package/dist/es/modal-close.js +2 -4
- package/dist/es/modal-content.js +2 -50
- package/dist/es/modal-footer.js +2 -24
- package/dist/es/modal-header.js +2 -83
- package/dist/es/modal-trigger.js +2 -4
- package/dist/es/modal.js +2 -4
- package/dist/es/pagination-content.js +2 -32
- package/dist/es/pagination-ellipsis.js +2 -36
- package/dist/es/pagination-first.js +2 -4
- package/dist/es/pagination-item.js +2 -4
- package/dist/es/pagination-last.js +2 -4
- package/dist/es/pagination-next.js +2 -4
- package/dist/es/pagination-previous.js +2 -4
- package/dist/es/pagination.js +2 -61
- package/dist/es/popover-content.js +2 -107
- package/dist/es/popover-trigger.js +2 -26
- package/dist/es/popover.js +2 -4
- package/dist/es/progress-bar.js +2 -86
- package/dist/es/progress-circle.js +2 -94
- package/dist/es/radio-group-card.js +2 -112
- package/dist/es/radio-group-item.js +2 -5
- package/dist/es/radio-group-label.js +2 -111
- package/dist/es/radio-group.js +2 -5
- package/dist/es/rich-editor.js +2 -431
- package/dist/es/scroll-area.js +2 -44
- package/dist/es/scroll-bar.js +2 -34
- package/dist/es/segmented-control-item.js +2 -41
- package/dist/es/segmented-control.js +2 -42
- package/dist/es/select-content.js +2 -63
- package/dist/es/select-group.js +2 -4
- package/dist/es/select-icon.js +2 -26
- package/dist/es/select-item.js +2 -46
- package/dist/es/select-label.js +2 -33
- package/dist/es/select-separator.js +2 -27
- package/dist/es/select-trigger.js +2 -42
- package/dist/es/select-value.js +2 -33
- package/dist/es/select.js +2 -4
- package/dist/es/sheet-close.js +2 -30
- package/dist/es/sheet-content.js +2 -62
- package/dist/es/sheet-description.js +2 -32
- package/dist/es/sheet-footer.js +2 -29
- package/dist/es/sheet-header.js +2 -24
- package/dist/es/sheet-title.js +2 -32
- package/dist/es/sheet-trigger.js +2 -4
- package/dist/es/sheet.js +2 -4
- package/dist/es/shims.js +0 -1
- package/dist/es/sidebar-content.js +2 -5
- package/dist/es/sidebar-element.js +2 -5
- package/dist/es/sidebar-footer.js +2 -5
- package/dist/es/sidebar-group-content.js +2 -25
- package/dist/es/sidebar-group-label.js +2 -5
- package/dist/es/sidebar-group.js +2 -5
- package/dist/es/sidebar-header.js +2 -5
- package/dist/es/sidebar-menu-action.js +2 -5
- package/dist/es/sidebar-menu-badge.js +2 -5
- package/dist/es/sidebar-menu-button.js +2 -5
- package/dist/es/sidebar-menu-item.js +2 -5
- package/dist/es/sidebar-menu-sub-button.js +2 -5
- package/dist/es/sidebar-menu-sub-item.js +2 -5
- package/dist/es/sidebar-menu-sub.js +2 -5
- package/dist/es/sidebar-menu.js +2 -5
- package/dist/es/sidebar-provider.js +2 -4
- package/dist/es/sidebar-separator.js +2 -4
- package/dist/es/sidebar-trigger.js +2 -35
- package/dist/es/sidebar.js +2 -5
- package/dist/es/slider.js +2 -5
- package/dist/es/social-button.js +2 -46
- package/dist/es/sonner-alert.js +2 -43
- package/dist/es/sonner.js +2 -4
- package/dist/es/status-badge.js +2 -51
- package/dist/es/switch.js +2 -5
- package/dist/es/tab-menu-content.js +2 -34
- package/dist/es/tab-menu-item.js +2 -46
- package/dist/es/tab-menu-list.js +2 -36
- package/dist/es/tab-menu.js +2 -34
- package/dist/es/table-body.js +2 -24
- package/dist/es/table-caption.js +2 -24
- package/dist/es/table-cell.js +2 -27
- package/dist/es/table-empty.js +2 -45
- package/dist/es/table-footer.js +2 -24
- package/dist/es/table-head.js +2 -25
- package/dist/es/table-header.js +2 -4
- package/dist/es/table-row.js +2 -33
- package/dist/es/table.js +2 -27
- package/dist/es/tag.js +2 -48
- package/dist/es/text-input-affix.js +2 -28
- package/dist/es/text-input-button.js +2 -33
- package/dist/es/text-input.js +2 -121
- package/dist/es/textarea.js +2 -58
- package/dist/es/tooltip-content.js +2 -95
- package/dist/es/tooltip-provider.js +2 -4
- package/dist/es/tooltip-root.js +2 -4
- package/dist/es/tooltip-trigger.js +2 -4
- package/dist/es/tooltip.js +2 -4
- package/dist/es/types.js +0 -1
- package/dist/es/use-color-model.js +2 -33
- package/dist/es/use-delegated-props.js +11 -11
- package/dist/es/use-sidebar.js +11 -18
- package/dist/es/use-user-select.js +37 -37
- package/package.json +10 -10
- package/dist/cjs/alert.js +0 -112
- package/dist/cjs/alpha-slider.js +0 -3
- package/dist/cjs/badge.js +0 -59
- package/dist/cjs/button.js +0 -40
- package/dist/cjs/checkbox-card.js +0 -111
- package/dist/cjs/checkbox-label.js +0 -110
- package/dist/cjs/checkbox.js +0 -4
- package/dist/cjs/chunks/_plugin-vue_export-helper.js +0 -9
- package/dist/cjs/chunks/alpha-slider.js +0 -127
- package/dist/cjs/chunks/checkbox.js +0 -38
- package/dist/cjs/chunks/clsx.js +0 -15
- package/dist/cjs/chunks/collapsible-content.js +0 -27
- package/dist/cjs/chunks/collapsible-trigger.js +0 -22
- package/dist/cjs/chunks/collapsible.js +0 -28
- package/dist/cjs/chunks/combobox-anchor.js +0 -31
- package/dist/cjs/chunks/content-divider.vue_vue_type_style_index_0_lang.js +0 -52
- package/dist/cjs/chunks/counter-input.js +0 -70
- package/dist/cjs/chunks/dropdown-menu-sub.js +0 -25
- package/dist/cjs/chunks/index.js +0 -10879
- package/dist/cjs/chunks/index2.js +0 -90
- package/dist/cjs/chunks/index3.js +0 -272
- package/dist/cjs/chunks/index4.js +0 -1486
- package/dist/cjs/chunks/index5.js +0 -17162
- package/dist/cjs/chunks/modal-close.js +0 -22
- package/dist/cjs/chunks/modal-trigger.js +0 -22
- package/dist/cjs/chunks/modal.js +0 -26
- package/dist/cjs/chunks/pagination-first.js +0 -32
- package/dist/cjs/chunks/pagination-item.js +0 -32
- package/dist/cjs/chunks/pagination-last.js +0 -32
- package/dist/cjs/chunks/pagination-next.js +0 -32
- package/dist/cjs/chunks/pagination-previous.js +0 -32
- package/dist/cjs/chunks/popover.js +0 -26
- package/dist/cjs/chunks/radio-group-item.js +0 -34
- package/dist/cjs/chunks/radio-group.js +0 -39
- package/dist/cjs/chunks/rich-editor.vue_vue_type_style_index_0_scoped_4e1c9896_lang.js +0 -5272
- package/dist/cjs/chunks/select-group.js +0 -22
- package/dist/cjs/chunks/select.js +0 -38
- package/dist/cjs/chunks/sheet-trigger.js +0 -22
- package/dist/cjs/chunks/sheet.js +0 -26
- package/dist/cjs/chunks/sidebar-content.js +0 -21
- package/dist/cjs/chunks/sidebar-element.js +0 -28
- package/dist/cjs/chunks/sidebar-footer.js +0 -21
- package/dist/cjs/chunks/sidebar-group-label.js +0 -29
- package/dist/cjs/chunks/sidebar-group.js +0 -21
- package/dist/cjs/chunks/sidebar-header.js +0 -21
- package/dist/cjs/chunks/sidebar-menu-action.js +0 -34
- package/dist/cjs/chunks/sidebar-menu-badge.js +0 -29
- package/dist/cjs/chunks/sidebar-menu-button.js +0 -39
- package/dist/cjs/chunks/sidebar-menu-item.js +0 -21
- package/dist/cjs/chunks/sidebar-menu-sub-button.js +0 -37
- package/dist/cjs/chunks/sidebar-menu-sub-item.js +0 -21
- package/dist/cjs/chunks/sidebar-menu-sub.js +0 -21
- package/dist/cjs/chunks/sidebar-menu.js +0 -21
- package/dist/cjs/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +0 -63
- package/dist/cjs/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +0 -137
- package/dist/cjs/chunks/sidebar.js +0 -84
- package/dist/cjs/chunks/slider.js +0 -52
- package/dist/cjs/chunks/sonner.js +0 -1222
- package/dist/cjs/chunks/switch.js +0 -38
- package/dist/cjs/chunks/table-header.js +0 -20
- package/dist/cjs/chunks/tinycolor.js +0 -965
- package/dist/cjs/chunks/tooltip-provider.js +0 -26
- package/dist/cjs/chunks/tooltip-root.js +0 -36
- package/dist/cjs/chunks/tooltip-trigger.js +0 -23
- package/dist/cjs/chunks/tooltip.js +0 -84
- package/dist/cjs/collapsible-content.js +0 -4
- package/dist/cjs/collapsible-trigger.js +0 -3
- package/dist/cjs/collapsible.js +0 -3
- package/dist/cjs/color-area.js +0 -176
- package/dist/cjs/color-picker.js +0 -518
- package/dist/cjs/color-swatch.js +0 -61
- package/dist/cjs/color.js +0 -102
- package/dist/cjs/combobox-anchor.js +0 -3
- package/dist/cjs/combobox-empty.js +0 -33
- package/dist/cjs/combobox-group.js +0 -43
- package/dist/cjs/combobox-input.js +0 -65
- package/dist/cjs/combobox-item.js +0 -111
- package/dist/cjs/combobox-list.js +0 -63
- package/dist/cjs/combobox-root.js +0 -42
- package/dist/cjs/combobox-separator.js +0 -33
- package/dist/cjs/combobox-trigger.js +0 -48
- package/dist/cjs/combobox.js +0 -240
- package/dist/cjs/command-group.js +0 -41
- package/dist/cjs/command-input.js +0 -42
- package/dist/cjs/command-item.js +0 -34
- package/dist/cjs/command-list.js +0 -52
- package/dist/cjs/command-root.js +0 -46
- package/dist/cjs/command-separator.js +0 -32
- package/dist/cjs/compact-button.js +0 -43
- package/dist/cjs/config.js +0 -136
- package/dist/cjs/content-divider.js +0 -3
- package/dist/cjs/counter-input.js +0 -4
- package/dist/cjs/crypto.js +0 -8
- package/dist/cjs/digit-input-group.js +0 -32
- package/dist/cjs/digit-input-slot.js +0 -29
- package/dist/cjs/digit-input.js +0 -47
- package/dist/cjs/dropdown-menu-content.js +0 -54
- package/dist/cjs/dropdown-menu-group.js +0 -25
- package/dist/cjs/dropdown-menu-item.js +0 -54
- package/dist/cjs/dropdown-menu-label.js +0 -32
- package/dist/cjs/dropdown-menu-separator.js +0 -26
- package/dist/cjs/dropdown-menu-sub-content.js +0 -51
- package/dist/cjs/dropdown-menu-sub-trigger.js +0 -45
- package/dist/cjs/dropdown-menu-sub.js +0 -3
- package/dist/cjs/dropdown-menu-trigger.js +0 -27
- package/dist/cjs/dropdown-menu.js +0 -36
- package/dist/cjs/extra-settings.js +0 -156
- package/dist/cjs/fancy-button.js +0 -38
- package/dist/cjs/file-upload-area.js +0 -146
- package/dist/cjs/hint-text.js +0 -37
- package/dist/cjs/hue-slider.js +0 -134
- package/dist/cjs/index.js +0 -526
- package/dist/cjs/label.js +0 -59
- package/dist/cjs/link-bubble.js +0 -242
- package/dist/cjs/link-button.js +0 -44
- package/dist/cjs/modal-body.js +0 -23
- package/dist/cjs/modal-close.js +0 -3
- package/dist/cjs/modal-content.js +0 -49
- package/dist/cjs/modal-footer.js +0 -23
- package/dist/cjs/modal-header.js +0 -82
- package/dist/cjs/modal-trigger.js +0 -3
- package/dist/cjs/modal.js +0 -3
- package/dist/cjs/pagination-content.js +0 -31
- package/dist/cjs/pagination-ellipsis.js +0 -35
- package/dist/cjs/pagination-first.js +0 -3
- package/dist/cjs/pagination-item.js +0 -3
- package/dist/cjs/pagination-last.js +0 -3
- package/dist/cjs/pagination-next.js +0 -3
- package/dist/cjs/pagination-previous.js +0 -3
- package/dist/cjs/pagination.js +0 -60
- package/dist/cjs/popover-content.js +0 -106
- package/dist/cjs/popover-trigger.js +0 -25
- package/dist/cjs/popover.js +0 -3
- package/dist/cjs/progress-bar.js +0 -85
- package/dist/cjs/progress-circle.js +0 -93
- package/dist/cjs/radio-group-card.js +0 -111
- package/dist/cjs/radio-group-item.js +0 -4
- package/dist/cjs/radio-group-label.js +0 -110
- package/dist/cjs/radio-group.js +0 -4
- package/dist/cjs/rich-editor.js +0 -430
- package/dist/cjs/scroll-area.js +0 -43
- package/dist/cjs/scroll-bar.js +0 -33
- package/dist/cjs/segmented-control-item.js +0 -40
- package/dist/cjs/segmented-control.js +0 -41
- package/dist/cjs/select-content.js +0 -62
- package/dist/cjs/select-group.js +0 -3
- package/dist/cjs/select-icon.js +0 -25
- package/dist/cjs/select-item.js +0 -45
- package/dist/cjs/select-label.js +0 -32
- package/dist/cjs/select-separator.js +0 -26
- package/dist/cjs/select-trigger.js +0 -41
- package/dist/cjs/select-value.js +0 -32
- package/dist/cjs/select.js +0 -3
- package/dist/cjs/sheet-close.js +0 -29
- package/dist/cjs/sheet-content.js +0 -61
- package/dist/cjs/sheet-description.js +0 -31
- package/dist/cjs/sheet-footer.js +0 -28
- package/dist/cjs/sheet-header.js +0 -23
- package/dist/cjs/sheet-title.js +0 -31
- package/dist/cjs/sheet-trigger.js +0 -3
- package/dist/cjs/sheet.js +0 -3
- package/dist/cjs/shims.js +0 -1
- package/dist/cjs/sidebar-content.js +0 -4
- package/dist/cjs/sidebar-element.js +0 -4
- package/dist/cjs/sidebar-footer.js +0 -4
- package/dist/cjs/sidebar-group-content.js +0 -24
- package/dist/cjs/sidebar-group-label.js +0 -4
- package/dist/cjs/sidebar-group.js +0 -4
- package/dist/cjs/sidebar-header.js +0 -4
- package/dist/cjs/sidebar-menu-action.js +0 -4
- package/dist/cjs/sidebar-menu-badge.js +0 -4
- package/dist/cjs/sidebar-menu-button.js +0 -4
- package/dist/cjs/sidebar-menu-item.js +0 -4
- package/dist/cjs/sidebar-menu-sub-button.js +0 -4
- package/dist/cjs/sidebar-menu-sub-item.js +0 -4
- package/dist/cjs/sidebar-menu-sub.js +0 -4
- package/dist/cjs/sidebar-menu.js +0 -4
- package/dist/cjs/sidebar-provider.js +0 -3
- package/dist/cjs/sidebar-separator.js +0 -3
- package/dist/cjs/sidebar-trigger.js +0 -34
- package/dist/cjs/sidebar.js +0 -4
- package/dist/cjs/slider.js +0 -4
- package/dist/cjs/social-button.js +0 -45
- package/dist/cjs/sonner-alert.js +0 -42
- package/dist/cjs/sonner.js +0 -3
- package/dist/cjs/status-badge.js +0 -50
- package/dist/cjs/switch.js +0 -4
- package/dist/cjs/tab-menu-content.js +0 -33
- package/dist/cjs/tab-menu-item.js +0 -45
- package/dist/cjs/tab-menu-list.js +0 -35
- package/dist/cjs/tab-menu.js +0 -33
- package/dist/cjs/table-body.js +0 -23
- package/dist/cjs/table-caption.js +0 -23
- package/dist/cjs/table-cell.js +0 -26
- package/dist/cjs/table-empty.js +0 -44
- package/dist/cjs/table-footer.js +0 -23
- package/dist/cjs/table-head.js +0 -24
- package/dist/cjs/table-header.js +0 -3
- package/dist/cjs/table-row.js +0 -32
- package/dist/cjs/table.js +0 -26
- package/dist/cjs/tag.js +0 -47
- package/dist/cjs/text-input-affix.js +0 -27
- package/dist/cjs/text-input-button.js +0 -32
- package/dist/cjs/text-input.js +0 -120
- package/dist/cjs/textarea.js +0 -57
- package/dist/cjs/tooltip-content.js +0 -94
- package/dist/cjs/tooltip-provider.js +0 -3
- package/dist/cjs/tooltip-root.js +0 -3
- package/dist/cjs/tooltip-trigger.js +0 -3
- package/dist/cjs/tooltip.js +0 -3
- package/dist/cjs/types.js +0 -1
- package/dist/cjs/use-color-model.js +0 -33
- package/dist/cjs/use-delegated-props.js +0 -14
- package/dist/cjs/use-user-select.js +0 -39
- package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +0 -53
- package/dist/es/chunks/index.js +0 -10864
- package/dist/es/chunks/index2.js +0 -91
- package/dist/es/chunks/index3.js +0 -273
- package/dist/es/chunks/index4.js +0 -1486
- package/dist/es/chunks/index5.js +0 -17163
- package/dist/es/chunks/rich-editor.vue_vue_type_style_index_0_scoped_4e1c9896_lang.js +0 -5273
- package/dist/es/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +0 -64
- package/dist/es/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +0 -138
- package/dist/es/chunks/tinycolor.js +0 -966
|
@@ -1,1486 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index$1 = require("./index.js");
|
|
4
|
-
const index = require("./index5.js");
|
|
5
|
-
const No = require("vue");
|
|
6
|
-
var readFromCache;
|
|
7
|
-
var addToCache;
|
|
8
|
-
if (typeof WeakMap != "undefined") {
|
|
9
|
-
let cache = /* @__PURE__ */ new WeakMap();
|
|
10
|
-
readFromCache = (key) => cache.get(key);
|
|
11
|
-
addToCache = (key, value) => {
|
|
12
|
-
cache.set(key, value);
|
|
13
|
-
return value;
|
|
14
|
-
};
|
|
15
|
-
} else {
|
|
16
|
-
const cache = [];
|
|
17
|
-
const cacheSize = 10;
|
|
18
|
-
let cachePos = 0;
|
|
19
|
-
readFromCache = (key) => {
|
|
20
|
-
for (let i = 0; i < cache.length; i += 2)
|
|
21
|
-
if (cache[i] == key) return cache[i + 1];
|
|
22
|
-
};
|
|
23
|
-
addToCache = (key, value) => {
|
|
24
|
-
if (cachePos == cacheSize) cachePos = 0;
|
|
25
|
-
cache[cachePos++] = key;
|
|
26
|
-
return cache[cachePos++] = value;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
var TableMap = class {
|
|
30
|
-
constructor(width, height, map, problems) {
|
|
31
|
-
this.width = width;
|
|
32
|
-
this.height = height;
|
|
33
|
-
this.map = map;
|
|
34
|
-
this.problems = problems;
|
|
35
|
-
}
|
|
36
|
-
// Find the dimensions of the cell at the given position.
|
|
37
|
-
findCell(pos) {
|
|
38
|
-
for (let i = 0; i < this.map.length; i++) {
|
|
39
|
-
const curPos = this.map[i];
|
|
40
|
-
if (curPos != pos) continue;
|
|
41
|
-
const left = i % this.width;
|
|
42
|
-
const top = i / this.width | 0;
|
|
43
|
-
let right = left + 1;
|
|
44
|
-
let bottom = top + 1;
|
|
45
|
-
for (let j = 1; right < this.width && this.map[i + j] == curPos; j++) {
|
|
46
|
-
right++;
|
|
47
|
-
}
|
|
48
|
-
for (let j = 1; bottom < this.height && this.map[i + this.width * j] == curPos; j++) {
|
|
49
|
-
bottom++;
|
|
50
|
-
}
|
|
51
|
-
return { left, top, right, bottom };
|
|
52
|
-
}
|
|
53
|
-
throw new RangeError(`No cell with offset ${pos} found`);
|
|
54
|
-
}
|
|
55
|
-
// Find the left side of the cell at the given position.
|
|
56
|
-
colCount(pos) {
|
|
57
|
-
for (let i = 0; i < this.map.length; i++) {
|
|
58
|
-
if (this.map[i] == pos) {
|
|
59
|
-
return i % this.width;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
throw new RangeError(`No cell with offset ${pos} found`);
|
|
63
|
-
}
|
|
64
|
-
// Find the next cell in the given direction, starting from the cell
|
|
65
|
-
// at `pos`, if any.
|
|
66
|
-
nextCell(pos, axis, dir) {
|
|
67
|
-
const { left, right, top, bottom } = this.findCell(pos);
|
|
68
|
-
if (axis == "horiz") {
|
|
69
|
-
if (dir < 0 ? left == 0 : right == this.width) return null;
|
|
70
|
-
return this.map[top * this.width + (dir < 0 ? left - 1 : right)];
|
|
71
|
-
} else {
|
|
72
|
-
if (dir < 0 ? top == 0 : bottom == this.height) return null;
|
|
73
|
-
return this.map[left + this.width * (dir < 0 ? top - 1 : bottom)];
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// Get the rectangle spanning the two given cells.
|
|
77
|
-
rectBetween(a, b) {
|
|
78
|
-
const {
|
|
79
|
-
left: leftA,
|
|
80
|
-
right: rightA,
|
|
81
|
-
top: topA,
|
|
82
|
-
bottom: bottomA
|
|
83
|
-
} = this.findCell(a);
|
|
84
|
-
const {
|
|
85
|
-
left: leftB,
|
|
86
|
-
right: rightB,
|
|
87
|
-
top: topB,
|
|
88
|
-
bottom: bottomB
|
|
89
|
-
} = this.findCell(b);
|
|
90
|
-
return {
|
|
91
|
-
left: Math.min(leftA, leftB),
|
|
92
|
-
top: Math.min(topA, topB),
|
|
93
|
-
right: Math.max(rightA, rightB),
|
|
94
|
-
bottom: Math.max(bottomA, bottomB)
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
// Return the position of all cells that have the top left corner in
|
|
98
|
-
// the given rectangle.
|
|
99
|
-
cellsInRect(rect) {
|
|
100
|
-
const result = [];
|
|
101
|
-
const seen = {};
|
|
102
|
-
for (let row = rect.top; row < rect.bottom; row++) {
|
|
103
|
-
for (let col = rect.left; col < rect.right; col++) {
|
|
104
|
-
const index2 = row * this.width + col;
|
|
105
|
-
const pos = this.map[index2];
|
|
106
|
-
if (seen[pos]) continue;
|
|
107
|
-
seen[pos] = true;
|
|
108
|
-
if (col == rect.left && col && this.map[index2 - 1] == pos || row == rect.top && row && this.map[index2 - this.width] == pos) {
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
result.push(pos);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return result;
|
|
115
|
-
}
|
|
116
|
-
// Return the position at which the cell at the given row and column
|
|
117
|
-
// starts, or would start, if a cell started there.
|
|
118
|
-
positionAt(row, col, table) {
|
|
119
|
-
for (let i = 0, rowStart = 0; ; i++) {
|
|
120
|
-
const rowEnd = rowStart + table.child(i).nodeSize;
|
|
121
|
-
if (i == row) {
|
|
122
|
-
let index2 = col + row * this.width;
|
|
123
|
-
const rowEndIndex = (row + 1) * this.width;
|
|
124
|
-
while (index2 < rowEndIndex && this.map[index2] < rowStart) index2++;
|
|
125
|
-
return index2 == rowEndIndex ? rowEnd - 1 : this.map[index2];
|
|
126
|
-
}
|
|
127
|
-
rowStart = rowEnd;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// Find the table map for the given table node.
|
|
131
|
-
static get(table) {
|
|
132
|
-
return readFromCache(table) || addToCache(table, computeMap(table));
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
function computeMap(table) {
|
|
136
|
-
if (table.type.spec.tableRole != "table")
|
|
137
|
-
throw new RangeError("Not a table node: " + table.type.name);
|
|
138
|
-
const width = findWidth(table), height = table.childCount;
|
|
139
|
-
const map = [];
|
|
140
|
-
let mapPos = 0;
|
|
141
|
-
let problems = null;
|
|
142
|
-
const colWidths = [];
|
|
143
|
-
for (let i = 0, e = width * height; i < e; i++) map[i] = 0;
|
|
144
|
-
for (let row = 0, pos = 0; row < height; row++) {
|
|
145
|
-
const rowNode = table.child(row);
|
|
146
|
-
pos++;
|
|
147
|
-
for (let i = 0; ; i++) {
|
|
148
|
-
while (mapPos < map.length && map[mapPos] != 0) mapPos++;
|
|
149
|
-
if (i == rowNode.childCount) break;
|
|
150
|
-
const cellNode = rowNode.child(i);
|
|
151
|
-
const { colspan, rowspan, colwidth } = cellNode.attrs;
|
|
152
|
-
for (let h = 0; h < rowspan; h++) {
|
|
153
|
-
if (h + row >= height) {
|
|
154
|
-
(problems || (problems = [])).push({
|
|
155
|
-
type: "overlong_rowspan",
|
|
156
|
-
pos,
|
|
157
|
-
n: rowspan - h
|
|
158
|
-
});
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
const start = mapPos + h * width;
|
|
162
|
-
for (let w = 0; w < colspan; w++) {
|
|
163
|
-
if (map[start + w] == 0) map[start + w] = pos;
|
|
164
|
-
else
|
|
165
|
-
(problems || (problems = [])).push({
|
|
166
|
-
type: "collision",
|
|
167
|
-
row,
|
|
168
|
-
pos,
|
|
169
|
-
n: colspan - w
|
|
170
|
-
});
|
|
171
|
-
const colW = colwidth && colwidth[w];
|
|
172
|
-
if (colW) {
|
|
173
|
-
const widthIndex = (start + w) % width * 2, prev = colWidths[widthIndex];
|
|
174
|
-
if (prev == null || prev != colW && colWidths[widthIndex + 1] == 1) {
|
|
175
|
-
colWidths[widthIndex] = colW;
|
|
176
|
-
colWidths[widthIndex + 1] = 1;
|
|
177
|
-
} else if (prev == colW) {
|
|
178
|
-
colWidths[widthIndex + 1]++;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
mapPos += colspan;
|
|
184
|
-
pos += cellNode.nodeSize;
|
|
185
|
-
}
|
|
186
|
-
const expectedPos = (row + 1) * width;
|
|
187
|
-
let missing = 0;
|
|
188
|
-
while (mapPos < expectedPos) if (map[mapPos++] == 0) missing++;
|
|
189
|
-
if (missing)
|
|
190
|
-
(problems || (problems = [])).push({ type: "missing", row, n: missing });
|
|
191
|
-
pos++;
|
|
192
|
-
}
|
|
193
|
-
if (width === 0 || height === 0)
|
|
194
|
-
(problems || (problems = [])).push({ type: "zero_sized" });
|
|
195
|
-
const tableMap = new TableMap(width, height, map, problems);
|
|
196
|
-
let badWidths = false;
|
|
197
|
-
for (let i = 0; !badWidths && i < colWidths.length; i += 2)
|
|
198
|
-
if (colWidths[i] != null && colWidths[i + 1] < height) badWidths = true;
|
|
199
|
-
if (badWidths) findBadColWidths(tableMap, colWidths, table);
|
|
200
|
-
return tableMap;
|
|
201
|
-
}
|
|
202
|
-
function findWidth(table) {
|
|
203
|
-
let width = -1;
|
|
204
|
-
let hasRowSpan = false;
|
|
205
|
-
for (let row = 0; row < table.childCount; row++) {
|
|
206
|
-
const rowNode = table.child(row);
|
|
207
|
-
let rowWidth = 0;
|
|
208
|
-
if (hasRowSpan)
|
|
209
|
-
for (let j = 0; j < row; j++) {
|
|
210
|
-
const prevRow = table.child(j);
|
|
211
|
-
for (let i = 0; i < prevRow.childCount; i++) {
|
|
212
|
-
const cell = prevRow.child(i);
|
|
213
|
-
if (j + cell.attrs.rowspan > row) rowWidth += cell.attrs.colspan;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
for (let i = 0; i < rowNode.childCount; i++) {
|
|
217
|
-
const cell = rowNode.child(i);
|
|
218
|
-
rowWidth += cell.attrs.colspan;
|
|
219
|
-
if (cell.attrs.rowspan > 1) hasRowSpan = true;
|
|
220
|
-
}
|
|
221
|
-
if (width == -1) width = rowWidth;
|
|
222
|
-
else if (width != rowWidth) width = Math.max(width, rowWidth);
|
|
223
|
-
}
|
|
224
|
-
return width;
|
|
225
|
-
}
|
|
226
|
-
function findBadColWidths(map, colWidths, table) {
|
|
227
|
-
if (!map.problems) map.problems = [];
|
|
228
|
-
const seen = {};
|
|
229
|
-
for (let i = 0; i < map.map.length; i++) {
|
|
230
|
-
const pos = map.map[i];
|
|
231
|
-
if (seen[pos]) continue;
|
|
232
|
-
seen[pos] = true;
|
|
233
|
-
const node = table.nodeAt(pos);
|
|
234
|
-
if (!node) {
|
|
235
|
-
throw new RangeError(`No cell with offset ${pos} found`);
|
|
236
|
-
}
|
|
237
|
-
let updated = null;
|
|
238
|
-
const attrs = node.attrs;
|
|
239
|
-
for (let j = 0; j < attrs.colspan; j++) {
|
|
240
|
-
const col = (i + j) % map.width;
|
|
241
|
-
const colWidth = colWidths[col * 2];
|
|
242
|
-
if (colWidth != null && (!attrs.colwidth || attrs.colwidth[j] != colWidth))
|
|
243
|
-
(updated || (updated = freshColWidth(attrs)))[j] = colWidth;
|
|
244
|
-
}
|
|
245
|
-
if (updated)
|
|
246
|
-
map.problems.unshift({
|
|
247
|
-
type: "colwidth mismatch",
|
|
248
|
-
pos,
|
|
249
|
-
colwidth: updated
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
function freshColWidth(attrs) {
|
|
254
|
-
if (attrs.colwidth) return attrs.colwidth.slice();
|
|
255
|
-
const result = [];
|
|
256
|
-
for (let i = 0; i < attrs.colspan; i++) result.push(0);
|
|
257
|
-
return result;
|
|
258
|
-
}
|
|
259
|
-
function tableNodeTypes(schema) {
|
|
260
|
-
let result = schema.cached.tableNodeTypes;
|
|
261
|
-
if (!result) {
|
|
262
|
-
result = schema.cached.tableNodeTypes = {};
|
|
263
|
-
for (const name in schema.nodes) {
|
|
264
|
-
const type = schema.nodes[name], role = type.spec.tableRole;
|
|
265
|
-
if (role) result[role] = type;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return result;
|
|
269
|
-
}
|
|
270
|
-
new index.PluginKey("selectingCells");
|
|
271
|
-
function cellAround($pos) {
|
|
272
|
-
for (let d = $pos.depth - 1; d > 0; d--)
|
|
273
|
-
if ($pos.node(d).type.spec.tableRole == "row")
|
|
274
|
-
return $pos.node(0).resolve($pos.before(d + 1));
|
|
275
|
-
return null;
|
|
276
|
-
}
|
|
277
|
-
function isInTable(state) {
|
|
278
|
-
const $head = state.selection.$head;
|
|
279
|
-
for (let d = $head.depth; d > 0; d--)
|
|
280
|
-
if ($head.node(d).type.spec.tableRole == "row") return true;
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
function selectionCell(state) {
|
|
284
|
-
const sel = state.selection;
|
|
285
|
-
if ("$anchorCell" in sel && sel.$anchorCell) {
|
|
286
|
-
return sel.$anchorCell.pos > sel.$headCell.pos ? sel.$anchorCell : sel.$headCell;
|
|
287
|
-
} else if ("node" in sel && sel.node && sel.node.type.spec.tableRole == "cell") {
|
|
288
|
-
return sel.$anchor;
|
|
289
|
-
}
|
|
290
|
-
const $cell = cellAround(sel.$head) || cellNear(sel.$head);
|
|
291
|
-
if ($cell) {
|
|
292
|
-
return $cell;
|
|
293
|
-
}
|
|
294
|
-
throw new RangeError(`No cell found around position ${sel.head}`);
|
|
295
|
-
}
|
|
296
|
-
function cellNear($pos) {
|
|
297
|
-
for (let after = $pos.nodeAfter, pos = $pos.pos; after; after = after.firstChild, pos++) {
|
|
298
|
-
const role = after.type.spec.tableRole;
|
|
299
|
-
if (role == "cell" || role == "header_cell") return $pos.doc.resolve(pos);
|
|
300
|
-
}
|
|
301
|
-
for (let before = $pos.nodeBefore, pos = $pos.pos; before; before = before.lastChild, pos--) {
|
|
302
|
-
const role = before.type.spec.tableRole;
|
|
303
|
-
if (role == "cell" || role == "header_cell")
|
|
304
|
-
return $pos.doc.resolve(pos - before.nodeSize);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
function pointsAtCell($pos) {
|
|
308
|
-
return $pos.parent.type.spec.tableRole == "row" && !!$pos.nodeAfter;
|
|
309
|
-
}
|
|
310
|
-
function inSameTable($cellA, $cellB) {
|
|
311
|
-
return $cellA.depth == $cellB.depth && $cellA.pos >= $cellB.start(-1) && $cellA.pos <= $cellB.end(-1);
|
|
312
|
-
}
|
|
313
|
-
function nextCell($pos, axis, dir) {
|
|
314
|
-
const table = $pos.node(-1);
|
|
315
|
-
const map = TableMap.get(table);
|
|
316
|
-
const tableStart = $pos.start(-1);
|
|
317
|
-
const moved = map.nextCell($pos.pos - tableStart, axis, dir);
|
|
318
|
-
return moved == null ? null : $pos.node(0).resolve(tableStart + moved);
|
|
319
|
-
}
|
|
320
|
-
function removeColSpan(attrs, pos, n = 1) {
|
|
321
|
-
const result = { ...attrs, colspan: attrs.colspan - n };
|
|
322
|
-
if (result.colwidth) {
|
|
323
|
-
result.colwidth = result.colwidth.slice();
|
|
324
|
-
result.colwidth.splice(pos, n);
|
|
325
|
-
if (!result.colwidth.some((w) => w > 0)) result.colwidth = null;
|
|
326
|
-
}
|
|
327
|
-
return result;
|
|
328
|
-
}
|
|
329
|
-
var CellSelection = class _CellSelection extends index.Selection {
|
|
330
|
-
// A table selection is identified by its anchor and head cells. The
|
|
331
|
-
// positions given to this constructor should point _before_ two
|
|
332
|
-
// cells in the same table. They may be the same, to select a single
|
|
333
|
-
// cell.
|
|
334
|
-
constructor($anchorCell, $headCell = $anchorCell) {
|
|
335
|
-
const table = $anchorCell.node(-1);
|
|
336
|
-
const map = TableMap.get(table);
|
|
337
|
-
const tableStart = $anchorCell.start(-1);
|
|
338
|
-
const rect = map.rectBetween(
|
|
339
|
-
$anchorCell.pos - tableStart,
|
|
340
|
-
$headCell.pos - tableStart
|
|
341
|
-
);
|
|
342
|
-
const doc = $anchorCell.node(0);
|
|
343
|
-
const cells = map.cellsInRect(rect).filter((p) => p != $headCell.pos - tableStart);
|
|
344
|
-
cells.unshift($headCell.pos - tableStart);
|
|
345
|
-
const ranges = cells.map((pos) => {
|
|
346
|
-
const cell = table.nodeAt(pos);
|
|
347
|
-
if (!cell) {
|
|
348
|
-
throw RangeError(`No cell with offset ${pos} found`);
|
|
349
|
-
}
|
|
350
|
-
const from = tableStart + pos + 1;
|
|
351
|
-
return new index.SelectionRange(
|
|
352
|
-
doc.resolve(from),
|
|
353
|
-
doc.resolve(from + cell.content.size)
|
|
354
|
-
);
|
|
355
|
-
});
|
|
356
|
-
super(ranges[0].$from, ranges[0].$to, ranges);
|
|
357
|
-
this.$anchorCell = $anchorCell;
|
|
358
|
-
this.$headCell = $headCell;
|
|
359
|
-
}
|
|
360
|
-
map(doc, mapping) {
|
|
361
|
-
const $anchorCell = doc.resolve(mapping.map(this.$anchorCell.pos));
|
|
362
|
-
const $headCell = doc.resolve(mapping.map(this.$headCell.pos));
|
|
363
|
-
if (pointsAtCell($anchorCell) && pointsAtCell($headCell) && inSameTable($anchorCell, $headCell)) {
|
|
364
|
-
const tableChanged = this.$anchorCell.node(-1) != $anchorCell.node(-1);
|
|
365
|
-
if (tableChanged && this.isRowSelection())
|
|
366
|
-
return _CellSelection.rowSelection($anchorCell, $headCell);
|
|
367
|
-
else if (tableChanged && this.isColSelection())
|
|
368
|
-
return _CellSelection.colSelection($anchorCell, $headCell);
|
|
369
|
-
else return new _CellSelection($anchorCell, $headCell);
|
|
370
|
-
}
|
|
371
|
-
return index.TextSelection.between($anchorCell, $headCell);
|
|
372
|
-
}
|
|
373
|
-
// Returns a rectangular slice of table rows containing the selected
|
|
374
|
-
// cells.
|
|
375
|
-
content() {
|
|
376
|
-
const table = this.$anchorCell.node(-1);
|
|
377
|
-
const map = TableMap.get(table);
|
|
378
|
-
const tableStart = this.$anchorCell.start(-1);
|
|
379
|
-
const rect = map.rectBetween(
|
|
380
|
-
this.$anchorCell.pos - tableStart,
|
|
381
|
-
this.$headCell.pos - tableStart
|
|
382
|
-
);
|
|
383
|
-
const seen = {};
|
|
384
|
-
const rows = [];
|
|
385
|
-
for (let row = rect.top; row < rect.bottom; row++) {
|
|
386
|
-
const rowContent = [];
|
|
387
|
-
for (let index2 = row * map.width + rect.left, col = rect.left; col < rect.right; col++, index2++) {
|
|
388
|
-
const pos = map.map[index2];
|
|
389
|
-
if (seen[pos]) continue;
|
|
390
|
-
seen[pos] = true;
|
|
391
|
-
const cellRect = map.findCell(pos);
|
|
392
|
-
let cell = table.nodeAt(pos);
|
|
393
|
-
if (!cell) {
|
|
394
|
-
throw RangeError(`No cell with offset ${pos} found`);
|
|
395
|
-
}
|
|
396
|
-
const extraLeft = rect.left - cellRect.left;
|
|
397
|
-
const extraRight = cellRect.right - rect.right;
|
|
398
|
-
if (extraLeft > 0 || extraRight > 0) {
|
|
399
|
-
let attrs = cell.attrs;
|
|
400
|
-
if (extraLeft > 0) {
|
|
401
|
-
attrs = removeColSpan(attrs, 0, extraLeft);
|
|
402
|
-
}
|
|
403
|
-
if (extraRight > 0) {
|
|
404
|
-
attrs = removeColSpan(
|
|
405
|
-
attrs,
|
|
406
|
-
attrs.colspan - extraRight,
|
|
407
|
-
extraRight
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
if (cellRect.left < rect.left) {
|
|
411
|
-
cell = cell.type.createAndFill(attrs);
|
|
412
|
-
if (!cell) {
|
|
413
|
-
throw RangeError(
|
|
414
|
-
`Could not create cell with attrs ${JSON.stringify(attrs)}`
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
} else {
|
|
418
|
-
cell = cell.type.create(attrs, cell.content);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
if (cellRect.top < rect.top || cellRect.bottom > rect.bottom) {
|
|
422
|
-
const attrs = {
|
|
423
|
-
...cell.attrs,
|
|
424
|
-
rowspan: Math.min(cellRect.bottom, rect.bottom) - Math.max(cellRect.top, rect.top)
|
|
425
|
-
};
|
|
426
|
-
if (cellRect.top < rect.top) {
|
|
427
|
-
cell = cell.type.createAndFill(attrs);
|
|
428
|
-
} else {
|
|
429
|
-
cell = cell.type.create(attrs, cell.content);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
rowContent.push(cell);
|
|
433
|
-
}
|
|
434
|
-
rows.push(table.child(row).copy(index.Fragment.from(rowContent)));
|
|
435
|
-
}
|
|
436
|
-
const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
437
|
-
return new index.Slice(index.Fragment.from(fragment), 1, 1);
|
|
438
|
-
}
|
|
439
|
-
replace(tr, content = index.Slice.empty) {
|
|
440
|
-
const mapFrom = tr.steps.length, ranges = this.ranges;
|
|
441
|
-
for (let i = 0; i < ranges.length; i++) {
|
|
442
|
-
const { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
|
|
443
|
-
tr.replace(
|
|
444
|
-
mapping.map($from.pos),
|
|
445
|
-
mapping.map($to.pos),
|
|
446
|
-
i ? index.Slice.empty : content
|
|
447
|
-
);
|
|
448
|
-
}
|
|
449
|
-
const sel = index.Selection.findFrom(
|
|
450
|
-
tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)),
|
|
451
|
-
-1
|
|
452
|
-
);
|
|
453
|
-
if (sel) tr.setSelection(sel);
|
|
454
|
-
}
|
|
455
|
-
replaceWith(tr, node) {
|
|
456
|
-
this.replace(tr, new index.Slice(index.Fragment.from(node), 0, 0));
|
|
457
|
-
}
|
|
458
|
-
forEachCell(f) {
|
|
459
|
-
const table = this.$anchorCell.node(-1);
|
|
460
|
-
const map = TableMap.get(table);
|
|
461
|
-
const tableStart = this.$anchorCell.start(-1);
|
|
462
|
-
const cells = map.cellsInRect(
|
|
463
|
-
map.rectBetween(
|
|
464
|
-
this.$anchorCell.pos - tableStart,
|
|
465
|
-
this.$headCell.pos - tableStart
|
|
466
|
-
)
|
|
467
|
-
);
|
|
468
|
-
for (let i = 0; i < cells.length; i++) {
|
|
469
|
-
f(table.nodeAt(cells[i]), tableStart + cells[i]);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
// True if this selection goes all the way from the top to the
|
|
473
|
-
// bottom of the table.
|
|
474
|
-
isColSelection() {
|
|
475
|
-
const anchorTop = this.$anchorCell.index(-1);
|
|
476
|
-
const headTop = this.$headCell.index(-1);
|
|
477
|
-
if (Math.min(anchorTop, headTop) > 0) return false;
|
|
478
|
-
const anchorBottom = anchorTop + this.$anchorCell.nodeAfter.attrs.rowspan;
|
|
479
|
-
const headBottom = headTop + this.$headCell.nodeAfter.attrs.rowspan;
|
|
480
|
-
return Math.max(anchorBottom, headBottom) == this.$headCell.node(-1).childCount;
|
|
481
|
-
}
|
|
482
|
-
// Returns the smallest column selection that covers the given anchor
|
|
483
|
-
// and head cell.
|
|
484
|
-
static colSelection($anchorCell, $headCell = $anchorCell) {
|
|
485
|
-
const table = $anchorCell.node(-1);
|
|
486
|
-
const map = TableMap.get(table);
|
|
487
|
-
const tableStart = $anchorCell.start(-1);
|
|
488
|
-
const anchorRect = map.findCell($anchorCell.pos - tableStart);
|
|
489
|
-
const headRect = map.findCell($headCell.pos - tableStart);
|
|
490
|
-
const doc = $anchorCell.node(0);
|
|
491
|
-
if (anchorRect.top <= headRect.top) {
|
|
492
|
-
if (anchorRect.top > 0)
|
|
493
|
-
$anchorCell = doc.resolve(tableStart + map.map[anchorRect.left]);
|
|
494
|
-
if (headRect.bottom < map.height)
|
|
495
|
-
$headCell = doc.resolve(
|
|
496
|
-
tableStart + map.map[map.width * (map.height - 1) + headRect.right - 1]
|
|
497
|
-
);
|
|
498
|
-
} else {
|
|
499
|
-
if (headRect.top > 0)
|
|
500
|
-
$headCell = doc.resolve(tableStart + map.map[headRect.left]);
|
|
501
|
-
if (anchorRect.bottom < map.height)
|
|
502
|
-
$anchorCell = doc.resolve(
|
|
503
|
-
tableStart + map.map[map.width * (map.height - 1) + anchorRect.right - 1]
|
|
504
|
-
);
|
|
505
|
-
}
|
|
506
|
-
return new _CellSelection($anchorCell, $headCell);
|
|
507
|
-
}
|
|
508
|
-
// True if this selection goes all the way from the left to the
|
|
509
|
-
// right of the table.
|
|
510
|
-
isRowSelection() {
|
|
511
|
-
const table = this.$anchorCell.node(-1);
|
|
512
|
-
const map = TableMap.get(table);
|
|
513
|
-
const tableStart = this.$anchorCell.start(-1);
|
|
514
|
-
const anchorLeft = map.colCount(this.$anchorCell.pos - tableStart);
|
|
515
|
-
const headLeft = map.colCount(this.$headCell.pos - tableStart);
|
|
516
|
-
if (Math.min(anchorLeft, headLeft) > 0) return false;
|
|
517
|
-
const anchorRight = anchorLeft + this.$anchorCell.nodeAfter.attrs.colspan;
|
|
518
|
-
const headRight = headLeft + this.$headCell.nodeAfter.attrs.colspan;
|
|
519
|
-
return Math.max(anchorRight, headRight) == map.width;
|
|
520
|
-
}
|
|
521
|
-
eq(other) {
|
|
522
|
-
return other instanceof _CellSelection && other.$anchorCell.pos == this.$anchorCell.pos && other.$headCell.pos == this.$headCell.pos;
|
|
523
|
-
}
|
|
524
|
-
// Returns the smallest row selection that covers the given anchor
|
|
525
|
-
// and head cell.
|
|
526
|
-
static rowSelection($anchorCell, $headCell = $anchorCell) {
|
|
527
|
-
const table = $anchorCell.node(-1);
|
|
528
|
-
const map = TableMap.get(table);
|
|
529
|
-
const tableStart = $anchorCell.start(-1);
|
|
530
|
-
const anchorRect = map.findCell($anchorCell.pos - tableStart);
|
|
531
|
-
const headRect = map.findCell($headCell.pos - tableStart);
|
|
532
|
-
const doc = $anchorCell.node(0);
|
|
533
|
-
if (anchorRect.left <= headRect.left) {
|
|
534
|
-
if (anchorRect.left > 0)
|
|
535
|
-
$anchorCell = doc.resolve(
|
|
536
|
-
tableStart + map.map[anchorRect.top * map.width]
|
|
537
|
-
);
|
|
538
|
-
if (headRect.right < map.width)
|
|
539
|
-
$headCell = doc.resolve(
|
|
540
|
-
tableStart + map.map[map.width * (headRect.top + 1) - 1]
|
|
541
|
-
);
|
|
542
|
-
} else {
|
|
543
|
-
if (headRect.left > 0)
|
|
544
|
-
$headCell = doc.resolve(tableStart + map.map[headRect.top * map.width]);
|
|
545
|
-
if (anchorRect.right < map.width)
|
|
546
|
-
$anchorCell = doc.resolve(
|
|
547
|
-
tableStart + map.map[map.width * (anchorRect.top + 1) - 1]
|
|
548
|
-
);
|
|
549
|
-
}
|
|
550
|
-
return new _CellSelection($anchorCell, $headCell);
|
|
551
|
-
}
|
|
552
|
-
toJSON() {
|
|
553
|
-
return {
|
|
554
|
-
type: "cell",
|
|
555
|
-
anchor: this.$anchorCell.pos,
|
|
556
|
-
head: this.$headCell.pos
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
static fromJSON(doc, json) {
|
|
560
|
-
return new _CellSelection(doc.resolve(json.anchor), doc.resolve(json.head));
|
|
561
|
-
}
|
|
562
|
-
static create(doc, anchorCell, headCell = anchorCell) {
|
|
563
|
-
return new _CellSelection(doc.resolve(anchorCell), doc.resolve(headCell));
|
|
564
|
-
}
|
|
565
|
-
getBookmark() {
|
|
566
|
-
return new CellBookmark(this.$anchorCell.pos, this.$headCell.pos);
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
CellSelection.prototype.visible = false;
|
|
570
|
-
index.Selection.jsonID("cell", CellSelection);
|
|
571
|
-
var CellBookmark = class _CellBookmark {
|
|
572
|
-
constructor(anchor, head) {
|
|
573
|
-
this.anchor = anchor;
|
|
574
|
-
this.head = head;
|
|
575
|
-
}
|
|
576
|
-
map(mapping) {
|
|
577
|
-
return new _CellBookmark(mapping.map(this.anchor), mapping.map(this.head));
|
|
578
|
-
}
|
|
579
|
-
resolve(doc) {
|
|
580
|
-
const $anchorCell = doc.resolve(this.anchor), $headCell = doc.resolve(this.head);
|
|
581
|
-
if ($anchorCell.parent.type.spec.tableRole == "row" && $headCell.parent.type.spec.tableRole == "row" && $anchorCell.index() < $anchorCell.parent.childCount && $headCell.index() < $headCell.parent.childCount && inSameTable($anchorCell, $headCell))
|
|
582
|
-
return new CellSelection($anchorCell, $headCell);
|
|
583
|
-
else return index.Selection.near($headCell, 1);
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
new index.PluginKey("fix-tables");
|
|
587
|
-
function selectedRect(state) {
|
|
588
|
-
const sel = state.selection;
|
|
589
|
-
const $pos = selectionCell(state);
|
|
590
|
-
const table = $pos.node(-1);
|
|
591
|
-
const tableStart = $pos.start(-1);
|
|
592
|
-
const map = TableMap.get(table);
|
|
593
|
-
const rect = sel instanceof CellSelection ? map.rectBetween(
|
|
594
|
-
sel.$anchorCell.pos - tableStart,
|
|
595
|
-
sel.$headCell.pos - tableStart
|
|
596
|
-
) : map.findCell($pos.pos - tableStart);
|
|
597
|
-
return { ...rect, tableStart, map, table };
|
|
598
|
-
}
|
|
599
|
-
function deprecated_toggleHeader(type) {
|
|
600
|
-
return function(state, dispatch) {
|
|
601
|
-
if (!isInTable(state)) return false;
|
|
602
|
-
if (dispatch) {
|
|
603
|
-
const types = tableNodeTypes(state.schema);
|
|
604
|
-
const rect = selectedRect(state), tr = state.tr;
|
|
605
|
-
const cells = rect.map.cellsInRect(
|
|
606
|
-
type == "column" ? {
|
|
607
|
-
left: rect.left,
|
|
608
|
-
top: 0,
|
|
609
|
-
right: rect.right,
|
|
610
|
-
bottom: rect.map.height
|
|
611
|
-
} : type == "row" ? {
|
|
612
|
-
left: 0,
|
|
613
|
-
top: rect.top,
|
|
614
|
-
right: rect.map.width,
|
|
615
|
-
bottom: rect.bottom
|
|
616
|
-
} : rect
|
|
617
|
-
);
|
|
618
|
-
const nodes = cells.map((pos) => rect.table.nodeAt(pos));
|
|
619
|
-
for (let i = 0; i < cells.length; i++)
|
|
620
|
-
if (nodes[i].type == types.header_cell)
|
|
621
|
-
tr.setNodeMarkup(
|
|
622
|
-
rect.tableStart + cells[i],
|
|
623
|
-
types.cell,
|
|
624
|
-
nodes[i].attrs
|
|
625
|
-
);
|
|
626
|
-
if (tr.steps.length == 0)
|
|
627
|
-
for (let i = 0; i < cells.length; i++)
|
|
628
|
-
tr.setNodeMarkup(
|
|
629
|
-
rect.tableStart + cells[i],
|
|
630
|
-
types.header_cell,
|
|
631
|
-
nodes[i].attrs
|
|
632
|
-
);
|
|
633
|
-
dispatch(tr);
|
|
634
|
-
}
|
|
635
|
-
return true;
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
function isHeaderEnabledByType(type, rect, types) {
|
|
639
|
-
const cellPositions = rect.map.cellsInRect({
|
|
640
|
-
left: 0,
|
|
641
|
-
top: 0,
|
|
642
|
-
right: type == "row" ? rect.map.width : 1,
|
|
643
|
-
bottom: type == "column" ? rect.map.height : 1
|
|
644
|
-
});
|
|
645
|
-
for (let i = 0; i < cellPositions.length; i++) {
|
|
646
|
-
const cell = rect.table.nodeAt(cellPositions[i]);
|
|
647
|
-
if (cell && cell.type !== types.header_cell) {
|
|
648
|
-
return false;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
return true;
|
|
652
|
-
}
|
|
653
|
-
function toggleHeader(type, options) {
|
|
654
|
-
options = options || { useDeprecatedLogic: false };
|
|
655
|
-
if (options.useDeprecatedLogic) return deprecated_toggleHeader(type);
|
|
656
|
-
return function(state, dispatch) {
|
|
657
|
-
if (!isInTable(state)) return false;
|
|
658
|
-
if (dispatch) {
|
|
659
|
-
const types = tableNodeTypes(state.schema);
|
|
660
|
-
const rect = selectedRect(state), tr = state.tr;
|
|
661
|
-
const isHeaderRowEnabled = isHeaderEnabledByType("row", rect, types);
|
|
662
|
-
const isHeaderColumnEnabled = isHeaderEnabledByType(
|
|
663
|
-
"column",
|
|
664
|
-
rect,
|
|
665
|
-
types
|
|
666
|
-
);
|
|
667
|
-
const isHeaderEnabled = type === "column" ? isHeaderRowEnabled : type === "row" ? isHeaderColumnEnabled : false;
|
|
668
|
-
const selectionStartsAt = isHeaderEnabled ? 1 : 0;
|
|
669
|
-
const cellsRect = type == "column" ? {
|
|
670
|
-
left: 0,
|
|
671
|
-
top: selectionStartsAt,
|
|
672
|
-
right: 1,
|
|
673
|
-
bottom: rect.map.height
|
|
674
|
-
} : type == "row" ? {
|
|
675
|
-
left: selectionStartsAt,
|
|
676
|
-
top: 0,
|
|
677
|
-
right: rect.map.width,
|
|
678
|
-
bottom: 1
|
|
679
|
-
} : rect;
|
|
680
|
-
const newType = type == "column" ? isHeaderColumnEnabled ? types.cell : types.header_cell : type == "row" ? isHeaderRowEnabled ? types.cell : types.header_cell : types.cell;
|
|
681
|
-
rect.map.cellsInRect(cellsRect).forEach((relativeCellPos) => {
|
|
682
|
-
const cellPos = relativeCellPos + rect.tableStart;
|
|
683
|
-
const cell = tr.doc.nodeAt(cellPos);
|
|
684
|
-
if (cell) {
|
|
685
|
-
tr.setNodeMarkup(cellPos, newType, cell.attrs);
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
dispatch(tr);
|
|
689
|
-
}
|
|
690
|
-
return true;
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
toggleHeader("row", {
|
|
694
|
-
useDeprecatedLogic: true
|
|
695
|
-
});
|
|
696
|
-
toggleHeader("column", {
|
|
697
|
-
useDeprecatedLogic: true
|
|
698
|
-
});
|
|
699
|
-
toggleHeader("cell", {
|
|
700
|
-
useDeprecatedLogic: true
|
|
701
|
-
});
|
|
702
|
-
function deleteCellSelection(state, dispatch) {
|
|
703
|
-
const sel = state.selection;
|
|
704
|
-
if (!(sel instanceof CellSelection)) return false;
|
|
705
|
-
if (dispatch) {
|
|
706
|
-
const tr = state.tr;
|
|
707
|
-
const baseContent = tableNodeTypes(state.schema).cell.createAndFill().content;
|
|
708
|
-
sel.forEachCell((cell, pos) => {
|
|
709
|
-
if (!cell.content.eq(baseContent))
|
|
710
|
-
tr.replace(
|
|
711
|
-
tr.mapping.map(pos + 1),
|
|
712
|
-
tr.mapping.map(pos + cell.nodeSize - 1),
|
|
713
|
-
new index.Slice(baseContent, 0, 0)
|
|
714
|
-
);
|
|
715
|
-
});
|
|
716
|
-
if (tr.docChanged) dispatch(tr);
|
|
717
|
-
}
|
|
718
|
-
return true;
|
|
719
|
-
}
|
|
720
|
-
index.keydownHandler({
|
|
721
|
-
ArrowLeft: arrow("horiz", -1),
|
|
722
|
-
ArrowRight: arrow("horiz", 1),
|
|
723
|
-
ArrowUp: arrow("vert", -1),
|
|
724
|
-
ArrowDown: arrow("vert", 1),
|
|
725
|
-
"Shift-ArrowLeft": shiftArrow("horiz", -1),
|
|
726
|
-
"Shift-ArrowRight": shiftArrow("horiz", 1),
|
|
727
|
-
"Shift-ArrowUp": shiftArrow("vert", -1),
|
|
728
|
-
"Shift-ArrowDown": shiftArrow("vert", 1),
|
|
729
|
-
Backspace: deleteCellSelection,
|
|
730
|
-
"Mod-Backspace": deleteCellSelection,
|
|
731
|
-
Delete: deleteCellSelection,
|
|
732
|
-
"Mod-Delete": deleteCellSelection
|
|
733
|
-
});
|
|
734
|
-
function maybeSetSelection(state, dispatch, selection) {
|
|
735
|
-
if (selection.eq(state.selection)) return false;
|
|
736
|
-
if (dispatch) dispatch(state.tr.setSelection(selection).scrollIntoView());
|
|
737
|
-
return true;
|
|
738
|
-
}
|
|
739
|
-
function arrow(axis, dir) {
|
|
740
|
-
return (state, dispatch, view) => {
|
|
741
|
-
if (!view) return false;
|
|
742
|
-
const sel = state.selection;
|
|
743
|
-
if (sel instanceof CellSelection) {
|
|
744
|
-
return maybeSetSelection(
|
|
745
|
-
state,
|
|
746
|
-
dispatch,
|
|
747
|
-
index.Selection.near(sel.$headCell, dir)
|
|
748
|
-
);
|
|
749
|
-
}
|
|
750
|
-
if (axis != "horiz" && !sel.empty) return false;
|
|
751
|
-
const end = atEndOfCell(view, axis, dir);
|
|
752
|
-
if (end == null) return false;
|
|
753
|
-
if (axis == "horiz") {
|
|
754
|
-
return maybeSetSelection(
|
|
755
|
-
state,
|
|
756
|
-
dispatch,
|
|
757
|
-
index.Selection.near(state.doc.resolve(sel.head + dir), dir)
|
|
758
|
-
);
|
|
759
|
-
} else {
|
|
760
|
-
const $cell = state.doc.resolve(end);
|
|
761
|
-
const $next = nextCell($cell, axis, dir);
|
|
762
|
-
let newSel;
|
|
763
|
-
if ($next) newSel = index.Selection.near($next, 1);
|
|
764
|
-
else if (dir < 0)
|
|
765
|
-
newSel = index.Selection.near(state.doc.resolve($cell.before(-1)), -1);
|
|
766
|
-
else newSel = index.Selection.near(state.doc.resolve($cell.after(-1)), 1);
|
|
767
|
-
return maybeSetSelection(state, dispatch, newSel);
|
|
768
|
-
}
|
|
769
|
-
};
|
|
770
|
-
}
|
|
771
|
-
function shiftArrow(axis, dir) {
|
|
772
|
-
return (state, dispatch, view) => {
|
|
773
|
-
if (!view) return false;
|
|
774
|
-
const sel = state.selection;
|
|
775
|
-
let cellSel;
|
|
776
|
-
if (sel instanceof CellSelection) {
|
|
777
|
-
cellSel = sel;
|
|
778
|
-
} else {
|
|
779
|
-
const end = atEndOfCell(view, axis, dir);
|
|
780
|
-
if (end == null) return false;
|
|
781
|
-
cellSel = new CellSelection(state.doc.resolve(end));
|
|
782
|
-
}
|
|
783
|
-
const $head = nextCell(cellSel.$headCell, axis, dir);
|
|
784
|
-
if (!$head) return false;
|
|
785
|
-
return maybeSetSelection(
|
|
786
|
-
state,
|
|
787
|
-
dispatch,
|
|
788
|
-
new CellSelection(cellSel.$anchorCell, $head)
|
|
789
|
-
);
|
|
790
|
-
};
|
|
791
|
-
}
|
|
792
|
-
function atEndOfCell(view, axis, dir) {
|
|
793
|
-
if (!(view.state.selection instanceof index.TextSelection)) return null;
|
|
794
|
-
const { $head } = view.state.selection;
|
|
795
|
-
for (let d = $head.depth - 1; d >= 0; d--) {
|
|
796
|
-
const parent = $head.node(d), index2 = dir < 0 ? $head.index(d) : $head.indexAfter(d);
|
|
797
|
-
if (index2 != (dir < 0 ? 0 : parent.childCount)) return null;
|
|
798
|
-
if (parent.type.spec.tableRole == "cell" || parent.type.spec.tableRole == "header_cell") {
|
|
799
|
-
const cellPos = $head.before(d);
|
|
800
|
-
const dirStr = axis == "vert" ? dir > 0 ? "down" : "up" : dir > 0 ? "right" : "left";
|
|
801
|
-
return view.endOfTextblock(dirStr) ? cellPos : null;
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
return null;
|
|
805
|
-
}
|
|
806
|
-
new index.PluginKey(
|
|
807
|
-
"tableColumnResizing"
|
|
808
|
-
);
|
|
809
|
-
function combineDOMRects(rect1, rect2) {
|
|
810
|
-
const top = Math.min(rect1.top, rect2.top);
|
|
811
|
-
const bottom = Math.max(rect1.bottom, rect2.bottom);
|
|
812
|
-
const left = Math.min(rect1.left, rect2.left);
|
|
813
|
-
const right = Math.max(rect1.right, rect2.right);
|
|
814
|
-
const width = right - left;
|
|
815
|
-
const height = bottom - top;
|
|
816
|
-
const x = left;
|
|
817
|
-
const y = top;
|
|
818
|
-
return new DOMRect(x, y, width, height);
|
|
819
|
-
}
|
|
820
|
-
var BubbleMenuView = class {
|
|
821
|
-
constructor({
|
|
822
|
-
editor,
|
|
823
|
-
element,
|
|
824
|
-
view,
|
|
825
|
-
updateDelay = 250,
|
|
826
|
-
resizeDelay = 60,
|
|
827
|
-
shouldShow,
|
|
828
|
-
appendTo,
|
|
829
|
-
getReferencedVirtualElement,
|
|
830
|
-
options
|
|
831
|
-
}) {
|
|
832
|
-
this.preventHide = false;
|
|
833
|
-
this.isVisible = false;
|
|
834
|
-
this.scrollTarget = window;
|
|
835
|
-
this.floatingUIOptions = {
|
|
836
|
-
strategy: "absolute",
|
|
837
|
-
placement: "top",
|
|
838
|
-
offset: 8,
|
|
839
|
-
flip: {},
|
|
840
|
-
shift: {},
|
|
841
|
-
arrow: false,
|
|
842
|
-
size: false,
|
|
843
|
-
autoPlacement: false,
|
|
844
|
-
hide: false,
|
|
845
|
-
inline: false,
|
|
846
|
-
onShow: void 0,
|
|
847
|
-
onHide: void 0,
|
|
848
|
-
onUpdate: void 0,
|
|
849
|
-
onDestroy: void 0
|
|
850
|
-
};
|
|
851
|
-
this.shouldShow = ({ view: view2, state, from, to }) => {
|
|
852
|
-
const { doc, selection } = state;
|
|
853
|
-
const { empty } = selection;
|
|
854
|
-
const isEmptyTextBlock = !doc.textBetween(from, to).length && index.isTextSelection(state.selection);
|
|
855
|
-
const isChildOfMenu = this.element.contains(document.activeElement);
|
|
856
|
-
const hasEditorFocus = view2.hasFocus() || isChildOfMenu;
|
|
857
|
-
if (!hasEditorFocus || empty || isEmptyTextBlock || !this.editor.isEditable) {
|
|
858
|
-
return false;
|
|
859
|
-
}
|
|
860
|
-
return true;
|
|
861
|
-
};
|
|
862
|
-
this.mousedownHandler = () => {
|
|
863
|
-
this.preventHide = true;
|
|
864
|
-
};
|
|
865
|
-
this.dragstartHandler = () => {
|
|
866
|
-
this.hide();
|
|
867
|
-
};
|
|
868
|
-
this.resizeHandler = () => {
|
|
869
|
-
if (this.resizeDebounceTimer) {
|
|
870
|
-
clearTimeout(this.resizeDebounceTimer);
|
|
871
|
-
}
|
|
872
|
-
this.resizeDebounceTimer = window.setTimeout(() => {
|
|
873
|
-
this.updatePosition();
|
|
874
|
-
}, this.resizeDelay);
|
|
875
|
-
};
|
|
876
|
-
this.focusHandler = () => {
|
|
877
|
-
setTimeout(() => this.update(this.editor.view));
|
|
878
|
-
};
|
|
879
|
-
this.blurHandler = ({ event }) => {
|
|
880
|
-
var _a2;
|
|
881
|
-
if (this.editor.isDestroyed) {
|
|
882
|
-
this.destroy();
|
|
883
|
-
return;
|
|
884
|
-
}
|
|
885
|
-
if (this.preventHide) {
|
|
886
|
-
this.preventHide = false;
|
|
887
|
-
return;
|
|
888
|
-
}
|
|
889
|
-
if ((event == null ? void 0 : event.relatedTarget) && ((_a2 = this.element.parentNode) == null ? void 0 : _a2.contains(event.relatedTarget))) {
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
|
|
893
|
-
return;
|
|
894
|
-
}
|
|
895
|
-
this.hide();
|
|
896
|
-
};
|
|
897
|
-
this.handleDebouncedUpdate = (view2, oldState) => {
|
|
898
|
-
const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view2.state.selection));
|
|
899
|
-
const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view2.state.doc));
|
|
900
|
-
if (!selectionChanged && !docChanged) {
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
if (this.updateDebounceTimer) {
|
|
904
|
-
clearTimeout(this.updateDebounceTimer);
|
|
905
|
-
}
|
|
906
|
-
this.updateDebounceTimer = window.setTimeout(() => {
|
|
907
|
-
this.updateHandler(view2, selectionChanged, docChanged, oldState);
|
|
908
|
-
}, this.updateDelay);
|
|
909
|
-
};
|
|
910
|
-
this.updateHandler = (view2, selectionChanged, docChanged, oldState) => {
|
|
911
|
-
const { composing } = view2;
|
|
912
|
-
const isSame = !selectionChanged && !docChanged;
|
|
913
|
-
if (composing || isSame) {
|
|
914
|
-
return;
|
|
915
|
-
}
|
|
916
|
-
const shouldShow2 = this.getShouldShow(oldState);
|
|
917
|
-
if (!shouldShow2) {
|
|
918
|
-
this.hide();
|
|
919
|
-
return;
|
|
920
|
-
}
|
|
921
|
-
this.updatePosition();
|
|
922
|
-
this.show();
|
|
923
|
-
};
|
|
924
|
-
this.transactionHandler = ({ transaction: tr }) => {
|
|
925
|
-
const meta = tr.getMeta("bubbleMenu");
|
|
926
|
-
if (meta === "updatePosition") {
|
|
927
|
-
this.updatePosition();
|
|
928
|
-
}
|
|
929
|
-
};
|
|
930
|
-
var _a;
|
|
931
|
-
this.editor = editor;
|
|
932
|
-
this.element = element;
|
|
933
|
-
this.view = view;
|
|
934
|
-
this.updateDelay = updateDelay;
|
|
935
|
-
this.resizeDelay = resizeDelay;
|
|
936
|
-
this.appendTo = appendTo;
|
|
937
|
-
this.scrollTarget = (_a = options == null ? void 0 : options.scrollTarget) != null ? _a : window;
|
|
938
|
-
this.getReferencedVirtualElement = getReferencedVirtualElement;
|
|
939
|
-
this.floatingUIOptions = {
|
|
940
|
-
...this.floatingUIOptions,
|
|
941
|
-
...options
|
|
942
|
-
};
|
|
943
|
-
this.element.tabIndex = 0;
|
|
944
|
-
if (shouldShow) {
|
|
945
|
-
this.shouldShow = shouldShow;
|
|
946
|
-
}
|
|
947
|
-
this.element.addEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
948
|
-
this.view.dom.addEventListener("dragstart", this.dragstartHandler);
|
|
949
|
-
this.editor.on("focus", this.focusHandler);
|
|
950
|
-
this.editor.on("blur", this.blurHandler);
|
|
951
|
-
this.editor.on("transaction", this.transactionHandler);
|
|
952
|
-
window.addEventListener("resize", this.resizeHandler);
|
|
953
|
-
this.scrollTarget.addEventListener("scroll", this.resizeHandler);
|
|
954
|
-
this.update(view, view.state);
|
|
955
|
-
if (this.getShouldShow()) {
|
|
956
|
-
this.show();
|
|
957
|
-
this.updatePosition();
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
get middlewares() {
|
|
961
|
-
const middlewares = [];
|
|
962
|
-
if (this.floatingUIOptions.flip) {
|
|
963
|
-
middlewares.push(index$1.flip(typeof this.floatingUIOptions.flip !== "boolean" ? this.floatingUIOptions.flip : void 0));
|
|
964
|
-
}
|
|
965
|
-
if (this.floatingUIOptions.shift) {
|
|
966
|
-
middlewares.push(
|
|
967
|
-
index$1.shift(typeof this.floatingUIOptions.shift !== "boolean" ? this.floatingUIOptions.shift : void 0)
|
|
968
|
-
);
|
|
969
|
-
}
|
|
970
|
-
if (this.floatingUIOptions.offset) {
|
|
971
|
-
middlewares.push(
|
|
972
|
-
index$1.offset(typeof this.floatingUIOptions.offset !== "boolean" ? this.floatingUIOptions.offset : void 0)
|
|
973
|
-
);
|
|
974
|
-
}
|
|
975
|
-
if (this.floatingUIOptions.arrow) {
|
|
976
|
-
middlewares.push(index$1.arrow(this.floatingUIOptions.arrow));
|
|
977
|
-
}
|
|
978
|
-
if (this.floatingUIOptions.size) {
|
|
979
|
-
middlewares.push(index$1.size(typeof this.floatingUIOptions.size !== "boolean" ? this.floatingUIOptions.size : void 0));
|
|
980
|
-
}
|
|
981
|
-
if (this.floatingUIOptions.autoPlacement) {
|
|
982
|
-
middlewares.push(
|
|
983
|
-
index$1.autoPlacement(
|
|
984
|
-
typeof this.floatingUIOptions.autoPlacement !== "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
985
|
-
)
|
|
986
|
-
);
|
|
987
|
-
}
|
|
988
|
-
if (this.floatingUIOptions.hide) {
|
|
989
|
-
middlewares.push(index$1.hide(typeof this.floatingUIOptions.hide !== "boolean" ? this.floatingUIOptions.hide : void 0));
|
|
990
|
-
}
|
|
991
|
-
if (this.floatingUIOptions.inline) {
|
|
992
|
-
middlewares.push(
|
|
993
|
-
index$1.inline(typeof this.floatingUIOptions.inline !== "boolean" ? this.floatingUIOptions.inline : void 0)
|
|
994
|
-
);
|
|
995
|
-
}
|
|
996
|
-
return middlewares;
|
|
997
|
-
}
|
|
998
|
-
get virtualElement() {
|
|
999
|
-
var _a;
|
|
1000
|
-
const { selection } = this.editor.state;
|
|
1001
|
-
const referencedVirtualElement = (_a = this.getReferencedVirtualElement) == null ? void 0 : _a.call(this);
|
|
1002
|
-
if (referencedVirtualElement) {
|
|
1003
|
-
return referencedVirtualElement;
|
|
1004
|
-
}
|
|
1005
|
-
const domRect = index.posToDOMRect(this.view, selection.from, selection.to);
|
|
1006
|
-
let virtualElement = {
|
|
1007
|
-
getBoundingClientRect: () => domRect,
|
|
1008
|
-
getClientRects: () => [domRect]
|
|
1009
|
-
};
|
|
1010
|
-
if (selection instanceof index.NodeSelection) {
|
|
1011
|
-
let node = this.view.nodeDOM(selection.from);
|
|
1012
|
-
const nodeViewWrapper = node.dataset.nodeViewWrapper ? node : node.querySelector("[data-node-view-wrapper]");
|
|
1013
|
-
if (nodeViewWrapper) {
|
|
1014
|
-
node = nodeViewWrapper;
|
|
1015
|
-
}
|
|
1016
|
-
if (node) {
|
|
1017
|
-
virtualElement = {
|
|
1018
|
-
getBoundingClientRect: () => node.getBoundingClientRect(),
|
|
1019
|
-
getClientRects: () => [node.getBoundingClientRect()]
|
|
1020
|
-
};
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
if (selection instanceof CellSelection) {
|
|
1024
|
-
const { $anchorCell, $headCell } = selection;
|
|
1025
|
-
const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
|
|
1026
|
-
const to = $headCell ? $headCell.pos : $anchorCell.pos;
|
|
1027
|
-
const fromDOM = this.view.nodeDOM(from);
|
|
1028
|
-
const toDOM = this.view.nodeDOM(to);
|
|
1029
|
-
if (!fromDOM || !toDOM) {
|
|
1030
|
-
return;
|
|
1031
|
-
}
|
|
1032
|
-
const clientRect = fromDOM === toDOM ? fromDOM.getBoundingClientRect() : combineDOMRects(
|
|
1033
|
-
fromDOM.getBoundingClientRect(),
|
|
1034
|
-
toDOM.getBoundingClientRect()
|
|
1035
|
-
);
|
|
1036
|
-
virtualElement = {
|
|
1037
|
-
getBoundingClientRect: () => clientRect,
|
|
1038
|
-
getClientRects: () => [clientRect]
|
|
1039
|
-
};
|
|
1040
|
-
}
|
|
1041
|
-
return virtualElement;
|
|
1042
|
-
}
|
|
1043
|
-
updatePosition() {
|
|
1044
|
-
const virtualElement = this.virtualElement;
|
|
1045
|
-
if (!virtualElement) {
|
|
1046
|
-
return;
|
|
1047
|
-
}
|
|
1048
|
-
index$1.computePosition(virtualElement, this.element, {
|
|
1049
|
-
placement: this.floatingUIOptions.placement,
|
|
1050
|
-
strategy: this.floatingUIOptions.strategy,
|
|
1051
|
-
middleware: this.middlewares
|
|
1052
|
-
}).then(({ x, y, strategy }) => {
|
|
1053
|
-
this.element.style.width = "max-content";
|
|
1054
|
-
this.element.style.position = strategy;
|
|
1055
|
-
this.element.style.left = `${x}px`;
|
|
1056
|
-
this.element.style.top = `${y}px`;
|
|
1057
|
-
if (this.isVisible && this.floatingUIOptions.onUpdate) {
|
|
1058
|
-
this.floatingUIOptions.onUpdate();
|
|
1059
|
-
}
|
|
1060
|
-
});
|
|
1061
|
-
}
|
|
1062
|
-
update(view, oldState) {
|
|
1063
|
-
const { state } = view;
|
|
1064
|
-
const hasValidSelection = state.selection.from !== state.selection.to;
|
|
1065
|
-
if (this.updateDelay > 0 && hasValidSelection) {
|
|
1066
|
-
this.handleDebouncedUpdate(view, oldState);
|
|
1067
|
-
return;
|
|
1068
|
-
}
|
|
1069
|
-
const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view.state.selection));
|
|
1070
|
-
const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view.state.doc));
|
|
1071
|
-
this.updateHandler(view, selectionChanged, docChanged, oldState);
|
|
1072
|
-
}
|
|
1073
|
-
getShouldShow(oldState) {
|
|
1074
|
-
var _a;
|
|
1075
|
-
const { state } = this.view;
|
|
1076
|
-
const { selection } = state;
|
|
1077
|
-
const { ranges } = selection;
|
|
1078
|
-
const from = Math.min(...ranges.map((range) => range.$from.pos));
|
|
1079
|
-
const to = Math.max(...ranges.map((range) => range.$to.pos));
|
|
1080
|
-
const shouldShow = (_a = this.shouldShow) == null ? void 0 : _a.call(this, {
|
|
1081
|
-
editor: this.editor,
|
|
1082
|
-
element: this.element,
|
|
1083
|
-
view: this.view,
|
|
1084
|
-
state,
|
|
1085
|
-
oldState,
|
|
1086
|
-
from,
|
|
1087
|
-
to
|
|
1088
|
-
});
|
|
1089
|
-
return shouldShow || false;
|
|
1090
|
-
}
|
|
1091
|
-
show() {
|
|
1092
|
-
var _a;
|
|
1093
|
-
if (this.isVisible) {
|
|
1094
|
-
return;
|
|
1095
|
-
}
|
|
1096
|
-
this.element.style.visibility = "visible";
|
|
1097
|
-
this.element.style.opacity = "1";
|
|
1098
|
-
const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
|
|
1099
|
-
(_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
|
|
1100
|
-
if (this.floatingUIOptions.onShow) {
|
|
1101
|
-
this.floatingUIOptions.onShow();
|
|
1102
|
-
}
|
|
1103
|
-
this.isVisible = true;
|
|
1104
|
-
}
|
|
1105
|
-
hide() {
|
|
1106
|
-
if (!this.isVisible) {
|
|
1107
|
-
return;
|
|
1108
|
-
}
|
|
1109
|
-
this.element.style.visibility = "hidden";
|
|
1110
|
-
this.element.style.opacity = "0";
|
|
1111
|
-
this.element.remove();
|
|
1112
|
-
if (this.floatingUIOptions.onHide) {
|
|
1113
|
-
this.floatingUIOptions.onHide();
|
|
1114
|
-
}
|
|
1115
|
-
this.isVisible = false;
|
|
1116
|
-
}
|
|
1117
|
-
destroy() {
|
|
1118
|
-
this.hide();
|
|
1119
|
-
this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
1120
|
-
this.view.dom.removeEventListener("dragstart", this.dragstartHandler);
|
|
1121
|
-
window.removeEventListener("resize", this.resizeHandler);
|
|
1122
|
-
this.scrollTarget.removeEventListener("scroll", this.resizeHandler);
|
|
1123
|
-
this.editor.off("focus", this.focusHandler);
|
|
1124
|
-
this.editor.off("blur", this.blurHandler);
|
|
1125
|
-
this.editor.off("transaction", this.transactionHandler);
|
|
1126
|
-
if (this.floatingUIOptions.onDestroy) {
|
|
1127
|
-
this.floatingUIOptions.onDestroy();
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
};
|
|
1131
|
-
var BubbleMenuPlugin = (options) => {
|
|
1132
|
-
return new index.Plugin({
|
|
1133
|
-
key: typeof options.pluginKey === "string" ? new index.PluginKey(options.pluginKey) : options.pluginKey,
|
|
1134
|
-
view: (view) => new BubbleMenuView({ view, ...options })
|
|
1135
|
-
});
|
|
1136
|
-
};
|
|
1137
|
-
var BubbleMenu = No.defineComponent({
|
|
1138
|
-
name: "BubbleMenu",
|
|
1139
|
-
inheritAttrs: false,
|
|
1140
|
-
props: {
|
|
1141
|
-
pluginKey: {
|
|
1142
|
-
type: [String, Object],
|
|
1143
|
-
default: "bubbleMenu"
|
|
1144
|
-
},
|
|
1145
|
-
editor: {
|
|
1146
|
-
type: Object,
|
|
1147
|
-
required: true
|
|
1148
|
-
},
|
|
1149
|
-
updateDelay: {
|
|
1150
|
-
type: Number,
|
|
1151
|
-
default: void 0
|
|
1152
|
-
},
|
|
1153
|
-
resizeDelay: {
|
|
1154
|
-
type: Number,
|
|
1155
|
-
default: void 0
|
|
1156
|
-
},
|
|
1157
|
-
options: {
|
|
1158
|
-
type: Object,
|
|
1159
|
-
default: () => ({})
|
|
1160
|
-
},
|
|
1161
|
-
appendTo: {
|
|
1162
|
-
type: Object,
|
|
1163
|
-
default: void 0
|
|
1164
|
-
},
|
|
1165
|
-
shouldShow: {
|
|
1166
|
-
type: Function,
|
|
1167
|
-
default: null
|
|
1168
|
-
},
|
|
1169
|
-
getReferencedVirtualElement: {
|
|
1170
|
-
type: Function,
|
|
1171
|
-
default: void 0
|
|
1172
|
-
}
|
|
1173
|
-
},
|
|
1174
|
-
setup(props, { slots, attrs }) {
|
|
1175
|
-
const root = No.ref(null);
|
|
1176
|
-
No.onMounted(() => {
|
|
1177
|
-
const {
|
|
1178
|
-
editor,
|
|
1179
|
-
options,
|
|
1180
|
-
pluginKey,
|
|
1181
|
-
resizeDelay,
|
|
1182
|
-
appendTo,
|
|
1183
|
-
shouldShow,
|
|
1184
|
-
getReferencedVirtualElement,
|
|
1185
|
-
updateDelay
|
|
1186
|
-
} = props;
|
|
1187
|
-
const el = root.value;
|
|
1188
|
-
if (!el) {
|
|
1189
|
-
return;
|
|
1190
|
-
}
|
|
1191
|
-
el.style.visibility = "hidden";
|
|
1192
|
-
el.style.position = "absolute";
|
|
1193
|
-
el.remove();
|
|
1194
|
-
No.nextTick(() => {
|
|
1195
|
-
editor.registerPlugin(
|
|
1196
|
-
BubbleMenuPlugin({
|
|
1197
|
-
editor,
|
|
1198
|
-
element: el,
|
|
1199
|
-
options,
|
|
1200
|
-
pluginKey,
|
|
1201
|
-
resizeDelay,
|
|
1202
|
-
appendTo,
|
|
1203
|
-
shouldShow,
|
|
1204
|
-
getReferencedVirtualElement,
|
|
1205
|
-
updateDelay
|
|
1206
|
-
})
|
|
1207
|
-
);
|
|
1208
|
-
});
|
|
1209
|
-
});
|
|
1210
|
-
No.onBeforeUnmount(() => {
|
|
1211
|
-
const { pluginKey, editor } = props;
|
|
1212
|
-
editor.unregisterPlugin(pluginKey);
|
|
1213
|
-
});
|
|
1214
|
-
return () => {
|
|
1215
|
-
var _a;
|
|
1216
|
-
return No.h("div", { ref: root, ...attrs }, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
1217
|
-
};
|
|
1218
|
-
}
|
|
1219
|
-
});
|
|
1220
|
-
var FloatingMenuView = class {
|
|
1221
|
-
constructor({ editor, element, view, options, appendTo, shouldShow }) {
|
|
1222
|
-
this.preventHide = false;
|
|
1223
|
-
this.isVisible = false;
|
|
1224
|
-
this.shouldShow = ({ view: view2, state }) => {
|
|
1225
|
-
const { selection } = state;
|
|
1226
|
-
const { $anchor, empty } = selection;
|
|
1227
|
-
const isRootDepth = $anchor.depth === 1;
|
|
1228
|
-
const isEmptyTextBlock = $anchor.parent.isTextblock && !$anchor.parent.type.spec.code && !$anchor.parent.textContent && $anchor.parent.childCount === 0 && !this.getTextContent($anchor.parent);
|
|
1229
|
-
if (!view2.hasFocus() || !empty || !isRootDepth || !isEmptyTextBlock || !this.editor.isEditable) {
|
|
1230
|
-
return false;
|
|
1231
|
-
}
|
|
1232
|
-
return true;
|
|
1233
|
-
};
|
|
1234
|
-
this.floatingUIOptions = {
|
|
1235
|
-
strategy: "absolute",
|
|
1236
|
-
placement: "right",
|
|
1237
|
-
offset: 8,
|
|
1238
|
-
flip: {},
|
|
1239
|
-
shift: {},
|
|
1240
|
-
arrow: false,
|
|
1241
|
-
size: false,
|
|
1242
|
-
autoPlacement: false,
|
|
1243
|
-
hide: false,
|
|
1244
|
-
inline: false
|
|
1245
|
-
};
|
|
1246
|
-
this.updateHandler = (view2, selectionChanged, docChanged, oldState) => {
|
|
1247
|
-
const { composing } = view2;
|
|
1248
|
-
const isSame = !selectionChanged && !docChanged;
|
|
1249
|
-
if (composing || isSame) {
|
|
1250
|
-
return;
|
|
1251
|
-
}
|
|
1252
|
-
const shouldShow2 = this.getShouldShow(oldState);
|
|
1253
|
-
if (!shouldShow2) {
|
|
1254
|
-
this.hide();
|
|
1255
|
-
return;
|
|
1256
|
-
}
|
|
1257
|
-
this.updatePosition();
|
|
1258
|
-
this.show();
|
|
1259
|
-
};
|
|
1260
|
-
this.mousedownHandler = () => {
|
|
1261
|
-
this.preventHide = true;
|
|
1262
|
-
};
|
|
1263
|
-
this.focusHandler = () => {
|
|
1264
|
-
setTimeout(() => this.update(this.editor.view));
|
|
1265
|
-
};
|
|
1266
|
-
this.blurHandler = ({ event }) => {
|
|
1267
|
-
var _a;
|
|
1268
|
-
if (this.preventHide) {
|
|
1269
|
-
this.preventHide = false;
|
|
1270
|
-
return;
|
|
1271
|
-
}
|
|
1272
|
-
if ((event == null ? void 0 : event.relatedTarget) && ((_a = this.element.parentNode) == null ? void 0 : _a.contains(event.relatedTarget))) {
|
|
1273
|
-
return;
|
|
1274
|
-
}
|
|
1275
|
-
if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
this.hide();
|
|
1279
|
-
};
|
|
1280
|
-
this.editor = editor;
|
|
1281
|
-
this.element = element;
|
|
1282
|
-
this.view = view;
|
|
1283
|
-
this.appendTo = appendTo;
|
|
1284
|
-
this.floatingUIOptions = {
|
|
1285
|
-
...this.floatingUIOptions,
|
|
1286
|
-
...options
|
|
1287
|
-
};
|
|
1288
|
-
this.element.tabIndex = 0;
|
|
1289
|
-
if (shouldShow) {
|
|
1290
|
-
this.shouldShow = shouldShow;
|
|
1291
|
-
}
|
|
1292
|
-
this.element.addEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
1293
|
-
this.editor.on("focus", this.focusHandler);
|
|
1294
|
-
this.editor.on("blur", this.blurHandler);
|
|
1295
|
-
this.update(view, view.state);
|
|
1296
|
-
if (this.getShouldShow()) {
|
|
1297
|
-
this.show();
|
|
1298
|
-
this.updatePosition();
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
getTextContent(node) {
|
|
1302
|
-
return index.getText(node, { textSerializers: index.getTextSerializersFromSchema(this.editor.schema) });
|
|
1303
|
-
}
|
|
1304
|
-
get middlewares() {
|
|
1305
|
-
const middlewares = [];
|
|
1306
|
-
if (this.floatingUIOptions.flip) {
|
|
1307
|
-
middlewares.push(index$1.flip(typeof this.floatingUIOptions.flip !== "boolean" ? this.floatingUIOptions.flip : void 0));
|
|
1308
|
-
}
|
|
1309
|
-
if (this.floatingUIOptions.shift) {
|
|
1310
|
-
middlewares.push(
|
|
1311
|
-
index$1.shift(typeof this.floatingUIOptions.shift !== "boolean" ? this.floatingUIOptions.shift : void 0)
|
|
1312
|
-
);
|
|
1313
|
-
}
|
|
1314
|
-
if (this.floatingUIOptions.offset) {
|
|
1315
|
-
middlewares.push(
|
|
1316
|
-
index$1.offset(typeof this.floatingUIOptions.offset !== "boolean" ? this.floatingUIOptions.offset : void 0)
|
|
1317
|
-
);
|
|
1318
|
-
}
|
|
1319
|
-
if (this.floatingUIOptions.arrow) {
|
|
1320
|
-
middlewares.push(index$1.arrow(this.floatingUIOptions.arrow));
|
|
1321
|
-
}
|
|
1322
|
-
if (this.floatingUIOptions.size) {
|
|
1323
|
-
middlewares.push(index$1.size(typeof this.floatingUIOptions.size !== "boolean" ? this.floatingUIOptions.size : void 0));
|
|
1324
|
-
}
|
|
1325
|
-
if (this.floatingUIOptions.autoPlacement) {
|
|
1326
|
-
middlewares.push(
|
|
1327
|
-
index$1.autoPlacement(
|
|
1328
|
-
typeof this.floatingUIOptions.autoPlacement !== "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
1329
|
-
)
|
|
1330
|
-
);
|
|
1331
|
-
}
|
|
1332
|
-
if (this.floatingUIOptions.hide) {
|
|
1333
|
-
middlewares.push(index$1.hide(typeof this.floatingUIOptions.hide !== "boolean" ? this.floatingUIOptions.hide : void 0));
|
|
1334
|
-
}
|
|
1335
|
-
if (this.floatingUIOptions.inline) {
|
|
1336
|
-
middlewares.push(
|
|
1337
|
-
index$1.inline(typeof this.floatingUIOptions.inline !== "boolean" ? this.floatingUIOptions.inline : void 0)
|
|
1338
|
-
);
|
|
1339
|
-
}
|
|
1340
|
-
return middlewares;
|
|
1341
|
-
}
|
|
1342
|
-
getShouldShow(oldState) {
|
|
1343
|
-
var _a;
|
|
1344
|
-
const { state } = this.view;
|
|
1345
|
-
const { selection } = state;
|
|
1346
|
-
const { ranges } = selection;
|
|
1347
|
-
const from = Math.min(...ranges.map((range) => range.$from.pos));
|
|
1348
|
-
const to = Math.max(...ranges.map((range) => range.$to.pos));
|
|
1349
|
-
const shouldShow = (_a = this.shouldShow) == null ? void 0 : _a.call(this, {
|
|
1350
|
-
editor: this.editor,
|
|
1351
|
-
view: this.view,
|
|
1352
|
-
state,
|
|
1353
|
-
oldState,
|
|
1354
|
-
from,
|
|
1355
|
-
to
|
|
1356
|
-
});
|
|
1357
|
-
return shouldShow;
|
|
1358
|
-
}
|
|
1359
|
-
updatePosition() {
|
|
1360
|
-
const { selection } = this.editor.state;
|
|
1361
|
-
const domRect = index.posToDOMRect(this.view, selection.from, selection.to);
|
|
1362
|
-
const virtualElement = {
|
|
1363
|
-
getBoundingClientRect: () => domRect,
|
|
1364
|
-
getClientRects: () => [domRect]
|
|
1365
|
-
};
|
|
1366
|
-
index$1.computePosition(virtualElement, this.element, {
|
|
1367
|
-
placement: this.floatingUIOptions.placement,
|
|
1368
|
-
strategy: this.floatingUIOptions.strategy,
|
|
1369
|
-
middleware: this.middlewares
|
|
1370
|
-
}).then(({ x, y, strategy }) => {
|
|
1371
|
-
this.element.style.width = "max-content";
|
|
1372
|
-
this.element.style.position = strategy;
|
|
1373
|
-
this.element.style.left = `${x}px`;
|
|
1374
|
-
this.element.style.top = `${y}px`;
|
|
1375
|
-
if (this.isVisible && this.floatingUIOptions.onUpdate) {
|
|
1376
|
-
this.floatingUIOptions.onUpdate();
|
|
1377
|
-
}
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
update(view, oldState) {
|
|
1381
|
-
const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view.state.selection));
|
|
1382
|
-
const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view.state.doc));
|
|
1383
|
-
this.updateHandler(view, selectionChanged, docChanged, oldState);
|
|
1384
|
-
}
|
|
1385
|
-
show() {
|
|
1386
|
-
var _a;
|
|
1387
|
-
if (this.isVisible) {
|
|
1388
|
-
return;
|
|
1389
|
-
}
|
|
1390
|
-
this.element.style.visibility = "visible";
|
|
1391
|
-
this.element.style.opacity = "1";
|
|
1392
|
-
const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
|
|
1393
|
-
(_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
|
|
1394
|
-
if (this.floatingUIOptions.onShow) {
|
|
1395
|
-
this.floatingUIOptions.onShow();
|
|
1396
|
-
}
|
|
1397
|
-
this.isVisible = true;
|
|
1398
|
-
}
|
|
1399
|
-
hide() {
|
|
1400
|
-
if (!this.isVisible) {
|
|
1401
|
-
return;
|
|
1402
|
-
}
|
|
1403
|
-
this.element.style.visibility = "hidden";
|
|
1404
|
-
this.element.style.opacity = "0";
|
|
1405
|
-
this.element.remove();
|
|
1406
|
-
if (this.floatingUIOptions.onHide) {
|
|
1407
|
-
this.floatingUIOptions.onHide();
|
|
1408
|
-
}
|
|
1409
|
-
this.isVisible = false;
|
|
1410
|
-
}
|
|
1411
|
-
destroy() {
|
|
1412
|
-
this.hide();
|
|
1413
|
-
this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
1414
|
-
this.editor.off("focus", this.focusHandler);
|
|
1415
|
-
this.editor.off("blur", this.blurHandler);
|
|
1416
|
-
if (this.floatingUIOptions.onDestroy) {
|
|
1417
|
-
this.floatingUIOptions.onDestroy();
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
};
|
|
1421
|
-
var FloatingMenuPlugin = (options) => {
|
|
1422
|
-
return new index.Plugin({
|
|
1423
|
-
key: typeof options.pluginKey === "string" ? new index.PluginKey(options.pluginKey) : options.pluginKey,
|
|
1424
|
-
view: (view) => new FloatingMenuView({ view, ...options })
|
|
1425
|
-
});
|
|
1426
|
-
};
|
|
1427
|
-
No.defineComponent({
|
|
1428
|
-
name: "FloatingMenu",
|
|
1429
|
-
inheritAttrs: false,
|
|
1430
|
-
props: {
|
|
1431
|
-
pluginKey: {
|
|
1432
|
-
// TODO: TypeScript breaks :(
|
|
1433
|
-
// type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
|
|
1434
|
-
type: null,
|
|
1435
|
-
default: "floatingMenu"
|
|
1436
|
-
},
|
|
1437
|
-
editor: {
|
|
1438
|
-
type: Object,
|
|
1439
|
-
required: true
|
|
1440
|
-
},
|
|
1441
|
-
options: {
|
|
1442
|
-
type: Object,
|
|
1443
|
-
default: () => ({})
|
|
1444
|
-
},
|
|
1445
|
-
appendTo: {
|
|
1446
|
-
type: Object,
|
|
1447
|
-
default: void 0
|
|
1448
|
-
},
|
|
1449
|
-
shouldShow: {
|
|
1450
|
-
type: Function,
|
|
1451
|
-
default: null
|
|
1452
|
-
}
|
|
1453
|
-
},
|
|
1454
|
-
setup(props, { slots, attrs }) {
|
|
1455
|
-
const root = No.ref(null);
|
|
1456
|
-
No.onMounted(() => {
|
|
1457
|
-
const { pluginKey, editor, options, appendTo, shouldShow } = props;
|
|
1458
|
-
const el = root.value;
|
|
1459
|
-
if (!el) {
|
|
1460
|
-
return;
|
|
1461
|
-
}
|
|
1462
|
-
el.style.visibility = "hidden";
|
|
1463
|
-
el.style.position = "absolute";
|
|
1464
|
-
el.remove();
|
|
1465
|
-
editor.registerPlugin(
|
|
1466
|
-
FloatingMenuPlugin({
|
|
1467
|
-
pluginKey,
|
|
1468
|
-
editor,
|
|
1469
|
-
element: el,
|
|
1470
|
-
options,
|
|
1471
|
-
appendTo,
|
|
1472
|
-
shouldShow
|
|
1473
|
-
})
|
|
1474
|
-
);
|
|
1475
|
-
});
|
|
1476
|
-
No.onBeforeUnmount(() => {
|
|
1477
|
-
const { pluginKey, editor } = props;
|
|
1478
|
-
editor.unregisterPlugin(pluginKey);
|
|
1479
|
-
});
|
|
1480
|
-
return () => {
|
|
1481
|
-
var _a;
|
|
1482
|
-
return No.h("div", { ref: root, ...attrs }, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
1483
|
-
};
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1486
|
-
exports.BubbleMenu = BubbleMenu;
|