@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,133 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModifierKeys,
|
|
3
|
+
MouseData,
|
|
4
|
+
PointerEventData,
|
|
5
|
+
RawInputEvent,
|
|
6
|
+
InputSystemEvents
|
|
7
|
+
} from '@asyra/utils'
|
|
8
|
+
import {
|
|
9
|
+
HandlerDeps,
|
|
10
|
+
MouseStateAPIs,
|
|
11
|
+
KeyStateAPIs,
|
|
12
|
+
InteractionCoreSessionAPIs
|
|
13
|
+
} from '../../types'
|
|
14
|
+
|
|
15
|
+
export class RenderHandler {
|
|
16
|
+
private _isDown: boolean
|
|
17
|
+
private _isDrag: boolean
|
|
18
|
+
private _startPos: MouseData
|
|
19
|
+
private _endPos: MouseData
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
private inputSystem: HandlerDeps['inputSystem'],
|
|
23
|
+
private deps: MouseStateAPIs & InteractionCoreSessionAPIs & KeyStateAPIs
|
|
24
|
+
) {
|
|
25
|
+
this._isDown = false
|
|
26
|
+
this._isDrag = false
|
|
27
|
+
this._startPos = {
|
|
28
|
+
clientX: 0,
|
|
29
|
+
clientY: 0
|
|
30
|
+
}
|
|
31
|
+
this._endPos = {
|
|
32
|
+
clientX: 0,
|
|
33
|
+
clientY: 0
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
this.init()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
init() {
|
|
40
|
+
this.inputSystem.on(
|
|
41
|
+
InputSystemEvents.INPUT_DRAG_START,
|
|
42
|
+
this._handleDragStart
|
|
43
|
+
)
|
|
44
|
+
this.inputSystem.on(
|
|
45
|
+
InputSystemEvents.INPUT_DRAG_UPDATE,
|
|
46
|
+
this._handleDragUpdate
|
|
47
|
+
)
|
|
48
|
+
this.inputSystem.on(InputSystemEvents.INPUT_DRAG_END, this._handleDragEnd)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_handleDragStart = (raw: RawInputEvent) => {
|
|
52
|
+
const { clientX, clientY, button } = raw.pointer as PointerEventData
|
|
53
|
+
this._isDown = true
|
|
54
|
+
this._isDrag = false
|
|
55
|
+
this._startPos = { clientX, clientY }
|
|
56
|
+
|
|
57
|
+
this.deps.updateMouseState({
|
|
58
|
+
dragStart: {
|
|
59
|
+
x: clientX,
|
|
60
|
+
y: clientY
|
|
61
|
+
},
|
|
62
|
+
position: {
|
|
63
|
+
x: clientX,
|
|
64
|
+
y: clientY
|
|
65
|
+
},
|
|
66
|
+
delta: {
|
|
67
|
+
x: 0,
|
|
68
|
+
y: 0
|
|
69
|
+
},
|
|
70
|
+
down: this._isDown,
|
|
71
|
+
button: button,
|
|
72
|
+
dragging: this._isDrag
|
|
73
|
+
})
|
|
74
|
+
this.deps.updateKeyState({
|
|
75
|
+
...(raw.modifiers as ModifierKeys)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
this.deps.startSession(InputSystemEvents.INPUT_DRAG_START)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_handleDragUpdate = (raw: RawInputEvent) => {
|
|
82
|
+
const { clientX, clientY, button } = raw.pointer as PointerEventData
|
|
83
|
+
this._isDrag = true
|
|
84
|
+
this._endPos = {
|
|
85
|
+
clientX,
|
|
86
|
+
clientY
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
this.deps.updateMouseState({
|
|
90
|
+
position: {
|
|
91
|
+
x: clientX,
|
|
92
|
+
y: clientY
|
|
93
|
+
},
|
|
94
|
+
delta: {
|
|
95
|
+
x: clientX - this._startPos.clientX,
|
|
96
|
+
y: clientY - this._startPos.clientY
|
|
97
|
+
},
|
|
98
|
+
down: true,
|
|
99
|
+
button: button,
|
|
100
|
+
dragging: this._isDrag
|
|
101
|
+
})
|
|
102
|
+
this.deps.updateKeyState({
|
|
103
|
+
...(raw.modifiers as ModifierKeys)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
this.deps.updateSession(InputSystemEvents.INPUT_DRAG_UPDATE)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
_handleDragEnd = async (raw: RawInputEvent) => {
|
|
110
|
+
const { clientX, clientY, button } = raw.pointer as PointerEventData
|
|
111
|
+
|
|
112
|
+
this.deps.updateMouseState({
|
|
113
|
+
position: {
|
|
114
|
+
x: clientX,
|
|
115
|
+
y: clientY
|
|
116
|
+
},
|
|
117
|
+
delta: {
|
|
118
|
+
x: clientX - this._startPos.clientX,
|
|
119
|
+
y: clientY - this._startPos.clientY
|
|
120
|
+
},
|
|
121
|
+
button: button,
|
|
122
|
+
down: this._isDown,
|
|
123
|
+
dragging: this._isDrag
|
|
124
|
+
})
|
|
125
|
+
this.deps.updateKeyState({
|
|
126
|
+
...(raw.modifiers as ModifierKeys)
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
this.deps.endSession(InputSystemEvents.INPUT_DRAG_END)
|
|
130
|
+
|
|
131
|
+
this._isDown = false
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InputSystemEvents, ModifierKeys, RawInputEvent } from '@asyra/utils'
|
|
2
|
+
import {
|
|
3
|
+
HandlerDeps,
|
|
4
|
+
InteractionCoreActionAPIs,
|
|
5
|
+
KeyStateAPIs
|
|
6
|
+
} from '../../types'
|
|
7
|
+
|
|
8
|
+
export class UndoHandler {
|
|
9
|
+
constructor(
|
|
10
|
+
private inputSystem: HandlerDeps['inputSystem'],
|
|
11
|
+
private deps: InteractionCoreActionAPIs & KeyStateAPIs
|
|
12
|
+
) {
|
|
13
|
+
this.init()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
init() {
|
|
17
|
+
this.inputSystem.on(
|
|
18
|
+
InputSystemEvents.INPUT_SHORTCUT_UNDOREDO,
|
|
19
|
+
this._handleUndoRedo
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_handleUndoRedo = (raw: RawInputEvent) => {
|
|
24
|
+
this.deps.updateKeyState({
|
|
25
|
+
...(raw.modifiers as ModifierKeys)
|
|
26
|
+
})
|
|
27
|
+
this.deps.executeAction(InputSystemEvents.INPUT_SHORTCUT_UNDOREDO)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputSystemEvents,
|
|
3
|
+
ModifierKeys,
|
|
4
|
+
PointerEventData,
|
|
5
|
+
RawInputEvent
|
|
6
|
+
} from '@asyra/utils'
|
|
7
|
+
import {
|
|
8
|
+
HandlerDeps,
|
|
9
|
+
InteractionCoreActionAPIs,
|
|
10
|
+
KeyStateAPIs,
|
|
11
|
+
MouseStateAPIs
|
|
12
|
+
} from '../../types'
|
|
13
|
+
|
|
14
|
+
export class ViewportHandler {
|
|
15
|
+
constructor(
|
|
16
|
+
private inputSystem: HandlerDeps['inputSystem'],
|
|
17
|
+
private deps: InteractionCoreActionAPIs & MouseStateAPIs & KeyStateAPIs
|
|
18
|
+
) {
|
|
19
|
+
this.init()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
init() {
|
|
23
|
+
this.inputSystem.on(
|
|
24
|
+
InputSystemEvents.INPUT_SHORTCUT_ZOOM_PRESET,
|
|
25
|
+
this._handleZoomFit
|
|
26
|
+
)
|
|
27
|
+
this.inputSystem.on(
|
|
28
|
+
InputSystemEvents.INPUT_WHEEL_SCROLL,
|
|
29
|
+
this._handleWheelScroll
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_handleZoomFit = () => {
|
|
34
|
+
this.deps.executeAction(InputSystemEvents.INPUT_SHORTCUT_ZOOM_PRESET)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_handleWheelScroll = (raw: RawInputEvent) => {
|
|
38
|
+
const { clientX, clientY, deltaX, deltaY, button } =
|
|
39
|
+
raw.pointer as PointerEventData
|
|
40
|
+
this.deps.updateMouseState({
|
|
41
|
+
position: {
|
|
42
|
+
x: clientX,
|
|
43
|
+
y: clientY
|
|
44
|
+
},
|
|
45
|
+
delta: {
|
|
46
|
+
x: deltaX,
|
|
47
|
+
y: deltaY
|
|
48
|
+
},
|
|
49
|
+
down: false,
|
|
50
|
+
button: button,
|
|
51
|
+
dragging: false
|
|
52
|
+
})
|
|
53
|
+
this.deps.updateKeyState({
|
|
54
|
+
...(raw.modifiers as ModifierKeys)
|
|
55
|
+
})
|
|
56
|
+
this.deps.executeAction(InputSystemEvents.INPUT_WHEEL_SCROLL)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { subscribeToDecideToCreateElement } from '@asyra/reactive-events'
|
|
2
|
+
import { HandlerDeps, SceneTreeHandlerAPIs } from '../../types'
|
|
3
|
+
import { PrimaryToolType } from '@asyra/utils'
|
|
4
|
+
|
|
5
|
+
export const initCreateElementHandlers = (
|
|
6
|
+
render: HandlerDeps['render'],
|
|
7
|
+
apis: SceneTreeHandlerAPIs
|
|
8
|
+
) => {
|
|
9
|
+
subscribeToDecideToCreateElement(({ payload }) => {
|
|
10
|
+
const { position, elementType } = payload
|
|
11
|
+
const pos = render.getMousePosInWorkspace({
|
|
12
|
+
clientX: position.x,
|
|
13
|
+
clientY: position.y
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
switch (elementType) {
|
|
17
|
+
case PrimaryToolType.RECTANGLE:
|
|
18
|
+
apis.addRectangle(pos)
|
|
19
|
+
break
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataTypes,
|
|
3
|
+
DimensionData,
|
|
4
|
+
EVENT_OPTIONS,
|
|
5
|
+
PositionData,
|
|
6
|
+
PrimaryToolType
|
|
7
|
+
} from '@asyra/utils'
|
|
8
|
+
import { initTransactionHandlers } from './transaction'
|
|
9
|
+
import { initPrimaryToolHandlers } from './primary-tool'
|
|
10
|
+
import { initCreateElementHandlers } from './create-element'
|
|
11
|
+
import { initUndoRedoHandlers } from './undoredo'
|
|
12
|
+
import { CoreAPIs, HandlerDeps } from '../../types'
|
|
13
|
+
import { initViewportHandlers } from './viewport'
|
|
14
|
+
import { initResizeElementHandlers } from './resize-element'
|
|
15
|
+
import { initResetElementSizeSubscriber } from './reset-element-size'
|
|
16
|
+
import { initSelectElementHandlers } from './select-elements'
|
|
17
|
+
|
|
18
|
+
export const initInteractionCoreHandlers = (
|
|
19
|
+
deps: HandlerDeps,
|
|
20
|
+
apis: CoreAPIs
|
|
21
|
+
) => {
|
|
22
|
+
initTransactionHandlers({
|
|
23
|
+
startTransaction: () => apis.startTransaction(),
|
|
24
|
+
endTransaction: () => apis.endTransaction()
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
initPrimaryToolHandlers({
|
|
28
|
+
switchPrimaryTool: (primaryTool: PrimaryToolType) =>
|
|
29
|
+
apis.switchPrimaryTool(primaryTool)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
initCreateElementHandlers(deps.render, {
|
|
33
|
+
addRectangle: (pos: PositionData) => apis.addRectangle(pos)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
initResizeElementHandlers(deps.render, {
|
|
37
|
+
changeComputedData: (key: string, data: DataTypes) =>
|
|
38
|
+
apis.changeComputedData(key, data),
|
|
39
|
+
resizeElement: (
|
|
40
|
+
pos: PositionData,
|
|
41
|
+
dimension: DimensionData,
|
|
42
|
+
options?: EVENT_OPTIONS
|
|
43
|
+
) => apis.resizeElement(pos, dimension, options)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
initResetElementSizeSubscriber({
|
|
47
|
+
changeComputedData: (key: string, data: DataTypes) =>
|
|
48
|
+
apis.changeComputedData(key, data)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
initUndoRedoHandlers({
|
|
52
|
+
undo: () => apis.undo(),
|
|
53
|
+
redo: () => apis.redo()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
initViewportHandlers({
|
|
57
|
+
getViewportPosition: () => apis.getViewportPosition(),
|
|
58
|
+
getViewportScale: () => apis.getViewportScale(),
|
|
59
|
+
zoomFit: () => apis.zoomFit(),
|
|
60
|
+
panTo: (x: number, y: number) => apis.panTo(x, y),
|
|
61
|
+
zoomToCenter: (scale: number, centerX: number, centerY: number) =>
|
|
62
|
+
apis.zoomToCenter(scale, centerX, centerY)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
initSelectElementHandlers({
|
|
66
|
+
selectElements: (elementIds: string[]) => apis.selectElements(elementIds)
|
|
67
|
+
})
|
|
68
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { subscribeToDecideToSwitchPrimaryTool } from '@asyra/reactive-events'
|
|
2
|
+
import { PrimaryToolActionAPIs } from '../../types'
|
|
3
|
+
|
|
4
|
+
export const initPrimaryToolHandlers = (apis: PrimaryToolActionAPIs) => {
|
|
5
|
+
subscribeToDecideToSwitchPrimaryTool(({ payload }) => {
|
|
6
|
+
apis.switchPrimaryTool(payload.primaryTool)
|
|
7
|
+
})
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { subscribeToDecideToResetElementSize } from '@asyra/reactive-events'
|
|
2
|
+
import { DataTypes } from '@asyra/utils'
|
|
3
|
+
|
|
4
|
+
export const initResetElementSizeSubscriber = (deps: {
|
|
5
|
+
changeComputedData: (key: string, data: DataTypes) => void
|
|
6
|
+
}) => {
|
|
7
|
+
subscribeToDecideToResetElementSize((event) => {
|
|
8
|
+
const { dimension } = event.payload
|
|
9
|
+
deps.changeComputedData('width', dimension.width)
|
|
10
|
+
deps.changeComputedData('height', dimension.height)
|
|
11
|
+
})
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { subscribeToDecideToResizeElement } from '@asyra/reactive-events'
|
|
2
|
+
import { HandlerDeps, SceneTreeActionAPIs } from '../../types'
|
|
3
|
+
|
|
4
|
+
export const initResizeElementHandlers = (
|
|
5
|
+
render: HandlerDeps['render'],
|
|
6
|
+
apis: SceneTreeActionAPIs
|
|
7
|
+
) => {
|
|
8
|
+
subscribeToDecideToResizeElement(({ payload, options }) => {
|
|
9
|
+
const { dragStart, position } = payload
|
|
10
|
+
|
|
11
|
+
const oldPos = render.getMousePosInWorkspace({
|
|
12
|
+
clientX: dragStart.x,
|
|
13
|
+
clientY: dragStart.y
|
|
14
|
+
})
|
|
15
|
+
const newPos = render.getMousePosInWorkspace({
|
|
16
|
+
clientX: position.x,
|
|
17
|
+
clientY: position.y
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const pos = {
|
|
21
|
+
x: Math.min(oldPos.x, newPos.x),
|
|
22
|
+
y: Math.min(oldPos.y, newPos.y)
|
|
23
|
+
}
|
|
24
|
+
const dimension = {
|
|
25
|
+
width: Math.abs(newPos.x - oldPos.x),
|
|
26
|
+
height: Math.abs(newPos.y - oldPos.y)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
apis.resizeElement(pos, dimension, options)
|
|
30
|
+
})
|
|
31
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { subscribeToDecideToSelectElements } from '@asyra/reactive-events'
|
|
2
|
+
import { ElementSelectionActionAPIs } from '../../types'
|
|
3
|
+
|
|
4
|
+
export const initSelectElementHandlers = (apis: ElementSelectionActionAPIs) => {
|
|
5
|
+
subscribeToDecideToSelectElements(({ payload }) => {
|
|
6
|
+
apis.selectElements(payload.elementIds)
|
|
7
|
+
})
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
subscribeToDecideToEndTransaction,
|
|
3
|
+
subscribeToDecideToStartTransaction
|
|
4
|
+
} from '@asyra/reactive-events'
|
|
5
|
+
import { TransactionActionAPIs } from '../../types'
|
|
6
|
+
|
|
7
|
+
export const initTransactionHandlers = (apis: TransactionActionAPIs) => {
|
|
8
|
+
subscribeToDecideToStartTransaction(() => {
|
|
9
|
+
apis.startTransaction()
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
subscribeToDecideToEndTransaction(() => {
|
|
13
|
+
apis.endTransaction()
|
|
14
|
+
})
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { subscribeToDecideToUndoRedo } from '@asyra/reactive-events'
|
|
2
|
+
import { UNDO } from '@asyra/utils'
|
|
3
|
+
import { UndoActionAPIs } from '../../types'
|
|
4
|
+
|
|
5
|
+
export const initUndoRedoHandlers = (apis: UndoActionAPIs) => {
|
|
6
|
+
subscribeToDecideToUndoRedo(({ payload }) => {
|
|
7
|
+
switch (payload.undoredo) {
|
|
8
|
+
case UNDO.UNDO:
|
|
9
|
+
apis.undo()
|
|
10
|
+
break
|
|
11
|
+
case UNDO.REDO:
|
|
12
|
+
apis.redo()
|
|
13
|
+
break
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
subscribeToDecideToPanZoom,
|
|
3
|
+
subscribeToDecideToZoomFit
|
|
4
|
+
} from '@asyra/reactive-events'
|
|
5
|
+
import { ViewportAPIs } from '../../types'
|
|
6
|
+
import { PanZoom, ZOOM_SMOOTH_RATIO } from '@asyra/utils'
|
|
7
|
+
|
|
8
|
+
export const initViewportHandlers = (apis: ViewportAPIs) => {
|
|
9
|
+
subscribeToDecideToZoomFit(() => {
|
|
10
|
+
apis.zoomFit()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
subscribeToDecideToPanZoom(({ payload }) => {
|
|
14
|
+
switch (payload.panzoom) {
|
|
15
|
+
case PanZoom.PAN: {
|
|
16
|
+
const { x, y } = payload.wheel
|
|
17
|
+
const currentPosition = apis.getViewportPosition()
|
|
18
|
+
apis.panTo(currentPosition.x - x, currentPosition.y - y)
|
|
19
|
+
break
|
|
20
|
+
}
|
|
21
|
+
case PanZoom.ZOOM: {
|
|
22
|
+
const { x: clientX, y: clientY } = payload.mouse
|
|
23
|
+
const { y: deltaY } = payload.wheel
|
|
24
|
+
const currentScale = apis.getViewportScale()
|
|
25
|
+
// Adjust zoom scale based on wheel direction. deltaY < 0 means scrolling up (zoom in)
|
|
26
|
+
// Using a smaller scale factor (1.05) for smoother zooming
|
|
27
|
+
const newScale =
|
|
28
|
+
currentScale *
|
|
29
|
+
(deltaY < 0 ? 1 + ZOOM_SMOOTH_RATIO : 1 - ZOOM_SMOOTH_RATIO)
|
|
30
|
+
apis.zoomToCenter(newScale, clientX, clientY)
|
|
31
|
+
break
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Factory } from '@asyra/factory'
|
|
2
|
+
import type { InputSystem } from '@asyra/input-system'
|
|
3
|
+
import type { InteractionCore } from '@asyra/interaction-core'
|
|
4
|
+
import type { Render } from '@asyra/render'
|
|
5
|
+
|
|
6
|
+
export interface HandlerDeps {
|
|
7
|
+
inputSystem: InputSystem
|
|
8
|
+
render: Render
|
|
9
|
+
factory: Factory
|
|
10
|
+
interactionCore: InteractionCore
|
|
11
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { TransactionAPIs, TransactionActionAPIs } from './transaction'
|
|
2
|
+
import {
|
|
3
|
+
ElementSelectionAPIs,
|
|
4
|
+
ElementSelectionActionAPIs
|
|
5
|
+
} from './element-selection'
|
|
6
|
+
import { InputSystemAPIs, InputSystemRawAPIs } from './input-system'
|
|
7
|
+
import { RenderAPIs, RenderRawAPIs } from './render'
|
|
8
|
+
import {
|
|
9
|
+
SceneTreeAPIs,
|
|
10
|
+
SceneTreeActionAPIs,
|
|
11
|
+
SceneTreeHandlerAPIs
|
|
12
|
+
} from './scene-tree'
|
|
13
|
+
import { UndoAPIs, UndoActionAPIs } from './undo'
|
|
14
|
+
import { ViewportAPIs } from './viewport'
|
|
15
|
+
import { PropsAPIs, PropsRawAPIs } from './props'
|
|
16
|
+
import {
|
|
17
|
+
SystemContextAPIs,
|
|
18
|
+
PrimaryToolActionAPIs,
|
|
19
|
+
PrimaryToolAPIs,
|
|
20
|
+
MouseStateAPIs,
|
|
21
|
+
KeyStateAPIs
|
|
22
|
+
} from './system-context'
|
|
23
|
+
import {
|
|
24
|
+
InteractionCoreAPIs,
|
|
25
|
+
InteractionCoreSessionAPIs,
|
|
26
|
+
InteractionCoreActionAPIs
|
|
27
|
+
} from './interaction-core'
|
|
28
|
+
import {
|
|
29
|
+
Requests,
|
|
30
|
+
RequestsDeps,
|
|
31
|
+
SystemContextRequests,
|
|
32
|
+
SystemContextRequestsDeps,
|
|
33
|
+
PropsRequests,
|
|
34
|
+
PropsRequestDeps,
|
|
35
|
+
SceneTreeRequests,
|
|
36
|
+
SceneTreeRequestDeps,
|
|
37
|
+
FactoryRequests,
|
|
38
|
+
FactoryRequestDeps,
|
|
39
|
+
RenderRequests,
|
|
40
|
+
RenderRequestDeps,
|
|
41
|
+
SelectionRequests,
|
|
42
|
+
SelectionRequestDeps
|
|
43
|
+
} from './requests'
|
|
44
|
+
|
|
45
|
+
export { HandlerDeps } from './deps'
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
// APIs
|
|
49
|
+
TransactionAPIs,
|
|
50
|
+
TransactionActionAPIs,
|
|
51
|
+
InputSystemRawAPIs,
|
|
52
|
+
InputSystemAPIs,
|
|
53
|
+
UndoActionAPIs,
|
|
54
|
+
UndoAPIs,
|
|
55
|
+
ViewportAPIs,
|
|
56
|
+
RenderRawAPIs,
|
|
57
|
+
RenderAPIs,
|
|
58
|
+
SceneTreeAPIs,
|
|
59
|
+
SceneTreeActionAPIs,
|
|
60
|
+
SceneTreeHandlerAPIs,
|
|
61
|
+
ElementSelectionActionAPIs,
|
|
62
|
+
ElementSelectionAPIs,
|
|
63
|
+
PropsRawAPIs,
|
|
64
|
+
PropsAPIs,
|
|
65
|
+
PrimaryToolActionAPIs,
|
|
66
|
+
PrimaryToolAPIs,
|
|
67
|
+
MouseStateAPIs,
|
|
68
|
+
SystemContextAPIs,
|
|
69
|
+
InteractionCoreActionAPIs,
|
|
70
|
+
InteractionCoreSessionAPIs,
|
|
71
|
+
InteractionCoreAPIs,
|
|
72
|
+
KeyStateAPIs,
|
|
73
|
+
|
|
74
|
+
// Requests
|
|
75
|
+
Requests,
|
|
76
|
+
RequestsDeps,
|
|
77
|
+
SystemContextRequests,
|
|
78
|
+
SystemContextRequestsDeps,
|
|
79
|
+
PropsRequests,
|
|
80
|
+
PropsRequestDeps,
|
|
81
|
+
SceneTreeRequests,
|
|
82
|
+
SceneTreeRequestDeps,
|
|
83
|
+
FactoryRequests,
|
|
84
|
+
FactoryRequestDeps,
|
|
85
|
+
RenderRequests,
|
|
86
|
+
RenderRequestDeps,
|
|
87
|
+
SelectionRequests,
|
|
88
|
+
SelectionRequestDeps
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type CoreAPIs = TransactionAPIs &
|
|
92
|
+
InputSystemAPIs &
|
|
93
|
+
UndoAPIs &
|
|
94
|
+
ViewportAPIs &
|
|
95
|
+
RenderAPIs &
|
|
96
|
+
SceneTreeAPIs &
|
|
97
|
+
ElementSelectionAPIs &
|
|
98
|
+
PropsAPIs &
|
|
99
|
+
SystemContextAPIs &
|
|
100
|
+
InteractionCoreAPIs
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DetailType, InputSystemEvents } from '@asyra/utils'
|
|
2
|
+
|
|
3
|
+
export interface InteractionCoreActionAPIs {
|
|
4
|
+
executeAction: (eventName: InputSystemEvents, detail?: DetailType) => void
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface InteractionCoreSessionAPIs {
|
|
8
|
+
startSession: (eventName: InputSystemEvents, detail?: DetailType) => void
|
|
9
|
+
updateSession: (eventName: InputSystemEvents, detail?: DetailType) => void
|
|
10
|
+
endSession: (eventName: InputSystemEvents, detail?: DetailType) => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type InteractionCoreAPIs = InteractionCoreActionAPIs &
|
|
14
|
+
InteractionCoreSessionAPIs
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Factory } from '@asyra/factory'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Request API for Factory data
|
|
5
|
+
* Provides synchronous access to factory state
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface FactoryRequests {
|
|
9
|
+
isInUndoRedo: () => boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface FactoryRequestDeps {
|
|
13
|
+
factory: Factory
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Request API Types
|
|
2
|
+
// Domain-specific type definitions for request layer
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
SystemContextRequests,
|
|
6
|
+
SystemContextRequestsDeps
|
|
7
|
+
} from './system-context'
|
|
8
|
+
import { PropsRequests, PropsRequestDeps } from './props'
|
|
9
|
+
import { SceneTreeRequestDeps, SceneTreeRequests } from './scene-tree'
|
|
10
|
+
import { FactoryRequests, FactoryRequestDeps } from './factory'
|
|
11
|
+
import { RenderRequestDeps, RenderRequests } from './render'
|
|
12
|
+
import { SelectionRequestDeps, SelectionRequests } from './selection'
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
SystemContextRequests,
|
|
16
|
+
SystemContextRequestsDeps,
|
|
17
|
+
PropsRequests,
|
|
18
|
+
PropsRequestDeps,
|
|
19
|
+
SceneTreeRequests,
|
|
20
|
+
SceneTreeRequestDeps,
|
|
21
|
+
FactoryRequests,
|
|
22
|
+
FactoryRequestDeps,
|
|
23
|
+
RenderRequests,
|
|
24
|
+
RenderRequestDeps,
|
|
25
|
+
SelectionRequests,
|
|
26
|
+
SelectionRequestDeps
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type RequestsDeps = SystemContextRequestsDeps &
|
|
30
|
+
PropsRequestDeps &
|
|
31
|
+
SceneTreeRequestDeps &
|
|
32
|
+
FactoryRequestDeps &
|
|
33
|
+
RenderRequestDeps &
|
|
34
|
+
SelectionRequestDeps
|
|
35
|
+
|
|
36
|
+
export interface Requests {
|
|
37
|
+
systemContextRequests: SystemContextRequests
|
|
38
|
+
propsRequests: PropsRequests
|
|
39
|
+
sceneTreeRequests: SceneTreeRequests
|
|
40
|
+
factoryRequests: FactoryRequests
|
|
41
|
+
renderRequests: RenderRequests
|
|
42
|
+
selectionRequests: SelectionRequests
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PropsManager } from '@asyra/props-manager'
|
|
2
|
+
import { PropsComponentRawData } from '@asyra/utils'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Request API for Props data
|
|
6
|
+
* Provides synchronous access to props manager state
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface PropsRequests {
|
|
10
|
+
propsLoadData: (data: PropsComponentRawData) => void
|
|
11
|
+
propsSaveData: () => PropsComponentRawData
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PropsRequestDeps {
|
|
15
|
+
props: PropsManager
|
|
16
|
+
}
|