modern-canvas 0.10.0 → 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.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
- for (const key in meta) {
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.10.0",
4
+ "version": "0.10.1",
5
5
  "packageManager": "pnpm@10.18.1",
6
6
  "description": "A JavaScript WebGL rendering engine.",
7
7
  "author": "wxm",