modern-canvas 0.8.8 → 0.8.9

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
@@ -5977,6 +5977,19 @@ let Node = class extends CoreObject {
5977
5977
  return false;
5978
5978
  }
5979
5979
  }
5980
+ canInput() {
5981
+ if (!this._tree)
5982
+ return false;
5983
+ switch (this.inputMode) {
5984
+ case "inherit":
5985
+ return this._parent?.canInput() ?? true;
5986
+ case "always":
5987
+ return true;
5988
+ case "disabled":
5989
+ default:
5990
+ return false;
5991
+ }
5992
+ }
5980
5993
  canRender() {
5981
5994
  if (!this._tree)
5982
5995
  return false;
@@ -6087,7 +6100,9 @@ let Node = class extends CoreObject {
6087
6100
  if (event.propagationStopped) {
6088
6101
  return;
6089
6102
  }
6090
- this._input(event, key);
6103
+ if (this.canInput()) {
6104
+ this._input(event, key);
6105
+ }
6091
6106
  }
6092
6107
  getIndex() {
6093
6108
  return this._parent?.children.getInternal(this.internalMode).indexOf(this) ?? 0;
@@ -6311,6 +6326,9 @@ __decorateClass$S([
6311
6326
  __decorateClass$S([
6312
6327
  property({ protected: true, fallback: "inherit" })
6313
6328
  ], Node.prototype, "renderMode", 2);
6329
+ __decorateClass$S([
6330
+ property({ protected: true, fallback: "inherit" })
6331
+ ], Node.prototype, "inputMode", 2);
6314
6332
  __decorateClass$S([
6315
6333
  property({ protected: true, fallback: "default" })
6316
6334
  ], Node.prototype, "internalMode", 2);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.8.8",
4
+ "version": "0.8.9",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "A JavaScript WebGL rendering engine.",
7
7
  "author": "wxm",