@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
layers:
|
|
3
|
+
layers: TextLayer[];
|
|
4
4
|
}
|
|
5
5
|
declare const ColorButton: import("svelte").Component<Props, {}, "layers">;
|
|
6
6
|
type ColorButton = ReturnType<typeof ColorButton>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Button } from '../../../../../../ui/button/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getEditorContext } from '../../../../../editor.svelte.js';
|
|
4
4
|
import { extractNodeFonts, extractSelectionFonts } from '../../editor/utils.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
|
-
layers:
|
|
8
|
+
layers: TextLayer[];
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
let { layers = $bindable() }: Props = $props();
|
|
12
12
|
|
|
13
|
-
const editor =
|
|
13
|
+
const editor = getEditorContext();
|
|
14
14
|
|
|
15
15
|
const { htmlEditor } = editor;
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
layers:
|
|
3
|
+
layers: TextLayer[];
|
|
4
4
|
}
|
|
5
5
|
declare const FontFamilyButton: import("svelte").Component<Props, {}, "layers">;
|
|
6
6
|
type FontFamilyButton = ReturnType<typeof FontFamilyButton>;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import MinusIcon from 'lucide
|
|
3
|
-
import PlusIcon from 'lucide
|
|
4
|
-
import type {
|
|
2
|
+
import MinusIcon from '@lucide/svelte/icons/minus';
|
|
3
|
+
import PlusIcon from '@lucide/svelte/icons/plus';
|
|
4
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
5
5
|
import * as DropdownMenu from '../../../../../../ui/dropdown-menu/index.js';
|
|
6
6
|
import { Button, buttonVariants } from '../../../../../../ui/button/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { getEditorContext } from '../../../../../editor.svelte.js';
|
|
8
8
|
import {
|
|
9
9
|
createEditorNotReactive,
|
|
10
10
|
extractNodeFontSizes,
|
|
11
11
|
extractSelectionFontSizes,
|
|
12
12
|
} from '../../editor/utils.js';
|
|
13
|
-
import { applyHtmlToLayer } from '../../../../utils.js';
|
|
14
13
|
|
|
15
14
|
interface Props {
|
|
16
|
-
layers:
|
|
15
|
+
layers: TextLayer[];
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
let { layers = $bindable() }: Props = $props();
|
|
20
19
|
|
|
21
|
-
const editor =
|
|
20
|
+
const editor = getEditorContext();
|
|
22
21
|
|
|
23
22
|
const { htmlEditor } = editor;
|
|
24
23
|
|
|
@@ -40,12 +39,12 @@
|
|
|
40
39
|
const fontSize = $derived.by(() => {
|
|
41
40
|
if (editor.activeAction?.type === 'edit') {
|
|
42
41
|
const fontSizesPx = extractSelectionFontSizes($htmlEditor);
|
|
43
|
-
return getFontSize(fontSizesPx, layers[0]?.scale
|
|
42
|
+
return getFontSize(fontSizesPx, layers[0]?.scale);
|
|
44
43
|
} else {
|
|
45
44
|
const set = new Set<number>();
|
|
46
45
|
layers.forEach((layer) => {
|
|
47
46
|
const fontSizesPx = extractNodeFontSizes(layer.html);
|
|
48
|
-
const fontSize = getFontSize(fontSizesPx, layer.scale
|
|
47
|
+
const fontSize = getFontSize(fontSizesPx, layer.scale);
|
|
49
48
|
if (fontSize) {
|
|
50
49
|
set.add(fontSize);
|
|
51
50
|
}
|
|
@@ -55,8 +54,9 @@
|
|
|
55
54
|
}
|
|
56
55
|
});
|
|
57
56
|
|
|
58
|
-
const updateFontSize = async (value: number) => {
|
|
57
|
+
const updateFontSize = async (value: string | number) => {
|
|
59
58
|
console.log('updateFontSize', value);
|
|
59
|
+
value = parseInt(value.toString());
|
|
60
60
|
let fontSizePt = value;
|
|
61
61
|
if (fontSizePt < min) {
|
|
62
62
|
fontSizePt = min;
|
|
@@ -64,36 +64,29 @@
|
|
|
64
64
|
fontSizePt = max;
|
|
65
65
|
}
|
|
66
66
|
if (editor.activeAction?.type === 'edit') {
|
|
67
|
-
$htmlEditor.commands.setFontSize(fontSizePt / pxToPt /
|
|
67
|
+
$htmlEditor.commands.setFontSize(fontSizePt / pxToPt / layers[0]?.scale);
|
|
68
68
|
} else {
|
|
69
|
-
editor.historyPush(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.run();
|
|
69
|
+
editor.historyPush(
|
|
70
|
+
(
|
|
71
|
+
await Promise.all(
|
|
72
|
+
layers.map(async (layer) => {
|
|
73
|
+
const editorNotReactive = createEditorNotReactive(layer.html);
|
|
74
|
+
const fontSize = fontSizePt / pxToPt / layer.scale;
|
|
75
|
+
editorNotReactive
|
|
76
|
+
.chain()
|
|
77
|
+
.setContent(layer.html)
|
|
78
|
+
.selectAll()
|
|
79
|
+
.setFontSize(fontSize)
|
|
80
|
+
.run();
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
undo,
|
|
92
|
-
redo,
|
|
93
|
-
};
|
|
94
|
-
}),
|
|
95
|
-
),
|
|
96
|
-
});
|
|
82
|
+
return editor.applyHtmlToLayer(
|
|
83
|
+
editor.createTextLayerInitial(editor.activePage, layer),
|
|
84
|
+
editorNotReactive.getJSON(),
|
|
85
|
+
);
|
|
86
|
+
}),
|
|
87
|
+
)
|
|
88
|
+
).flat(),
|
|
89
|
+
);
|
|
97
90
|
}
|
|
98
91
|
};
|
|
99
92
|
|
|
@@ -138,11 +131,11 @@
|
|
|
138
131
|
placeholder="– –"
|
|
139
132
|
value={fontSize}
|
|
140
133
|
style:-moz-appearance="textfield"
|
|
141
|
-
onchange={(e) => updateFontSize(e.
|
|
134
|
+
onchange={(e) => updateFontSize(e.currentTarget.value)}
|
|
142
135
|
onkeydown={(e) => {
|
|
143
136
|
if (e.key === 'Enter') {
|
|
144
137
|
e.stopPropagation();
|
|
145
|
-
updateFontSize(e.
|
|
138
|
+
updateFontSize(e.currentTarget.value);
|
|
146
139
|
} else if (e.key === 'Escape') {
|
|
147
140
|
e.stopPropagation();
|
|
148
141
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
layers:
|
|
3
|
+
layers: TextLayer[];
|
|
4
4
|
}
|
|
5
5
|
declare const FontSizeButton: import("svelte").Component<Props, {}, "layers">;
|
|
6
6
|
type FontSizeButton = ReturnType<typeof FontSizeButton>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ItalicIcon from '@lucide/svelte/icons/italic';
|
|
3
|
+
import { Toggle } from '../../../../../../ui/toggle/index.js';
|
|
4
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
5
|
+
import { getEditorContext } from '../../../../../editor.svelte.js';
|
|
6
|
+
import { createEditorNotReactive } from '../../editor/utils.js';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
layers: TextLayer[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { layers = $bindable() }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const editor = getEditorContext();
|
|
15
|
+
|
|
16
|
+
const { htmlEditor } = editor;
|
|
17
|
+
|
|
18
|
+
const editorNotReactive = createEditorNotReactive();
|
|
19
|
+
|
|
20
|
+
const isActive = $derived.by(() => {
|
|
21
|
+
if (editor.activeAction?.type === 'edit') {
|
|
22
|
+
return $htmlEditor.isActive('italic');
|
|
23
|
+
} else {
|
|
24
|
+
return layers.every((layer) => {
|
|
25
|
+
editorNotReactive.chain().setContent(layer.html).selectAll().run();
|
|
26
|
+
return editorNotReactive.isActive('italic');
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const setValue = async (value: boolean) => {
|
|
32
|
+
if (editor.activeAction?.type === 'edit') {
|
|
33
|
+
if (value) {
|
|
34
|
+
$htmlEditor.chain().focus().setItalic().run();
|
|
35
|
+
} else {
|
|
36
|
+
$htmlEditor.chain().focus().unsetItalic().run();
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
editor.historyPush(
|
|
40
|
+
(
|
|
41
|
+
await Promise.all(
|
|
42
|
+
layers.map(async (layer) => {
|
|
43
|
+
let chain = editorNotReactive.chain().setContent(layer.html).selectAll();
|
|
44
|
+
if (value) {
|
|
45
|
+
chain = chain.setItalic();
|
|
46
|
+
} else {
|
|
47
|
+
chain = chain.unsetItalic();
|
|
48
|
+
}
|
|
49
|
+
chain.run();
|
|
50
|
+
|
|
51
|
+
return editor.applyHtmlToLayer(
|
|
52
|
+
editor.createTextLayerInitial(editor.activePage, layer),
|
|
53
|
+
editorNotReactive.getJSON(),
|
|
54
|
+
);
|
|
55
|
+
}),
|
|
56
|
+
)
|
|
57
|
+
).flat(),
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<Toggle size="xs" pressed={isActive} onPressedChange={(val) => setValue(val)}>
|
|
64
|
+
<ItalicIcon class="h-6 w-6" />
|
|
65
|
+
</Toggle>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
layers:
|
|
3
|
+
layers: TextLayer[];
|
|
4
4
|
}
|
|
5
5
|
declare const ItalicButton: import("svelte").Component<Props, {}, "layers">;
|
|
6
6
|
type ItalicButton = ReturnType<typeof ItalicButton>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as DropdownMenu from '../../../../../../ui/dropdown-menu/index.js';
|
|
3
|
+
import { buttonVariants } from '../../../../../../ui/button/index.js';
|
|
4
|
+
import { getEditorContext } from '../../../../../editor.svelte.js';
|
|
5
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
6
|
+
import type { Editor } from '../../editor/index.js';
|
|
7
|
+
import {
|
|
8
|
+
createEditorNotReactive,
|
|
9
|
+
extractNodeListStyleTypes,
|
|
10
|
+
extractSelectionListStyleTypes,
|
|
11
|
+
} from '../../editor/utils.js';
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
layers: TextLayer[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { layers = $bindable() }: Props = $props();
|
|
18
|
+
|
|
19
|
+
const editor = getEditorContext();
|
|
20
|
+
|
|
21
|
+
const { htmlEditor } = editor;
|
|
22
|
+
|
|
23
|
+
type ListStyleType = { name: string | undefined; symbol: string; title: string };
|
|
24
|
+
|
|
25
|
+
const listStyleTypes: ListStyleType[] = [
|
|
26
|
+
{ name: undefined, symbol: '¶', title: 'Paragraph' },
|
|
27
|
+
{ name: 'disc', symbol: '●', title: 'Disc' },
|
|
28
|
+
{ name: 'circle', symbol: '○', title: 'Circle' },
|
|
29
|
+
{ name: 'square', symbol: '■', title: 'Square' },
|
|
30
|
+
{ name: 'decimal', symbol: '1.', title: 'Decimal' },
|
|
31
|
+
{ name: 'lower-alpha', symbol: 'a.', title: 'Lower Alpha' },
|
|
32
|
+
{ name: 'upper-alpha', symbol: 'A.', title: 'Upper Alpha' },
|
|
33
|
+
{ name: 'upper-roman', symbol: 'I.', title: 'Upper Roman' },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const editorNotReactive = createEditorNotReactive();
|
|
37
|
+
|
|
38
|
+
const getListStyleType = (editor: Editor): ListStyleType => {
|
|
39
|
+
for (let listStyleType of listStyleTypes) {
|
|
40
|
+
if (editor.isActive('list', { listStyleType: listStyleType.name })) {
|
|
41
|
+
if (listStyleTypes.find((l) => l.name === listStyleType.name)) return listStyleType;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return listStyleTypes[0];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const currentListStyleType = $derived.by(() => {
|
|
48
|
+
const set = new Set<string>();
|
|
49
|
+
if (editor.activeAction?.type === 'edit') {
|
|
50
|
+
extractSelectionListStyleTypes($htmlEditor, set);
|
|
51
|
+
} else {
|
|
52
|
+
layers.forEach((layer) => extractNodeListStyleTypes(layer.html, set));
|
|
53
|
+
}
|
|
54
|
+
if (set.size === 1) {
|
|
55
|
+
const listStyleType = listStyleTypes.find((l) => set.has(l.name ?? ''));
|
|
56
|
+
if (listStyleType) return listStyleType;
|
|
57
|
+
}
|
|
58
|
+
return listStyleTypes[0];
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const setListStyleType = async (type?: string) => {
|
|
62
|
+
if (editor.activeAction?.type === 'edit') {
|
|
63
|
+
$htmlEditor.chain().focus().toggleListStyleType(type).run();
|
|
64
|
+
} else {
|
|
65
|
+
editor.historyPush(
|
|
66
|
+
(
|
|
67
|
+
await Promise.all(
|
|
68
|
+
layers.map(async (layer) => {
|
|
69
|
+
editorNotReactive
|
|
70
|
+
.chain()
|
|
71
|
+
.focus()
|
|
72
|
+
.setContent(layer.html)
|
|
73
|
+
.selectAll()
|
|
74
|
+
.toggleListStyleType(type)
|
|
75
|
+
.run();
|
|
76
|
+
|
|
77
|
+
return editor.applyHtmlToLayer(
|
|
78
|
+
editor.createTextLayerInitial(editor.activePage, layer),
|
|
79
|
+
editorNotReactive.getJSON(),
|
|
80
|
+
);
|
|
81
|
+
}),
|
|
82
|
+
)
|
|
83
|
+
).flat(),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<DropdownMenu.Root>
|
|
90
|
+
<DropdownMenu.Trigger
|
|
91
|
+
class={buttonVariants({
|
|
92
|
+
variant: 'ghost',
|
|
93
|
+
size: 'xs',
|
|
94
|
+
class: 'inline-flex cursor-text select-none rounded-none align-middle',
|
|
95
|
+
})}
|
|
96
|
+
>
|
|
97
|
+
{currentListStyleType.symbol}
|
|
98
|
+
</DropdownMenu.Trigger>
|
|
99
|
+
<DropdownMenu.Content
|
|
100
|
+
trapFocus={false}
|
|
101
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
102
|
+
align="start"
|
|
103
|
+
sideOffset={2}
|
|
104
|
+
class="w-32 p-1"
|
|
105
|
+
>
|
|
106
|
+
{#each listStyleTypes as listStyleType}
|
|
107
|
+
<DropdownMenu.Item onSelect={() => setListStyleType(listStyleType.name)}>
|
|
108
|
+
{listStyleType.symbol}
|
|
109
|
+
{listStyleType.title}
|
|
110
|
+
</DropdownMenu.Item>
|
|
111
|
+
{/each}
|
|
112
|
+
</DropdownMenu.Content>
|
|
113
|
+
</DropdownMenu.Root>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
layers:
|
|
3
|
+
layers: TextLayer[];
|
|
4
4
|
}
|
|
5
5
|
declare const ListButton: import("svelte").Component<Props, {}, "layers">;
|
|
6
6
|
type ListButton = ReturnType<typeof ListButton>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import StrikethroughIcon from 'lucide
|
|
2
|
+
import StrikethroughIcon from '@lucide/svelte/icons/strikethrough';
|
|
3
3
|
import { Toggle } from '../../../../../../ui/toggle/index.js';
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
4
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
5
|
+
import { getEditorContext } from '../../../../../editor.svelte.js';
|
|
6
6
|
import { createEditorNotReactive } from '../../editor/utils.js';
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
|
-
layers:
|
|
9
|
+
layers: TextLayer[];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
let { layers = $bindable() }: Props = $props();
|
|
13
13
|
|
|
14
|
-
const editor =
|
|
14
|
+
const editor = getEditorContext();
|
|
15
15
|
|
|
16
16
|
const { htmlEditor } = editor;
|
|
17
17
|
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
$htmlEditor.chain().focus().unsetStrike().run();
|
|
37
37
|
}
|
|
38
38
|
} else {
|
|
39
|
-
editor.historyPush(
|
|
40
|
-
|
|
41
|
-
actions: layers.map((layer) => {
|
|
39
|
+
editor.historyPush(
|
|
40
|
+
layers.map((layer) => {
|
|
42
41
|
let chain = editorNotReactive.chain().setContent(layer.html).selectAll();
|
|
43
42
|
if (value) {
|
|
44
43
|
chain = chain.setStrike();
|
|
@@ -48,14 +47,14 @@
|
|
|
48
47
|
chain.run();
|
|
49
48
|
|
|
50
49
|
return {
|
|
51
|
-
type: '
|
|
52
|
-
|
|
50
|
+
type: 'layerUpdate',
|
|
51
|
+
pageId: editor.activePage.id,
|
|
53
52
|
layer: { id: layer.id, type: layer.type },
|
|
54
53
|
undo: { html: layer.html },
|
|
55
54
|
redo: { html: editorNotReactive.getJSON() },
|
|
56
55
|
};
|
|
57
56
|
}),
|
|
58
|
-
|
|
57
|
+
);
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
60
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
layers:
|
|
3
|
+
layers: TextLayer[];
|
|
4
4
|
}
|
|
5
5
|
declare const StrikethroughButton: import("svelte").Component<Props, {}, "layers">;
|
|
6
6
|
type StrikethroughButton = ReturnType<typeof StrikethroughButton>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import UnderlineIcon from 'lucide
|
|
2
|
+
import UnderlineIcon from '@lucide/svelte/icons/underline';
|
|
3
3
|
import { Toggle } from '../../../../../../ui/toggle/index.js';
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
4
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
5
|
+
import { getEditorContext } from '../../../../../editor.svelte.js';
|
|
6
6
|
import { createEditorNotReactive } from '../../editor/utils.js';
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
|
-
layers:
|
|
9
|
+
layers: TextLayer[];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
let { layers = $bindable() }: Props = $props();
|
|
13
13
|
|
|
14
|
-
const editor =
|
|
14
|
+
const editor = getEditorContext();
|
|
15
15
|
|
|
16
16
|
const { htmlEditor } = editor;
|
|
17
17
|
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
$htmlEditor.chain().focus().unsetUnderline().run();
|
|
37
37
|
}
|
|
38
38
|
} else {
|
|
39
|
-
editor.historyPush(
|
|
40
|
-
|
|
41
|
-
actions: layers.map((layer) => {
|
|
39
|
+
editor.historyPush(
|
|
40
|
+
layers.map((layer) => {
|
|
42
41
|
let chain = editorNotReactive.chain().setContent(layer.html).selectAll();
|
|
43
42
|
if (value) {
|
|
44
43
|
chain = chain.setUnderline();
|
|
@@ -48,14 +47,14 @@
|
|
|
48
47
|
chain.run();
|
|
49
48
|
|
|
50
49
|
return {
|
|
51
|
-
type: '
|
|
52
|
-
|
|
50
|
+
type: 'layerUpdate',
|
|
51
|
+
pageId: editor.activePage.id,
|
|
53
52
|
layer: { id: layer.id, type: layer.type },
|
|
54
53
|
undo: { html: layer.html },
|
|
55
54
|
redo: { html: editorNotReactive.getJSON() },
|
|
56
55
|
};
|
|
57
56
|
}),
|
|
58
|
-
|
|
57
|
+
);
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
60
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextLayer } from '../../../../../types.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
layers:
|
|
3
|
+
layers: TextLayer[];
|
|
4
4
|
}
|
|
5
5
|
declare const UnderlineButton: import("svelte").Component<Props, {}, "layers">;
|
|
6
6
|
type UnderlineButton = ReturnType<typeof UnderlineButton>;
|
|
@@ -2,6 +2,8 @@ import { type JSONContent } from '@tiptap/core';
|
|
|
2
2
|
import { Editor } from './Editor.js';
|
|
3
3
|
export declare const DEFAULT_COLOR = "#000000";
|
|
4
4
|
export declare const createEditorNotReactive: (content?: JSONContent) => Editor;
|
|
5
|
+
export declare const extractSelectionListStyleTypes: (editor: Editor, set?: Set<string>) => string[];
|
|
6
|
+
export declare const extractNodeListStyleTypes: (content: JSONContent, set?: Set<string>) => string[];
|
|
5
7
|
export declare const extractSelectionFonts: (editor: Editor) => string[];
|
|
6
8
|
export declare const extractNodeFonts: (content: JSONContent, set?: Set<string>) => string[];
|
|
7
9
|
export declare const extractSelectionFontSizes: (editor: Editor) => number[];
|