modern-canvas 0.9.6 → 0.10.1
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 +51 -8
- package/dist/index.d.cts +130 -125
- package/dist/index.d.mts +130 -125
- package/dist/index.d.ts +130 -125
- package/dist/index.js +57 -30
- package/dist/index.mjs +51 -8
- package/package.json +13 -13
package/dist/index.mjs
CHANGED
|
@@ -5753,6 +5753,47 @@ class Children {
|
|
|
5753
5753
|
}
|
|
5754
5754
|
}
|
|
5755
5755
|
|
|
5756
|
+
class Meta extends CoreObject {
|
|
5757
|
+
constructor(parent) {
|
|
5758
|
+
super();
|
|
5759
|
+
this.parent = parent;
|
|
5760
|
+
return new Proxy(this, {
|
|
5761
|
+
get: (target, prop, receiver) => {
|
|
5762
|
+
if (Reflect.has(target, prop)) {
|
|
5763
|
+
return Reflect.get(target, prop, receiver);
|
|
5764
|
+
}
|
|
5765
|
+
return target.getProperty(String(prop));
|
|
5766
|
+
},
|
|
5767
|
+
set: (target, prop, value, receiver) => {
|
|
5768
|
+
if (Reflect.has(target, prop)) {
|
|
5769
|
+
return Reflect.set(target, prop, value, receiver);
|
|
5770
|
+
}
|
|
5771
|
+
target.setProperty(String(prop), value);
|
|
5772
|
+
return true;
|
|
5773
|
+
},
|
|
5774
|
+
deleteProperty: (target, prop) => {
|
|
5775
|
+
if (Reflect.has(target, prop)) {
|
|
5776
|
+
return Reflect.deleteProperty(target, prop);
|
|
5777
|
+
}
|
|
5778
|
+
target.setProperty(String(prop), void 0);
|
|
5779
|
+
return true;
|
|
5780
|
+
}
|
|
5781
|
+
});
|
|
5782
|
+
}
|
|
5783
|
+
getPropertyDeclarations() {
|
|
5784
|
+
const declarations = /* @__PURE__ */ new Map();
|
|
5785
|
+
this._properties.forEach((_value, key) => {
|
|
5786
|
+
declarations.set(key, {
|
|
5787
|
+
internalKey: `____${key}`
|
|
5788
|
+
});
|
|
5789
|
+
});
|
|
5790
|
+
return declarations;
|
|
5791
|
+
}
|
|
5792
|
+
getPropertyDeclaration(key) {
|
|
5793
|
+
return { internalKey: `____${key}` };
|
|
5794
|
+
}
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5756
5797
|
var __defProp$L = Object.defineProperty;
|
|
5757
5798
|
var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor;
|
|
5758
5799
|
var __decorateClass$T = (decorators, target, key, kind) => {
|
|
@@ -5771,6 +5812,13 @@ function getNodeIid(key) {
|
|
|
5771
5812
|
return iid;
|
|
5772
5813
|
}
|
|
5773
5814
|
let Node = class extends CoreObject {
|
|
5815
|
+
_meta = new Meta(this);
|
|
5816
|
+
get meta() {
|
|
5817
|
+
return this._meta;
|
|
5818
|
+
}
|
|
5819
|
+
set meta(value) {
|
|
5820
|
+
this._meta.resetProperties().setProperties(value);
|
|
5821
|
+
}
|
|
5774
5822
|
_readyed = false;
|
|
5775
5823
|
constructor(properties, nodes = []) {
|
|
5776
5824
|
super();
|
|
@@ -5793,9 +5841,7 @@ let Node = class extends CoreObject {
|
|
|
5793
5841
|
...restProperties
|
|
5794
5842
|
} = properties;
|
|
5795
5843
|
if (meta) {
|
|
5796
|
-
|
|
5797
|
-
this.meta[key] = meta[key];
|
|
5798
|
-
}
|
|
5844
|
+
this.meta = meta;
|
|
5799
5845
|
}
|
|
5800
5846
|
super.setProperties(restProperties);
|
|
5801
5847
|
}
|
|
@@ -6252,7 +6298,7 @@ let Node = class extends CoreObject {
|
|
|
6252
6298
|
...super.toJSON(),
|
|
6253
6299
|
children: this.children.length ? [...this.children.map((child) => child.toJSON())] : void 0,
|
|
6254
6300
|
meta: {
|
|
6255
|
-
...this.meta,
|
|
6301
|
+
...this.meta.toJSON(),
|
|
6256
6302
|
inCanvasIs: this.is
|
|
6257
6303
|
}
|
|
6258
6304
|
});
|
|
@@ -6275,9 +6321,6 @@ __decorateClass$T([
|
|
|
6275
6321
|
__decorateClass$T([
|
|
6276
6322
|
property({ fallback: idGenerator() })
|
|
6277
6323
|
], Node.prototype, "name", 2);
|
|
6278
|
-
__decorateClass$T([
|
|
6279
|
-
property({ default: () => ({}) })
|
|
6280
|
-
], Node.prototype, "meta", 2);
|
|
6281
6324
|
__decorateClass$T([
|
|
6282
6325
|
property({ internal: true, fallback: "inherit" })
|
|
6283
6326
|
], Node.prototype, "processMode", 2);
|
|
@@ -7210,7 +7253,7 @@ __decorateClass$M([
|
|
|
7210
7253
|
property({ internal: true, fallback: false })
|
|
7211
7254
|
], SceneTree.prototype, "processPaused");
|
|
7212
7255
|
__decorateClass$M([
|
|
7213
|
-
property({ internal: true,
|
|
7256
|
+
property({ internal: true, default: () => fonts })
|
|
7214
7257
|
], SceneTree.prototype, "fonts");
|
|
7215
7258
|
__decorateClass$M([
|
|
7216
7259
|
property({ internal: true, default: () => new Timeline() })
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-canvas",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@
|
|
4
|
+
"version": "0.10.1",
|
|
5
|
+
"packageManager": "pnpm@10.18.1",
|
|
6
6
|
"description": "A JavaScript WebGL rendering engine.",
|
|
7
7
|
"author": "wxm",
|
|
8
8
|
"license": "MIT",
|
|
@@ -73,25 +73,25 @@
|
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"colord": "^2.9.3",
|
|
75
75
|
"earcut": "^3.0.2",
|
|
76
|
-
"modern-font": "^0.4.
|
|
77
|
-
"modern-idoc": "^0.
|
|
78
|
-
"modern-path2d": "^1.4.
|
|
79
|
-
"modern-text": "^1.
|
|
76
|
+
"modern-font": "^0.4.4",
|
|
77
|
+
"modern-idoc": "^0.10.1",
|
|
78
|
+
"modern-path2d": "^1.4.10",
|
|
79
|
+
"modern-text": "^1.9.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@antfu/eslint-config": "^5.
|
|
82
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
83
83
|
"@types/earcut": "^3.0.0",
|
|
84
|
-
"@types/node": "^24.
|
|
85
|
-
"bumpp": "^10.
|
|
84
|
+
"@types/node": "^24.7.0",
|
|
85
|
+
"bumpp": "^10.3.1",
|
|
86
86
|
"conventional-changelog-cli": "^5.0.0",
|
|
87
|
-
"eslint": "^9.
|
|
88
|
-
"lint-staged": "^16.
|
|
87
|
+
"eslint": "^9.37.0",
|
|
88
|
+
"lint-staged": "^16.2.3",
|
|
89
89
|
"lottie-web": "^5.13.0",
|
|
90
90
|
"modern-gif": "^2.0.4",
|
|
91
91
|
"simple-git-hooks": "^2.13.1",
|
|
92
|
-
"typescript": "^5.9.
|
|
92
|
+
"typescript": "^5.9.3",
|
|
93
93
|
"unbuild": "^3.6.1",
|
|
94
|
-
"vite": "^7.1.
|
|
94
|
+
"vite": "^7.1.9",
|
|
95
95
|
"vitest": "^3.2.4",
|
|
96
96
|
"yoga-layout": "^3.2.1"
|
|
97
97
|
},
|