kritzel-stencil 0.0.131 → 0.0.133
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/dist/cjs/{index-BwINBV6L.js → index-DCHCVnOl.js} +755 -701
- package/dist/cjs/index-DCHCVnOl.js.map +1 -0
- package/dist/cjs/index-nzUNdMPh.js +6 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +32 -0
- package/dist/cjs/kritzel-brush-style.entry.cjs.js.map +1 -0
- package/dist/cjs/{kritzel-brush-style_23.cjs.entry.js → kritzel-color_22.cjs.entry.js} +1046 -874
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/commands/add-object.command.js +6 -7
- package/dist/collection/classes/commands/add-object.command.js.map +1 -1
- package/dist/collection/classes/commands/add-selection-group.command.js +9 -9
- package/dist/collection/classes/commands/add-selection-group.command.js.map +1 -1
- package/dist/collection/classes/commands/base.command.js +3 -3
- package/dist/collection/classes/commands/base.command.js.map +1 -1
- package/dist/collection/classes/commands/batch.command.js +2 -2
- package/dist/collection/classes/commands/batch.command.js.map +1 -1
- package/dist/collection/classes/commands/move-selection-group.command.js +15 -7
- package/dist/collection/classes/commands/move-selection-group.command.js.map +1 -1
- package/dist/collection/classes/commands/remove-object.command.js +8 -9
- package/dist/collection/classes/commands/remove-object.command.js.map +1 -1
- package/dist/collection/classes/commands/remove-selection-group.command.js +7 -7
- package/dist/collection/classes/commands/remove-selection-group.command.js.map +1 -1
- package/dist/collection/classes/commands/resize-selection-group.command.js +15 -7
- package/dist/collection/classes/commands/resize-selection-group.command.js.map +1 -1
- package/dist/collection/classes/commands/rotate-selection-group.command.js +14 -12
- package/dist/collection/classes/commands/rotate-selection-group.command.js.map +1 -1
- package/dist/collection/classes/commands/update-object.command.js +6 -5
- package/dist/collection/classes/commands/update-object.command.js.map +1 -1
- package/dist/collection/classes/commands/update-viewport.command.js +11 -11
- package/dist/collection/classes/commands/update-viewport.command.js.map +1 -1
- package/dist/collection/classes/{store.class.js → core/core.class.js} +116 -145
- package/dist/collection/classes/core/core.class.js.map +1 -0
- package/dist/collection/classes/{database.class.js → core/database.class.js} +28 -20
- package/dist/collection/classes/core/database.class.js.map +1 -0
- package/dist/collection/classes/core/history.class.js +88 -0
- package/dist/collection/classes/core/history.class.js.map +1 -0
- package/dist/collection/classes/{reviver.class.js → core/reviver.class.js} +27 -23
- package/dist/collection/classes/core/reviver.class.js.map +1 -0
- package/dist/collection/classes/core/store.class.js +51 -0
- package/dist/collection/classes/core/store.class.js.map +1 -0
- package/dist/collection/classes/core/viewport.class.js +165 -0
- package/dist/collection/classes/core/viewport.class.js.map +1 -0
- package/dist/collection/classes/core/workspace.class.js +42 -0
- package/dist/collection/classes/core/workspace.class.js.map +1 -0
- package/dist/collection/classes/handlers/base.handler.js +4 -4
- package/dist/collection/classes/handlers/base.handler.js.map +1 -1
- package/dist/collection/classes/handlers/context-menu.handler.js +29 -19
- package/dist/collection/classes/handlers/context-menu.handler.js.map +1 -1
- package/dist/collection/classes/handlers/hover.handler.js +5 -5
- package/dist/collection/classes/handlers/hover.handler.js.map +1 -1
- package/dist/collection/classes/handlers/key.handler.js +38 -44
- package/dist/collection/classes/handlers/key.handler.js.map +1 -1
- package/dist/collection/classes/handlers/move.handler.js +49 -44
- package/dist/collection/classes/handlers/move.handler.js.map +1 -1
- package/dist/collection/classes/handlers/resize.handler.js +55 -60
- package/dist/collection/classes/handlers/resize.handler.js.map +1 -1
- package/dist/collection/classes/handlers/rotation.handler.js +59 -69
- package/dist/collection/classes/handlers/rotation.handler.js.map +1 -1
- package/dist/collection/classes/handlers/selection.handler.js +73 -72
- package/dist/collection/classes/handlers/selection.handler.js.map +1 -1
- package/dist/collection/classes/objects/base-object.class.js +30 -17
- package/dist/collection/classes/objects/base-object.class.js.map +1 -1
- package/dist/collection/classes/objects/custom-element.class.js +3 -3
- package/dist/collection/classes/objects/custom-element.class.js.map +1 -1
- package/dist/collection/classes/objects/image.class.js +5 -5
- package/dist/collection/classes/objects/image.class.js.map +1 -1
- package/dist/collection/classes/objects/path.class.js +7 -7
- package/dist/collection/classes/objects/path.class.js.map +1 -1
- package/dist/collection/classes/objects/selection-box.class.js +4 -4
- package/dist/collection/classes/objects/selection-box.class.js.map +1 -1
- package/dist/collection/classes/objects/selection-group.class.js +19 -20
- package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
- package/dist/collection/classes/objects/text.class.js +13 -13
- package/dist/collection/classes/objects/text.class.js.map +1 -1
- package/dist/collection/classes/registries/tool.registry.js +2 -2
- package/dist/collection/classes/registries/tool.registry.js.map +1 -1
- package/dist/collection/classes/tools/base-tool.class.js +11 -5
- package/dist/collection/classes/tools/base-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/brush-tool.class.js +57 -53
- package/dist/collection/classes/tools/brush-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/eraser-tool.class.js +26 -26
- package/dist/collection/classes/tools/eraser-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/image-tool.class.js +11 -11
- package/dist/collection/classes/tools/image-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/selection-tool.class.js +39 -37
- package/dist/collection/classes/tools/selection-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/text-tool.class.js +37 -37
- package/dist/collection/classes/tools/text-tool.class.js.map +1 -1
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +28 -28
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js.map +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +7 -9
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +177 -7
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js.map +1 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +237 -232
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +1 -1
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js.map +1 -1
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js.map +1 -1
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +5 -0
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +3 -3
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js.map +1 -1
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +12 -12
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js.map +1 -1
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js.map +1 -1
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +1 -1
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js.map +1 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js.map +1 -1
- package/dist/collection/components/shared/kritzel-icon/kritzel-icon.css +1 -0
- package/dist/collection/components/shared/kritzel-icon/kritzel-icon.js.map +1 -1
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +5 -1
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +2 -2
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js.map +1 -1
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +18 -7
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +24 -9
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js.map +1 -1
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +4 -42
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js.map +1 -1
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +0 -4
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +52 -10
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js.map +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +4 -0
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js.map +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +79 -7
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js.map +1 -1
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js +47 -15
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js.map +1 -1
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.css +4 -0
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js +6 -6
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js.map +1 -1
- package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.js +2 -2
- package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.js.map +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +12 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +23 -7
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js.map +1 -1
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +5 -0
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js.map +1 -1
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.js +25 -15
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.js.map +1 -1
- package/dist/collection/configs/default-engine-state.js +0 -1
- package/dist/collection/configs/default-engine-state.js.map +1 -1
- package/dist/collection/helpers/devices.helper.js +20 -0
- package/dist/collection/helpers/devices.helper.js.map +1 -1
- package/dist/collection/helpers/event.helper.js +1 -5
- package/dist/collection/helpers/event.helper.js.map +1 -1
- package/dist/collection/helpers/html.helper.js +29 -0
- package/dist/collection/helpers/html.helper.js.map +1 -1
- package/dist/collection/helpers/object.helper.js +0 -14
- package/dist/collection/helpers/object.helper.js.map +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interfaces/clonable.interface.js +2 -0
- package/dist/collection/interfaces/clonable.interface.js.map +1 -0
- package/dist/collection/interfaces/engine-state.interface.js.map +1 -1
- package/dist/collection/interfaces/serializable.interface.js.map +1 -1
- package/dist/collection/types/deep-readonly.type.js +2 -0
- package/dist/collection/types/deep-readonly.type.js.map +1 -0
- package/dist/components/index.js +3 -3
- package/dist/components/kritzel-brush-style.js +59 -1
- package/dist/components/kritzel-brush-style.js.map +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-control-brush-config.js +1 -1
- package/dist/components/kritzel-control-text-config.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +80 -37
- package/dist/components/kritzel-editor.js.map +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/{p-CMJ3P0Vw.js → p-0iJh9Z6m.js} +5 -5
- package/dist/components/p-0iJh9Z6m.js.map +1 -0
- package/dist/components/p-B0kd2rUI.js +16 -0
- package/dist/components/p-B0kd2rUI.js.map +1 -0
- package/dist/components/{p-BB5R2k1o.js → p-B3LGnqFz.js} +41 -31
- package/dist/components/p-B3LGnqFz.js.map +1 -0
- package/dist/components/{p-BB0_-X42.js → p-B7kZ1_RH.js} +4 -4
- package/dist/components/{p-BB0_-X42.js.map → p-B7kZ1_RH.js.map} +1 -1
- package/dist/components/{p-t4NIsuX9.js → p-B7w19kIk.js} +15 -27
- package/dist/components/p-B7w19kIk.js.map +1 -0
- package/dist/components/{p-B1BLgWL1.js → p-BGdsAz54.js} +27 -18
- package/dist/components/p-BGdsAz54.js.map +1 -0
- package/dist/components/{p-CGmS8wnN.js → p-BKvOO7NT.js} +26 -16
- package/dist/components/p-BKvOO7NT.js.map +1 -0
- package/dist/components/{p-BhiYvSBc.js → p-BM9IjvnD.js} +3 -3
- package/dist/components/p-BM9IjvnD.js.map +1 -0
- package/dist/components/{p-BrBQUN0Q.js → p-BPsQrpzN.js} +40 -11
- package/dist/components/p-BPsQrpzN.js.map +1 -0
- package/dist/components/p-C6qB08BS.js +68 -0
- package/dist/components/p-C6qB08BS.js.map +1 -0
- package/dist/components/{p-BPz_H-EG.js → p-CM8KdFZI.js} +28 -16
- package/dist/components/p-CM8KdFZI.js.map +1 -0
- package/dist/components/{p-DHSEK3rF.js → p-CNTK3JOp.js} +174 -153
- package/dist/components/p-CNTK3JOp.js.map +1 -0
- package/dist/components/{p-DMrtdhBD.js → p-CsyM5q2M.js} +7 -7
- package/dist/components/p-CsyM5q2M.js.map +1 -0
- package/dist/components/{p-BuewJQNl.js → p-CwH-bwjb.js} +1187 -1141
- package/dist/components/p-CwH-bwjb.js.map +1 -0
- package/dist/components/{p-BgmKrd5Z.js → p-DCx3703u.js} +5 -5
- package/dist/components/p-DCx3703u.js.map +1 -0
- package/dist/components/{p-trncBp_6.js → p-DFO-6kuA.js} +15 -15
- package/dist/components/p-DFO-6kuA.js.map +1 -0
- package/dist/components/{p-BubxwvMA.js → p-Db3kxVe2.js} +24 -24
- package/dist/components/p-Db3kxVe2.js.map +1 -0
- package/dist/components/{p-BexTdWaX.js → p-Ddlbt3Bj.js} +4 -4
- package/dist/components/p-Ddlbt3Bj.js.map +1 -0
- package/dist/components/{p-CHxPWeZd.js → p-DjU7p3od.js} +11 -11
- package/dist/components/{p-CHxPWeZd.js.map → p-DjU7p3od.js.map} +1 -1
- package/dist/components/{p-BeljsQ-8.js → p-Dw4n-4zp.js} +32 -17
- package/dist/components/p-Dw4n-4zp.js.map +1 -0
- package/dist/components/{p-DxTu1aoJ.js → p-NP1Htol7.js} +7 -45
- package/dist/components/p-NP1Htol7.js.map +1 -0
- package/dist/components/p-YqK8ch2R.js +46 -0
- package/dist/components/p-YqK8ch2R.js.map +1 -0
- package/dist/components/p-l10It7Nm.js +30 -0
- package/dist/components/p-l10It7Nm.js.map +1 -0
- package/dist/components/{p-p1Jkec_q.js → p-sq9jgfX0.js} +3 -3
- package/dist/components/p-sq9jgfX0.js.map +1 -0
- package/dist/components/{p-yZ48g7-u.js → p-sreNwi0N.js} +4 -4
- package/dist/components/{p-yZ48g7-u.js.map → p-sreNwi0N.js.map} +1 -1
- package/dist/esm/{index-B-oSk-v8.js → index-DY3KqYWc.js} +756 -702
- package/dist/esm/index-DY3KqYWc.js.map +1 -0
- package/dist/esm/index-oCOlsFCN.js +6 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/kritzel-brush-style.entry.js +30 -0
- package/dist/esm/kritzel-brush-style.entry.js.map +1 -0
- package/dist/esm/{kritzel-brush-style_23.entry.js → kritzel-color_22.entry.js} +1048 -875
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/kritzel-brush-style.entry.esm.js.map +1 -0
- package/dist/stencil/p-25d1e040.entry.js +2 -0
- package/dist/stencil/p-25d1e040.entry.js.map +1 -0
- package/dist/stencil/p-DY3KqYWc.js +2 -0
- package/dist/stencil/p-DY3KqYWc.js.map +1 -0
- package/dist/stencil/p-dc534b01.entry.js +2 -0
- package/dist/stencil/p-dc534b01.entry.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/commands/add-object.command.d.ts +2 -2
- package/dist/types/classes/commands/add-selection-group.command.d.ts +2 -1
- package/dist/types/classes/commands/base.command.d.ts +3 -3
- package/dist/types/classes/commands/batch.command.d.ts +2 -1
- package/dist/types/classes/commands/move-selection-group.command.d.ts +2 -1
- package/dist/types/classes/commands/remove-object.command.d.ts +2 -2
- package/dist/types/classes/commands/remove-selection-group.command.d.ts +2 -2
- package/dist/types/classes/commands/resize-selection-group.command.d.ts +2 -1
- package/dist/types/classes/commands/rotate-selection-group.command.d.ts +2 -1
- package/dist/types/classes/commands/update-object.command.d.ts +2 -2
- package/dist/types/classes/commands/update-viewport.command.d.ts +2 -1
- package/dist/types/classes/{store.class.d.ts → core/core.class.d.ts} +9 -19
- package/dist/types/classes/{database.class.d.ts → core/database.class.d.ts} +3 -2
- package/dist/types/classes/{history.class.d.ts → core/history.class.d.ts} +5 -5
- package/dist/types/classes/core/reviver.class.d.ts +6 -0
- package/dist/types/classes/core/store.class.d.ts +17 -0
- package/dist/types/classes/{viewport.class.d.ts → core/viewport.class.d.ts} +3 -3
- package/dist/types/classes/core/workspace.class.d.ts +24 -0
- package/dist/types/classes/handlers/base.handler.d.ts +3 -3
- package/dist/types/classes/handlers/context-menu.handler.d.ts +2 -2
- package/dist/types/classes/handlers/hover.handler.d.ts +2 -2
- package/dist/types/classes/handlers/key.handler.d.ts +2 -2
- package/dist/types/classes/handlers/move.handler.d.ts +4 -2
- package/dist/types/classes/handlers/resize.handler.d.ts +3 -2
- package/dist/types/classes/handlers/rotation.handler.d.ts +6 -2
- package/dist/types/classes/handlers/selection.handler.d.ts +2 -2
- package/dist/types/classes/objects/base-object.class.d.ts +8 -5
- package/dist/types/classes/objects/custom-element.class.d.ts +2 -2
- package/dist/types/classes/objects/image.class.d.ts +2 -2
- package/dist/types/classes/objects/path.class.d.ts +2 -2
- package/dist/types/classes/objects/selection-box.class.d.ts +2 -2
- package/dist/types/classes/objects/selection-group.class.d.ts +2 -2
- package/dist/types/classes/objects/text.class.d.ts +2 -2
- package/dist/types/classes/registries/tool.registry.d.ts +2 -2
- package/dist/types/classes/tools/base-tool.class.d.ts +8 -4
- package/dist/types/classes/tools/brush-tool.class.d.ts +2 -2
- package/dist/types/classes/tools/eraser-tool.class.d.ts +2 -2
- package/dist/types/classes/tools/image-tool.class.d.ts +2 -2
- package/dist/types/classes/tools/selection-tool.class.d.ts +2 -2
- package/dist/types/classes/tools/text-tool.class.d.ts +2 -2
- package/dist/types/components/core/kritzel-cursor-trail/kritzel-cursor-trail.d.ts +5 -5
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +13 -3
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +21 -22
- package/dist/types/components/shared/kritzel-dropdown/kritzel-dropdown.d.ts +2 -2
- package/dist/types/components/shared/kritzel-menu-item/kritzel-menu-item.d.ts +2 -0
- package/dist/types/components/shared/kritzel-portal/kritzel-portal.d.ts +0 -1
- package/dist/types/components/shared/kritzel-split-button/kritzel-split-button.d.ts +4 -2
- package/dist/types/components/shared/kritzel-tooltip/kritzel-tooltip.d.ts +8 -2
- package/dist/types/components/ui/kritzel-context-menu/kritzel-context-menu.d.ts +5 -3
- package/dist/types/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.d.ts +1 -1
- package/dist/types/components/ui/kritzel-controls/kritzel-controls.d.ts +3 -1
- package/dist/types/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.d.ts +3 -2
- package/dist/types/components.d.ts +41 -12
- package/dist/types/helpers/devices.helper.d.ts +4 -0
- package/dist/types/helpers/event.helper.d.ts +1 -1
- package/dist/types/helpers/html.helper.d.ts +1 -0
- package/dist/types/helpers/object.helper.d.ts +0 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interfaces/clonable.interface.d.ts +3 -0
- package/dist/types/interfaces/engine-state.interface.d.ts +1 -2
- package/dist/types/interfaces/serializable.interface.d.ts +2 -1
- package/dist/types/types/deep-readonly.type.d.ts +7 -0
- package/package.json +3 -2
- package/dist/cjs/index-BwINBV6L.js.map +0 -1
- package/dist/collection/classes/database.class.js.map +0 -1
- package/dist/collection/classes/history.class.js +0 -88
- package/dist/collection/classes/history.class.js.map +0 -1
- package/dist/collection/classes/reviver.class.js.map +0 -1
- package/dist/collection/classes/store.class.js.map +0 -1
- package/dist/collection/classes/viewport.class.js +0 -153
- package/dist/collection/classes/viewport.class.js.map +0 -1
- package/dist/collection/classes/workspace.class.js +0 -15
- package/dist/collection/classes/workspace.class.js.map +0 -1
- package/dist/components/p-B1BLgWL1.js.map +0 -1
- package/dist/components/p-BB5R2k1o.js.map +0 -1
- package/dist/components/p-BPz_H-EG.js.map +0 -1
- package/dist/components/p-B_lb1FGi.js +0 -19
- package/dist/components/p-B_lb1FGi.js.map +0 -1
- package/dist/components/p-BeljsQ-8.js.map +0 -1
- package/dist/components/p-BexTdWaX.js.map +0 -1
- package/dist/components/p-BgmKrd5Z.js.map +0 -1
- package/dist/components/p-BhiYvSBc.js.map +0 -1
- package/dist/components/p-BrBQUN0Q.js.map +0 -1
- package/dist/components/p-BubxwvMA.js.map +0 -1
- package/dist/components/p-BuewJQNl.js.map +0 -1
- package/dist/components/p-CGmS8wnN.js.map +0 -1
- package/dist/components/p-CJKA5zIE.js +0 -10
- package/dist/components/p-CJKA5zIE.js.map +0 -1
- package/dist/components/p-CMJ3P0Vw.js.map +0 -1
- package/dist/components/p-DHSEK3rF.js.map +0 -1
- package/dist/components/p-DMrtdhBD.js.map +0 -1
- package/dist/components/p-DnUKql15.js +0 -30
- package/dist/components/p-DnUKql15.js.map +0 -1
- package/dist/components/p-DxTu1aoJ.js.map +0 -1
- package/dist/components/p-p1Jkec_q.js.map +0 -1
- package/dist/components/p-rIRXQdie.js +0 -64
- package/dist/components/p-rIRXQdie.js.map +0 -1
- package/dist/components/p-t4NIsuX9.js.map +0 -1
- package/dist/components/p-trncBp_6.js.map +0 -1
- package/dist/esm/index-B-oSk-v8.js.map +0 -1
- package/dist/stencil/p-3bb80782.entry.js +0 -2
- package/dist/stencil/p-3bb80782.entry.js.map +0 -1
- package/dist/stencil/p-B-oSk-v8.js +0 -2
- package/dist/stencil/p-B-oSk-v8.js.map +0 -1
- package/dist/types/classes/reviver.class.d.ts +0 -6
- package/dist/types/classes/workspace.class.d.ts +0 -16
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { KritzelViewport } from "../../../classes/viewport.class";
|
|
2
|
+
import { KritzelViewport } from "../../../classes/core/viewport.class";
|
|
3
3
|
import { KritzelSelectionTool } from "../../../classes/tools/selection-tool.class";
|
|
4
|
-
import { KritzelStore } from "../../../classes/store.class";
|
|
5
4
|
import { KritzelKeyHandler } from "../../../classes/handlers/key.handler";
|
|
6
5
|
import { KritzelBaseTool } from "../../../classes/tools/base-tool.class";
|
|
7
6
|
import { KritzelEraserTool } from "../../../classes/tools/eraser-tool.class";
|
|
@@ -14,131 +13,100 @@ import { KritzelToolRegistry } from "../../../classes/registries/tool.registry";
|
|
|
14
13
|
import { KritzelEventHelper } from "../../../helpers/event.helper";
|
|
15
14
|
import { KritzelClassHelper } from "../../../helpers/class.helper";
|
|
16
15
|
import { ABSOLUTE_SCALE_MAX, ABSOLUTE_SCALE_MIN } from "../../../constants/engine.constants";
|
|
16
|
+
import { KritzelCore } from "../../../classes/core/core.class";
|
|
17
|
+
import { KritzelDevicesHelper } from "../../../helpers/devices.helper";
|
|
17
18
|
export class KritzelEngine {
|
|
19
|
+
host;
|
|
18
20
|
workspace;
|
|
21
|
+
onWorkspaceChange(newWorkspace) {
|
|
22
|
+
if (this.core.store.state.activeWorkspace !== newWorkspace) {
|
|
23
|
+
this.core.initializeWorkspace(newWorkspace);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
19
26
|
activeTool;
|
|
20
27
|
globalContextMenuItems;
|
|
21
28
|
objectContextMenuItems;
|
|
22
29
|
scaleMax = ABSOLUTE_SCALE_MAX;
|
|
23
|
-
scaleMin = ABSOLUTE_SCALE_MIN;
|
|
24
|
-
isEngineReady;
|
|
25
|
-
activeToolChange;
|
|
26
|
-
workspacesChange;
|
|
27
|
-
host;
|
|
28
|
-
forceUpdate = 0;
|
|
29
|
-
onWorkspaceChange(newWorkspace) {
|
|
30
|
-
if (newWorkspace) {
|
|
31
|
-
this.store.initializeWorkspace(newWorkspace);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
30
|
validateScaleMax(newValue) {
|
|
35
31
|
if (newValue > ABSOLUTE_SCALE_MAX) {
|
|
36
32
|
console.warn(`scaleMax cannot be greater than ${ABSOLUTE_SCALE_MAX}.`);
|
|
37
33
|
this.scaleMax = ABSOLUTE_SCALE_MAX;
|
|
38
|
-
this.store.
|
|
34
|
+
this.core.store.setState('scaleMax', this.scaleMax);
|
|
39
35
|
}
|
|
40
36
|
else {
|
|
41
|
-
this.store.
|
|
37
|
+
this.core.store.setState('scaleMax', newValue);
|
|
42
38
|
}
|
|
43
39
|
}
|
|
40
|
+
scaleMin = ABSOLUTE_SCALE_MIN;
|
|
44
41
|
validateScaleMin(newValue) {
|
|
45
42
|
if (newValue < ABSOLUTE_SCALE_MIN) {
|
|
46
43
|
console.warn(`scaleMin cannot be less than ${ABSOLUTE_SCALE_MIN}.`);
|
|
47
44
|
this.scaleMin = ABSOLUTE_SCALE_MIN;
|
|
48
|
-
this.store.
|
|
45
|
+
this.core.store.setState('scaleMin', this.scaleMin);
|
|
49
46
|
}
|
|
50
47
|
else {
|
|
51
|
-
this.store.
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
store;
|
|
55
|
-
viewport;
|
|
56
|
-
contextMenuHandler;
|
|
57
|
-
keyHandler;
|
|
58
|
-
contextMenuElement = null;
|
|
59
|
-
get isSelecting() {
|
|
60
|
-
return this.store.state.activeTool instanceof KritzelSelectionTool && this.store.state.isSelecting;
|
|
61
|
-
}
|
|
62
|
-
get isSelectionActive() {
|
|
63
|
-
return this.store.state.activeTool instanceof KritzelSelectionTool && this.store.state.selectionGroup !== null;
|
|
64
|
-
}
|
|
65
|
-
constructor() {
|
|
66
|
-
this.store = new KritzelStore(this);
|
|
67
|
-
}
|
|
68
|
-
componentWillLoad() {
|
|
69
|
-
this.validateScaleMax(this.scaleMax);
|
|
70
|
-
this.validateScaleMin(this.scaleMin);
|
|
71
|
-
}
|
|
72
|
-
async componentDidLoad() {
|
|
73
|
-
this.contextMenuHandler = new KritzelContextMenuHandler(this.store, this.globalContextMenuItems, this.objectContextMenuItems);
|
|
74
|
-
this.keyHandler = new KritzelKeyHandler(this.store);
|
|
75
|
-
this.viewport = new KritzelViewport(this.store, this.host);
|
|
76
|
-
this._registerStateChangeListeners();
|
|
77
|
-
await this.store.initializeDatabase();
|
|
78
|
-
await this.store.initializeWorkspace(this.workspace);
|
|
79
|
-
if (this.store.state.isReady === false) {
|
|
80
|
-
this.store.state.isReady = true;
|
|
81
|
-
this.isEngineReady.emit(this.store.state);
|
|
48
|
+
this.core.store.setState('scaleMin', newValue);
|
|
82
49
|
}
|
|
83
50
|
}
|
|
51
|
+
isEngineReady;
|
|
52
|
+
activeToolChange;
|
|
53
|
+
workspacesChange;
|
|
54
|
+
longpress;
|
|
55
|
+
forceUpdate = 0;
|
|
84
56
|
handleWheel(ev) {
|
|
85
|
-
if (this.store.isDisabled) {
|
|
57
|
+
if (this.core.store.isDisabled) {
|
|
86
58
|
return;
|
|
87
59
|
}
|
|
88
|
-
if (this.store.state.isContextMenuVisible) {
|
|
60
|
+
if (this.core.store.state.isContextMenuVisible) {
|
|
89
61
|
this.hideContextMenu();
|
|
90
62
|
}
|
|
91
63
|
this.viewport.handleWheel(ev);
|
|
92
|
-
this.store.state?.activeTool?.handleWheel(ev);
|
|
64
|
+
this.core.store.state?.activeTool?.handleWheel(ev);
|
|
93
65
|
}
|
|
94
66
|
handlePointerDown(ev) {
|
|
95
|
-
if (this.store.isDisabled) {
|
|
67
|
+
if (this.core.store.isDisabled) {
|
|
96
68
|
return;
|
|
97
69
|
}
|
|
98
|
-
if (
|
|
99
|
-
this.
|
|
100
|
-
return;
|
|
70
|
+
if (KritzelDevicesHelper.isTouchDevice()) {
|
|
71
|
+
KritzelEventHelper.onLongPress(ev, (event) => this.longpress.emit(event));
|
|
101
72
|
}
|
|
102
|
-
KritzelEventHelper.onLongTouchPress(ev, (event) => {
|
|
103
|
-
if (!(this.store.state.activeTool instanceof KritzelSelectionTool)) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
this.contextMenuHandler.handleContextMenu(event);
|
|
107
|
-
});
|
|
108
73
|
this.host.setPointerCapture(ev.pointerId);
|
|
109
|
-
this.store.state.pointers.set(ev.pointerId, ev);
|
|
74
|
+
this.core.store.state.pointers.set(ev.pointerId, ev);
|
|
110
75
|
this.viewport.handlePointerDown(ev);
|
|
111
|
-
this.store.state?.activeTool?.handlePointerDown(ev);
|
|
76
|
+
this.core.store.state?.activeTool?.handlePointerDown(ev);
|
|
112
77
|
}
|
|
113
78
|
handlePointerMove(ev) {
|
|
114
|
-
if (this.store.isDisabled) {
|
|
79
|
+
if (this.core.store.isDisabled) {
|
|
115
80
|
return;
|
|
116
81
|
}
|
|
117
|
-
this.store.state.pointers.set(ev.pointerId, ev);
|
|
82
|
+
this.core.store.state.pointers.set(ev.pointerId, ev);
|
|
118
83
|
this.viewport.handlePointerMove(ev);
|
|
119
|
-
this.store.state?.activeTool?.handlePointerMove(ev);
|
|
84
|
+
this.core.store.state?.activeTool?.handlePointerMove(ev);
|
|
120
85
|
}
|
|
121
86
|
handlePointerUp(ev) {
|
|
122
|
-
if (this.store.isDisabled) {
|
|
87
|
+
if (this.core.store.isDisabled) {
|
|
123
88
|
return;
|
|
124
89
|
}
|
|
125
|
-
this.store.state.pointers.delete(ev.pointerId);
|
|
90
|
+
this.core.store.state.pointers.delete(ev.pointerId);
|
|
126
91
|
this.host.releasePointerCapture(ev.pointerId);
|
|
127
92
|
this.viewport.handlePointerUp(ev);
|
|
128
|
-
this.store.state?.activeTool?.handlePointerUp(ev);
|
|
93
|
+
this.core.store.state?.activeTool?.handlePointerUp(ev);
|
|
129
94
|
}
|
|
130
95
|
handlePointerCancel(ev) {
|
|
131
|
-
if (this.store.isDisabled) {
|
|
96
|
+
if (this.core.store.isDisabled) {
|
|
132
97
|
return;
|
|
133
98
|
}
|
|
134
99
|
this.host.releasePointerCapture(ev.pointerId);
|
|
135
|
-
this.store.state.pointers.delete(ev.pointerId);
|
|
100
|
+
this.core.store.state.pointers.delete(ev.pointerId);
|
|
136
101
|
this.viewport.handlePointerUp(ev);
|
|
137
|
-
this.store.state?.activeTool?.handlePointerUp(ev);
|
|
102
|
+
this.core.store.state?.activeTool?.handlePointerUp(ev);
|
|
103
|
+
}
|
|
104
|
+
handleLongPress(ev) {
|
|
105
|
+
this.contextMenuHandler.handleContextMenu(ev.detail);
|
|
138
106
|
}
|
|
139
107
|
handleContextMenu(ev) {
|
|
140
108
|
ev.preventDefault();
|
|
141
|
-
if (this.store.isDisabled) {
|
|
109
|
+
if (this.core.store.isDisabled) {
|
|
142
110
|
return;
|
|
143
111
|
}
|
|
144
112
|
if (ev.pointerType === 'touch') {
|
|
@@ -155,26 +123,12 @@ export class KritzelEngine {
|
|
|
155
123
|
handleKeyUp(ev) {
|
|
156
124
|
this.keyHandler.handleKeyUp(ev);
|
|
157
125
|
}
|
|
158
|
-
updateFocus(ev) {
|
|
159
|
-
if (this.store.isDisabled) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const rect = this.store.state.host.getBoundingClientRect();
|
|
163
|
-
const isInside = ev.clientX >= rect.left && ev.clientX <= rect.right && ev.clientY >= rect.top && ev.clientY <= rect.bottom;
|
|
164
|
-
const path = ev.composedPath();
|
|
165
|
-
const kritzelEngineElement = this.host.closest('kritzel-engine');
|
|
166
|
-
const isInKritzelEngine = path.includes(kritzelEngineElement || this.host);
|
|
167
|
-
this.store.setState('isFocused', isInside && isInKritzelEngine);
|
|
168
|
-
}
|
|
169
|
-
handleClick() {
|
|
170
|
-
this.enable();
|
|
171
|
-
}
|
|
172
126
|
async registerTool(toolName, toolClass, toolConfig) {
|
|
173
127
|
if (typeof toolClass !== 'function' || !(toolClass.prototype instanceof KritzelBaseTool)) {
|
|
174
128
|
console.error(`Failed to register tool "${toolName}": Tool class must be a constructor function`);
|
|
175
129
|
return null;
|
|
176
130
|
}
|
|
177
|
-
const registeredTool = KritzelToolRegistry.registerTool(toolName, toolClass, this.
|
|
131
|
+
const registeredTool = KritzelToolRegistry.registerTool(toolName, toolClass, this.core);
|
|
178
132
|
if (toolConfig) {
|
|
179
133
|
Object.entries(toolConfig).forEach(([key, value]) => {
|
|
180
134
|
registeredTool[key] = value;
|
|
@@ -183,153 +137,183 @@ export class KritzelEngine {
|
|
|
183
137
|
return Promise.resolve(registeredTool);
|
|
184
138
|
}
|
|
185
139
|
async changeActiveTool(tool) {
|
|
186
|
-
this.store.state.activeTool?.onDeactivate();
|
|
187
|
-
this.store.setState('activeTool', tool);
|
|
188
|
-
this.
|
|
140
|
+
this.core.store.state.activeTool?.onDeactivate();
|
|
141
|
+
this.core.store.setState('activeTool', tool);
|
|
142
|
+
this.core.deselectAllObjects();
|
|
189
143
|
tool?.onActivate();
|
|
190
144
|
}
|
|
191
|
-
async setFocus() {
|
|
192
|
-
this.host.focus();
|
|
193
|
-
this.store.state.isFocused = true;
|
|
194
|
-
}
|
|
195
145
|
async disable() {
|
|
196
|
-
this.store.
|
|
197
|
-
this.
|
|
146
|
+
this.core.store.setState('isEnabled', false);
|
|
147
|
+
this.core.rerender();
|
|
198
148
|
}
|
|
199
149
|
async enable() {
|
|
200
|
-
this.store.
|
|
201
|
-
this.
|
|
150
|
+
this.core.store.setState('isEnabled', true);
|
|
151
|
+
this.core.rerender();
|
|
202
152
|
}
|
|
203
153
|
async delete() {
|
|
204
|
-
this.
|
|
154
|
+
this.core.delete();
|
|
205
155
|
}
|
|
206
156
|
async copy() {
|
|
207
|
-
this.
|
|
157
|
+
this.core.copy();
|
|
208
158
|
}
|
|
209
159
|
async paste(x, y) {
|
|
210
|
-
this.
|
|
160
|
+
this.core.paste(x, y);
|
|
211
161
|
}
|
|
212
162
|
async bringForward(object) {
|
|
213
|
-
this.
|
|
163
|
+
this.core.bringForward(object);
|
|
214
164
|
}
|
|
215
165
|
async sendBackward(object) {
|
|
216
|
-
this.
|
|
166
|
+
this.core.sendBackward(object);
|
|
217
167
|
}
|
|
218
168
|
async bringToFront(object) {
|
|
219
|
-
this.
|
|
169
|
+
this.core.bringToFront(object);
|
|
220
170
|
}
|
|
221
171
|
async sendToBack(object) {
|
|
222
|
-
this.
|
|
172
|
+
this.core.sendToBack(object);
|
|
223
173
|
}
|
|
224
174
|
async undo() {
|
|
225
|
-
this.
|
|
175
|
+
this.core.history.undo();
|
|
226
176
|
}
|
|
227
177
|
async redo() {
|
|
228
|
-
this.
|
|
178
|
+
this.core.history.redo();
|
|
229
179
|
}
|
|
230
180
|
async hideContextMenu() {
|
|
231
|
-
this.store.state.pointers.clear();
|
|
232
|
-
this.store.
|
|
233
|
-
this.store.
|
|
234
|
-
this.store.
|
|
181
|
+
this.core.store.state.pointers.clear();
|
|
182
|
+
this.core.store.setState('isContextMenuVisible', false);
|
|
183
|
+
this.core.store.setState('selectionBox', null);
|
|
184
|
+
this.core.store.setState('isSelecting', false);
|
|
185
|
+
this.core.store.setState('isEnabled', true);
|
|
186
|
+
this.core.rerender();
|
|
235
187
|
}
|
|
236
188
|
async getObjectById(id) {
|
|
237
|
-
const object = this.store.
|
|
189
|
+
const object = this.core.store.allObjects.find(obj => obj.id === id);
|
|
238
190
|
return object || null;
|
|
239
191
|
}
|
|
240
192
|
async addObject(object) {
|
|
241
|
-
this.
|
|
193
|
+
this.core.deselectAllObjects();
|
|
242
194
|
object.id = object.generateId();
|
|
243
|
-
object.
|
|
244
|
-
object.scale = object.scale ? object.scale : this.store.state.scale;
|
|
245
|
-
object.zIndex = this.store.currentZIndex;
|
|
246
|
-
const command = new AddObjectCommand(this.
|
|
247
|
-
this.
|
|
195
|
+
object._core = this.core;
|
|
196
|
+
object.scale = object.scale ? object.scale : this.core.store.state.scale;
|
|
197
|
+
object.zIndex = this.core.store.currentZIndex;
|
|
198
|
+
const command = new AddObjectCommand(this.core, this, object);
|
|
199
|
+
this.core.history.executeCommand(command);
|
|
248
200
|
return object;
|
|
249
201
|
}
|
|
250
202
|
async updateObject(object, updatedProperties) {
|
|
251
|
-
this.
|
|
252
|
-
const command = new UpdateObjectCommand(this.
|
|
253
|
-
this.
|
|
203
|
+
this.core.deselectAllObjects();
|
|
204
|
+
const command = new UpdateObjectCommand(this.core, this, object, updatedProperties);
|
|
205
|
+
this.core.history.executeCommand(command);
|
|
254
206
|
return object;
|
|
255
207
|
}
|
|
256
208
|
async removeObject(object) {
|
|
257
|
-
this.
|
|
258
|
-
const command = new RemoveObjectCommand(this.
|
|
259
|
-
this.
|
|
209
|
+
this.core.deselectAllObjects();
|
|
210
|
+
const command = new RemoveObjectCommand(this.core, this, object);
|
|
211
|
+
this.core.history.executeCommand(command);
|
|
260
212
|
return object;
|
|
261
213
|
}
|
|
262
214
|
async getSelectedObjects() {
|
|
263
|
-
return this.store.state.selectionGroup ? this.store.state.selectionGroup.objects : [];
|
|
215
|
+
return this.core.store.state.selectionGroup ? this.core.store.state.selectionGroup.objects : [];
|
|
264
216
|
}
|
|
265
217
|
async selectObjects(objects) {
|
|
266
|
-
this.store.state.activeTool?.onDeactivate();
|
|
267
|
-
this.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
268
|
-
this.
|
|
269
|
-
this.
|
|
218
|
+
this.core.store.state.activeTool?.onDeactivate();
|
|
219
|
+
this.core.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
220
|
+
this.core.deselectAllObjects();
|
|
221
|
+
this.core.selectObjects(objects);
|
|
270
222
|
}
|
|
271
223
|
async selectAllObjectsInViewport() {
|
|
272
|
-
this.store.state.activeTool?.onDeactivate();
|
|
273
|
-
this.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
274
|
-
this.
|
|
275
|
-
this.
|
|
224
|
+
this.core.store.state.activeTool?.onDeactivate();
|
|
225
|
+
this.core.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
226
|
+
this.core.deselectAllObjects();
|
|
227
|
+
this.core.selectAllObjectsInViewport();
|
|
276
228
|
}
|
|
277
229
|
async clearSelection() {
|
|
278
|
-
this.
|
|
230
|
+
this.core.clearSelection();
|
|
279
231
|
}
|
|
280
232
|
async centerObjectInViewport(object) {
|
|
281
233
|
object.centerInViewport();
|
|
282
|
-
const command = new UpdateObjectCommand(this.
|
|
283
|
-
this.
|
|
234
|
+
const command = new UpdateObjectCommand(this.core, this, object, object);
|
|
235
|
+
this.core.history.executeCommand(command);
|
|
284
236
|
return object;
|
|
285
237
|
}
|
|
286
238
|
async getCopiedObjects() {
|
|
287
|
-
return this.store.state.copiedObjects?.objects || [];
|
|
239
|
+
return this.core.store.state.copiedObjects?.objects || [];
|
|
288
240
|
}
|
|
289
241
|
async createWorkspace(workspace) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
242
|
+
workspace._core = this.core;
|
|
243
|
+
await this.core.createWorkspace(workspace);
|
|
244
|
+
this.workspacesChange.emit(this.core.store.state.workspaces);
|
|
245
|
+
return workspace;
|
|
293
246
|
}
|
|
294
247
|
async updateWorkspace(workspace) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
});
|
|
248
|
+
await this.core.updateWorkspace(workspace);
|
|
249
|
+
this.workspacesChange.emit(this.core.store.state.workspaces);
|
|
298
250
|
}
|
|
299
251
|
async deleteWorkspace(workspace) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
});
|
|
252
|
+
await this.core.deleteWorkspace(workspace);
|
|
253
|
+
this.workspacesChange.emit(this.core.store.state.workspaces);
|
|
303
254
|
}
|
|
304
255
|
async getWorkspaces() {
|
|
305
|
-
return this.
|
|
256
|
+
return this.core.getWorkspaces();
|
|
257
|
+
}
|
|
258
|
+
async getActiveWorkspace() {
|
|
259
|
+
return this.core.store.state.activeWorkspace;
|
|
260
|
+
}
|
|
261
|
+
core;
|
|
262
|
+
viewport;
|
|
263
|
+
contextMenuHandler;
|
|
264
|
+
keyHandler;
|
|
265
|
+
contextMenuElement = null;
|
|
266
|
+
get isSelecting() {
|
|
267
|
+
return this.core.store.state.activeTool instanceof KritzelSelectionTool && this.core.store.state.isSelecting;
|
|
268
|
+
}
|
|
269
|
+
get isSelectionActive() {
|
|
270
|
+
return this.core.store.state.activeTool instanceof KritzelSelectionTool && this.core.store.state.selectionGroup !== null;
|
|
271
|
+
}
|
|
272
|
+
constructor() {
|
|
273
|
+
this.core = new KritzelCore(this);
|
|
274
|
+
}
|
|
275
|
+
componentWillLoad() {
|
|
276
|
+
this.validateScaleMax(this.scaleMax);
|
|
277
|
+
this.validateScaleMin(this.scaleMin);
|
|
278
|
+
}
|
|
279
|
+
async componentDidLoad() {
|
|
280
|
+
this.contextMenuHandler = new KritzelContextMenuHandler(this.core, this.globalContextMenuItems, this.objectContextMenuItems);
|
|
281
|
+
this.keyHandler = new KritzelKeyHandler(this.core);
|
|
282
|
+
this.viewport = new KritzelViewport(this.core, this.host);
|
|
283
|
+
await this.core.initializeDatabase();
|
|
284
|
+
await this.core.initializeWorkspace(this.workspace);
|
|
285
|
+
this._registerStateChangeListeners();
|
|
286
|
+
if (this.core.store.state.isReady === false) {
|
|
287
|
+
this.core.store.setState('isReady', true);
|
|
288
|
+
this.isEngineReady.emit(this.core.store.state);
|
|
289
|
+
}
|
|
306
290
|
}
|
|
307
291
|
_registerStateChangeListeners() {
|
|
308
|
-
this.store.onStateChange('activeTool', this._handleActiveToolChange.bind(this));
|
|
309
|
-
this.store.onStateChange('isFocused', this._handleIsFocusedChange.bind(this));
|
|
292
|
+
this.core.store.onStateChange('activeTool', this._handleActiveToolChange.bind(this));
|
|
310
293
|
}
|
|
311
294
|
_handleActiveToolChange(activeTool) {
|
|
312
295
|
if (!(activeTool instanceof KritzelSelectionTool)) {
|
|
313
|
-
this.
|
|
296
|
+
this.core.clearSelection();
|
|
314
297
|
}
|
|
315
|
-
this.store.
|
|
298
|
+
this.core.store.setState('skipContextMenu', false);
|
|
316
299
|
this.activeToolChange.emit(activeTool);
|
|
317
300
|
KritzelKeyboardHelper.forceHideKeyboard();
|
|
318
301
|
}
|
|
319
|
-
_handleIsFocusedChange(isFocused) {
|
|
320
|
-
if (!isFocused) {
|
|
321
|
-
this.store.resetActiveText();
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
302
|
render() {
|
|
325
303
|
const computedStyle = window.getComputedStyle(this.host);
|
|
326
304
|
const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
|
|
327
305
|
const baseHandleSize = parseFloat(baseHandleSizePx);
|
|
328
306
|
const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
|
|
329
|
-
return (h(Host, { key: '
|
|
330
|
-
transform: `matrix(${this.store.state?.scale}, 0, 0, ${this.store.state?.scale}, ${this.store.state?.translateX}, ${this.store.state?.translateY})`,
|
|
331
|
-
} }, this.store.state.objectsMap.allObjects()?.map(object => {
|
|
332
|
-
return (h("div", { key: object.id, style: {
|
|
307
|
+
return (h(Host, { key: 'da47553aad7abf8b5daab177c6933a9177b91089' }, h("div", { key: '4e64b43bfb85a61154d36ca8ecd3518d61445d50', class: "debug-panel", style: { display: this.core.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, h("div", { key: '21742da9258a2b929b81c0ca6c8f37f41b228ad4' }, "ActiveWorkspaceId: ", this.core.store.state?.activeWorkspace?.id), h("div", { key: 'de31fcf57b0faf8fad2bb39336eeea35dbec35ca' }, "ActiveWorkspaceName: ", this.core.store.state?.activeWorkspace?.name), h("div", { key: 'a2cb298a867f92349b5e1fb556ee5f9c6110f1c7' }, "TranslateX: ", this.core.store.state?.translateX), h("div", { key: '28697bfcecf9f8b4b1972a90cd02855767433047' }, "TranslateY: ", this.core.store.state?.translateY), h("div", { key: '7fb25f6e9c9b8dea11832dbd311d2cc0b981cbeb' }, "ViewportWidth: ", this.core.store.state?.viewportWidth), h("div", { key: '92aeade312b3d28e4c9b0e1c7ca55f6932fd23d9' }, "ViewportHeight: ", this.core.store.state?.viewportHeight), h("div", { key: 'a4fd8090acaf094e44fdc2e72fcc388695b412c4' }, "Scale: ", this.core.store.state?.scale), h("div", { key: '6ff28100b64bafdffcb8fe9d49cd041a6a374817' }, "ActiveTool: ", this.core.store.state?.activeTool?.name), h("div", { key: '12a61ad3d070563eb721d0d4068143962914b2bc' }, "HasViewportChanged: ", this.core.store.state?.hasViewportChanged ? 'true' : 'false'), h("div", { key: '437309daa2af1a64c9b9d3548fe12e075dd4a8bd' }, "IsEnabled: ", this.core.store.state?.isEnabled ? 'true' : 'false'), h("div", { key: 'e6841095c220ebf081604c548729f085ec9d17bd' }, "IsScaling: ", this.core.store.state?.isScaling ? 'true' : 'false'), h("div", { key: 'b07316a528782f7560c2e42f7bd9edd473cc256c' }, "IsPanning: ", this.core.store.state?.isPanning ? 'true' : 'false'), h("div", { key: '7160a5aa21c4cdbf2b523f620c819ad541a2e466' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", { key: '9ad29a686bc76b47d4c5040121b468428ade437a' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", { key: '68f240aa7d7188996647afd0df73d63a253e18a1' }, "IsResizeHandleSelected: ", this.core.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", { key: '260010c089bdf0e8fd8c2406c39394ef79a85262' }, "IsRotationHandleSelected: ", this.core.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", { key: '6b07975c781801b0a7d7727d0666a6765aa9e889' }, "IsDrawing: ", this.core.store.state.isDrawing ? 'true' : 'false'), h("div", { key: '83c949c9ed26c3d445421ba1f965a742f5fc149f' }, "IsWriting: ", this.core.store.state.isWriting ? 'true' : 'false'), h("div", { key: '1687122785d3370da5d91a975dd56f11aebc81c1' }, "PointerX: ", this.core.store.state?.pointerX), h("div", { key: 'a28e152a0510c9e3eef5624de1b5512baf45b37c' }, "PointerY: ", this.core.store.state?.pointerY), h("div", { key: '09e5a0157002fe95a46415d32a3eb17be8d959a9' }, "SelectedObjects: ", this.core.store.state.selectionGroup?.objects.length || 0)), h("div", { key: '5228fbae773f30d91b129c257ef08adca10a6a70', id: "origin", class: "origin", style: {
|
|
308
|
+
transform: `matrix(${this.core.store.state?.scale}, 0, 0, ${this.core.store.state?.scale}, ${this.core.store.state?.translateX}, ${this.core.store.state?.translateY})`,
|
|
309
|
+
} }, this.core.store.state.objectsMap.allObjects()?.map(object => {
|
|
310
|
+
return (h("div", { key: object.id, style: {
|
|
311
|
+
display: object.isInViewport() ? 'block' : 'none',
|
|
312
|
+
transform: object?.transformationMatrix,
|
|
313
|
+
transformOrigin: 'top left',
|
|
314
|
+
zIndex: object.zIndex.toString(),
|
|
315
|
+
position: 'absolute',
|
|
316
|
+
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", id: object.id, class: "object", style: {
|
|
333
317
|
height: object?.totalHeight.toString(),
|
|
334
318
|
width: object?.totalWidth.toString(),
|
|
335
319
|
left: '0',
|
|
@@ -386,69 +370,71 @@ export class KritzelEngine {
|
|
|
386
370
|
} })), KritzelClassHelper.isInstanceOf(object, 'KrtizelSelectionBox') && (h("div", { ref: el => (el ? object.mount(el) : object.unmount()), style: {
|
|
387
371
|
width: '100%',
|
|
388
372
|
height: '100%',
|
|
373
|
+
backgroundColor: KritzelDevicesHelper.isFirefox() ? object.backgroundColor : 'transparent',
|
|
374
|
+
borderWidth: KritzelDevicesHelper.isFirefox() ? object.borderWidth + 'px' : '0',
|
|
375
|
+
borderStyle: KritzelDevicesHelper.isFirefox() ? 'solid' : 'none',
|
|
376
|
+
borderColor: KritzelDevicesHelper.isFirefox() ? object.borderColor : 'transparent',
|
|
389
377
|
} }))), h("line", { x1: "0", y1: "0", x2: object.totalWidth, y2: "0", style: {
|
|
390
378
|
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
391
|
-
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.store.state?.scale})`,
|
|
379
|
+
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.core.store.state?.scale})`,
|
|
392
380
|
strokeLinecap: 'square',
|
|
393
381
|
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("line", { x1: "0", y1: "0", x2: "0", y2: object.totalHeight, style: {
|
|
394
382
|
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
395
|
-
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.store.state?.scale})`,
|
|
383
|
+
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.core.store.state?.scale})`,
|
|
396
384
|
strokeLinecap: 'square',
|
|
397
385
|
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("line", { x1: "0", y1: object.totalHeight, x2: object.totalWidth, y2: object.totalHeight, style: {
|
|
398
386
|
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
399
|
-
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.store.state?.scale})`,
|
|
387
|
+
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.core.store.state?.scale})`,
|
|
400
388
|
strokeLinecap: 'square',
|
|
401
389
|
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("line", { x1: object.totalWidth, y1: "0", x2: object.totalWidth, y2: object.totalHeight, style: {
|
|
402
390
|
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
403
|
-
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.store.state?.scale})`,
|
|
391
|
+
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.core.store.state?.scale})`,
|
|
404
392
|
strokeLinecap: 'square',
|
|
405
|
-
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle top-left", cx: "0", cy: "0", r: `${(baseHandleSize * object.scale) / this.store.state?.scale}`, style: {
|
|
393
|
+
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle top-left", cx: "0", cy: "0", r: `${(baseHandleSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
406
394
|
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
407
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay top-left", cx: "0", cy: "0", r: `${(baseHandleTouchSize * object.scale) / this.store.state?.scale}`, style: {
|
|
395
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay top-left", cx: "0", cy: "0", r: `${(baseHandleTouchSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
408
396
|
fill: 'transparent',
|
|
409
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle top-right", cx: object.totalWidth, cy: "0", r: `${(baseHandleSize * object.scale) / this.store.state?.scale}`, style: {
|
|
397
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle top-right", cx: object.totalWidth, cy: "0", r: `${(baseHandleSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
410
398
|
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
411
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay top-right", cx: object.totalWidth, cy: "0", r: `${(baseHandleTouchSize * object.scale) / this.store.state?.scale}`, style: {
|
|
399
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay top-right", cx: object.totalWidth, cy: "0", r: `${(baseHandleTouchSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
412
400
|
fill: 'transparent',
|
|
413
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle bottom-left", cx: "0", cy: object.totalHeight, r: `${(baseHandleSize * object.scale) / this.store.state?.scale}`, style: {
|
|
401
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle bottom-left", cx: "0", cy: object.totalHeight, r: `${(baseHandleSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
414
402
|
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
415
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay bottom-left", cx: "0", cy: object.totalHeight, r: `${(baseHandleTouchSize * object.scale) / this.store.state?.scale}`, style: {
|
|
403
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay bottom-left", cx: "0", cy: object.totalHeight, r: `${(baseHandleTouchSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
416
404
|
fill: 'transparent',
|
|
417
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle bottom-right", cx: object.totalWidth, cy: object.totalHeight, r: `${(baseHandleSize * object.scale) / this.store.state?.scale}`, style: {
|
|
405
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle bottom-right", cx: object.totalWidth, cy: object.totalHeight, r: `${(baseHandleSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
418
406
|
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
419
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay bottom-right", cx: object.totalWidth, cy: object.totalHeight, r: `${(baseHandleTouchSize * object.scale) / this.store.state?.scale}`, style: {
|
|
407
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay bottom-right", cx: object.totalWidth, cy: object.totalHeight, r: `${(baseHandleTouchSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
420
408
|
fill: 'transparent',
|
|
421
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("line", { x1: object.totalWidth / 2, y1: "0", x2: object.totalWidth / 2, y2: -((15 * object.scale) / this.store.state?.scale), style: {
|
|
409
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("line", { x1: object.totalWidth / 2, y1: "0", x2: object.totalWidth / 2, y2: -((15 * object.scale) / this.core.store.state?.scale), style: {
|
|
422
410
|
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
423
|
-
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.store.state?.scale})`,
|
|
424
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "rotation-handle", cx: object.totalWidth / 2, cy: -((15 * object.scale) / this.store.state?.scale), r: `${(baseHandleSize * object.scale) / this.store.state?.scale}`, style: {
|
|
411
|
+
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${this.core.store.state?.scale})`,
|
|
412
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "rotation-handle", cx: object.totalWidth / 2, cy: -((15 * object.scale) / this.core.store.state?.scale), r: `${(baseHandleSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
425
413
|
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
426
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "rotation-handle-overlay", cx: object.totalWidth / 2, cy: -((15 * object.scale) / this.store.state?.scale), r: `${(baseHandleTouchSize * object.scale) / this.store.state?.scale}`, style: {
|
|
414
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "rotation-handle-overlay", cx: object.totalWidth / 2, cy: -((15 * object.scale) / this.core.store.state?.scale), r: `${(baseHandleTouchSize * object.scale) / this.core.store.state?.scale}`, style: {
|
|
427
415
|
fill: 'transparent',
|
|
428
416
|
cursor: 'grab',
|
|
429
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.isDebugInfoVisible ? 'block' : 'none' } }, h("div", { style: { width: '100%', height: '100%' } }, h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation), h("div", { style: { whiteSpace: 'nowrap' } }, "x: ", object.x), h("div", { style: { whiteSpace: 'nowrap' } }, "y: ", object.y)))))));
|
|
430
|
-
}), h("svg", { key:
|
|
431
|
-
height: this.store.state.currentPath?.height.toString(),
|
|
432
|
-
width: this.store.state.currentPath?.width.toString(),
|
|
417
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("g", { style: { display: this.core.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.isDebugInfoVisible ? 'block' : 'none' } }, h("div", { style: { width: '100%', height: '100%' } }, h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation), h("div", { style: { whiteSpace: 'nowrap' } }, "x: ", object.x), h("div", { style: { whiteSpace: 'nowrap' } }, "y: ", object.y)))))));
|
|
418
|
+
}), h("svg", { key: "current-path", class: "object", xmlns: "http://www.w3.org/2000/svg", width: this.core.store.state.currentPath?.width, height: this.core.store.state.currentPath?.height, style: {
|
|
433
419
|
left: '0',
|
|
434
420
|
top: '0',
|
|
435
|
-
zIndex: this.store.state.currentPath?.zIndex.toString(),
|
|
421
|
+
zIndex: this.core.store.state.currentPath?.zIndex.toString(),
|
|
436
422
|
position: 'absolute',
|
|
437
|
-
transform: this.store.state.currentPath?.transformationMatrix,
|
|
423
|
+
transform: this.core.store.state.currentPath?.transformationMatrix,
|
|
438
424
|
transformOrigin: 'top left',
|
|
439
425
|
overflow: 'visible',
|
|
440
|
-
}, viewBox: this.store.state.currentPath?.viewBox }, h("path", { key: '
|
|
426
|
+
}, viewBox: this.core.store.state.currentPath?.viewBox }, h("path", { key: '6dedb398968d275166e042660c4718635b57da84', d: this.core.store.state.currentPath?.d, fill: this.core.store.state.currentPath?.fill, stroke: this.core.store.state.currentPath?.stroke }))), this.core.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: '09ae0d7842918bcb4ae9fd16d416badc19942264', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.core.store.state.contextMenuItems, objects: this.core.store.state.selectionGroup?.objects || [], style: {
|
|
441
427
|
position: 'fixed',
|
|
442
|
-
left: `${this.store.state.contextMenuX}px`,
|
|
443
|
-
top: `${this.store.state.contextMenuY}px`,
|
|
428
|
+
left: `${this.core.store.state.contextMenuX}px`,
|
|
429
|
+
top: `${this.core.store.state.contextMenuY}px`,
|
|
444
430
|
zIndex: '10000',
|
|
445
431
|
}, onActionSelected: event => {
|
|
446
432
|
event.detail.action({
|
|
447
|
-
x: (-this.store.state.translateX + this.store.state.contextMenuX) / this.store.state.scale,
|
|
448
|
-
y: (-this.store.state.translateY + this.store.state.contextMenuY) / this.store.state.scale,
|
|
449
|
-
}, this.store.state.selectionGroup?.objects);
|
|
433
|
+
x: (-this.core.store.state.translateX + this.core.store.state.contextMenuX) / this.core.store.state.scale,
|
|
434
|
+
y: (-this.core.store.state.translateY + this.core.store.state.contextMenuY) / this.core.store.state.scale,
|
|
435
|
+
}, this.core.store.state.selectionGroup?.objects);
|
|
450
436
|
this.hideContextMenu();
|
|
451
|
-
} })), this.store.state?.activeTool instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '
|
|
437
|
+
}, onClose: () => this.hideContextMenu() })), this.core.store.state?.activeTool instanceof KritzelEraserTool && !this.core.store.state.isScaling && h("kritzel-cursor-trail", { key: 'e0863ccf8c52ebef822827d8eeac62d3619134ca', core: this.core })));
|
|
452
438
|
}
|
|
453
439
|
static get is() { return "kritzel-engine"; }
|
|
454
440
|
static get encapsulation() { return "shadow"; }
|
|
@@ -474,8 +460,8 @@ export class KritzelEngine {
|
|
|
474
460
|
"references": {
|
|
475
461
|
"KritzelWorkspace": {
|
|
476
462
|
"location": "import",
|
|
477
|
-
"path": "../../../classes/workspace.class",
|
|
478
|
-
"id": "src/classes/workspace.class.ts::KritzelWorkspace"
|
|
463
|
+
"path": "../../../classes/core/workspace.class",
|
|
464
|
+
"id": "src/classes/core/workspace.class.ts::KritzelWorkspace"
|
|
479
465
|
}
|
|
480
466
|
}
|
|
481
467
|
},
|
|
@@ -666,8 +652,28 @@ export class KritzelEngine {
|
|
|
666
652
|
"references": {
|
|
667
653
|
"KritzelWorkspace": {
|
|
668
654
|
"location": "import",
|
|
669
|
-
"path": "../../../classes/workspace.class",
|
|
670
|
-
"id": "src/classes/workspace.class.ts::KritzelWorkspace"
|
|
655
|
+
"path": "../../../classes/core/workspace.class",
|
|
656
|
+
"id": "src/classes/core/workspace.class.ts::KritzelWorkspace"
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}, {
|
|
661
|
+
"method": "longpress",
|
|
662
|
+
"name": "longpress",
|
|
663
|
+
"bubbles": true,
|
|
664
|
+
"cancelable": true,
|
|
665
|
+
"composed": true,
|
|
666
|
+
"docs": {
|
|
667
|
+
"tags": [],
|
|
668
|
+
"text": ""
|
|
669
|
+
},
|
|
670
|
+
"complexType": {
|
|
671
|
+
"original": "PointerEvent",
|
|
672
|
+
"resolved": "PointerEvent",
|
|
673
|
+
"references": {
|
|
674
|
+
"PointerEvent": {
|
|
675
|
+
"location": "global",
|
|
676
|
+
"id": "global::PointerEvent"
|
|
671
677
|
}
|
|
672
678
|
}
|
|
673
679
|
}
|
|
@@ -745,23 +751,6 @@ export class KritzelEngine {
|
|
|
745
751
|
"tags": []
|
|
746
752
|
}
|
|
747
753
|
},
|
|
748
|
-
"setFocus": {
|
|
749
|
-
"complexType": {
|
|
750
|
-
"signature": "() => Promise<void>",
|
|
751
|
-
"parameters": [],
|
|
752
|
-
"references": {
|
|
753
|
-
"Promise": {
|
|
754
|
-
"location": "global",
|
|
755
|
-
"id": "global::Promise"
|
|
756
|
-
}
|
|
757
|
-
},
|
|
758
|
-
"return": "Promise<void>"
|
|
759
|
-
},
|
|
760
|
-
"docs": {
|
|
761
|
-
"text": "",
|
|
762
|
-
"tags": []
|
|
763
|
-
}
|
|
764
|
-
},
|
|
765
754
|
"disable": {
|
|
766
755
|
"complexType": {
|
|
767
756
|
"signature": "() => Promise<void>",
|
|
@@ -1286,7 +1275,7 @@ export class KritzelEngine {
|
|
|
1286
1275
|
},
|
|
1287
1276
|
"createWorkspace": {
|
|
1288
1277
|
"complexType": {
|
|
1289
|
-
"signature": "(workspace: KritzelWorkspace) => Promise<
|
|
1278
|
+
"signature": "(workspace: KritzelWorkspace) => Promise<KritzelWorkspace | null>",
|
|
1290
1279
|
"parameters": [{
|
|
1291
1280
|
"name": "workspace",
|
|
1292
1281
|
"type": "KritzelWorkspace",
|
|
@@ -1299,11 +1288,11 @@ export class KritzelEngine {
|
|
|
1299
1288
|
},
|
|
1300
1289
|
"KritzelWorkspace": {
|
|
1301
1290
|
"location": "import",
|
|
1302
|
-
"path": "../../../classes/workspace.class",
|
|
1303
|
-
"id": "src/classes/workspace.class.ts::KritzelWorkspace"
|
|
1291
|
+
"path": "../../../classes/core/workspace.class",
|
|
1292
|
+
"id": "src/classes/core/workspace.class.ts::KritzelWorkspace"
|
|
1304
1293
|
}
|
|
1305
1294
|
},
|
|
1306
|
-
"return": "Promise<
|
|
1295
|
+
"return": "Promise<KritzelWorkspace>"
|
|
1307
1296
|
},
|
|
1308
1297
|
"docs": {
|
|
1309
1298
|
"text": "",
|
|
@@ -1325,8 +1314,8 @@ export class KritzelEngine {
|
|
|
1325
1314
|
},
|
|
1326
1315
|
"KritzelWorkspace": {
|
|
1327
1316
|
"location": "import",
|
|
1328
|
-
"path": "../../../classes/workspace.class",
|
|
1329
|
-
"id": "src/classes/workspace.class.ts::KritzelWorkspace"
|
|
1317
|
+
"path": "../../../classes/core/workspace.class",
|
|
1318
|
+
"id": "src/classes/core/workspace.class.ts::KritzelWorkspace"
|
|
1330
1319
|
}
|
|
1331
1320
|
},
|
|
1332
1321
|
"return": "Promise<void>"
|
|
@@ -1351,8 +1340,8 @@ export class KritzelEngine {
|
|
|
1351
1340
|
},
|
|
1352
1341
|
"KritzelWorkspace": {
|
|
1353
1342
|
"location": "import",
|
|
1354
|
-
"path": "../../../classes/workspace.class",
|
|
1355
|
-
"id": "src/classes/workspace.class.ts::KritzelWorkspace"
|
|
1343
|
+
"path": "../../../classes/core/workspace.class",
|
|
1344
|
+
"id": "src/classes/core/workspace.class.ts::KritzelWorkspace"
|
|
1356
1345
|
}
|
|
1357
1346
|
},
|
|
1358
1347
|
"return": "Promise<void>"
|
|
@@ -1373,8 +1362,8 @@ export class KritzelEngine {
|
|
|
1373
1362
|
},
|
|
1374
1363
|
"KritzelWorkspace": {
|
|
1375
1364
|
"location": "import",
|
|
1376
|
-
"path": "../../../classes/workspace.class",
|
|
1377
|
-
"id": "src/classes/workspace.class.ts::KritzelWorkspace"
|
|
1365
|
+
"path": "../../../classes/core/workspace.class",
|
|
1366
|
+
"id": "src/classes/core/workspace.class.ts::KritzelWorkspace"
|
|
1378
1367
|
}
|
|
1379
1368
|
},
|
|
1380
1369
|
"return": "Promise<KritzelWorkspace[]>"
|
|
@@ -1383,6 +1372,28 @@ export class KritzelEngine {
|
|
|
1383
1372
|
"text": "",
|
|
1384
1373
|
"tags": []
|
|
1385
1374
|
}
|
|
1375
|
+
},
|
|
1376
|
+
"getActiveWorkspace": {
|
|
1377
|
+
"complexType": {
|
|
1378
|
+
"signature": "() => Promise<KritzelWorkspace>",
|
|
1379
|
+
"parameters": [],
|
|
1380
|
+
"references": {
|
|
1381
|
+
"Promise": {
|
|
1382
|
+
"location": "global",
|
|
1383
|
+
"id": "global::Promise"
|
|
1384
|
+
},
|
|
1385
|
+
"KritzelWorkspace": {
|
|
1386
|
+
"location": "import",
|
|
1387
|
+
"path": "../../../classes/core/workspace.class",
|
|
1388
|
+
"id": "src/classes/core/workspace.class.ts::KritzelWorkspace"
|
|
1389
|
+
}
|
|
1390
|
+
},
|
|
1391
|
+
"return": "Promise<KritzelWorkspace>"
|
|
1392
|
+
},
|
|
1393
|
+
"docs": {
|
|
1394
|
+
"text": "",
|
|
1395
|
+
"tags": []
|
|
1396
|
+
}
|
|
1386
1397
|
}
|
|
1387
1398
|
};
|
|
1388
1399
|
}
|
|
@@ -1430,6 +1441,12 @@ export class KritzelEngine {
|
|
|
1430
1441
|
"target": undefined,
|
|
1431
1442
|
"capture": false,
|
|
1432
1443
|
"passive": false
|
|
1444
|
+
}, {
|
|
1445
|
+
"name": "longpress",
|
|
1446
|
+
"method": "handleLongPress",
|
|
1447
|
+
"target": undefined,
|
|
1448
|
+
"capture": false,
|
|
1449
|
+
"passive": false
|
|
1433
1450
|
}, {
|
|
1434
1451
|
"name": "contextmenu",
|
|
1435
1452
|
"method": "handleContextMenu",
|
|
@@ -1454,18 +1471,6 @@ export class KritzelEngine {
|
|
|
1454
1471
|
"target": "window",
|
|
1455
1472
|
"capture": false,
|
|
1456
1473
|
"passive": false
|
|
1457
|
-
}, {
|
|
1458
|
-
"name": "mousedown",
|
|
1459
|
-
"method": "updateFocus",
|
|
1460
|
-
"target": "window",
|
|
1461
|
-
"capture": false,
|
|
1462
|
-
"passive": true
|
|
1463
|
-
}, {
|
|
1464
|
-
"name": "click",
|
|
1465
|
-
"method": "handleClick",
|
|
1466
|
-
"target": undefined,
|
|
1467
|
-
"capture": false,
|
|
1468
|
-
"passive": false
|
|
1469
1474
|
}];
|
|
1470
1475
|
}
|
|
1471
1476
|
}
|