@mdesignable/core 1.0.0-beta.64
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/LICENSE.md +20 -0
- package/README.md +1 -0
- package/dist/designable.core.umd.production.js +10 -0
- package/dist/designable.core.umd.production.min.js +23505 -0
- package/esm/drivers/DragDropDriver.d.ts +14 -0
- package/esm/drivers/DragDropDriver.js +157 -0
- package/esm/drivers/KeyboardDriver.d.ts +7 -0
- package/esm/drivers/KeyboardDriver.js +90 -0
- package/esm/drivers/MouseClickDriver.d.ts +8 -0
- package/esm/drivers/MouseClickDriver.js +95 -0
- package/esm/drivers/MouseMoveDriver.d.ts +8 -0
- package/esm/drivers/MouseMoveDriver.js +75 -0
- package/esm/drivers/ViewportResizeDriver.d.ts +10 -0
- package/esm/drivers/ViewportResizeDriver.js +95 -0
- package/esm/drivers/ViewportScrollDriver.d.ts +8 -0
- package/esm/drivers/ViewportScrollDriver.js +74 -0
- package/esm/drivers/index.d.ts +6 -0
- package/esm/drivers/index.js +6 -0
- package/esm/effects/index.d.ts +11 -0
- package/esm/effects/index.js +11 -0
- package/esm/effects/useAutoScrollEffect.d.ts +2 -0
- package/esm/effects/useAutoScrollEffect.js +65 -0
- package/esm/effects/useContentEditableEffect.d.ts +2 -0
- package/esm/effects/useContentEditableEffect.js +167 -0
- package/esm/effects/useCursorEffect.d.ts +2 -0
- package/esm/effects/useCursorEffect.js +55 -0
- package/esm/effects/useDragDropEffect.d.ts +2 -0
- package/esm/effects/useDragDropEffect.js +168 -0
- package/esm/effects/useFreeSelectionEffect.d.ts +2 -0
- package/esm/effects/useFreeSelectionEffect.js +59 -0
- package/esm/effects/useKeyboardEffect.d.ts +2 -0
- package/esm/effects/useKeyboardEffect.js +17 -0
- package/esm/effects/useResizeEffect.d.ts +2 -0
- package/esm/effects/useResizeEffect.js +80 -0
- package/esm/effects/useSelectionEffect.d.ts +2 -0
- package/esm/effects/useSelectionEffect.js +68 -0
- package/esm/effects/useTranslateEffect.d.ts +2 -0
- package/esm/effects/useTranslateEffect.js +58 -0
- package/esm/effects/useViewportEffect.d.ts +2 -0
- package/esm/effects/useViewportEffect.js +31 -0
- package/esm/effects/useWorkspaceEffect.d.ts +2 -0
- package/esm/effects/useWorkspaceEffect.js +29 -0
- package/esm/events/cursor/AbstractCursorEvent.d.ts +21 -0
- package/esm/events/cursor/AbstractCursorEvent.js +40 -0
- package/esm/events/cursor/DragMoveEvent.d.ts +5 -0
- package/esm/events/cursor/DragMoveEvent.js +51 -0
- package/esm/events/cursor/DragStartEvent.d.ts +5 -0
- package/esm/events/cursor/DragStartEvent.js +51 -0
- package/esm/events/cursor/DragStopEvent.d.ts +5 -0
- package/esm/events/cursor/DragStopEvent.js +51 -0
- package/esm/events/cursor/MouseClickEvent.d.ts +8 -0
- package/esm/events/cursor/MouseClickEvent.js +61 -0
- package/esm/events/cursor/MouseMoveEvent.d.ts +5 -0
- package/esm/events/cursor/MouseMoveEvent.js +51 -0
- package/esm/events/cursor/index.d.ts +5 -0
- package/esm/events/cursor/index.js +5 -0
- package/esm/events/history/AbstractHistoryEvent.d.ts +6 -0
- package/esm/events/history/AbstractHistoryEvent.js +7 -0
- package/esm/events/history/HistoryGotoEvent.d.ts +5 -0
- package/esm/events/history/HistoryGotoEvent.js +51 -0
- package/esm/events/history/HistoryPushEvent.d.ts +5 -0
- package/esm/events/history/HistoryPushEvent.js +51 -0
- package/esm/events/history/HistoryRedoEvent.d.ts +5 -0
- package/esm/events/history/HistoryRedoEvent.js +51 -0
- package/esm/events/history/HistoryUndoEvent.d.ts +5 -0
- package/esm/events/history/HistoryUndoEvent.js +51 -0
- package/esm/events/history/index.d.ts +4 -0
- package/esm/events/history/index.js +4 -0
- package/esm/events/index.d.ts +6 -0
- package/esm/events/index.js +6 -0
- package/esm/events/keyboard/AbstractKeyboardEvent.d.ts +15 -0
- package/esm/events/keyboard/AbstractKeyboardEvent.js +61 -0
- package/esm/events/keyboard/KeyDownEvent.d.ts +5 -0
- package/esm/events/keyboard/KeyDownEvent.js +51 -0
- package/esm/events/keyboard/KeyUpEvent.d.ts +5 -0
- package/esm/events/keyboard/KeyUpEvent.js +51 -0
- package/esm/events/keyboard/index.d.ts +2 -0
- package/esm/events/keyboard/index.js +2 -0
- package/esm/events/mutation/AbstractMutationNodeEvent.d.ts +13 -0
- package/esm/events/mutation/AbstractMutationNodeEvent.js +7 -0
- package/esm/events/mutation/AppendNodeEvent.d.ts +5 -0
- package/esm/events/mutation/AppendNodeEvent.js +51 -0
- package/esm/events/mutation/CloneNodeEvent.d.ts +5 -0
- package/esm/events/mutation/CloneNodeEvent.js +51 -0
- package/esm/events/mutation/DragNodeEvent.d.ts +5 -0
- package/esm/events/mutation/DragNodeEvent.js +51 -0
- package/esm/events/mutation/DropNodeEvent.d.ts +5 -0
- package/esm/events/mutation/DropNodeEvent.js +51 -0
- package/esm/events/mutation/FromNodeEvent.d.ts +13 -0
- package/esm/events/mutation/FromNodeEvent.js +8 -0
- package/esm/events/mutation/HoverNodeEvent.d.ts +5 -0
- package/esm/events/mutation/HoverNodeEvent.js +51 -0
- package/esm/events/mutation/InsertAfterEvent.d.ts +5 -0
- package/esm/events/mutation/InsertAfterEvent.js +51 -0
- package/esm/events/mutation/InsertBeforeEvent.d.ts +5 -0
- package/esm/events/mutation/InsertBeforeEvent.js +51 -0
- package/esm/events/mutation/InsertChildrenEvent.d.ts +5 -0
- package/esm/events/mutation/InsertChildrenEvent.js +51 -0
- package/esm/events/mutation/PrependNodeEvent.d.ts +5 -0
- package/esm/events/mutation/PrependNodeEvent.js +51 -0
- package/esm/events/mutation/RemoveNodeEvent.d.ts +5 -0
- package/esm/events/mutation/RemoveNodeEvent.js +51 -0
- package/esm/events/mutation/SelectNodeEvent.d.ts +5 -0
- package/esm/events/mutation/SelectNodeEvent.js +51 -0
- package/esm/events/mutation/UnSelectNodeEvent.d.ts +5 -0
- package/esm/events/mutation/UnSelectNodeEvent.js +51 -0
- package/esm/events/mutation/UpdateChildrenEvent.d.ts +5 -0
- package/esm/events/mutation/UpdateChildrenEvent.js +51 -0
- package/esm/events/mutation/UpdateNodePropsEvent.d.ts +5 -0
- package/esm/events/mutation/UpdateNodePropsEvent.js +51 -0
- package/esm/events/mutation/UserSelectNodeEvent.d.ts +5 -0
- package/esm/events/mutation/UserSelectNodeEvent.js +51 -0
- package/esm/events/mutation/WrapNodeEvent.d.ts +5 -0
- package/esm/events/mutation/WrapNodeEvent.js +51 -0
- package/esm/events/mutation/index.d.ts +16 -0
- package/esm/events/mutation/index.js +16 -0
- package/esm/events/viewport/AbstractViewportEvent.d.ts +16 -0
- package/esm/events/viewport/AbstractViewportEvent.js +17 -0
- package/esm/events/viewport/ViewportResizeEvent.d.ts +5 -0
- package/esm/events/viewport/ViewportResizeEvent.js +51 -0
- package/esm/events/viewport/ViewportScrollEvent.d.ts +5 -0
- package/esm/events/viewport/ViewportScrollEvent.js +51 -0
- package/esm/events/viewport/index.d.ts +2 -0
- package/esm/events/viewport/index.js +2 -0
- package/esm/events/workbench/AbstractWorkspaceEvent.d.ts +7 -0
- package/esm/events/workbench/AbstractWorkspaceEvent.js +7 -0
- package/esm/events/workbench/AddWorkspaceEvent.d.ts +5 -0
- package/esm/events/workbench/AddWorkspaceEvent.js +51 -0
- package/esm/events/workbench/RemoveWorkspaceEvent.d.ts +5 -0
- package/esm/events/workbench/RemoveWorkspaceEvent.js +51 -0
- package/esm/events/workbench/SwitchWorkspaceEvent.d.ts +5 -0
- package/esm/events/workbench/SwitchWorkspaceEvent.js +51 -0
- package/esm/events/workbench/index.d.ts +3 -0
- package/esm/events/workbench/index.js +3 -0
- package/esm/exports.d.ts +5 -0
- package/esm/exports.js +5 -0
- package/esm/externals.d.ts +12 -0
- package/esm/externals.js +113 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +24 -0
- package/esm/internals.d.ts +3 -0
- package/esm/internals.js +34 -0
- package/esm/models/Cursor.d.ts +60 -0
- package/esm/models/Cursor.js +151 -0
- package/esm/models/Engine.d.ts +29 -0
- package/esm/models/Engine.js +112 -0
- package/esm/models/History.d.ts +34 -0
- package/esm/models/History.js +110 -0
- package/esm/models/Hover.d.ts +14 -0
- package/esm/models/Hover.js +38 -0
- package/esm/models/Keyboard.d.ts +29 -0
- package/esm/models/Keyboard.js +126 -0
- package/esm/models/MoveHelper.d.ts +66 -0
- package/esm/models/MoveHelper.js +363 -0
- package/esm/models/Operation.d.ts +29 -0
- package/esm/models/Operation.js +75 -0
- package/esm/models/Screen.d.ts +31 -0
- package/esm/models/Screen.js +73 -0
- package/esm/models/Selection.d.ts +29 -0
- package/esm/models/Selection.js +192 -0
- package/esm/models/Shortcut.d.ts +20 -0
- package/esm/models/Shortcut.js +69 -0
- package/esm/models/SnapLine.d.ts +27 -0
- package/esm/models/SnapLine.js +141 -0
- package/esm/models/SpaceBlock.d.ts +40 -0
- package/esm/models/SpaceBlock.js +171 -0
- package/esm/models/TransformHelper.d.ts +80 -0
- package/esm/models/TransformHelper.js +601 -0
- package/esm/models/TreeNode.d.ts +115 -0
- package/esm/models/TreeNode.js +932 -0
- package/esm/models/Viewport.d.ts +90 -0
- package/esm/models/Viewport.js +474 -0
- package/esm/models/Workbench.d.ts +23 -0
- package/esm/models/Workbench.js +98 -0
- package/esm/models/Workspace.d.ts +41 -0
- package/esm/models/Workspace.js +95 -0
- package/esm/models/index.d.ts +13 -0
- package/esm/models/index.js +13 -0
- package/esm/presets.d.ts +4 -0
- package/esm/presets.js +38 -0
- package/esm/registry.d.ts +16 -0
- package/esm/registry.js +123 -0
- package/esm/shortcuts/CursorSwitch.d.ts +2 -0
- package/esm/shortcuts/CursorSwitch.js +10 -0
- package/esm/shortcuts/MultiSelection.d.ts +5 -0
- package/esm/shortcuts/MultiSelection.js +27 -0
- package/esm/shortcuts/NodeMutation.d.ts +7 -0
- package/esm/shortcuts/NodeMutation.js +40 -0
- package/esm/shortcuts/QuickSelection.d.ts +3 -0
- package/esm/shortcuts/QuickSelection.js +85 -0
- package/esm/shortcuts/UndoRedo.d.ts +3 -0
- package/esm/shortcuts/UndoRedo.js +27 -0
- package/esm/shortcuts/index.d.ts +5 -0
- package/esm/shortcuts/index.js +5 -0
- package/esm/types.d.ts +131 -0
- package/esm/types.js +1 -0
- package/lib/drivers/DragDropDriver.d.ts +14 -0
- package/lib/drivers/DragDropDriver.js +160 -0
- package/lib/drivers/KeyboardDriver.d.ts +7 -0
- package/lib/drivers/KeyboardDriver.js +93 -0
- package/lib/drivers/MouseClickDriver.d.ts +8 -0
- package/lib/drivers/MouseClickDriver.js +98 -0
- package/lib/drivers/MouseMoveDriver.d.ts +8 -0
- package/lib/drivers/MouseMoveDriver.js +78 -0
- package/lib/drivers/ViewportResizeDriver.d.ts +10 -0
- package/lib/drivers/ViewportResizeDriver.js +98 -0
- package/lib/drivers/ViewportScrollDriver.d.ts +8 -0
- package/lib/drivers/ViewportScrollDriver.js +77 -0
- package/lib/drivers/index.d.ts +6 -0
- package/lib/drivers/index.js +22 -0
- package/lib/effects/index.d.ts +11 -0
- package/lib/effects/index.js +27 -0
- package/lib/effects/useAutoScrollEffect.d.ts +2 -0
- package/lib/effects/useAutoScrollEffect.js +69 -0
- package/lib/effects/useContentEditableEffect.d.ts +2 -0
- package/lib/effects/useContentEditableEffect.js +171 -0
- package/lib/effects/useCursorEffect.d.ts +2 -0
- package/lib/effects/useCursorEffect.js +59 -0
- package/lib/effects/useDragDropEffect.d.ts +2 -0
- package/lib/effects/useDragDropEffect.js +172 -0
- package/lib/effects/useFreeSelectionEffect.d.ts +2 -0
- package/lib/effects/useFreeSelectionEffect.js +63 -0
- package/lib/effects/useKeyboardEffect.d.ts +2 -0
- package/lib/effects/useKeyboardEffect.js +21 -0
- package/lib/effects/useResizeEffect.d.ts +2 -0
- package/lib/effects/useResizeEffect.js +84 -0
- package/lib/effects/useSelectionEffect.d.ts +2 -0
- package/lib/effects/useSelectionEffect.js +72 -0
- package/lib/effects/useTranslateEffect.d.ts +2 -0
- package/lib/effects/useTranslateEffect.js +62 -0
- package/lib/effects/useViewportEffect.d.ts +2 -0
- package/lib/effects/useViewportEffect.js +35 -0
- package/lib/effects/useWorkspaceEffect.d.ts +2 -0
- package/lib/effects/useWorkspaceEffect.js +33 -0
- package/lib/events/cursor/AbstractCursorEvent.d.ts +21 -0
- package/lib/events/cursor/AbstractCursorEvent.js +43 -0
- package/lib/events/cursor/DragMoveEvent.d.ts +5 -0
- package/lib/events/cursor/DragMoveEvent.js +54 -0
- package/lib/events/cursor/DragStartEvent.d.ts +5 -0
- package/lib/events/cursor/DragStartEvent.js +54 -0
- package/lib/events/cursor/DragStopEvent.d.ts +5 -0
- package/lib/events/cursor/DragStopEvent.js +54 -0
- package/lib/events/cursor/MouseClickEvent.d.ts +8 -0
- package/lib/events/cursor/MouseClickEvent.js +64 -0
- package/lib/events/cursor/MouseMoveEvent.d.ts +5 -0
- package/lib/events/cursor/MouseMoveEvent.js +54 -0
- package/lib/events/cursor/index.d.ts +5 -0
- package/lib/events/cursor/index.js +21 -0
- package/lib/events/history/AbstractHistoryEvent.d.ts +6 -0
- package/lib/events/history/AbstractHistoryEvent.js +10 -0
- package/lib/events/history/HistoryGotoEvent.d.ts +5 -0
- package/lib/events/history/HistoryGotoEvent.js +54 -0
- package/lib/events/history/HistoryPushEvent.d.ts +5 -0
- package/lib/events/history/HistoryPushEvent.js +54 -0
- package/lib/events/history/HistoryRedoEvent.d.ts +5 -0
- package/lib/events/history/HistoryRedoEvent.js +54 -0
- package/lib/events/history/HistoryUndoEvent.d.ts +5 -0
- package/lib/events/history/HistoryUndoEvent.js +54 -0
- package/lib/events/history/index.d.ts +4 -0
- package/lib/events/history/index.js +20 -0
- package/lib/events/index.d.ts +6 -0
- package/lib/events/index.js +22 -0
- package/lib/events/keyboard/AbstractKeyboardEvent.d.ts +15 -0
- package/lib/events/keyboard/AbstractKeyboardEvent.js +64 -0
- package/lib/events/keyboard/KeyDownEvent.d.ts +5 -0
- package/lib/events/keyboard/KeyDownEvent.js +54 -0
- package/lib/events/keyboard/KeyUpEvent.d.ts +5 -0
- package/lib/events/keyboard/KeyUpEvent.js +54 -0
- package/lib/events/keyboard/index.d.ts +2 -0
- package/lib/events/keyboard/index.js +18 -0
- package/lib/events/mutation/AbstractMutationNodeEvent.d.ts +13 -0
- package/lib/events/mutation/AbstractMutationNodeEvent.js +10 -0
- package/lib/events/mutation/AppendNodeEvent.d.ts +5 -0
- package/lib/events/mutation/AppendNodeEvent.js +54 -0
- package/lib/events/mutation/CloneNodeEvent.d.ts +5 -0
- package/lib/events/mutation/CloneNodeEvent.js +54 -0
- package/lib/events/mutation/DragNodeEvent.d.ts +5 -0
- package/lib/events/mutation/DragNodeEvent.js +54 -0
- package/lib/events/mutation/DropNodeEvent.d.ts +5 -0
- package/lib/events/mutation/DropNodeEvent.js +54 -0
- package/lib/events/mutation/FromNodeEvent.d.ts +13 -0
- package/lib/events/mutation/FromNodeEvent.js +11 -0
- package/lib/events/mutation/HoverNodeEvent.d.ts +5 -0
- package/lib/events/mutation/HoverNodeEvent.js +54 -0
- package/lib/events/mutation/InsertAfterEvent.d.ts +5 -0
- package/lib/events/mutation/InsertAfterEvent.js +54 -0
- package/lib/events/mutation/InsertBeforeEvent.d.ts +5 -0
- package/lib/events/mutation/InsertBeforeEvent.js +54 -0
- package/lib/events/mutation/InsertChildrenEvent.d.ts +5 -0
- package/lib/events/mutation/InsertChildrenEvent.js +54 -0
- package/lib/events/mutation/PrependNodeEvent.d.ts +5 -0
- package/lib/events/mutation/PrependNodeEvent.js +54 -0
- package/lib/events/mutation/RemoveNodeEvent.d.ts +5 -0
- package/lib/events/mutation/RemoveNodeEvent.js +54 -0
- package/lib/events/mutation/SelectNodeEvent.d.ts +5 -0
- package/lib/events/mutation/SelectNodeEvent.js +54 -0
- package/lib/events/mutation/UnSelectNodeEvent.d.ts +5 -0
- package/lib/events/mutation/UnSelectNodeEvent.js +54 -0
- package/lib/events/mutation/UpdateChildrenEvent.d.ts +5 -0
- package/lib/events/mutation/UpdateChildrenEvent.js +54 -0
- package/lib/events/mutation/UpdateNodePropsEvent.d.ts +5 -0
- package/lib/events/mutation/UpdateNodePropsEvent.js +54 -0
- package/lib/events/mutation/UserSelectNodeEvent.d.ts +5 -0
- package/lib/events/mutation/UserSelectNodeEvent.js +54 -0
- package/lib/events/mutation/WrapNodeEvent.d.ts +5 -0
- package/lib/events/mutation/WrapNodeEvent.js +54 -0
- package/lib/events/mutation/index.d.ts +16 -0
- package/lib/events/mutation/index.js +32 -0
- package/lib/events/viewport/AbstractViewportEvent.d.ts +16 -0
- package/lib/events/viewport/AbstractViewportEvent.js +20 -0
- package/lib/events/viewport/ViewportResizeEvent.d.ts +5 -0
- package/lib/events/viewport/ViewportResizeEvent.js +54 -0
- package/lib/events/viewport/ViewportScrollEvent.d.ts +5 -0
- package/lib/events/viewport/ViewportScrollEvent.js +54 -0
- package/lib/events/viewport/index.d.ts +2 -0
- package/lib/events/viewport/index.js +18 -0
- package/lib/events/workbench/AbstractWorkspaceEvent.d.ts +7 -0
- package/lib/events/workbench/AbstractWorkspaceEvent.js +10 -0
- package/lib/events/workbench/AddWorkspaceEvent.d.ts +5 -0
- package/lib/events/workbench/AddWorkspaceEvent.js +54 -0
- package/lib/events/workbench/RemoveWorkspaceEvent.d.ts +5 -0
- package/lib/events/workbench/RemoveWorkspaceEvent.js +54 -0
- package/lib/events/workbench/SwitchWorkspaceEvent.d.ts +5 -0
- package/lib/events/workbench/SwitchWorkspaceEvent.js +54 -0
- package/lib/events/workbench/index.d.ts +3 -0
- package/lib/events/workbench/index.js +19 -0
- package/lib/exports.d.ts +5 -0
- package/lib/exports.js +21 -0
- package/lib/externals.d.ts +12 -0
- package/lib/externals.js +126 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +52 -0
- package/lib/internals.d.ts +3 -0
- package/lib/internals.js +40 -0
- package/lib/models/Cursor.d.ts +60 -0
- package/lib/models/Cursor.js +154 -0
- package/lib/models/Engine.d.ts +29 -0
- package/lib/models/Engine.js +115 -0
- package/lib/models/History.d.ts +34 -0
- package/lib/models/History.js +113 -0
- package/lib/models/Hover.d.ts +14 -0
- package/lib/models/Hover.js +41 -0
- package/lib/models/Keyboard.d.ts +29 -0
- package/lib/models/Keyboard.js +129 -0
- package/lib/models/MoveHelper.d.ts +66 -0
- package/lib/models/MoveHelper.js +366 -0
- package/lib/models/Operation.d.ts +29 -0
- package/lib/models/Operation.js +78 -0
- package/lib/models/Screen.d.ts +31 -0
- package/lib/models/Screen.js +76 -0
- package/lib/models/Selection.d.ts +29 -0
- package/lib/models/Selection.js +195 -0
- package/lib/models/Shortcut.d.ts +20 -0
- package/lib/models/Shortcut.js +72 -0
- package/lib/models/SnapLine.d.ts +27 -0
- package/lib/models/SnapLine.js +144 -0
- package/lib/models/SpaceBlock.d.ts +40 -0
- package/lib/models/SpaceBlock.js +174 -0
- package/lib/models/TransformHelper.d.ts +80 -0
- package/lib/models/TransformHelper.js +604 -0
- package/lib/models/TreeNode.d.ts +115 -0
- package/lib/models/TreeNode.js +935 -0
- package/lib/models/Viewport.d.ts +90 -0
- package/lib/models/Viewport.js +477 -0
- package/lib/models/Workbench.d.ts +23 -0
- package/lib/models/Workbench.js +101 -0
- package/lib/models/Workspace.d.ts +41 -0
- package/lib/models/Workspace.js +98 -0
- package/lib/models/index.d.ts +13 -0
- package/lib/models/index.js +29 -0
- package/lib/presets.d.ts +4 -0
- package/lib/presets.js +41 -0
- package/lib/registry.d.ts +16 -0
- package/lib/registry.js +126 -0
- package/lib/shortcuts/CursorSwitch.d.ts +2 -0
- package/lib/shortcuts/CursorSwitch.js +13 -0
- package/lib/shortcuts/MultiSelection.d.ts +5 -0
- package/lib/shortcuts/MultiSelection.js +30 -0
- package/lib/shortcuts/NodeMutation.d.ts +7 -0
- package/lib/shortcuts/NodeMutation.js +43 -0
- package/lib/shortcuts/QuickSelection.d.ts +3 -0
- package/lib/shortcuts/QuickSelection.js +88 -0
- package/lib/shortcuts/UndoRedo.d.ts +3 -0
- package/lib/shortcuts/UndoRedo.js +30 -0
- package/lib/shortcuts/index.d.ts +5 -0
- package/lib/shortcuts/index.js +21 -0
- package/lib/types.d.ts +131 -0
- package/lib/types.js +2 -0
- package/package.json +49 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
import { CursorDragType } from '../models';
|
2
|
+
import { DragStartEvent, DragMoveEvent, DragStopEvent } from '../events';
|
3
|
+
export var useResizeEffect = function (engine) {
|
4
|
+
var findStartNodeHandler = function (target) {
|
5
|
+
var handler = target === null || target === void 0 ? void 0 : target.closest("*[".concat(engine.props.nodeResizeHandlerAttrName, "]"));
|
6
|
+
if (handler) {
|
7
|
+
var direction = handler.getAttribute(engine.props.nodeResizeHandlerAttrName);
|
8
|
+
if (direction) {
|
9
|
+
var element = handler.closest("*[".concat(engine.props.nodeSelectionIdAttrName, "]"));
|
10
|
+
if (element) {
|
11
|
+
var nodeId = element.getAttribute(engine.props.nodeSelectionIdAttrName);
|
12
|
+
if (nodeId) {
|
13
|
+
var node = engine.findNodeById(nodeId);
|
14
|
+
if (node) {
|
15
|
+
return { direction: direction, node: node, element: element };
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return;
|
22
|
+
};
|
23
|
+
engine.subscribeTo(DragStartEvent, function (event) {
|
24
|
+
var _a, _b;
|
25
|
+
var target = event.data.target;
|
26
|
+
var currentWorkspace = (_b = (_a = event.context) === null || _a === void 0 ? void 0 : _a.workspace) !== null && _b !== void 0 ? _b : engine.workbench.activeWorkspace;
|
27
|
+
if (!currentWorkspace)
|
28
|
+
return;
|
29
|
+
var handler = findStartNodeHandler(target);
|
30
|
+
var helper = currentWorkspace.operation.transformHelper;
|
31
|
+
if (handler) {
|
32
|
+
var selectionElement = handler.element.closest("*[".concat(engine.props.nodeSelectionIdAttrName, "]"));
|
33
|
+
if (selectionElement) {
|
34
|
+
var nodeId = selectionElement.getAttribute(engine.props.nodeSelectionIdAttrName);
|
35
|
+
if (nodeId) {
|
36
|
+
var node = engine.findNodeById(nodeId);
|
37
|
+
if (node) {
|
38
|
+
helper.dragStart({
|
39
|
+
dragNodes: [node],
|
40
|
+
type: 'resize',
|
41
|
+
direction: handler.direction,
|
42
|
+
});
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
});
|
48
|
+
engine.subscribeTo(DragMoveEvent, function (event) {
|
49
|
+
var _a, _b;
|
50
|
+
if (engine.cursor.dragType !== CursorDragType.Resize)
|
51
|
+
return;
|
52
|
+
var currentWorkspace = (_b = (_a = event.context) === null || _a === void 0 ? void 0 : _a.workspace) !== null && _b !== void 0 ? _b : engine.workbench.activeWorkspace;
|
53
|
+
var helper = currentWorkspace === null || currentWorkspace === void 0 ? void 0 : currentWorkspace.operation.transformHelper;
|
54
|
+
var dragNodes = helper.dragNodes;
|
55
|
+
if (!dragNodes.length)
|
56
|
+
return;
|
57
|
+
helper.dragMove();
|
58
|
+
dragNodes.forEach(function (node) {
|
59
|
+
var element = node.getElement();
|
60
|
+
helper.resize(node, function (rect) {
|
61
|
+
element.style.width = rect.width + 'px';
|
62
|
+
element.style.height = rect.height + 'px';
|
63
|
+
element.style.position = 'absolute';
|
64
|
+
element.style.left = '0px';
|
65
|
+
element.style.top = '0px';
|
66
|
+
element.style.transform = "translate3d(".concat(rect.x, "px,").concat(rect.y, "px,0)");
|
67
|
+
});
|
68
|
+
});
|
69
|
+
});
|
70
|
+
engine.subscribeTo(DragStopEvent, function (event) {
|
71
|
+
var _a, _b;
|
72
|
+
if (engine.cursor.dragType !== CursorDragType.Resize)
|
73
|
+
return;
|
74
|
+
var currentWorkspace = (_b = (_a = event.context) === null || _a === void 0 ? void 0 : _a.workspace) !== null && _b !== void 0 ? _b : engine.workbench.activeWorkspace;
|
75
|
+
var helper = currentWorkspace === null || currentWorkspace === void 0 ? void 0 : currentWorkspace.operation.transformHelper;
|
76
|
+
if (helper) {
|
77
|
+
helper.dragEnd();
|
78
|
+
}
|
79
|
+
});
|
80
|
+
};
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { CursorStatus } from '../models';
|
2
|
+
import { MouseClickEvent } from '../events';
|
3
|
+
import { KeyCode, Point } from '@mdesignable/shared';
|
4
|
+
export var useSelectionEffect = function (engine) {
|
5
|
+
engine.subscribeTo(MouseClickEvent, function (event) {
|
6
|
+
var _a, _b, _c, _d;
|
7
|
+
if (engine.cursor.status !== CursorStatus.Normal)
|
8
|
+
return;
|
9
|
+
var target = event.data.target;
|
10
|
+
var el = (_a = target === null || target === void 0 ? void 0 : target.closest) === null || _a === void 0 ? void 0 : _a.call(target, "\n *[".concat(engine.props.nodeIdAttrName, "],\n *[").concat(engine.props.outlineNodeIdAttrName, "]\n "));
|
11
|
+
var isHelpers = (_b = target === null || target === void 0 ? void 0 : target.closest) === null || _b === void 0 ? void 0 : _b.call(target, "*[".concat(engine.props.nodeSelectionIdAttrName, "]"));
|
12
|
+
var currentWorkspace = (_d = (_c = event.context) === null || _c === void 0 ? void 0 : _c.workspace) !== null && _d !== void 0 ? _d : engine.workbench.activeWorkspace;
|
13
|
+
if (!currentWorkspace)
|
14
|
+
return;
|
15
|
+
if (!(el === null || el === void 0 ? void 0 : el.getAttribute)) {
|
16
|
+
var point = new Point(event.data.topClientX, event.data.topClientY);
|
17
|
+
var operation_1 = currentWorkspace.operation;
|
18
|
+
var viewport = currentWorkspace.viewport;
|
19
|
+
var outline = currentWorkspace.outline;
|
20
|
+
var isInViewport = viewport.isPointInViewport(point, false);
|
21
|
+
var isInOutline = outline.isPointInViewport(point, false);
|
22
|
+
if (isHelpers)
|
23
|
+
return;
|
24
|
+
if (isInViewport || isInOutline) {
|
25
|
+
var selection_1 = operation_1.selection;
|
26
|
+
var tree_1 = operation_1.tree;
|
27
|
+
selection_1.select(tree_1);
|
28
|
+
}
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
var nodeId = el.getAttribute(engine.props.nodeIdAttrName);
|
32
|
+
var structNodeId = el.getAttribute(engine.props.outlineNodeIdAttrName);
|
33
|
+
var operation = currentWorkspace.operation;
|
34
|
+
var selection = operation.selection;
|
35
|
+
var tree = operation.tree;
|
36
|
+
var node = tree.findById(nodeId || structNodeId);
|
37
|
+
if (node) {
|
38
|
+
engine.keyboard.requestClean();
|
39
|
+
if (engine.keyboard.isKeyDown(KeyCode.Meta) ||
|
40
|
+
engine.keyboard.isKeyDown(KeyCode.Control)) {
|
41
|
+
if (selection.has(node)) {
|
42
|
+
if (selection.selected.length > 1) {
|
43
|
+
selection.remove(node);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
selection.add(node);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
else if (engine.keyboard.isKeyDown(KeyCode.Shift)) {
|
51
|
+
if (selection.has(node)) {
|
52
|
+
if (selection.selected.length > 1) {
|
53
|
+
selection.remove(node);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
selection.crossAddTo(node);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
selection.select(node);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
selection.select(tree);
|
66
|
+
}
|
67
|
+
});
|
68
|
+
};
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { CursorDragType } from '../models';
|
2
|
+
import { DragStartEvent, DragMoveEvent, DragStopEvent } from '../events';
|
3
|
+
export var useTranslateEffect = function (engine) {
|
4
|
+
engine.subscribeTo(DragStartEvent, function (event) {
|
5
|
+
var _a, _b;
|
6
|
+
var target = event.data.target;
|
7
|
+
var currentWorkspace = (_b = (_a = event.context) === null || _a === void 0 ? void 0 : _a.workspace) !== null && _b !== void 0 ? _b : engine.workbench.activeWorkspace;
|
8
|
+
var handler = target === null || target === void 0 ? void 0 : target.closest("*[".concat(engine.props.nodeTranslateAttrName, "]"));
|
9
|
+
if (!currentWorkspace)
|
10
|
+
return;
|
11
|
+
var helper = currentWorkspace.operation.transformHelper;
|
12
|
+
if (handler) {
|
13
|
+
var type = handler.getAttribute(engine.props.nodeTranslateAttrName);
|
14
|
+
if (type) {
|
15
|
+
var selectionElement = handler.closest("*[".concat(engine.props.nodeSelectionIdAttrName, "]"));
|
16
|
+
if (selectionElement) {
|
17
|
+
var nodeId = selectionElement.getAttribute(engine.props.nodeSelectionIdAttrName);
|
18
|
+
if (nodeId) {
|
19
|
+
var node = engine.findNodeById(nodeId);
|
20
|
+
if (node) {
|
21
|
+
helper.dragStart({ dragNodes: [node], type: 'translate' });
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
});
|
28
|
+
engine.subscribeTo(DragMoveEvent, function (event) {
|
29
|
+
var _a, _b;
|
30
|
+
if (engine.cursor.dragType !== CursorDragType.Translate)
|
31
|
+
return;
|
32
|
+
var currentWorkspace = (_b = (_a = event.context) === null || _a === void 0 ? void 0 : _a.workspace) !== null && _b !== void 0 ? _b : engine.workbench.activeWorkspace;
|
33
|
+
var helper = currentWorkspace === null || currentWorkspace === void 0 ? void 0 : currentWorkspace.operation.transformHelper;
|
34
|
+
var dragNodes = helper.dragNodes;
|
35
|
+
if (!dragNodes.length)
|
36
|
+
return;
|
37
|
+
helper.dragMove();
|
38
|
+
dragNodes.forEach(function (node) {
|
39
|
+
var element = node.getElement();
|
40
|
+
helper.translate(node, function (translate) {
|
41
|
+
element.style.position = 'absolute';
|
42
|
+
element.style.left = '0px';
|
43
|
+
element.style.top = '0px';
|
44
|
+
element.style.transform = "translate3d(".concat(translate.x, "px,").concat(translate.y, "px,0)");
|
45
|
+
});
|
46
|
+
});
|
47
|
+
});
|
48
|
+
engine.subscribeTo(DragStopEvent, function (event) {
|
49
|
+
var _a, _b;
|
50
|
+
if (engine.cursor.dragType !== CursorDragType.Translate)
|
51
|
+
return;
|
52
|
+
var currentWorkspace = (_b = (_a = event.context) === null || _a === void 0 ? void 0 : _a.workspace) !== null && _b !== void 0 ? _b : engine.workbench.activeWorkspace;
|
53
|
+
var helper = currentWorkspace === null || currentWorkspace === void 0 ? void 0 : currentWorkspace.operation.transformHelper;
|
54
|
+
if (helper) {
|
55
|
+
helper.dragEnd();
|
56
|
+
}
|
57
|
+
});
|
58
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { ViewportResizeEvent, ViewportScrollEvent } from '../events';
|
2
|
+
export var useViewportEffect = function (engine) {
|
3
|
+
engine.subscribeTo(ViewportResizeEvent, function (event) {
|
4
|
+
var _a;
|
5
|
+
var currentWorkspace = (_a = event === null || event === void 0 ? void 0 : event.context) === null || _a === void 0 ? void 0 : _a.workspace;
|
6
|
+
if (!currentWorkspace)
|
7
|
+
return;
|
8
|
+
var viewport = currentWorkspace.viewport;
|
9
|
+
var outline = currentWorkspace.outline;
|
10
|
+
if (viewport.matchViewport(event.data.target)) {
|
11
|
+
viewport.digestViewport();
|
12
|
+
}
|
13
|
+
if (outline.matchViewport(event.data.target)) {
|
14
|
+
outline.digestViewport();
|
15
|
+
}
|
16
|
+
});
|
17
|
+
engine.subscribeTo(ViewportScrollEvent, function (event) {
|
18
|
+
var _a;
|
19
|
+
var currentWorkspace = (_a = event === null || event === void 0 ? void 0 : event.context) === null || _a === void 0 ? void 0 : _a.workspace;
|
20
|
+
if (!currentWorkspace)
|
21
|
+
return;
|
22
|
+
var viewport = currentWorkspace.viewport;
|
23
|
+
var outline = currentWorkspace.outline;
|
24
|
+
if (viewport.matchViewport(event.data.target)) {
|
25
|
+
viewport.digestViewport();
|
26
|
+
}
|
27
|
+
if (outline.matchViewport(event.data.target)) {
|
28
|
+
outline.digestViewport();
|
29
|
+
}
|
30
|
+
});
|
31
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { SelectNodeEvent } from '../events';
|
2
|
+
export var useWorkspaceEffect = function (engine) {
|
3
|
+
engine.subscribeWith([
|
4
|
+
'append:node',
|
5
|
+
'insert:after',
|
6
|
+
'insert:before',
|
7
|
+
'insert:children',
|
8
|
+
'drag:node',
|
9
|
+
'drop:node',
|
10
|
+
'prepend:node',
|
11
|
+
'remove:node',
|
12
|
+
'select:node',
|
13
|
+
'update:children',
|
14
|
+
'wrap:node',
|
15
|
+
'update:node:props',
|
16
|
+
], function (event) {
|
17
|
+
var _a;
|
18
|
+
if ((_a = event.context) === null || _a === void 0 ? void 0 : _a.workbench) {
|
19
|
+
engine.workbench.setActiveWorkspace(event.context.workspace);
|
20
|
+
}
|
21
|
+
});
|
22
|
+
engine.subscribeTo(SelectNodeEvent, function (event) {
|
23
|
+
engine.workbench.eachWorkspace(function (workspace) {
|
24
|
+
if (workspace !== event.context.workspace) {
|
25
|
+
workspace.operation.selection.clear();
|
26
|
+
}
|
27
|
+
});
|
28
|
+
});
|
29
|
+
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { IEngineContext } from '../../types';
|
2
|
+
export interface ICursorEventOriginData {
|
3
|
+
clientX: number;
|
4
|
+
clientY: number;
|
5
|
+
pageX: number;
|
6
|
+
pageY: number;
|
7
|
+
target: EventTarget;
|
8
|
+
view: Window;
|
9
|
+
}
|
10
|
+
export interface ICursorEventData extends ICursorEventOriginData {
|
11
|
+
topClientX?: number;
|
12
|
+
topClientY?: number;
|
13
|
+
topPageX?: number;
|
14
|
+
topPageY?: number;
|
15
|
+
}
|
16
|
+
export declare class AbstractCursorEvent {
|
17
|
+
data: ICursorEventData;
|
18
|
+
context: IEngineContext;
|
19
|
+
constructor(data: ICursorEventOriginData);
|
20
|
+
transformCoordinates(): void;
|
21
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { globalThisPolyfill } from '@mdesignable/shared';
|
2
|
+
var AbstractCursorEvent = /** @class */ (function () {
|
3
|
+
function AbstractCursorEvent(data) {
|
4
|
+
this.data = data || {
|
5
|
+
clientX: 0,
|
6
|
+
clientY: 0,
|
7
|
+
pageX: 0,
|
8
|
+
pageY: 0,
|
9
|
+
target: null,
|
10
|
+
view: globalThisPolyfill,
|
11
|
+
};
|
12
|
+
this.transformCoordinates();
|
13
|
+
}
|
14
|
+
AbstractCursorEvent.prototype.transformCoordinates = function () {
|
15
|
+
var _a;
|
16
|
+
var frameElement = (((_a = this.data) === null || _a === void 0 ? void 0 : _a.view) || {}).frameElement;
|
17
|
+
if (frameElement && this.data.view !== globalThisPolyfill) {
|
18
|
+
var frameRect = frameElement.getBoundingClientRect();
|
19
|
+
var scale = frameRect.width / frameElement['offsetWidth'];
|
20
|
+
this.data.topClientX = this.data.clientX * scale + frameRect.x;
|
21
|
+
this.data.topClientY = this.data.clientY * scale + frameRect.y;
|
22
|
+
this.data.topPageX =
|
23
|
+
this.data.pageX + frameRect.x - this.data.view.scrollX;
|
24
|
+
this.data.topPageY =
|
25
|
+
this.data.pageY + frameRect.y - this.data.view.scrollY;
|
26
|
+
var topElement = document.elementFromPoint(this.data.topPageX, this.data.topClientY);
|
27
|
+
if (topElement !== frameElement) {
|
28
|
+
this.data.target = topElement;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
this.data.topClientX = this.data.clientX;
|
33
|
+
this.data.topClientY = this.data.clientY;
|
34
|
+
this.data.topPageX = this.data.pageX;
|
35
|
+
this.data.topPageY = this.data.pageY;
|
36
|
+
}
|
37
|
+
};
|
38
|
+
return AbstractCursorEvent;
|
39
|
+
}());
|
40
|
+
export { AbstractCursorEvent };
|
@@ -0,0 +1,51 @@
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
2
|
+
var extendStatics = function (d, b) {
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
6
|
+
return extendStatics(d, b);
|
7
|
+
};
|
8
|
+
return function (d, b) {
|
9
|
+
if (typeof b !== "function" && b !== null)
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
11
|
+
extendStatics(d, b);
|
12
|
+
function __() { this.constructor = d; }
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14
|
+
};
|
15
|
+
})();
|
16
|
+
var __read = (this && this.__read) || function (o, n) {
|
17
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
18
|
+
if (!m) return o;
|
19
|
+
var i = m.call(o), r, ar = [], e;
|
20
|
+
try {
|
21
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
22
|
+
}
|
23
|
+
catch (error) { e = { error: error }; }
|
24
|
+
finally {
|
25
|
+
try {
|
26
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
27
|
+
}
|
28
|
+
finally { if (e) throw e.error; }
|
29
|
+
}
|
30
|
+
return ar;
|
31
|
+
};
|
32
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
33
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
34
|
+
if (ar || !(i in from)) {
|
35
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
36
|
+
ar[i] = from[i];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
40
|
+
};
|
41
|
+
import { AbstractCursorEvent } from './AbstractCursorEvent';
|
42
|
+
var DragMoveEvent = /** @class */ (function (_super) {
|
43
|
+
__extends(DragMoveEvent, _super);
|
44
|
+
function DragMoveEvent() {
|
45
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
46
|
+
_this.type = 'drag:move';
|
47
|
+
return _this;
|
48
|
+
}
|
49
|
+
return DragMoveEvent;
|
50
|
+
}(AbstractCursorEvent));
|
51
|
+
export { DragMoveEvent };
|
@@ -0,0 +1,51 @@
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
2
|
+
var extendStatics = function (d, b) {
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
6
|
+
return extendStatics(d, b);
|
7
|
+
};
|
8
|
+
return function (d, b) {
|
9
|
+
if (typeof b !== "function" && b !== null)
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
11
|
+
extendStatics(d, b);
|
12
|
+
function __() { this.constructor = d; }
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14
|
+
};
|
15
|
+
})();
|
16
|
+
var __read = (this && this.__read) || function (o, n) {
|
17
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
18
|
+
if (!m) return o;
|
19
|
+
var i = m.call(o), r, ar = [], e;
|
20
|
+
try {
|
21
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
22
|
+
}
|
23
|
+
catch (error) { e = { error: error }; }
|
24
|
+
finally {
|
25
|
+
try {
|
26
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
27
|
+
}
|
28
|
+
finally { if (e) throw e.error; }
|
29
|
+
}
|
30
|
+
return ar;
|
31
|
+
};
|
32
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
33
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
34
|
+
if (ar || !(i in from)) {
|
35
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
36
|
+
ar[i] = from[i];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
40
|
+
};
|
41
|
+
import { AbstractCursorEvent } from './AbstractCursorEvent';
|
42
|
+
var DragStartEvent = /** @class */ (function (_super) {
|
43
|
+
__extends(DragStartEvent, _super);
|
44
|
+
function DragStartEvent() {
|
45
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
46
|
+
_this.type = 'drag:start';
|
47
|
+
return _this;
|
48
|
+
}
|
49
|
+
return DragStartEvent;
|
50
|
+
}(AbstractCursorEvent));
|
51
|
+
export { DragStartEvent };
|
@@ -0,0 +1,51 @@
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
2
|
+
var extendStatics = function (d, b) {
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
6
|
+
return extendStatics(d, b);
|
7
|
+
};
|
8
|
+
return function (d, b) {
|
9
|
+
if (typeof b !== "function" && b !== null)
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
11
|
+
extendStatics(d, b);
|
12
|
+
function __() { this.constructor = d; }
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14
|
+
};
|
15
|
+
})();
|
16
|
+
var __read = (this && this.__read) || function (o, n) {
|
17
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
18
|
+
if (!m) return o;
|
19
|
+
var i = m.call(o), r, ar = [], e;
|
20
|
+
try {
|
21
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
22
|
+
}
|
23
|
+
catch (error) { e = { error: error }; }
|
24
|
+
finally {
|
25
|
+
try {
|
26
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
27
|
+
}
|
28
|
+
finally { if (e) throw e.error; }
|
29
|
+
}
|
30
|
+
return ar;
|
31
|
+
};
|
32
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
33
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
34
|
+
if (ar || !(i in from)) {
|
35
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
36
|
+
ar[i] = from[i];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
40
|
+
};
|
41
|
+
import { AbstractCursorEvent } from './AbstractCursorEvent';
|
42
|
+
var DragStopEvent = /** @class */ (function (_super) {
|
43
|
+
__extends(DragStopEvent, _super);
|
44
|
+
function DragStopEvent() {
|
45
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
46
|
+
_this.type = 'drag:stop';
|
47
|
+
return _this;
|
48
|
+
}
|
49
|
+
return DragStopEvent;
|
50
|
+
}(AbstractCursorEvent));
|
51
|
+
export { DragStopEvent };
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ICustomEvent } from '@mdesignable/shared';
|
2
|
+
import { AbstractCursorEvent } from './AbstractCursorEvent';
|
3
|
+
export declare class MouseClickEvent extends AbstractCursorEvent implements ICustomEvent {
|
4
|
+
type: string;
|
5
|
+
}
|
6
|
+
export declare class MouseDoubleClickEvent extends AbstractCursorEvent implements ICustomEvent {
|
7
|
+
type: string;
|
8
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
2
|
+
var extendStatics = function (d, b) {
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
6
|
+
return extendStatics(d, b);
|
7
|
+
};
|
8
|
+
return function (d, b) {
|
9
|
+
if (typeof b !== "function" && b !== null)
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
11
|
+
extendStatics(d, b);
|
12
|
+
function __() { this.constructor = d; }
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14
|
+
};
|
15
|
+
})();
|
16
|
+
var __read = (this && this.__read) || function (o, n) {
|
17
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
18
|
+
if (!m) return o;
|
19
|
+
var i = m.call(o), r, ar = [], e;
|
20
|
+
try {
|
21
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
22
|
+
}
|
23
|
+
catch (error) { e = { error: error }; }
|
24
|
+
finally {
|
25
|
+
try {
|
26
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
27
|
+
}
|
28
|
+
finally { if (e) throw e.error; }
|
29
|
+
}
|
30
|
+
return ar;
|
31
|
+
};
|
32
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
33
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
34
|
+
if (ar || !(i in from)) {
|
35
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
36
|
+
ar[i] = from[i];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
40
|
+
};
|
41
|
+
import { AbstractCursorEvent } from './AbstractCursorEvent';
|
42
|
+
var MouseClickEvent = /** @class */ (function (_super) {
|
43
|
+
__extends(MouseClickEvent, _super);
|
44
|
+
function MouseClickEvent() {
|
45
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
46
|
+
_this.type = 'mouse:click';
|
47
|
+
return _this;
|
48
|
+
}
|
49
|
+
return MouseClickEvent;
|
50
|
+
}(AbstractCursorEvent));
|
51
|
+
export { MouseClickEvent };
|
52
|
+
var MouseDoubleClickEvent = /** @class */ (function (_super) {
|
53
|
+
__extends(MouseDoubleClickEvent, _super);
|
54
|
+
function MouseDoubleClickEvent() {
|
55
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
56
|
+
_this.type = 'mouse:dblclick';
|
57
|
+
return _this;
|
58
|
+
}
|
59
|
+
return MouseDoubleClickEvent;
|
60
|
+
}(AbstractCursorEvent));
|
61
|
+
export { MouseDoubleClickEvent };
|
@@ -0,0 +1,51 @@
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
2
|
+
var extendStatics = function (d, b) {
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
6
|
+
return extendStatics(d, b);
|
7
|
+
};
|
8
|
+
return function (d, b) {
|
9
|
+
if (typeof b !== "function" && b !== null)
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
11
|
+
extendStatics(d, b);
|
12
|
+
function __() { this.constructor = d; }
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14
|
+
};
|
15
|
+
})();
|
16
|
+
var __read = (this && this.__read) || function (o, n) {
|
17
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
18
|
+
if (!m) return o;
|
19
|
+
var i = m.call(o), r, ar = [], e;
|
20
|
+
try {
|
21
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
22
|
+
}
|
23
|
+
catch (error) { e = { error: error }; }
|
24
|
+
finally {
|
25
|
+
try {
|
26
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
27
|
+
}
|
28
|
+
finally { if (e) throw e.error; }
|
29
|
+
}
|
30
|
+
return ar;
|
31
|
+
};
|
32
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
33
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
34
|
+
if (ar || !(i in from)) {
|
35
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
36
|
+
ar[i] = from[i];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
40
|
+
};
|
41
|
+
import { AbstractCursorEvent } from './AbstractCursorEvent';
|
42
|
+
var MouseMoveEvent = /** @class */ (function (_super) {
|
43
|
+
__extends(MouseMoveEvent, _super);
|
44
|
+
function MouseMoveEvent() {
|
45
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
46
|
+
_this.type = 'mouse:move';
|
47
|
+
return _this;
|
48
|
+
}
|
49
|
+
return MouseMoveEvent;
|
50
|
+
}(AbstractCursorEvent));
|
51
|
+
export { MouseMoveEvent };
|