@asyra/core 0.2.5 → 0.5.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/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/apis/create-apis.d.ts +8 -0
- package/dist/apis/create-apis.d.ts.map +1 -0
- package/dist/apis/create-apis.js +272 -0
- package/dist/apis/create-apis.js.map +1 -0
- package/dist/apis/element-properties.d.ts +10 -0
- package/dist/apis/element-properties.d.ts.map +1 -0
- package/dist/apis/element-properties.js +33 -0
- package/dist/apis/element-properties.js.map +1 -0
- package/dist/apis/element-selection.d.ts +4 -2
- package/dist/apis/element-selection.d.ts.map +1 -1
- package/dist/apis/element-selection.js +155 -6
- package/dist/apis/element-selection.js.map +1 -1
- package/dist/apis/feature-system.d.ts +11 -0
- package/dist/apis/feature-system.d.ts.map +1 -0
- package/dist/apis/feature-system.js +9 -0
- package/dist/apis/feature-system.js.map +1 -0
- package/dist/apis/index.d.ts +1 -2
- package/dist/apis/index.d.ts.map +1 -1
- package/dist/apis/index.js +1 -24
- package/dist/apis/index.js.map +1 -1
- package/dist/apis/input-system.d.ts +1 -1
- package/dist/apis/input-system.d.ts.map +1 -1
- package/dist/apis/props.d.ts +18 -2
- package/dist/apis/props.d.ts.map +1 -1
- package/dist/apis/props.js +28 -9
- package/dist/apis/props.js.map +1 -1
- package/dist/apis/render.d.ts +39 -2
- package/dist/apis/render.d.ts.map +1 -1
- package/dist/apis/render.js +35 -2
- package/dist/apis/render.js.map +1 -1
- package/dist/apis/scene-bounds.d.ts +4 -0
- package/dist/apis/scene-bounds.d.ts.map +1 -0
- package/dist/apis/scene-bounds.js +112 -0
- package/dist/apis/scene-bounds.js.map +1 -0
- package/dist/apis/scene-tree.d.ts +24 -2
- package/dist/apis/scene-tree.d.ts.map +1 -1
- package/dist/apis/scene-tree.js +116 -25
- package/dist/apis/scene-tree.js.map +1 -1
- package/dist/apis/system-properties.d.ts +18 -0
- package/dist/apis/system-properties.d.ts.map +1 -0
- package/dist/apis/system-properties.js +21 -0
- package/dist/apis/system-properties.js.map +1 -0
- package/dist/apis/ui-context.d.ts +10 -0
- package/dist/apis/ui-context.d.ts.map +1 -0
- package/dist/apis/ui-context.js +22 -0
- package/dist/apis/ui-context.js.map +1 -0
- package/dist/canvas-pipeline-debugger/debugger.d.ts +29 -0
- package/dist/canvas-pipeline-debugger/debugger.d.ts.map +1 -0
- package/dist/canvas-pipeline-debugger/debugger.js +251 -0
- package/dist/canvas-pipeline-debugger/debugger.js.map +1 -0
- package/dist/canvas-pipeline-debugger/index.d.ts +2 -0
- package/dist/canvas-pipeline-debugger/index.d.ts.map +1 -0
- package/dist/canvas-pipeline-debugger/index.js +2 -0
- package/dist/canvas-pipeline-debugger/index.js.map +1 -0
- package/dist/core.d.ts +196 -40
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +1055 -38
- package/dist/core.js.map +1 -1
- package/dist/data-channel-observer.d.ts +35 -0
- package/dist/data-channel-observer.d.ts.map +1 -0
- package/dist/data-channel-observer.js +77 -0
- package/dist/data-channel-observer.js.map +1 -0
- package/dist/define-component.d.ts +102 -0
- package/dist/define-component.d.ts.map +1 -0
- package/dist/define-component.js +429 -0
- package/dist/define-component.js.map +1 -0
- package/dist/define-property-component.d.ts +29 -0
- package/dist/define-property-component.d.ts.map +1 -0
- package/dist/define-property-component.js +140 -0
- package/dist/define-property-component.js.map +1 -0
- package/dist/feature-integration.d.ts +16 -0
- package/dist/feature-integration.d.ts.map +1 -0
- package/dist/feature-integration.js +19 -0
- package/dist/feature-integration.js.map +1 -0
- package/dist/index.d.ts +43 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/types/canonical-changes.d.ts +39 -0
- package/dist/types/canonical-changes.d.ts.map +1 -0
- package/dist/types/canonical-changes.js +2 -0
- package/dist/types/canonical-changes.js.map +1 -0
- package/dist/types/deps.d.ts +0 -2
- package/dist/types/deps.d.ts.map +1 -1
- package/dist/types/element-properties.d.ts +24 -0
- package/dist/types/element-properties.d.ts.map +1 -0
- package/dist/types/element-properties.js +2 -0
- package/dist/types/element-properties.js.map +1 -0
- package/dist/types/element-selection.d.ts +5 -1
- package/dist/types/element-selection.d.ts.map +1 -1
- package/dist/types/feature-system.d.ts +5 -0
- package/dist/types/feature-system.d.ts.map +1 -0
- package/dist/types/feature-system.js +2 -0
- package/dist/types/feature-system.js.map +1 -0
- package/dist/types/index.d.ts +18 -14
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/load-migration.d.ts +12 -0
- package/dist/types/load-migration.d.ts.map +1 -0
- package/dist/types/load-migration.js +16 -0
- package/dist/types/load-migration.js.map +1 -0
- package/dist/types/load-validation.d.ts +12 -0
- package/dist/types/load-validation.d.ts.map +1 -0
- package/dist/types/load-validation.js +2 -0
- package/dist/types/load-validation.js.map +1 -0
- package/dist/types/props.d.ts +8 -1
- package/dist/types/props.d.ts.map +1 -1
- package/dist/types/render.d.ts +20 -1
- package/dist/types/render.d.ts.map +1 -1
- package/dist/types/scene-tree.d.ts +21 -9
- package/dist/types/scene-tree.d.ts.map +1 -1
- package/dist/types/system-properties.d.ts +19 -0
- package/dist/types/system-properties.d.ts.map +1 -0
- package/dist/types/system-properties.js +2 -0
- package/dist/types/system-properties.js.map +1 -0
- package/dist/types/ui-context.d.ts +11 -0
- package/dist/types/ui-context.d.ts.map +1 -0
- package/dist/types/ui-context.js +2 -0
- package/dist/types/ui-context.js.map +1 -0
- package/dist/types/vector.d.ts +131 -0
- package/dist/types/vector.d.ts.map +1 -0
- package/dist/types/vector.js +83 -0
- package/dist/types/vector.js.map +1 -0
- package/package.json +39 -12
- package/.turbo/turbo-test$colon$ci.log +0 -132
- package/.turbo/turbo-test$colon$local.log +0 -21
- package/.turbo/turbo-test.log +0 -0
- package/CHANGELOG.md +0 -86
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -991
- package/coverage/coverage-final.json +0 -14952
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -236
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/src/apis/element-selection.ts.html +0 -133
- package/coverage/src/apis/index.html +0 -266
- package/coverage/src/apis/index.ts.html +0 -175
- package/coverage/src/apis/input-system.ts.html +0 -121
- package/coverage/src/apis/interaction-core.ts.html +0 -190
- package/coverage/src/apis/props.ts.html +0 -124
- package/coverage/src/apis/render.ts.html +0 -130
- package/coverage/src/apis/scene-tree.ts.html +0 -292
- package/coverage/src/apis/system-context.ts.html +0 -154
- package/coverage/src/apis/transaction.ts.html +0 -124
- package/coverage/src/apis/undo.ts.html +0 -124
- package/coverage/src/apis/viewport.ts.html +0 -193
- package/coverage/src/combinations.ts.html +0 -223
- package/coverage/src/core.ts.html +0 -559
- package/coverage/src/index.html +0 -146
- package/coverage/src/index.ts.html +0 -97
- package/coverage/src/requests/factory.ts.html +0 -127
- package/coverage/src/requests/index.html +0 -206
- package/coverage/src/requests/index.ts.html +0 -154
- package/coverage/src/requests/props.ts.html +0 -133
- package/coverage/src/requests/render.ts.html +0 -187
- package/coverage/src/requests/scene-tree.ts.html +0 -163
- package/coverage/src/requests/selection.ts.html +0 -127
- package/coverage/src/requests/system-context.ts.html +0 -130
- package/coverage/src/subscribes/index.html +0 -116
- package/coverage/src/subscribes/index.ts.html +0 -109
- package/coverage/src/subscribes/input-system/index.html +0 -176
- package/coverage/src/subscribes/input-system/index.ts.html +0 -226
- package/coverage/src/subscribes/input-system/primary-tool.ts.html +0 -160
- package/coverage/src/subscribes/input-system/render.ts.html +0 -484
- package/coverage/src/subscribes/input-system/undo.ts.html +0 -172
- package/coverage/src/subscribes/input-system/viewport.ts.html +0 -259
- package/coverage/src/subscribes/interaction-core/create-element.ts.html +0 -151
- package/coverage/src/subscribes/interaction-core/index.html +0 -236
- package/coverage/src/subscribes/interaction-core/index.ts.html +0 -289
- package/coverage/src/subscribes/interaction-core/primary-tool.ts.html +0 -109
- package/coverage/src/subscribes/interaction-core/reset-element-size.ts.html +0 -127
- package/coverage/src/subscribes/interaction-core/resize-element.ts.html +0 -181
- package/coverage/src/subscribes/interaction-core/select-elements.ts.html +0 -109
- package/coverage/src/subscribes/interaction-core/transaction.ts.html +0 -130
- package/coverage/src/subscribes/interaction-core/undoredo.ts.html +0 -133
- package/coverage/src/subscribes/interaction-core/viewport.ts.html +0 -193
- package/coverage/src/types/deps.ts.html +0 -118
- package/coverage/src/types/element-selection.ts.html +0 -100
- package/coverage/src/types/index.html +0 -266
- package/coverage/src/types/index.ts.html +0 -385
- package/coverage/src/types/input-system.ts.html +0 -100
- package/coverage/src/types/interaction-core.ts.html +0 -127
- package/coverage/src/types/props.ts.html +0 -109
- package/coverage/src/types/render.ts.html +0 -106
- package/coverage/src/types/requests/factory.ts.html +0 -127
- package/coverage/src/types/requests/index.html +0 -206
- package/coverage/src/types/requests/index.ts.html +0 -214
- package/coverage/src/types/requests/props.ts.html +0 -133
- package/coverage/src/types/requests/render.ts.html +0 -139
- package/coverage/src/types/requests/scene-tree.ts.html +0 -133
- package/coverage/src/types/requests/selection.ts.html +0 -127
- package/coverage/src/types/requests/system-context.ts.html +0 -142
- package/coverage/src/types/scene-tree.ts.html +0 -178
- package/coverage/src/types/system-context/index.html +0 -161
- package/coverage/src/types/system-context/index.ts.html +0 -112
- package/coverage/src/types/system-context/key-state.ts.html +0 -106
- package/coverage/src/types/system-context/mouse-state.ts.html +0 -106
- package/coverage/src/types/system-context/primary-tool.ts.html +0 -112
- package/coverage/src/types/transaction.ts.html +0 -103
- package/coverage/src/types/undo.ts.html +0 -103
- package/coverage/src/types/viewport.ts.html +0 -127
- package/dist/__tests__/core.test.d.ts +0 -2
- package/dist/__tests__/core.test.d.ts.map +0 -1
- package/dist/__tests__/core.test.js +0 -122
- package/dist/__tests__/core.test.js.map +0 -1
- package/dist/apis/interaction-core.d.ts +0 -3
- package/dist/apis/interaction-core.d.ts.map +0 -1
- package/dist/apis/interaction-core.js +0 -22
- package/dist/apis/interaction-core.js.map +0 -1
- package/dist/apis/system-context.d.ts +0 -3
- package/dist/apis/system-context.d.ts.map +0 -1
- package/dist/apis/system-context.js +0 -16
- package/dist/apis/system-context.js.map +0 -1
- package/dist/apis/transaction.d.ts +0 -3
- package/dist/apis/transaction.d.ts.map +0 -1
- package/dist/apis/transaction.js +0 -12
- package/dist/apis/transaction.js.map +0 -1
- package/dist/apis/undo.d.ts +0 -3
- package/dist/apis/undo.d.ts.map +0 -1
- package/dist/apis/undo.js +0 -12
- package/dist/apis/undo.js.map +0 -1
- package/dist/apis/viewport.d.ts +0 -4
- package/dist/apis/viewport.d.ts.map +0 -1
- package/dist/apis/viewport.js +0 -27
- package/dist/apis/viewport.js.map +0 -1
- package/dist/combinations.d.ts +0 -4
- package/dist/combinations.d.ts.map +0 -1
- package/dist/combinations.js +0 -42
- package/dist/combinations.js.map +0 -1
- package/dist/requests/factory copy.d.ts +0 -7
- package/dist/requests/factory copy.d.ts.map +0 -1
- package/dist/requests/factory copy.js +0 -10
- package/dist/requests/factory copy.js.map +0 -1
- package/dist/requests/factory.d.ts +0 -7
- package/dist/requests/factory.d.ts.map +0 -1
- package/dist/requests/factory.js +0 -10
- package/dist/requests/factory.js.map +0 -1
- package/dist/requests/index.d.ts +0 -3
- package/dist/requests/index.d.ts.map +0 -1
- package/dist/requests/index.js +0 -21
- package/dist/requests/index.js.map +0 -1
- package/dist/requests/primary-tool.d.ts +0 -7
- package/dist/requests/primary-tool.d.ts.map +0 -1
- package/dist/requests/primary-tool.js +0 -13
- package/dist/requests/primary-tool.js.map +0 -1
- package/dist/requests/props copy.d.ts +0 -7
- package/dist/requests/props copy.d.ts.map +0 -1
- package/dist/requests/props copy.js +0 -13
- package/dist/requests/props copy.js.map +0 -1
- package/dist/requests/props.d.ts +0 -7
- package/dist/requests/props.d.ts.map +0 -1
- package/dist/requests/props.js +0 -13
- package/dist/requests/props.js.map +0 -1
- package/dist/requests/render.d.ts +0 -3
- package/dist/requests/render.d.ts.map +0 -1
- package/dist/requests/render.js +0 -22
- package/dist/requests/render.js.map +0 -1
- package/dist/requests/scene-tree.d.ts +0 -7
- package/dist/requests/scene-tree.d.ts.map +0 -1
- package/dist/requests/scene-tree.js +0 -17
- package/dist/requests/scene-tree.js.map +0 -1
- package/dist/requests/selection.d.ts +0 -7
- package/dist/requests/selection.d.ts.map +0 -1
- package/dist/requests/selection.js +0 -10
- package/dist/requests/selection.js.map +0 -1
- package/dist/requests/system-context copy.d.ts +0 -7
- package/dist/requests/system-context copy.d.ts.map +0 -1
- package/dist/requests/system-context copy.js +0 -19
- package/dist/requests/system-context copy.js.map +0 -1
- package/dist/requests/system-context.d.ts +0 -7
- package/dist/requests/system-context.d.ts.map +0 -1
- package/dist/requests/system-context.js +0 -10
- package/dist/requests/system-context.js.map +0 -1
- package/dist/requests/types.d.ts +0 -7
- package/dist/requests/types.d.ts.map +0 -1
- package/dist/requests/types.js +0 -4
- package/dist/requests/types.js.map +0 -1
- package/dist/requests/viewport.d.ts +0 -19
- package/dist/requests/viewport.d.ts.map +0 -1
- package/dist/requests/viewport.js +0 -6
- package/dist/requests/viewport.js.map +0 -1
- package/dist/subscribes/index.d.ts +0 -3
- package/dist/subscribes/index.d.ts.map +0 -1
- package/dist/subscribes/index.js +0 -7
- package/dist/subscribes/index.js.map +0 -1
- package/dist/subscribes/input-system/index.d.ts +0 -3
- package/dist/subscribes/input-system/index.d.ts.map +0 -1
- package/dist/subscribes/input-system/index.js +0 -26
- package/dist/subscribes/input-system/index.js.map +0 -1
- package/dist/subscribes/input-system/primary-tool.d.ts +0 -10
- package/dist/subscribes/input-system/primary-tool.d.ts.map +0 -1
- package/dist/subscribes/input-system/primary-tool.js +0 -15
- package/dist/subscribes/input-system/primary-tool.js.map +0 -1
- package/dist/subscribes/input-system/render.d.ts +0 -16
- package/dist/subscribes/input-system/render.d.ts.map +0 -1
- package/dist/subscribes/input-system/render.js +0 -97
- package/dist/subscribes/input-system/render.js.map +0 -1
- package/dist/subscribes/input-system/undo.d.ts +0 -10
- package/dist/subscribes/input-system/undo.d.ts.map +0 -1
- package/dist/subscribes/input-system/undo.js +0 -18
- package/dist/subscribes/input-system/undo.js.map +0 -1
- package/dist/subscribes/input-system/viewport.d.ts +0 -11
- package/dist/subscribes/input-system/viewport.d.ts.map +0 -1
- package/dist/subscribes/input-system/viewport.js +0 -36
- package/dist/subscribes/input-system/viewport.js.map +0 -1
- package/dist/subscribes/interaction-core/create-and-resize.d.ts +0 -5
- package/dist/subscribes/interaction-core/create-and-resize.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/create-and-resize.js +0 -86
- package/dist/subscribes/interaction-core/create-and-resize.js.map +0 -1
- package/dist/subscribes/interaction-core/create-element copy.d.ts +0 -3
- package/dist/subscribes/interaction-core/create-element copy.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/create-element copy.js +0 -17
- package/dist/subscribes/interaction-core/create-element copy.js.map +0 -1
- package/dist/subscribes/interaction-core/create-element.d.ts +0 -3
- package/dist/subscribes/interaction-core/create-element.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/create-element.js +0 -17
- package/dist/subscribes/interaction-core/create-element.js.map +0 -1
- package/dist/subscribes/interaction-core/index.d.ts +0 -3
- package/dist/subscribes/interaction-core/index.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/index.js +0 -42
- package/dist/subscribes/interaction-core/index.js.map +0 -1
- package/dist/subscribes/interaction-core/input-to-decision.d.ts +0 -5
- package/dist/subscribes/interaction-core/input-to-decision.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/input-to-decision.js +0 -48
- package/dist/subscribes/interaction-core/input-to-decision.js.map +0 -1
- package/dist/subscribes/interaction-core/primary-tool.d.ts +0 -3
- package/dist/subscribes/interaction-core/primary-tool.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/primary-tool.js +0 -7
- package/dist/subscribes/interaction-core/primary-tool.js.map +0 -1
- package/dist/subscribes/interaction-core/reset-element-size.d.ts +0 -5
- package/dist/subscribes/interaction-core/reset-element-size.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/reset-element-size.js +0 -9
- package/dist/subscribes/interaction-core/reset-element-size.js.map +0 -1
- package/dist/subscribes/interaction-core/resize-element.d.ts +0 -3
- package/dist/subscribes/interaction-core/resize-element.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/resize-element.js +0 -24
- package/dist/subscribes/interaction-core/resize-element.js.map +0 -1
- package/dist/subscribes/interaction-core/select-elements.d.ts +0 -3
- package/dist/subscribes/interaction-core/select-elements.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/select-elements.js +0 -7
- package/dist/subscribes/interaction-core/select-elements.js.map +0 -1
- package/dist/subscribes/interaction-core/transaction.d.ts +0 -3
- package/dist/subscribes/interaction-core/transaction.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/transaction.js +0 -10
- package/dist/subscribes/interaction-core/transaction.js.map +0 -1
- package/dist/subscribes/interaction-core/undoredo.d.ts +0 -3
- package/dist/subscribes/interaction-core/undoredo.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/undoredo.js +0 -15
- package/dist/subscribes/interaction-core/undoredo.js.map +0 -1
- package/dist/subscribes/interaction-core/viewport.d.ts +0 -3
- package/dist/subscribes/interaction-core/viewport.d.ts.map +0 -1
- package/dist/subscribes/interaction-core/viewport.js +0 -29
- package/dist/subscribes/interaction-core/viewport.js.map +0 -1
- package/dist/subscribes/render.d.ts +0 -6
- package/dist/subscribes/render.d.ts.map +0 -1
- package/dist/subscribes/render.js +0 -28
- package/dist/subscribes/render.js.map +0 -1
- package/dist/types/interaction-core.d.ts +0 -11
- package/dist/types/interaction-core.d.ts.map +0 -1
- package/dist/types/interaction-core.js +0 -2
- package/dist/types/interaction-core.js.map +0 -1
- package/dist/types/requests/factory copy.d.ts +0 -12
- package/dist/types/requests/factory copy.d.ts.map +0 -1
- package/dist/types/requests/factory copy.js +0 -2
- package/dist/types/requests/factory copy.js.map +0 -1
- package/dist/types/requests/factory.d.ts +0 -12
- package/dist/types/requests/factory.d.ts.map +0 -1
- package/dist/types/requests/factory.js +0 -2
- package/dist/types/requests/factory.js.map +0 -1
- package/dist/types/requests/index.d.ts +0 -17
- package/dist/types/requests/index.d.ts.map +0 -1
- package/dist/types/requests/index.js +0 -4
- package/dist/types/requests/index.js.map +0 -1
- package/dist/types/requests/primary-tool.d.ts +0 -13
- package/dist/types/requests/primary-tool.d.ts.map +0 -1
- package/dist/types/requests/primary-tool.js +0 -2
- package/dist/types/requests/primary-tool.js.map +0 -1
- package/dist/types/requests/props copy.d.ts +0 -14
- package/dist/types/requests/props copy.d.ts.map +0 -1
- package/dist/types/requests/props copy.js +0 -2
- package/dist/types/requests/props copy.js.map +0 -1
- package/dist/types/requests/props.d.ts +0 -14
- package/dist/types/requests/props.d.ts.map +0 -1
- package/dist/types/requests/props.js +0 -2
- package/dist/types/requests/props.js.map +0 -1
- package/dist/types/requests/render.d.ts +0 -15
- package/dist/types/requests/render.d.ts.map +0 -1
- package/dist/types/requests/render.js +0 -2
- package/dist/types/requests/render.js.map +0 -1
- package/dist/types/requests/scene-tree.d.ts +0 -14
- package/dist/types/requests/scene-tree.d.ts.map +0 -1
- package/dist/types/requests/scene-tree.js +0 -2
- package/dist/types/requests/scene-tree.js.map +0 -1
- package/dist/types/requests/selection.d.ts +0 -12
- package/dist/types/requests/selection.d.ts.map +0 -1
- package/dist/types/requests/selection.js +0 -2
- package/dist/types/requests/selection.js.map +0 -1
- package/dist/types/requests/system-context.d.ts +0 -17
- package/dist/types/requests/system-context.d.ts.map +0 -1
- package/dist/types/requests/system-context.js +0 -2
- package/dist/types/requests/system-context.js.map +0 -1
- package/dist/types/requests/system.d.ts +0 -13
- package/dist/types/requests/system.d.ts.map +0 -1
- package/dist/types/requests/system.js +0 -2
- package/dist/types/requests/system.js.map +0 -1
- package/dist/types/requests/viewport.d.ts +0 -20
- package/dist/types/requests/viewport.d.ts.map +0 -1
- package/dist/types/requests/viewport.js +0 -6
- package/dist/types/requests/viewport.js.map +0 -1
- package/dist/types/requests.d.ts +0 -8
- package/dist/types/requests.d.ts.map +0 -1
- package/dist/types/requests.js +0 -2
- package/dist/types/requests.js.map +0 -1
- package/dist/types/system-context/index.d.ts +0 -8
- package/dist/types/system-context/index.d.ts.map +0 -1
- package/dist/types/system-context/index.js +0 -4
- package/dist/types/system-context/index.js.map +0 -1
- package/dist/types/system-context/key-state.d.ts +0 -6
- package/dist/types/system-context/key-state.d.ts.map +0 -1
- package/dist/types/system-context/key-state.js +0 -2
- package/dist/types/system-context/key-state.js.map +0 -1
- package/dist/types/system-context/mouse-state.d.ts +0 -6
- package/dist/types/system-context/mouse-state.d.ts.map +0 -1
- package/dist/types/system-context/mouse-state.js +0 -2
- package/dist/types/system-context/mouse-state.js.map +0 -1
- package/dist/types/system-context/primary-tool.d.ts +0 -8
- package/dist/types/system-context/primary-tool.d.ts.map +0 -1
- package/dist/types/system-context/primary-tool.js +0 -2
- package/dist/types/system-context/primary-tool.js.map +0 -1
- package/dist/types/transaction.d.ts +0 -6
- package/dist/types/transaction.d.ts.map +0 -1
- package/dist/types/transaction.js +0 -2
- package/dist/types/transaction.js.map +0 -1
- package/dist/types/undo.d.ts +0 -6
- package/dist/types/undo.d.ts.map +0 -1
- package/dist/types/undo.js +0 -2
- package/dist/types/undo.js.map +0 -1
- package/dist/types/viewport.d.ts +0 -12
- package/dist/types/viewport.d.ts.map +0 -1
- package/dist/types/viewport.js +0 -2
- package/dist/types/viewport.js.map +0 -1
- package/src/__tests__/core.test.ts +0 -153
- package/src/apis/element-selection.ts +0 -16
- package/src/apis/index.ts +0 -30
- package/src/apis/input-system.ts +0 -12
- package/src/apis/interaction-core.ts +0 -35
- package/src/apis/props.ts +0 -13
- package/src/apis/render.ts +0 -15
- package/src/apis/scene-tree.ts +0 -69
- package/src/apis/system-context.ts +0 -23
- package/src/apis/transaction.ts +0 -13
- package/src/apis/undo.ts +0 -13
- package/src/apis/viewport.ts +0 -36
- package/src/combinations.ts +0 -46
- package/src/core.ts +0 -158
- package/src/index.ts +0 -4
- package/src/requests/factory.ts +0 -14
- package/src/requests/index.ts +0 -23
- package/src/requests/props.ts +0 -16
- package/src/requests/render.ts +0 -34
- package/src/requests/scene-tree.ts +0 -26
- package/src/requests/selection.ts +0 -14
- package/src/requests/system-context.ts +0 -15
- package/src/subscribes/index.ts +0 -8
- package/src/subscribes/input-system/index.ts +0 -47
- package/src/subscribes/input-system/primary-tool.ts +0 -25
- package/src/subscribes/input-system/render.ts +0 -133
- package/src/subscribes/input-system/undo.ts +0 -29
- package/src/subscribes/input-system/viewport.ts +0 -58
- package/src/subscribes/interaction-core/create-element.ts +0 -22
- package/src/subscribes/interaction-core/index.ts +0 -68
- package/src/subscribes/interaction-core/primary-tool.ts +0 -8
- package/src/subscribes/interaction-core/reset-element-size.ts +0 -12
- package/src/subscribes/interaction-core/resize-element.ts +0 -31
- package/src/subscribes/interaction-core/select-elements.ts +0 -8
- package/src/subscribes/interaction-core/transaction.ts +0 -15
- package/src/subscribes/interaction-core/undoredo.ts +0 -16
- package/src/subscribes/interaction-core/viewport.ts +0 -35
- package/src/types/deps.ts +0 -11
- package/src/types/element-selection.ts +0 -5
- package/src/types/index.ts +0 -100
- package/src/types/input-system.ts +0 -5
- package/src/types/interaction-core.ts +0 -14
- package/src/types/props.ts +0 -8
- package/src/types/render.ts +0 -7
- package/src/types/requests/factory.ts +0 -14
- package/src/types/requests/index.ts +0 -43
- package/src/types/requests/props.ts +0 -16
- package/src/types/requests/render.ts +0 -18
- package/src/types/requests/scene-tree.ts +0 -16
- package/src/types/requests/selection.ts +0 -14
- package/src/types/requests/system-context.ts +0 -19
- package/src/types/scene-tree.ts +0 -31
- package/src/types/system-context/index.ts +0 -9
- package/src/types/system-context/key-state.ts +0 -7
- package/src/types/system-context/mouse-state.ts +0 -7
- package/src/types/system-context/primary-tool.ts +0 -9
- package/src/types/transaction.ts +0 -6
- package/src/types/undo.ts +0 -6
- package/src/types/viewport.ts +0 -14
- package/test-setup.ts +0 -6
- package/tsconfig.json +0 -22
- package/vitest.config.ts +0 -8
|
@@ -1,133 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
}
|
package/src/types/deps.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
package/src/types/index.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
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
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
package/src/types/props.ts
DELETED
package/src/types/render.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|