kritzel-stencil 0.0.154 → 0.0.156
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/stencil/default-text-tool.config-DKpRP4XR.js +1441 -0
- package/dist/stencil/default-text-tool.config-DKpRP4XR.js.map +1 -0
- package/dist/{components/p-l10It7Nm.js → stencil/devices.helper-l10It7Nm.js} +2 -2
- package/dist/stencil/devices.helper-l10It7Nm.js.map +1 -0
- package/dist/stencil/engine.constants-DsjjAmnl.js +7 -0
- package/dist/stencil/engine.constants-DsjjAmnl.js.map +1 -0
- package/dist/{components/p-D8W6LE-c.js → stencil/event-button.enum-D8W6LE-c.js} +2 -2
- package/dist/stencil/event-button.enum-D8W6LE-c.js.map +1 -0
- package/dist/{components/p-C6qB08BS.js → stencil/html.helper-C6qB08BS.js} +2 -2
- package/dist/{collection/helpers/html.helper.js.map → stencil/html.helper-C6qB08BS.js.map} +1 -1
- package/dist/{collection/classes/registries/icon-registry.class.js → stencil/icon-registry.class-BtT8riKh.js} +6 -2
- package/dist/stencil/icon-registry.class-BtT8riKh.js.map +1 -0
- package/dist/stencil/index-DniO_INI.js +4395 -0
- package/dist/stencil/index-DniO_INI.js.map +1 -0
- package/dist/stencil/index.esm.js +18 -2
- package/dist/stencil/index.esm.js.map +1 -1
- package/dist/{esm → stencil}/kritzel-brush-style.entry.js +3 -3
- package/dist/stencil/kritzel-color-palette.entry.esm.js.map +1 -0
- package/dist/{components/p-D1uj4A4F.js → stencil/kritzel-color-palette.entry.js} +9 -39
- package/dist/stencil/kritzel-color.entry.esm.js.map +1 -0
- package/dist/{components/p-D4yvhd1d.js → stencil/kritzel-color.entry.js} +8 -30
- package/dist/stencil/kritzel-context-menu-BYgOEy-i.js +66 -0
- package/dist/stencil/kritzel-context-menu-BYgOEy-i.js.map +1 -0
- package/dist/{components/p-C2sWlNsJ.js → stencil/kritzel-context-menu-GdU9xEKC.js} +12 -41
- package/dist/stencil/kritzel-context-menu-GdU9xEKC.js.map +1 -0
- package/dist/stencil/kritzel-context-menu.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-context-menu.entry.js +3 -0
- package/dist/stencil/kritzel-control-brush-config.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-control-brush-config.entry.js +54 -0
- package/dist/stencil/kritzel-control-text-config.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-control-text-config.entry.js +42 -0
- package/dist/stencil/kritzel-controls.entry.esm.js.map +1 -0
- package/dist/{components/p-1lIHoOlH.js → stencil/kritzel-controls.entry.js} +17 -115
- package/dist/stencil/kritzel-cursor-trail.entry.esm.js.map +1 -0
- package/dist/{components/p-CLt3HMl6.js → stencil/kritzel-cursor-trail.entry.js} +10 -33
- package/dist/stencil/kritzel-dropdown.entry.esm.js.map +1 -0
- package/dist/{components/p-CIXPLjCu.js → stencil/kritzel-dropdown.entry.js} +9 -39
- package/dist/stencil/kritzel-editor.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-editor.entry.js +248 -0
- package/dist/stencil/kritzel-engine.entry.esm.js.map +1 -0
- package/dist/{esm/kritzel-color_22.entry.js → stencil/kritzel-engine.entry.js} +287 -1844
- package/dist/stencil/kritzel-font-family.entry.esm.js.map +1 -0
- package/dist/{components/p-BgznZoBH.js → stencil/kritzel-font-family.entry.js} +9 -37
- package/dist/{components/p-DDmSxM5f.js.map → stencil/kritzel-font-size.entry.esm.js.map} +1 -1
- package/dist/stencil/kritzel-font-size.entry.js +28 -0
- package/dist/stencil/kritzel-font.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-font.entry.js +23 -0
- package/dist/stencil/kritzel-icon.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-icon.entry.js +29 -0
- package/dist/stencil/kritzel-menu-item.entry.esm.js.map +1 -0
- package/dist/{components/p-CsA9M6me.js → stencil/kritzel-menu-item.entry.js} +16 -174
- package/dist/stencil/kritzel-menu.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-menu.entry.js +72 -0
- package/dist/stencil/kritzel-portal.entry.esm.js.map +1 -0
- package/dist/{components/p-D5Wq4x4r.js → stencil/kritzel-portal.entry.js} +11 -37
- package/dist/stencil/kritzel-split-button.entry.esm.js.map +1 -0
- package/dist/{components/p-TdCTkEu0.js → stencil/kritzel-split-button.entry.js} +18 -72
- package/dist/stencil/kritzel-stroke-size.entry.esm.js.map +1 -0
- package/dist/stencil/kritzel-stroke-size.entry.js +27 -0
- package/dist/stencil/kritzel-tooltip.entry.esm.js.map +1 -0
- package/dist/{components/p-CTP479Lf.js → stencil/kritzel-tooltip.entry.js} +11 -39
- package/dist/stencil/kritzel-utility-panel.entry.esm.js.map +1 -0
- package/dist/{components/p-DAfkuR8U.js → stencil/kritzel-utility-panel.entry.js} +11 -38
- package/dist/stencil/kritzel-workspace-manager.entry.esm.js.map +1 -0
- package/dist/{components/p-CK6no3mi.js → stencil/kritzel-workspace-manager.entry.js} +13 -68
- package/dist/stencil/loader.esm.js.map +1 -1
- package/dist/{components/p-B0kd2rUI.js → stencil/object.helper-B0kd2rUI.js} +2 -2
- package/dist/stencil/object.helper-B0kd2rUI.js.map +1 -0
- package/dist/stencil/stencil.esm.js +48 -2
- package/dist/stencil/stencil.esm.js.map +1 -1
- package/dist/stencil/sync-config.interface-lKfyG1EN.js +19839 -0
- package/dist/stencil/sync-config.interface-lKfyG1EN.js.map +1 -0
- package/dist/{components/p-CBYBurdY.js → stencil/text-tool.class-C0GbC5zQ.js} +729 -25
- package/dist/stencil/text-tool.class-C0GbC5zQ.js.map +1 -0
- package/dist/{components/p-n789Y3S-.js → stencil/workspace.class-n789Y3S-.js} +2 -2
- package/dist/stencil/workspace.class-n789Y3S-.js.map +1 -0
- package/dist/types/classes/structures/object-map.structure.d.ts +9 -1
- package/dist/types/classes/structures/quadtree.structure.d.ts +18 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +1 -0
- package/dist/types/interfaces/bounding-box.interface.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -8
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/default-text-tool.config-BySzvIox.js +0 -31267
- package/dist/cjs/default-text-tool.config-BySzvIox.js.map +0 -1
- package/dist/cjs/index-Cj__YTlG.js +0 -1650
- package/dist/cjs/index-Cj__YTlG.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -1465
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +0 -32
- package/dist/cjs/kritzel-brush-style.entry.cjs.js.map +0 -1
- package/dist/cjs/kritzel-color_22.cjs.entry.js +0 -20798
- package/dist/cjs/loader.cjs.js +0 -14
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/stencil.cjs.js +0 -26
- package/dist/cjs/stencil.cjs.js.map +0 -1
- package/dist/collection/classes/core/core.class.js +0 -461
- package/dist/collection/classes/core/core.class.js.map +0 -1
- package/dist/collection/classes/core/reviver.class.js +0 -71
- package/dist/collection/classes/core/reviver.class.js.map +0 -1
- package/dist/collection/classes/core/store.class.js +0 -72
- package/dist/collection/classes/core/store.class.js.map +0 -1
- package/dist/collection/classes/core/viewport.class.js +0 -190
- package/dist/collection/classes/core/viewport.class.js.map +0 -1
- package/dist/collection/classes/core/workspace.class.js +0 -41
- package/dist/collection/classes/core/workspace.class.js.map +0 -1
- package/dist/collection/classes/handlers/base.handler.js +0 -8
- package/dist/collection/classes/handlers/base.handler.js.map +0 -1
- package/dist/collection/classes/handlers/context-menu.handler.js +0 -62
- package/dist/collection/classes/handlers/context-menu.handler.js.map +0 -1
- package/dist/collection/classes/handlers/hover.handler.js +0 -19
- package/dist/collection/classes/handlers/hover.handler.js.map +0 -1
- package/dist/collection/classes/handlers/key.handler.js +0 -58
- package/dist/collection/classes/handlers/key.handler.js.map +0 -1
- package/dist/collection/classes/handlers/move.handler.js +0 -149
- package/dist/collection/classes/handlers/move.handler.js.map +0 -1
- package/dist/collection/classes/handlers/resize.handler.js +0 -184
- package/dist/collection/classes/handlers/resize.handler.js.map +0 -1
- package/dist/collection/classes/handlers/rotation.handler.js +0 -116
- package/dist/collection/classes/handlers/rotation.handler.js.map +0 -1
- package/dist/collection/classes/handlers/selection.handler.js +0 -246
- package/dist/collection/classes/handlers/selection.handler.js.map +0 -1
- package/dist/collection/classes/objects/base-object.class.js +0 -232
- package/dist/collection/classes/objects/base-object.class.js.map +0 -1
- package/dist/collection/classes/objects/custom-element.class.js +0 -62
- package/dist/collection/classes/objects/custom-element.class.js.map +0 -1
- package/dist/collection/classes/objects/image.class.js +0 -56
- package/dist/collection/classes/objects/image.class.js.map +0 -1
- package/dist/collection/classes/objects/path.class.js +0 -284
- package/dist/collection/classes/objects/path.class.js.map +0 -1
- package/dist/collection/classes/objects/selection-box.class.js +0 -19
- package/dist/collection/classes/objects/selection-box.class.js.map +0 -1
- package/dist/collection/classes/objects/selection-group.class.js +0 -226
- package/dist/collection/classes/objects/selection-group.class.js.map +0 -1
- package/dist/collection/classes/objects/text.class.js +0 -261
- package/dist/collection/classes/objects/text.class.js.map +0 -1
- package/dist/collection/classes/providers/broadcast-sync-provider.class.js +0 -93
- package/dist/collection/classes/providers/broadcast-sync-provider.class.js.map +0 -1
- package/dist/collection/classes/providers/hocuspocus-sync-provider.class.js +0 -232
- package/dist/collection/classes/providers/hocuspocus-sync-provider.class.js.map +0 -1
- package/dist/collection/classes/providers/indexeddb-sync-provider.class.js +0 -35
- package/dist/collection/classes/providers/indexeddb-sync-provider.class.js.map +0 -1
- package/dist/collection/classes/providers/websocket-sync-provider.class.js +0 -89
- package/dist/collection/classes/providers/websocket-sync-provider.class.js.map +0 -1
- package/dist/collection/classes/registries/icon-registry.class.js.map +0 -1
- package/dist/collection/classes/registries/tool.registry.js +0 -18
- package/dist/collection/classes/registries/tool.registry.js.map +0 -1
- package/dist/collection/classes/structures/app-state-map.structure.js +0 -189
- package/dist/collection/classes/structures/app-state-map.structure.js.map +0 -1
- package/dist/collection/classes/structures/object-map.structure.js +0 -310
- package/dist/collection/classes/structures/object-map.structure.js.map +0 -1
- package/dist/collection/classes/tools/base-tool.class.js +0 -38
- package/dist/collection/classes/tools/base-tool.class.js.map +0 -1
- package/dist/collection/classes/tools/brush-tool.class.js +0 -133
- package/dist/collection/classes/tools/brush-tool.class.js.map +0 -1
- package/dist/collection/classes/tools/eraser-tool.class.js +0 -85
- package/dist/collection/classes/tools/eraser-tool.class.js.map +0 -1
- package/dist/collection/classes/tools/image-tool.class.js +0 -83
- package/dist/collection/classes/tools/image-tool.class.js.map +0 -1
- package/dist/collection/classes/tools/selection-tool.class.js +0 -164
- package/dist/collection/classes/tools/selection-tool.class.js.map +0 -1
- package/dist/collection/classes/tools/text-tool.class.js +0 -108
- package/dist/collection/classes/tools/text-tool.class.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -34
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.css +0 -10
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +0 -153
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js.map +0 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +0 -34
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +0 -928
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js.map +0 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +0 -73
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +0 -1593
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +0 -1
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.css +0 -44
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +0 -98
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js.map +0 -1
- package/dist/collection/components/shared/kritzel-color/kritzel-color.css +0 -21
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +0 -107
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js.map +0 -1
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +0 -46
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +0 -145
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js.map +0 -1
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +0 -53
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +0 -218
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js.map +0 -1
- package/dist/collection/components/shared/kritzel-font/kritzel-font.css +0 -10
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +0 -90
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js.map +0 -1
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.css +0 -48
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +0 -114
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js.map +0 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.css +0 -30
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +0 -110
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js.map +0 -1
- package/dist/collection/components/shared/kritzel-icon/kritzel-icon.css +0 -18
- package/dist/collection/components/shared/kritzel-icon/kritzel-icon.js +0 -94
- package/dist/collection/components/shared/kritzel-icon/kritzel-icon.js.map +0 -1
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +0 -27
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +0 -291
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js.map +0 -1
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +0 -145
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +0 -280
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js.map +0 -1
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +0 -310
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js.map +0 -1
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +0 -78
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +0 -406
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js.map +0 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +0 -28
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +0 -89
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js.map +0 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.css +0 -17
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +0 -251
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js.map +0 -1
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.css +0 -55
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js +0 -172
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js.map +0 -1
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.css +0 -19
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js +0 -135
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js.map +0 -1
- package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.css +0 -19
- package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.js +0 -115
- package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.js.map +0 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +0 -127
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +0 -312
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js.map +0 -1
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +0 -44
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +0 -111
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js.map +0 -1
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.css +0 -5
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.js +0 -255
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.js.map +0 -1
- package/dist/collection/configs/default-brush-tool.config.js +0 -60
- package/dist/collection/configs/default-brush-tool.config.js.map +0 -1
- package/dist/collection/configs/default-engine-config.js +0 -53
- package/dist/collection/configs/default-engine-config.js.map +0 -1
- package/dist/collection/configs/default-sync.config.js +0 -10
- package/dist/collection/configs/default-sync.config.js.map +0 -1
- package/dist/collection/configs/default-text-tool.config.js +0 -32
- package/dist/collection/configs/default-text-tool.config.js.map +0 -1
- package/dist/collection/constants/core.constants.js +0 -2
- package/dist/collection/constants/core.constants.js.map +0 -1
- package/dist/collection/constants/engine.constants.js +0 -3
- package/dist/collection/constants/engine.constants.js.map +0 -1
- package/dist/collection/enums/event-button.enum.js +0 -7
- package/dist/collection/enums/event-button.enum.js.map +0 -1
- package/dist/collection/enums/handle-type.enum.js +0 -8
- package/dist/collection/enums/handle-type.enum.js.map +0 -1
- package/dist/collection/helpers/class.helper.js +0 -6
- package/dist/collection/helpers/class.helper.js.map +0 -1
- package/dist/collection/helpers/devices.helper.js +0 -26
- package/dist/collection/helpers/devices.helper.js.map +0 -1
- package/dist/collection/helpers/event.helper.js +0 -51
- package/dist/collection/helpers/event.helper.js.map +0 -1
- package/dist/collection/helpers/geometry.helper.js +0 -53
- package/dist/collection/helpers/geometry.helper.js.map +0 -1
- package/dist/collection/helpers/html.helper.js +0 -64
- package/dist/collection/helpers/keyboard.helper.js +0 -49
- package/dist/collection/helpers/keyboard.helper.js.map +0 -1
- package/dist/collection/helpers/math.helper.js +0 -6
- package/dist/collection/helpers/math.helper.js.map +0 -1
- package/dist/collection/helpers/object.helper.js +0 -12
- package/dist/collection/helpers/object.helper.js.map +0 -1
- package/dist/collection/index.js +0 -30
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/interfaces/bounding-box.interface.js +0 -2
- package/dist/collection/interfaces/bounding-box.interface.js.map +0 -1
- package/dist/collection/interfaces/clonable.interface.js +0 -2
- package/dist/collection/interfaces/clonable.interface.js.map +0 -1
- package/dist/collection/interfaces/context-menu-item.interface.js +0 -2
- package/dist/collection/interfaces/context-menu-item.interface.js.map +0 -1
- package/dist/collection/interfaces/debug-info.interface.js +0 -2
- package/dist/collection/interfaces/debug-info.interface.js.map +0 -1
- package/dist/collection/interfaces/engine-state.interface.js +0 -2
- package/dist/collection/interfaces/engine-state.interface.js.map +0 -1
- package/dist/collection/interfaces/menu-item.interface.js +0 -2
- package/dist/collection/interfaces/menu-item.interface.js.map +0 -1
- package/dist/collection/interfaces/object.interface.js +0 -2
- package/dist/collection/interfaces/object.interface.js.map +0 -1
- package/dist/collection/interfaces/path-options.interface.js +0 -2
- package/dist/collection/interfaces/path-options.interface.js.map +0 -1
- package/dist/collection/interfaces/point.interface.js +0 -2
- package/dist/collection/interfaces/point.interface.js.map +0 -1
- package/dist/collection/interfaces/polygon.interface.js +0 -2
- package/dist/collection/interfaces/polygon.interface.js.map +0 -1
- package/dist/collection/interfaces/selection-state.interface.js +0 -2
- package/dist/collection/interfaces/selection-state.interface.js.map +0 -1
- package/dist/collection/interfaces/serializable.interface.js +0 -2
- package/dist/collection/interfaces/serializable.interface.js.map +0 -1
- package/dist/collection/interfaces/shortcut.interface.js +0 -2
- package/dist/collection/interfaces/shortcut.interface.js.map +0 -1
- package/dist/collection/interfaces/sync-config.interface.js +0 -2
- package/dist/collection/interfaces/sync-config.interface.js.map +0 -1
- package/dist/collection/interfaces/sync-provider.interface.js +0 -2
- package/dist/collection/interfaces/sync-provider.interface.js.map +0 -1
- package/dist/collection/interfaces/tool.interface.js +0 -2
- package/dist/collection/interfaces/tool.interface.js.map +0 -1
- package/dist/collection/interfaces/toolbar-control.interface.js +0 -2
- package/dist/collection/interfaces/toolbar-control.interface.js.map +0 -1
- package/dist/collection/interfaces/undo-state.interface.js +0 -2
- package/dist/collection/interfaces/undo-state.interface.js.map +0 -1
- package/dist/collection/types/deep-readonly.type.js +0 -2
- package/dist/collection/types/deep-readonly.type.js.map +0 -1
- package/dist/collection/types/state.types.js +0 -2
- package/dist/collection/types/state.types.js.map +0 -1
- package/dist/components/index.js +0 -1477
- package/dist/components/index.js.map +0 -1
- package/dist/components/kritzel-brush-style.js +0 -67
- package/dist/components/kritzel-brush-style.js.map +0 -1
- package/dist/components/kritzel-color-palette.js +0 -9
- package/dist/components/kritzel-color-palette.js.map +0 -1
- package/dist/components/kritzel-color.js +0 -9
- package/dist/components/kritzel-color.js.map +0 -1
- package/dist/components/kritzel-context-menu.js +0 -9
- package/dist/components/kritzel-context-menu.js.map +0 -1
- package/dist/components/kritzel-control-brush-config.js +0 -9
- package/dist/components/kritzel-control-brush-config.js.map +0 -1
- package/dist/components/kritzel-control-text-config.js +0 -9
- package/dist/components/kritzel-control-text-config.js.map +0 -1
- package/dist/components/kritzel-controls.js +0 -9
- package/dist/components/kritzel-controls.js.map +0 -1
- package/dist/components/kritzel-cursor-trail.js +0 -9
- package/dist/components/kritzel-cursor-trail.js.map +0 -1
- package/dist/components/kritzel-dropdown.js +0 -9
- package/dist/components/kritzel-dropdown.js.map +0 -1
- package/dist/components/kritzel-editor.js +0 -516
- package/dist/components/kritzel-editor.js.map +0 -1
- package/dist/components/kritzel-engine.js +0 -9
- package/dist/components/kritzel-engine.js.map +0 -1
- package/dist/components/kritzel-font-family.js +0 -9
- package/dist/components/kritzel-font-family.js.map +0 -1
- package/dist/components/kritzel-font-size.js +0 -9
- package/dist/components/kritzel-font-size.js.map +0 -1
- package/dist/components/kritzel-font.js +0 -9
- package/dist/components/kritzel-font.js.map +0 -1
- package/dist/components/kritzel-icon.js +0 -9
- package/dist/components/kritzel-icon.js.map +0 -1
- package/dist/components/kritzel-menu-item.js +0 -9
- package/dist/components/kritzel-menu-item.js.map +0 -1
- package/dist/components/kritzel-menu.js +0 -9
- package/dist/components/kritzel-menu.js.map +0 -1
- package/dist/components/kritzel-portal.js +0 -9
- package/dist/components/kritzel-portal.js.map +0 -1
- package/dist/components/kritzel-split-button.js +0 -9
- package/dist/components/kritzel-split-button.js.map +0 -1
- package/dist/components/kritzel-stroke-size.js +0 -9
- package/dist/components/kritzel-stroke-size.js.map +0 -1
- package/dist/components/kritzel-tooltip.js +0 -9
- package/dist/components/kritzel-tooltip.js.map +0 -1
- package/dist/components/kritzel-utility-panel.js +0 -9
- package/dist/components/kritzel-utility-panel.js.map +0 -1
- package/dist/components/kritzel-workspace-manager.js +0 -9
- package/dist/components/kritzel-workspace-manager.js.map +0 -1
- package/dist/components/p-1lIHoOlH.js.map +0 -1
- package/dist/components/p-B0kd2rUI.js.map +0 -1
- package/dist/components/p-B4kxkVe-.js +0 -55
- package/dist/components/p-B4kxkVe-.js.map +0 -1
- package/dist/components/p-BQg4YML7.js +0 -106
- package/dist/components/p-BQg4YML7.js.map +0 -1
- package/dist/components/p-BfaEHdtM.js +0 -35434
- package/dist/components/p-BfaEHdtM.js.map +0 -1
- package/dist/components/p-BgznZoBH.js.map +0 -1
- package/dist/components/p-Bhtn9qay.js +0 -98
- package/dist/components/p-Bhtn9qay.js.map +0 -1
- package/dist/components/p-C2sWlNsJ.js.map +0 -1
- package/dist/components/p-C6qB08BS.js.map +0 -1
- package/dist/components/p-CBYBurdY.js.map +0 -1
- package/dist/components/p-CIXPLjCu.js.map +0 -1
- package/dist/components/p-CK6no3mi.js.map +0 -1
- package/dist/components/p-CLt3HMl6.js.map +0 -1
- package/dist/components/p-CTP479Lf.js.map +0 -1
- package/dist/components/p-CsA9M6me.js.map +0 -1
- package/dist/components/p-CwkUrTy1.js +0 -1367
- package/dist/components/p-CwkUrTy1.js.map +0 -1
- package/dist/components/p-D1uj4A4F.js.map +0 -1
- package/dist/components/p-D4yvhd1d.js.map +0 -1
- package/dist/components/p-D5Wq4x4r.js.map +0 -1
- package/dist/components/p-D8W6LE-c.js.map +0 -1
- package/dist/components/p-DAfkuR8U.js.map +0 -1
- package/dist/components/p-DDmSxM5f.js +0 -57
- package/dist/components/p-Ddh40W3x.js +0 -103
- package/dist/components/p-Ddh40W3x.js.map +0 -1
- package/dist/components/p-TdCTkEu0.js.map +0 -1
- package/dist/components/p-l10It7Nm.js.map +0 -1
- package/dist/components/p-n789Y3S-.js.map +0 -1
- package/dist/components/p-uuRJU2R1.js +0 -46
- package/dist/components/p-uuRJU2R1.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -6
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/default-text-tool.config-2YFQA3SF.js +0 -31208
- package/dist/esm/default-text-tool.config-2YFQA3SF.js.map +0 -1
- package/dist/esm/index-SGde3HXB.js +0 -1623
- package/dist/esm/index-SGde3HXB.js.map +0 -1
- package/dist/esm/index.js +0 -1449
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/kritzel-brush-style.entry.js.map +0 -1
- package/dist/esm/loader.js +0 -12
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/stencil.js +0 -22
- package/dist/esm/stencil.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil/p-2YFQA3SF.js +0 -2
- package/dist/stencil/p-2YFQA3SF.js.map +0 -1
- package/dist/stencil/p-DQuL1Twl.js +0 -2
- package/dist/stencil/p-DQuL1Twl.js.map +0 -1
- package/dist/stencil/p-SGde3HXB.js +0 -3
- package/dist/stencil/p-SGde3HXB.js.map +0 -1
- package/dist/stencil/p-bb5b2f78.entry.js +0 -10
- package/dist/stencil/p-bb5b2f78.entry.js.map +0 -1
- package/dist/stencil/p-d702c5af.entry.js +0 -2
- package/dist/stencil/p-d702c5af.entry.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as ObjectHelper } from './
|
|
2
|
-
import { K as KritzelDevicesHelper } from './
|
|
3
|
-
import { K as KritzelMouseButton } from './
|
|
1
|
+
import { O as ObjectHelper } from './object.helper-B0kd2rUI.js';
|
|
2
|
+
import { K as KritzelDevicesHelper } from './devices.helper-l10It7Nm.js';
|
|
3
|
+
import { K as KritzelMouseButton } from './event-button.enum-D8W6LE-c.js';
|
|
4
4
|
|
|
5
5
|
class KritzelToolRegistry {
|
|
6
6
|
static registry = {};
|
|
@@ -214,6 +214,7 @@ class KritzelBaseObject {
|
|
|
214
214
|
const viewportBounds = {
|
|
215
215
|
x: -this._core.store.state.translateX / this._core.store.state.scale,
|
|
216
216
|
y: -this._core.store.state.translateY / this._core.store.state.scale,
|
|
217
|
+
z: this._core.store.state.scale,
|
|
217
218
|
width: this._core.store.state.viewportWidth / this._core.store.state.scale,
|
|
218
219
|
height: this._core.store.state.viewportHeight / this._core.store.state.scale,
|
|
219
220
|
};
|
|
@@ -2725,7 +2726,7 @@ let NodeType$1 = class NodeType {
|
|
|
2725
2726
|
@internal
|
|
2726
2727
|
*/
|
|
2727
2728
|
checkAttrs(attrs) {
|
|
2728
|
-
checkAttrs(this.attrs, attrs, "node");
|
|
2729
|
+
checkAttrs(this.attrs, attrs, "node", this.name);
|
|
2729
2730
|
}
|
|
2730
2731
|
/**
|
|
2731
2732
|
Check whether the given mark type is allowed in this node.
|
|
@@ -2876,7 +2877,7 @@ class MarkType {
|
|
|
2876
2877
|
@internal
|
|
2877
2878
|
*/
|
|
2878
2879
|
checkAttrs(attrs) {
|
|
2879
|
-
checkAttrs(this.attrs, attrs, "mark");
|
|
2880
|
+
checkAttrs(this.attrs, attrs, "mark", this.name);
|
|
2880
2881
|
}
|
|
2881
2882
|
/**
|
|
2882
2883
|
Queries whether a given mark type is
|
|
@@ -3184,7 +3185,7 @@ function wsOptionsFor(type, preserveWhitespace, base) {
|
|
|
3184
3185
|
if (preserveWhitespace != null)
|
|
3185
3186
|
return (preserveWhitespace ? OPT_PRESERVE_WS : 0) |
|
|
3186
3187
|
(preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0);
|
|
3187
|
-
return type && type.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base &
|
|
3188
|
+
return type && type.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base & ~OPT_OPEN_LEFT;
|
|
3188
3189
|
}
|
|
3189
3190
|
class NodeContext {
|
|
3190
3191
|
constructor(type, attrs, marks, solid, match, options) {
|
|
@@ -4944,7 +4945,7 @@ function liftTarget(range) {
|
|
|
4944
4945
|
}
|
|
4945
4946
|
return null;
|
|
4946
4947
|
}
|
|
4947
|
-
function lift(tr, range, target) {
|
|
4948
|
+
function lift$1(tr, range, target) {
|
|
4948
4949
|
let { $from, $to, depth } = range;
|
|
4949
4950
|
let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
|
|
4950
4951
|
let start = gapStart, end = gapEnd;
|
|
@@ -4970,6 +4971,45 @@ function lift(tr, range, target) {
|
|
|
4970
4971
|
}
|
|
4971
4972
|
tr.step(new ReplaceAroundStep(start, end, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));
|
|
4972
4973
|
}
|
|
4974
|
+
/**
|
|
4975
|
+
Try to find a valid way to wrap the content in the given range in a
|
|
4976
|
+
node of the given type. May introduce extra nodes around and inside
|
|
4977
|
+
the wrapper node, if necessary. Returns null if no valid wrapping
|
|
4978
|
+
could be found. When `innerRange` is given, that range's content is
|
|
4979
|
+
used as the content to fit into the wrapping, instead of the
|
|
4980
|
+
content of `range`.
|
|
4981
|
+
*/
|
|
4982
|
+
function findWrapping(range, nodeType, attrs = null, innerRange = range) {
|
|
4983
|
+
let around = findWrappingOutside(range, nodeType);
|
|
4984
|
+
let inner = around && findWrappingInside(innerRange, nodeType);
|
|
4985
|
+
if (!inner)
|
|
4986
|
+
return null;
|
|
4987
|
+
return around.map(withAttrs)
|
|
4988
|
+
.concat({ type: nodeType, attrs }).concat(inner.map(withAttrs));
|
|
4989
|
+
}
|
|
4990
|
+
function withAttrs(type) { return { type, attrs: null }; }
|
|
4991
|
+
function findWrappingOutside(range, type) {
|
|
4992
|
+
let { parent, startIndex, endIndex } = range;
|
|
4993
|
+
let around = parent.contentMatchAt(startIndex).findWrapping(type);
|
|
4994
|
+
if (!around)
|
|
4995
|
+
return null;
|
|
4996
|
+
let outer = around.length ? around[0] : type;
|
|
4997
|
+
return parent.canReplaceWith(startIndex, endIndex, outer) ? around : null;
|
|
4998
|
+
}
|
|
4999
|
+
function findWrappingInside(range, type) {
|
|
5000
|
+
let { parent, startIndex, endIndex } = range;
|
|
5001
|
+
let inner = parent.child(startIndex);
|
|
5002
|
+
let inside = type.contentMatch.findWrapping(inner.type);
|
|
5003
|
+
if (!inside)
|
|
5004
|
+
return null;
|
|
5005
|
+
let lastType = inside.length ? inside[inside.length - 1] : type;
|
|
5006
|
+
let innerMatch = lastType.contentMatch;
|
|
5007
|
+
for (let i = startIndex; innerMatch && i < endIndex; i++)
|
|
5008
|
+
innerMatch = innerMatch.matchType(parent.child(i).type);
|
|
5009
|
+
if (!innerMatch || !innerMatch.validEnd)
|
|
5010
|
+
return null;
|
|
5011
|
+
return inside;
|
|
5012
|
+
}
|
|
4973
5013
|
function wrap(tr, range, wrappers) {
|
|
4974
5014
|
let content = Fragment.empty;
|
|
4975
5015
|
for (let i = wrappers.length - 1; i >= 0; i--) {
|
|
@@ -4983,7 +5023,7 @@ function wrap(tr, range, wrappers) {
|
|
|
4983
5023
|
let start = range.start, end = range.end;
|
|
4984
5024
|
tr.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
|
|
4985
5025
|
}
|
|
4986
|
-
function setBlockType(tr, from, to, type, attrs) {
|
|
5026
|
+
function setBlockType$1(tr, from, to, type, attrs) {
|
|
4987
5027
|
if (!type.isTextblock)
|
|
4988
5028
|
throw new RangeError("Type given to setBlockType should be a textblock");
|
|
4989
5029
|
let mapFrom = tr.steps.length;
|
|
@@ -5115,6 +5155,36 @@ function canAppendWithSubstitutedLinebreaks(a, b) {
|
|
|
5115
5155
|
function joinable(a, b) {
|
|
5116
5156
|
return !!(a && b && !a.isLeaf && canAppendWithSubstitutedLinebreaks(a, b));
|
|
5117
5157
|
}
|
|
5158
|
+
/**
|
|
5159
|
+
Find an ancestor of the given position that can be joined to the
|
|
5160
|
+
block before (or after if `dir` is positive). Returns the joinable
|
|
5161
|
+
point, if any.
|
|
5162
|
+
*/
|
|
5163
|
+
function joinPoint(doc, pos, dir = -1) {
|
|
5164
|
+
let $pos = doc.resolve(pos);
|
|
5165
|
+
for (let d = $pos.depth;; d--) {
|
|
5166
|
+
let before, after, index = $pos.index(d);
|
|
5167
|
+
if (d == $pos.depth) {
|
|
5168
|
+
before = $pos.nodeBefore;
|
|
5169
|
+
after = $pos.nodeAfter;
|
|
5170
|
+
}
|
|
5171
|
+
else if (dir > 0) {
|
|
5172
|
+
before = $pos.node(d + 1);
|
|
5173
|
+
index++;
|
|
5174
|
+
after = $pos.node(d).maybeChild(index);
|
|
5175
|
+
}
|
|
5176
|
+
else {
|
|
5177
|
+
before = $pos.node(d).maybeChild(index - 1);
|
|
5178
|
+
after = $pos.node(d + 1);
|
|
5179
|
+
}
|
|
5180
|
+
if (before && !before.isTextblock && joinable(before, after) &&
|
|
5181
|
+
$pos.node(d).canReplace(index, index + 1))
|
|
5182
|
+
return pos;
|
|
5183
|
+
if (d == 0)
|
|
5184
|
+
break;
|
|
5185
|
+
pos = dir < 0 ? $pos.before(d) : $pos.after(d);
|
|
5186
|
+
}
|
|
5187
|
+
}
|
|
5118
5188
|
function join(tr, pos, depth) {
|
|
5119
5189
|
let convertNewlines = null;
|
|
5120
5190
|
let { linebreakReplacement } = tr.doc.type.schema;
|
|
@@ -5914,7 +5984,7 @@ class Transform {
|
|
|
5914
5984
|
sure the lift is valid.
|
|
5915
5985
|
*/
|
|
5916
5986
|
lift(range, target) {
|
|
5917
|
-
lift(this, range, target);
|
|
5987
|
+
lift$1(this, range, target);
|
|
5918
5988
|
return this;
|
|
5919
5989
|
}
|
|
5920
5990
|
/**
|
|
@@ -5939,7 +6009,7 @@ class Transform {
|
|
|
5939
6009
|
the given node type with the given attributes.
|
|
5940
6010
|
*/
|
|
5941
6011
|
setBlockType(from, to = from, type, attrs = null) {
|
|
5942
|
-
setBlockType(this, from, to, type, attrs);
|
|
6012
|
+
setBlockType$1(this, from, to, type, attrs);
|
|
5943
6013
|
return this;
|
|
5944
6014
|
}
|
|
5945
6015
|
/**
|
|
@@ -6568,7 +6638,7 @@ class Transaction extends Transform {
|
|
|
6568
6638
|
throw new RangeError("Selection passed to setSelection must point at the current document");
|
|
6569
6639
|
this.curSelection = selection;
|
|
6570
6640
|
this.curSelectionFor = this.steps.length;
|
|
6571
|
-
this.updated = (this.updated | UPDATED_SEL) &
|
|
6641
|
+
this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;
|
|
6572
6642
|
this.storedMarks = null;
|
|
6573
6643
|
return this;
|
|
6574
6644
|
}
|
|
@@ -6619,7 +6689,7 @@ class Transaction extends Transform {
|
|
|
6619
6689
|
*/
|
|
6620
6690
|
addStep(step, doc) {
|
|
6621
6691
|
super.addStep(step, doc);
|
|
6622
|
-
this.updated = this.updated &
|
|
6692
|
+
this.updated = this.updated & ~UPDATED_MARKS;
|
|
6623
6693
|
this.storedMarks = null;
|
|
6624
6694
|
}
|
|
6625
6695
|
/**
|
|
@@ -7012,6 +7082,27 @@ function createKey(name) {
|
|
|
7012
7082
|
keys[name] = 0;
|
|
7013
7083
|
return name + "$";
|
|
7014
7084
|
}
|
|
7085
|
+
/**
|
|
7086
|
+
A key is used to [tag](https://prosemirror.net/docs/ref/#state.PluginSpec.key) plugins in a way
|
|
7087
|
+
that makes it possible to find them, given an editor state.
|
|
7088
|
+
Assigning a key does mean only one plugin of that type can be
|
|
7089
|
+
active in a state.
|
|
7090
|
+
*/
|
|
7091
|
+
class PluginKey {
|
|
7092
|
+
/**
|
|
7093
|
+
Create a plugin key.
|
|
7094
|
+
*/
|
|
7095
|
+
constructor(name = "key") { this.key = createKey(name); }
|
|
7096
|
+
/**
|
|
7097
|
+
Get the active plugin with this key, if any, from an editor
|
|
7098
|
+
state.
|
|
7099
|
+
*/
|
|
7100
|
+
get(state) { return state.config.pluginsByKey[this.key]; }
|
|
7101
|
+
/**
|
|
7102
|
+
Get the plugin's state from an editor state.
|
|
7103
|
+
*/
|
|
7104
|
+
getState(state) { return state[this.key]; }
|
|
7105
|
+
}
|
|
7015
7106
|
|
|
7016
7107
|
const domIndex = function (node) {
|
|
7017
7108
|
for (var index = 0;; index++) {
|
|
@@ -7182,6 +7273,7 @@ const ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(agent);
|
|
|
7182
7273
|
const ie$1 = !!(ie_upto10 || ie_11up || ie_edge);
|
|
7183
7274
|
const ie_version = ie_upto10 ? document.documentMode : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0;
|
|
7184
7275
|
const gecko = !ie$1 && /gecko\/(\d+)/i.test(agent);
|
|
7276
|
+
gecko && +(/Firefox\/(\d+)/.exec(agent) || [0, 0])[1];
|
|
7185
7277
|
const _chrome = !ie$1 && /Chrome\/(\d+)/.exec(agent);
|
|
7186
7278
|
const chrome = !!_chrome;
|
|
7187
7279
|
const chrome_version = _chrome ? +_chrome[1] : 0;
|
|
@@ -10224,7 +10316,8 @@ function updateSelection(view, selection, origin) {
|
|
|
10224
10316
|
if (view.state.selection.eq(selection))
|
|
10225
10317
|
return;
|
|
10226
10318
|
let tr = view.state.tr.setSelection(selection);
|
|
10227
|
-
|
|
10319
|
+
if (origin == "pointer")
|
|
10320
|
+
tr.setMeta("pointer", true);
|
|
10228
10321
|
view.dispatch(tr);
|
|
10229
10322
|
}
|
|
10230
10323
|
function selectClickedLeaf(view, inside) {
|
|
@@ -10232,7 +10325,7 @@ function selectClickedLeaf(view, inside) {
|
|
|
10232
10325
|
return false;
|
|
10233
10326
|
let $pos = view.state.doc.resolve(inside), node = $pos.nodeAfter;
|
|
10234
10327
|
if (node && node.isAtom && NodeSelection.isSelectable(node)) {
|
|
10235
|
-
updateSelection(view, new NodeSelection($pos));
|
|
10328
|
+
updateSelection(view, new NodeSelection($pos), "pointer");
|
|
10236
10329
|
return true;
|
|
10237
10330
|
}
|
|
10238
10331
|
return false;
|
|
@@ -10256,7 +10349,7 @@ function selectClickedNode(view, inside) {
|
|
|
10256
10349
|
}
|
|
10257
10350
|
}
|
|
10258
10351
|
if (selectAt != null) {
|
|
10259
|
-
updateSelection(view, NodeSelection.create(view.state.doc, selectAt));
|
|
10352
|
+
updateSelection(view, NodeSelection.create(view.state.doc, selectAt), "pointer");
|
|
10260
10353
|
return true;
|
|
10261
10354
|
}
|
|
10262
10355
|
else {
|
|
@@ -10283,7 +10376,7 @@ function defaultTripleClick(view, inside, event) {
|
|
|
10283
10376
|
let doc = view.state.doc;
|
|
10284
10377
|
if (inside == -1) {
|
|
10285
10378
|
if (doc.inlineContent) {
|
|
10286
|
-
updateSelection(view, TextSelection.create(doc, 0, doc.content.size));
|
|
10379
|
+
updateSelection(view, TextSelection.create(doc, 0, doc.content.size), "pointer");
|
|
10287
10380
|
return true;
|
|
10288
10381
|
}
|
|
10289
10382
|
return false;
|
|
@@ -10293,9 +10386,9 @@ function defaultTripleClick(view, inside, event) {
|
|
|
10293
10386
|
let node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);
|
|
10294
10387
|
let nodePos = $pos.before(i);
|
|
10295
10388
|
if (node.inlineContent)
|
|
10296
|
-
updateSelection(view, TextSelection.create(doc, nodePos + 1, nodePos + 1 + node.content.size));
|
|
10389
|
+
updateSelection(view, TextSelection.create(doc, nodePos + 1, nodePos + 1 + node.content.size), "pointer");
|
|
10297
10390
|
else if (NodeSelection.isSelectable(node))
|
|
10298
|
-
updateSelection(view, NodeSelection.create(doc, nodePos));
|
|
10391
|
+
updateSelection(view, NodeSelection.create(doc, nodePos), "pointer");
|
|
10299
10392
|
else
|
|
10300
10393
|
continue;
|
|
10301
10394
|
return true;
|
|
@@ -10424,7 +10517,7 @@ class MouseDown {
|
|
|
10424
10517
|
// works around that.
|
|
10425
10518
|
(chrome && !this.view.state.selection.visible &&
|
|
10426
10519
|
Math.min(Math.abs(pos.pos - this.view.state.selection.from), Math.abs(pos.pos - this.view.state.selection.to)) <= 2))) {
|
|
10427
|
-
updateSelection(this.view, Selection.near(this.view.state.doc.resolve(pos.pos)));
|
|
10520
|
+
updateSelection(this.view, Selection.near(this.view.state.doc.resolve(pos.pos)), "pointer");
|
|
10428
10521
|
event.preventDefault();
|
|
10429
10522
|
}
|
|
10430
10523
|
else {
|
|
@@ -12244,6 +12337,15 @@ function isSurrogatePair(str) {
|
|
|
12244
12337
|
let a = str.charCodeAt(0), b = str.charCodeAt(1);
|
|
12245
12338
|
return a >= 0xDC00 && a <= 0xDFFF && b >= 0xD800 && b <= 0xDBFF;
|
|
12246
12339
|
}
|
|
12340
|
+
|
|
12341
|
+
/**
|
|
12342
|
+
@internal
|
|
12343
|
+
*/
|
|
12344
|
+
const __parseFromClipboard = parseFromClipboard;
|
|
12345
|
+
/**
|
|
12346
|
+
@internal
|
|
12347
|
+
*/
|
|
12348
|
+
const __endComposition = endComposition;
|
|
12247
12349
|
/**
|
|
12248
12350
|
An editor view manages the DOM structure that represents an
|
|
12249
12351
|
editable document. Its state and behavior are determined by its
|
|
@@ -13060,6 +13162,229 @@ function addListNodes(nodes, itemContent, listGroup) {
|
|
|
13060
13162
|
list_item: add(listItem, { content: itemContent })
|
|
13061
13163
|
});
|
|
13062
13164
|
}
|
|
13165
|
+
/**
|
|
13166
|
+
Returns a command function that wraps the selection in a list with
|
|
13167
|
+
the given type an attributes. If `dispatch` is null, only return a
|
|
13168
|
+
value to indicate whether this is possible, but don't actually
|
|
13169
|
+
perform the change.
|
|
13170
|
+
*/
|
|
13171
|
+
function wrapInList(listType, attrs = null) {
|
|
13172
|
+
return function (state, dispatch) {
|
|
13173
|
+
let { $from, $to } = state.selection;
|
|
13174
|
+
let range = $from.blockRange($to);
|
|
13175
|
+
if (!range)
|
|
13176
|
+
return false;
|
|
13177
|
+
let tr = dispatch ? state.tr : null;
|
|
13178
|
+
if (!wrapRangeInList(tr, range, listType, attrs))
|
|
13179
|
+
return false;
|
|
13180
|
+
if (dispatch)
|
|
13181
|
+
dispatch(tr.scrollIntoView());
|
|
13182
|
+
return true;
|
|
13183
|
+
};
|
|
13184
|
+
}
|
|
13185
|
+
/**
|
|
13186
|
+
Try to wrap the given node range in a list of the given type.
|
|
13187
|
+
Return `true` when this is possible, `false` otherwise. When `tr`
|
|
13188
|
+
is non-null, the wrapping is added to that transaction. When it is
|
|
13189
|
+
`null`, the function only queries whether the wrapping is
|
|
13190
|
+
possible.
|
|
13191
|
+
*/
|
|
13192
|
+
function wrapRangeInList(tr, range, listType, attrs = null) {
|
|
13193
|
+
let doJoin = false, outerRange = range, doc = range.$from.doc;
|
|
13194
|
+
// This is at the top of an existing list item
|
|
13195
|
+
if (range.depth >= 2 && range.$from.node(range.depth - 1).type.compatibleContent(listType) && range.startIndex == 0) {
|
|
13196
|
+
// Don't do anything if this is the top of the list
|
|
13197
|
+
if (range.$from.index(range.depth - 1) == 0)
|
|
13198
|
+
return false;
|
|
13199
|
+
let $insert = doc.resolve(range.start - 2);
|
|
13200
|
+
outerRange = new NodeRange($insert, $insert, range.depth);
|
|
13201
|
+
if (range.endIndex < range.parent.childCount)
|
|
13202
|
+
range = new NodeRange(range.$from, doc.resolve(range.$to.end(range.depth)), range.depth);
|
|
13203
|
+
doJoin = true;
|
|
13204
|
+
}
|
|
13205
|
+
let wrap = findWrapping(outerRange, listType, attrs, range);
|
|
13206
|
+
if (!wrap)
|
|
13207
|
+
return false;
|
|
13208
|
+
if (tr)
|
|
13209
|
+
doWrapInList(tr, range, wrap, doJoin, listType);
|
|
13210
|
+
return true;
|
|
13211
|
+
}
|
|
13212
|
+
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
13213
|
+
let content = Fragment.empty;
|
|
13214
|
+
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
13215
|
+
content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
13216
|
+
tr.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
13217
|
+
let found = 0;
|
|
13218
|
+
for (let i = 0; i < wrappers.length; i++)
|
|
13219
|
+
if (wrappers[i].type == listType)
|
|
13220
|
+
found = i + 1;
|
|
13221
|
+
let splitDepth = wrappers.length - found;
|
|
13222
|
+
let splitPos = range.start + wrappers.length - (joinBefore ? 2 : 0), parent = range.parent;
|
|
13223
|
+
for (let i = range.startIndex, e = range.endIndex, first = true; i < e; i++, first = false) {
|
|
13224
|
+
if (!first && canSplit(tr.doc, splitPos, splitDepth)) {
|
|
13225
|
+
tr.split(splitPos, splitDepth);
|
|
13226
|
+
splitPos += 2 * splitDepth;
|
|
13227
|
+
}
|
|
13228
|
+
splitPos += parent.child(i).nodeSize;
|
|
13229
|
+
}
|
|
13230
|
+
return tr;
|
|
13231
|
+
}
|
|
13232
|
+
/**
|
|
13233
|
+
Build a command that splits a non-empty textblock at the top level
|
|
13234
|
+
of a list item by also splitting that list item.
|
|
13235
|
+
*/
|
|
13236
|
+
function splitListItem(itemType, itemAttrs) {
|
|
13237
|
+
return function (state, dispatch) {
|
|
13238
|
+
let { $from, $to, node } = state.selection;
|
|
13239
|
+
if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to))
|
|
13240
|
+
return false;
|
|
13241
|
+
let grandParent = $from.node(-1);
|
|
13242
|
+
if (grandParent.type != itemType)
|
|
13243
|
+
return false;
|
|
13244
|
+
if ($from.parent.content.size == 0 && $from.node(-1).childCount == $from.indexAfter(-1)) {
|
|
13245
|
+
// In an empty block. If this is a nested list, the wrapping
|
|
13246
|
+
// list item should be split. Otherwise, bail out and let next
|
|
13247
|
+
// command handle lifting.
|
|
13248
|
+
if ($from.depth == 3 || $from.node(-3).type != itemType ||
|
|
13249
|
+
$from.index(-2) != $from.node(-2).childCount - 1)
|
|
13250
|
+
return false;
|
|
13251
|
+
if (dispatch) {
|
|
13252
|
+
let wrap = Fragment.empty;
|
|
13253
|
+
let depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
13254
|
+
// Build a fragment containing empty versions of the structure
|
|
13255
|
+
// from the outer list item to the parent node of the cursor
|
|
13256
|
+
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d--)
|
|
13257
|
+
wrap = Fragment.from($from.node(d).copy(wrap));
|
|
13258
|
+
let depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1
|
|
13259
|
+
: $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
|
|
13260
|
+
// Add a second list item with an empty default start node
|
|
13261
|
+
wrap = wrap.append(Fragment.from(itemType.createAndFill()));
|
|
13262
|
+
let start = $from.before($from.depth - (depthBefore - 1));
|
|
13263
|
+
let tr = state.tr.replace(start, $from.after(-depthAfter), new Slice(wrap, 4 - depthBefore, 0));
|
|
13264
|
+
let sel = -1;
|
|
13265
|
+
tr.doc.nodesBetween(start, tr.doc.content.size, (node, pos) => {
|
|
13266
|
+
if (sel > -1)
|
|
13267
|
+
return false;
|
|
13268
|
+
if (node.isTextblock && node.content.size == 0)
|
|
13269
|
+
sel = pos + 1;
|
|
13270
|
+
});
|
|
13271
|
+
if (sel > -1)
|
|
13272
|
+
tr.setSelection(Selection.near(tr.doc.resolve(sel)));
|
|
13273
|
+
dispatch(tr.scrollIntoView());
|
|
13274
|
+
}
|
|
13275
|
+
return true;
|
|
13276
|
+
}
|
|
13277
|
+
let nextType = $to.pos == $from.end() ? grandParent.contentMatchAt(0).defaultType : null;
|
|
13278
|
+
let tr = state.tr.delete($from.pos, $to.pos);
|
|
13279
|
+
let types = nextType ? [itemAttrs ? { type: itemType, attrs: itemAttrs } : null, { type: nextType }] : undefined;
|
|
13280
|
+
if (!canSplit(tr.doc, $from.pos, 2, types))
|
|
13281
|
+
return false;
|
|
13282
|
+
if (dispatch)
|
|
13283
|
+
dispatch(tr.split($from.pos, 2, types).scrollIntoView());
|
|
13284
|
+
return true;
|
|
13285
|
+
};
|
|
13286
|
+
}
|
|
13287
|
+
/**
|
|
13288
|
+
Acts like [`splitListItem`](https://prosemirror.net/docs/ref/#schema-list.splitListItem), but
|
|
13289
|
+
without resetting the set of active marks at the cursor.
|
|
13290
|
+
*/
|
|
13291
|
+
function splitListItemKeepMarks(itemType, itemAttrs) {
|
|
13292
|
+
let split = splitListItem(itemType, itemAttrs);
|
|
13293
|
+
return (state, dispatch) => {
|
|
13294
|
+
return split(state, dispatch && (tr => {
|
|
13295
|
+
let marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());
|
|
13296
|
+
if (marks)
|
|
13297
|
+
tr.ensureMarks(marks);
|
|
13298
|
+
dispatch(tr);
|
|
13299
|
+
}));
|
|
13300
|
+
};
|
|
13301
|
+
}
|
|
13302
|
+
/**
|
|
13303
|
+
Create a command to lift the list item around the selection up into
|
|
13304
|
+
a wrapping list.
|
|
13305
|
+
*/
|
|
13306
|
+
function liftListItem(itemType) {
|
|
13307
|
+
return function (state, dispatch) {
|
|
13308
|
+
let { $from, $to } = state.selection;
|
|
13309
|
+
let range = $from.blockRange($to, node => node.childCount > 0 && node.firstChild.type == itemType);
|
|
13310
|
+
if (!range)
|
|
13311
|
+
return false;
|
|
13312
|
+
if (!dispatch)
|
|
13313
|
+
return true;
|
|
13314
|
+
if ($from.node(range.depth - 1).type == itemType) // Inside a parent list
|
|
13315
|
+
return liftToOuterList(state, dispatch, itemType, range);
|
|
13316
|
+
else // Outer list node
|
|
13317
|
+
return liftOutOfList(state, dispatch, range);
|
|
13318
|
+
};
|
|
13319
|
+
}
|
|
13320
|
+
function liftToOuterList(state, dispatch, itemType, range) {
|
|
13321
|
+
let tr = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
13322
|
+
if (end < endOfList) {
|
|
13323
|
+
// There are siblings after the lifted items, which must become
|
|
13324
|
+
// children of the last item
|
|
13325
|
+
tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
13326
|
+
range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
|
|
13327
|
+
}
|
|
13328
|
+
const target = liftTarget(range);
|
|
13329
|
+
if (target == null)
|
|
13330
|
+
return false;
|
|
13331
|
+
tr.lift(range, target);
|
|
13332
|
+
let $after = tr.doc.resolve(tr.mapping.map(end, -1) - 1);
|
|
13333
|
+
if (canJoin(tr.doc, $after.pos) && $after.nodeBefore.type == $after.nodeAfter.type)
|
|
13334
|
+
tr.join($after.pos);
|
|
13335
|
+
dispatch(tr.scrollIntoView());
|
|
13336
|
+
return true;
|
|
13337
|
+
}
|
|
13338
|
+
function liftOutOfList(state, dispatch, range) {
|
|
13339
|
+
let tr = state.tr, list = range.parent;
|
|
13340
|
+
// Merge the list items into a single big item
|
|
13341
|
+
for (let pos = range.end, i = range.endIndex - 1, e = range.startIndex; i > e; i--) {
|
|
13342
|
+
pos -= list.child(i).nodeSize;
|
|
13343
|
+
tr.delete(pos - 1, pos + 1);
|
|
13344
|
+
}
|
|
13345
|
+
let $start = tr.doc.resolve(range.start), item = $start.nodeAfter;
|
|
13346
|
+
if (tr.mapping.map(range.end) != range.start + $start.nodeAfter.nodeSize)
|
|
13347
|
+
return false;
|
|
13348
|
+
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
13349
|
+
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
13350
|
+
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment.empty : Fragment.from(list))))
|
|
13351
|
+
return false;
|
|
13352
|
+
let start = $start.pos, end = start + item.nodeSize;
|
|
13353
|
+
// Strip off the surrounding list. At the sides where we're not at
|
|
13354
|
+
// the end of the list, the existing list is closed. At sides where
|
|
13355
|
+
// this is the end, it is overwritten to its end.
|
|
13356
|
+
tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment.empty : Fragment.from(list.copy(Fragment.empty)))
|
|
13357
|
+
.append(atEnd ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
13358
|
+
dispatch(tr.scrollIntoView());
|
|
13359
|
+
return true;
|
|
13360
|
+
}
|
|
13361
|
+
/**
|
|
13362
|
+
Create a command to sink the list item around the selection down
|
|
13363
|
+
into an inner list.
|
|
13364
|
+
*/
|
|
13365
|
+
function sinkListItem(itemType) {
|
|
13366
|
+
return function (state, dispatch) {
|
|
13367
|
+
let { $from, $to } = state.selection;
|
|
13368
|
+
let range = $from.blockRange($to, node => node.childCount > 0 && node.firstChild.type == itemType);
|
|
13369
|
+
if (!range)
|
|
13370
|
+
return false;
|
|
13371
|
+
let startIndex = range.startIndex;
|
|
13372
|
+
if (startIndex == 0)
|
|
13373
|
+
return false;
|
|
13374
|
+
let parent = range.parent, nodeBefore = parent.child(startIndex - 1);
|
|
13375
|
+
if (nodeBefore.type != itemType)
|
|
13376
|
+
return false;
|
|
13377
|
+
if (dispatch) {
|
|
13378
|
+
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
13379
|
+
let inner = Fragment.from(nestedBefore ? itemType.create() : null);
|
|
13380
|
+
let slice = new Slice(Fragment.from(itemType.create(null, Fragment.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
13381
|
+
let before = range.start, after = range.end;
|
|
13382
|
+
dispatch(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice, 1, true))
|
|
13383
|
+
.scrollIntoView());
|
|
13384
|
+
}
|
|
13385
|
+
return true;
|
|
13386
|
+
};
|
|
13387
|
+
}
|
|
13063
13388
|
|
|
13064
13389
|
var base = {
|
|
13065
13390
|
8: "Backspace",
|
|
@@ -13377,6 +13702,60 @@ const joinBackward = (state, dispatch, view) => {
|
|
|
13377
13702
|
}
|
|
13378
13703
|
return false;
|
|
13379
13704
|
};
|
|
13705
|
+
/**
|
|
13706
|
+
A more limited form of [`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward)
|
|
13707
|
+
that only tries to join the current textblock to the one before
|
|
13708
|
+
it, if the cursor is at the start of a textblock.
|
|
13709
|
+
*/
|
|
13710
|
+
const joinTextblockBackward = (state, dispatch, view) => {
|
|
13711
|
+
let $cursor = atBlockStart(state, view);
|
|
13712
|
+
if (!$cursor)
|
|
13713
|
+
return false;
|
|
13714
|
+
let $cut = findCutBefore($cursor);
|
|
13715
|
+
return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;
|
|
13716
|
+
};
|
|
13717
|
+
/**
|
|
13718
|
+
A more limited form of [`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward)
|
|
13719
|
+
that only tries to join the current textblock to the one after
|
|
13720
|
+
it, if the cursor is at the end of a textblock.
|
|
13721
|
+
*/
|
|
13722
|
+
const joinTextblockForward = (state, dispatch, view) => {
|
|
13723
|
+
let $cursor = atBlockEnd(state, view);
|
|
13724
|
+
if (!$cursor)
|
|
13725
|
+
return false;
|
|
13726
|
+
let $cut = findCutAfter($cursor);
|
|
13727
|
+
return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;
|
|
13728
|
+
};
|
|
13729
|
+
function joinTextblocksAround(state, $cut, dispatch) {
|
|
13730
|
+
let before = $cut.nodeBefore, beforeText = before, beforePos = $cut.pos - 1;
|
|
13731
|
+
for (; !beforeText.isTextblock; beforePos--) {
|
|
13732
|
+
if (beforeText.type.spec.isolating)
|
|
13733
|
+
return false;
|
|
13734
|
+
let child = beforeText.lastChild;
|
|
13735
|
+
if (!child)
|
|
13736
|
+
return false;
|
|
13737
|
+
beforeText = child;
|
|
13738
|
+
}
|
|
13739
|
+
let after = $cut.nodeAfter, afterText = after, afterPos = $cut.pos + 1;
|
|
13740
|
+
for (; !afterText.isTextblock; afterPos++) {
|
|
13741
|
+
if (afterText.type.spec.isolating)
|
|
13742
|
+
return false;
|
|
13743
|
+
let child = afterText.firstChild;
|
|
13744
|
+
if (!child)
|
|
13745
|
+
return false;
|
|
13746
|
+
afterText = child;
|
|
13747
|
+
}
|
|
13748
|
+
let step = replaceStep(state.doc, beforePos, afterPos, Slice.empty);
|
|
13749
|
+
if (!step || step.from != beforePos ||
|
|
13750
|
+
step instanceof ReplaceStep && step.slice.size >= afterPos - beforePos)
|
|
13751
|
+
return false;
|
|
13752
|
+
if (dispatch) {
|
|
13753
|
+
let tr = state.tr.step(step);
|
|
13754
|
+
tr.setSelection(TextSelection.create(tr.doc, beforePos));
|
|
13755
|
+
dispatch(tr.scrollIntoView());
|
|
13756
|
+
}
|
|
13757
|
+
return true;
|
|
13758
|
+
}
|
|
13380
13759
|
function textblockAt(node, side, only = false) {
|
|
13381
13760
|
for (let scan = node; scan; scan = (side == "start" ? scan.firstChild : scan.lastChild)) {
|
|
13382
13761
|
if (scan.isTextblock)
|
|
@@ -13505,6 +13884,64 @@ function findCutAfter($pos) {
|
|
|
13505
13884
|
return null;
|
|
13506
13885
|
}
|
|
13507
13886
|
/**
|
|
13887
|
+
Join the selected block or, if there is a text selection, the
|
|
13888
|
+
closest ancestor block of the selection that can be joined, with
|
|
13889
|
+
the sibling above it.
|
|
13890
|
+
*/
|
|
13891
|
+
const joinUp = (state, dispatch) => {
|
|
13892
|
+
let sel = state.selection, nodeSel = sel instanceof NodeSelection, point;
|
|
13893
|
+
if (nodeSel) {
|
|
13894
|
+
if (sel.node.isTextblock || !canJoin(state.doc, sel.from))
|
|
13895
|
+
return false;
|
|
13896
|
+
point = sel.from;
|
|
13897
|
+
}
|
|
13898
|
+
else {
|
|
13899
|
+
point = joinPoint(state.doc, sel.from, -1);
|
|
13900
|
+
if (point == null)
|
|
13901
|
+
return false;
|
|
13902
|
+
}
|
|
13903
|
+
if (dispatch) {
|
|
13904
|
+
let tr = state.tr.join(point);
|
|
13905
|
+
if (nodeSel)
|
|
13906
|
+
tr.setSelection(NodeSelection.create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize));
|
|
13907
|
+
dispatch(tr.scrollIntoView());
|
|
13908
|
+
}
|
|
13909
|
+
return true;
|
|
13910
|
+
};
|
|
13911
|
+
/**
|
|
13912
|
+
Join the selected block, or the closest ancestor of the selection
|
|
13913
|
+
that can be joined, with the sibling after it.
|
|
13914
|
+
*/
|
|
13915
|
+
const joinDown = (state, dispatch) => {
|
|
13916
|
+
let sel = state.selection, point;
|
|
13917
|
+
if (sel instanceof NodeSelection) {
|
|
13918
|
+
if (sel.node.isTextblock || !canJoin(state.doc, sel.to))
|
|
13919
|
+
return false;
|
|
13920
|
+
point = sel.to;
|
|
13921
|
+
}
|
|
13922
|
+
else {
|
|
13923
|
+
point = joinPoint(state.doc, sel.to, 1);
|
|
13924
|
+
if (point == null)
|
|
13925
|
+
return false;
|
|
13926
|
+
}
|
|
13927
|
+
if (dispatch)
|
|
13928
|
+
dispatch(state.tr.join(point).scrollIntoView());
|
|
13929
|
+
return true;
|
|
13930
|
+
};
|
|
13931
|
+
/**
|
|
13932
|
+
Lift the selected block, or the closest ancestor block of the
|
|
13933
|
+
selection that can be lifted, out of its parent node.
|
|
13934
|
+
*/
|
|
13935
|
+
const lift = (state, dispatch) => {
|
|
13936
|
+
let { $from, $to } = state.selection;
|
|
13937
|
+
let range = $from.blockRange($to), target = range && liftTarget(range);
|
|
13938
|
+
if (target == null)
|
|
13939
|
+
return false;
|
|
13940
|
+
if (dispatch)
|
|
13941
|
+
dispatch(state.tr.lift(range, target).scrollIntoView());
|
|
13942
|
+
return true;
|
|
13943
|
+
};
|
|
13944
|
+
/**
|
|
13508
13945
|
If the selection is in a node whose type has a truthy
|
|
13509
13946
|
[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, replace the
|
|
13510
13947
|
selection with a newline character.
|
|
@@ -13592,7 +14029,7 @@ a custom function to determine the type of the newly split off block.
|
|
|
13592
14029
|
*/
|
|
13593
14030
|
function splitBlockAs(splitNode) {
|
|
13594
14031
|
return (state, dispatch) => {
|
|
13595
|
-
let { $from} = state.selection;
|
|
14032
|
+
let { $from, $to } = state.selection;
|
|
13596
14033
|
if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
|
|
13597
14034
|
if (!$from.parentOffset || !canSplit(state.doc, $from.pos))
|
|
13598
14035
|
return false;
|
|
@@ -13610,7 +14047,8 @@ function splitBlockAs(splitNode) {
|
|
|
13610
14047
|
atEnd = $from.end(d) == $from.pos + ($from.depth - d);
|
|
13611
14048
|
atStart = $from.start(d) == $from.pos - ($from.depth - d);
|
|
13612
14049
|
deflt = defaultBlockAt($from.node(d - 1).contentMatchAt($from.indexAfter(d - 1)));
|
|
13613
|
-
|
|
14050
|
+
let splitType = splitNode && splitNode($to.parent, atEnd, $from);
|
|
14051
|
+
types.unshift(splitType || (atEnd && deflt ? { type: deflt } : null));
|
|
13614
14052
|
splitDepth = d;
|
|
13615
14053
|
break;
|
|
13616
14054
|
}
|
|
@@ -13648,6 +14086,32 @@ selection, also delete its content.
|
|
|
13648
14086
|
*/
|
|
13649
14087
|
const splitBlock = splitBlockAs();
|
|
13650
14088
|
/**
|
|
14089
|
+
Acts like [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock), but without
|
|
14090
|
+
resetting the set of active marks at the cursor.
|
|
14091
|
+
*/
|
|
14092
|
+
const splitBlockKeepMarks = (state, dispatch) => {
|
|
14093
|
+
return splitBlock(state, dispatch && (tr => {
|
|
14094
|
+
let marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());
|
|
14095
|
+
if (marks)
|
|
14096
|
+
tr.ensureMarks(marks);
|
|
14097
|
+
dispatch(tr);
|
|
14098
|
+
}));
|
|
14099
|
+
};
|
|
14100
|
+
/**
|
|
14101
|
+
Move the selection to the node wrapping the current selection, if
|
|
14102
|
+
any. (Will not select the document node.)
|
|
14103
|
+
*/
|
|
14104
|
+
const selectParentNode = (state, dispatch) => {
|
|
14105
|
+
let { $from, to } = state.selection, pos;
|
|
14106
|
+
let same = $from.sharedDepth(to);
|
|
14107
|
+
if (same == 0)
|
|
14108
|
+
return false;
|
|
14109
|
+
pos = $from.before(same);
|
|
14110
|
+
if (dispatch)
|
|
14111
|
+
dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));
|
|
14112
|
+
return true;
|
|
14113
|
+
};
|
|
14114
|
+
/**
|
|
13651
14115
|
Select the whole document.
|
|
13652
14116
|
*/
|
|
13653
14117
|
const selectAll = (state, dispatch) => {
|
|
@@ -13748,6 +14212,205 @@ const selectTextblockStart = selectTextblockSide(-1);
|
|
|
13748
14212
|
Moves the cursor to the end of current text block.
|
|
13749
14213
|
*/
|
|
13750
14214
|
const selectTextblockEnd = selectTextblockSide(1);
|
|
14215
|
+
// Parameterized commands
|
|
14216
|
+
/**
|
|
14217
|
+
Wrap the selection in a node of the given type with the given
|
|
14218
|
+
attributes.
|
|
14219
|
+
*/
|
|
14220
|
+
function wrapIn(nodeType, attrs = null) {
|
|
14221
|
+
return function (state, dispatch) {
|
|
14222
|
+
let { $from, $to } = state.selection;
|
|
14223
|
+
let range = $from.blockRange($to), wrapping = range && findWrapping(range, nodeType, attrs);
|
|
14224
|
+
if (!wrapping)
|
|
14225
|
+
return false;
|
|
14226
|
+
if (dispatch)
|
|
14227
|
+
dispatch(state.tr.wrap(range, wrapping).scrollIntoView());
|
|
14228
|
+
return true;
|
|
14229
|
+
};
|
|
14230
|
+
}
|
|
14231
|
+
/**
|
|
14232
|
+
Returns a command that tries to set the selected textblocks to the
|
|
14233
|
+
given node type with the given attributes.
|
|
14234
|
+
*/
|
|
14235
|
+
function setBlockType(nodeType, attrs = null) {
|
|
14236
|
+
return function (state, dispatch) {
|
|
14237
|
+
let applicable = false;
|
|
14238
|
+
for (let i = 0; i < state.selection.ranges.length && !applicable; i++) {
|
|
14239
|
+
let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];
|
|
14240
|
+
state.doc.nodesBetween(from, to, (node, pos) => {
|
|
14241
|
+
if (applicable)
|
|
14242
|
+
return false;
|
|
14243
|
+
if (!node.isTextblock || node.hasMarkup(nodeType, attrs))
|
|
14244
|
+
return;
|
|
14245
|
+
if (node.type == nodeType) {
|
|
14246
|
+
applicable = true;
|
|
14247
|
+
}
|
|
14248
|
+
else {
|
|
14249
|
+
let $pos = state.doc.resolve(pos), index = $pos.index();
|
|
14250
|
+
applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);
|
|
14251
|
+
}
|
|
14252
|
+
});
|
|
14253
|
+
}
|
|
14254
|
+
if (!applicable)
|
|
14255
|
+
return false;
|
|
14256
|
+
if (dispatch) {
|
|
14257
|
+
let tr = state.tr;
|
|
14258
|
+
for (let i = 0; i < state.selection.ranges.length; i++) {
|
|
14259
|
+
let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];
|
|
14260
|
+
tr.setBlockType(from, to, nodeType, attrs);
|
|
14261
|
+
}
|
|
14262
|
+
dispatch(tr.scrollIntoView());
|
|
14263
|
+
}
|
|
14264
|
+
return true;
|
|
14265
|
+
};
|
|
14266
|
+
}
|
|
14267
|
+
function markApplies(doc, ranges, type, enterAtoms) {
|
|
14268
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
14269
|
+
let { $from, $to } = ranges[i];
|
|
14270
|
+
let can = $from.depth == 0 ? doc.inlineContent && doc.type.allowsMarkType(type) : false;
|
|
14271
|
+
doc.nodesBetween($from.pos, $to.pos, (node, pos) => {
|
|
14272
|
+
if (can || !enterAtoms && node.isAtom && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos)
|
|
14273
|
+
return false;
|
|
14274
|
+
can = node.inlineContent && node.type.allowsMarkType(type);
|
|
14275
|
+
});
|
|
14276
|
+
if (can)
|
|
14277
|
+
return true;
|
|
14278
|
+
}
|
|
14279
|
+
return false;
|
|
14280
|
+
}
|
|
14281
|
+
function removeInlineAtoms(ranges) {
|
|
14282
|
+
let result = [];
|
|
14283
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
14284
|
+
let { $from, $to } = ranges[i];
|
|
14285
|
+
$from.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {
|
|
14286
|
+
if (node.isAtom && node.content.size && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos) {
|
|
14287
|
+
if (pos + 1 > $from.pos)
|
|
14288
|
+
result.push(new SelectionRange($from, $from.doc.resolve(pos + 1)));
|
|
14289
|
+
$from = $from.doc.resolve(pos + 1 + node.content.size);
|
|
14290
|
+
return false;
|
|
14291
|
+
}
|
|
14292
|
+
});
|
|
14293
|
+
if ($from.pos < $to.pos)
|
|
14294
|
+
result.push(new SelectionRange($from, $to));
|
|
14295
|
+
}
|
|
14296
|
+
return result;
|
|
14297
|
+
}
|
|
14298
|
+
/**
|
|
14299
|
+
Create a command function that toggles the given mark with the
|
|
14300
|
+
given attributes. Will return `false` when the current selection
|
|
14301
|
+
doesn't support that mark. This will remove the mark if any marks
|
|
14302
|
+
of that type exist in the selection, or add it otherwise. If the
|
|
14303
|
+
selection is empty, this applies to the [stored
|
|
14304
|
+
marks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks) instead of a range of the
|
|
14305
|
+
document.
|
|
14306
|
+
*/
|
|
14307
|
+
function toggleMark(markType, attrs = null, options) {
|
|
14308
|
+
let removeWhenPresent = (options && options.removeWhenPresent) !== false;
|
|
14309
|
+
let enterAtoms = (options && options.enterInlineAtoms) !== false;
|
|
14310
|
+
let dropSpace = !(options && options.includeWhitespace);
|
|
14311
|
+
return function (state, dispatch) {
|
|
14312
|
+
let { empty, $cursor, ranges } = state.selection;
|
|
14313
|
+
if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType, enterAtoms))
|
|
14314
|
+
return false;
|
|
14315
|
+
if (dispatch) {
|
|
14316
|
+
if ($cursor) {
|
|
14317
|
+
if (markType.isInSet(state.storedMarks || $cursor.marks()))
|
|
14318
|
+
dispatch(state.tr.removeStoredMark(markType));
|
|
14319
|
+
else
|
|
14320
|
+
dispatch(state.tr.addStoredMark(markType.create(attrs)));
|
|
14321
|
+
}
|
|
14322
|
+
else {
|
|
14323
|
+
let add, tr = state.tr;
|
|
14324
|
+
if (!enterAtoms)
|
|
14325
|
+
ranges = removeInlineAtoms(ranges);
|
|
14326
|
+
if (removeWhenPresent) {
|
|
14327
|
+
add = !ranges.some(r => state.doc.rangeHasMark(r.$from.pos, r.$to.pos, markType));
|
|
14328
|
+
}
|
|
14329
|
+
else {
|
|
14330
|
+
add = !ranges.every(r => {
|
|
14331
|
+
let missing = false;
|
|
14332
|
+
tr.doc.nodesBetween(r.$from.pos, r.$to.pos, (node, pos, parent) => {
|
|
14333
|
+
if (missing)
|
|
14334
|
+
return false;
|
|
14335
|
+
missing = !markType.isInSet(node.marks) && !!parent && parent.type.allowsMarkType(markType) &&
|
|
14336
|
+
!(node.isText && /^\s*$/.test(node.textBetween(Math.max(0, r.$from.pos - pos), Math.min(node.nodeSize, r.$to.pos - pos))));
|
|
14337
|
+
});
|
|
14338
|
+
return !missing;
|
|
14339
|
+
});
|
|
14340
|
+
}
|
|
14341
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
14342
|
+
let { $from, $to } = ranges[i];
|
|
14343
|
+
if (!add) {
|
|
14344
|
+
tr.removeMark($from.pos, $to.pos, markType);
|
|
14345
|
+
}
|
|
14346
|
+
else {
|
|
14347
|
+
let from = $from.pos, to = $to.pos, start = $from.nodeAfter, end = $to.nodeBefore;
|
|
14348
|
+
let spaceStart = dropSpace && start && start.isText ? /^\s*/.exec(start.text)[0].length : 0;
|
|
14349
|
+
let spaceEnd = dropSpace && end && end.isText ? /\s*$/.exec(end.text)[0].length : 0;
|
|
14350
|
+
if (from + spaceStart < to) {
|
|
14351
|
+
from += spaceStart;
|
|
14352
|
+
to -= spaceEnd;
|
|
14353
|
+
}
|
|
14354
|
+
tr.addMark(from, to, markType.create(attrs));
|
|
14355
|
+
}
|
|
14356
|
+
}
|
|
14357
|
+
dispatch(tr.scrollIntoView());
|
|
14358
|
+
}
|
|
14359
|
+
}
|
|
14360
|
+
return true;
|
|
14361
|
+
};
|
|
14362
|
+
}
|
|
14363
|
+
function wrapDispatchForJoin(dispatch, isJoinable) {
|
|
14364
|
+
return (tr) => {
|
|
14365
|
+
if (!tr.isGeneric)
|
|
14366
|
+
return dispatch(tr);
|
|
14367
|
+
let ranges = [];
|
|
14368
|
+
for (let i = 0; i < tr.mapping.maps.length; i++) {
|
|
14369
|
+
let map = tr.mapping.maps[i];
|
|
14370
|
+
for (let j = 0; j < ranges.length; j++)
|
|
14371
|
+
ranges[j] = map.map(ranges[j]);
|
|
14372
|
+
map.forEach((_s, _e, from, to) => ranges.push(from, to));
|
|
14373
|
+
}
|
|
14374
|
+
// Figure out which joinable points exist inside those ranges,
|
|
14375
|
+
// by checking all node boundaries in their parent nodes.
|
|
14376
|
+
let joinable = [];
|
|
14377
|
+
for (let i = 0; i < ranges.length; i += 2) {
|
|
14378
|
+
let from = ranges[i], to = ranges[i + 1];
|
|
14379
|
+
let $from = tr.doc.resolve(from), depth = $from.sharedDepth(to), parent = $from.node(depth);
|
|
14380
|
+
for (let index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {
|
|
14381
|
+
let after = parent.maybeChild(index);
|
|
14382
|
+
if (!after)
|
|
14383
|
+
break;
|
|
14384
|
+
if (index && joinable.indexOf(pos) == -1) {
|
|
14385
|
+
let before = parent.child(index - 1);
|
|
14386
|
+
if (before.type == after.type && isJoinable(before, after))
|
|
14387
|
+
joinable.push(pos);
|
|
14388
|
+
}
|
|
14389
|
+
pos += after.nodeSize;
|
|
14390
|
+
}
|
|
14391
|
+
}
|
|
14392
|
+
// Join the joinable points
|
|
14393
|
+
joinable.sort((a, b) => a - b);
|
|
14394
|
+
for (let i = joinable.length - 1; i >= 0; i--) {
|
|
14395
|
+
if (canJoin(tr.doc, joinable[i]))
|
|
14396
|
+
tr.join(joinable[i]);
|
|
14397
|
+
}
|
|
14398
|
+
dispatch(tr);
|
|
14399
|
+
};
|
|
14400
|
+
}
|
|
14401
|
+
/**
|
|
14402
|
+
Wrap a command so that, when it produces a transform that causes
|
|
14403
|
+
two joinable nodes to end up next to each other, those are joined.
|
|
14404
|
+
Nodes are considered joinable when they are of the same type and
|
|
14405
|
+
when the `isJoinable` predicate returns true for them or, if an
|
|
14406
|
+
array of strings was passed, if their node type name is in that
|
|
14407
|
+
array.
|
|
14408
|
+
*/
|
|
14409
|
+
function autoJoin(command, isJoinable) {
|
|
14410
|
+
let canJoin = Array.isArray(isJoinable) ? (node) => isJoinable.indexOf(node.type.name) > -1
|
|
14411
|
+
: isJoinable;
|
|
14412
|
+
return (state, dispatch, view) => command(state, dispatch && wrapDispatchForJoin(dispatch, canJoin), view);
|
|
14413
|
+
}
|
|
13751
14414
|
/**
|
|
13752
14415
|
Combine a number of command functions into a single function (which
|
|
13753
14416
|
calls them one by one until one returns true).
|
|
@@ -14062,6 +14725,45 @@ class KritzelText extends KritzelBaseObject {
|
|
|
14062
14725
|
}
|
|
14063
14726
|
}
|
|
14064
14727
|
|
|
14728
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
14729
|
+
|
|
14730
|
+
function getDefaultExportFromCjs (x) {
|
|
14731
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
14732
|
+
}
|
|
14733
|
+
|
|
14734
|
+
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
14735
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
14736
|
+
}
|
|
14737
|
+
|
|
14738
|
+
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
14739
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
14740
|
+
}
|
|
14741
|
+
|
|
14742
|
+
function getAugmentedNamespace(n) {
|
|
14743
|
+
if (n.__esModule) return n;
|
|
14744
|
+
var f = n.default;
|
|
14745
|
+
if (typeof f == "function") {
|
|
14746
|
+
var a = function a () {
|
|
14747
|
+
if (this instanceof a) {
|
|
14748
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
14749
|
+
}
|
|
14750
|
+
return f.apply(this, arguments);
|
|
14751
|
+
};
|
|
14752
|
+
a.prototype = f.prototype;
|
|
14753
|
+
} else a = {};
|
|
14754
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
14755
|
+
Object.keys(n).forEach(function (k) {
|
|
14756
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
14757
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
14758
|
+
enumerable: true,
|
|
14759
|
+
get: function () {
|
|
14760
|
+
return n[k];
|
|
14761
|
+
}
|
|
14762
|
+
});
|
|
14763
|
+
});
|
|
14764
|
+
return a;
|
|
14765
|
+
}
|
|
14766
|
+
|
|
14065
14767
|
var cjs = {};
|
|
14066
14768
|
|
|
14067
14769
|
var hasRequiredCjs;
|
|
@@ -14070,12 +14772,13 @@ function requireCjs () {
|
|
|
14070
14772
|
if (hasRequiredCjs) return cjs;
|
|
14071
14773
|
hasRequiredCjs = 1;
|
|
14072
14774
|
(function (exports) {
|
|
14073
|
-
var pe=Object.defineProperty;var ge=e=>pe(e,"__esModule",{value
|
|
14775
|
+
var pe=Object.defineProperty;var ge=e=>pe(e,"__esModule",{value:!0});var de=(e,t)=>{ge(e);for(var s in t)pe(e,s,{get:t[s],enumerable:!0});};de(exports,{default:()=>ve,getStroke:()=>ne,getStrokeOutlinePoints:()=>te,getStrokePoints:()=>re});function $(e,t,s,x=h=>h){return e*x(.5-t*(.5-s))}function ce(e){return [-e[0],-e[1]]}function l(e,t){return [e[0]+t[0],e[1]+t[1]]}function a(e,t){return [e[0]-t[0],e[1]-t[1]]}function b(e,t){return [e[0]*t,e[1]*t]}function xe(e,t){return [e[0]/t,e[1]/t]}function R(e){return [e[1],-e[0]]}function B(e,t){return e[0]*t[0]+e[1]*t[1]}function me(e,t){return e[0]===t[0]&&e[1]===t[1]}function Se(e){return Math.hypot(e[0],e[1])}function Pe(e){return e[0]*e[0]+e[1]*e[1]}function A(e,t){return Pe(a(e,t))}function G(e){return xe(e,Se(e))}function ae(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function L(e,t,s){let x=Math.sin(s),h=Math.cos(s),y=e[0]-t[0],n=e[1]-t[1],f=y*h-n*x,d=y*x+n*h;return [f+t[0],d+t[1]]}function K(e,t,s){return l(e,b(a(t,e),s))}function ee(e,t,s){return l(e,b(t,s))}var{min:C,PI:ke}=Math,le=.275,V=ke+1e-4;function te(e,t={}){let{size:s=16,smoothing:x=.5,thinning:h=.5,simulatePressure:y=!0,easing:n=r=>r,start:f={},end:d={},last:D=!1}=t,{cap:S=!0,easing:j=r=>r*(2-r)}=f,{cap:q=!0,easing:c=r=>--r*r*r+1}=d;if(e.length===0||s<=0)return [];let p=e[e.length-1].runningLength,g=f.taper===!1?0:f.taper===!0?Math.max(s,p):f.taper,T=d.taper===!1?0:d.taper===!0?Math.max(s,p):d.taper,oe=Math.pow(s*x,2),_=[],M=[],H=e.slice(0,10).reduce((r,i)=>{let o=i.pressure;if(y){let u=C(1,i.distance/s),W=C(1,1-u);o=C(1,r+(W-r)*(u*le));}return (r+o)/2},e[0].pressure),m=$(s,h,e[e.length-1].pressure,n),U,X=e[0].vector,z=e[0].point,F=z,O=z,E=F,J=!1;for(let r=0;r<e.length;r++){let{pressure:i}=e[r],{point:o,vector:u,distance:W,runningLength:I}=e[r];if(r<e.length-1&&p-I<3)continue;if(h){if(y){let v=C(1,W/s),Z=C(1,1-v);i=C(1,H+(Z-H)*(v*le));}m=$(s,h,i,n);}else m=s/2;U===void 0&&(U=m);let fe=I<g?j(I/g):1,be=p-I<T?c((p-I)/T):1;m=Math.max(.01,m*Math.min(fe,be));let se=(r<e.length-1?e[r+1]:e[r]).vector,Y=r<e.length-1?B(u,se):1,he=B(u,X)<0&&!J,ue=Y!==null&&Y<0;if(he||ue){let v=b(R(X),m);for(let Z=1/13,w=0;w<=1;w+=Z)O=L(a(o,v),o,V*w),_.push(O),E=L(l(o,v),o,V*-w),M.push(E);z=O,F=E,ue&&(J=!0);continue}if(J=!1,r===e.length-1){let v=b(R(u),m);_.push(a(o,v)),M.push(l(o,v));continue}let ie=b(R(K(se,u,Y)),m);O=a(o,ie),(r<=1||A(z,O)>oe)&&(_.push(O),z=O),E=l(o,ie),(r<=1||A(F,E)>oe)&&(M.push(E),F=E),H=i,X=u;}let P=e[0].point.slice(0,2),k=e.length>1?e[e.length-1].point.slice(0,2):l(e[0].point,[1,1]),Q=[],N=[];if(e.length===1){if(!(g||T)||D){let r=ee(P,G(R(a(P,k))),-(U||m)),i=[];for(let o=1/13,u=o;u<=1;u+=o)i.push(L(r,P,V*2*u));return i}}else {if(!(g||T&&e.length===1))if(S)for(let i=1/13,o=i;o<=1;o+=i){let u=L(M[0],P,V*o);Q.push(u);}else {let i=a(_[0],M[0]),o=b(i,.5),u=b(i,.51);Q.push(a(P,o),a(P,u),l(P,u),l(P,o));}let r=R(ce(e[e.length-1].vector));if(T||g&&e.length===1)N.push(k);else if(q){let i=ee(k,r,m);for(let o=1/29,u=o;u<1;u+=o)N.push(L(i,k,V*3*u));}else N.push(l(k,b(r,m)),l(k,b(r,m*.99)),a(k,b(r,m*.99)),a(k,b(r,m)));}return _.concat(N,M.reverse(),Q)}function re(e,t={}){var q;let{streamline:s=.5,size:x=16,last:h=!1}=t;if(e.length===0)return [];let y=.15+(1-s)*.85,n=Array.isArray(e[0])?e:e.map(({x:c,y:p,pressure:g=.5})=>[c,p,g]);if(n.length===2){let c=n[1];n=n.slice(0,-1);for(let p=1;p<5;p++)n.push(K(n[0],c,p/4));}n.length===1&&(n=[...n,[...l(n[0],[1,1]),...n[0].slice(2)]]);let f=[{point:[n[0][0],n[0][1]],pressure:n[0][2]>=0?n[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,D=0,S=f[0],j=n.length-1;for(let c=1;c<n.length;c++){let p=h&&c===j?n[c].slice(0,2):K(S.point,n[c],y);if(me(S.point,p))continue;let g=ae(p,S.point);if(D+=g,c<j&&!d){if(D<x)continue;d=!0;}S={point:p,pressure:n[c][2]>=0?n[c][2]:.5,vector:G(a(S.point,p)),distance:g,runningLength:D},f.push(S);}return f[0].vector=((q=f[1])==null?void 0:q.vector)||[0,0],f}function ne(e,t={}){return te(re(e,t),t)}var ve=ne;
|
|
14074
14776
|
} (cjs));
|
|
14075
14777
|
return cjs;
|
|
14076
14778
|
}
|
|
14077
14779
|
|
|
14078
14780
|
var cjsExports = requireCjs();
|
|
14781
|
+
var index = /*@__PURE__*/getDefaultExportFromCjs(cjsExports);
|
|
14079
14782
|
|
|
14080
14783
|
class KritzelMathHelper {
|
|
14081
14784
|
static average(a, b) {
|
|
@@ -14419,6 +15122,7 @@ class KritzelBaseTool {
|
|
|
14419
15122
|
_core;
|
|
14420
15123
|
constructor(core) {
|
|
14421
15124
|
this._core = core;
|
|
15125
|
+
void this._core; // Avoid unused variable warning
|
|
14422
15126
|
}
|
|
14423
15127
|
onActivate() {
|
|
14424
15128
|
// default implementation
|
|
@@ -14684,7 +15388,7 @@ class KritzelTextTool extends KritzelBaseTool {
|
|
|
14684
15388
|
}
|
|
14685
15389
|
}
|
|
14686
15390
|
|
|
14687
|
-
export { KritzelText as K, KritzelPath as a, KritzelBrushTool as b, KritzelTextTool as c, KritzelKeyboardHelper as d,
|
|
14688
|
-
//# sourceMappingURL=
|
|
15391
|
+
export { KritzelText as K, KritzelPath as a, KritzelBrushTool as b, KritzelTextTool as c, KritzelKeyboardHelper as d, commonjsGlobal as e, KritzelToolRegistry as f, getDefaultExportFromCjs as g, KritzelBaseObject as h, KritzelEventHelper as i, KritzelBaseTool as j };
|
|
15392
|
+
//# sourceMappingURL=text-tool.class-C0GbC5zQ.js.map
|
|
14689
15393
|
|
|
14690
|
-
//# sourceMappingURL=
|
|
15394
|
+
//# sourceMappingURL=text-tool.class-C0GbC5zQ.js.map
|