kritzel-stencil 0.0.165 → 0.0.167
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-line-tool.config-DEuVgTP4.js → default-line-tool.config-BNBO4I1t.js} +47 -32
- package/dist/cjs/default-line-tool.config-BNBO4I1t.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-color_22.cjs.entry.js +62 -34
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/tools/brush-tool.class.js +45 -30
- package/dist/collection/classes/tools/brush-tool.class.js.map +1 -1
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +2 -1
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +25 -2
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js.map +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +48 -22
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js.map +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +2 -16
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +8 -9
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js.map +1 -1
- package/dist/components/index.js +3 -3
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-editor.js +8 -8
- 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-portal.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/{p-BuS7MM1j.js → p-BmdYFhLx.js} +4 -4
- package/dist/components/{p-BuS7MM1j.js.map → p-BmdYFhLx.js.map} +1 -1
- package/dist/components/{p-DguzZn_x.js → p-BoazmhlG.js} +4 -4
- package/dist/components/{p-DguzZn_x.js.map → p-BoazmhlG.js.map} +1 -1
- package/dist/components/{p-Dz2XHHqa.js → p-Bwv1dxAB.js} +47 -32
- package/dist/components/{p-Dz2XHHqa.js.map → p-Bwv1dxAB.js.map} +1 -1
- package/dist/components/{p-9Fzdviju.js → p-C1S1zPH-.js} +30 -23
- package/dist/components/p-C1S1zPH-.js.map +1 -0
- package/dist/components/{p-BDX0tuVV.js → p-CIXaR1a8.js} +3 -3
- package/dist/components/{p-BDX0tuVV.js.map → p-CIXaR1a8.js.map} +1 -1
- package/dist/components/{p-I3iPEDpx.js → p-CiM-IPaD.js} +5 -5
- package/dist/components/{p-I3iPEDpx.js.map → p-CiM-IPaD.js.map} +1 -1
- package/dist/components/{p-OFrACpZf.js → p-aeYt0bPO.js} +27 -4
- package/dist/components/p-aeYt0bPO.js.map +1 -0
- package/dist/components/{p-tp96UZ0l.js → p-xcQV8l_c.js} +13 -14
- package/dist/components/p-xcQV8l_c.js.map +1 -0
- package/dist/esm/{default-line-tool.config-D-XCKjDC.js → default-line-tool.config-DJ488kil.js} +47 -32
- package/dist/esm/default-line-tool.config-DJ488kil.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/kritzel-color_22.entry.js +62 -34
- 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-DJ488kil.js +2 -0
- package/dist/stencil/p-DJ488kil.js.map +1 -0
- package/dist/stencil/{p-eac6fcb8.entry.js → p-a9f3c47e.entry.js} +3 -3
- package/dist/stencil/p-a9f3c47e.entry.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/tools/brush-tool.class.d.ts +1 -0
- package/dist/types/components/shared/kritzel-tooltip/kritzel-tooltip.d.ts +2 -1
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/cjs/default-line-tool.config-DEuVgTP4.js.map +0 -1
- package/dist/components/p-9Fzdviju.js.map +0 -1
- package/dist/components/p-OFrACpZf.js.map +0 -1
- package/dist/components/p-tp96UZ0l.js.map +0 -1
- package/dist/esm/default-line-tool.config-D-XCKjDC.js.map +0 -1
- package/dist/stencil/p-D-XCKjDC.js +0 -2
- package/dist/stencil/p-D-XCKjDC.js.map +0 -1
- package/dist/stencil/p-eac6fcb8.entry.js.map +0 -1
package/dist/cjs/{default-line-tool.config-DEuVgTP4.js → default-line-tool.config-BNBO4I1t.js}
RENAMED
|
@@ -15300,9 +15300,10 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
15300
15300
|
color = '#000000';
|
|
15301
15301
|
size = 6;
|
|
15302
15302
|
palettes = {
|
|
15303
|
-
pen: ['#000000', '#FFFFFF', '#FF0000', '#00FF00', '#0000FF', '#FFFF00', '#FF00FF', '#00FFFF', '#808080', '#C0C0C0', '#800000', '#008000', '#000080', '#
|
|
15303
|
+
pen: ['#000000', '#FFFFFF', '#FF0000', '#00FF00', '#0000FF', '#FFFF00', '#FF00FF', '#00FFFF', '#808080', '#C0C0C0', '#800000', '#008000', '#000080', '#800080'],
|
|
15304
15304
|
highlighter: ['#ffff00', '#ffb347', '#b4ffb4'],
|
|
15305
15305
|
};
|
|
15306
|
+
_currentPathId = null;
|
|
15306
15307
|
constructor(core) {
|
|
15307
15308
|
super(core);
|
|
15308
15309
|
}
|
|
@@ -15324,6 +15325,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
15324
15325
|
strokeWidth: this.size,
|
|
15325
15326
|
});
|
|
15326
15327
|
path.isCompleted = false;
|
|
15328
|
+
this._currentPathId = path.id;
|
|
15327
15329
|
this._core.store.state.objects.insert(path);
|
|
15328
15330
|
}
|
|
15329
15331
|
}
|
|
@@ -15342,6 +15344,7 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
15342
15344
|
strokeWidth: this.size,
|
|
15343
15345
|
});
|
|
15344
15346
|
path.isCompleted = false;
|
|
15347
|
+
this._currentPathId = path.id;
|
|
15345
15348
|
this._core.store.state.objects.insert(path);
|
|
15346
15349
|
}
|
|
15347
15350
|
}
|
|
@@ -15351,8 +15354,9 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
15351
15354
|
event.preventDefault();
|
|
15352
15355
|
}
|
|
15353
15356
|
if (event.pointerType === 'mouse') {
|
|
15354
|
-
if (this._core.store.state.isDrawing) {
|
|
15355
|
-
const
|
|
15357
|
+
if (this._core.store.state.isDrawing && this._currentPathId) {
|
|
15358
|
+
const matchingObjects = this._core.store.state.objects.filter(o => o.id === this._currentPathId);
|
|
15359
|
+
const currentPath = matchingObjects.length > 0 ? matchingObjects[0] : null;
|
|
15356
15360
|
if (currentPath) {
|
|
15357
15361
|
const x = event.clientX - this._core.store.offsetX;
|
|
15358
15362
|
const y = event.clientY - this._core.store.offsetY;
|
|
@@ -15375,23 +15379,26 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
15375
15379
|
if (event.pointerType === 'touch') {
|
|
15376
15380
|
const activePointers = Array.from(this._core.store.state.pointers.values());
|
|
15377
15381
|
if (activePointers.length === 1) {
|
|
15378
|
-
|
|
15379
|
-
|
|
15380
|
-
const
|
|
15381
|
-
|
|
15382
|
-
|
|
15383
|
-
|
|
15384
|
-
|
|
15385
|
-
|
|
15386
|
-
|
|
15387
|
-
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
|
|
15382
|
+
if (this._currentPathId) {
|
|
15383
|
+
const matchingObjects = this._core.store.state.objects.filter(o => o.id === this._currentPathId);
|
|
15384
|
+
const currentPath = matchingObjects.length > 0 ? matchingObjects[0] : null;
|
|
15385
|
+
if (currentPath) {
|
|
15386
|
+
const x = Math.round(activePointers[0].clientX - this._core.store.offsetX);
|
|
15387
|
+
const y = Math.round(activePointers[0].clientY - this._core.store.offsetY);
|
|
15388
|
+
const updatedPath = KritzelPath.create(this._core, {
|
|
15389
|
+
points: [...currentPath.points, [x, y]],
|
|
15390
|
+
translateX: -this._core.store.state.translateX,
|
|
15391
|
+
translateY: -this._core.store.state.translateY,
|
|
15392
|
+
scale: this._core.store.state.scale,
|
|
15393
|
+
fill: this.color,
|
|
15394
|
+
strokeWidth: this.size,
|
|
15395
|
+
});
|
|
15396
|
+
updatedPath.id = currentPath.id;
|
|
15397
|
+
updatedPath.workspaceId = currentPath.workspaceId;
|
|
15398
|
+
updatedPath.zIndex = currentPath.zIndex;
|
|
15399
|
+
updatedPath.isCompleted = false;
|
|
15400
|
+
this._core.store.state.objects.update(updatedPath);
|
|
15401
|
+
}
|
|
15395
15402
|
}
|
|
15396
15403
|
}
|
|
15397
15404
|
}
|
|
@@ -15403,22 +15410,30 @@ class KritzelBrushTool extends KritzelBaseTool {
|
|
|
15403
15410
|
if (event.pointerType === 'mouse') {
|
|
15404
15411
|
if (this._core.store.state.isDrawing) {
|
|
15405
15412
|
this._core.store.state.isDrawing = false;
|
|
15406
|
-
|
|
15407
|
-
|
|
15408
|
-
currentPath
|
|
15409
|
-
|
|
15410
|
-
|
|
15413
|
+
if (this._currentPathId) {
|
|
15414
|
+
const matchingObjects = this._core.store.state.objects.filter(o => o.id === this._currentPathId);
|
|
15415
|
+
const currentPath = matchingObjects.length > 0 ? matchingObjects[0] : null;
|
|
15416
|
+
if (currentPath) {
|
|
15417
|
+
currentPath.isCompleted = true;
|
|
15418
|
+
this._core.store.state.objects.update(currentPath);
|
|
15419
|
+
this._core.engine.emitObjectsChange();
|
|
15420
|
+
}
|
|
15421
|
+
this._currentPathId = null;
|
|
15411
15422
|
}
|
|
15412
15423
|
}
|
|
15413
15424
|
}
|
|
15414
15425
|
if (event.pointerType === 'touch') {
|
|
15415
15426
|
if (this._core.store.state.isDrawing) {
|
|
15416
15427
|
this._core.store.state.isDrawing = false;
|
|
15417
|
-
|
|
15418
|
-
|
|
15419
|
-
currentPath
|
|
15420
|
-
|
|
15421
|
-
|
|
15428
|
+
if (this._currentPathId) {
|
|
15429
|
+
const matchingObjects = this._core.store.state.objects.filter(o => o.id === this._currentPathId);
|
|
15430
|
+
const currentPath = matchingObjects.length > 0 ? matchingObjects[0] : null;
|
|
15431
|
+
if (currentPath) {
|
|
15432
|
+
currentPath.isCompleted = true;
|
|
15433
|
+
this._core.store.state.objects.update(currentPath);
|
|
15434
|
+
this._core.engine.emitObjectsChange();
|
|
15435
|
+
}
|
|
15436
|
+
this._currentPathId = null;
|
|
15422
15437
|
}
|
|
15423
15438
|
}
|
|
15424
15439
|
}
|
|
@@ -33917,6 +33932,6 @@ exports.varStorage = varStorage;
|
|
|
33917
33932
|
exports.writeVarString = writeVarString$2;
|
|
33918
33933
|
exports.writeVarUint = writeVarUint$2;
|
|
33919
33934
|
exports.writeVarUint8Array = writeVarUint8Array$2;
|
|
33920
|
-
//# sourceMappingURL=default-line-tool.config-
|
|
33935
|
+
//# sourceMappingURL=default-line-tool.config-BNBO4I1t.js.map
|
|
33921
33936
|
|
|
33922
|
-
//# sourceMappingURL=default-line-tool.config-
|
|
33937
|
+
//# sourceMappingURL=default-line-tool.config-BNBO4I1t.js.map
|