@peteai/presentation-editor 0.0.6 → 0.0.8
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 +38 -38
- package/dist/components/editor/active-layers-buttons.svelte +56 -0
- package/dist/components/editor/active-layers.svelte +237 -0
- package/dist/components/editor/active-layers.svelte.d.ts +8 -0
- package/dist/components/{presentation-editor/cognition-slides.d.ts → editor/cognition-pages.d.ts} +1 -1
- package/dist/components/{presentation-editor/cognition-slides.js → editor/cognition-pages.js} +1 -1
- package/dist/components/{presentation-editor → editor}/cursor-tooltip.svelte +6 -2
- package/dist/components/editor/cursor-tooltip.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor → editor}/dragged.svelte +7 -3
- package/dist/components/editor/dragged.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor/presentation-editor.svelte → editor/editor.svelte} +64 -61
- package/dist/components/editor/editor.svelte.d.ts +4 -0
- package/dist/components/editor/editor.svelte.js +1169 -0
- package/dist/components/editor/header.svelte +62 -0
- package/dist/components/editor/header.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor → editor}/hotkeys.svelte +48 -16
- package/dist/components/editor/index.d.ts +3 -0
- package/dist/components/editor/index.js +3 -0
- package/dist/components/{presentation-editor → editor}/layers/active-background-border.svelte +2 -2
- package/dist/components/{presentation-editor → editor}/layers/active-layer-border.svelte +5 -8
- package/dist/components/editor/layers/buttons/border-button/border-button-colors.svelte +59 -0
- package/dist/components/editor/layers/buttons/border-button/border-button-colors.svelte.d.ts +9 -0
- package/dist/components/{presentation-editor → editor}/layers/buttons/border-button/border-button.svelte +47 -65
- package/dist/components/{presentation-editor → editor}/layers/buttons/corner-radius-button/corner-radius-button.svelte +24 -28
- package/dist/components/{presentation-editor → editor}/layers/buttons/flip-button/flip-button.svelte +11 -12
- package/dist/components/{presentation-editor → editor}/layers/buttons/opacity-button/opacity-button.svelte +33 -44
- package/dist/components/{presentation-editor → editor}/layers/controls/corner-scale-control/corner-scale-control.svelte +27 -32
- package/dist/components/editor/layers/controls/group-resize-control/group-resize-control.svelte +418 -0
- package/dist/components/{presentation-editor → editor}/layers/controls/rotate-control/rotate-control.svelte +33 -34
- package/dist/components/editor/layers/controls/rotate-control/rotate-control.svelte.d.ts +6 -0
- package/dist/components/{presentation-editor → editor}/layers/controls/side-resize-control/side-resize-control.svelte +22 -26
- package/dist/components/{presentation-editor → editor}/layers/controls/side-scale-control/side-scale-control.svelte +13 -15
- package/dist/components/{presentation-editor → editor}/layers/controls/side-scale-control/side-scale-control.svelte.d.ts +2 -2
- package/dist/components/editor/layers/index.d.ts +10 -0
- package/dist/components/{presentation-editor → editor}/layers/index.js +8 -5
- package/dist/components/{presentation-editor → editor}/layers/layer-button.svelte +14 -8
- package/dist/components/{presentation-editor → editor}/layers/layer-thumb-wrapper.svelte +5 -6
- package/dist/components/{presentation-editor → editor}/layers/layer-wrapper.svelte +46 -57
- package/dist/components/editor/layers/types/background/background-content-image.svelte +36 -0
- package/dist/components/{presentation-editor → editor}/layers/types/background/background-layer-buttons.svelte +6 -6
- package/dist/components/editor/layers/types/background/background-layer-content.svelte +21 -0
- package/dist/components/{presentation-editor → editor}/layers/types/background/background-layer-content.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor → editor}/layers/types/background/background-layer.svelte +7 -9
- package/dist/components/editor/layers/types/group/group-child-wrapper.svelte +44 -0
- package/dist/components/editor/layers/types/group/group-child-wrapper.svelte.d.ts +9 -0
- package/dist/components/editor/layers/types/group/group-layer-content.svelte +45 -0
- package/dist/components/editor/layers/types/group/group-layer-content.svelte.d.ts +9 -0
- package/dist/components/editor/layers/types/group/group-layer.svelte +33 -0
- package/dist/components/editor/layers/types/group/group-layer.svelte.d.ts +8 -0
- package/dist/components/editor/layers/types/group/index.d.ts +3 -0
- package/dist/components/editor/layers/types/group/index.js +3 -0
- package/dist/components/editor/layers/types/image/controls/image-rotate-control/image-rotate-control.svelte +120 -0
- package/dist/components/editor/layers/types/image/controls/image-rotate-control/image-rotate-control.svelte.d.ts +8 -0
- package/dist/components/editor/layers/types/image/controls/image-rotate-control/index.d.ts +2 -0
- package/dist/components/editor/layers/types/image/controls/image-rotate-control/index.js +4 -0
- package/dist/components/editor/layers/types/image/controls/image-scale-control/image-scale-control.svelte +154 -0
- package/dist/components/editor/layers/types/image/controls/image-scale-control/image-scale-control.svelte.d.ts +91 -0
- package/dist/components/editor/layers/types/image/controls/image-scale-control/index.d.ts +2 -0
- package/dist/components/editor/layers/types/image/controls/image-scale-control/index.js +4 -0
- package/dist/components/{presentation-editor → editor}/layers/types/image/image-layer-active.svelte +10 -13
- package/dist/components/{presentation-editor → editor}/layers/types/image/image-layer-content.svelte +15 -12
- package/dist/components/editor/layers/types/image/image-layer-crop.svelte +182 -0
- package/dist/components/editor/layers/types/image/image-layer-crop.svelte.d.ts +10 -0
- package/dist/components/{presentation-editor → editor}/layers/types/image/image-layer.svelte +24 -14
- package/dist/components/editor/layers/types/image/index.d.ts +4 -0
- package/dist/components/editor/layers/types/image/index.js +4 -0
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/alignment-button/alignment-button.svelte +13 -14
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/alignment-button/alignment-button.svelte.d.ts +2 -2
- package/dist/components/editor/layers/types/text/buttons/bold-button/bold-button.svelte +65 -0
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/bold-button/bold-button.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/case-button/case-button.svelte +24 -30
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/case-button/case-button.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/color-button/color-button.svelte +4 -4
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/color-button/color-button.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-family-button/font-family-button.svelte +4 -4
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-family-button/font-family-button.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-size-button/font-size-button.svelte +33 -40
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-size-button/font-size-button.svelte.d.ts +2 -2
- package/dist/components/editor/layers/types/text/buttons/italic-button/italic-button.svelte +65 -0
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/italic-button/italic-button.svelte.d.ts +2 -2
- package/dist/components/editor/layers/types/text/buttons/list-button/list-button.svelte +113 -0
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/list-button/list-button.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/strikethrough-button/strikethrough-button.svelte +10 -11
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/strikethrough-button/strikethrough-button.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/underline-button/underline-button.svelte +10 -11
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/underline-button/underline-button.svelte.d.ts +2 -2
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/utils.d.ts +2 -0
- package/dist/components/editor/layers/types/text/editor/utils.js +166 -0
- package/dist/components/editor/layers/types/text/extensions/list/index.d.ts +3 -0
- package/dist/components/editor/layers/types/text/extensions/list/index.js +3 -0
- package/dist/components/editor/layers/types/text/extensions/list/list.d.ts +67 -0
- package/dist/components/editor/layers/types/text/extensions/list/list.js +237 -0
- package/dist/components/editor/layers/types/text/extensions/list-item/index.d.ts +3 -0
- package/dist/components/editor/layers/types/text/extensions/list-item/index.js +3 -0
- package/dist/components/editor/layers/types/text/extensions/list-item/list-item.d.ts +13 -0
- package/dist/components/editor/layers/types/text/extensions/list-item/list-item.js +262 -0
- package/dist/components/editor/layers/types/text/extensions/list-item-paragraph/index.d.ts +3 -0
- package/dist/components/editor/layers/types/text/extensions/list-item-paragraph/index.js +3 -0
- package/dist/components/editor/layers/types/text/extensions/list-item-paragraph/list-item-paragraph.d.ts +14 -0
- package/dist/components/editor/layers/types/text/extensions/list-item-paragraph/list-item-paragraph.js +27 -0
- package/dist/components/editor/layers/types/text/extensions/paragraph/index.d.ts +3 -0
- package/dist/components/editor/layers/types/text/extensions/paragraph/index.js +3 -0
- package/dist/components/editor/layers/types/text/extensions/paragraph/paragraph.d.ts +6 -0
- package/dist/components/editor/layers/types/text/extensions/paragraph/paragraph.js +28 -0
- package/dist/components/editor/layers/types/text/extensions/preserve-formatting-on-clear/index.d.ts +3 -0
- package/dist/components/editor/layers/types/text/extensions/preserve-formatting-on-clear/index.js +3 -0
- package/dist/components/editor/layers/types/text/extensions/preserve-formatting-on-clear/preserve-formatting-on-clear.d.ts +2 -0
- package/dist/components/editor/layers/types/text/extensions/preserve-formatting-on-clear/preserve-formatting-on-clear.js +74 -0
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/text-transform/text-transform.js +1 -4
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions.js +13 -23
- package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/html-content.svelte +0 -9
- package/dist/components/editor/layers/types/text/index.d.ts +5 -0
- package/dist/components/editor/layers/types/text/index.js +5 -0
- package/dist/components/{presentation-editor/layers/types/html/html-layer-content.svelte → editor/layers/types/text/text-layer-content.svelte} +2 -2
- package/dist/components/editor/layers/types/text/text-layer-content.svelte.d.ts +9 -0
- package/dist/components/editor/layers/types/text/text-layer-edit.svelte +114 -0
- package/dist/components/editor/layers/types/text/text-layer-edit.svelte.d.ts +9 -0
- package/dist/components/editor/layers/types/text/text-layer.svelte +125 -0
- package/dist/components/editor/layers/types/text/text-layer.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor → editor}/layers/utils.d.ts +32 -24
- package/dist/components/{presentation-editor → editor}/layers/utils.js +152 -102
- package/dist/components/{presentation-editor → editor}/menu/background-menu-content.svelte +24 -24
- package/dist/components/{presentation-editor → editor}/menu/background-menu-content.svelte.d.ts +4 -4
- package/dist/components/{presentation-editor → editor}/menu/layer-menu-content.svelte +62 -38
- package/dist/components/{presentation-editor/menu/slide-menu-content.svelte → editor/menu/page-menu-content.svelte} +19 -19
- package/dist/components/editor/menu/page-menu-content.svelte.d.ts +9 -0
- package/dist/components/{presentation-editor/slide-editor.svelte → editor/page-editor.svelte} +30 -25
- package/dist/components/editor/page-editor.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor/slide-inner.svelte → editor/page-inner.svelte} +5 -5
- package/dist/components/{presentation-editor/sidebar/sidebar.svelte.d.ts → editor/page-inner.svelte.d.ts} +3 -3
- package/dist/components/editor/page.svelte +69 -0
- package/dist/components/editor/page.svelte.d.ts +4 -0
- package/dist/components/editor/pages-navigation/page-preview.svelte +36 -0
- package/dist/components/editor/pages-navigation/page-preview.svelte.d.ts +8 -0
- package/dist/components/{presentation-editor/slides-navigation/slide-preview.svelte → editor/pages-navigation/pages-navigation-item.svelte} +21 -41
- package/dist/components/editor/pages-navigation/pages-navigation-item.svelte.d.ts +11 -0
- package/dist/components/{presentation-editor/slides-navigation/slides-navigation.svelte → editor/pages-navigation/pages-navigation.svelte} +26 -21
- package/dist/components/editor/pages-navigation/pages-navigation.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/color-sidebar-color.svelte +1 -1
- package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/color-sidebar-gradient-picker.svelte +2 -2
- package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/color-sidebar.svelte +92 -89
- package/dist/components/{presentation-editor → editor}/sidebar/font-sidebar/font-sidebar-button.svelte +3 -3
- package/dist/components/{presentation-editor → editor}/sidebar/font-sidebar/font-sidebar.svelte +34 -39
- package/dist/components/editor/sidebar/image-crop-sidebar.svelte +112 -0
- package/dist/components/editor/sidebar/image-crop-sidebar.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor/sidebar/position-slidebar.svelte → editor/sidebar/position-sidebar.svelte} +26 -20
- package/dist/components/editor/sidebar/position-sidebar.svelte.d.ts +3 -0
- package/dist/components/{presentation-editor → editor}/sidebar/sidebar-text-tab-button.svelte +5 -5
- package/dist/components/{presentation-editor → editor}/sidebar/sidebar-text-tab.svelte +5 -5
- package/dist/components/{presentation-editor → editor}/sidebar/sidebar-uploads-tab.svelte +4 -4
- package/dist/components/{presentation-editor → editor}/sidebar/sidebar-wrapper.svelte +6 -4
- package/dist/components/{presentation-editor → editor}/sidebar/sidebar.svelte +17 -10
- package/dist/components/editor/sidebar/sidebar.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor → editor}/sidebar/uploads-image.svelte +3 -3
- package/dist/components/editor/types.d.ts +283 -0
- package/dist/components/{presentation-editor → editor}/utils.d.ts +14 -6
- package/dist/components/{presentation-editor → editor}/utils.js +98 -63
- package/dist/components/ui/color-picker/color-picker.svelte +2 -2
- package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte +2 -2
- package/dist/components/ui/context-menu/context-menu-radio-item.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte +1 -1
- package/dist/components/ui/dialog/dialog-content.svelte +3 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +3 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +2 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/slider/slider.svelte +28 -20
- package/dist/index.d.ts +12 -6
- package/dist/index.js +5 -3
- package/package.json +42 -38
- package/dist/components/presentation-editor/active-layers-buttons.svelte +0 -53
- package/dist/components/presentation-editor/active-layers.svelte +0 -181
- package/dist/components/presentation-editor/active-layers.svelte.d.ts +0 -3
- package/dist/components/presentation-editor/cursor-tooltip.svelte.d.ts +0 -18
- package/dist/components/presentation-editor/dragged.svelte.d.ts +0 -18
- package/dist/components/presentation-editor/header.svelte +0 -54
- package/dist/components/presentation-editor/header.svelte.d.ts +0 -18
- package/dist/components/presentation-editor/index.d.ts +0 -2
- package/dist/components/presentation-editor/index.js +0 -2
- package/dist/components/presentation-editor/layers/controls/group-resize-control/group-resize-control.svelte +0 -337
- package/dist/components/presentation-editor/layers/controls/rotate-control/rotate-control.svelte.d.ts +0 -3
- package/dist/components/presentation-editor/layers/index.d.ts +0 -9
- package/dist/components/presentation-editor/layers/types/background/background-content-image.svelte +0 -41
- package/dist/components/presentation-editor/layers/types/background/background-layer-content.svelte +0 -19
- package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte +0 -71
- package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/italic-button.svelte +0 -71
- package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte +0 -90
- package/dist/components/presentation-editor/layers/types/html/editor/utils.js +0 -88
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/index.d.ts +0 -3
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/index.js +0 -3
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/unstyled-list.d.ts +0 -47
- package/dist/components/presentation-editor/layers/types/html/extensions/unstyled-list/unstyled-list.js +0 -74
- package/dist/components/presentation-editor/layers/types/html/html-layer-content.svelte.d.ts +0 -9
- package/dist/components/presentation-editor/layers/types/html/html-layer-edit.svelte +0 -103
- package/dist/components/presentation-editor/layers/types/html/html-layer-edit.svelte.d.ts +0 -8
- package/dist/components/presentation-editor/layers/types/html/html-layer.svelte +0 -105
- package/dist/components/presentation-editor/layers/types/html/html-layer.svelte.d.ts +0 -7
- package/dist/components/presentation-editor/layers/types/html/index.d.ts +0 -5
- package/dist/components/presentation-editor/layers/types/html/index.js +0 -5
- package/dist/components/presentation-editor/layers/types/image/index.d.ts +0 -3
- package/dist/components/presentation-editor/layers/types/image/index.js +0 -3
- package/dist/components/presentation-editor/menu/slide-menu-content.svelte.d.ts +0 -9
- package/dist/components/presentation-editor/presentation-editor.svelte.d.ts +0 -4
- package/dist/components/presentation-editor/presentation-editor.svelte.js +0 -813
- package/dist/components/presentation-editor/sidebar/position-slidebar.svelte.d.ts +0 -18
- package/dist/components/presentation-editor/slide-editor.svelte.d.ts +0 -7
- package/dist/components/presentation-editor/slide-inner.svelte.d.ts +0 -18
- package/dist/components/presentation-editor/slides-navigation/slide-preview.svelte.d.ts +0 -11
- package/dist/components/presentation-editor/slides-navigation/slides-navigation.svelte.d.ts +0 -3
- package/dist/components/presentation-editor/types.d.ts +0 -158
- /package/dist/components/{presentation-editor → editor}/active-layers-buttons.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/color-indicator-gradient-def.svelte +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/color-indicator-gradient-def.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/color-indicator-gradient.svelte +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/color-indicator-gradient.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/color-indicator.svelte +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/color-indicator.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/color-indicator/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/fonts.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/fonts.js +0 -0
- /package/dist/components/{presentation-editor → editor}/hotkeys.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/active-background-border.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/active-layer-border.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/border-button/border-button.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/border-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/border-button/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/corner-radius-button/corner-radius-button.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/corner-radius-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/corner-radius-button/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/flip-button/flip-button.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/flip-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/flip-button/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/opacity-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/opacity-button/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/buttons/opacity-button/opacity-button.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/corner-scale-control/corner-scale-control.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/corner-scale-control/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/corner-scale-control/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/group-resize-control/group-resize-control.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/group-resize-control/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/group-resize-control/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/rotate-control/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/rotate-control/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/side-resize-control/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/side-resize-control/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/side-resize-control/side-resize-control.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/side-scale-control/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/controls/side-scale-control/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/layer-button.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/layer-thumb-wrapper.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/layer-wrapper.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/background/background-content-image.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/background/background-layer-buttons.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/background/background-layer.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/background/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/background/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/image/image-layer-active.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/image/image-layer-content.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/image/image-layer.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/alignment-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/alignment-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/bold-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/bold-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/case-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/case-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/color-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/color-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-family-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-family-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-size-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/font-size-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/italic-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/italic-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/list-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/list-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/strikethrough-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/strikethrough-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/underline-button/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/buttons/underline-button/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/Editor.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/Editor.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/createEditor.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/createEditor.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/editor-content.svelte +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/editor-content.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/types.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor/types.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/editor.css +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-family/font-family.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-family/font-family.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-family/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-family/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-size/font-size.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-size/font-size.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-size/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/font-size/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/line-height/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/line-height/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/line-height/line-height.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/line-height/line-height.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/selection/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/selection/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/selection/selection.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/selection/selection.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/text-transform/index.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/text-transform/index.js +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions/text-transform/text-transform.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/extensions.d.ts +0 -0
- /package/dist/components/{presentation-editor/layers/types/html → editor/layers/types/text}/html-content.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/menu/layer-menu-content.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/color-sidebar-color.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/color-sidebar-gradient-picker.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/color-sidebar.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/color-sidebar/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/font-sidebar/font-sidebar-button.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/font-sidebar/font-sidebar.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/font-sidebar/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/font-sidebar/index.js +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/sidebar-text-tab-button.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/sidebar-text-tab.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/sidebar-uploads-tab.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/sidebar-wrapper.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/sidebar/uploads-image.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/snapping-guides.svelte +0 -0
- /package/dist/components/{presentation-editor → editor}/snapping-guides.svelte.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/types.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peteai/presentation-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
31
31
|
"type": "module",
|
|
32
32
|
"exports": {
|
|
33
|
+
"./*": [
|
|
34
|
+
"./src/*/index.ts",
|
|
35
|
+
"./src/*.ts"
|
|
36
|
+
],
|
|
33
37
|
".": {
|
|
34
38
|
"types": "./dist/index.d.ts",
|
|
35
39
|
"svelte": "./dist/index.js"
|
|
@@ -43,57 +47,57 @@
|
|
|
43
47
|
"svelte": "^5.19.7"
|
|
44
48
|
},
|
|
45
49
|
"devDependencies": {
|
|
46
|
-
"@playwright/test": "^1.
|
|
47
|
-
"@sveltejs/adapter-auto": "^6.0.
|
|
48
|
-
"@sveltejs/kit": "^2.
|
|
49
|
-
"@sveltejs/package": "^2.
|
|
50
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
50
|
+
"@playwright/test": "^1.54.1",
|
|
51
|
+
"@sveltejs/adapter-auto": "^6.0.1",
|
|
52
|
+
"@sveltejs/kit": "^2.26.1",
|
|
53
|
+
"@sveltejs/package": "^2.4.0",
|
|
54
|
+
"@sveltejs/vite-plugin-svelte": "^6.1.0",
|
|
51
55
|
"@types/eslint": "^9.6.1",
|
|
52
56
|
"@types/uniqid": "^5.3.4",
|
|
53
57
|
"@types/webfontloader": "^1.6.38",
|
|
54
58
|
"autoprefixer": "^10.4.21",
|
|
55
|
-
"eslint": "^9.
|
|
56
|
-
"eslint-config-prettier": "^10.1.
|
|
57
|
-
"eslint-plugin-svelte": "^3.
|
|
58
|
-
"globals": "^16.
|
|
59
|
+
"eslint": "^9.32.0",
|
|
60
|
+
"eslint-config-prettier": "^10.1.8",
|
|
61
|
+
"eslint-plugin-svelte": "^3.11.0",
|
|
62
|
+
"globals": "^16.3.0",
|
|
59
63
|
"postcss-cli": "^11.0.1",
|
|
60
|
-
"prettier": "^3.
|
|
61
|
-
"prettier-plugin-svelte": "^3.
|
|
62
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
64
|
+
"prettier": "^3.6.2",
|
|
65
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
66
|
+
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
63
67
|
"publint": "^0.3.12",
|
|
64
|
-
"svelte": "^5.
|
|
65
|
-
"svelte-check": "^4.
|
|
68
|
+
"svelte": "^5.37.1",
|
|
69
|
+
"svelte-check": "^4.3.0",
|
|
66
70
|
"svelte-kit-sst": "^2.43.5",
|
|
67
71
|
"tailwindcss": "^3.4.17",
|
|
68
72
|
"typescript": "^5.8.3",
|
|
69
|
-
"typescript-eslint": "^8.
|
|
70
|
-
"vite": "^
|
|
71
|
-
"vitest": "^3.
|
|
73
|
+
"typescript-eslint": "^8.38.0",
|
|
74
|
+
"vite": "^7.0.6",
|
|
75
|
+
"vitest": "^3.2.4"
|
|
72
76
|
},
|
|
73
77
|
"dependencies": {
|
|
74
|
-
"@
|
|
75
|
-
"@tiptap/
|
|
76
|
-
"@tiptap/extension-
|
|
77
|
-
"@tiptap/extension-
|
|
78
|
-
"@tiptap/extension-
|
|
79
|
-
"@tiptap/extension-
|
|
80
|
-
"@tiptap/extension-
|
|
81
|
-
"@tiptap/extension-list-
|
|
82
|
-
"@tiptap/extension-
|
|
83
|
-
"@tiptap/extension-
|
|
84
|
-
"@tiptap/extension-
|
|
85
|
-
"@tiptap/extension-
|
|
86
|
-
"@tiptap/extension-text
|
|
87
|
-
"@tiptap/extension-text-
|
|
88
|
-
"@tiptap/extension-
|
|
89
|
-
"@tiptap/
|
|
90
|
-
"
|
|
78
|
+
"@lucide/svelte": "^0.534.0",
|
|
79
|
+
"@tiptap/core": "^2.14.0",
|
|
80
|
+
"@tiptap/extension-bold": "^2.14.0",
|
|
81
|
+
"@tiptap/extension-bullet-list": "^2.14.0",
|
|
82
|
+
"@tiptap/extension-color": "^2.14.0",
|
|
83
|
+
"@tiptap/extension-document": "^2.14.0",
|
|
84
|
+
"@tiptap/extension-italic": "^2.14.0",
|
|
85
|
+
"@tiptap/extension-list-item": "^2.14.0",
|
|
86
|
+
"@tiptap/extension-list-keymap": "^2.14.0",
|
|
87
|
+
"@tiptap/extension-ordered-list": "^2.14.0",
|
|
88
|
+
"@tiptap/extension-paragraph": "^2.14.0",
|
|
89
|
+
"@tiptap/extension-strike": "^2.14.0",
|
|
90
|
+
"@tiptap/extension-text": "^2.14.0",
|
|
91
|
+
"@tiptap/extension-text-align": "^2.14.0",
|
|
92
|
+
"@tiptap/extension-text-style": "^2.14.0",
|
|
93
|
+
"@tiptap/extension-underline": "^2.14.0",
|
|
94
|
+
"@tiptap/pm": "^2.14.0",
|
|
95
|
+
"bits-ui": "^2.8.13",
|
|
91
96
|
"clsx": "^2.1.1",
|
|
92
97
|
"esm-env": "^1.2.2",
|
|
93
|
-
"
|
|
94
|
-
"svelte-dnd-action": "^0.9.57",
|
|
98
|
+
"svelte-dnd-action": "^0.9.64",
|
|
95
99
|
"svelte-radix": "^2.0.1",
|
|
96
|
-
"tailwind-merge": "^3.
|
|
100
|
+
"tailwind-merge": "^3.3.1",
|
|
97
101
|
"tailwind-variants": "^1.0.0",
|
|
98
102
|
"tailwindcss-animate": "^1.0.7",
|
|
99
103
|
"uniqid": "^5.4.0",
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Separator } from '../ui/separator/index.js';
|
|
3
|
-
import { BorderButton } from './layers/buttons/border-button/index.js';
|
|
4
|
-
import { CornerRadiusButton } from './layers/buttons/corner-radius-button/index.js';
|
|
5
|
-
import { FlipButton } from './layers/buttons/flip-button/index.js';
|
|
6
|
-
import { OpacityButton } from './layers/buttons/opacity-button/index.js';
|
|
7
|
-
import { AlignmentButton } from './layers/types/html/buttons/alignment-button/index.js';
|
|
8
|
-
import { BoldButton } from './layers/types/html/buttons/bold-button/index.js';
|
|
9
|
-
import { CaseButton } from './layers/types/html/buttons/case-button/index.js';
|
|
10
|
-
import { ColorButton } from './layers/types/html/buttons/color-button/index.js';
|
|
11
|
-
import { FontFamilyButton } from './layers/types/html/buttons/font-family-button/index.js';
|
|
12
|
-
import { FontSizeButton } from './layers/types/html/buttons/font-size-button/index.js';
|
|
13
|
-
import { ItalicButton } from './layers/types/html/buttons/italic-button/index.js';
|
|
14
|
-
import { ListButton } from './layers/types/html/buttons/list-button/index.js';
|
|
15
|
-
import { StrikethroughButton } from './layers/types/html/buttons/strikethrough-button/index.js';
|
|
16
|
-
import { UnderlineButton } from './layers/types/html/buttons/underline-button/index.js';
|
|
17
|
-
import { getPresentationEditorContext } from './presentation-editor.svelte.js';
|
|
18
|
-
|
|
19
|
-
const editor = getPresentationEditorContext();
|
|
20
|
-
|
|
21
|
-
let noLockedLayers = $derived(editor.activeLayers.filter((layer) => !layer.locked));
|
|
22
|
-
let imageLayers = $derived(noLockedLayers.filter((layer) => layer.type === 'image'));
|
|
23
|
-
let htmlLayers = $derived(noLockedLayers.filter((layer) => layer.type === 'html'));
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
{#if editor.activeLayers.length}
|
|
27
|
-
{#if imageLayers.length}
|
|
28
|
-
<Separator orientation="vertical" />
|
|
29
|
-
<BorderButton bind:layers={imageLayers} />
|
|
30
|
-
<CornerRadiusButton bind:layers={imageLayers} />
|
|
31
|
-
{#if htmlLayers.length === 0}
|
|
32
|
-
<Separator orientation="vertical" />
|
|
33
|
-
<FlipButton bind:layers={imageLayers} />
|
|
34
|
-
{/if}
|
|
35
|
-
{/if}
|
|
36
|
-
{#if htmlLayers.length}
|
|
37
|
-
<Separator orientation="vertical" />
|
|
38
|
-
<FontFamilyButton bind:layers={htmlLayers} />
|
|
39
|
-
<FontSizeButton bind:layers={htmlLayers} />
|
|
40
|
-
<ColorButton bind:layers={htmlLayers} />
|
|
41
|
-
<BoldButton bind:layers={htmlLayers} />
|
|
42
|
-
<ItalicButton bind:layers={htmlLayers} />
|
|
43
|
-
<UnderlineButton bind:layers={htmlLayers} />
|
|
44
|
-
<StrikethroughButton bind:layers={htmlLayers} />
|
|
45
|
-
<CaseButton bind:layers={htmlLayers} />
|
|
46
|
-
<AlignmentButton bind:layers={htmlLayers} />
|
|
47
|
-
<ListButton bind:layers={htmlLayers} />
|
|
48
|
-
{/if}
|
|
49
|
-
{#if noLockedLayers.length}
|
|
50
|
-
<Separator orientation="vertical" />
|
|
51
|
-
<OpacityButton bind:layers={noLockedLayers} />
|
|
52
|
-
{/if}
|
|
53
|
-
{/if}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { getPresentationEditorContext } from './presentation-editor.svelte.js';
|
|
3
|
-
import {
|
|
4
|
-
calculateLayerTransform,
|
|
5
|
-
calculateGroupRotatedBoundingBox,
|
|
6
|
-
calculateRelativeRects,
|
|
7
|
-
isRotatedVertically,
|
|
8
|
-
} from './layers/utils.js';
|
|
9
|
-
import { SideScaleControl } from './layers/controls/side-scale-control/index.js';
|
|
10
|
-
import { SideResizeControl } from './layers/controls/side-resize-control/index.js';
|
|
11
|
-
import { GroupResizeControl } from './layers/controls/group-resize-control/index.js';
|
|
12
|
-
import { CornerScaleControl } from './layers/controls/corner-scale-control/index.js';
|
|
13
|
-
import { RotateControl } from './layers/controls/rotate-control/index.js';
|
|
14
|
-
import { HtmlLayerEdit } from './layers/index.js';
|
|
15
|
-
import type { HtmlLayer } from './types.js';
|
|
16
|
-
|
|
17
|
-
const editor = getPresentationEditorContext();
|
|
18
|
-
|
|
19
|
-
let htmlLayerEditing: HtmlLayer | undefined = $derived.by(() => {
|
|
20
|
-
if (editor.activeAction?.type === 'edit' && editor.activeLayers.length === 1) {
|
|
21
|
-
const layer = editor.activeLayers[0];
|
|
22
|
-
if (editor.activeAction.id == layer.id && layer.type === 'html') {
|
|
23
|
-
return layer;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const group = $derived.by(() => {
|
|
29
|
-
if (editor.activeBackground) {
|
|
30
|
-
return {
|
|
31
|
-
bbox: {
|
|
32
|
-
x: 0,
|
|
33
|
-
y: 0,
|
|
34
|
-
width: editor.width,
|
|
35
|
-
height: editor.height,
|
|
36
|
-
rotate: 0,
|
|
37
|
-
},
|
|
38
|
-
padding: 3,
|
|
39
|
-
items: [],
|
|
40
|
-
};
|
|
41
|
-
} else if (editor.activeLayers.length === 1) {
|
|
42
|
-
return {
|
|
43
|
-
bbox: calculateLayerTransform(editor.activeLayers[0]),
|
|
44
|
-
padding: 0,
|
|
45
|
-
items: [],
|
|
46
|
-
};
|
|
47
|
-
} else if (editor.activeLayers.length > 1) {
|
|
48
|
-
const transforms = editor.activeLayers.map(calculateLayerTransform);
|
|
49
|
-
const bbox = calculateGroupRotatedBoundingBox(transforms, editor.activeGroupRotate);
|
|
50
|
-
const items = calculateRelativeRects(bbox, transforms);
|
|
51
|
-
|
|
52
|
-
return { bbox, padding: 0, items };
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Determines if resizing should be forbidden based on the rotation of the group and its layers.
|
|
58
|
-
*
|
|
59
|
-
* @param {number} groupRotate - The rotation of the group in degrees.
|
|
60
|
-
* @returns {(boolean|string)} - Returns 'horizontal' or 'vertical' if resizing should be forbidden in that direction, otherwise returns false.
|
|
61
|
-
*/
|
|
62
|
-
const getConstrainedResizeAxis = (groupRotate: number) => {
|
|
63
|
-
// Check if all active layers are of type 'html'
|
|
64
|
-
const htmlLayersOnly = editor.activeLayers.every((layer) => layer.type === 'html');
|
|
65
|
-
if (!htmlLayersOnly) return false; // If not all layers are 'html', resizing is not forbidden
|
|
66
|
-
|
|
67
|
-
// Calculate the rotation of the first layer relative to the group rotation
|
|
68
|
-
const firstLayerRelativeRotate = (editor.activeLayers[0].rotate || 0) - groupRotate;
|
|
69
|
-
// Determine if the first layer is rotated vertically
|
|
70
|
-
const firstLayerRotatedVertically = isRotatedVertically(firstLayerRelativeRotate);
|
|
71
|
-
|
|
72
|
-
// Check if all layers have the same rotation direction relative to the group rotation
|
|
73
|
-
const allLayersHaveSameRotationDirection = editor.activeLayers.every(
|
|
74
|
-
(layer) =>
|
|
75
|
-
isRotatedVertically((layer.rotate || 0) - groupRotate) === firstLayerRotatedVertically,
|
|
76
|
-
);
|
|
77
|
-
if (!allLayersHaveSameRotationDirection) return false; // If not all layers have the same rotation direction, resizing is not forbidden
|
|
78
|
-
|
|
79
|
-
// Based on the rotation direction, determine the direction in which resizing should be forbidden
|
|
80
|
-
return firstLayerRotatedVertically ? 'horizontal' : 'vertical';
|
|
81
|
-
};
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
{#if htmlLayerEditing}
|
|
85
|
-
<HtmlLayerEdit bind:layer={htmlLayerEditing} />
|
|
86
|
-
{/if}
|
|
87
|
-
|
|
88
|
-
{#if group}
|
|
89
|
-
<div
|
|
90
|
-
class="pointer-events-none absolute left-0 top-0 h-full w-full"
|
|
91
|
-
style:width={`${group.bbox.width * editor.zoom + group.padding * 2}px`}
|
|
92
|
-
style:height={`${group.bbox.height * editor.zoom + group.padding * 2}px`}
|
|
93
|
-
style:transform={`translate(${group.bbox.x * editor.zoom - group.padding}px, ${group.bbox.y * editor.zoom - group.padding}px) rotate(${group.bbox.rotate}deg)`}
|
|
94
|
-
>
|
|
95
|
-
{#if group.items.length < 2}
|
|
96
|
-
<div
|
|
97
|
-
class="border-primary absolute -inset-px border-2"
|
|
98
|
-
style:box-shadow="0 0 0 1px hsla(0, 0%, 100%, .07), inset 0 0 0 1px hsla(0, 0%, 100%, .07)"
|
|
99
|
-
></div>
|
|
100
|
-
{:else}
|
|
101
|
-
<div class="group-border absolute -inset-px"></div>
|
|
102
|
-
{#each group.items as item}
|
|
103
|
-
<div
|
|
104
|
-
class="border-primary absolute -left-px -top-px border-2"
|
|
105
|
-
style:box-shadow="0 0 0 1px hsla(0, 0%, 100%, .07), inset 0 0 0 1px hsla(0, 0%, 100%, .07)"
|
|
106
|
-
style:width={`${item.width * editor.zoom + 2}px`}
|
|
107
|
-
style:height={`${item.height * editor.zoom + 2}px`}
|
|
108
|
-
style:transform={`translate(${item.x * editor.zoom}px, ${item.y * editor.zoom}px) rotate(${item.rotate}deg)`}
|
|
109
|
-
></div>
|
|
110
|
-
{/each}
|
|
111
|
-
{/if}
|
|
112
|
-
|
|
113
|
-
{#if editor.activeLayers.length > 0 && !editor.activeSlide.locked && !editor.activeLayers.some((l) => l.locked)}
|
|
114
|
-
<div class="h-full w-full outline-none transition-opacity duration-300">
|
|
115
|
-
<div class="flex h-full w-full items-center justify-center">
|
|
116
|
-
{#if editor.activeLayers.length === 1}
|
|
117
|
-
{@const layer = editor.activeLayers[0]}
|
|
118
|
-
{#if layer.type === 'html'}
|
|
119
|
-
<SideScaleControl origin="left" {layer} />
|
|
120
|
-
<SideScaleControl origin="right" {layer} />
|
|
121
|
-
{:else if layer.type === 'image'}
|
|
122
|
-
<SideResizeControl origin="left" {layer} />
|
|
123
|
-
<SideResizeControl origin="right" {layer} />
|
|
124
|
-
<SideResizeControl origin="top" {layer} />
|
|
125
|
-
<SideResizeControl origin="bottom" {layer} />
|
|
126
|
-
{/if}
|
|
127
|
-
{:else}
|
|
128
|
-
{@const constrainedResizeAxis = getConstrainedResizeAxis(group.bbox.rotate)}
|
|
129
|
-
{#if constrainedResizeAxis !== 'horizontal'}
|
|
130
|
-
<GroupResizeControl origin="left" />
|
|
131
|
-
<GroupResizeControl origin="right" />
|
|
132
|
-
{/if}
|
|
133
|
-
{#if constrainedResizeAxis !== 'vertical'}
|
|
134
|
-
<GroupResizeControl origin="top" />
|
|
135
|
-
<GroupResizeControl origin="bottom" />
|
|
136
|
-
{/if}
|
|
137
|
-
{/if}
|
|
138
|
-
<CornerScaleControl origin="bottom-right" />
|
|
139
|
-
<CornerScaleControl origin="bottom-left" />
|
|
140
|
-
<CornerScaleControl origin="top-right" />
|
|
141
|
-
<CornerScaleControl origin="top-left" />
|
|
142
|
-
<RotateControl />
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
{/if}
|
|
146
|
-
</div>
|
|
147
|
-
{/if}
|
|
148
|
-
|
|
149
|
-
<style>
|
|
150
|
-
.group-border {
|
|
151
|
-
background-image: linear-gradient(90deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
152
|
-
linear-gradient(180deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
153
|
-
linear-gradient(90deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
154
|
-
linear-gradient(180deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
155
|
-
linear-gradient(90deg, rgba(57, 76, 96, 0.15), rgba(57, 76, 96, 0.15)),
|
|
156
|
-
linear-gradient(180deg, rgba(57, 76, 96, 0.15), rgba(57, 76, 96, 0.15)),
|
|
157
|
-
linear-gradient(90deg, rgba(57, 76, 96, 0.15), rgba(57, 76, 96, 0.15)),
|
|
158
|
-
linear-gradient(180deg, rgba(57, 76, 96, 0.15), rgba(57, 76, 96, 0.15));
|
|
159
|
-
background-position:
|
|
160
|
-
top,
|
|
161
|
-
100%,
|
|
162
|
-
bottom,
|
|
163
|
-
0,
|
|
164
|
-
center 2px,
|
|
165
|
-
calc(100% - 2px),
|
|
166
|
-
center calc(100% - 2px),
|
|
167
|
-
2px;
|
|
168
|
-
background-repeat: repeat-x, repeat-y, repeat-x, repeat-y, no-repeat, no-repeat, no-repeat,
|
|
169
|
-
no-repeat;
|
|
170
|
-
background-size:
|
|
171
|
-
6px 2px,
|
|
172
|
-
2px 6px,
|
|
173
|
-
6px 2px,
|
|
174
|
-
2px 6px,
|
|
175
|
-
calc(100% - 6px) 1px,
|
|
176
|
-
1px calc(100% - 4px),
|
|
177
|
-
calc(100% - 6px) 1px,
|
|
178
|
-
1px calc(100% - 4px);
|
|
179
|
-
box-shadow: 0 0 0 1px rgba(57, 76, 96, 0.15);
|
|
180
|
-
}
|
|
181
|
-
</style>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const CursorTooltip: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type CursorTooltip = InstanceType<typeof CursorTooltip>;
|
|
18
|
-
export default CursorTooltip;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const Dragged: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type Dragged = InstanceType<typeof Dragged>;
|
|
18
|
-
export default Dragged;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import UndoIcon from 'lucide-svelte/icons/undo-2';
|
|
3
|
-
import RedoIcon from 'lucide-svelte/icons/redo-2';
|
|
4
|
-
import { Separator } from '../ui/separator/index.js';
|
|
5
|
-
import { Button } from '../ui/button/index.js';
|
|
6
|
-
import { getPresentationEditorContext } from './presentation-editor.svelte.js';
|
|
7
|
-
import { BackgroundLayerButtons } from './layers/index.js';
|
|
8
|
-
import ActiveLayersButtons from './active-layers-buttons.svelte';
|
|
9
|
-
|
|
10
|
-
const editor = getPresentationEditorContext();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<div class="bg-background h-12 w-full border-b border-gray-200 px-2">
|
|
14
|
-
<div class="flex h-full items-center justify-between">
|
|
15
|
-
<div class="grid grid-flow-col items-center gap-2">
|
|
16
|
-
<Button
|
|
17
|
-
variant="ghost"
|
|
18
|
-
size="icon-xs"
|
|
19
|
-
disabled={editor.historyIndex === -1}
|
|
20
|
-
onclick={() => editor.historyUndo()}
|
|
21
|
-
>
|
|
22
|
-
<UndoIcon class="h-6 w-6" />
|
|
23
|
-
</Button>
|
|
24
|
-
<Button
|
|
25
|
-
variant="ghost"
|
|
26
|
-
size="icon-xs"
|
|
27
|
-
disabled={editor.historyIndex === editor.historyActions.length - 1}
|
|
28
|
-
onclick={() => editor.historyRedo()}
|
|
29
|
-
>
|
|
30
|
-
<RedoIcon class="h-6 w-6" />
|
|
31
|
-
</Button>
|
|
32
|
-
<div class="grid grid-flow-col items-center gap-2 overflow-x-auto">
|
|
33
|
-
{#if !editor.activeSlide.locked}
|
|
34
|
-
{#if editor.activeBackground}
|
|
35
|
-
{#if !editor.activeSlide.backgroundLocked}
|
|
36
|
-
<BackgroundLayerButtons />
|
|
37
|
-
{/if}
|
|
38
|
-
{:else if editor.activeLayers.length}
|
|
39
|
-
<ActiveLayersButtons />
|
|
40
|
-
{/if}
|
|
41
|
-
{/if}
|
|
42
|
-
</div>
|
|
43
|
-
<Separator orientation="vertical" />
|
|
44
|
-
<Button
|
|
45
|
-
variant="ghost"
|
|
46
|
-
size="xs"
|
|
47
|
-
active={editor.activeSidebarPopup === 'position'}
|
|
48
|
-
onclick={() => editor.toggleActiveSidebarPopup('position')}
|
|
49
|
-
>
|
|
50
|
-
Position
|
|
51
|
-
</Button>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const Header: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type Header = InstanceType<typeof Header>;
|
|
18
|
-
export default Header;
|