@asyra/core 0.2.0
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/.turbo/turbo-test$colon$ci.log +132 -0
- package/.turbo/turbo-test$colon$local.log +30 -0
- package/.turbo/turbo-test.log +0 -0
- package/README.md +1 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +991 -0
- package/coverage/coverage-final.json +14952 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +236 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/src/apis/element-selection.ts.html +133 -0
- package/coverage/src/apis/index.html +266 -0
- package/coverage/src/apis/index.ts.html +175 -0
- package/coverage/src/apis/input-system.ts.html +121 -0
- package/coverage/src/apis/interaction-core.ts.html +190 -0
- package/coverage/src/apis/props.ts.html +124 -0
- package/coverage/src/apis/render.ts.html +130 -0
- package/coverage/src/apis/scene-tree.ts.html +292 -0
- package/coverage/src/apis/system-context.ts.html +154 -0
- package/coverage/src/apis/transaction.ts.html +124 -0
- package/coverage/src/apis/undo.ts.html +124 -0
- package/coverage/src/apis/viewport.ts.html +193 -0
- package/coverage/src/combinations.ts.html +223 -0
- package/coverage/src/core.ts.html +559 -0
- package/coverage/src/index.html +146 -0
- package/coverage/src/index.ts.html +97 -0
- package/coverage/src/requests/factory.ts.html +127 -0
- package/coverage/src/requests/index.html +206 -0
- package/coverage/src/requests/index.ts.html +154 -0
- package/coverage/src/requests/props.ts.html +133 -0
- package/coverage/src/requests/render.ts.html +187 -0
- package/coverage/src/requests/scene-tree.ts.html +163 -0
- package/coverage/src/requests/selection.ts.html +127 -0
- package/coverage/src/requests/system-context.ts.html +130 -0
- package/coverage/src/subscribes/index.html +116 -0
- package/coverage/src/subscribes/index.ts.html +109 -0
- package/coverage/src/subscribes/input-system/index.html +176 -0
- package/coverage/src/subscribes/input-system/index.ts.html +226 -0
- package/coverage/src/subscribes/input-system/primary-tool.ts.html +160 -0
- package/coverage/src/subscribes/input-system/render.ts.html +484 -0
- package/coverage/src/subscribes/input-system/undo.ts.html +172 -0
- package/coverage/src/subscribes/input-system/viewport.ts.html +259 -0
- package/coverage/src/subscribes/interaction-core/create-element.ts.html +151 -0
- package/coverage/src/subscribes/interaction-core/index.html +236 -0
- package/coverage/src/subscribes/interaction-core/index.ts.html +289 -0
- package/coverage/src/subscribes/interaction-core/primary-tool.ts.html +109 -0
- package/coverage/src/subscribes/interaction-core/reset-element-size.ts.html +127 -0
- package/coverage/src/subscribes/interaction-core/resize-element.ts.html +181 -0
- package/coverage/src/subscribes/interaction-core/select-elements.ts.html +109 -0
- package/coverage/src/subscribes/interaction-core/transaction.ts.html +130 -0
- package/coverage/src/subscribes/interaction-core/undoredo.ts.html +133 -0
- package/coverage/src/subscribes/interaction-core/viewport.ts.html +193 -0
- package/coverage/src/types/deps.ts.html +118 -0
- package/coverage/src/types/element-selection.ts.html +100 -0
- package/coverage/src/types/index.html +266 -0
- package/coverage/src/types/index.ts.html +385 -0
- package/coverage/src/types/input-system.ts.html +100 -0
- package/coverage/src/types/interaction-core.ts.html +127 -0
- package/coverage/src/types/props.ts.html +109 -0
- package/coverage/src/types/render.ts.html +106 -0
- package/coverage/src/types/requests/factory.ts.html +127 -0
- package/coverage/src/types/requests/index.html +206 -0
- package/coverage/src/types/requests/index.ts.html +214 -0
- package/coverage/src/types/requests/props.ts.html +133 -0
- package/coverage/src/types/requests/render.ts.html +139 -0
- package/coverage/src/types/requests/scene-tree.ts.html +133 -0
- package/coverage/src/types/requests/selection.ts.html +127 -0
- package/coverage/src/types/requests/system-context.ts.html +142 -0
- package/coverage/src/types/scene-tree.ts.html +178 -0
- package/coverage/src/types/system-context/index.html +161 -0
- package/coverage/src/types/system-context/index.ts.html +112 -0
- package/coverage/src/types/system-context/key-state.ts.html +106 -0
- package/coverage/src/types/system-context/mouse-state.ts.html +106 -0
- package/coverage/src/types/system-context/primary-tool.ts.html +112 -0
- package/coverage/src/types/transaction.ts.html +103 -0
- package/coverage/src/types/undo.ts.html +103 -0
- package/coverage/src/types/viewport.ts.html +127 -0
- package/dist/__tests__/core.test.d.ts +2 -0
- package/dist/__tests__/core.test.d.ts.map +1 -0
- package/dist/__tests__/core.test.js +122 -0
- package/dist/__tests__/core.test.js.map +1 -0
- package/dist/apis/element-selection.d.ts +3 -0
- package/dist/apis/element-selection.d.ts.map +1 -0
- package/dist/apis/element-selection.js +11 -0
- package/dist/apis/element-selection.js.map +1 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.d.ts.map +1 -0
- package/dist/apis/index.js +25 -0
- package/dist/apis/index.js.map +1 -0
- package/dist/apis/input-system.d.ts +3 -0
- package/dist/apis/input-system.d.ts.map +1 -0
- package/dist/apis/input-system.js +11 -0
- package/dist/apis/input-system.js.map +1 -0
- package/dist/apis/interaction-core.d.ts +3 -0
- package/dist/apis/interaction-core.d.ts.map +1 -0
- package/dist/apis/interaction-core.js +22 -0
- package/dist/apis/interaction-core.js.map +1 -0
- package/dist/apis/props.d.ts +3 -0
- package/dist/apis/props.d.ts.map +1 -0
- package/dist/apis/props.js +11 -0
- package/dist/apis/props.js.map +1 -0
- package/dist/apis/render.d.ts +3 -0
- package/dist/apis/render.d.ts.map +1 -0
- package/dist/apis/render.js +12 -0
- package/dist/apis/render.js.map +1 -0
- package/dist/apis/scene-tree.d.ts +3 -0
- package/dist/apis/scene-tree.d.ts.map +1 -0
- package/dist/apis/scene-tree.js +39 -0
- package/dist/apis/scene-tree.js.map +1 -0
- package/dist/apis/system-context.d.ts +3 -0
- package/dist/apis/system-context.d.ts.map +1 -0
- package/dist/apis/system-context.js +16 -0
- package/dist/apis/system-context.js.map +1 -0
- package/dist/apis/transaction.d.ts +3 -0
- package/dist/apis/transaction.d.ts.map +1 -0
- package/dist/apis/transaction.js +12 -0
- package/dist/apis/transaction.js.map +1 -0
- package/dist/apis/undo.d.ts +3 -0
- package/dist/apis/undo.d.ts.map +1 -0
- package/dist/apis/undo.js +12 -0
- package/dist/apis/undo.js.map +1 -0
- package/dist/apis/viewport.d.ts +4 -0
- package/dist/apis/viewport.d.ts.map +1 -0
- package/dist/apis/viewport.js +27 -0
- package/dist/apis/viewport.js.map +1 -0
- package/dist/combinations.d.ts +4 -0
- package/dist/combinations.d.ts.map +1 -0
- package/dist/combinations.js +42 -0
- package/dist/combinations.js.map +1 -0
- package/dist/core.d.ts +68 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +76 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/requests/factory copy.d.ts +7 -0
- package/dist/requests/factory copy.d.ts.map +1 -0
- package/dist/requests/factory copy.js +10 -0
- package/dist/requests/factory copy.js.map +1 -0
- package/dist/requests/factory.d.ts +7 -0
- package/dist/requests/factory.d.ts.map +1 -0
- package/dist/requests/factory.js +10 -0
- package/dist/requests/factory.js.map +1 -0
- package/dist/requests/index.d.ts +3 -0
- package/dist/requests/index.d.ts.map +1 -0
- package/dist/requests/index.js +21 -0
- package/dist/requests/index.js.map +1 -0
- package/dist/requests/primary-tool.d.ts +7 -0
- package/dist/requests/primary-tool.d.ts.map +1 -0
- package/dist/requests/primary-tool.js +13 -0
- package/dist/requests/primary-tool.js.map +1 -0
- package/dist/requests/props copy.d.ts +7 -0
- package/dist/requests/props copy.d.ts.map +1 -0
- package/dist/requests/props copy.js +13 -0
- package/dist/requests/props copy.js.map +1 -0
- package/dist/requests/props.d.ts +7 -0
- package/dist/requests/props.d.ts.map +1 -0
- package/dist/requests/props.js +13 -0
- package/dist/requests/props.js.map +1 -0
- package/dist/requests/render.d.ts +3 -0
- package/dist/requests/render.d.ts.map +1 -0
- package/dist/requests/render.js +22 -0
- package/dist/requests/render.js.map +1 -0
- package/dist/requests/scene-tree.d.ts +7 -0
- package/dist/requests/scene-tree.d.ts.map +1 -0
- package/dist/requests/scene-tree.js +17 -0
- package/dist/requests/scene-tree.js.map +1 -0
- package/dist/requests/selection.d.ts +7 -0
- package/dist/requests/selection.d.ts.map +1 -0
- package/dist/requests/selection.js +10 -0
- package/dist/requests/selection.js.map +1 -0
- package/dist/requests/system-context copy.d.ts +7 -0
- package/dist/requests/system-context copy.d.ts.map +1 -0
- package/dist/requests/system-context copy.js +19 -0
- package/dist/requests/system-context copy.js.map +1 -0
- package/dist/requests/system-context.d.ts +7 -0
- package/dist/requests/system-context.d.ts.map +1 -0
- package/dist/requests/system-context.js +10 -0
- package/dist/requests/system-context.js.map +1 -0
- package/dist/requests/types.d.ts +7 -0
- package/dist/requests/types.d.ts.map +1 -0
- package/dist/requests/types.js +4 -0
- package/dist/requests/types.js.map +1 -0
- package/dist/requests/viewport.d.ts +19 -0
- package/dist/requests/viewport.d.ts.map +1 -0
- package/dist/requests/viewport.js +6 -0
- package/dist/requests/viewport.js.map +1 -0
- package/dist/subscribes/index.d.ts +3 -0
- package/dist/subscribes/index.d.ts.map +1 -0
- package/dist/subscribes/index.js +7 -0
- package/dist/subscribes/index.js.map +1 -0
- package/dist/subscribes/input-system/index.d.ts +3 -0
- package/dist/subscribes/input-system/index.d.ts.map +1 -0
- package/dist/subscribes/input-system/index.js +26 -0
- package/dist/subscribes/input-system/index.js.map +1 -0
- package/dist/subscribes/input-system/primary-tool.d.ts +10 -0
- package/dist/subscribes/input-system/primary-tool.d.ts.map +1 -0
- package/dist/subscribes/input-system/primary-tool.js +15 -0
- package/dist/subscribes/input-system/primary-tool.js.map +1 -0
- package/dist/subscribes/input-system/render.d.ts +16 -0
- package/dist/subscribes/input-system/render.d.ts.map +1 -0
- package/dist/subscribes/input-system/render.js +97 -0
- package/dist/subscribes/input-system/render.js.map +1 -0
- package/dist/subscribes/input-system/undo.d.ts +10 -0
- package/dist/subscribes/input-system/undo.d.ts.map +1 -0
- package/dist/subscribes/input-system/undo.js +18 -0
- package/dist/subscribes/input-system/undo.js.map +1 -0
- package/dist/subscribes/input-system/viewport.d.ts +11 -0
- package/dist/subscribes/input-system/viewport.d.ts.map +1 -0
- package/dist/subscribes/input-system/viewport.js +36 -0
- package/dist/subscribes/input-system/viewport.js.map +1 -0
- package/dist/subscribes/interaction-core/create-and-resize.d.ts +5 -0
- package/dist/subscribes/interaction-core/create-and-resize.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/create-and-resize.js +86 -0
- package/dist/subscribes/interaction-core/create-and-resize.js.map +1 -0
- package/dist/subscribes/interaction-core/create-element copy.d.ts +3 -0
- package/dist/subscribes/interaction-core/create-element copy.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/create-element copy.js +17 -0
- package/dist/subscribes/interaction-core/create-element copy.js.map +1 -0
- package/dist/subscribes/interaction-core/create-element.d.ts +3 -0
- package/dist/subscribes/interaction-core/create-element.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/create-element.js +17 -0
- package/dist/subscribes/interaction-core/create-element.js.map +1 -0
- package/dist/subscribes/interaction-core/index.d.ts +3 -0
- package/dist/subscribes/interaction-core/index.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/index.js +42 -0
- package/dist/subscribes/interaction-core/index.js.map +1 -0
- package/dist/subscribes/interaction-core/input-to-decision.d.ts +5 -0
- package/dist/subscribes/interaction-core/input-to-decision.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/input-to-decision.js +48 -0
- package/dist/subscribes/interaction-core/input-to-decision.js.map +1 -0
- package/dist/subscribes/interaction-core/primary-tool.d.ts +3 -0
- package/dist/subscribes/interaction-core/primary-tool.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/primary-tool.js +7 -0
- package/dist/subscribes/interaction-core/primary-tool.js.map +1 -0
- package/dist/subscribes/interaction-core/reset-element-size.d.ts +5 -0
- package/dist/subscribes/interaction-core/reset-element-size.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/reset-element-size.js +9 -0
- package/dist/subscribes/interaction-core/reset-element-size.js.map +1 -0
- package/dist/subscribes/interaction-core/resize-element.d.ts +3 -0
- package/dist/subscribes/interaction-core/resize-element.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/resize-element.js +25 -0
- package/dist/subscribes/interaction-core/resize-element.js.map +1 -0
- package/dist/subscribes/interaction-core/select-elements.d.ts +3 -0
- package/dist/subscribes/interaction-core/select-elements.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/select-elements.js +7 -0
- package/dist/subscribes/interaction-core/select-elements.js.map +1 -0
- package/dist/subscribes/interaction-core/transaction.d.ts +3 -0
- package/dist/subscribes/interaction-core/transaction.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/transaction.js +10 -0
- package/dist/subscribes/interaction-core/transaction.js.map +1 -0
- package/dist/subscribes/interaction-core/undoredo.d.ts +3 -0
- package/dist/subscribes/interaction-core/undoredo.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/undoredo.js +15 -0
- package/dist/subscribes/interaction-core/undoredo.js.map +1 -0
- package/dist/subscribes/interaction-core/viewport.d.ts +3 -0
- package/dist/subscribes/interaction-core/viewport.d.ts.map +1 -0
- package/dist/subscribes/interaction-core/viewport.js +29 -0
- package/dist/subscribes/interaction-core/viewport.js.map +1 -0
- package/dist/subscribes/render.d.ts +6 -0
- package/dist/subscribes/render.d.ts.map +1 -0
- package/dist/subscribes/render.js +28 -0
- package/dist/subscribes/render.js.map +1 -0
- package/dist/types/deps.d.ts +11 -0
- package/dist/types/deps.d.ts.map +1 -0
- package/dist/types/deps.js +2 -0
- package/dist/types/deps.js.map +1 -0
- package/dist/types/element-selection.d.ts +5 -0
- package/dist/types/element-selection.d.ts.map +1 -0
- package/dist/types/element-selection.js +2 -0
- package/dist/types/element-selection.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/input-system.d.ts +5 -0
- package/dist/types/input-system.d.ts.map +1 -0
- package/dist/types/input-system.js +2 -0
- package/dist/types/input-system.js.map +1 -0
- package/dist/types/interaction-core.d.ts +11 -0
- package/dist/types/interaction-core.d.ts.map +1 -0
- package/dist/types/interaction-core.js +2 -0
- package/dist/types/interaction-core.js.map +1 -0
- package/dist/types/props.d.ts +7 -0
- package/dist/types/props.d.ts.map +1 -0
- package/dist/types/props.js +2 -0
- package/dist/types/props.js.map +1 -0
- package/dist/types/render.d.ts +6 -0
- package/dist/types/render.d.ts.map +1 -0
- package/dist/types/render.js +2 -0
- package/dist/types/render.js.map +1 -0
- package/dist/types/requests/factory copy.d.ts +12 -0
- package/dist/types/requests/factory copy.d.ts.map +1 -0
- package/dist/types/requests/factory copy.js +2 -0
- package/dist/types/requests/factory copy.js.map +1 -0
- package/dist/types/requests/factory.d.ts +12 -0
- package/dist/types/requests/factory.d.ts.map +1 -0
- package/dist/types/requests/factory.js +2 -0
- package/dist/types/requests/factory.js.map +1 -0
- package/dist/types/requests/index.d.ts +17 -0
- package/dist/types/requests/index.d.ts.map +1 -0
- package/dist/types/requests/index.js +4 -0
- package/dist/types/requests/index.js.map +1 -0
- package/dist/types/requests/primary-tool.d.ts +13 -0
- package/dist/types/requests/primary-tool.d.ts.map +1 -0
- package/dist/types/requests/primary-tool.js +2 -0
- package/dist/types/requests/primary-tool.js.map +1 -0
- package/dist/types/requests/props copy.d.ts +14 -0
- package/dist/types/requests/props copy.d.ts.map +1 -0
- package/dist/types/requests/props copy.js +2 -0
- package/dist/types/requests/props copy.js.map +1 -0
- package/dist/types/requests/props.d.ts +14 -0
- package/dist/types/requests/props.d.ts.map +1 -0
- package/dist/types/requests/props.js +2 -0
- package/dist/types/requests/props.js.map +1 -0
- package/dist/types/requests/render.d.ts +15 -0
- package/dist/types/requests/render.d.ts.map +1 -0
- package/dist/types/requests/render.js +2 -0
- package/dist/types/requests/render.js.map +1 -0
- package/dist/types/requests/scene-tree.d.ts +14 -0
- package/dist/types/requests/scene-tree.d.ts.map +1 -0
- package/dist/types/requests/scene-tree.js +2 -0
- package/dist/types/requests/scene-tree.js.map +1 -0
- package/dist/types/requests/selection.d.ts +12 -0
- package/dist/types/requests/selection.d.ts.map +1 -0
- package/dist/types/requests/selection.js +2 -0
- package/dist/types/requests/selection.js.map +1 -0
- package/dist/types/requests/system-context.d.ts +17 -0
- package/dist/types/requests/system-context.d.ts.map +1 -0
- package/dist/types/requests/system-context.js +2 -0
- package/dist/types/requests/system-context.js.map +1 -0
- package/dist/types/requests/system.d.ts +13 -0
- package/dist/types/requests/system.d.ts.map +1 -0
- package/dist/types/requests/system.js +2 -0
- package/dist/types/requests/system.js.map +1 -0
- package/dist/types/requests/viewport.d.ts +20 -0
- package/dist/types/requests/viewport.d.ts.map +1 -0
- package/dist/types/requests/viewport.js +6 -0
- package/dist/types/requests/viewport.js.map +1 -0
- package/dist/types/requests.d.ts +8 -0
- package/dist/types/requests.d.ts.map +1 -0
- package/dist/types/requests.js +2 -0
- package/dist/types/requests.js.map +1 -0
- package/dist/types/scene-tree.d.ts +15 -0
- package/dist/types/scene-tree.d.ts.map +1 -0
- package/dist/types/scene-tree.js +2 -0
- package/dist/types/scene-tree.js.map +1 -0
- package/dist/types/system-context/index.d.ts +8 -0
- package/dist/types/system-context/index.d.ts.map +1 -0
- package/dist/types/system-context/index.js +4 -0
- package/dist/types/system-context/index.js.map +1 -0
- package/dist/types/system-context/key-state.d.ts +6 -0
- package/dist/types/system-context/key-state.d.ts.map +1 -0
- package/dist/types/system-context/key-state.js +2 -0
- package/dist/types/system-context/key-state.js.map +1 -0
- package/dist/types/system-context/mouse-state.d.ts +6 -0
- package/dist/types/system-context/mouse-state.d.ts.map +1 -0
- package/dist/types/system-context/mouse-state.js +2 -0
- package/dist/types/system-context/mouse-state.js.map +1 -0
- package/dist/types/system-context/primary-tool.d.ts +8 -0
- package/dist/types/system-context/primary-tool.d.ts.map +1 -0
- package/dist/types/system-context/primary-tool.js +2 -0
- package/dist/types/system-context/primary-tool.js.map +1 -0
- package/dist/types/transaction.d.ts +6 -0
- package/dist/types/transaction.d.ts.map +1 -0
- package/dist/types/transaction.js +2 -0
- package/dist/types/transaction.js.map +1 -0
- package/dist/types/undo.d.ts +6 -0
- package/dist/types/undo.d.ts.map +1 -0
- package/dist/types/undo.js +2 -0
- package/dist/types/undo.js.map +1 -0
- package/dist/types/viewport.d.ts +12 -0
- package/dist/types/viewport.d.ts.map +1 -0
- package/dist/types/viewport.js +2 -0
- package/dist/types/viewport.js.map +1 -0
- package/package.json +37 -0
- package/src/__tests__/core.test.ts +153 -0
- package/src/apis/element-selection.ts +16 -0
- package/src/apis/index.ts +30 -0
- package/src/apis/input-system.ts +12 -0
- package/src/apis/interaction-core.ts +35 -0
- package/src/apis/props.ts +13 -0
- package/src/apis/render.ts +15 -0
- package/src/apis/scene-tree.ts +69 -0
- package/src/apis/system-context.ts +23 -0
- package/src/apis/transaction.ts +13 -0
- package/src/apis/undo.ts +13 -0
- package/src/apis/viewport.ts +36 -0
- package/src/combinations.ts +46 -0
- package/src/core.ts +158 -0
- package/src/index.ts +4 -0
- package/src/requests/factory.ts +14 -0
- package/src/requests/index.ts +23 -0
- package/src/requests/props.ts +16 -0
- package/src/requests/render.ts +34 -0
- package/src/requests/scene-tree.ts +26 -0
- package/src/requests/selection.ts +14 -0
- package/src/requests/system-context.ts +15 -0
- package/src/subscribes/index.ts +8 -0
- package/src/subscribes/input-system/index.ts +47 -0
- package/src/subscribes/input-system/primary-tool.ts +25 -0
- package/src/subscribes/input-system/render.ts +133 -0
- package/src/subscribes/input-system/undo.ts +29 -0
- package/src/subscribes/input-system/viewport.ts +58 -0
- package/src/subscribes/interaction-core/create-element.ts +22 -0
- package/src/subscribes/interaction-core/index.ts +68 -0
- package/src/subscribes/interaction-core/primary-tool.ts +8 -0
- package/src/subscribes/interaction-core/reset-element-size.ts +12 -0
- package/src/subscribes/interaction-core/resize-element.ts +31 -0
- package/src/subscribes/interaction-core/select-elements.ts +8 -0
- package/src/subscribes/interaction-core/transaction.ts +15 -0
- package/src/subscribes/interaction-core/undoredo.ts +16 -0
- package/src/subscribes/interaction-core/viewport.ts +35 -0
- package/src/types/deps.ts +11 -0
- package/src/types/element-selection.ts +5 -0
- package/src/types/index.ts +100 -0
- package/src/types/input-system.ts +5 -0
- package/src/types/interaction-core.ts +14 -0
- package/src/types/props.ts +8 -0
- package/src/types/render.ts +7 -0
- package/src/types/requests/factory.ts +14 -0
- package/src/types/requests/index.ts +43 -0
- package/src/types/requests/props.ts +16 -0
- package/src/types/requests/render.ts +18 -0
- package/src/types/requests/scene-tree.ts +16 -0
- package/src/types/requests/selection.ts +14 -0
- package/src/types/requests/system-context.ts +19 -0
- package/src/types/scene-tree.ts +31 -0
- package/src/types/system-context/index.ts +9 -0
- package/src/types/system-context/key-state.ts +7 -0
- package/src/types/system-context/mouse-state.ts +7 -0
- package/src/types/system-context/primary-tool.ts +9 -0
- package/src/types/transaction.ts +6 -0
- package/src/types/undo.ts +6 -0
- package/src/types/viewport.ts +14 -0
- package/test-setup.ts +6 -0
- package/tsconfig.json +22 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputSystemEvents } from '@asyra/utils';
|
|
2
|
+
export class PrimaryToolHandler {
|
|
3
|
+
constructor(inputSystem, deps) {
|
|
4
|
+
this.inputSystem = inputSystem;
|
|
5
|
+
this.deps = deps;
|
|
6
|
+
this._handleSwitchPrimaryTool = (raw) => {
|
|
7
|
+
this.deps.executeAction(InputSystemEvents.INPUT_SHORTCUT_SWITCH_PRIMARY_TOOL, raw.detail);
|
|
8
|
+
};
|
|
9
|
+
this.init();
|
|
10
|
+
}
|
|
11
|
+
init() {
|
|
12
|
+
this.inputSystem.on(InputSystemEvents.INPUT_SHORTCUT_SWITCH_PRIMARY_TOOL, this._handleSwitchPrimaryTool);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=primary-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primary-tool.js","sourceRoot":"","sources":["../../../src/subscribes/input-system/primary-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,cAAc,CAAA;AAG/D,MAAM,OAAO,kBAAkB;IAC7B,YACU,WAAuC,EACvC,IAA+B;QAD/B,gBAAW,GAAX,WAAW,CAA4B;QACvC,SAAI,GAAJ,IAAI,CAA2B;QAYzC,6BAAwB,GAAG,CAAC,GAAkB,EAAE,EAAE;YAChD,IAAI,CAAC,IAAI,CAAC,aAAa,CACrB,iBAAiB,CAAC,kCAAkC,EACpD,GAAG,CAAC,MAAM,CACX,CAAA;QACH,CAAC,CAAA;QAfC,IAAI,CAAC,IAAI,EAAE,CAAA;IACb,CAAC;IAED,IAAI;QACF,IAAI,CAAC,WAAW,CAAC,EAAE,CACjB,iBAAiB,CAAC,kCAAkC,EACpD,IAAI,CAAC,wBAAwB,CAC9B,CAAA;IACH,CAAC;CAQF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RawInputEvent } from '@asyra/utils';
|
|
2
|
+
import { HandlerDeps, MouseStateAPIs, KeyStateAPIs, InteractionCoreSessionAPIs } from '../../types';
|
|
3
|
+
export declare class RenderHandler {
|
|
4
|
+
private inputSystem;
|
|
5
|
+
private deps;
|
|
6
|
+
private _isDown;
|
|
7
|
+
private _isDrag;
|
|
8
|
+
private _startPos;
|
|
9
|
+
private _endPos;
|
|
10
|
+
constructor(inputSystem: HandlerDeps['inputSystem'], deps: MouseStateAPIs & InteractionCoreSessionAPIs & KeyStateAPIs);
|
|
11
|
+
init(): void;
|
|
12
|
+
_handleDragStart: (raw: RawInputEvent) => void;
|
|
13
|
+
_handleDragUpdate: (raw: RawInputEvent) => void;
|
|
14
|
+
_handleDragEnd: (raw: RawInputEvent) => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/subscribes/input-system/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAEd,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,0BAA0B,EAC3B,MAAM,aAAa,CAAA;AAEpB,qBAAa,aAAa;IAOtB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,IAAI;IAPd,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,OAAO,CAAW;gBAGhB,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,EACvC,IAAI,EAAE,cAAc,GAAG,0BAA0B,GAAG,YAAY;IAgB1E,IAAI;IAYJ,gBAAgB,GAAI,KAAK,aAAa,UA4BrC;IAED,iBAAiB,GAAI,KAAK,aAAa,UA0BtC;IAED,cAAc,GAAU,KAAK,aAAa,mBAuBzC;CACF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { InputSystemEvents } from '@asyra/utils';
|
|
2
|
+
export class RenderHandler {
|
|
3
|
+
constructor(inputSystem, deps) {
|
|
4
|
+
this.inputSystem = inputSystem;
|
|
5
|
+
this.deps = deps;
|
|
6
|
+
this._handleDragStart = (raw) => {
|
|
7
|
+
const { clientX, clientY, button } = raw.pointer;
|
|
8
|
+
this._isDown = true;
|
|
9
|
+
this._isDrag = false;
|
|
10
|
+
this._startPos = { clientX, clientY };
|
|
11
|
+
this.deps.updateMouseState({
|
|
12
|
+
dragStart: {
|
|
13
|
+
x: clientX,
|
|
14
|
+
y: clientY
|
|
15
|
+
},
|
|
16
|
+
position: {
|
|
17
|
+
x: clientX,
|
|
18
|
+
y: clientY
|
|
19
|
+
},
|
|
20
|
+
delta: {
|
|
21
|
+
x: 0,
|
|
22
|
+
y: 0
|
|
23
|
+
},
|
|
24
|
+
down: this._isDown,
|
|
25
|
+
button: button,
|
|
26
|
+
dragging: this._isDrag
|
|
27
|
+
});
|
|
28
|
+
this.deps.updateKeyState({
|
|
29
|
+
...raw.modifiers
|
|
30
|
+
});
|
|
31
|
+
this.deps.startSession(InputSystemEvents.INPUT_DRAG_START);
|
|
32
|
+
};
|
|
33
|
+
this._handleDragUpdate = (raw) => {
|
|
34
|
+
const { clientX, clientY, button } = raw.pointer;
|
|
35
|
+
this._isDrag = true;
|
|
36
|
+
this._endPos = {
|
|
37
|
+
clientX,
|
|
38
|
+
clientY
|
|
39
|
+
};
|
|
40
|
+
this.deps.updateMouseState({
|
|
41
|
+
position: {
|
|
42
|
+
x: clientX,
|
|
43
|
+
y: clientY
|
|
44
|
+
},
|
|
45
|
+
delta: {
|
|
46
|
+
x: clientX - this._startPos.clientX,
|
|
47
|
+
y: clientY - this._startPos.clientY
|
|
48
|
+
},
|
|
49
|
+
down: true,
|
|
50
|
+
button: button,
|
|
51
|
+
dragging: this._isDrag
|
|
52
|
+
});
|
|
53
|
+
this.deps.updateKeyState({
|
|
54
|
+
...raw.modifiers
|
|
55
|
+
});
|
|
56
|
+
this.deps.updateSession(InputSystemEvents.INPUT_DRAG_UPDATE);
|
|
57
|
+
};
|
|
58
|
+
this._handleDragEnd = async (raw) => {
|
|
59
|
+
const { clientX, clientY, button } = raw.pointer;
|
|
60
|
+
this.deps.updateMouseState({
|
|
61
|
+
position: {
|
|
62
|
+
x: clientX,
|
|
63
|
+
y: clientY
|
|
64
|
+
},
|
|
65
|
+
delta: {
|
|
66
|
+
x: clientX - this._startPos.clientX,
|
|
67
|
+
y: clientY - this._startPos.clientY
|
|
68
|
+
},
|
|
69
|
+
button: button,
|
|
70
|
+
down: this._isDown,
|
|
71
|
+
dragging: this._isDrag
|
|
72
|
+
});
|
|
73
|
+
this.deps.updateKeyState({
|
|
74
|
+
...raw.modifiers
|
|
75
|
+
});
|
|
76
|
+
this.deps.endSession(InputSystemEvents.INPUT_DRAG_END);
|
|
77
|
+
this._isDown = false;
|
|
78
|
+
};
|
|
79
|
+
this._isDown = false;
|
|
80
|
+
this._isDrag = false;
|
|
81
|
+
this._startPos = {
|
|
82
|
+
clientX: 0,
|
|
83
|
+
clientY: 0
|
|
84
|
+
};
|
|
85
|
+
this._endPos = {
|
|
86
|
+
clientX: 0,
|
|
87
|
+
clientY: 0
|
|
88
|
+
};
|
|
89
|
+
this.init();
|
|
90
|
+
}
|
|
91
|
+
init() {
|
|
92
|
+
this.inputSystem.on(InputSystemEvents.INPUT_DRAG_START, this._handleDragStart);
|
|
93
|
+
this.inputSystem.on(InputSystemEvents.INPUT_DRAG_UPDATE, this._handleDragUpdate);
|
|
94
|
+
this.inputSystem.on(InputSystemEvents.INPUT_DRAG_END, this._handleDragEnd);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../src/subscribes/input-system/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EAClB,MAAM,cAAc,CAAA;AAQrB,MAAM,OAAO,aAAa;IAMxB,YACU,WAAuC,EACvC,IAAgE;QADhE,gBAAW,GAAX,WAAW,CAA4B;QACvC,SAAI,GAAJ,IAAI,CAA4D;QA4B1E,qBAAgB,GAAG,CAAC,GAAkB,EAAE,EAAE;YACxC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,OAA2B,CAAA;YACpE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;YACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;YACpB,IAAI,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;YAErC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;gBACzB,SAAS,EAAE;oBACT,CAAC,EAAE,OAAO;oBACV,CAAC,EAAE,OAAO;iBACX;gBACD,QAAQ,EAAE;oBACR,CAAC,EAAE,OAAO;oBACV,CAAC,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,CAAC,WAAW,CAAC,EAAE,CAAC,iBAAiB,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAC5E,CAAC;CAoFF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RawInputEvent } from '@asyra/utils';
|
|
2
|
+
import { HandlerDeps, InteractionCoreActionAPIs, KeyStateAPIs } from '../../types';
|
|
3
|
+
export declare class UndoHandler {
|
|
4
|
+
private inputSystem;
|
|
5
|
+
private deps;
|
|
6
|
+
constructor(inputSystem: HandlerDeps['inputSystem'], deps: InteractionCoreActionAPIs & KeyStateAPIs);
|
|
7
|
+
init(): void;
|
|
8
|
+
_handleUndoRedo: (raw: RawInputEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=undo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../src/subscribes/input-system/undo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,aAAa,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,YAAY,EACb,MAAM,aAAa,CAAA;AAEpB,qBAAa,WAAW;IAEpB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,IAAI;gBADJ,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,EACvC,IAAI,EAAE,yBAAyB,GAAG,YAAY;IAKxD,IAAI;IAOJ,eAAe,GAAI,KAAK,aAAa,UAKpC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InputSystemEvents } from '@asyra/utils';
|
|
2
|
+
export class UndoHandler {
|
|
3
|
+
constructor(inputSystem, deps) {
|
|
4
|
+
this.inputSystem = inputSystem;
|
|
5
|
+
this.deps = deps;
|
|
6
|
+
this._handleUndoRedo = (raw) => {
|
|
7
|
+
this.deps.updateKeyState({
|
|
8
|
+
...raw.modifiers
|
|
9
|
+
});
|
|
10
|
+
this.deps.executeAction(InputSystemEvents.INPUT_SHORTCUT_UNDOREDO);
|
|
11
|
+
};
|
|
12
|
+
this.init();
|
|
13
|
+
}
|
|
14
|
+
init() {
|
|
15
|
+
this.inputSystem.on(InputSystemEvents.INPUT_SHORTCUT_UNDOREDO, this._handleUndoRedo);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=undo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undo.js","sourceRoot":"","sources":["../../../src/subscribes/input-system/undo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,cAAc,CAAA;AAO7E,MAAM,OAAO,WAAW;IACtB,YACU,WAAuC,EACvC,IAA8C;QAD9C,gBAAW,GAAX,WAAW,CAA4B;QACvC,SAAI,GAAJ,IAAI,CAA0C;QAYxD,oBAAe,GAAG,CAAC,GAAkB,EAAE,EAAE;YACvC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;gBACvB,GAAI,GAAG,CAAC,SAA0B;aACnC,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAA;QACpE,CAAC,CAAA;QAfC,IAAI,CAAC,IAAI,EAAE,CAAA;IACb,CAAC;IAED,IAAI;QACF,IAAI,CAAC,WAAW,CAAC,EAAE,CACjB,iBAAiB,CAAC,uBAAuB,EACzC,IAAI,CAAC,eAAe,CACrB,CAAA;IACH,CAAC;CAQF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RawInputEvent } from '@asyra/utils';
|
|
2
|
+
import { HandlerDeps, InteractionCoreActionAPIs, KeyStateAPIs, MouseStateAPIs } from '../../types';
|
|
3
|
+
export declare class ViewportHandler {
|
|
4
|
+
private inputSystem;
|
|
5
|
+
private deps;
|
|
6
|
+
constructor(inputSystem: HandlerDeps['inputSystem'], deps: InteractionCoreActionAPIs & MouseStateAPIs & KeyStateAPIs);
|
|
7
|
+
init(): void;
|
|
8
|
+
_handleZoomFit: () => void;
|
|
9
|
+
_handleWheelScroll: (raw: RawInputEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../../src/subscribes/input-system/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACd,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,YAAY,EACZ,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,qBAAa,eAAe;IAExB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,IAAI;gBADJ,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,EACvC,IAAI,EAAE,yBAAyB,GAAG,cAAc,GAAG,YAAY;IAKzE,IAAI;IAWJ,cAAc,aAEb;IAED,kBAAkB,GAAI,KAAK,aAAa,UAoBvC;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { InputSystemEvents } from '@asyra/utils';
|
|
2
|
+
export class ViewportHandler {
|
|
3
|
+
constructor(inputSystem, deps) {
|
|
4
|
+
this.inputSystem = inputSystem;
|
|
5
|
+
this.deps = deps;
|
|
6
|
+
this._handleZoomFit = () => {
|
|
7
|
+
this.deps.executeAction(InputSystemEvents.INPUT_SHORTCUT_ZOOM_PRESET);
|
|
8
|
+
};
|
|
9
|
+
this._handleWheelScroll = (raw) => {
|
|
10
|
+
const { clientX, clientY, deltaX, deltaY, button } = raw.pointer;
|
|
11
|
+
this.deps.updateMouseState({
|
|
12
|
+
position: {
|
|
13
|
+
x: clientX,
|
|
14
|
+
y: clientY
|
|
15
|
+
},
|
|
16
|
+
delta: {
|
|
17
|
+
x: deltaX,
|
|
18
|
+
y: deltaY
|
|
19
|
+
},
|
|
20
|
+
down: false,
|
|
21
|
+
button: button,
|
|
22
|
+
dragging: false
|
|
23
|
+
});
|
|
24
|
+
this.deps.updateKeyState({
|
|
25
|
+
...raw.modifiers
|
|
26
|
+
});
|
|
27
|
+
this.deps.executeAction(InputSystemEvents.INPUT_WHEEL_SCROLL);
|
|
28
|
+
};
|
|
29
|
+
this.init();
|
|
30
|
+
}
|
|
31
|
+
init() {
|
|
32
|
+
this.inputSystem.on(InputSystemEvents.INPUT_SHORTCUT_ZOOM_PRESET, this._handleZoomFit);
|
|
33
|
+
this.inputSystem.on(InputSystemEvents.INPUT_WHEEL_SCROLL, this._handleWheelScroll);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=viewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.js","sourceRoot":"","sources":["../../../src/subscribes/input-system/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAIlB,MAAM,cAAc,CAAA;AAQrB,MAAM,OAAO,eAAe;IAC1B,YACU,WAAuC,EACvC,IAA+D;QAD/D,gBAAW,GAAX,WAAW,CAA4B;QACvC,SAAI,GAAJ,IAAI,CAA2D;QAgBzE,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,0BAA0B,CAAC,CAAA;QACvE,CAAC,CAAA;QAED,uBAAkB,GAAG,CAAC,GAAkB,EAAE,EAAE;YAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAChD,GAAG,CAAC,OAA2B,CAAA;YACjC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;gBACzB,QAAQ,EAAE;oBACR,CAAC,EAAE,OAAO;oBACV,CAAC,EAAE,OAAO;iBACX;gBACD,KAAK,EAAE;oBACL,CAAC,EAAE,MAAM;oBACT,CAAC,EAAE,MAAM;iBACV;gBACD,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;gBACvB,GAAI,GAAG,CAAC,SAA0B;aACnC,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAA;QAC/D,CAAC,CAAA;QAtCC,IAAI,CAAC,IAAI,EAAE,CAAA;IACb,CAAC;IAED,IAAI;QACF,IAAI,CAAC,WAAW,CAAC,EAAE,CACjB,iBAAiB,CAAC,0BAA0B,EAC5C,IAAI,CAAC,cAAc,CACpB,CAAA;QACD,IAAI,CAAC,WAAW,CAAC,EAAE,CACjB,iBAAiB,CAAC,kBAAkB,EACpC,IAAI,CAAC,kBAAkB,CACxB,CAAA;IACH,CAAC;CA2BF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HandlerDeps, SceneTreeHandlerAPIs } from '../../types';
|
|
2
|
+
export declare const initCreateAndResizeHandlers: (render: HandlerDeps["render"], apis: SceneTreeHandlerAPIs & {
|
|
3
|
+
changeComputedData: (key: string, data: any) => void;
|
|
4
|
+
}) => void;
|
|
5
|
+
//# sourceMappingURL=create-and-resize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-and-resize.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/create-and-resize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAc/D,eAAO,MAAM,2BAA2B,GACtC,QAAQ,WAAW,CAAC,QAAQ,CAAC,EAC7B,MAAM,oBAAoB,GAAG;IAAE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,SAiBtF,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { subscribeToDecideToCreateAndResize } from '@asyra/reactive-events';
|
|
2
|
+
import { PrimaryToolType } from '@asyra/utils';
|
|
3
|
+
// Track the current create-and-resize session
|
|
4
|
+
let currentSession = {
|
|
5
|
+
startPosition: null,
|
|
6
|
+
elementType: null,
|
|
7
|
+
isResizing: false
|
|
8
|
+
};
|
|
9
|
+
export const initCreateAndResizeHandlers = (render, apis) => {
|
|
10
|
+
subscribeToDecideToCreateAndResize(({ payload }) => {
|
|
11
|
+
const { phase, data } = payload;
|
|
12
|
+
switch (phase) {
|
|
13
|
+
case 'start':
|
|
14
|
+
handleCreateAndResizeStart(render, apis, data);
|
|
15
|
+
break;
|
|
16
|
+
case 'update':
|
|
17
|
+
handleCreateAndResizeUpdate(render, apis, data);
|
|
18
|
+
break;
|
|
19
|
+
case 'end':
|
|
20
|
+
handleCreateAndResizeEnd(render, apis, data);
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const handleCreateAndResizeStart = (render, apis, data) => {
|
|
26
|
+
const { position, elementType } = data;
|
|
27
|
+
const pos = render.getMousePosInWorkspace({
|
|
28
|
+
clientX: position.x,
|
|
29
|
+
clientY: position.y
|
|
30
|
+
});
|
|
31
|
+
// Create the element with minimal size initially using the proper API
|
|
32
|
+
switch (elementType) {
|
|
33
|
+
case PrimaryToolType.RECTANGLE:
|
|
34
|
+
const rectangleData = {
|
|
35
|
+
...pos,
|
|
36
|
+
width: 1,
|
|
37
|
+
height: 1
|
|
38
|
+
};
|
|
39
|
+
// Use the normal addRectangle API which handles transactions and selection
|
|
40
|
+
apis.addRectangle(rectangleData);
|
|
41
|
+
// Store session info (element will be automatically selected by addRectangle)
|
|
42
|
+
currentSession = {
|
|
43
|
+
startPosition: pos,
|
|
44
|
+
elementType,
|
|
45
|
+
isResizing: true
|
|
46
|
+
};
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const handleCreateAndResizeUpdate = async (render, apis, data) => {
|
|
51
|
+
if (!currentSession.startPosition || !currentSession.isResizing) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const { currentPosition } = data;
|
|
55
|
+
const pos = render.getMousePosInWorkspace({
|
|
56
|
+
clientX: currentPosition.x,
|
|
57
|
+
clientY: currentPosition.y
|
|
58
|
+
});
|
|
59
|
+
// Calculate new dimensions based on drag
|
|
60
|
+
const width = Math.max(1, Math.abs(pos.x - currentSession.startPosition.x));
|
|
61
|
+
const height = Math.max(1, Math.abs(pos.y - currentSession.startPosition.y));
|
|
62
|
+
// Update element dimensions using the proper API (works on selected elements)
|
|
63
|
+
await apis.changeComputedData('width', width);
|
|
64
|
+
await apis.changeComputedData('height', height);
|
|
65
|
+
// Update position if dragging in negative direction
|
|
66
|
+
const newX = Math.min(pos.x, currentSession.startPosition.x);
|
|
67
|
+
const newY = Math.min(pos.y, currentSession.startPosition.y);
|
|
68
|
+
if (newX !== currentSession.startPosition.x) {
|
|
69
|
+
await apis.changeComputedData('x', newX);
|
|
70
|
+
}
|
|
71
|
+
if (newY !== currentSession.startPosition.y) {
|
|
72
|
+
await apis.changeComputedData('y', newY);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const handleCreateAndResizeEnd = (render, apis, data) => {
|
|
76
|
+
if (!currentSession.isResizing) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// Clear session (no transaction management needed as each API call handles its own)
|
|
80
|
+
currentSession = {
|
|
81
|
+
startPosition: null,
|
|
82
|
+
elementType: null,
|
|
83
|
+
isResizing: false
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=create-and-resize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-and-resize.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/create-and-resize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAA;AAE1E,OAAO,EAAE,eAAe,EAAuB,MAAM,aAAa,CAAA;AAElE,8CAA8C;AAC9C,IAAI,cAAc,GAId;IAC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C,EAAE,CAAC;QAC5C,MAAM,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC;IACD,IAAI,IAAI,KAAK,cAAc,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC;AACH,CAAC,CAAA;AAED,MAAM,wBAAwB,GAAG,CAC/B,MAA6B,EAC7B,IAAqF,EACrF,IAAS,EACT,EAAE;IACF,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QAC/B,OAAM;IACR,CAAC;IAED,oFAAoF;IACpF,cAAc,GAAG;QACf,aAAa,EAAE,IAAI;QACnB,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,KAAK;KAClB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element copy.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/create-element copy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAG/D,eAAO,MAAM,yBAAyB,GACpC,QAAQ,WAAW,CAAC,QAAQ,CAAC,EAC7B,MAAM,oBAAoB,SAe3B,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { subscribeToDecideToCreateElement } from '@asyra/reactive-events';
|
|
2
|
+
import { PrimaryToolType } from '@asyra/utils';
|
|
3
|
+
export const initCreateElementHandlers = (render, apis) => {
|
|
4
|
+
subscribeToDecideToCreateElement(({ payload }) => {
|
|
5
|
+
const { position, elementType } = payload;
|
|
6
|
+
const pos = render.getMousePosInWorkspace({
|
|
7
|
+
clientX: position.x,
|
|
8
|
+
clientY: position.y
|
|
9
|
+
});
|
|
10
|
+
switch (elementType) {
|
|
11
|
+
case PrimaryToolType.RECTANGLE:
|
|
12
|
+
apis.addRectangle(pos);
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=create-element%20copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element copy.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/create-element copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAA;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,MAA6B,EAC7B,IAA0B,EAC1B,EAAE;IACF,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QAC/C,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QACzC,MAAM,GAAG,GAAG,MAAM,CAAC,sBAAsB,CAAC;YACxC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACnB,OAAO,EAAE,QAAQ,CAAC,CAAC;SACpB,CAAC,CAAA;QAEF,QAAQ,WAAW,EAAE,CAAC;YACpB,KAAK,eAAe,CAAC,SAAS;gBAC5B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;gBACtB,MAAK;QACT,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/create-element.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAG/D,eAAO,MAAM,yBAAyB,GACpC,QAAQ,WAAW,CAAC,QAAQ,CAAC,EAC7B,MAAM,oBAAoB,SAe3B,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { subscribeToDecideToCreateElement } from '@asyra/reactive-events';
|
|
2
|
+
import { PrimaryToolType } from '@asyra/utils';
|
|
3
|
+
export const initCreateElementHandlers = (render, apis) => {
|
|
4
|
+
subscribeToDecideToCreateElement(({ payload }) => {
|
|
5
|
+
const { position, elementType } = payload;
|
|
6
|
+
const pos = render.getMousePosInWorkspace({
|
|
7
|
+
clientX: position.x,
|
|
8
|
+
clientY: position.y
|
|
9
|
+
});
|
|
10
|
+
switch (elementType) {
|
|
11
|
+
case PrimaryToolType.RECTANGLE:
|
|
12
|
+
apis.addRectangle(pos);
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=create-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/create-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAA;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,MAA6B,EAC7B,IAA0B,EAC1B,EAAE;IACF,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QAC/C,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QACzC,MAAM,GAAG,GAAG,MAAM,CAAC,sBAAsB,CAAC;YACxC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACnB,OAAO,EAAE,QAAQ,CAAC,CAAC;SACpB,CAAC,CAAA;QAEF,QAAQ,WAAW,EAAE,CAAC;YACpB,KAAK,eAAe,CAAC,SAAS;gBAC5B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;gBACtB,MAAK;QACT,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAMnD,eAAO,MAAM,2BAA2B,GACtC,MAAM,WAAW,EACjB,MAAM,QAAQ,SAgDf,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { initTransactionHandlers } from './transaction';
|
|
2
|
+
import { initPrimaryToolHandlers } from './primary-tool';
|
|
3
|
+
import { initCreateElementHandlers } from './create-element';
|
|
4
|
+
import { initUndoRedoHandlers } from './undoredo';
|
|
5
|
+
import { initViewportHandlers } from './viewport';
|
|
6
|
+
import { initResizeElementHandlers } from './resize-element';
|
|
7
|
+
import { initResetElementSizeSubscriber } from './reset-element-size';
|
|
8
|
+
import { initSelectElementHandlers } from './select-elements';
|
|
9
|
+
export const initInteractionCoreHandlers = (deps, apis) => {
|
|
10
|
+
initTransactionHandlers({
|
|
11
|
+
startTransaction: () => apis.startTransaction(),
|
|
12
|
+
endTransaction: () => apis.endTransaction()
|
|
13
|
+
});
|
|
14
|
+
initPrimaryToolHandlers({
|
|
15
|
+
switchPrimaryTool: (primaryTool) => apis.switchPrimaryTool(primaryTool)
|
|
16
|
+
});
|
|
17
|
+
initCreateElementHandlers(deps.render, {
|
|
18
|
+
addRectangle: (pos) => apis.addRectangle(pos)
|
|
19
|
+
});
|
|
20
|
+
initResizeElementHandlers(deps.render, {
|
|
21
|
+
changeComputedData: (key, data) => apis.changeComputedData(key, data),
|
|
22
|
+
resizeElement: (pos, dimension, options) => apis.resizeElement(pos, dimension, options)
|
|
23
|
+
});
|
|
24
|
+
initResetElementSizeSubscriber({
|
|
25
|
+
changeComputedData: (key, data) => apis.changeComputedData(key, data)
|
|
26
|
+
});
|
|
27
|
+
initUndoRedoHandlers({
|
|
28
|
+
undo: () => apis.undo(),
|
|
29
|
+
redo: () => apis.redo()
|
|
30
|
+
});
|
|
31
|
+
initViewportHandlers({
|
|
32
|
+
getViewportPosition: () => apis.getViewportPosition(),
|
|
33
|
+
getViewportScale: () => apis.getViewportScale(),
|
|
34
|
+
zoomFit: () => apis.zoomFit(),
|
|
35
|
+
panTo: (x, y) => apis.panTo(x, y),
|
|
36
|
+
zoomToCenter: (scale, centerX, centerY) => apis.zoomToCenter(scale, centerX, centerY)
|
|
37
|
+
});
|
|
38
|
+
initSelectElementHandlers({
|
|
39
|
+
selectElements: (elementIds) => apis.selectElements(elementIds)
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,IAAiB,EACjB,IAAc,EACd,EAAE;IACF,uBAAuB,CAAC;QACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC/C,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE;KAC5C,CAAC,CAAA;IAEF,uBAAuB,CAAC;QACtB,iBAAiB,EAAE,CAAC,WAA4B,EAAE,EAAE,CAClD,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC;KACtC,CAAC,CAAA;IAEF,yBAAyB,CAAC,IAAI,CAAC,MAAM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,cAAc,EAAE,CAAC,UAAoB,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;KAC1E,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-to-decision.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/input-to-decision.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,eAAO,MAAM,2BAA2B,YAmDvC,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { subscribeToExecuteAction } from '@asyra/reactive-events';
|
|
2
|
+
import { InputSystemEvents, UNDO, PanZoom } from '@asyra/utils';
|
|
3
|
+
import { decideToUndoRedo, decideToPanZoom } from '@asyra/reactive-events';
|
|
4
|
+
/**
|
|
5
|
+
* Initialize handlers that connect input events to decision events
|
|
6
|
+
*/
|
|
7
|
+
export const initInputToDecisionHandlers = () => {
|
|
8
|
+
// Handle undo/redo keyboard shortcuts
|
|
9
|
+
subscribeToExecuteAction(({ payload }) => {
|
|
10
|
+
if (payload.eventName === InputSystemEvents.INPUT_SHORTCUT_UNDOREDO) {
|
|
11
|
+
// Check if Meta key is pressed
|
|
12
|
+
const hasMeta = payload.detail?.modifiers?.meta;
|
|
13
|
+
if (hasMeta) {
|
|
14
|
+
// Check if Shift is also pressed (for redo)
|
|
15
|
+
const hasShift = payload.detail?.modifiers?.shift;
|
|
16
|
+
if (hasShift) {
|
|
17
|
+
decideToUndoRedo(UNDO.REDO);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
decideToUndoRedo(UNDO.UNDO);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
// Handle wheel scroll for zoom/pan
|
|
26
|
+
subscribeToExecuteAction(({ payload }) => {
|
|
27
|
+
if (payload.eventName === InputSystemEvents.INPUT_WHEEL_SCROLL) {
|
|
28
|
+
const detail = payload.detail;
|
|
29
|
+
// Check if Meta key is pressed for zoom
|
|
30
|
+
const hasMeta = detail?.modifiers?.meta;
|
|
31
|
+
if (hasMeta) {
|
|
32
|
+
// Handle zoom
|
|
33
|
+
decideToPanZoom(PanZoom.ZOOM, {
|
|
34
|
+
x: detail?.pointer?.clientX || 0,
|
|
35
|
+
y: detail?.pointer?.clientY || 0
|
|
36
|
+
}, { x: detail?.pointer?.deltaX || 0, y: detail?.pointer?.deltaY || 0 });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Handle pan
|
|
40
|
+
decideToPanZoom(PanZoom.PAN, {
|
|
41
|
+
x: detail?.pointer?.clientX || 0,
|
|
42
|
+
y: detail?.pointer?.clientY || 0
|
|
43
|
+
}, { x: detail?.pointer?.deltaX || 0, y: detail?.pointer?.deltaY || 0 });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=input-to-decision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-to-decision.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/input-to-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAIzB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,iBAAiB,EACjB,IAAI,EACJ,OAAO,EAIR,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEzE;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,sCAAsC;IACtC,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QACvC,IAAI,OAAO,CAAC,SAAS,KAAK,iBAAiB,CAAC,uBAAuB,EAAE,CAAC;YACpE,+BAA+B;YAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAA;YAE/C,IAAI,OAAO,EAAE,CAAC;gBACZ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OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,CACrE,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primary-tool.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/primary-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEnD,eAAO,MAAM,uBAAuB,GAAI,MAAM,qBAAqB,SAIlE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { subscribeToDecideToSwitchPrimaryTool } from '@asyra/reactive-events';
|
|
2
|
+
export const initPrimaryToolHandlers = (apis) => {
|
|
3
|
+
subscribeToDecideToSwitchPrimaryTool(({ payload }) => {
|
|
4
|
+
apis.switchPrimaryTool(payload.primaryTool);
|
|
5
|
+
});
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=primary-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primary-tool.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/primary-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAA;AAG7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAA2B,EAAE,EAAE;IACrE,oCAAoC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QACnD,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-element-size.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/reset-element-size.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,eAAO,MAAM,8BAA8B,GAAI,MAAM;IACnD,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;CAC3D,SAMA,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { subscribeToDecideToResetElementSize } from '@asyra/reactive-events';
|
|
2
|
+
export const initResetElementSizeSubscriber = (deps) => {
|
|
3
|
+
subscribeToDecideToResetElementSize((event) => {
|
|
4
|
+
const { dimension } = event.payload;
|
|
5
|
+
deps.changeComputedData('width', dimension.width);
|
|
6
|
+
deps.changeComputedData('height', dimension.height);
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=reset-element-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-element-size.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/reset-element-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAA;AAG5E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,IAE9C,EAAE,EAAE;IACH,mCAAmC,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5C,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,OAAO,CAAA;QACnC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QACjD,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-element.d.ts","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/resize-element.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAG9D,eAAO,MAAM,yBAAyB,GACpC,QAAQ,WAAW,CAAC,QAAQ,CAAC,EAC7B,MAAM,mBAAmB,SAyB1B,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { subscribeToDecideToResizeElement } from '@asyra/reactive-events';
|
|
2
|
+
// import { PrimaryToolType } from '@asyra/utils'
|
|
3
|
+
export const initResizeElementHandlers = (render, apis) => {
|
|
4
|
+
subscribeToDecideToResizeElement(({ payload, options }) => {
|
|
5
|
+
const { dragStart, position } = payload;
|
|
6
|
+
const oldPos = render.getMousePosInWorkspace({
|
|
7
|
+
clientX: dragStart.x,
|
|
8
|
+
clientY: dragStart.y
|
|
9
|
+
});
|
|
10
|
+
const newPos = render.getMousePosInWorkspace({
|
|
11
|
+
clientX: position.x,
|
|
12
|
+
clientY: position.y
|
|
13
|
+
});
|
|
14
|
+
const pos = {
|
|
15
|
+
x: Math.min(oldPos.x, newPos.x),
|
|
16
|
+
y: Math.min(oldPos.y, newPos.y)
|
|
17
|
+
};
|
|
18
|
+
const dimension = {
|
|
19
|
+
width: Math.abs(newPos.x - oldPos.x),
|
|
20
|
+
height: Math.abs(newPos.y - oldPos.y)
|
|
21
|
+
};
|
|
22
|
+
apis.resizeElement(pos, dimension, options);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=resize-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-element.js","sourceRoot":"","sources":["../../../src/subscribes/interaction-core/resize-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAA;AAEzE,iDAAiD;AAEjD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,MAA6B,EAC7B,IAAyB,EACzB,EAAE;IACF,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QACxD,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QAEvC,MAAM,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAAC;YAC3C,OAAO,EAAE,SAAS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