modern-canvas 0.6.2 → 0.6.4
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.cjs +16 -14
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -11
- package/dist/index.mjs +16 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5657,6 +5657,7 @@ function getNodeIid(key) {
|
|
|
5657
5657
|
return iid;
|
|
5658
5658
|
}
|
|
5659
5659
|
exports.Node = class Node extends CoreObject {
|
|
5660
|
+
meta = {};
|
|
5660
5661
|
_readyed = false;
|
|
5661
5662
|
constructor(properties, nodes = []) {
|
|
5662
5663
|
super();
|
|
@@ -6109,7 +6110,8 @@ exports.Node = class Node extends CoreObject {
|
|
|
6109
6110
|
return modernIdoc.clearUndef({
|
|
6110
6111
|
...super.toJSON(),
|
|
6111
6112
|
is: this.is,
|
|
6112
|
-
children: this._children.length ? [...this._children.map((child) => child.toJSON())] : void 0
|
|
6113
|
+
children: this._children.length ? [...this._children.map((child) => child.toJSON())] : void 0,
|
|
6114
|
+
meta: Object.keys(this.meta).length ? { ...this.meta } : void 0
|
|
6113
6115
|
});
|
|
6114
6116
|
}
|
|
6115
6117
|
static parse(value) {
|
|
@@ -6141,9 +6143,6 @@ __decorateClass$Q([
|
|
|
6141
6143
|
__decorateClass$Q([
|
|
6142
6144
|
modernIdoc.property({ fallback: "default" })
|
|
6143
6145
|
], exports.Node.prototype, "internalMode", 2);
|
|
6144
|
-
__decorateClass$Q([
|
|
6145
|
-
modernIdoc.property({ default: () => ({}) })
|
|
6146
|
-
], exports.Node.prototype, "meta", 2);
|
|
6147
6146
|
__decorateClass$Q([
|
|
6148
6147
|
modernIdoc.property({ protected: true })
|
|
6149
6148
|
], exports.Node.prototype, "mask", 2);
|
|
@@ -9546,7 +9545,10 @@ var __decorateClass$l = (decorators, target, key, kind) => {
|
|
|
9546
9545
|
return result;
|
|
9547
9546
|
};
|
|
9548
9547
|
exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
9549
|
-
size = new Vector2().on("update", () =>
|
|
9548
|
+
size = new Vector2().on("update", () => {
|
|
9549
|
+
this.updateGlobalTransform();
|
|
9550
|
+
this.requestRedraw();
|
|
9551
|
+
});
|
|
9550
9552
|
get style() {
|
|
9551
9553
|
return this._style;
|
|
9552
9554
|
}
|
|
@@ -9640,15 +9642,6 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
|
9640
9642
|
return this;
|
|
9641
9643
|
}
|
|
9642
9644
|
_updateStyleProperty(key, value, _oldValue, _declaration) {
|
|
9643
|
-
switch (key) {
|
|
9644
|
-
case "width":
|
|
9645
|
-
case "height":
|
|
9646
|
-
if (this.mask instanceof exports.BaseElement2D) {
|
|
9647
|
-
this.mask.size.x = this.size.x;
|
|
9648
|
-
this.mask.size.y = this.size.y;
|
|
9649
|
-
}
|
|
9650
|
-
break;
|
|
9651
|
-
}
|
|
9652
9645
|
switch (key) {
|
|
9653
9646
|
case "rotate":
|
|
9654
9647
|
this.rotation = this.style.rotate * DEG_TO_RAD;
|
|
@@ -9941,6 +9934,15 @@ exports.Element2D = class Element2D extends exports.BaseElement2D {
|
|
|
9941
9934
|
this.size.height = Number(value);
|
|
9942
9935
|
break;
|
|
9943
9936
|
}
|
|
9937
|
+
switch (key) {
|
|
9938
|
+
case "width":
|
|
9939
|
+
case "height":
|
|
9940
|
+
if (this.mask instanceof exports.BaseElement2D) {
|
|
9941
|
+
this.mask.size.width = this.size.width;
|
|
9942
|
+
this.mask.size.height = this.size.height;
|
|
9943
|
+
}
|
|
9944
|
+
break;
|
|
9945
|
+
}
|
|
9944
9946
|
}
|
|
9945
9947
|
};
|
|
9946
9948
|
exports.Element2D = __decorateClass$k([
|
package/dist/index.d.cts
CHANGED
|
@@ -1643,8 +1643,8 @@ declare class Node extends CoreObject {
|
|
|
1643
1643
|
processSortMode: ProcessSortMode;
|
|
1644
1644
|
renderMode: RenderMode;
|
|
1645
1645
|
internalMode: InternalMode;
|
|
1646
|
-
meta: Record<string, any>;
|
|
1647
1646
|
mask?: Maskable;
|
|
1647
|
+
readonly meta: Record<string, any>;
|
|
1648
1648
|
protected _readyed: boolean;
|
|
1649
1649
|
constructor(properties?: Partial<NodeProperties>, nodes?: Node[]);
|
|
1650
1650
|
setProperties(properties?: Record<string, any>): this;
|
package/dist/index.d.mts
CHANGED
|
@@ -1643,8 +1643,8 @@ declare class Node extends CoreObject {
|
|
|
1643
1643
|
processSortMode: ProcessSortMode;
|
|
1644
1644
|
renderMode: RenderMode;
|
|
1645
1645
|
internalMode: InternalMode;
|
|
1646
|
-
meta: Record<string, any>;
|
|
1647
1646
|
mask?: Maskable;
|
|
1647
|
+
readonly meta: Record<string, any>;
|
|
1648
1648
|
protected _readyed: boolean;
|
|
1649
1649
|
constructor(properties?: Partial<NodeProperties>, nodes?: Node[]);
|
|
1650
1650
|
setProperties(properties?: Record<string, any>): this;
|
package/dist/index.d.ts
CHANGED
|
@@ -1643,8 +1643,8 @@ declare class Node extends CoreObject {
|
|
|
1643
1643
|
processSortMode: ProcessSortMode;
|
|
1644
1644
|
renderMode: RenderMode;
|
|
1645
1645
|
internalMode: InternalMode;
|
|
1646
|
-
meta: Record<string, any>;
|
|
1647
1646
|
mask?: Maskable;
|
|
1647
|
+
readonly meta: Record<string, any>;
|
|
1648
1648
|
protected _readyed: boolean;
|
|
1649
1649
|
constructor(properties?: Partial<NodeProperties>, nodes?: Node[]);
|
|
1650
1650
|
setProperties(properties?: Record<string, any>): this;
|