@peteai/presentation-editor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -0
- package/dist/components/presentation-editor/app.css +12 -0
- package/dist/components/presentation-editor/cognition-slides.d.ts +56 -0
- package/dist/components/presentation-editor/cognition-slides.js +182 -0
- package/dist/components/presentation-editor/cursor-tooltip.svelte +29 -0
- package/dist/components/presentation-editor/cursor-tooltip.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/dragged.svelte +31 -0
- package/dist/components/presentation-editor/dragged.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/header.svelte +66 -0
- package/dist/components/presentation-editor/header.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/index.d.ts +2 -0
- package/dist/components/presentation-editor/index.js +2 -0
- package/dist/components/presentation-editor/layers/active-background-border.svelte +16 -0
- package/dist/components/presentation-editor/layers/active-background-border.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/layers/active-layer-border.svelte +30 -0
- package/dist/components/presentation-editor/layers/active-layer-border.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/buttons/border-button/border-button.svelte +231 -0
- package/dist/components/presentation-editor/layers/buttons/border-button/border-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/buttons/border-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/buttons/border-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/buttons/corner-radius-button/corner-radius-button.svelte +88 -0
- package/dist/components/presentation-editor/layers/buttons/corner-radius-button/corner-radius-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/buttons/corner-radius-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/buttons/corner-radius-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/buttons/flip-button/flip-button.svelte +39 -0
- package/dist/components/presentation-editor/layers/buttons/flip-button/flip-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/buttons/flip-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/buttons/flip-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/buttons/opacity-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/buttons/opacity-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/buttons/opacity-button/opacity-button.svelte +93 -0
- package/dist/components/presentation-editor/layers/buttons/opacity-button/opacity-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/controls/corner-scale-control/corner-scale-control.svelte +179 -0
- package/dist/components/presentation-editor/layers/controls/corner-scale-control/corner-scale-control.svelte.d.ts +184 -0
- package/dist/components/presentation-editor/layers/controls/corner-scale-control/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/controls/corner-scale-control/index.js +4 -0
- package/dist/components/presentation-editor/layers/controls/rotate-control/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/controls/rotate-control/index.js +4 -0
- package/dist/components/presentation-editor/layers/controls/rotate-control/rotate-control.svelte +105 -0
- package/dist/components/presentation-editor/layers/controls/rotate-control/rotate-control.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/controls/side-resize-control/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/controls/side-resize-control/index.js +4 -0
- package/dist/components/presentation-editor/layers/controls/side-resize-control/side-resize-control.svelte +220 -0
- package/dist/components/presentation-editor/layers/controls/side-resize-control/side-resize-control.svelte.d.ts +215 -0
- package/dist/components/presentation-editor/layers/controls/side-scale-control/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/controls/side-scale-control/index.js +4 -0
- package/dist/components/presentation-editor/layers/controls/side-scale-control/side-scale-control.svelte +141 -0
- package/dist/components/presentation-editor/layers/controls/side-scale-control/side-scale-control.svelte.d.ts +114 -0
- package/dist/components/presentation-editor/layers/hovered-layer.svelte +34 -0
- package/dist/components/presentation-editor/layers/hovered-layer.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/index.d.ts +10 -0
- package/dist/components/presentation-editor/layers/index.js +22 -0
- package/dist/components/presentation-editor/layers/layer-button.svelte +38 -0
- package/dist/components/presentation-editor/layers/layer-button.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/layer-thumb-wrapper.svelte +36 -0
- package/dist/components/presentation-editor/layers/layer-thumb-wrapper.svelte.d.ts +15 -0
- package/dist/components/presentation-editor/layers/layer-wrapper.svelte +288 -0
- package/dist/components/presentation-editor/layers/layer-wrapper.svelte.d.ts +10 -0
- package/dist/components/presentation-editor/layers/types/background/background-content.svelte +11 -0
- package/dist/components/presentation-editor/layers/types/background/background-content.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer-buttons.svelte +81 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer-buttons.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer-thumb.svelte +12 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer-thumb.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer.svelte +103 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/background/index.d.ts +5 -0
- package/dist/components/presentation-editor/layers/types/background/index.js +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/alignment-button.svelte +45 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/alignment-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte +19 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/case-button/case-button.svelte +37 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/case-button/case-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/case-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/case-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/color-button/color-button.svelte +88 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/color-button/color-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/color-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/color-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/font-size-button.svelte +132 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/font-size-button.svelte.d.ts +9 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/italic-button.svelte +19 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/italic-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/list-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/list-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte +37 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/strikethrough-button.svelte +19 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/strikethrough-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/underline-button.svelte +20 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/underline-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/editor/Editor.d.ts +4 -0
- package/dist/components/presentation-editor/layers/types/html/editor/Editor.js +4 -0
- package/dist/components/presentation-editor/layers/types/html/editor/createEditor.d.ts +5 -0
- package/dist/components/presentation-editor/layers/types/html/editor/createEditor.js +18 -0
- package/dist/components/presentation-editor/layers/types/html/editor/editor-content.svelte +60 -0
- package/dist/components/presentation-editor/layers/types/html/editor/editor-content.svelte.d.ts +5 -0
- package/dist/components/presentation-editor/layers/types/html/editor/index.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/editor/index.js +3 -0
- package/dist/components/presentation-editor/layers/types/html/editor/types.d.ts +10 -0
- package/dist/components/presentation-editor/layers/types/html/editor/types.js +1 -0
- package/dist/components/presentation-editor/layers/types/html/editor.css +7 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.d.ts +20 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.js +44 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-size/index.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-size/index.js +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/line-height/index.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/line-height/index.js +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/line-height/line-height.d.ts +22 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/line-height/line-height.js +44 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/selection/index.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/selection/index.js +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/selection/selection.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/selection/selection.js +30 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/index.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/index.js +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/text-transform.d.ts +20 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/text-transform/text-transform.js +50 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/index.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/index.js +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/unstyled-list.d.ts +47 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/unstyled-list.js +74 -0
- package/dist/components/presentation-editor/layers/types/html/html-content.svelte +21 -0
- package/dist/components/presentation-editor/layers/types/html/html-content.svelte.d.ts +5 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-active.svelte +159 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-active.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-buttons.svelte +42 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-buttons.svelte.d.ts +10 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-thumb.svelte +24 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-thumb.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer.svelte +97 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/index.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/index.js +58 -0
- package/dist/components/presentation-editor/layers/types/image/image-content.svelte +96 -0
- package/dist/components/presentation-editor/layers/types/image/image-content.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer-active.svelte +39 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer-active.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer-buttons.svelte +21 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer-buttons.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer-thumb.svelte +13 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer-thumb.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer.svelte +80 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/image/index.d.ts +5 -0
- package/dist/components/presentation-editor/layers/types/image/index.js +5 -0
- package/dist/components/presentation-editor/layers/utils.d.ts +32 -0
- package/dist/components/presentation-editor/layers/utils.js +92 -0
- package/dist/components/presentation-editor/presentation-editor.svelte +336 -0
- package/dist/components/presentation-editor/presentation-editor.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/presentation-editor.svelte.js +352 -0
- package/dist/components/presentation-editor/sidebar/images-library.svelte +108 -0
- package/dist/components/presentation-editor/sidebar/images-library.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/sidebar/layers.svelte +94 -0
- package/dist/components/presentation-editor/sidebar/layers.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/sidebar/sidebar.svelte +20 -0
- package/dist/components/presentation-editor/sidebar/sidebar.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/sidebar/uploads-image.svelte +64 -0
- package/dist/components/presentation-editor/sidebar/uploads-image.svelte.d.ts +5 -0
- package/dist/components/presentation-editor/slide-editor.svelte +106 -0
- package/dist/components/presentation-editor/slide-editor.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/slide-inner.svelte +53 -0
- package/dist/components/presentation-editor/slide-inner.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-delete-button.svelte +32 -0
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-delete-button.svelte.d.ts +10 -0
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-duplicate-button.svelte +34 -0
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-duplicate-button.svelte.d.ts +10 -0
- package/dist/components/presentation-editor/slides-navigation/slide-preview.svelte +134 -0
- package/dist/components/presentation-editor/slides-navigation/slide-preview.svelte.d.ts +11 -0
- package/dist/components/presentation-editor/slides-navigation/slides-navigation.svelte +100 -0
- package/dist/components/presentation-editor/slides-navigation/slides-navigation.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/snapping-guides.svelte +41 -0
- package/dist/components/presentation-editor/snapping-guides.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/types.d.ts +118 -0
- package/dist/components/presentation-editor/types.js +1 -0
- package/dist/components/presentation-editor/utils.d.ts +5 -0
- package/dist/components/presentation-editor/utils.js +348 -0
- package/dist/components/ui/button/button.svelte +94 -0
- package/dist/components/ui/button/button.svelte.d.ts +155 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/index.js +4 -0
- package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte +40 -0
- package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte.d.ts +8 -0
- package/dist/components/ui/context-menu/context-menu-content.svelte +24 -0
- package/dist/components/ui/context-menu/context-menu-content.svelte.d.ts +7 -0
- package/dist/components/ui/context-menu/context-menu-group-heading.svelte +19 -0
- package/dist/components/ui/context-menu/context-menu-group-heading.svelte.d.ts +7 -0
- package/dist/components/ui/context-menu/context-menu-item.svelte +23 -0
- package/dist/components/ui/context-menu/context-menu-item.svelte.d.ts +7 -0
- package/dist/components/ui/context-menu/context-menu-radio-item.svelte +30 -0
- package/dist/components/ui/context-menu/context-menu-radio-item.svelte.d.ts +4 -0
- package/dist/components/ui/context-menu/context-menu-separator.svelte +16 -0
- package/dist/components/ui/context-menu/context-menu-separator.svelte.d.ts +4 -0
- package/dist/components/ui/context-menu/context-menu-shortcut.svelte +20 -0
- package/dist/components/ui/context-menu/context-menu-shortcut.svelte.d.ts +5 -0
- package/dist/components/ui/context-menu/context-menu-sub-content.svelte +19 -0
- package/dist/components/ui/context-menu/context-menu-sub-content.svelte.d.ts +4 -0
- package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte +28 -0
- package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte.d.ts +7 -0
- package/dist/components/ui/context-menu/index.d.ts +16 -0
- package/dist/components/ui/context-menu/index.js +18 -0
- package/dist/components/ui/dialog/dialog-content.svelte +38 -0
- package/dist/components/ui/dialog/dialog-content.svelte.d.ts +9 -0
- package/dist/components/ui/dialog/dialog-description.svelte +16 -0
- package/dist/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-footer.svelte +20 -0
- package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +5 -0
- package/dist/components/ui/dialog/dialog-header.svelte +20 -0
- package/dist/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte +19 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-title.svelte +16 -0
- package/dist/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/index.d.ts +12 -0
- package/dist/components/ui/dialog/index.js +14 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +40 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +8 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +21 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +23 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +23 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +8 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +30 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +16 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +5 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +28 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +25 -0
- package/dist/components/ui/dropdown-menu/index.js +17 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/index.js +4 -0
- package/dist/components/ui/input/input.svelte +22 -0
- package/dist/components/ui/input/input.svelte.d.ts +5 -0
- package/dist/components/ui/label/index.d.ts +2 -0
- package/dist/components/ui/label/index.js +4 -0
- package/dist/components/ui/label/label.svelte +19 -0
- package/dist/components/ui/label/label.svelte.d.ts +4 -0
- package/dist/components/ui/popover/index.d.ts +6 -0
- package/dist/components/ui/popover/index.js +8 -0
- package/dist/components/ui/popover/popover-content.svelte +25 -0
- package/dist/components/ui/popover/popover-content.svelte.d.ts +4 -0
- package/dist/components/ui/scroll-area/index.d.ts +3 -0
- package/dist/components/ui/scroll-area/index.js +5 -0
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +29 -0
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte.d.ts +4 -0
- package/dist/components/ui/scroll-area/scroll-area.svelte +34 -0
- package/dist/components/ui/scroll-area/scroll-area.svelte.d.ts +10 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/index.js +4 -0
- package/dist/components/ui/separator/separator.svelte +22 -0
- package/dist/components/ui/separator/separator.svelte.d.ts +4 -0
- package/dist/components/ui/slider/index.d.ts +2 -0
- package/dist/components/ui/slider/index.js +4 -0
- package/dist/components/ui/slider/slider.svelte +34 -0
- package/dist/components/ui/slider/slider.svelte.d.ts +4 -0
- package/dist/components/ui/toggle/index.d.ts +3 -0
- package/dist/components/ui/toggle/index.js +5 -0
- package/dist/components/ui/toggle/toggle.svelte +51 -0
- package/dist/components/ui/toggle/toggle.svelte.d.ts +90 -0
- package/dist/components/ui/tooltip/index.d.ts +6 -0
- package/dist/components/ui/tooltip/index.js +8 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte +21 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +4 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/plugin.d.ts +5 -0
- package/dist/plugin.js +154 -0
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +31 -0
- package/package.json +99 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
}
|
|
5
|
+
declare const StrikethroughButton: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type StrikethroughButton = ReturnType<typeof StrikethroughButton>;
|
|
7
|
+
export default StrikethroughButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '../../editor/index.js';
|
|
3
|
+
import UnderlineIcon from 'lucide-svelte/icons/underline';
|
|
4
|
+
import { Toggle } from '../../../../../../ui/toggle/index.js';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Toggle
|
|
14
|
+
size="xs"
|
|
15
|
+
pressed={editor.isActive('underline')}
|
|
16
|
+
onPressedChange={(val) =>
|
|
17
|
+
val ? editor.commands.setUnderline() : editor.commands.unsetUnderline()}
|
|
18
|
+
>
|
|
19
|
+
<UnderlineIcon class="h-6 w-6" />
|
|
20
|
+
</Toggle>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { readable } from 'svelte/store';
|
|
2
|
+
import { Editor } from './Editor.js';
|
|
3
|
+
import { tick } from 'svelte';
|
|
4
|
+
const createEditor = (options) => {
|
|
5
|
+
const editor = new Editor(options);
|
|
6
|
+
return readable(editor, (set) => {
|
|
7
|
+
editor.on('transaction', () => {
|
|
8
|
+
tick().then(() => {
|
|
9
|
+
set(editor);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
return () => {
|
|
13
|
+
console.log('destroying editor');
|
|
14
|
+
editor.destroy();
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export default createEditor;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onDestroy, onMount, tick } from 'svelte';
|
|
3
|
+
import type { ComponentInputProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
type Props = ComponentInputProps<{}>;
|
|
6
|
+
|
|
7
|
+
const { editor, children }: Props = $props();
|
|
8
|
+
let element: HTMLElement;
|
|
9
|
+
|
|
10
|
+
const init = async () => {
|
|
11
|
+
console.log('init editor content', editor);
|
|
12
|
+
await tick();
|
|
13
|
+
if (!element) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (!editor?.options.element) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (editor.contentElement) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
element.append(...Array.from(editor.options.element.childNodes));
|
|
26
|
+
editor.setOptions({ element });
|
|
27
|
+
|
|
28
|
+
editor.contentElement = element;
|
|
29
|
+
|
|
30
|
+
editor.commands.focus('all');
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
onMount(init);
|
|
34
|
+
|
|
35
|
+
onDestroy(() => {
|
|
36
|
+
console.log('destroy editor content', editor);
|
|
37
|
+
if (!editor) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
editor.contentElement = null;
|
|
42
|
+
|
|
43
|
+
if (!editor.options.element.firstChild) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const newElement = document.createElement('div');
|
|
48
|
+
newElement.append(...Array.from(editor.options.element.childNodes));
|
|
49
|
+
|
|
50
|
+
editor.setOptions({
|
|
51
|
+
element: newElement,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<div bind:this={element}></div>
|
|
57
|
+
|
|
58
|
+
{#if children}
|
|
59
|
+
{@render children()}
|
|
60
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { Editor } from './Editor.js';
|
|
3
|
+
export interface TiptapNodeViewContext {
|
|
4
|
+
onDragStart: (event: DragEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
export type ComponentInputProps<T> = Partial<T> & {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
class?: string;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import '@tiptap/extension-text-style';
|
|
3
|
+
export type FontSizeOptions = {
|
|
4
|
+
types: string[];
|
|
5
|
+
};
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
fontSize: {
|
|
9
|
+
/**
|
|
10
|
+
* Set the font size
|
|
11
|
+
*/
|
|
12
|
+
setFontSize: (fontSize: number) => ReturnType;
|
|
13
|
+
/**
|
|
14
|
+
* Unset the font size
|
|
15
|
+
*/
|
|
16
|
+
unsetFontSize: () => ReturnType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const FontSize: Extension<FontSizeOptions, any>;
|
package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import '@tiptap/extension-text-style';
|
|
3
|
+
export const FontSize = Extension.create({
|
|
4
|
+
name: 'fontSize',
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
types: [],
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
addGlobalAttributes() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
types: this.options.types,
|
|
14
|
+
attributes: {
|
|
15
|
+
fontSize: {
|
|
16
|
+
default: null,
|
|
17
|
+
parseHTML: (element) => element.style.fontSize?.replace(/['"\D]+/g, ''),
|
|
18
|
+
renderHTML: (attributes) => {
|
|
19
|
+
if (!attributes.fontSize) {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
style: `font-size: ${attributes.fontSize}px`,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
},
|
|
31
|
+
addCommands() {
|
|
32
|
+
return {
|
|
33
|
+
setFontSize: (fontSize) => ({
|
|
34
|
+
// chain,
|
|
35
|
+
commands, }) => {
|
|
36
|
+
return this.options.types.every((type) => commands.updateAttributes(type, { fontSize }));
|
|
37
|
+
// return chain().setMark('textStyle', { fontSize }).run();
|
|
38
|
+
},
|
|
39
|
+
unsetFontSize: () => ({ chain }) => {
|
|
40
|
+
return chain().setMark('textStyle', { fontSize: null }).removeEmptyTextStyle().run();
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export interface LineHeightOptions {
|
|
3
|
+
types: string[];
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
defaultHeight: number;
|
|
7
|
+
}
|
|
8
|
+
declare module '@tiptap/core' {
|
|
9
|
+
interface Commands<ReturnType> {
|
|
10
|
+
lineHeight: {
|
|
11
|
+
/**
|
|
12
|
+
* Set the line height attribute
|
|
13
|
+
*/
|
|
14
|
+
setLineHeight: (height: number) => ReturnType;
|
|
15
|
+
/**
|
|
16
|
+
* Unset the text align attribute
|
|
17
|
+
*/
|
|
18
|
+
unsetLineHeight: () => ReturnType;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export declare const LineHeight: Extension<LineHeightOptions, any>;
|
package/dist/components/presentation-editor/layers/types/html/extensions/line-height/line-height.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export const LineHeight = Extension.create({
|
|
3
|
+
name: 'lineHeight',
|
|
4
|
+
addOptions() {
|
|
5
|
+
return {
|
|
6
|
+
types: ['heading', 'paragraph'],
|
|
7
|
+
min: 0.5,
|
|
8
|
+
max: 2.5,
|
|
9
|
+
defaultHeight: 1.4,
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
addGlobalAttributes() {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
types: this.options.types,
|
|
16
|
+
attributes: {
|
|
17
|
+
lineHeight: {
|
|
18
|
+
default: this.options.defaultHeight,
|
|
19
|
+
parseHTML: (element) => element.style.lineHeight,
|
|
20
|
+
renderHTML: (attributes) => {
|
|
21
|
+
// if (attributes.lineHeight === this.options.defaultHeight) {
|
|
22
|
+
// return {};
|
|
23
|
+
// }
|
|
24
|
+
return { style: `line-height: ${attributes.lineHeight}` };
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
},
|
|
31
|
+
addCommands() {
|
|
32
|
+
return {
|
|
33
|
+
setLineHeight: (height) => ({ commands }) => {
|
|
34
|
+
if (this.options.min > height || this.options.max < height) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return this.options.types.every((type) => commands.updateAttributes(type, { lineHeight: height }));
|
|
38
|
+
},
|
|
39
|
+
unsetLineHeight: () => ({ commands }) => {
|
|
40
|
+
return this.options.types.every((type) => commands.resetAttributes(type, 'lineHeight'));
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
package/dist/components/presentation-editor/layers/types/html/extensions/selection/selection.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
import { Decoration, DecorationSet } from '@tiptap/pm/view';
|
|
4
|
+
export const Selection = Extension.create({
|
|
5
|
+
name: 'selection',
|
|
6
|
+
addProseMirrorPlugins() {
|
|
7
|
+
const { editor } = this;
|
|
8
|
+
return [
|
|
9
|
+
new Plugin({
|
|
10
|
+
key: new PluginKey('selection'),
|
|
11
|
+
props: {
|
|
12
|
+
decorations(state) {
|
|
13
|
+
if (state.selection.empty) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
if (editor.isFocused === true) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return DecorationSet.create(state.doc, [
|
|
20
|
+
Decoration.inline(state.selection.from, state.selection.to, {
|
|
21
|
+
class: 'selection',
|
|
22
|
+
}),
|
|
23
|
+
]);
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
];
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export default Selection;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import '@tiptap/extension-text-style';
|
|
3
|
+
export type TextTransformOptions = {
|
|
4
|
+
types: string[];
|
|
5
|
+
};
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
textTransform: {
|
|
9
|
+
/**
|
|
10
|
+
* Set the text transform
|
|
11
|
+
*/
|
|
12
|
+
setTextTransform: (textTransform: string) => ReturnType;
|
|
13
|
+
/**
|
|
14
|
+
* Unset the text transform
|
|
15
|
+
*/
|
|
16
|
+
unsetTextTransform: () => ReturnType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const TextTransform: Extension<TextTransformOptions, any>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import '@tiptap/extension-text-style';
|
|
3
|
+
export const TextTransform = Extension.create({
|
|
4
|
+
name: 'textTransform',
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
types: [],
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
addGlobalAttributes() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
types: this.options.types,
|
|
14
|
+
attributes: {
|
|
15
|
+
textTransform: {
|
|
16
|
+
default: null,
|
|
17
|
+
parseHTML: (element) => element.style.textTransform,
|
|
18
|
+
renderHTML: (attributes) => {
|
|
19
|
+
if (!attributes.textTransform) {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
style: `text-transform: ${attributes.textTransform}`,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
},
|
|
31
|
+
addCommands() {
|
|
32
|
+
return {
|
|
33
|
+
setTextTransform: (textTransform) => ({
|
|
34
|
+
// chain,
|
|
35
|
+
commands, }) => {
|
|
36
|
+
return this.options.types.every((type) => commands.updateAttributes(type, { textTransform }));
|
|
37
|
+
// return chain().setMark('textTransform', { textTransform }).run();
|
|
38
|
+
},
|
|
39
|
+
unsetTextTransform: () => ({
|
|
40
|
+
// chain,
|
|
41
|
+
commands, }) => {
|
|
42
|
+
return this.options.types.every((type) => commands.updateAttributes(type, { textTransform: null }));
|
|
43
|
+
// return chain()
|
|
44
|
+
// .setMark('textTransform', { textTransform: null })
|
|
45
|
+
// .removeEmptyTextStyle()
|
|
46
|
+
// .run();
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface UnstyledListOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The node name for the list items
|
|
5
|
+
* @default 'listItem'
|
|
6
|
+
* @example 'paragraph'
|
|
7
|
+
*/
|
|
8
|
+
itemTypeName: string;
|
|
9
|
+
/**
|
|
10
|
+
* HTML attributes to add to the unstyled list element
|
|
11
|
+
* @default {}
|
|
12
|
+
* @example { class: 'foo' }
|
|
13
|
+
*/
|
|
14
|
+
HTMLAttributes: Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Keep the marks when splitting the list
|
|
17
|
+
* @default false
|
|
18
|
+
* @example true
|
|
19
|
+
*/
|
|
20
|
+
keepMarks: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Keep the attributes when splitting the list
|
|
23
|
+
* @default false
|
|
24
|
+
* @example true
|
|
25
|
+
*/
|
|
26
|
+
keepAttributes: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare module '@tiptap/core' {
|
|
29
|
+
interface Commands<ReturnType> {
|
|
30
|
+
unstyledList: {
|
|
31
|
+
/**
|
|
32
|
+
* Toggle a unstyled list
|
|
33
|
+
*/
|
|
34
|
+
toggleUnstyledList: () => ReturnType;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Matches a unstyled list to a dash or asterisk.
|
|
40
|
+
*/
|
|
41
|
+
export declare const inputRegex: RegExp;
|
|
42
|
+
/**
|
|
43
|
+
* This extension allows you to create unstyled lists.
|
|
44
|
+
* This requires the ListItem extension
|
|
45
|
+
* @see https://tiptap.dev/api/nodes/list-item.
|
|
46
|
+
*/
|
|
47
|
+
export declare const UnstyledList: Node<UnstyledListOptions, any>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core';
|
|
2
|
+
import ListItem from '@tiptap/extension-list-item';
|
|
3
|
+
import TextStyle from '@tiptap/extension-text-style';
|
|
4
|
+
/**
|
|
5
|
+
* Matches a unstyled list to a dash or asterisk.
|
|
6
|
+
*/
|
|
7
|
+
export const inputRegex = /^\s*([-+*])\s$/;
|
|
8
|
+
/**
|
|
9
|
+
* This extension allows you to create unstyled lists.
|
|
10
|
+
* This requires the ListItem extension
|
|
11
|
+
* @see https://tiptap.dev/api/nodes/list-item.
|
|
12
|
+
*/
|
|
13
|
+
export const UnstyledList = Node.create({
|
|
14
|
+
name: 'unstyledList',
|
|
15
|
+
addOptions() {
|
|
16
|
+
return {
|
|
17
|
+
itemTypeName: 'listItem',
|
|
18
|
+
HTMLAttributes: {},
|
|
19
|
+
keepMarks: false,
|
|
20
|
+
keepAttributes: false,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
group: 'block list',
|
|
24
|
+
content() {
|
|
25
|
+
return `${this.options.itemTypeName}+`;
|
|
26
|
+
},
|
|
27
|
+
parseHTML() {
|
|
28
|
+
return [{ tag: 'ul' }];
|
|
29
|
+
},
|
|
30
|
+
renderHTML({ HTMLAttributes }) {
|
|
31
|
+
return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
32
|
+
},
|
|
33
|
+
addCommands() {
|
|
34
|
+
return {
|
|
35
|
+
toggleUnstyledList: () => ({ commands, chain }) => {
|
|
36
|
+
const selection = this.editor.view.state.selection;
|
|
37
|
+
console.log('selection', selection.from, selection.to, selection);
|
|
38
|
+
if (this.options.keepAttributes) {
|
|
39
|
+
console.log(TextStyle.name, this.editor.getAttributes(TextStyle.name));
|
|
40
|
+
console.log('fontSize', this.editor.getAttributes('fontSize'));
|
|
41
|
+
return chain()
|
|
42
|
+
.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
43
|
+
.updateAttributes(ListItem.name, this.editor.getAttributes(TextStyle.name))
|
|
44
|
+
.run();
|
|
45
|
+
}
|
|
46
|
+
return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
addKeyboardShortcuts() {
|
|
51
|
+
return {
|
|
52
|
+
'Mod-Shift-9': () => this.editor.commands.toggleUnstyledList(),
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
addInputRules() {
|
|
56
|
+
let inputRule = wrappingInputRule({
|
|
57
|
+
find: inputRegex,
|
|
58
|
+
type: this.type,
|
|
59
|
+
});
|
|
60
|
+
if (this.options.keepMarks || this.options.keepAttributes) {
|
|
61
|
+
inputRule = wrappingInputRule({
|
|
62
|
+
find: inputRegex,
|
|
63
|
+
type: this.type,
|
|
64
|
+
keepMarks: this.options.keepMarks,
|
|
65
|
+
keepAttributes: this.options.keepAttributes,
|
|
66
|
+
getAttributes: () => {
|
|
67
|
+
return this.editor.getAttributes(TextStyle.name);
|
|
68
|
+
},
|
|
69
|
+
editor: this.editor,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return [inputRule];
|
|
73
|
+
},
|
|
74
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { BROWSER } from 'esm-env';
|
|
3
|
+
import { generateHTML, type JSONContent } from '@tiptap/core';
|
|
4
|
+
import { extensions } from './index.js';
|
|
5
|
+
|
|
6
|
+
let { html } = $props();
|
|
7
|
+
|
|
8
|
+
const getHtml = (html: JSONContent) => {
|
|
9
|
+
try {
|
|
10
|
+
return generateHTML(html, extensions);
|
|
11
|
+
} catch (err) {
|
|
12
|
+
console.error(err);
|
|
13
|
+
return '<p></p>';
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#if BROWSER}
|
|
19
|
+
<!-- eslint-disable svelte/no-at-html-tags -->
|
|
20
|
+
{@html getHtml(html)}
|
|
21
|
+
{/if}
|