@vnejs/plugins.canvas.child.fill 0.2.2 → 0.2.3

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.
@@ -20,7 +20,7 @@ export class LayerFillState extends ModuleCore {
20
20
  };
21
21
  onFillStateGet = ({ id } = {}) => this.state.fills.find((item) => item.id === id);
22
22
  onStateSet = async (payload) => {
23
- const clonedState = await this.emitClone(this.getStateSlice(payload));
23
+ const clonedState = structuredClone(this.getStateSlice(payload));
24
24
  const oldFillsByLayer = this.state.fills.reduce(this.getFillsByLayerFromState, {});
25
25
  const newFillsByLayer = clonedState.fills.reduce(this.getFillsByLayerFromState, {});
26
26
  const [promises, uniqLayers, oldLayers, newLayers] = [
@@ -51,9 +51,9 @@ export class LayerFillState extends ModuleCore {
51
51
  await Promise.all(this.state.fills.map(this.cloneFillAndHide));
52
52
  this.shared.viewForceAnimationSources.rm(`${this.name}.clear`);
53
53
  };
54
- cloneFillAndChange = async (fill) => this.emitEventWithFill(await this.emitClone(fill), this.emitFillChange);
55
- cloneFillAndHide = async (fill) => this.emitEventWithFill(await this.emitClone(fill), this.emitFillHide);
56
- cloneFillAndShow = async (fill) => this.emitEventWithFill(await this.emitClone(fill), this.emitFillShow);
54
+ cloneFillAndChange = async (fill) => this.emitEventWithFill(structuredClone(fill), this.emitFillChange);
55
+ cloneFillAndHide = async (fill) => this.emitEventWithFill(structuredClone(fill), this.emitFillHide);
56
+ cloneFillAndShow = async (fill) => this.emitEventWithFill(structuredClone(fill), this.emitFillShow);
57
57
  emitFillChange = (fill) => this.emit(this.EVENTS.LAYER_FILL.CHANGE, { ...fill, duration: 0 });
58
58
  emitFillHide = (fill) => this.emit(this.EVENTS.LAYER_FILL.HIDE, fill);
59
59
  emitFillShow = (fill) => this.emit(this.EVENTS.LAYER_FILL.SHOW, fill);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.canvas.child.fill",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,7 +31,7 @@ export class LayerFillState extends ModuleCore<FillPluginEvents, FillPluginConst
31
31
  onFillStateGet = ({ id }: FillStateIdPayload = {}) => this.state.fills.find((item) => item.id === id);
32
32
 
33
33
  onStateSet = async (payload: ModuleGlobalStateRegistry) => {
34
- const clonedState = await this.emitClone<FillState>(this.getStateSlice(payload));
34
+ const clonedState = structuredClone(this.getStateSlice(payload));
35
35
 
36
36
  const oldFillsByLayer = this.state.fills.reduce(this.getFillsByLayerFromState, {} as Record<string, FillRecord[]>);
37
37
  const newFillsByLayer = clonedState.fills.reduce(this.getFillsByLayerFromState, {} as Record<string, FillRecord[]>);
@@ -71,11 +71,11 @@ export class LayerFillState extends ModuleCore<FillPluginEvents, FillPluginConst
71
71
  this.shared.viewForceAnimationSources.rm(`${this.name}.clear`);
72
72
  };
73
73
 
74
- cloneFillAndChange = async (fill: FillRecord) => this.emitEventWithFill(await this.emitClone<FillRecord>(fill), this.emitFillChange);
74
+ cloneFillAndChange = async (fill: FillRecord) => this.emitEventWithFill(structuredClone(fill), this.emitFillChange);
75
75
 
76
- cloneFillAndHide = async (fill: FillRecord) => this.emitEventWithFill(await this.emitClone<FillRecord>(fill), this.emitFillHide);
76
+ cloneFillAndHide = async (fill: FillRecord) => this.emitEventWithFill(structuredClone(fill), this.emitFillHide);
77
77
 
78
- cloneFillAndShow = async (fill: FillRecord) => this.emitEventWithFill(await this.emitClone<FillRecord>(fill), this.emitFillShow);
78
+ cloneFillAndShow = async (fill: FillRecord) => this.emitEventWithFill(structuredClone(fill), this.emitFillShow);
79
79
 
80
80
  emitFillChange = (fill: FillRecord) => this.emit(this.EVENTS.LAYER_FILL.CHANGE, { ...fill, duration: 0 });
81
81
  emitFillHide = (fill: FillRecord) => this.emit(this.EVENTS.LAYER_FILL.HIDE, fill);