@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,231 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import BorderWidthIcon from 'svelte-radix/BorderWidth.svelte';
|
|
3
|
+
import BorderNoneIcon from 'svelte-radix/CircleBackslash.svelte';
|
|
4
|
+
import BorderSolidIcon from 'svelte-radix/BorderSolid.svelte';
|
|
5
|
+
import BorderDashedIcon from 'svelte-radix/BorderDashed.svelte';
|
|
6
|
+
import BorderDottedIcon from 'svelte-radix/BorderDotted.svelte';
|
|
7
|
+
import PaletteIcon from 'lucide-svelte/icons/palette';
|
|
8
|
+
import type {
|
|
9
|
+
ImageLayer,
|
|
10
|
+
LayerBorder,
|
|
11
|
+
LayerChangesAction,
|
|
12
|
+
} from '../../../types.js';
|
|
13
|
+
import { getPresentationEditorContext } from '../../../presentation-editor.svelte.js';
|
|
14
|
+
import * as Popover from '../../../../ui/popover/index.js';
|
|
15
|
+
import { Button } from '../../../../ui/button/index.js';
|
|
16
|
+
import { Slider } from '../../../../ui/slider/index.js';
|
|
17
|
+
import { cn, createDebouncedCallback } from '../../../../../utils.js';
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
layer: ImageLayer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let { layer = $bindable() }: Props = $props();
|
|
24
|
+
|
|
25
|
+
const editor = getPresentationEditorContext();
|
|
26
|
+
|
|
27
|
+
let selectedColor = $state(layer.borderColor || '#000000');
|
|
28
|
+
|
|
29
|
+
const setStyle = (value: LayerBorder['borderStyle']) => {
|
|
30
|
+
if (value === layer.borderStyle) return;
|
|
31
|
+
|
|
32
|
+
const undo = {
|
|
33
|
+
borderStyle: layer.borderStyle,
|
|
34
|
+
borderWidth: layer.borderWidth,
|
|
35
|
+
borderColor: layer.borderColor,
|
|
36
|
+
};
|
|
37
|
+
const redo = {
|
|
38
|
+
borderStyle: value,
|
|
39
|
+
borderWidth: layer.borderWidth ?? 10,
|
|
40
|
+
borderColor: selectedColor,
|
|
41
|
+
};
|
|
42
|
+
Object.assign(layer, redo);
|
|
43
|
+
editor.historyPush({ type: 'layer', layer: { id: layer.id, type: layer.type }, undo, redo });
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
let undo: LayerBorder | null = null;
|
|
47
|
+
const debouncedHistoryPush = createDebouncedCallback((action: LayerChangesAction) => {
|
|
48
|
+
editor.historyPush(action);
|
|
49
|
+
undo = null;
|
|
50
|
+
}, 500);
|
|
51
|
+
|
|
52
|
+
let min = 0;
|
|
53
|
+
let max = 100;
|
|
54
|
+
const setWidth = (value: string | number, debounce = false) => {
|
|
55
|
+
let borderWidth = parseInt(value.toString());
|
|
56
|
+
if (borderWidth > max) {
|
|
57
|
+
borderWidth = max;
|
|
58
|
+
} else if (borderWidth < min) {
|
|
59
|
+
borderWidth = min;
|
|
60
|
+
}
|
|
61
|
+
if (!undo) {
|
|
62
|
+
undo = {
|
|
63
|
+
borderStyle: layer.borderStyle,
|
|
64
|
+
borderWidth: layer.borderWidth,
|
|
65
|
+
borderColor: layer.borderColor,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const redo = {
|
|
69
|
+
borderStyle: layer.borderStyle ?? 'solid',
|
|
70
|
+
borderWidth: borderWidth,
|
|
71
|
+
borderColor: selectedColor,
|
|
72
|
+
};
|
|
73
|
+
Object.assign(layer, redo);
|
|
74
|
+
const action: LayerChangesAction = {
|
|
75
|
+
type: 'layer',
|
|
76
|
+
layer: { id: layer.id, type: layer.type },
|
|
77
|
+
undo,
|
|
78
|
+
redo,
|
|
79
|
+
};
|
|
80
|
+
if (debounce) {
|
|
81
|
+
debouncedHistoryPush(action);
|
|
82
|
+
} else {
|
|
83
|
+
editor.historyPush(action);
|
|
84
|
+
undo = null;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const colors = [
|
|
89
|
+
{ value: '#000000', name: 'Black' },
|
|
90
|
+
{ value: '#545454', name: 'Dark Gray' },
|
|
91
|
+
{ value: '#737373', name: 'Gray' },
|
|
92
|
+
{ value: '#a6a6a6', name: 'Gray' },
|
|
93
|
+
{ value: '#d9d9d9', name: 'Light Gray' },
|
|
94
|
+
{ value: '#ffffff', name: 'White' },
|
|
95
|
+
|
|
96
|
+
{ value: '#ff3131', name: 'Bright Red' },
|
|
97
|
+
{ value: '#ff5757', name: 'Coral Red' },
|
|
98
|
+
{ value: '#ff66c4', name: 'Pink' },
|
|
99
|
+
{ value: '#cb6ce6', name: 'Magenta' },
|
|
100
|
+
{ value: '#8c52ff', name: 'Purple' },
|
|
101
|
+
{ value: '#5e17eb', name: 'Violet' },
|
|
102
|
+
|
|
103
|
+
{ value: '#0097b2', name: 'Dark Turquoise' },
|
|
104
|
+
{ value: '#0cc0df', name: 'Aqua Blue' },
|
|
105
|
+
{ value: '#5ce1e6', name: 'Turquoise Blue' },
|
|
106
|
+
{ value: '#38b6ff', name: 'Light Blue' },
|
|
107
|
+
{ value: '#5271ff', name: 'Royal Blue' },
|
|
108
|
+
{ value: '#004aad', name: 'Cobalt Blue' },
|
|
109
|
+
|
|
110
|
+
{ value: '#00bf63', name: 'Green' },
|
|
111
|
+
{ value: '#7ed957', name: 'Grass Green' },
|
|
112
|
+
{ value: '#c1ff72', name: 'Lime' },
|
|
113
|
+
{ value: '#ffde59', name: 'Yellow' },
|
|
114
|
+
{ value: '#ffbd59', name: 'Peach' },
|
|
115
|
+
{ value: '#ff914d', name: 'Orange' },
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
const setColor = (value: string) => () => {
|
|
119
|
+
if (value === selectedColor) return;
|
|
120
|
+
selectedColor = value;
|
|
121
|
+
if (layer.borderWidth) {
|
|
122
|
+
const undo = {
|
|
123
|
+
borderStyle: layer.borderStyle,
|
|
124
|
+
borderWidth: layer.borderWidth,
|
|
125
|
+
borderColor: layer.borderColor,
|
|
126
|
+
};
|
|
127
|
+
const redo = {
|
|
128
|
+
borderStyle: layer.borderStyle,
|
|
129
|
+
borderWidth: layer.borderWidth,
|
|
130
|
+
borderColor: selectedColor,
|
|
131
|
+
};
|
|
132
|
+
Object.assign(layer, redo);
|
|
133
|
+
editor.historyPush({ type: 'layer', layer: { id: layer.id, type: layer.type }, undo, redo });
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<Popover.Root>
|
|
139
|
+
<Popover.Trigger>
|
|
140
|
+
{#snippet child({ props })}
|
|
141
|
+
<Button {...props} variant="ghost" size="icon-xs">
|
|
142
|
+
<BorderWidthIcon class="h-6 w-6" />
|
|
143
|
+
</Button>
|
|
144
|
+
{/snippet}
|
|
145
|
+
</Popover.Trigger>
|
|
146
|
+
<Popover.Content align="start" sideOffset={2} class="w-auto p-4">
|
|
147
|
+
<div class="flex flex-col gap-2">
|
|
148
|
+
<div role="radiogroup" aria-label="Border style">
|
|
149
|
+
<div class="flex shrink-0 gap-2">
|
|
150
|
+
<Button
|
|
151
|
+
variant="outline"
|
|
152
|
+
class="w-12 p-2"
|
|
153
|
+
active={!layer.borderWidth}
|
|
154
|
+
onclick={() => setStyle(null)}
|
|
155
|
+
>
|
|
156
|
+
<BorderNoneIcon class="h-6 w-6" />
|
|
157
|
+
</Button>
|
|
158
|
+
<Button
|
|
159
|
+
variant="outline"
|
|
160
|
+
class="w-12 p-2"
|
|
161
|
+
active={layer.borderStyle === 'solid'}
|
|
162
|
+
onclick={() => setStyle('solid')}
|
|
163
|
+
>
|
|
164
|
+
<BorderSolidIcon class="h-6 w-6" />
|
|
165
|
+
</Button>
|
|
166
|
+
<Button
|
|
167
|
+
variant="outline"
|
|
168
|
+
class="w-12 p-2"
|
|
169
|
+
active={layer.borderStyle === 'dashed'}
|
|
170
|
+
onclick={() => setStyle('dashed')}
|
|
171
|
+
>
|
|
172
|
+
<BorderDashedIcon class="h-6 w-6" />
|
|
173
|
+
</Button>
|
|
174
|
+
<Button
|
|
175
|
+
variant="outline"
|
|
176
|
+
class="w-12 p-2"
|
|
177
|
+
active={layer.borderStyle === 'dotted'}
|
|
178
|
+
onclick={() => setStyle('dotted')}
|
|
179
|
+
>
|
|
180
|
+
<BorderDottedIcon class="h-6 w-6" />
|
|
181
|
+
</Button>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="flex flex-col">
|
|
185
|
+
<div class="text-sm font-medium text-gray-500">Border width</div>
|
|
186
|
+
<div class="flex gap-4">
|
|
187
|
+
<Slider
|
|
188
|
+
type="single"
|
|
189
|
+
value={layer.borderWidth || 0}
|
|
190
|
+
{min}
|
|
191
|
+
{max}
|
|
192
|
+
step={1}
|
|
193
|
+
onValueChange={(value) => setWidth(value, true)}
|
|
194
|
+
/>
|
|
195
|
+
<input
|
|
196
|
+
class="border-input m-0 h-10 w-10 rounded-md bg-transparent p-0 pb-1 text-center text-sm font-semibold leading-none focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none"
|
|
197
|
+
type="text"
|
|
198
|
+
inputmode="decimal"
|
|
199
|
+
placeholder="--"
|
|
200
|
+
value={layer.borderWidth || 0}
|
|
201
|
+
onchange={(e) => setWidth(e.target.value)}
|
|
202
|
+
/>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
<div class="flex flex-col gap-2">
|
|
206
|
+
<div class="flex items-center gap-2 py-2">
|
|
207
|
+
<PaletteIcon class="h-5 w-5" />
|
|
208
|
+
<h5 class="text-left text-sm font-bold">Colors</h5>
|
|
209
|
+
</div>
|
|
210
|
+
<div class="grid grid-cols-6 items-stretch gap-3">
|
|
211
|
+
{#each colors as color}
|
|
212
|
+
<Button
|
|
213
|
+
class={cn(
|
|
214
|
+
'relative h-10 w-10 after:absolute after:inset-0 after:rounded-full after:transition-shadow',
|
|
215
|
+
(layer.borderColor || selectedColor) === color.value && 'after:shadow-active',
|
|
216
|
+
)}
|
|
217
|
+
variant="ghost"
|
|
218
|
+
size="icon"
|
|
219
|
+
onclick={setColor(color.value)}
|
|
220
|
+
>
|
|
221
|
+
<span
|
|
222
|
+
class="h-full w-full rounded-full after:absolute after:inset-0 after:rounded-full after:shadow-inner"
|
|
223
|
+
style:background-color={color.value}
|
|
224
|
+
></span>
|
|
225
|
+
</Button>
|
|
226
|
+
{/each}
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</Popover.Content>
|
|
231
|
+
</Popover.Root>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CornerRadiusIcon from 'svelte-radix/CornerTopLeft.svelte';
|
|
3
|
+
import type {
|
|
4
|
+
ImageLayer,
|
|
5
|
+
LayerChangesAction,
|
|
6
|
+
} from '../../../types.js';
|
|
7
|
+
import { getPresentationEditorContext } from '../../../presentation-editor.svelte.js';
|
|
8
|
+
import * as Popover from '../../../../ui/popover/index.js';
|
|
9
|
+
import { Button } from '../../../../ui/button/index.js';
|
|
10
|
+
import { Slider } from '../../../../ui/slider/index.js';
|
|
11
|
+
import { createDebouncedCallback } from '../../../../../utils.js';
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
layer: ImageLayer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { layer = $bindable() }: Props = $props();
|
|
18
|
+
|
|
19
|
+
const editor = getPresentationEditorContext();
|
|
20
|
+
|
|
21
|
+
let undo: { cornerRadius: number | null } | null = null;
|
|
22
|
+
const debouncedHistoryPush = createDebouncedCallback((action: LayerChangesAction) => {
|
|
23
|
+
editor.historyPush(action);
|
|
24
|
+
undo = null;
|
|
25
|
+
}, 500);
|
|
26
|
+
|
|
27
|
+
let min = 0;
|
|
28
|
+
let max = 100;
|
|
29
|
+
const setCornerRadius = (value: string | number, debounce = false) => {
|
|
30
|
+
let cornerRadius = parseInt(value.toString());
|
|
31
|
+
if (cornerRadius > max) {
|
|
32
|
+
cornerRadius = max;
|
|
33
|
+
} else if (cornerRadius < min) {
|
|
34
|
+
cornerRadius = min;
|
|
35
|
+
}
|
|
36
|
+
if (!undo) {
|
|
37
|
+
undo = { cornerRadius: layer.cornerRadius };
|
|
38
|
+
}
|
|
39
|
+
const redo = { cornerRadius: cornerRadius || null };
|
|
40
|
+
const action: LayerChangesAction = {
|
|
41
|
+
type: 'layer',
|
|
42
|
+
layer: { id: layer.id, type: layer.type },
|
|
43
|
+
undo,
|
|
44
|
+
redo,
|
|
45
|
+
};
|
|
46
|
+
if (debounce) {
|
|
47
|
+
debouncedHistoryPush(action);
|
|
48
|
+
} else {
|
|
49
|
+
editor.historyPush(action);
|
|
50
|
+
undo = null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<Popover.Root>
|
|
56
|
+
<Popover.Trigger>
|
|
57
|
+
{#snippet child({ props })}
|
|
58
|
+
<Button {...props} variant="ghost" size="icon-xs">
|
|
59
|
+
<CornerRadiusIcon class="h-6 w-6" />
|
|
60
|
+
</Button>
|
|
61
|
+
{/snippet}
|
|
62
|
+
</Popover.Trigger>
|
|
63
|
+
<Popover.Content trapFocus={false} align="start" sideOffset={2} class="w-64 p-4">
|
|
64
|
+
<div class="flex flex-col gap-2">
|
|
65
|
+
<div class="flex flex-col">
|
|
66
|
+
<div class="text-sm font-medium text-gray-500">Corner rounding</div>
|
|
67
|
+
<div class="flex gap-4">
|
|
68
|
+
<Slider
|
|
69
|
+
type="single"
|
|
70
|
+
value={layer.cornerRadius || 0}
|
|
71
|
+
{min}
|
|
72
|
+
{max}
|
|
73
|
+
step={1}
|
|
74
|
+
onValueChange={(value) => setCornerRadius(value, true)}
|
|
75
|
+
/>
|
|
76
|
+
<input
|
|
77
|
+
class="border-input m-0 h-10 w-10 rounded-md bg-transparent p-0 pb-1 text-center text-sm font-semibold leading-none focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none"
|
|
78
|
+
type="text"
|
|
79
|
+
inputmode="decimal"
|
|
80
|
+
placeholder="--"
|
|
81
|
+
value={layer.cornerRadius || 0}
|
|
82
|
+
onchange={(e) => setCornerRadius(e.target.value)}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</Popover.Content>
|
|
88
|
+
</Popover.Root>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ImageLayer } from '../../../types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
layer: ImageLayer;
|
|
4
|
+
}
|
|
5
|
+
declare const CornerRadiusButton: import("svelte").Component<Props, {}, "layer">;
|
|
6
|
+
type CornerRadiusButton = ReturnType<typeof CornerRadiusButton>;
|
|
7
|
+
export default CornerRadiusButton;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import FlipHorizontalIcon from 'lucide-svelte/icons/flip-horizontal';
|
|
3
|
+
import FlipVerticalIcon from 'lucide-svelte/icons/flip-vertical';
|
|
4
|
+
import type { ImageLayer } from '../../../types.js';
|
|
5
|
+
import { getPresentationEditorContext } from '../../../presentation-editor.svelte.js';
|
|
6
|
+
import * as DropdownMenu from '../../../../ui/dropdown-menu/index.js';
|
|
7
|
+
import { buttonVariants } from '../../../../ui/button/index.js';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
layer: ImageLayer;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { layer = $bindable() }: Props = $props();
|
|
14
|
+
|
|
15
|
+
const editor = getPresentationEditorContext();
|
|
16
|
+
|
|
17
|
+
const flipToggle = (isHorizontal?: boolean) => () => {
|
|
18
|
+
const undo = isHorizontal ? { flipY: layer.flipY } : { flipX: layer.flipX };
|
|
19
|
+
const redo = isHorizontal ? { flipY: !layer.flipY } : { flipX: !layer.flipX };
|
|
20
|
+
Object.assign(layer, redo);
|
|
21
|
+
editor.historyPush({ type: 'layer', layer: { id: layer.id, type: layer.type }, undo, redo });
|
|
22
|
+
};
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<DropdownMenu.Root>
|
|
26
|
+
<DropdownMenu.Trigger class={buttonVariants({ variant: 'ghost', size: 'icon-xs' })}>
|
|
27
|
+
Flip
|
|
28
|
+
</DropdownMenu.Trigger>
|
|
29
|
+
<DropdownMenu.Content align="start" sideOffset={2} class="w-auto">
|
|
30
|
+
<DropdownMenu.Item closeOnSelect={false} class="gap-2" onclick={flipToggle()}>
|
|
31
|
+
<FlipHorizontalIcon class="h-6 w-6" />
|
|
32
|
+
Flip horizontally
|
|
33
|
+
</DropdownMenu.Item>
|
|
34
|
+
<DropdownMenu.Item closeOnSelect={false} class="gap-2" onclick={flipToggle(true)}>
|
|
35
|
+
<FlipVerticalIcon class="h-6 w-6" />
|
|
36
|
+
Flip vertically
|
|
37
|
+
</DropdownMenu.Item>
|
|
38
|
+
</DropdownMenu.Content>
|
|
39
|
+
</DropdownMenu.Root>
|
package/dist/components/presentation-editor/layers/buttons/opacity-button/opacity-button.svelte
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import OpacityIcon from 'svelte-radix/TransparencyGrid.svelte';
|
|
3
|
+
import type { Layer, LayerChangesAction } from '../../../types.js';
|
|
4
|
+
import { getPresentationEditorContext } from '../../../presentation-editor.svelte.js';
|
|
5
|
+
import * as Popover from '../../../../ui/popover/index.js';
|
|
6
|
+
import { Button } from '../../../../ui/button/index.js';
|
|
7
|
+
import { Slider } from '../../../../ui/slider/index.js';
|
|
8
|
+
import { createDebouncedCallback } from '../../../../../utils.js';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
layer: Layer;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let { layer = $bindable() }: Props = $props();
|
|
15
|
+
|
|
16
|
+
const editor = getPresentationEditorContext();
|
|
17
|
+
|
|
18
|
+
let undo: { opacity: number | null } | null = null;
|
|
19
|
+
const debouncedHistoryPush = createDebouncedCallback((action: LayerChangesAction) => {
|
|
20
|
+
editor.historyPush(action);
|
|
21
|
+
undo = null;
|
|
22
|
+
}, 500);
|
|
23
|
+
|
|
24
|
+
let trasparency = $derived(parseFloat((100 - (layer.opacity ?? 1) * 100).toFixed(2)));
|
|
25
|
+
|
|
26
|
+
let min = 0;
|
|
27
|
+
let max = 100;
|
|
28
|
+
const setTransparency = (value: string | number, debounce = false) => {
|
|
29
|
+
let transparency = Number(value);
|
|
30
|
+
if (transparency > max) {
|
|
31
|
+
transparency = max;
|
|
32
|
+
} else if (!(transparency >= min || transparency <= max)) {
|
|
33
|
+
transparency = min;
|
|
34
|
+
}
|
|
35
|
+
if (!undo) {
|
|
36
|
+
undo = { opacity: layer.opacity };
|
|
37
|
+
}
|
|
38
|
+
const redo = { opacity: transparency ? (100 - transparency) / 100 : null };
|
|
39
|
+
Object.assign(layer, redo);
|
|
40
|
+
const action: LayerChangesAction = {
|
|
41
|
+
type: 'layer',
|
|
42
|
+
layer: { id: layer.id, type: layer.type },
|
|
43
|
+
undo,
|
|
44
|
+
redo,
|
|
45
|
+
};
|
|
46
|
+
if (debounce) {
|
|
47
|
+
debouncedHistoryPush(action);
|
|
48
|
+
} else {
|
|
49
|
+
editor.historyPush(action);
|
|
50
|
+
undo = null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const onChange = (e: Event) => {
|
|
55
|
+
const target = e.target as HTMLInputElement;
|
|
56
|
+
setTransparency(target.value);
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<Popover.Root>
|
|
61
|
+
<Popover.Trigger>
|
|
62
|
+
{#snippet child({ props })}
|
|
63
|
+
<Button {...props} variant="ghost" size="icon-xs">
|
|
64
|
+
<OpacityIcon class="h-6 w-6" />
|
|
65
|
+
</Button>
|
|
66
|
+
{/snippet}
|
|
67
|
+
</Popover.Trigger>
|
|
68
|
+
<Popover.Content align="start" sideOffset={2} class="w-64 p-4">
|
|
69
|
+
<div class="flex flex-col gap-2">
|
|
70
|
+
<div class="flex flex-col">
|
|
71
|
+
<div class="text-sm font-medium text-gray-500">Transparency</div>
|
|
72
|
+
<div class="flex gap-4">
|
|
73
|
+
<Slider
|
|
74
|
+
type="single"
|
|
75
|
+
value={trasparency}
|
|
76
|
+
{min}
|
|
77
|
+
{max}
|
|
78
|
+
step={1}
|
|
79
|
+
onValueChange={(value) => setTransparency(value, true)}
|
|
80
|
+
/>
|
|
81
|
+
<input
|
|
82
|
+
class="border-input m-0 h-10 w-10 rounded-md bg-transparent p-0 pb-1 text-center text-sm font-semibold leading-none focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none"
|
|
83
|
+
type="text"
|
|
84
|
+
inputmode="decimal"
|
|
85
|
+
placeholder="--"
|
|
86
|
+
value={trasparency}
|
|
87
|
+
onchange={onChange}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</Popover.Content>
|
|
93
|
+
</Popover.Root>
|