@peteai/presentation-editor 0.0.5 → 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 +43 -39
- 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/dist/components/{presentation-editor/presentation-editor.svelte → editor/editor.svelte}
RENAMED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { BROWSER } from 'esm-env';
|
|
2
3
|
import { onDestroy, onMount, tick } from 'svelte';
|
|
3
4
|
import { get } from 'svelte/store';
|
|
4
|
-
import CheckIcon from 'lucide
|
|
5
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
5
6
|
import * as DropdownMenu from '../ui/dropdown-menu/index.js';
|
|
6
7
|
import { Slider } from '../ui/slider/index.js';
|
|
7
8
|
import { buttonVariants } from '../ui/button/index.js';
|
|
8
|
-
import type { Image } from './types.js';
|
|
9
|
+
import type { EditorOptions, Image } from './types.js';
|
|
9
10
|
import { checkImage } from './utils.js';
|
|
10
|
-
import {
|
|
11
|
-
PresentationEditor,
|
|
12
|
-
type PresentationEditorOptions,
|
|
13
|
-
} from './presentation-editor.svelte.js';
|
|
11
|
+
import { Editor } from './editor.svelte.js';
|
|
14
12
|
import Hotkeys from './hotkeys.svelte';
|
|
15
13
|
import Header from './header.svelte';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
14
|
+
import PageEditor from './page-editor.svelte';
|
|
15
|
+
import PagesNavigation from './pages-navigation/pages-navigation.svelte';
|
|
18
16
|
import CursorTooltip from './cursor-tooltip.svelte';
|
|
19
17
|
import Dragged from './dragged.svelte';
|
|
20
18
|
import Sidebar from './sidebar/sidebar.svelte';
|
|
19
|
+
import { extractNodeFonts } from './layers/types/text/editor/utils.js';
|
|
21
20
|
|
|
22
|
-
let editorOptions:
|
|
21
|
+
let editorOptions: EditorOptions = $props();
|
|
23
22
|
|
|
24
|
-
export const
|
|
23
|
+
export const editor = new Editor(editorOptions);
|
|
24
|
+
|
|
25
|
+
if (BROWSER) {
|
|
26
|
+
const fontFamilies = editor.pages
|
|
27
|
+
.flatMap((page) => page.layers)
|
|
28
|
+
.filter((layer) => layer.type === 'text')
|
|
29
|
+
.flatMap((layer) => extractNodeFonts(layer.html));
|
|
30
|
+
Promise.all(fontFamilies.map(editor.loadFont));
|
|
31
|
+
}
|
|
25
32
|
|
|
26
33
|
const sliderMin = -2.304;
|
|
27
34
|
const sliderMax = 1.61;
|
|
@@ -51,18 +58,18 @@
|
|
|
51
58
|
: Math.round((value - intercept2) / slope2 / sliderStep) * sliderStep;
|
|
52
59
|
};
|
|
53
60
|
|
|
54
|
-
let sliderValue = $state(convertZoomToSlider(
|
|
61
|
+
let sliderValue = $state(convertZoomToSlider(editor.zoom));
|
|
55
62
|
|
|
56
63
|
let viewportRef: HTMLDivElement | null = $state(null);
|
|
57
64
|
let wrapperRef: HTMLDivElement | null = $state(null);
|
|
58
65
|
|
|
59
|
-
let scaledWidth = $derived(
|
|
60
|
-
let scaledHeight = $derived(
|
|
66
|
+
let scaledWidth = $derived(editor.width * editor.zoom);
|
|
67
|
+
let scaledHeight = $derived(editor.height * editor.zoom);
|
|
61
68
|
|
|
62
69
|
let centerX = 0;
|
|
63
70
|
let centerY = 0;
|
|
64
71
|
export const setZoom = async (zoom: number) => {
|
|
65
|
-
|
|
72
|
+
editor.zoomSnapping = null;
|
|
66
73
|
if (viewportRef) {
|
|
67
74
|
const centeringPrecision = 0.001;
|
|
68
75
|
const newCenterX =
|
|
@@ -73,7 +80,7 @@
|
|
|
73
80
|
centerX = Math.abs(centerX - newCenterX) < centeringPrecision ? centerX : newCenterX;
|
|
74
81
|
centerY = Math.abs(centerY - newCenterY) < centeringPrecision ? centerY : newCenterY;
|
|
75
82
|
}
|
|
76
|
-
|
|
83
|
+
editor.zoom = zoom;
|
|
77
84
|
await tick();
|
|
78
85
|
if (viewportRef) {
|
|
79
86
|
viewportRef.scrollLeft = centerX * viewportRef.scrollWidth - viewportRef.clientWidth / 2;
|
|
@@ -85,12 +92,11 @@
|
|
|
85
92
|
export const fillScreen = async () => {
|
|
86
93
|
if (viewportRef && wrapperRef) {
|
|
87
94
|
await setZoom(
|
|
88
|
-
(
|
|
89
|
-
(viewportRef.clientWidth - (wrapperRef.clientWidth - scaledWidth))) /
|
|
95
|
+
(editor.zoom * (viewportRef.clientWidth - (wrapperRef.clientWidth - scaledWidth))) /
|
|
90
96
|
scaledWidth,
|
|
91
97
|
);
|
|
92
98
|
tick().then(() => {
|
|
93
|
-
|
|
99
|
+
editor.zoomSnapping = 'fill';
|
|
94
100
|
});
|
|
95
101
|
}
|
|
96
102
|
};
|
|
@@ -100,31 +106,31 @@
|
|
|
100
106
|
viewportRef.scrollLeft = 0;
|
|
101
107
|
viewportRef.scrollTop = 0;
|
|
102
108
|
await setZoom(
|
|
103
|
-
|
|
109
|
+
editor.zoom *
|
|
104
110
|
Math.min(
|
|
105
111
|
(viewportRef.clientWidth - (wrapperRef.clientWidth - scaledWidth)) / scaledWidth,
|
|
106
112
|
(viewportRef.clientHeight - (wrapperRef.clientHeight - scaledHeight)) / scaledHeight,
|
|
107
113
|
),
|
|
108
114
|
);
|
|
109
115
|
tick().then(() => {
|
|
110
|
-
|
|
116
|
+
editor.zoomSnapping = 'fit';
|
|
111
117
|
});
|
|
112
118
|
}
|
|
113
119
|
};
|
|
114
120
|
|
|
115
121
|
const onResize = () => {
|
|
116
122
|
tick().then(() => {
|
|
117
|
-
if (
|
|
123
|
+
if (editor.zoomSnapping === 'fit') {
|
|
118
124
|
fitToScreen();
|
|
119
|
-
} else if (
|
|
125
|
+
} else if (editor.zoomSnapping === 'fill') {
|
|
120
126
|
fillScreen();
|
|
121
127
|
}
|
|
122
128
|
});
|
|
123
129
|
};
|
|
124
130
|
|
|
125
131
|
$effect(() => {
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
editor.activeSidebarPopup;
|
|
133
|
+
editor.activeSidebarTab;
|
|
128
134
|
onResize();
|
|
129
135
|
});
|
|
130
136
|
|
|
@@ -132,7 +138,7 @@
|
|
|
132
138
|
// console.log('dragover windown', e);
|
|
133
139
|
e.preventDefault();
|
|
134
140
|
if (e.dataTransfer?.items.length) {
|
|
135
|
-
|
|
141
|
+
editor.fileDragged = true;
|
|
136
142
|
}
|
|
137
143
|
};
|
|
138
144
|
|
|
@@ -142,9 +148,9 @@
|
|
|
142
148
|
e.preventDefault();
|
|
143
149
|
e.stopPropagation();
|
|
144
150
|
|
|
145
|
-
|
|
151
|
+
editor.fileDragged = false;
|
|
146
152
|
if (e.dataTransfer?.items.length) {
|
|
147
|
-
let
|
|
153
|
+
let dropToPage = false;
|
|
148
154
|
const viewportRect = viewportRef?.getBoundingClientRect();
|
|
149
155
|
const wrapperRect = wrapperRef?.getBoundingClientRect();
|
|
150
156
|
if (viewportRect && wrapperRect) {
|
|
@@ -153,7 +159,7 @@
|
|
|
153
159
|
const minTop = Math.max(viewportRect.top, wrapperRect.top);
|
|
154
160
|
const maxBottom = Math.min(viewportRect.bottom, wrapperRect.bottom);
|
|
155
161
|
|
|
156
|
-
|
|
162
|
+
dropToPage =
|
|
157
163
|
e.pageX > minLeft && e.pageX < maxRight && e.pageY > minTop && e.pageY < maxBottom;
|
|
158
164
|
}
|
|
159
165
|
|
|
@@ -165,28 +171,27 @@
|
|
|
165
171
|
if (file) {
|
|
166
172
|
try {
|
|
167
173
|
let image: Image;
|
|
168
|
-
if (
|
|
169
|
-
image = await
|
|
174
|
+
if (editor.onImageUpload) {
|
|
175
|
+
image = await editor.onImageUpload(file);
|
|
170
176
|
} else {
|
|
171
177
|
const url = URL.createObjectURL(file);
|
|
172
178
|
console.log('image url', url);
|
|
173
|
-
// presentationEditor.
|
|
174
179
|
const htmlImage = await checkImage(url);
|
|
175
180
|
image = {
|
|
176
|
-
id:
|
|
181
|
+
id: editor.generateId(),
|
|
177
182
|
src: url,
|
|
178
183
|
width: htmlImage.width,
|
|
179
184
|
height: htmlImage.height,
|
|
180
185
|
};
|
|
181
186
|
}
|
|
182
|
-
|
|
183
|
-
if (
|
|
184
|
-
const layer =
|
|
187
|
+
editor.images.push(image);
|
|
188
|
+
if (dropToPage) {
|
|
189
|
+
const layer = editor.buildImageLayer({
|
|
185
190
|
width: image.width,
|
|
186
191
|
height: image.height,
|
|
187
192
|
image,
|
|
188
193
|
});
|
|
189
|
-
|
|
194
|
+
editor.addLayers(editor.activePage.id, layer);
|
|
190
195
|
}
|
|
191
196
|
} catch (err) {
|
|
192
197
|
console.log('err', err);
|
|
@@ -204,7 +209,7 @@
|
|
|
204
209
|
|
|
205
210
|
onDestroy(() => {
|
|
206
211
|
console.log('editor main component destroy');
|
|
207
|
-
get(
|
|
212
|
+
get(editor.htmlEditor).destroy();
|
|
208
213
|
});
|
|
209
214
|
</script>
|
|
210
215
|
|
|
@@ -214,21 +219,21 @@
|
|
|
214
219
|
|
|
215
220
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
216
221
|
<div class="flex h-full w-full select-none" ondragover={onDragOver} ondrop={onDrop}>
|
|
217
|
-
<Sidebar />
|
|
222
|
+
<Sidebar {editor} />
|
|
218
223
|
<div class="flex h-full flex-1 select-none flex-col overflow-auto">
|
|
219
|
-
<Dragged />
|
|
220
|
-
<CursorTooltip />
|
|
221
|
-
<Header />
|
|
224
|
+
<Dragged {editor} />
|
|
225
|
+
<CursorTooltip {editor} />
|
|
226
|
+
<Header {editor} />
|
|
222
227
|
|
|
223
228
|
<div class="flex min-h-0 flex-1">
|
|
224
229
|
<div class="relative flex grow flex-col overflow-hidden bg-gray-100">
|
|
225
230
|
<main class="flex min-h-0 flex-1 flex-col bg-gray-200">
|
|
226
|
-
<
|
|
231
|
+
<PageEditor bind:wrapperRef bind:viewportRef />
|
|
227
232
|
</main>
|
|
228
233
|
|
|
229
234
|
<footer class="relative">
|
|
230
|
-
{#if
|
|
231
|
-
<
|
|
235
|
+
{#if editor.mode === 'multiple'}
|
|
236
|
+
<PagesNavigation {editor} />
|
|
232
237
|
{/if}
|
|
233
238
|
<div class="flex items-center justify-end gap-2 px-4">
|
|
234
239
|
<div class="w-48">
|
|
@@ -245,14 +250,14 @@
|
|
|
245
250
|
<DropdownMenu.Trigger
|
|
246
251
|
class={buttonVariants({ variant: 'ghost', size: 'icon-xs', class: 'w-16' })}
|
|
247
252
|
>
|
|
248
|
-
{Math.round(
|
|
253
|
+
{Math.round(editor.zoom * 100)}%
|
|
249
254
|
</DropdownMenu.Trigger>
|
|
250
255
|
|
|
251
256
|
<DropdownMenu.Content align="end" class="w-48">
|
|
252
257
|
{#each [3, 2, 1.25, 1, 0.75, 0.5, 0.25, 0.1] as zoomLevel}
|
|
253
258
|
<DropdownMenu.Item onclick={() => setZoom(zoomLevel)}>
|
|
254
259
|
{(zoomLevel * 100).toFixed(0)}%
|
|
255
|
-
{#if
|
|
260
|
+
{#if editor.zoom === zoomLevel}
|
|
256
261
|
<CheckIcon class="h-4 w-4" />
|
|
257
262
|
{/if}
|
|
258
263
|
</DropdownMenu.Item>
|
|
@@ -260,13 +265,13 @@
|
|
|
260
265
|
<DropdownMenu.Separator />
|
|
261
266
|
<DropdownMenu.Item onclick={fitToScreen}>
|
|
262
267
|
Fit
|
|
263
|
-
{#if
|
|
268
|
+
{#if editor.zoomSnapping === 'fit'}
|
|
264
269
|
<CheckIcon class="h-4 w-4" />
|
|
265
270
|
{/if}
|
|
266
271
|
</DropdownMenu.Item>
|
|
267
272
|
<DropdownMenu.Item onclick={fillScreen}>
|
|
268
273
|
Fill
|
|
269
|
-
{#if
|
|
274
|
+
{#if editor.zoomSnapping === 'fill'}
|
|
270
275
|
<CheckIcon class="h-4 w-4" />
|
|
271
276
|
{/if}
|
|
272
277
|
</DropdownMenu.Item>
|