kritzel-stencil 0.0.153 → 0.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{default-text-tool.config-Cds94FE8.js → default-text-tool.config-BySzvIox.js} +53 -39
- package/dist/cjs/default-text-tool.config-BySzvIox.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-color_22.cjs.entry.js +110 -64
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/core/core.class.js +16 -14
- package/dist/collection/classes/core/core.class.js.map +1 -1
- package/dist/collection/classes/core/store.class.js +8 -8
- package/dist/collection/classes/core/store.class.js.map +1 -1
- package/dist/collection/classes/core/viewport.class.js +1 -1
- package/dist/collection/classes/core/viewport.class.js.map +1 -1
- package/dist/collection/classes/handlers/context-menu.handler.js +1 -1
- package/dist/collection/classes/handlers/context-menu.handler.js.map +1 -1
- package/dist/collection/classes/handlers/move.handler.js +2 -0
- package/dist/collection/classes/handlers/move.handler.js.map +1 -1
- package/dist/collection/classes/handlers/resize.handler.js +2 -0
- package/dist/collection/classes/handlers/resize.handler.js.map +1 -1
- package/dist/collection/classes/handlers/rotation.handler.js +2 -0
- package/dist/collection/classes/handlers/rotation.handler.js.map +1 -1
- package/dist/collection/classes/handlers/selection.handler.js +7 -5
- package/dist/collection/classes/handlers/selection.handler.js.map +1 -1
- package/dist/collection/classes/objects/base-object.class.js +5 -5
- package/dist/collection/classes/objects/base-object.class.js.map +1 -1
- package/dist/collection/classes/objects/custom-element.class.js +1 -1
- package/dist/collection/classes/objects/custom-element.class.js.map +1 -1
- package/dist/collection/classes/objects/image.class.js +1 -1
- package/dist/collection/classes/objects/image.class.js.map +1 -1
- package/dist/collection/classes/objects/path.class.js +4 -4
- package/dist/collection/classes/objects/path.class.js.map +1 -1
- package/dist/collection/classes/objects/selection-group.class.js +10 -10
- package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
- package/dist/collection/classes/objects/text.class.js +5 -4
- package/dist/collection/classes/objects/text.class.js.map +1 -1
- package/dist/collection/classes/structures/object-map.structure.js +10 -0
- package/dist/collection/classes/structures/object-map.structure.js.map +1 -1
- package/dist/collection/classes/tools/brush-tool.class.js +8 -6
- package/dist/collection/classes/tools/brush-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/eraser-tool.class.js +2 -0
- package/dist/collection/classes/tools/eraser-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/image-tool.class.js +1 -0
- package/dist/collection/classes/tools/image-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/text-tool.class.js +2 -2
- package/dist/collection/classes/tools/text-tool.class.js.map +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +60 -4
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js.map +1 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +80 -23
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +0 -5
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +0 -3
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +0 -2
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +0 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +0 -4
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.css +0 -4
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +0 -5
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +28 -3
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js.map +1 -1
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +8 -2
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +30 -1
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js.map +1 -1
- package/dist/collection/configs/default-engine-config.js +1 -1
- package/dist/collection/configs/default-engine-config.js.map +1 -1
- package/dist/collection/interfaces/engine-state.interface.js.map +1 -1
- package/dist/collection/interfaces/undo-state.interface.js +2 -0
- package/dist/collection/interfaces/undo-state.interface.js.map +1 -0
- package/dist/components/index.js +3 -3
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-control-brush-config.js +1 -1
- package/dist/components/kritzel-control-text-config.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-editor.js +30 -14
- package/dist/components/kritzel-editor.js.map +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/{p-CcqEzr-v.js → p-1lIHoOlH.js} +14 -12
- package/dist/components/p-1lIHoOlH.js.map +1 -0
- package/dist/components/{p-BDHz9TkP.js → p-B4kxkVe-.js} +3 -3
- package/dist/components/p-B4kxkVe-.js.map +1 -0
- package/dist/components/{p-G8Xyn7XV.js → p-BQg4YML7.js} +3 -3
- package/dist/components/{p-G8Xyn7XV.js.map → p-BQg4YML7.js.map} +1 -1
- package/dist/components/{p-BDvBsqPy.js → p-BfaEHdtM.js} +108 -68
- package/dist/components/p-BfaEHdtM.js.map +1 -0
- package/dist/components/{p-BJ-T4laL.js → p-CBYBurdY.js} +26 -23
- package/dist/components/p-CBYBurdY.js.map +1 -0
- package/dist/components/{p-DnOeM6VQ.js → p-CK6no3mi.js} +4 -4
- package/dist/components/{p-DnOeM6VQ.js.map → p-CK6no3mi.js.map} +1 -1
- package/dist/components/{p-DKVBZiTy.js → p-CsA9M6me.js} +4 -4
- package/dist/components/p-CsA9M6me.js.map +1 -0
- package/dist/components/{p-CJzBIV7n.js → p-D1uj4A4F.js} +3 -3
- package/dist/components/p-D1uj4A4F.js.map +1 -0
- package/dist/components/{p-Cqpp9wKT.js → p-DAfkuR8U.js} +8 -5
- package/dist/components/p-DAfkuR8U.js.map +1 -0
- package/dist/components/{p-CRB1YGoc.js → p-Ddh40W3x.js} +5 -5
- package/dist/components/p-Ddh40W3x.js.map +1 -0
- package/dist/components/{p-DhDRFCsP.js → p-TdCTkEu0.js} +4 -4
- package/dist/components/p-TdCTkEu0.js.map +1 -0
- package/dist/esm/{default-text-tool.config-ClW1W-X4.js → default-text-tool.config-2YFQA3SF.js} +53 -39
- package/dist/esm/default-text-tool.config-2YFQA3SF.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/kritzel-color_22.entry.js +110 -64
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/p-2YFQA3SF.js +2 -0
- package/dist/stencil/p-2YFQA3SF.js.map +1 -0
- package/dist/stencil/p-bb5b2f78.entry.js +10 -0
- package/dist/stencil/p-bb5b2f78.entry.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/core/store.class.d.ts +4 -3
- package/dist/types/classes/structures/object-map.structure.d.ts +2 -0
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +8 -1
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +4 -0
- package/dist/types/components/ui/kritzel-controls/kritzel-controls.d.ts +2 -0
- package/dist/types/components/ui/kritzel-utility-panel/kritzel-utility-panel.d.ts +2 -0
- package/dist/types/components.d.ts +28 -0
- package/dist/types/interfaces/engine-state.interface.d.ts +1 -1
- package/dist/types/interfaces/undo-state.interface.d.ts +6 -0
- package/package.json +1 -1
- package/dist/cjs/default-text-tool.config-Cds94FE8.js.map +0 -1
- package/dist/components/p-BDHz9TkP.js.map +0 -1
- package/dist/components/p-BDvBsqPy.js.map +0 -1
- package/dist/components/p-BJ-T4laL.js.map +0 -1
- package/dist/components/p-CJzBIV7n.js.map +0 -1
- package/dist/components/p-CRB1YGoc.js.map +0 -1
- package/dist/components/p-CcqEzr-v.js.map +0 -1
- package/dist/components/p-Cqpp9wKT.js.map +0 -1
- package/dist/components/p-DKVBZiTy.js.map +0 -1
- package/dist/components/p-DhDRFCsP.js.map +0 -1
- package/dist/esm/default-text-tool.config-ClW1W-X4.js.map +0 -1
- package/dist/stencil/p-843d013b.entry.js +0 -10
- package/dist/stencil/p-843d013b.entry.js.map +0 -1
- package/dist/stencil/p-ClW1W-X4.js +0 -2
- package/dist/stencil/p-ClW1W-X4.js.map +0 -1
package/dist/cjs/{default-text-tool.config-Cds94FE8.js → default-text-tool.config-BySzvIox.js}
RENAMED
|
@@ -244,14 +244,14 @@ class KritzelBaseObject {
|
|
|
244
244
|
this.updatePosition(this.translateX + deltaX, this.translateY + deltaY);
|
|
245
245
|
}
|
|
246
246
|
update() {
|
|
247
|
-
this._core.store.state.
|
|
247
|
+
this._core.store.state.objects.update(this);
|
|
248
248
|
}
|
|
249
249
|
move(startX, startY, endX, endY) {
|
|
250
250
|
const deltaX = (startX - endX) / this._core.store.state.scale;
|
|
251
251
|
const deltaY = (startY - endY) / this._core.store.state.scale;
|
|
252
252
|
this.translateX += deltaX;
|
|
253
253
|
this.translateY += deltaY;
|
|
254
|
-
this._core.store.state.
|
|
254
|
+
this._core.store.state.objects.update(this);
|
|
255
255
|
}
|
|
256
256
|
resize(x, y, width, height) {
|
|
257
257
|
if (width <= 1 || height <= 1) {
|
|
@@ -261,11 +261,11 @@ class KritzelBaseObject {
|
|
|
261
261
|
this.height = height;
|
|
262
262
|
this.translateX = x;
|
|
263
263
|
this.translateY = y;
|
|
264
|
-
this._core.store.state.
|
|
264
|
+
this._core.store.state.objects.update(this);
|
|
265
265
|
}
|
|
266
266
|
rotate(value) {
|
|
267
267
|
this.rotation = value;
|
|
268
|
-
this._core.store.state.
|
|
268
|
+
this._core.store.state.objects.update(this);
|
|
269
269
|
}
|
|
270
270
|
clone() {
|
|
271
271
|
const clone = Object.create(Object.getPrototypeOf(this));
|
|
@@ -308,7 +308,7 @@ class KritzelBaseObject {
|
|
|
308
308
|
updatePosition(x, y) {
|
|
309
309
|
this.translateX = x;
|
|
310
310
|
this.translateY = y;
|
|
311
|
-
this._core.store.state.
|
|
311
|
+
this._core.store.state.objects.update(this);
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
|
|
@@ -13946,7 +13946,7 @@ class KritzelText extends KritzelBaseObject {
|
|
|
13946
13946
|
this.content = newState.doc.toJSON();
|
|
13947
13947
|
this.adjustSizeOnInput();
|
|
13948
13948
|
if (!transaction.getMeta('fromRemote')) {
|
|
13949
|
-
this._core.store.state.
|
|
13949
|
+
this._core.store.state.objects.update(this, { temporary: true });
|
|
13950
13950
|
}
|
|
13951
13951
|
}
|
|
13952
13952
|
},
|
|
@@ -13999,7 +13999,7 @@ class KritzelText extends KritzelBaseObject {
|
|
|
13999
13999
|
this.height = originalHeight * this.scaleFactor;
|
|
14000
14000
|
this.translateX = x;
|
|
14001
14001
|
this.translateY = y;
|
|
14002
|
-
this._core.store.state.
|
|
14002
|
+
this._core.store.state.objects.update(this);
|
|
14003
14003
|
}
|
|
14004
14004
|
focus(coords) {
|
|
14005
14005
|
if (this.editor) {
|
|
@@ -14051,8 +14051,9 @@ class KritzelText extends KritzelBaseObject {
|
|
|
14051
14051
|
this.editor.setProps({ editable: () => false });
|
|
14052
14052
|
this.editor.dom.blur();
|
|
14053
14053
|
this.isEditing = false;
|
|
14054
|
-
this._core.store.state.
|
|
14055
|
-
this._core.store.state.
|
|
14054
|
+
this._core.store.state.objects.consolidateTemporaryItems();
|
|
14055
|
+
this._core.store.state.objects.update(this);
|
|
14056
|
+
this._core.engine.emitObjectsChange();
|
|
14056
14057
|
}
|
|
14057
14058
|
handlePointerDown(event) {
|
|
14058
14059
|
if (!this.isEditing) {
|
|
@@ -14185,12 +14186,12 @@ class KritzelPath extends KritzelBaseObject {
|
|
|
14185
14186
|
this.translateX = x;
|
|
14186
14187
|
this.translateY = y;
|
|
14187
14188
|
this._adjustedPoints = null;
|
|
14188
|
-
this._core.store.state.
|
|
14189
|
+
this._core.store.state.objects.update(this);
|
|
14189
14190
|
}
|
|
14190
14191
|
rotate(value) {
|
|
14191
14192
|
this.rotation = value;
|
|
14192
14193
|
this._adjustedPoints = null;
|
|
14193
|
-
this._core.store.state.
|
|
14194
|
+
this._core.store.state.objects.update(this);
|
|
14194
14195
|
}
|
|
14195
14196
|
move(startX, startY, endX, endY) {
|
|
14196
14197
|
const deltaX = (startX - endX) / this._core.store.state.scale;
|
|
@@ -14198,7 +14199,7 @@ class KritzelPath extends KritzelBaseObject {
|
|
|
14198
14199
|
this.translateX += deltaX;
|
|
14199
14200
|
this.translateY += deltaY;
|
|
14200
14201
|
this._adjustedPoints = null;
|
|
14201
|
-
this._core.store.state.
|
|
14202
|
+
this._core.store.state.objects.update(this);
|
|
14202
14203
|
}
|
|
14203
14204
|
hitTest(x, y) {
|
|
14204
14205
|
const halfStroke = this.strokeWidth / this.scale / 2;
|
|
@@ -14274,7 +14275,7 @@ class KritzelPath extends KritzelBaseObject {
|
|
|
14274
14275
|
this.translateX = x;
|
|
14275
14276
|
this.translateY = y;
|
|
14276
14277
|
this._adjustedPoints = null;
|
|
14277
|
-
this._core.store.state.
|
|
14278
|
+
this._core.store.state.objects.update(this);
|
|
14278
14279
|
}
|
|
14279
14280
|
computeAdjustedPoints() {
|
|
14280
14281
|
if (!this.points?.length) {
|
|
@@ -14437,7 +14438,7 @@ class KritzelImage extends KritzelBaseObject {
|
|
|
14437
14438
|
this.translateX = x;
|
|
14438
14439
|
this.translateY = y;
|
|
14439
14440
|
// Update to sync changes to y.js and propagate to other tabs
|
|
14440
|
-
this._core.store.state.
|
|
14441
|
+
this._core.store.state.objects.update(this);
|
|
14441
14442
|
}
|
|
14442
14443
|
calculateScaledDimensions(img) {
|
|
14443
14444
|
let scaledWidth = img.width;
|
|
@@ -14576,7 +14577,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14576
14577
|
strokeWidth: this.size,
|
|
14577
14578
|
});
|
|
14578
14579
|
path.isCompleted = false;
|
|
14579
|
-
this._core.store.state.
|
|
14580
|
+
this._core.store.state.objects.insert(path);
|
|
14580
14581
|
}
|
|
14581
14582
|
}
|
|
14582
14583
|
if (event.pointerType === 'touch') {
|
|
@@ -14594,7 +14595,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14594
14595
|
strokeWidth: this.size,
|
|
14595
14596
|
});
|
|
14596
14597
|
path.isCompleted = false;
|
|
14597
|
-
this._core.store.state.
|
|
14598
|
+
this._core.store.state.objects.insert(path);
|
|
14598
14599
|
}
|
|
14599
14600
|
}
|
|
14600
14601
|
}
|
|
@@ -14619,7 +14620,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14619
14620
|
updatedPath.id = currentPath.id;
|
|
14620
14621
|
updatedPath.workspaceId = currentPath.workspaceId;
|
|
14621
14622
|
updatedPath.isCompleted = false;
|
|
14622
|
-
this._core.store.state.
|
|
14623
|
+
this._core.store.state.objects.update(updatedPath);
|
|
14623
14624
|
}
|
|
14624
14625
|
}
|
|
14625
14626
|
}
|
|
@@ -14641,7 +14642,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14641
14642
|
updatedPath.id = currentPath.id;
|
|
14642
14643
|
updatedPath.workspaceId = currentPath.workspaceId;
|
|
14643
14644
|
updatedPath.isCompleted = false;
|
|
14644
|
-
this._core.store.state.
|
|
14645
|
+
this._core.store.state.objects.update(updatedPath);
|
|
14645
14646
|
}
|
|
14646
14647
|
}
|
|
14647
14648
|
}
|
|
@@ -14657,7 +14658,8 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14657
14658
|
if (currentPath) {
|
|
14658
14659
|
currentPath.isCompleted = true;
|
|
14659
14660
|
currentPath.zIndex = this._core.store.currentZIndex;
|
|
14660
|
-
this._core.store.state.
|
|
14661
|
+
this._core.store.state.objects.update(currentPath);
|
|
14662
|
+
this._core.engine.emitObjectsChange();
|
|
14661
14663
|
}
|
|
14662
14664
|
}
|
|
14663
14665
|
}
|
|
@@ -14668,7 +14670,8 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14668
14670
|
if (currentPath) {
|
|
14669
14671
|
currentPath.isCompleted = true;
|
|
14670
14672
|
currentPath.zIndex = this._core.store.currentZIndex;
|
|
14671
|
-
this._core.store.state.
|
|
14673
|
+
this._core.store.state.objects.update(currentPath);
|
|
14674
|
+
this._core.engine.emitObjectsChange();
|
|
14672
14675
|
}
|
|
14673
14676
|
}
|
|
14674
14677
|
}
|
|
@@ -14737,6 +14740,7 @@ class KritzelEraserTool extends KritzelBaseTool {
|
|
|
14737
14740
|
this._core.rerender();
|
|
14738
14741
|
}
|
|
14739
14742
|
this._core.store.state.isErasing = false;
|
|
14743
|
+
this._core.engine.emitObjectsChange();
|
|
14740
14744
|
}
|
|
14741
14745
|
}
|
|
14742
14746
|
if (event.pointerType === 'touch') {
|
|
@@ -14751,6 +14755,7 @@ class KritzelEraserTool extends KritzelBaseTool {
|
|
|
14751
14755
|
this._core.rerender();
|
|
14752
14756
|
}
|
|
14753
14757
|
this._core.store.state.isErasing = false;
|
|
14758
|
+
this._core.engine.emitObjectsChange();
|
|
14754
14759
|
}
|
|
14755
14760
|
}
|
|
14756
14761
|
}
|
|
@@ -14837,6 +14842,7 @@ class KritzelImageTool extends KritzelBaseTool {
|
|
|
14837
14842
|
this._core.addObject(image);
|
|
14838
14843
|
this._core.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
14839
14844
|
this._core.selectObjects([image]);
|
|
14845
|
+
this._core.engine.emitObjectsChange();
|
|
14840
14846
|
}
|
|
14841
14847
|
handleCancel() {
|
|
14842
14848
|
this._core.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
@@ -14900,7 +14906,7 @@ class KritzelTextTool extends KritzelBaseTool {
|
|
|
14900
14906
|
text.translateX = (clientX - this._core.store.state.translateX) / this._core.store.state.scale;
|
|
14901
14907
|
text.translateY = (clientY - this._core.store.state.translateY) / this._core.store.state.scale;
|
|
14902
14908
|
text.zIndex = this._core.store.currentZIndex;
|
|
14903
|
-
this._core.store.state.
|
|
14909
|
+
this._core.store.state.objects.insert(text);
|
|
14904
14910
|
this._core.rerender();
|
|
14905
14911
|
text.edit(event);
|
|
14906
14912
|
}
|
|
@@ -14934,7 +14940,7 @@ class KritzelTextTool extends KritzelBaseTool {
|
|
|
14934
14940
|
text.translateX = (clientX - this._core.store.state.translateX) / this._core.store.state.scale;
|
|
14935
14941
|
text.translateY = (clientY - this._core.store.state.translateY) / this._core.store.state.scale;
|
|
14936
14942
|
text.zIndex = this._core.store.currentZIndex;
|
|
14937
|
-
this._core.store.state.
|
|
14943
|
+
this._core.store.state.objects.insert(text);
|
|
14938
14944
|
this._core.rerender();
|
|
14939
14945
|
text.edit(event);
|
|
14940
14946
|
}
|
|
@@ -15082,6 +15088,7 @@ class KritzelMoveHandler extends KritzelBaseHandler {
|
|
|
15082
15088
|
this._core.store.state.isDragging = false;
|
|
15083
15089
|
if (this.hasMoved) {
|
|
15084
15090
|
this._core.store.selectionGroup.update();
|
|
15091
|
+
this._core.engine.emitObjectsChange();
|
|
15085
15092
|
this._core.store.state.hasObjectsChanged = true;
|
|
15086
15093
|
}
|
|
15087
15094
|
}
|
|
@@ -15091,6 +15098,7 @@ class KritzelMoveHandler extends KritzelBaseHandler {
|
|
|
15091
15098
|
this._core.store.state.isDragging = false;
|
|
15092
15099
|
if (this.hasMoved) {
|
|
15093
15100
|
this._core.store.selectionGroup.update();
|
|
15101
|
+
this._core.engine.emitObjectsChange();
|
|
15094
15102
|
this._core.store.state.hasObjectsChanged = true;
|
|
15095
15103
|
}
|
|
15096
15104
|
}
|
|
@@ -15267,6 +15275,7 @@ class KritzelResizeHandler extends KritzelBaseHandler {
|
|
|
15267
15275
|
this._core.store.state.isResizing = false;
|
|
15268
15276
|
if (this.hasResized) {
|
|
15269
15277
|
this._core.store.selectionGroup.update();
|
|
15278
|
+
this._core.engine.emitObjectsChange();
|
|
15270
15279
|
this._core.store.state.hasObjectsChanged = true;
|
|
15271
15280
|
}
|
|
15272
15281
|
this.reset();
|
|
@@ -15277,6 +15286,7 @@ class KritzelResizeHandler extends KritzelBaseHandler {
|
|
|
15277
15286
|
this._core.store.state.isResizing = false;
|
|
15278
15287
|
if (this.hasResized) {
|
|
15279
15288
|
this._core.store.selectionGroup.update();
|
|
15289
|
+
this._core.engine.emitObjectsChange();
|
|
15280
15290
|
this._core.store.state.hasObjectsChanged = true;
|
|
15281
15291
|
}
|
|
15282
15292
|
this.reset();
|
|
@@ -15381,6 +15391,7 @@ class KritzelRotationHandler extends KritzelBaseHandler {
|
|
|
15381
15391
|
if (event.pointerType === 'mouse') {
|
|
15382
15392
|
if (this._core.store.state.isRotating) {
|
|
15383
15393
|
this._core.store.selectionGroup.update();
|
|
15394
|
+
this._core.engine.emitObjectsChange();
|
|
15384
15395
|
this._core.store.state.isRotating = false;
|
|
15385
15396
|
this._core.store.state.hasObjectsChanged = true;
|
|
15386
15397
|
this.reset();
|
|
@@ -15389,6 +15400,7 @@ class KritzelRotationHandler extends KritzelBaseHandler {
|
|
|
15389
15400
|
if (event.pointerType === 'touch') {
|
|
15390
15401
|
if (this._core.store.state.isRotating) {
|
|
15391
15402
|
this._core.store.selectionGroup.update();
|
|
15403
|
+
this._core.engine.emitObjectsChange();
|
|
15392
15404
|
this._core.store.state.isRotating = false;
|
|
15393
15405
|
this._core.store.state.hasObjectsChanged = true;
|
|
15394
15406
|
this.reset();
|
|
@@ -15430,7 +15442,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15430
15442
|
get objects() {
|
|
15431
15443
|
return this.objectIds
|
|
15432
15444
|
.map(id => {
|
|
15433
|
-
const found = this._core.store.state.
|
|
15445
|
+
const found = this._core.store.state.objects.filter(obj => obj.id === id);
|
|
15434
15446
|
return found.length > 0 ? found[0] : null;
|
|
15435
15447
|
})
|
|
15436
15448
|
.filter(obj => obj !== null);
|
|
@@ -15485,7 +15497,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15485
15497
|
});
|
|
15486
15498
|
this.translateX = x;
|
|
15487
15499
|
this.translateY = y;
|
|
15488
|
-
this._core.store.state.
|
|
15500
|
+
this._core.store.state.objects.update(this);
|
|
15489
15501
|
}
|
|
15490
15502
|
/**
|
|
15491
15503
|
* Capture snapshots of current object states for undo/redo operations
|
|
@@ -15529,15 +15541,15 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15529
15541
|
// Only update the selection group itself
|
|
15530
15542
|
// Child objects are already updated during move/resize/rotate operations
|
|
15531
15543
|
// Updating them again here would create redundant y.js updates
|
|
15532
|
-
this._core.store.state.
|
|
15544
|
+
this._core.store.state.objects.update(this);
|
|
15533
15545
|
}
|
|
15534
15546
|
move(startX, startY, endX, endY) {
|
|
15535
15547
|
const deltaX = (startX - endX) / this._core.store.state.scale;
|
|
15536
15548
|
const deltaY = (startY - endY) / this._core.store.state.scale;
|
|
15537
15549
|
this.translateX += deltaX;
|
|
15538
15550
|
this.translateY += deltaY;
|
|
15539
|
-
this._core.store.state.
|
|
15540
|
-
this._core.store.state.
|
|
15551
|
+
this._core.store.state.objects.transaction(() => {
|
|
15552
|
+
this._core.store.state.objects.update(this);
|
|
15541
15553
|
this.objects.forEach(obj => {
|
|
15542
15554
|
obj.move(startX, startY, endX, endY);
|
|
15543
15555
|
});
|
|
@@ -15553,7 +15565,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15553
15565
|
const heightScaleFactor = height / this.height;
|
|
15554
15566
|
const deltaX = x - this.translateX;
|
|
15555
15567
|
const deltaY = y - this.translateY;
|
|
15556
|
-
this._core.store.state.
|
|
15568
|
+
this._core.store.state.objects.transaction(() => {
|
|
15557
15569
|
this.objects.forEach(child => {
|
|
15558
15570
|
const updatedWidth = child.width * widthScaleFactor;
|
|
15559
15571
|
const updatedHeight = child.height * heightScaleFactor;
|
|
@@ -15564,7 +15576,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15564
15576
|
// Refresh dimensions and update the SelectionGroup to propagate changes to other tabs
|
|
15565
15577
|
this.refreshObjectDimensions();
|
|
15566
15578
|
this.captureUnchangedSnapshots();
|
|
15567
|
-
this._core.store.state.
|
|
15579
|
+
this._core.store.state.objects.update(this);
|
|
15568
15580
|
});
|
|
15569
15581
|
}
|
|
15570
15582
|
rotate(value) {
|
|
@@ -15574,9 +15586,9 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15574
15586
|
const angle = value;
|
|
15575
15587
|
const cos = Math.cos(angle);
|
|
15576
15588
|
const sin = Math.sin(angle);
|
|
15577
|
-
this._core.store.state.
|
|
15589
|
+
this._core.store.state.objects.transaction(() => {
|
|
15578
15590
|
// Update the SelectionGroup itself to propagate rotation to other tabs
|
|
15579
|
-
this._core.store.state.
|
|
15591
|
+
this._core.store.state.objects.update(this);
|
|
15580
15592
|
this.objects.forEach(child => {
|
|
15581
15593
|
const unchangedSnapshot = this.unchangedObjectSnapshots.get(child.id);
|
|
15582
15594
|
if (!unchangedSnapshot)
|
|
@@ -15627,7 +15639,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15627
15639
|
this.width = (this.maxX - this.minX - this.padding) * this.scale;
|
|
15628
15640
|
this.height = (this.maxY - this.minY - this.padding) * this.scale;
|
|
15629
15641
|
}
|
|
15630
|
-
this._core.store.state.
|
|
15642
|
+
this._core.store.state.objects.update(this);
|
|
15631
15643
|
}
|
|
15632
15644
|
getOffsetXToCenterFromSnapshot(snapshot) {
|
|
15633
15645
|
const objCenterX = snapshot.translateX + snapshot.totalWidth / snapshot.scale / 2;
|
|
@@ -15710,6 +15722,7 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15710
15722
|
this.addSelectedObjectsToSelectionGroup();
|
|
15711
15723
|
this.removeSelectionBox();
|
|
15712
15724
|
}
|
|
15725
|
+
this._core.engine.emitObjectsChange();
|
|
15713
15726
|
}
|
|
15714
15727
|
}
|
|
15715
15728
|
}
|
|
@@ -15730,13 +15743,14 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15730
15743
|
this.addSelectedObjectsToSelectionGroup();
|
|
15731
15744
|
this.removeSelectionBox();
|
|
15732
15745
|
}
|
|
15746
|
+
this._core.engine.emitObjectsChange();
|
|
15733
15747
|
this._core.store.state.skipContextMenu = false;
|
|
15734
15748
|
}
|
|
15735
15749
|
}
|
|
15736
15750
|
}
|
|
15737
15751
|
removeSelectionBox() {
|
|
15738
15752
|
this._core.store.state.isSelecting = false;
|
|
15739
|
-
this._core.store.state.
|
|
15753
|
+
this._core.store.state.objects.remove(o => o instanceof KritzelSelectionBox);
|
|
15740
15754
|
}
|
|
15741
15755
|
startMouseSelection(event) {
|
|
15742
15756
|
let clientX, clientY;
|
|
@@ -15748,8 +15762,8 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15748
15762
|
selectionBox.translateX = this.startX;
|
|
15749
15763
|
selectionBox.translateY = this.startY;
|
|
15750
15764
|
this._core.store.state.isSelecting = true;
|
|
15751
|
-
this._core.store.state.
|
|
15752
|
-
this._core.store.state.
|
|
15765
|
+
this._core.store.state.objects.remove(o => o instanceof KritzelSelectionBox || o instanceof KritzelSelectionGroup);
|
|
15766
|
+
this._core.store.state.objects.insert(selectionBox);
|
|
15753
15767
|
}
|
|
15754
15768
|
startTouchSelection() {
|
|
15755
15769
|
const activePointers = Array.from(this._core.store.state.pointers.values());
|
|
@@ -15768,8 +15782,8 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15768
15782
|
selectionBox.translateX = this.startX;
|
|
15769
15783
|
selectionBox.translateY = this.startY;
|
|
15770
15784
|
this._core.store.state.isSelecting = true;
|
|
15771
|
-
this._core.store.state.
|
|
15772
|
-
this._core.store.state.
|
|
15785
|
+
this._core.store.state.objects.remove(o => o instanceof KritzelSelectionBox || o instanceof KritzelSelectionGroup);
|
|
15786
|
+
this._core.store.state.objects.insert(selectionBox);
|
|
15773
15787
|
}
|
|
15774
15788
|
updateMouseSelection(event) {
|
|
15775
15789
|
let clientX, clientY;
|
|
@@ -31248,6 +31262,6 @@ exports.varStorage = varStorage;
|
|
|
31248
31262
|
exports.writeVarString = writeVarString$2;
|
|
31249
31263
|
exports.writeVarUint = writeVarUint$2;
|
|
31250
31264
|
exports.writeVarUint8Array = writeVarUint8Array$2;
|
|
31251
|
-
//# sourceMappingURL=default-text-tool.config-
|
|
31265
|
+
//# sourceMappingURL=default-text-tool.config-BySzvIox.js.map
|
|
31252
31266
|
|
|
31253
|
-
//# sourceMappingURL=default-text-tool.config-
|
|
31267
|
+
//# sourceMappingURL=default-text-tool.config-BySzvIox.js.map
|