canvas-editor-engine 2.3.23 → 2.3.25
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/index.mjs
CHANGED
@@ -2564,18 +2564,24 @@ var Painter = function() {
|
|
2564
2564
|
|
2565
2565
|
var DrawAccumulatorService = function() {
|
2566
2566
|
function DrawAccumulatorService(appConfig, appStoreRepository, eventService, drawLayersService) {
|
2567
|
+
var _this = this;
|
2567
2568
|
this.appConfig = appConfig;
|
2568
2569
|
this.appStoreRepository = appStoreRepository;
|
2569
2570
|
this.eventService = eventService;
|
2570
2571
|
this.drawLayersService = drawLayersService;
|
2571
|
-
this.painters = new Proxy(
|
2572
|
+
this.painters = new Proxy({
|
2573
|
+
value: [],
|
2574
|
+
filter: function(callback) {
|
2575
|
+
_this.value = _this.value.filter(callback);
|
2576
|
+
}
|
2577
|
+
}, {
|
2572
2578
|
get: function(target, name) {
|
2573
|
-
return target
|
2579
|
+
return target;
|
2574
2580
|
},
|
2575
2581
|
set: function(target, name, value) {
|
2576
2582
|
try {
|
2577
2583
|
if (typeof (value === null || value === void 0 ? void 0 : value.object) !== "undefined") {
|
2578
|
-
target[
|
2584
|
+
target["value"] = value.object;
|
2579
2585
|
value.update();
|
2580
2586
|
return true;
|
2581
2587
|
} else {
|
@@ -2586,7 +2592,7 @@ var DrawAccumulatorService = function() {
|
|
2586
2592
|
var MIN_LENGTH = -1;
|
2587
2593
|
var MAX_LENGTH = __spreadArray([], Object.keys(target), true);
|
2588
2594
|
if (value <= Math.max.apply(Math, __spreadArray([ MIN_LENGTH ], MAX_LENGTH, false)) + 1) {
|
2589
|
-
target.length = value;
|
2595
|
+
target["value"].length = value;
|
2590
2596
|
}
|
2591
2597
|
}
|
2592
2598
|
return true;
|
@@ -2611,7 +2617,7 @@ var DrawAccumulatorService = function() {
|
|
2611
2617
|
});
|
2612
2618
|
painter.drawService.bindOptions(drawType, options);
|
2613
2619
|
painter.drawService.tempCanvas.bindOptions(initialSize);
|
2614
|
-
this.painters.push({
|
2620
|
+
this.painters.value.push({
|
2615
2621
|
object: painter,
|
2616
2622
|
update: this.update.bind(this)
|
2617
2623
|
});
|
@@ -2625,11 +2631,11 @@ var DrawAccumulatorService = function() {
|
|
2625
2631
|
return __awaiter(this, void 0, void 0, (function() {
|
2626
2632
|
var painter;
|
2627
2633
|
return __generator(this, (function(_a) {
|
2628
|
-
painter = this.painters.find((function(painter) {
|
2634
|
+
painter = this.painters.value.find((function(painter) {
|
2629
2635
|
return painter.id === painterId;
|
2630
2636
|
}));
|
2631
2637
|
if (!!painter) {
|
2632
|
-
this.painters
|
2638
|
+
this.painters.value.filter((function(painter) {
|
2633
2639
|
return painter.id !== painterId;
|
2634
2640
|
}));
|
2635
2641
|
}
|
@@ -2639,7 +2645,7 @@ var DrawAccumulatorService = function() {
|
|
2639
2645
|
}));
|
2640
2646
|
};
|
2641
2647
|
DrawAccumulatorService.prototype.renamePainter = function(painterId, name) {
|
2642
|
-
var painter = this.painters.find((function(painter) {
|
2648
|
+
var painter = this.painters.value.find((function(painter) {
|
2643
2649
|
return painter.id === painterId;
|
2644
2650
|
}));
|
2645
2651
|
if (painter) {
|
@@ -2657,7 +2663,7 @@ var DrawAccumulatorService = function() {
|
|
2657
2663
|
return __generator(this, (function(_a) {
|
2658
2664
|
useStore = smoothFilterOptions.useStore, options = smoothFilterOptions.options,
|
2659
2665
|
filterOptions = smoothFilterOptions.filterOptions;
|
2660
|
-
painter = this.painters.find((function(painter) {
|
2666
|
+
painter = this.painters.value.find((function(painter) {
|
2661
2667
|
return painter.id === painterId;
|
2662
2668
|
}));
|
2663
2669
|
if (!painter) return [ 2 ];
|
@@ -2691,7 +2697,7 @@ var DrawAccumulatorService = function() {
|
|
2691
2697
|
get: function() {
|
2692
2698
|
var _this = this;
|
2693
2699
|
var gradient = [];
|
2694
|
-
this.painters.forEach((function(painter) {
|
2700
|
+
this.painters.value.forEach((function(painter) {
|
2695
2701
|
var layer = _this.drawLayersService.layerList.find((function(layer) {
|
2696
2702
|
return layer.painters.includes(painter);
|
2697
2703
|
}));
|
@@ -2715,7 +2721,7 @@ var DrawAccumulatorService = function() {
|
|
2715
2721
|
var _this = this;
|
2716
2722
|
var stash = [];
|
2717
2723
|
this.gradient.forEach((function(order) {
|
2718
|
-
_this.painters.forEach((function(painter) {
|
2724
|
+
_this.painters.value.forEach((function(painter) {
|
2719
2725
|
var layer = _this.drawLayersService.layerList.find((function(layer) {
|
2720
2726
|
return layer.painters.includes(painter);
|
2721
2727
|
}));
|
@@ -12,7 +12,10 @@ export default class DrawAccumulatorService {
|
|
12
12
|
private appStoreRepository;
|
13
13
|
private eventService;
|
14
14
|
private drawLayersService;
|
15
|
-
painters:
|
15
|
+
painters: {
|
16
|
+
value: Painter[];
|
17
|
+
filter: (callback: any) => void;
|
18
|
+
};
|
16
19
|
constructor(appConfig: AppConfig, appStoreRepository: AppStoreRepository, eventService: EventService, drawLayersService: DrawLayersService);
|
17
20
|
add<DrawType extends TDrawType>(layerId: ILayer['id'], drawType: DrawType, options: DrawService['options'][DrawType], initialSize: ITempCanvasOptions): Promise<void>;
|
18
21
|
removePainter(painterId: string): Promise<void>;
|