@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,103 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import BackgroundContent from './background-content.svelte';
|
|
3
|
+
import { calculateImageFill } from '../../utils.js';
|
|
4
|
+
import { getPresentationEditorContext } from '../../../presentation-editor.svelte.js';
|
|
5
|
+
import type { Layer } from '../../../types.js';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
hoveredLayer: Layer | 'background' | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { hoveredLayer = $bindable(null) }: Props = $props();
|
|
12
|
+
|
|
13
|
+
let ref: HTMLDivElement;
|
|
14
|
+
|
|
15
|
+
const editor = getPresentationEditorContext();
|
|
16
|
+
|
|
17
|
+
const onMouseDown = () => {
|
|
18
|
+
console.log('mousedown', 'background');
|
|
19
|
+
editor.setActiveBackground(true);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const onMouseOver = () => {
|
|
23
|
+
console.log('mouseover', 'background');
|
|
24
|
+
hoveredLayer = 'background';
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const onMouseLeave = () => {
|
|
28
|
+
console.log('mouseleave', 'background');
|
|
29
|
+
hoveredLayer = null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const onDragEnter = (e: DragEvent) => {
|
|
33
|
+
console.log('dragenter background image', e);
|
|
34
|
+
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
|
|
38
|
+
console.log('dragenter background', e);
|
|
39
|
+
|
|
40
|
+
if (editor.dragged) {
|
|
41
|
+
const rect = ref.getBoundingClientRect();
|
|
42
|
+
const { scale, offsetX, offsetY } = calculateImageFill(editor.dragged.image, rect);
|
|
43
|
+
editor.dragged = {
|
|
44
|
+
...editor.dragged,
|
|
45
|
+
hidden: false,
|
|
46
|
+
scale,
|
|
47
|
+
sticky: false,
|
|
48
|
+
x: rect.left + editor.dragged.offsetX - offsetX * scale,
|
|
49
|
+
y: rect.top + editor.dragged.offsetY - offsetY * scale,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const onDragOver = (e: DragEvent) => {
|
|
55
|
+
// console.log('dragover background image', e);
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const onDrop = (e: DragEvent) => {
|
|
60
|
+
console.log('drop background image', e);
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
|
|
63
|
+
const { dragged } = editor;
|
|
64
|
+
if (dragged) {
|
|
65
|
+
console.log(
|
|
66
|
+
dragged.image,
|
|
67
|
+
{ width: editor.width, height: editor.height },
|
|
68
|
+
calculateImageFill(dragged.image, { width: editor.width, height: editor.height }),
|
|
69
|
+
);
|
|
70
|
+
editor.addImageLayer({
|
|
71
|
+
sortOrder: editor.activeSlide.layers.length
|
|
72
|
+
? editor.activeSlide.layers[0].sortOrder - 1
|
|
73
|
+
: 1,
|
|
74
|
+
x: 0,
|
|
75
|
+
y: 0,
|
|
76
|
+
...calculateImageFill(dragged.image, { width: editor.width, height: editor.height }),
|
|
77
|
+
image: {
|
|
78
|
+
id: dragged.image.id,
|
|
79
|
+
src: dragged.image.src,
|
|
80
|
+
width: dragged.image.width,
|
|
81
|
+
height: dragged.image.height,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
89
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
90
|
+
<div
|
|
91
|
+
bind:this={ref}
|
|
92
|
+
class="pointer-events-auto absolute inset-0 overflow-hidden"
|
|
93
|
+
onmousedown={onMouseDown}
|
|
94
|
+
onmouseover={onMouseOver}
|
|
95
|
+
onmouseleave={onMouseLeave}
|
|
96
|
+
ondragenter={onDragEnter}
|
|
97
|
+
ondragover={onDragOver}
|
|
98
|
+
ondrop={onDrop}
|
|
99
|
+
>
|
|
100
|
+
<div class="h-full w-full">
|
|
101
|
+
<BackgroundContent slide={editor.activeSlide} />
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
package/dist/components/presentation-editor/layers/types/background/background-layer.svelte.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Layer } from '../../../types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
hoveredLayer: Layer | 'background' | null;
|
|
4
|
+
}
|
|
5
|
+
declare const BackgroundLayer: import("svelte").Component<Props, {}, "hoveredLayer">;
|
|
6
|
+
type BackgroundLayer = ReturnType<typeof BackgroundLayer>;
|
|
7
|
+
export default BackgroundLayer;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Root from './background-layer.svelte';
|
|
2
|
+
import BackgroundLayerThumb from './background-layer-thumb.svelte';
|
|
3
|
+
import BackgroundContent from './background-content.svelte';
|
|
4
|
+
import BackgroundLayerButtons from './background-layer-buttons.svelte';
|
|
5
|
+
export { Root, Root as BackgroundLayer, BackgroundLayerThumb, BackgroundContent, BackgroundLayerButtons, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Root from './background-layer.svelte';
|
|
2
|
+
import BackgroundLayerThumb from './background-layer-thumb.svelte';
|
|
3
|
+
import BackgroundContent from './background-content.svelte';
|
|
4
|
+
import BackgroundLayerButtons from './background-layer-buttons.svelte';
|
|
5
|
+
export { Root,
|
|
6
|
+
//
|
|
7
|
+
Root as BackgroundLayer, BackgroundLayerThumb, BackgroundContent, BackgroundLayerButtons, };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '../../editor/index.js';
|
|
3
|
+
import AlignJustifyIcon from 'lucide-svelte/icons/align-justify';
|
|
4
|
+
import AlignRightIcon from 'lucide-svelte/icons/align-right';
|
|
5
|
+
import AlignCenterIcon from 'lucide-svelte/icons/align-center';
|
|
6
|
+
import AlignLeftIcon from 'lucide-svelte/icons/align-left';
|
|
7
|
+
import { Button } from '../../../../../../ui/button/index.js';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
editor: Editor;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { editor }: Props = $props();
|
|
14
|
+
|
|
15
|
+
type TextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
16
|
+
|
|
17
|
+
const nextAlign: Record<TextAlign, TextAlign> = {
|
|
18
|
+
left: 'justify',
|
|
19
|
+
justify: 'right',
|
|
20
|
+
right: 'center',
|
|
21
|
+
center: 'left',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getAlign = (): TextAlign | undefined => {
|
|
25
|
+
const align: TextAlign[] = ['left', 'center', 'right', 'justify'];
|
|
26
|
+
return align.find((alignment) => editor.isActive({ textAlign: alignment }));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const switchAlign = () => {
|
|
30
|
+
const align: TextAlign = getAlign() || 'left';
|
|
31
|
+
editor.commands.setTextAlign(nextAlign[align]);
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<Button variant="ghost" size="icon-xs" onclick={switchAlign}>
|
|
36
|
+
{#if editor.isActive({ textAlign: 'justify' })}
|
|
37
|
+
<AlignJustifyIcon class="h-6 w-6" />
|
|
38
|
+
{:else if editor.isActive({ textAlign: 'right' })}
|
|
39
|
+
<AlignRightIcon class="h-6 w-6" />
|
|
40
|
+
{:else if editor.isActive({ textAlign: 'center' })}
|
|
41
|
+
<AlignCenterIcon class="h-6 w-6" />
|
|
42
|
+
{:else}
|
|
43
|
+
<AlignLeftIcon class="h-6 w-6" />
|
|
44
|
+
{/if}
|
|
45
|
+
</Button>
|
package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import BoldIcon from 'lucide-svelte/icons/bold';
|
|
3
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
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('bold')}
|
|
16
|
+
onPressedChange={(val) => (val ? editor.commands.setBold() : editor.commands.unsetBold())}
|
|
17
|
+
>
|
|
18
|
+
<BoldIcon class="h-6 w-6" />
|
|
19
|
+
</Toggle>
|
package/dist/components/presentation-editor/layers/types/html/buttons/case-button/case-button.svelte
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CaseIcon from 'lucide-svelte/icons/case-sensitive';
|
|
3
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
4
|
+
import { Toggle } from '../../../../../../ui/toggle/index.js';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
|
+
|
|
12
|
+
const getUppercase = () => {
|
|
13
|
+
const selection = editor.view.state.selection;
|
|
14
|
+
let uppercase: boolean | null = null;
|
|
15
|
+
editor.view.state.doc.nodesBetween(selection.from, selection.to, (node) => {
|
|
16
|
+
if (node.type.name !== 'text') {
|
|
17
|
+
if (uppercase !== false && node.attrs.textTransform === 'uppercase') {
|
|
18
|
+
uppercase = true;
|
|
19
|
+
} else {
|
|
20
|
+
uppercase = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return !!uppercase;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
let uppercase = $derived(editor && getUppercase());
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Toggle
|
|
31
|
+
size="xs"
|
|
32
|
+
pressed={uppercase}
|
|
33
|
+
onPressedChange={(val) =>
|
|
34
|
+
val ? editor.commands.setTextTransform('uppercase') : editor.commands.unsetTextTransform()}
|
|
35
|
+
>
|
|
36
|
+
<CaseIcon class="h-6 w-6" />
|
|
37
|
+
</Toggle>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import PaletteIcon from 'lucide-svelte/icons/palette';
|
|
3
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
4
|
+
import * as Popover from '../../../../../../ui/popover/index.js';
|
|
5
|
+
import { Button, buttonVariants } from '../../../../../../ui/button/index.js';
|
|
6
|
+
import { cn } from '../../../../../../../utils.js';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { editor }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const defaultColor = '#000000';
|
|
15
|
+
|
|
16
|
+
const colors = [
|
|
17
|
+
{ value: '#000000', name: 'Black' },
|
|
18
|
+
{ value: '#545454', name: 'Dark Gray' },
|
|
19
|
+
{ value: '#737373', name: 'Gray' },
|
|
20
|
+
{ value: '#a6a6a6', name: 'Gray' },
|
|
21
|
+
{ value: '#d9d9d9', name: 'Light Gray' },
|
|
22
|
+
{ value: '#ffffff', name: 'White' },
|
|
23
|
+
|
|
24
|
+
{ value: '#ff3131', name: 'Bright Red' },
|
|
25
|
+
{ value: '#ff5757', name: 'Coral Red' },
|
|
26
|
+
{ value: '#ff66c4', name: 'Pink' },
|
|
27
|
+
{ value: '#cb6ce6', name: 'Magenta' },
|
|
28
|
+
{ value: '#8c52ff', name: 'Purple' },
|
|
29
|
+
{ value: '#5e17eb', name: 'Violet' },
|
|
30
|
+
|
|
31
|
+
{ value: '#0097b2', name: 'Dark Turquoise' },
|
|
32
|
+
{ value: '#0cc0df', name: 'Aqua Blue' },
|
|
33
|
+
{ value: '#5ce1e6', name: 'Turquoise Blue' },
|
|
34
|
+
{ value: '#38b6ff', name: 'Light Blue' },
|
|
35
|
+
{ value: '#5271ff', name: 'Royal Blue' },
|
|
36
|
+
{ value: '#004aad', name: 'Cobalt Blue' },
|
|
37
|
+
|
|
38
|
+
{ value: '#00bf63', name: 'Green' },
|
|
39
|
+
{ value: '#7ed957', name: 'Grass Green' },
|
|
40
|
+
{ value: '#c1ff72', name: 'Lime' },
|
|
41
|
+
{ value: '#ffde59', name: 'Yellow' },
|
|
42
|
+
{ value: '#ffbd59', name: 'Peach' },
|
|
43
|
+
{ value: '#ff914d', name: 'Orange' },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const getColor = () => editor.getAttributes('textStyle').color || defaultColor;
|
|
47
|
+
|
|
48
|
+
const setColor = (value: string) => {
|
|
49
|
+
if (value === defaultColor) {
|
|
50
|
+
editor.chain().focus().unsetColor().run();
|
|
51
|
+
} else {
|
|
52
|
+
editor.chain().focus().setColor(value).run();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<Popover.Root>
|
|
58
|
+
<Popover.Trigger class={buttonVariants({ variant: 'ghost', size: 'icon-xs' })}>
|
|
59
|
+
<span class="h-6 w-6 rounded-full border border-gray-300" style:background-color={getColor()}
|
|
60
|
+
></span>
|
|
61
|
+
</Popover.Trigger>
|
|
62
|
+
<Popover.Content align="start" sideOffset={2} class="w-auto p-2">
|
|
63
|
+
<div class="flex flex-col gap-2">
|
|
64
|
+
<div class="flex items-center gap-2 p-2">
|
|
65
|
+
<PaletteIcon class="h-5 w-5" />
|
|
66
|
+
<h5 class="text-left text-sm font-bold">Colors</h5>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="grid grid-cols-6 items-stretch gap-3">
|
|
69
|
+
{#each colors as color}
|
|
70
|
+
<Button
|
|
71
|
+
class={cn(
|
|
72
|
+
'relative h-10 w-10 after:absolute after:inset-0 after:rounded-full after:transition-shadow',
|
|
73
|
+
getColor() === color.value && 'after:shadow-active',
|
|
74
|
+
)}
|
|
75
|
+
variant="ghost"
|
|
76
|
+
size="icon"
|
|
77
|
+
onclick={() => setColor(color.value)}
|
|
78
|
+
>
|
|
79
|
+
<span
|
|
80
|
+
class="h-full w-full rounded-full after:absolute after:inset-0 after:rounded-full after:shadow-inner"
|
|
81
|
+
style:background-color={color.value}
|
|
82
|
+
></span>
|
|
83
|
+
</Button>
|
|
84
|
+
{/each}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</Popover.Content>
|
|
88
|
+
</Popover.Root>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import MinusIcon from 'lucide-svelte/icons/minus';
|
|
3
|
+
import PlusIcon from 'lucide-svelte/icons/plus';
|
|
4
|
+
import type { Layer } from '../../../../../types.js';
|
|
5
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
6
|
+
import * as DropdownMenu from '../../../../../../ui/dropdown-menu/index.js';
|
|
7
|
+
import { Button, buttonVariants } from '../../../../../../ui/button/index.js';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
layer: Layer;
|
|
11
|
+
editor: Editor;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let { layer, editor }: Props = $props();
|
|
15
|
+
|
|
16
|
+
let fontSizeInputEl: HTMLInputElement | null = $state(null);
|
|
17
|
+
let pxToPt = 3 / 4;
|
|
18
|
+
const min = 1;
|
|
19
|
+
const max = 800;
|
|
20
|
+
|
|
21
|
+
const getFontSize = (scale: number) => {
|
|
22
|
+
const selection = editor.view.state.selection;
|
|
23
|
+
let fontSizes: number[] = [];
|
|
24
|
+
editor.view.state.doc.nodesBetween(selection.from, selection.to, (node) => {
|
|
25
|
+
if (node.type.name !== 'text') {
|
|
26
|
+
if (node.attrs.fontSize) {
|
|
27
|
+
fontSizes.push(node.attrs.fontSize);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
fontSizes = [...new Set(fontSizes)];
|
|
32
|
+
let fontSizePx;
|
|
33
|
+
if (fontSizes.length === 1) {
|
|
34
|
+
fontSizePx = fontSizes[0];
|
|
35
|
+
} else if (fontSizes.length === 0) {
|
|
36
|
+
fontSizePx = 14; // TODO: find better way of defining default font size
|
|
37
|
+
}
|
|
38
|
+
return fontSizePx ? Math.round(fontSizePx * pxToPt * scale * 10) / 10 : null;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
let scale = $derived(layer.scale || 1);
|
|
42
|
+
let fontSize = $derived(editor && getFontSize(scale));
|
|
43
|
+
|
|
44
|
+
const updateFontSize = (value: number) => {
|
|
45
|
+
console.log('updateFontSize', value);
|
|
46
|
+
if (editor) {
|
|
47
|
+
let fontSizePt = value;
|
|
48
|
+
if (fontSizePt < min) {
|
|
49
|
+
fontSizePt = min;
|
|
50
|
+
} else if (fontSizePt > max) {
|
|
51
|
+
fontSizePt = max;
|
|
52
|
+
}
|
|
53
|
+
editor.commands.setFontSize(fontSizePt / pxToPt / scale);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const incrementFontSize =
|
|
58
|
+
(inc = 1) =>
|
|
59
|
+
() => {
|
|
60
|
+
if (fontSize) {
|
|
61
|
+
updateFontSize(fontSize + inc);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<div class="flex items-center outline-0">
|
|
67
|
+
<Button
|
|
68
|
+
variant="outline"
|
|
69
|
+
size="xs"
|
|
70
|
+
class="w-8 rounded-r-none border-r-0"
|
|
71
|
+
onclick={incrementFontSize(-1)}
|
|
72
|
+
>
|
|
73
|
+
<MinusIcon class="h-6 w-6" />
|
|
74
|
+
</Button>
|
|
75
|
+
<DropdownMenu.Root>
|
|
76
|
+
<DropdownMenu.Trigger
|
|
77
|
+
class={buttonVariants({
|
|
78
|
+
variant: 'outline',
|
|
79
|
+
size: 'xs',
|
|
80
|
+
class: 'inline-flex cursor-text select-none rounded-none align-middle',
|
|
81
|
+
})}
|
|
82
|
+
>
|
|
83
|
+
<div
|
|
84
|
+
class="max-width-full m-auto inline-block overflow-hidden text-ellipsis whitespace-nowrap"
|
|
85
|
+
>
|
|
86
|
+
<input
|
|
87
|
+
bind:this={fontSizeInputEl}
|
|
88
|
+
class="m-0 h-full w-10 border-none bg-transparent p-0 pb-1 text-center text-sm font-semibold leading-none outline-none focus:border-transparent focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none"
|
|
89
|
+
type="number"
|
|
90
|
+
pattern="\d*"
|
|
91
|
+
{max}
|
|
92
|
+
{min}
|
|
93
|
+
step="0.1"
|
|
94
|
+
tabindex="-1"
|
|
95
|
+
placeholder="– –"
|
|
96
|
+
value={fontSize}
|
|
97
|
+
style:-moz-appearance="textfield"
|
|
98
|
+
onchange={(e) => updateFontSize(e.target.value)}
|
|
99
|
+
onkeydown={(e) => {
|
|
100
|
+
if (e.key === 'Enter') {
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
updateFontSize(e.target.value);
|
|
103
|
+
} else if (e.key === 'Escape') {
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
}
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
</DropdownMenu.Trigger>
|
|
110
|
+
<DropdownMenu.Content
|
|
111
|
+
trapFocus={false}
|
|
112
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
113
|
+
align="start"
|
|
114
|
+
sideOffset={2}
|
|
115
|
+
class="w-32 p-1"
|
|
116
|
+
>
|
|
117
|
+
{#each [6, 8, 10, 12, 14, 16, 18, 21, 24, 28, 32, 36, 42, 48, 56, 64, 72, 80, 88, 96, 104, 120, 144] as size}
|
|
118
|
+
<DropdownMenu.Item onSelect={() => updateFontSize(size)}>
|
|
119
|
+
{size}
|
|
120
|
+
</DropdownMenu.Item>
|
|
121
|
+
{/each}
|
|
122
|
+
</DropdownMenu.Content>
|
|
123
|
+
</DropdownMenu.Root>
|
|
124
|
+
<Button
|
|
125
|
+
variant="outline"
|
|
126
|
+
size="xs"
|
|
127
|
+
class="w-8 rounded-l-none border-l-0"
|
|
128
|
+
onclick={incrementFontSize()}
|
|
129
|
+
>
|
|
130
|
+
<PlusIcon class="h-6 w-6" />
|
|
131
|
+
</Button>
|
|
132
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Layer } from '../../../../../types.js';
|
|
2
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
layer: Layer;
|
|
5
|
+
editor: Editor;
|
|
6
|
+
}
|
|
7
|
+
declare const FontSizeButton: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type FontSizeButton = ReturnType<typeof FontSizeButton>;
|
|
9
|
+
export default FontSizeButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ItalicIcon from 'lucide-svelte/icons/italic';
|
|
3
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
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('italic')}
|
|
16
|
+
onPressedChange={(val) => (val ? editor.commands.setItalic() : editor.commands.unsetItalic())}
|
|
17
|
+
>
|
|
18
|
+
<ItalicIcon class="h-6 w-6" />
|
|
19
|
+
</Toggle>
|
package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type Editor } from '../../editor/index.js';
|
|
3
|
+
import BulletListIcon from 'lucide-svelte/icons/list';
|
|
4
|
+
import OrderedListIcon from 'lucide-svelte/icons/list-ordered';
|
|
5
|
+
import { Toggle } from '../../../../../../ui/toggle/index.js';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
editor: Editor;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { editor }: Props = $props();
|
|
12
|
+
|
|
13
|
+
type ListType = 'bulletList' | 'orderedList';
|
|
14
|
+
|
|
15
|
+
let listType: ListType | false = $derived(
|
|
16
|
+
editor &&
|
|
17
|
+
((editor.isActive('bulletList') && 'bulletList') ||
|
|
18
|
+
(editor.isActive('orderedList') && 'orderedList')),
|
|
19
|
+
);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Toggle
|
|
23
|
+
size="xs"
|
|
24
|
+
pressed={!!listType}
|
|
25
|
+
onPressedChange={() =>
|
|
26
|
+
!listType
|
|
27
|
+
? editor.commands.toggleBulletList()
|
|
28
|
+
: listType === 'bulletList'
|
|
29
|
+
? editor.commands.toggleOrderedList()
|
|
30
|
+
: editor.commands.toggleUnstyledList()}
|
|
31
|
+
>
|
|
32
|
+
{#if listType === 'orderedList'}
|
|
33
|
+
<OrderedListIcon class="h-6 w-6" />
|
|
34
|
+
{:else}
|
|
35
|
+
<BulletListIcon class="h-6 w-6" />
|
|
36
|
+
{/if}
|
|
37
|
+
</Toggle>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import StrikethroughIcon from 'lucide-svelte/icons/strikethrough';
|
|
3
|
+
import type { Editor } from '../../editor/Editor.js';
|
|
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('strike')}
|
|
16
|
+
onPressedChange={(val) => (val ? editor.commands.setStrike() : editor.commands.unsetStrike())}
|
|
17
|
+
>
|
|
18
|
+
<StrikethroughIcon class="h-6 w-6" />
|
|
19
|
+
</Toggle>
|