kritzel-stencil 0.0.153 → 0.0.155
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 +123 -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 +93 -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-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/components/{p-BDvBsqPy.js → p-q5u4CVFi.js} +121 -68
- package/dist/components/p-q5u4CVFi.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 +123 -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-77fa3987.entry.js +10 -0
- package/dist/stencil/p-77fa3987.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/esm/{default-text-tool.config-ClW1W-X4.js → default-text-tool.config-2YFQA3SF.js}
RENAMED
|
@@ -242,14 +242,14 @@ class KritzelBaseObject {
|
|
|
242
242
|
this.updatePosition(this.translateX + deltaX, this.translateY + deltaY);
|
|
243
243
|
}
|
|
244
244
|
update() {
|
|
245
|
-
this._core.store.state.
|
|
245
|
+
this._core.store.state.objects.update(this);
|
|
246
246
|
}
|
|
247
247
|
move(startX, startY, endX, endY) {
|
|
248
248
|
const deltaX = (startX - endX) / this._core.store.state.scale;
|
|
249
249
|
const deltaY = (startY - endY) / this._core.store.state.scale;
|
|
250
250
|
this.translateX += deltaX;
|
|
251
251
|
this.translateY += deltaY;
|
|
252
|
-
this._core.store.state.
|
|
252
|
+
this._core.store.state.objects.update(this);
|
|
253
253
|
}
|
|
254
254
|
resize(x, y, width, height) {
|
|
255
255
|
if (width <= 1 || height <= 1) {
|
|
@@ -259,11 +259,11 @@ class KritzelBaseObject {
|
|
|
259
259
|
this.height = height;
|
|
260
260
|
this.translateX = x;
|
|
261
261
|
this.translateY = y;
|
|
262
|
-
this._core.store.state.
|
|
262
|
+
this._core.store.state.objects.update(this);
|
|
263
263
|
}
|
|
264
264
|
rotate(value) {
|
|
265
265
|
this.rotation = value;
|
|
266
|
-
this._core.store.state.
|
|
266
|
+
this._core.store.state.objects.update(this);
|
|
267
267
|
}
|
|
268
268
|
clone() {
|
|
269
269
|
const clone = Object.create(Object.getPrototypeOf(this));
|
|
@@ -306,7 +306,7 @@ class KritzelBaseObject {
|
|
|
306
306
|
updatePosition(x, y) {
|
|
307
307
|
this.translateX = x;
|
|
308
308
|
this.translateY = y;
|
|
309
|
-
this._core.store.state.
|
|
309
|
+
this._core.store.state.objects.update(this);
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
|
|
@@ -13944,7 +13944,7 @@ class KritzelText extends KritzelBaseObject {
|
|
|
13944
13944
|
this.content = newState.doc.toJSON();
|
|
13945
13945
|
this.adjustSizeOnInput();
|
|
13946
13946
|
if (!transaction.getMeta('fromRemote')) {
|
|
13947
|
-
this._core.store.state.
|
|
13947
|
+
this._core.store.state.objects.update(this, { temporary: true });
|
|
13948
13948
|
}
|
|
13949
13949
|
}
|
|
13950
13950
|
},
|
|
@@ -13997,7 +13997,7 @@ class KritzelText extends KritzelBaseObject {
|
|
|
13997
13997
|
this.height = originalHeight * this.scaleFactor;
|
|
13998
13998
|
this.translateX = x;
|
|
13999
13999
|
this.translateY = y;
|
|
14000
|
-
this._core.store.state.
|
|
14000
|
+
this._core.store.state.objects.update(this);
|
|
14001
14001
|
}
|
|
14002
14002
|
focus(coords) {
|
|
14003
14003
|
if (this.editor) {
|
|
@@ -14049,8 +14049,9 @@ class KritzelText extends KritzelBaseObject {
|
|
|
14049
14049
|
this.editor.setProps({ editable: () => false });
|
|
14050
14050
|
this.editor.dom.blur();
|
|
14051
14051
|
this.isEditing = false;
|
|
14052
|
-
this._core.store.state.
|
|
14053
|
-
this._core.store.state.
|
|
14052
|
+
this._core.store.state.objects.consolidateTemporaryItems();
|
|
14053
|
+
this._core.store.state.objects.update(this);
|
|
14054
|
+
this._core.engine.emitObjectsChange();
|
|
14054
14055
|
}
|
|
14055
14056
|
handlePointerDown(event) {
|
|
14056
14057
|
if (!this.isEditing) {
|
|
@@ -14183,12 +14184,12 @@ class KritzelPath extends KritzelBaseObject {
|
|
|
14183
14184
|
this.translateX = x;
|
|
14184
14185
|
this.translateY = y;
|
|
14185
14186
|
this._adjustedPoints = null;
|
|
14186
|
-
this._core.store.state.
|
|
14187
|
+
this._core.store.state.objects.update(this);
|
|
14187
14188
|
}
|
|
14188
14189
|
rotate(value) {
|
|
14189
14190
|
this.rotation = value;
|
|
14190
14191
|
this._adjustedPoints = null;
|
|
14191
|
-
this._core.store.state.
|
|
14192
|
+
this._core.store.state.objects.update(this);
|
|
14192
14193
|
}
|
|
14193
14194
|
move(startX, startY, endX, endY) {
|
|
14194
14195
|
const deltaX = (startX - endX) / this._core.store.state.scale;
|
|
@@ -14196,7 +14197,7 @@ class KritzelPath extends KritzelBaseObject {
|
|
|
14196
14197
|
this.translateX += deltaX;
|
|
14197
14198
|
this.translateY += deltaY;
|
|
14198
14199
|
this._adjustedPoints = null;
|
|
14199
|
-
this._core.store.state.
|
|
14200
|
+
this._core.store.state.objects.update(this);
|
|
14200
14201
|
}
|
|
14201
14202
|
hitTest(x, y) {
|
|
14202
14203
|
const halfStroke = this.strokeWidth / this.scale / 2;
|
|
@@ -14272,7 +14273,7 @@ class KritzelPath extends KritzelBaseObject {
|
|
|
14272
14273
|
this.translateX = x;
|
|
14273
14274
|
this.translateY = y;
|
|
14274
14275
|
this._adjustedPoints = null;
|
|
14275
|
-
this._core.store.state.
|
|
14276
|
+
this._core.store.state.objects.update(this);
|
|
14276
14277
|
}
|
|
14277
14278
|
computeAdjustedPoints() {
|
|
14278
14279
|
if (!this.points?.length) {
|
|
@@ -14435,7 +14436,7 @@ class KritzelImage extends KritzelBaseObject {
|
|
|
14435
14436
|
this.translateX = x;
|
|
14436
14437
|
this.translateY = y;
|
|
14437
14438
|
// Update to sync changes to y.js and propagate to other tabs
|
|
14438
|
-
this._core.store.state.
|
|
14439
|
+
this._core.store.state.objects.update(this);
|
|
14439
14440
|
}
|
|
14440
14441
|
calculateScaledDimensions(img) {
|
|
14441
14442
|
let scaledWidth = img.width;
|
|
@@ -14574,7 +14575,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14574
14575
|
strokeWidth: this.size,
|
|
14575
14576
|
});
|
|
14576
14577
|
path.isCompleted = false;
|
|
14577
|
-
this._core.store.state.
|
|
14578
|
+
this._core.store.state.objects.insert(path);
|
|
14578
14579
|
}
|
|
14579
14580
|
}
|
|
14580
14581
|
if (event.pointerType === 'touch') {
|
|
@@ -14592,7 +14593,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14592
14593
|
strokeWidth: this.size,
|
|
14593
14594
|
});
|
|
14594
14595
|
path.isCompleted = false;
|
|
14595
|
-
this._core.store.state.
|
|
14596
|
+
this._core.store.state.objects.insert(path);
|
|
14596
14597
|
}
|
|
14597
14598
|
}
|
|
14598
14599
|
}
|
|
@@ -14617,7 +14618,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14617
14618
|
updatedPath.id = currentPath.id;
|
|
14618
14619
|
updatedPath.workspaceId = currentPath.workspaceId;
|
|
14619
14620
|
updatedPath.isCompleted = false;
|
|
14620
|
-
this._core.store.state.
|
|
14621
|
+
this._core.store.state.objects.update(updatedPath);
|
|
14621
14622
|
}
|
|
14622
14623
|
}
|
|
14623
14624
|
}
|
|
@@ -14639,7 +14640,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14639
14640
|
updatedPath.id = currentPath.id;
|
|
14640
14641
|
updatedPath.workspaceId = currentPath.workspaceId;
|
|
14641
14642
|
updatedPath.isCompleted = false;
|
|
14642
|
-
this._core.store.state.
|
|
14643
|
+
this._core.store.state.objects.update(updatedPath);
|
|
14643
14644
|
}
|
|
14644
14645
|
}
|
|
14645
14646
|
}
|
|
@@ -14655,7 +14656,8 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14655
14656
|
if (currentPath) {
|
|
14656
14657
|
currentPath.isCompleted = true;
|
|
14657
14658
|
currentPath.zIndex = this._core.store.currentZIndex;
|
|
14658
|
-
this._core.store.state.
|
|
14659
|
+
this._core.store.state.objects.update(currentPath);
|
|
14660
|
+
this._core.engine.emitObjectsChange();
|
|
14659
14661
|
}
|
|
14660
14662
|
}
|
|
14661
14663
|
}
|
|
@@ -14666,7 +14668,8 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
14666
14668
|
if (currentPath) {
|
|
14667
14669
|
currentPath.isCompleted = true;
|
|
14668
14670
|
currentPath.zIndex = this._core.store.currentZIndex;
|
|
14669
|
-
this._core.store.state.
|
|
14671
|
+
this._core.store.state.objects.update(currentPath);
|
|
14672
|
+
this._core.engine.emitObjectsChange();
|
|
14670
14673
|
}
|
|
14671
14674
|
}
|
|
14672
14675
|
}
|
|
@@ -14735,6 +14738,7 @@ class KritzelEraserTool extends KritzelBaseTool {
|
|
|
14735
14738
|
this._core.rerender();
|
|
14736
14739
|
}
|
|
14737
14740
|
this._core.store.state.isErasing = false;
|
|
14741
|
+
this._core.engine.emitObjectsChange();
|
|
14738
14742
|
}
|
|
14739
14743
|
}
|
|
14740
14744
|
if (event.pointerType === 'touch') {
|
|
@@ -14749,6 +14753,7 @@ class KritzelEraserTool extends KritzelBaseTool {
|
|
|
14749
14753
|
this._core.rerender();
|
|
14750
14754
|
}
|
|
14751
14755
|
this._core.store.state.isErasing = false;
|
|
14756
|
+
this._core.engine.emitObjectsChange();
|
|
14752
14757
|
}
|
|
14753
14758
|
}
|
|
14754
14759
|
}
|
|
@@ -14835,6 +14840,7 @@ class KritzelImageTool extends KritzelBaseTool {
|
|
|
14835
14840
|
this._core.addObject(image);
|
|
14836
14841
|
this._core.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
14837
14842
|
this._core.selectObjects([image]);
|
|
14843
|
+
this._core.engine.emitObjectsChange();
|
|
14838
14844
|
}
|
|
14839
14845
|
handleCancel() {
|
|
14840
14846
|
this._core.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
|
|
@@ -14898,7 +14904,7 @@ class KritzelTextTool extends KritzelBaseTool {
|
|
|
14898
14904
|
text.translateX = (clientX - this._core.store.state.translateX) / this._core.store.state.scale;
|
|
14899
14905
|
text.translateY = (clientY - this._core.store.state.translateY) / this._core.store.state.scale;
|
|
14900
14906
|
text.zIndex = this._core.store.currentZIndex;
|
|
14901
|
-
this._core.store.state.
|
|
14907
|
+
this._core.store.state.objects.insert(text);
|
|
14902
14908
|
this._core.rerender();
|
|
14903
14909
|
text.edit(event);
|
|
14904
14910
|
}
|
|
@@ -14932,7 +14938,7 @@ class KritzelTextTool extends KritzelBaseTool {
|
|
|
14932
14938
|
text.translateX = (clientX - this._core.store.state.translateX) / this._core.store.state.scale;
|
|
14933
14939
|
text.translateY = (clientY - this._core.store.state.translateY) / this._core.store.state.scale;
|
|
14934
14940
|
text.zIndex = this._core.store.currentZIndex;
|
|
14935
|
-
this._core.store.state.
|
|
14941
|
+
this._core.store.state.objects.insert(text);
|
|
14936
14942
|
this._core.rerender();
|
|
14937
14943
|
text.edit(event);
|
|
14938
14944
|
}
|
|
@@ -15080,6 +15086,7 @@ class KritzelMoveHandler extends KritzelBaseHandler {
|
|
|
15080
15086
|
this._core.store.state.isDragging = false;
|
|
15081
15087
|
if (this.hasMoved) {
|
|
15082
15088
|
this._core.store.selectionGroup.update();
|
|
15089
|
+
this._core.engine.emitObjectsChange();
|
|
15083
15090
|
this._core.store.state.hasObjectsChanged = true;
|
|
15084
15091
|
}
|
|
15085
15092
|
}
|
|
@@ -15089,6 +15096,7 @@ class KritzelMoveHandler extends KritzelBaseHandler {
|
|
|
15089
15096
|
this._core.store.state.isDragging = false;
|
|
15090
15097
|
if (this.hasMoved) {
|
|
15091
15098
|
this._core.store.selectionGroup.update();
|
|
15099
|
+
this._core.engine.emitObjectsChange();
|
|
15092
15100
|
this._core.store.state.hasObjectsChanged = true;
|
|
15093
15101
|
}
|
|
15094
15102
|
}
|
|
@@ -15265,6 +15273,7 @@ class KritzelResizeHandler extends KritzelBaseHandler {
|
|
|
15265
15273
|
this._core.store.state.isResizing = false;
|
|
15266
15274
|
if (this.hasResized) {
|
|
15267
15275
|
this._core.store.selectionGroup.update();
|
|
15276
|
+
this._core.engine.emitObjectsChange();
|
|
15268
15277
|
this._core.store.state.hasObjectsChanged = true;
|
|
15269
15278
|
}
|
|
15270
15279
|
this.reset();
|
|
@@ -15275,6 +15284,7 @@ class KritzelResizeHandler extends KritzelBaseHandler {
|
|
|
15275
15284
|
this._core.store.state.isResizing = false;
|
|
15276
15285
|
if (this.hasResized) {
|
|
15277
15286
|
this._core.store.selectionGroup.update();
|
|
15287
|
+
this._core.engine.emitObjectsChange();
|
|
15278
15288
|
this._core.store.state.hasObjectsChanged = true;
|
|
15279
15289
|
}
|
|
15280
15290
|
this.reset();
|
|
@@ -15379,6 +15389,7 @@ class KritzelRotationHandler extends KritzelBaseHandler {
|
|
|
15379
15389
|
if (event.pointerType === 'mouse') {
|
|
15380
15390
|
if (this._core.store.state.isRotating) {
|
|
15381
15391
|
this._core.store.selectionGroup.update();
|
|
15392
|
+
this._core.engine.emitObjectsChange();
|
|
15382
15393
|
this._core.store.state.isRotating = false;
|
|
15383
15394
|
this._core.store.state.hasObjectsChanged = true;
|
|
15384
15395
|
this.reset();
|
|
@@ -15387,6 +15398,7 @@ class KritzelRotationHandler extends KritzelBaseHandler {
|
|
|
15387
15398
|
if (event.pointerType === 'touch') {
|
|
15388
15399
|
if (this._core.store.state.isRotating) {
|
|
15389
15400
|
this._core.store.selectionGroup.update();
|
|
15401
|
+
this._core.engine.emitObjectsChange();
|
|
15390
15402
|
this._core.store.state.isRotating = false;
|
|
15391
15403
|
this._core.store.state.hasObjectsChanged = true;
|
|
15392
15404
|
this.reset();
|
|
@@ -15428,7 +15440,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15428
15440
|
get objects() {
|
|
15429
15441
|
return this.objectIds
|
|
15430
15442
|
.map(id => {
|
|
15431
|
-
const found = this._core.store.state.
|
|
15443
|
+
const found = this._core.store.state.objects.filter(obj => obj.id === id);
|
|
15432
15444
|
return found.length > 0 ? found[0] : null;
|
|
15433
15445
|
})
|
|
15434
15446
|
.filter(obj => obj !== null);
|
|
@@ -15483,7 +15495,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15483
15495
|
});
|
|
15484
15496
|
this.translateX = x;
|
|
15485
15497
|
this.translateY = y;
|
|
15486
|
-
this._core.store.state.
|
|
15498
|
+
this._core.store.state.objects.update(this);
|
|
15487
15499
|
}
|
|
15488
15500
|
/**
|
|
15489
15501
|
* Capture snapshots of current object states for undo/redo operations
|
|
@@ -15527,15 +15539,15 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15527
15539
|
// Only update the selection group itself
|
|
15528
15540
|
// Child objects are already updated during move/resize/rotate operations
|
|
15529
15541
|
// Updating them again here would create redundant y.js updates
|
|
15530
|
-
this._core.store.state.
|
|
15542
|
+
this._core.store.state.objects.update(this);
|
|
15531
15543
|
}
|
|
15532
15544
|
move(startX, startY, endX, endY) {
|
|
15533
15545
|
const deltaX = (startX - endX) / this._core.store.state.scale;
|
|
15534
15546
|
const deltaY = (startY - endY) / this._core.store.state.scale;
|
|
15535
15547
|
this.translateX += deltaX;
|
|
15536
15548
|
this.translateY += deltaY;
|
|
15537
|
-
this._core.store.state.
|
|
15538
|
-
this._core.store.state.
|
|
15549
|
+
this._core.store.state.objects.transaction(() => {
|
|
15550
|
+
this._core.store.state.objects.update(this);
|
|
15539
15551
|
this.objects.forEach(obj => {
|
|
15540
15552
|
obj.move(startX, startY, endX, endY);
|
|
15541
15553
|
});
|
|
@@ -15551,7 +15563,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15551
15563
|
const heightScaleFactor = height / this.height;
|
|
15552
15564
|
const deltaX = x - this.translateX;
|
|
15553
15565
|
const deltaY = y - this.translateY;
|
|
15554
|
-
this._core.store.state.
|
|
15566
|
+
this._core.store.state.objects.transaction(() => {
|
|
15555
15567
|
this.objects.forEach(child => {
|
|
15556
15568
|
const updatedWidth = child.width * widthScaleFactor;
|
|
15557
15569
|
const updatedHeight = child.height * heightScaleFactor;
|
|
@@ -15562,7 +15574,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15562
15574
|
// Refresh dimensions and update the SelectionGroup to propagate changes to other tabs
|
|
15563
15575
|
this.refreshObjectDimensions();
|
|
15564
15576
|
this.captureUnchangedSnapshots();
|
|
15565
|
-
this._core.store.state.
|
|
15577
|
+
this._core.store.state.objects.update(this);
|
|
15566
15578
|
});
|
|
15567
15579
|
}
|
|
15568
15580
|
rotate(value) {
|
|
@@ -15572,9 +15584,9 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15572
15584
|
const angle = value;
|
|
15573
15585
|
const cos = Math.cos(angle);
|
|
15574
15586
|
const sin = Math.sin(angle);
|
|
15575
|
-
this._core.store.state.
|
|
15587
|
+
this._core.store.state.objects.transaction(() => {
|
|
15576
15588
|
// Update the SelectionGroup itself to propagate rotation to other tabs
|
|
15577
|
-
this._core.store.state.
|
|
15589
|
+
this._core.store.state.objects.update(this);
|
|
15578
15590
|
this.objects.forEach(child => {
|
|
15579
15591
|
const unchangedSnapshot = this.unchangedObjectSnapshots.get(child.id);
|
|
15580
15592
|
if (!unchangedSnapshot)
|
|
@@ -15625,7 +15637,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
15625
15637
|
this.width = (this.maxX - this.minX - this.padding) * this.scale;
|
|
15626
15638
|
this.height = (this.maxY - this.minY - this.padding) * this.scale;
|
|
15627
15639
|
}
|
|
15628
|
-
this._core.store.state.
|
|
15640
|
+
this._core.store.state.objects.update(this);
|
|
15629
15641
|
}
|
|
15630
15642
|
getOffsetXToCenterFromSnapshot(snapshot) {
|
|
15631
15643
|
const objCenterX = snapshot.translateX + snapshot.totalWidth / snapshot.scale / 2;
|
|
@@ -15708,6 +15720,7 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15708
15720
|
this.addSelectedObjectsToSelectionGroup();
|
|
15709
15721
|
this.removeSelectionBox();
|
|
15710
15722
|
}
|
|
15723
|
+
this._core.engine.emitObjectsChange();
|
|
15711
15724
|
}
|
|
15712
15725
|
}
|
|
15713
15726
|
}
|
|
@@ -15728,13 +15741,14 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15728
15741
|
this.addSelectedObjectsToSelectionGroup();
|
|
15729
15742
|
this.removeSelectionBox();
|
|
15730
15743
|
}
|
|
15744
|
+
this._core.engine.emitObjectsChange();
|
|
15731
15745
|
this._core.store.state.skipContextMenu = false;
|
|
15732
15746
|
}
|
|
15733
15747
|
}
|
|
15734
15748
|
}
|
|
15735
15749
|
removeSelectionBox() {
|
|
15736
15750
|
this._core.store.state.isSelecting = false;
|
|
15737
|
-
this._core.store.state.
|
|
15751
|
+
this._core.store.state.objects.remove(o => o instanceof KritzelSelectionBox);
|
|
15738
15752
|
}
|
|
15739
15753
|
startMouseSelection(event) {
|
|
15740
15754
|
let clientX, clientY;
|
|
@@ -15746,8 +15760,8 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15746
15760
|
selectionBox.translateX = this.startX;
|
|
15747
15761
|
selectionBox.translateY = this.startY;
|
|
15748
15762
|
this._core.store.state.isSelecting = true;
|
|
15749
|
-
this._core.store.state.
|
|
15750
|
-
this._core.store.state.
|
|
15763
|
+
this._core.store.state.objects.remove(o => o instanceof KritzelSelectionBox || o instanceof KritzelSelectionGroup);
|
|
15764
|
+
this._core.store.state.objects.insert(selectionBox);
|
|
15751
15765
|
}
|
|
15752
15766
|
startTouchSelection() {
|
|
15753
15767
|
const activePointers = Array.from(this._core.store.state.pointers.values());
|
|
@@ -15766,8 +15780,8 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
15766
15780
|
selectionBox.translateX = this.startX;
|
|
15767
15781
|
selectionBox.translateY = this.startY;
|
|
15768
15782
|
this._core.store.state.isSelecting = true;
|
|
15769
|
-
this._core.store.state.
|
|
15770
|
-
this._core.store.state.
|
|
15783
|
+
this._core.store.state.objects.remove(o => o instanceof KritzelSelectionBox || o instanceof KritzelSelectionGroup);
|
|
15784
|
+
this._core.store.state.objects.insert(selectionBox);
|
|
15771
15785
|
}
|
|
15772
15786
|
updateMouseSelection(event) {
|
|
15773
15787
|
let clientX, clientY;
|
|
@@ -31189,6 +31203,6 @@ const DEFAULT_TEXT_CONFIG = {
|
|
|
31189
31203
|
};
|
|
31190
31204
|
|
|
31191
31205
|
export { Doc as $, isNode as A, min$2 as B, pow as C, HocuspocusProviderWebsocket as D, KritzelPath as E, KritzelImage as F, KritzelBrushTool as G, HocuspocusProvider as H, KritzelEraserTool as I, KritzelImageTool as J, KritzelText as K, KritzelTextTool as L, KritzelSelectionTool as M, IndexedDBSyncProvider as N, Observable$1 as O, KritzelAppStateMap as P, KritzelWorkspace as Q, DEFAULT_BRUSH_CONFIG as R, DEFAULT_TEXT_CONFIG as S, KritzelDevicesHelper as T, KritzelMouseButton as U, KritzelKeyboardHelper as V, KritzelBaseHandler as W, KritzelToolRegistry as X, KritzelSelectionBox as Y, KritzelSelectionGroup as Z, KritzelBaseObject as _, writeVarUint8Array$2 as a, DEFAULT_SYNC_CONFIG as a0, UndoManager as a1, ObjectHelper as a2, KritzelEventHelper as a3, KritzelBaseTool as a4, readVarUint8Array$2 as b, applyUpdate as c, encodeStateVector as d, encodeStateAsUpdate as e, createEncoder$1 as f, createDecoder$1 as g, create$8 as h, fromBase64 as i, toBase64 as j, createUint8ArrayFromArrayBuffer as k, offChange as l, readVarString$2 as m, floor$2 as n, onChange as o, getUnixTime$1 as p, equalityDeep$1 as q, readVarUint$2 as r, setIfUndefined$1 as s, toUint8Array$1 as t, writeVarString$2 as u, varStorage as v, writeVarUint$2 as w, map as x, ObservableV2 as y, length$3 as z };
|
|
31192
|
-
//# sourceMappingURL=default-text-tool.config-
|
|
31206
|
+
//# sourceMappingURL=default-text-tool.config-2YFQA3SF.js.map
|
|
31193
31207
|
|
|
31194
|
-
//# sourceMappingURL=default-text-tool.config-
|
|
31208
|
+
//# sourceMappingURL=default-text-tool.config-2YFQA3SF.js.map
|