@peteai/presentation-editor 0.0.6 → 0.0.7
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/{presentation-editor → editor}/active-layers.svelte +89 -48
- 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} +53 -48
- package/dist/components/editor/editor.svelte.d.ts +4 -0
- package/dist/components/editor/editor.svelte.js +1167 -0
- package/dist/components/{presentation-editor → editor}/header.svelte +11 -7
- package/dist/components/editor/header.svelte.d.ts +7 -0
- package/dist/components/{presentation-editor → editor}/hotkeys.svelte +41 -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 +32 -38
- 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 +27 -34
- package/dist/components/{presentation-editor → editor}/layers/controls/side-resize-control/side-resize-control.svelte +9 -13
- 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/{presentation-editor → editor}/layers/index.d.ts +3 -2
- package/dist/components/{presentation-editor → editor}/layers/index.js +6 -3
- 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/{presentation-editor → editor}/layers/types/background/background-content-image.svelte +2 -2
- 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 +5 -7
- 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/{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 +14 -11
- package/dist/components/{presentation-editor → editor}/layers/types/image/image-layer.svelte +8 -14
- 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 +264 -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 +9 -16
- package/dist/components/{presentation-editor → editor}/layers/utils.js +65 -68
- 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} +25 -24
- 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/{presentation-editor/sidebar/position-slidebar.svelte → editor/sidebar/position-sidebar.svelte} +28 -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 +11 -7
- 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 +282 -0
- package/dist/components/{presentation-editor → editor}/utils.d.ts +14 -6
- package/dist/components/{presentation-editor → editor}/utils.js +97 -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/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.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/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/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}/active-layers.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/rotate-control/rotate-control.svelte.d.ts +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 → editor}/layers/types/image/index.d.ts +0 -0
- /package/dist/components/{presentation-editor → editor}/layers/types/image/index.js +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/README.md
CHANGED
|
@@ -31,8 +31,8 @@ interface BaseLayer {
|
|
|
31
31
|
sortOrder: number;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
interface
|
|
35
|
-
type: '
|
|
34
|
+
interface TextLayer extends BaseLayer {
|
|
35
|
+
type: 'text';
|
|
36
36
|
scale: number | null;
|
|
37
37
|
html: JSONContent;
|
|
38
38
|
}
|
|
@@ -54,9 +54,9 @@ interface ImageLayer extends BaseLayer, LayerBorder {
|
|
|
54
54
|
flipY: boolean;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
type Layer =
|
|
57
|
+
type Layer = TextLayer | ImageLayer;
|
|
58
58
|
|
|
59
|
-
type
|
|
59
|
+
type Page = {
|
|
60
60
|
id: string;
|
|
61
61
|
backgroundColor: string | null;
|
|
62
62
|
layers: Layer[];
|
|
@@ -66,9 +66,9 @@ type Slide = {
|
|
|
66
66
|
|
|
67
67
|
### Html editor
|
|
68
68
|
|
|
69
|
-
PresentationEditor is using `Tiptap` editor for `
|
|
69
|
+
PresentationEditor is using `Tiptap` editor for `TextLayer` content editing.
|
|
70
70
|
|
|
71
|
-
`JSONContent` type provided by `@tiptap/core` is used for html content of `
|
|
71
|
+
`JSONContent` type provided by `@tiptap/core` is used for html content of `TextLayer` to store data in json format.
|
|
72
72
|
|
|
73
73
|
## Settings
|
|
74
74
|
|
|
@@ -81,22 +81,22 @@ interface BaseOptions {
|
|
|
81
81
|
height?: number;
|
|
82
82
|
generateId?: () => string;
|
|
83
83
|
onImageUpload?: (file: File) => Promise<Image>;
|
|
84
|
-
onLayerAdd?: (
|
|
85
|
-
onLayerUpdate?: (
|
|
86
|
-
onLayerRemove?: (
|
|
84
|
+
onLayerAdd?: (pageId: string, layer: Layer) => Promise<Layer>;
|
|
85
|
+
onLayerUpdate?: (pageId: string, layerId: string, layerType: string, changes: object) => void;
|
|
86
|
+
onLayerRemove?: (pageId: string, layerId: string, layerType: string) => Promise<void>;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
interface MultipleModeOption extends BaseOptions {
|
|
90
90
|
mode?: 'multiple';
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
pages?: Page[];
|
|
92
|
+
onPageAdd?: (page: Page) => Promise<Page>;
|
|
93
|
+
onPageUpdate?: (pageId: string, changes: object) => void;
|
|
94
|
+
onPageRemove?: (pageId: string) => Promise<void>;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
interface SingleModeOption extends BaseOptions {
|
|
98
98
|
mode: 'single';
|
|
99
|
-
|
|
99
|
+
page?: Page;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export type PresentationEditorOptions = MultipleModeOption | SingleModeOption;
|
|
@@ -109,82 +109,82 @@ import { createEditor } from '@peteai/presentation-editor';
|
|
|
109
109
|
|
|
110
110
|
// images list
|
|
111
111
|
const images: Image[];
|
|
112
|
-
//
|
|
113
|
-
const
|
|
112
|
+
// pages list
|
|
113
|
+
const pages: Page[];
|
|
114
114
|
|
|
115
115
|
const editor = new createEditor({
|
|
116
116
|
target: document.querySelector('.target'),
|
|
117
117
|
props: {
|
|
118
|
-
// function for new
|
|
118
|
+
// function for new pages and layers ids generation
|
|
119
119
|
generateId: () => crypto.randomUUID(),
|
|
120
120
|
images,
|
|
121
|
-
|
|
121
|
+
pages,
|
|
122
122
|
onImageUpload: async (file) => {
|
|
123
123
|
// called when user uploads image
|
|
124
124
|
// callback to store file and return Image
|
|
125
125
|
// which will be added to the images list
|
|
126
|
-
// new ImageLayer gonna be created if image file was dropped on
|
|
126
|
+
// new ImageLayer gonna be created if image file was dropped on page
|
|
127
127
|
// ...
|
|
128
128
|
return image;
|
|
129
129
|
},
|
|
130
|
-
|
|
131
|
-
// called when new
|
|
132
|
-
// expect
|
|
130
|
+
onPageAdd: async (page) => {
|
|
131
|
+
// called when new page is added
|
|
132
|
+
// expect Page to be returned to overwrite newly created page
|
|
133
133
|
},
|
|
134
|
-
|
|
135
|
-
// called when
|
|
134
|
+
onPageUpdate: async (pageId, values) => {
|
|
135
|
+
// called when page is updated
|
|
136
136
|
},
|
|
137
|
-
|
|
138
|
-
// called when
|
|
137
|
+
onPageRemove: async (pageId) => {
|
|
138
|
+
// called when page is removed
|
|
139
139
|
},
|
|
140
|
-
onLayerAdd: async (
|
|
140
|
+
onLayerAdd: async (pageId, layer) => {
|
|
141
141
|
// called when new layer is added
|
|
142
142
|
// expect Layer to be returned to overwrite newly created layer
|
|
143
143
|
},
|
|
144
|
-
onLayerUpdate: async (
|
|
144
|
+
onLayerUpdate: async (pageId, layerId, layerType, values) => {
|
|
145
145
|
// called when layer is updated
|
|
146
146
|
},
|
|
147
|
-
onLayerRemove: async (
|
|
147
|
+
onLayerRemove: async (pageId, layerId, layerType) => {
|
|
148
148
|
// called when layer is removed
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
## Single
|
|
154
|
+
## Single Page Mode
|
|
155
155
|
|
|
156
156
|
```typescript
|
|
157
157
|
import { createEditor } from '@peteai/presentation-editor';
|
|
158
158
|
|
|
159
159
|
// images list
|
|
160
160
|
const images: Image[];
|
|
161
|
-
//
|
|
162
|
-
const
|
|
161
|
+
// pages list
|
|
162
|
+
const page: Page;
|
|
163
163
|
|
|
164
164
|
const editor = new createEditor({
|
|
165
165
|
target: document.querySelector('.target'),
|
|
166
166
|
props: {
|
|
167
167
|
mode: 'single',
|
|
168
|
-
// function for new
|
|
168
|
+
// function for new pages and layers ids generation
|
|
169
169
|
generateId: () => crypto.randomUUID(),
|
|
170
170
|
images,
|
|
171
|
-
|
|
171
|
+
page,
|
|
172
172
|
onImageUpload: async (file) => {
|
|
173
173
|
// called when user uploads image
|
|
174
174
|
// callback to store file and return Image
|
|
175
175
|
// which will be added to the images list
|
|
176
|
-
// new ImageLayer gonna be created if image file was dropped on
|
|
176
|
+
// new ImageLayer gonna be created if image file was dropped on page
|
|
177
177
|
// ...
|
|
178
178
|
return image;
|
|
179
179
|
},
|
|
180
|
-
onLayerAdd: async (
|
|
180
|
+
onLayerAdd: async (pageId, layer) => {
|
|
181
181
|
// called when new layer is added
|
|
182
182
|
// expect Layer to be returned to overwrite newly created layer
|
|
183
183
|
},
|
|
184
|
-
onLayerUpdate: async (
|
|
184
|
+
onLayerUpdate: async (pageId, layerId, layerType, values) => {
|
|
185
185
|
// called when layer is updated
|
|
186
186
|
},
|
|
187
|
-
onLayerRemove: async (
|
|
187
|
+
onLayerRemove: async (pageId, layerId, layerType) => {
|
|
188
188
|
// called when layer is removed
|
|
189
189
|
},
|
|
190
190
|
},
|
|
@@ -0,0 +1,56 @@
|
|
|
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/text/buttons/alignment-button/index.js';
|
|
8
|
+
import { BoldButton } from './layers/types/text/buttons/bold-button/index.js';
|
|
9
|
+
import { CaseButton } from './layers/types/text/buttons/case-button/index.js';
|
|
10
|
+
import { ColorButton } from './layers/types/text/buttons/color-button/index.js';
|
|
11
|
+
import { FontFamilyButton } from './layers/types/text/buttons/font-family-button/index.js';
|
|
12
|
+
import { FontSizeButton } from './layers/types/text/buttons/font-size-button/index.js';
|
|
13
|
+
import { ItalicButton } from './layers/types/text/buttons/italic-button/index.js';
|
|
14
|
+
import { ListButton } from './layers/types/text/buttons/list-button/index.js';
|
|
15
|
+
import { StrikethroughButton } from './layers/types/text/buttons/strikethrough-button/index.js';
|
|
16
|
+
import { UnderlineButton } from './layers/types/text/buttons/underline-button/index.js';
|
|
17
|
+
import { getEditorContext } from './editor.svelte.js';
|
|
18
|
+
|
|
19
|
+
const editor = getEditorContext();
|
|
20
|
+
|
|
21
|
+
let imageLayers = $derived(
|
|
22
|
+
editor.selectedSimpleLayersNotLocked.filter((layer) => layer.type === 'image'),
|
|
23
|
+
);
|
|
24
|
+
let textLayers = $derived(
|
|
25
|
+
editor.selectedSimpleLayersNotLocked.filter((layer) => layer.type === 'text'),
|
|
26
|
+
);
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
{#if editor.activeLayers.length}
|
|
30
|
+
{#if imageLayers.length}
|
|
31
|
+
<Separator orientation="vertical" />
|
|
32
|
+
<BorderButton bind:layers={imageLayers} />
|
|
33
|
+
<CornerRadiusButton bind:layers={imageLayers} />
|
|
34
|
+
{#if textLayers.length === 0}
|
|
35
|
+
<Separator orientation="vertical" />
|
|
36
|
+
<FlipButton bind:layers={imageLayers} />
|
|
37
|
+
{/if}
|
|
38
|
+
{/if}
|
|
39
|
+
{#if textLayers.length}
|
|
40
|
+
<Separator orientation="vertical" />
|
|
41
|
+
<FontFamilyButton bind:layers={textLayers} />
|
|
42
|
+
<FontSizeButton bind:layers={textLayers} />
|
|
43
|
+
<ColorButton bind:layers={textLayers} />
|
|
44
|
+
<BoldButton bind:layers={textLayers} />
|
|
45
|
+
<ItalicButton bind:layers={textLayers} />
|
|
46
|
+
<UnderlineButton bind:layers={textLayers} />
|
|
47
|
+
<StrikethroughButton bind:layers={textLayers} />
|
|
48
|
+
<CaseButton bind:layers={textLayers} />
|
|
49
|
+
<AlignmentButton bind:layers={textLayers} />
|
|
50
|
+
<ListButton bind:layers={textLayers} />
|
|
51
|
+
{/if}
|
|
52
|
+
{#if editor.selectedLayersNotLocked.length}
|
|
53
|
+
<Separator orientation="vertical" />
|
|
54
|
+
<OpacityButton bind:layers={editor.selectedLayersNotLocked} />
|
|
55
|
+
{/if}
|
|
56
|
+
{/if}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { getEditorContext } from './editor.svelte.js';
|
|
3
3
|
import {
|
|
4
|
-
calculateLayerTransform,
|
|
5
4
|
calculateGroupRotatedBoundingBox,
|
|
6
5
|
calculateRelativeRects,
|
|
7
6
|
isRotatedVertically,
|
|
@@ -11,22 +10,35 @@
|
|
|
11
10
|
import { GroupResizeControl } from './layers/controls/group-resize-control/index.js';
|
|
12
11
|
import { CornerScaleControl } from './layers/controls/corner-scale-control/index.js';
|
|
13
12
|
import { RotateControl } from './layers/controls/rotate-control/index.js';
|
|
14
|
-
import {
|
|
15
|
-
import type {
|
|
13
|
+
import { TextLayerEdit } from './layers/index.js';
|
|
14
|
+
import type { GroupLayer, Layer, TextLayer } from './types.js';
|
|
16
15
|
|
|
17
|
-
const editor =
|
|
16
|
+
const editor = getEditorContext();
|
|
18
17
|
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
let textLayerEditing: { layer: TextLayer; groupLayer?: GroupLayer } | undefined = $derived.by(
|
|
19
|
+
() => {
|
|
20
|
+
if (editor.activeAction?.type === 'edit') {
|
|
21
|
+
if (editor.activeSelection.type === 'root-layers') {
|
|
22
|
+
if (editor.activeLayers.length === 1) {
|
|
23
|
+
const layer = editor.activeLayers[0];
|
|
24
|
+
if (editor.activeAction.id == layer.id && layer.type === 'text') {
|
|
25
|
+
return { layer };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
} else if (editor.activeSelection.type === 'child-layer') {
|
|
29
|
+
if (editor.activeGroupAndChild) {
|
|
30
|
+
const { childLayer, groupLayer } = editor.activeGroupAndChild;
|
|
31
|
+
if (editor.activeAction.id == childLayer.id && childLayer.type === 'text') {
|
|
32
|
+
return { layer: childLayer, groupLayer };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
|
-
}
|
|
26
|
-
|
|
37
|
+
},
|
|
38
|
+
);
|
|
27
39
|
|
|
28
40
|
const group = $derived.by(() => {
|
|
29
|
-
if (editor.
|
|
41
|
+
if (editor.activeSelection.type === 'background') {
|
|
30
42
|
return {
|
|
31
43
|
bbox: {
|
|
32
44
|
x: 0,
|
|
@@ -34,45 +46,71 @@
|
|
|
34
46
|
width: editor.width,
|
|
35
47
|
height: editor.height,
|
|
36
48
|
rotate: 0,
|
|
49
|
+
scale: 1,
|
|
37
50
|
},
|
|
38
51
|
padding: 3,
|
|
39
52
|
items: [],
|
|
40
53
|
};
|
|
54
|
+
} else if (editor.activeGroupAndChild) {
|
|
55
|
+
const { groupLayer, childLayer } = editor.activeGroupAndChild;
|
|
56
|
+
return {
|
|
57
|
+
bbox: groupLayer,
|
|
58
|
+
padding: 0,
|
|
59
|
+
items: [
|
|
60
|
+
{
|
|
61
|
+
...childLayer,
|
|
62
|
+
...{
|
|
63
|
+
x: childLayer.x * groupLayer.scale,
|
|
64
|
+
y: childLayer.y * groupLayer.scale,
|
|
65
|
+
width: childLayer.width * groupLayer.scale,
|
|
66
|
+
height: childLayer.height * groupLayer.scale,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
41
71
|
} else if (editor.activeLayers.length === 1) {
|
|
42
72
|
return {
|
|
43
|
-
bbox:
|
|
73
|
+
bbox: editor.activeLayers[0],
|
|
44
74
|
padding: 0,
|
|
45
75
|
items: [],
|
|
46
76
|
};
|
|
47
77
|
} else if (editor.activeLayers.length > 1) {
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const items = calculateRelativeRects(bbox, transforms);
|
|
78
|
+
const bbox = calculateGroupRotatedBoundingBox(editor.activeLayers, editor.activeGroupRotate);
|
|
79
|
+
const items = calculateRelativeRects(bbox, editor.activeLayers);
|
|
51
80
|
|
|
52
81
|
return { bbox, padding: 0, items };
|
|
53
82
|
}
|
|
54
83
|
});
|
|
55
|
-
|
|
56
84
|
/**
|
|
57
85
|
* Determines if resizing should be forbidden based on the rotation of the group and its layers.
|
|
58
86
|
*
|
|
87
|
+
* @param {Layer[]} layers - The layers to check.
|
|
59
88
|
* @param {number} groupRotate - The rotation of the group in degrees.
|
|
60
89
|
* @returns {(boolean|string)} - Returns 'horizontal' or 'vertical' if resizing should be forbidden in that direction, otherwise returns false.
|
|
61
90
|
*/
|
|
62
|
-
const getConstrainedResizeAxis = (groupRotate: number) => {
|
|
63
|
-
// Check if all active layers are of type '
|
|
64
|
-
const
|
|
65
|
-
|
|
91
|
+
const getConstrainedResizeAxis = (layers: Layer[], groupRotate: number) => {
|
|
92
|
+
// Check if all active layers are of type 'text'
|
|
93
|
+
const textLayersOnly = layers.every((layer) =>
|
|
94
|
+
layer.type === 'group'
|
|
95
|
+
? editor.findGroupChildren(editor.activePage, layer.id).every((l) => l.type === 'text')
|
|
96
|
+
: layer.type === 'text',
|
|
97
|
+
);
|
|
98
|
+
if (!textLayersOnly) return false; // If not all layers are 'text', resizing is not forbidden
|
|
99
|
+
|
|
100
|
+
const textLayersRotations = editor.activeLayers.flatMap((layer) =>
|
|
101
|
+
layer.type === 'group'
|
|
102
|
+
? editor.findGroupChildren(editor.activePage, layer.id).map((l) => l.rotate + layer.rotate)
|
|
103
|
+
: layer.rotate,
|
|
104
|
+
);
|
|
66
105
|
|
|
67
106
|
// Calculate the rotation of the first layer relative to the group rotation
|
|
68
|
-
const firstLayerRelativeRotate =
|
|
107
|
+
const firstLayerRelativeRotate = textLayersRotations[0] - groupRotate;
|
|
69
108
|
// Determine if the first layer is rotated vertically
|
|
70
109
|
const firstLayerRotatedVertically = isRotatedVertically(firstLayerRelativeRotate);
|
|
71
110
|
|
|
72
111
|
// Check if all layers have the same rotation direction relative to the group rotation
|
|
73
|
-
const allLayersHaveSameRotationDirection =
|
|
74
|
-
(
|
|
75
|
-
isRotatedVertically((layer.rotate || 0) - groupRotate) === firstLayerRotatedVertically,
|
|
112
|
+
const allLayersHaveSameRotationDirection = textLayersRotations.every(
|
|
113
|
+
(rotate) => isRotatedVertically(rotate - groupRotate) === firstLayerRotatedVertically,
|
|
76
114
|
);
|
|
77
115
|
if (!allLayersHaveSameRotationDirection) return false; // If not all layers have the same rotation direction, resizing is not forbidden
|
|
78
116
|
|
|
@@ -81,18 +119,18 @@
|
|
|
81
119
|
};
|
|
82
120
|
</script>
|
|
83
121
|
|
|
84
|
-
{#if
|
|
85
|
-
<
|
|
122
|
+
{#if textLayerEditing}
|
|
123
|
+
<TextLayerEdit {...textLayerEditing} />
|
|
86
124
|
{/if}
|
|
87
125
|
|
|
88
126
|
{#if group}
|
|
89
127
|
<div
|
|
90
128
|
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`}
|
|
129
|
+
style:width={`${group.bbox.width * group.bbox.scale * editor.zoom + group.padding * 2}px`}
|
|
130
|
+
style:height={`${group.bbox.height * group.bbox.scale * editor.zoom + group.padding * 2}px`}
|
|
93
131
|
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
132
|
>
|
|
95
|
-
{#if group.items.length
|
|
133
|
+
{#if !group.items.length}
|
|
96
134
|
<div
|
|
97
135
|
class="border-primary absolute -inset-px border-2"
|
|
98
136
|
style:box-shadow="0 0 0 1px hsla(0, 0%, 100%, .07), inset 0 0 0 1px hsla(0, 0%, 100%, .07)"
|
|
@@ -103,29 +141,31 @@
|
|
|
103
141
|
<div
|
|
104
142
|
class="border-primary absolute -left-px -top-px border-2"
|
|
105
143
|
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`}
|
|
144
|
+
style:width={`${item.width * item.scale * editor.zoom + 2}px`}
|
|
145
|
+
style:height={`${item.height * item.scale * editor.zoom + 2}px`}
|
|
108
146
|
style:transform={`translate(${item.x * editor.zoom}px, ${item.y * editor.zoom}px) rotate(${item.rotate}deg)`}
|
|
109
147
|
></div>
|
|
110
148
|
{/each}
|
|
111
149
|
{/if}
|
|
112
150
|
|
|
113
|
-
{#if editor.activeLayers.length > 0 && !editor.
|
|
151
|
+
{#if editor.activeLayers.length > 0 && !editor.activePage.locked && !editor.activeLayers.some((l) => l.locked)}
|
|
114
152
|
<div class="h-full w-full outline-none transition-opacity duration-300">
|
|
115
153
|
<div class="flex h-full w-full items-center justify-center">
|
|
116
|
-
{#if editor.activeLayers.length === 1}
|
|
154
|
+
{#if editor.activeLayers.length === 1 && editor.activeLayers[0].type === 'text'}
|
|
117
155
|
{@const layer = editor.activeLayers[0]}
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{/if}
|
|
156
|
+
<SideScaleControl origin="left" {layer} />
|
|
157
|
+
<SideScaleControl origin="right" {layer} />
|
|
158
|
+
{:else if editor.activeLayers.length === 1 && editor.activeLayers[0].type === 'image'}
|
|
159
|
+
{@const layer = editor.activeLayers[0]}
|
|
160
|
+
<SideResizeControl origin="left" {layer} />
|
|
161
|
+
<SideResizeControl origin="right" {layer} />
|
|
162
|
+
<SideResizeControl origin="top" {layer} />
|
|
163
|
+
<SideResizeControl origin="bottom" {layer} />
|
|
127
164
|
{:else}
|
|
128
|
-
{@const constrainedResizeAxis = getConstrainedResizeAxis(
|
|
165
|
+
{@const constrainedResizeAxis = getConstrainedResizeAxis(
|
|
166
|
+
editor.activeLayers,
|
|
167
|
+
group.bbox.rotate,
|
|
168
|
+
)}
|
|
129
169
|
{#if constrainedResizeAxis !== 'horizontal'}
|
|
130
170
|
<GroupResizeControl origin="left" />
|
|
131
171
|
<GroupResizeControl origin="right" />
|
|
@@ -148,7 +188,8 @@
|
|
|
148
188
|
|
|
149
189
|
<style>
|
|
150
190
|
.group-border {
|
|
151
|
-
background-image:
|
|
191
|
+
background-image:
|
|
192
|
+
linear-gradient(90deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
152
193
|
linear-gradient(180deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
153
194
|
linear-gradient(90deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
154
195
|
linear-gradient(180deg, #fff 60%, rgba(53, 71, 90, 0.2) 0),
|
|
@@ -165,8 +206,8 @@
|
|
|
165
206
|
calc(100% - 2px),
|
|
166
207
|
center calc(100% - 2px),
|
|
167
208
|
2px;
|
|
168
|
-
background-repeat:
|
|
169
|
-
no-repeat;
|
|
209
|
+
background-repeat:
|
|
210
|
+
repeat-x, repeat-y, repeat-x, repeat-y, no-repeat, no-repeat, no-repeat, no-repeat;
|
|
170
211
|
background-size:
|
|
171
212
|
6px 2px,
|
|
172
213
|
2px 6px,
|
package/dist/components/{presentation-editor/cognition-slides.js → editor/cognition-pages.js}
RENAMED
|
@@ -25,7 +25,7 @@ export const cognitionImages = [
|
|
|
25
25
|
height: 800,
|
|
26
26
|
},
|
|
27
27
|
];
|
|
28
|
-
export const
|
|
28
|
+
export const cognitionPages = [
|
|
29
29
|
{
|
|
30
30
|
slide_layout_plan: "For the first slide, I want to introduce the topic and provide a brief overview of what's to come. A title slide is appropriate here, with a headline that clearly indicates the subject matter and a subheadline that gives some additional context. The image should reflect the high-level topic of AI in acquiring banks. This slide sets the stage for the deeper dive into the statistics and insights that will be covered in subsequent slides.",
|
|
31
31
|
type: 'title',
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as Tooltip from '../ui/tooltip/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { Editor } from './editor.svelte.js';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface Props {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { editor }: Props = $props();
|
|
6
10
|
</script>
|
|
7
11
|
|
|
8
12
|
{#if editor.activeAction?.tooltip}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { HtmlContent } from './layers/types/
|
|
3
|
-
import {
|
|
2
|
+
import { HtmlContent } from './layers/types/text/index.js';
|
|
3
|
+
import type { Editor } from './editor.svelte.js';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface Props {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { editor }: Props = $props();
|
|
6
10
|
</script>
|
|
7
11
|
|
|
8
12
|
{#if editor.dragged}
|