modern-canvas 0.8.8 → 0.8.10

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 CHANGED
@@ -5752,23 +5752,23 @@ class CanvasContext extends modernPath2d.Path2D {
5752
5752
  }
5753
5753
  }
5754
5754
 
5755
- class Children extends Array {
5755
+ class Children {
5756
5756
  front = [];
5757
+ default = [];
5757
5758
  back = [];
5758
5759
  get internal() {
5759
5760
  return [
5760
5761
  ...this.front,
5761
- ...this,
5762
+ ...this.default,
5762
5763
  ...this.back
5763
5764
  ];
5764
5765
  }
5765
5766
  constructor(...items) {
5766
- super();
5767
5767
  this.set(items);
5768
5768
  }
5769
5769
  set(items) {
5770
5770
  this.front.length = 0;
5771
- this.length = 0;
5771
+ this.default.length = 0;
5772
5772
  this.back.length = 0;
5773
5773
  items.forEach((item) => {
5774
5774
  switch (item.internalMode) {
@@ -5776,7 +5776,7 @@ class Children extends Array {
5776
5776
  this.front.push(item);
5777
5777
  break;
5778
5778
  case "default":
5779
- this.push(item);
5779
+ this.default.push(item);
5780
5780
  break;
5781
5781
  case "back":
5782
5782
  this.back.push(item);
@@ -5790,7 +5790,7 @@ class Children extends Array {
5790
5790
  case "front":
5791
5791
  return this.front;
5792
5792
  case "default":
5793
- return this;
5793
+ return this.default;
5794
5794
  case "back":
5795
5795
  return this.back;
5796
5796
  default:
@@ -5798,7 +5798,7 @@ class Children extends Array {
5798
5798
  }
5799
5799
  }
5800
5800
  toJSON() {
5801
- return [...this];
5801
+ return [...this.default];
5802
5802
  }
5803
5803
  }
5804
5804
 
@@ -5939,13 +5939,16 @@ exports.Node = class Node extends CoreObject {
5939
5939
  /** Children */
5940
5940
  _children = new Children();
5941
5941
  get children() {
5942
- return this._children;
5942
+ return this._children.default;
5943
5943
  }
5944
5944
  set children(value) {
5945
- value instanceof Children ? this._children = value : this._children.set(value);
5945
+ this._children.set(value);
5946
+ }
5947
+ getChildren(includeInternal) {
5948
+ return this._children.getInternal(includeInternal);
5946
5949
  }
5947
5950
  getChild(index = 0) {
5948
- return this._children[index];
5951
+ return this.children[index];
5949
5952
  }
5950
5953
  get siblingIndex() {
5951
5954
  return this.getIndex();
@@ -5983,6 +5986,19 @@ exports.Node = class Node extends CoreObject {
5983
5986
  return false;
5984
5987
  }
5985
5988
  }
5989
+ canInput() {
5990
+ if (!this._tree)
5991
+ return false;
5992
+ switch (this.inputMode) {
5993
+ case "inherit":
5994
+ return this._parent?.canInput() ?? true;
5995
+ case "always":
5996
+ return true;
5997
+ case "disabled":
5998
+ default:
5999
+ return false;
6000
+ }
6001
+ }
5986
6002
  canRender() {
5987
6003
  if (!this._tree)
5988
6004
  return false;
@@ -6093,10 +6109,12 @@ exports.Node = class Node extends CoreObject {
6093
6109
  if (event.propagationStopped) {
6094
6110
  return;
6095
6111
  }
6096
- this._input(event, key);
6112
+ if (this.canInput()) {
6113
+ this._input(event, key);
6114
+ }
6097
6115
  }
6098
6116
  getIndex() {
6099
- return this._parent?.children.getInternal(this.internalMode).indexOf(this) ?? 0;
6117
+ return this._parent?.getChildren(this.internalMode).indexOf(this) ?? 0;
6100
6118
  }
6101
6119
  getNode(path) {
6102
6120
  return this._children.internal.find((child) => child.name === path);
@@ -6172,7 +6190,7 @@ exports.Node = class Node extends CoreObject {
6172
6190
  this._children.front.push(node);
6173
6191
  break;
6174
6192
  case "default":
6175
- this._children.push(node);
6193
+ this._children.default.push(node);
6176
6194
  break;
6177
6195
  case "back":
6178
6196
  this._children.back.push(node);
@@ -6216,24 +6234,24 @@ exports.Node = class Node extends CoreObject {
6216
6234
  removeChild(child) {
6217
6235
  const index = child.getIndex();
6218
6236
  if (this.equal(child.parent) && index > -1) {
6219
- this._children.getInternal(child.internalMode).splice(index, 1);
6237
+ this.getChildren(child.internalMode).splice(index, 1);
6220
6238
  child.setParent(void 0);
6221
6239
  this.emit("removeChild", child, index);
6222
6240
  }
6223
6241
  return child;
6224
6242
  }
6225
6243
  removeChildren() {
6226
- this._children.forEach((child) => this.removeChild(child));
6244
+ this.children.forEach((child) => this.removeChild(child));
6227
6245
  }
6228
6246
  remove() {
6229
6247
  this._parent?.removeChild(this);
6230
6248
  }
6231
6249
  forEachChild(callbackfn) {
6232
- this._children.forEach(callbackfn);
6250
+ this.children.forEach(callbackfn);
6233
6251
  return this;
6234
6252
  }
6235
6253
  forEachDescendant(callbackfn) {
6236
- this._children.forEach((child) => {
6254
+ this.children.forEach((child) => {
6237
6255
  callbackfn(child);
6238
6256
  child.forEachDescendant(callbackfn);
6239
6257
  });
@@ -6280,7 +6298,7 @@ exports.Node = class Node extends CoreObject {
6280
6298
  toJSON() {
6281
6299
  return modernIdoc.clearUndef({
6282
6300
  ...super.toJSON(),
6283
- children: this._children.length ? [...this._children.map((child) => child.toJSON())] : void 0,
6301
+ children: this.children.length ? [...this.children.map((child) => child.toJSON())] : void 0,
6284
6302
  meta: {
6285
6303
  ...this.meta,
6286
6304
  inCanvasIs: this.is
@@ -6317,6 +6335,9 @@ __decorateClass$S([
6317
6335
  __decorateClass$S([
6318
6336
  modernIdoc.property({ protected: true, fallback: "inherit" })
6319
6337
  ], exports.Node.prototype, "renderMode", 2);
6338
+ __decorateClass$S([
6339
+ modernIdoc.property({ protected: true, fallback: "inherit" })
6340
+ ], exports.Node.prototype, "inputMode", 2);
6320
6341
  __decorateClass$S([
6321
6342
  modernIdoc.property({ protected: true, fallback: "default" })
6322
6343
  ], exports.Node.prototype, "internalMode", 2);
@@ -6875,7 +6896,7 @@ exports.Effect = class Effect extends exports.TimelineNode {
6875
6896
  calls.splice(start, 0, renderStack.createCall(this));
6876
6897
  }
6877
6898
  _processChildren() {
6878
- if (this._children.length) {
6899
+ if (this.children.length) {
6879
6900
  super.emit("process");
6880
6901
  this._tree?.renderStack.push(this);
6881
6902
  }
package/dist/index.d.cts CHANGED
@@ -1643,9 +1643,10 @@ declare class SceneTree extends MainLoop {
1643
1643
  free(): void;
1644
1644
  }
1645
1645
 
1646
- declare class Children<T extends Node = Node> extends Array<T> {
1647
- readonly front: T[];
1648
- readonly back: T[];
1646
+ declare class Children<T extends Node = Node> {
1647
+ front: T[];
1648
+ default: T[];
1649
+ back: T[];
1649
1650
  get internal(): T[];
1650
1651
  constructor(...items: T[]);
1651
1652
  set(items: T[]): this;
@@ -1675,6 +1676,7 @@ interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
1675
1676
  type ProcessMode = 'inherit' | 'pausable' | 'when_paused' | 'always' | 'disabled';
1676
1677
  type ProcessSortMode = 'default' | 'parent_before';
1677
1678
  type RenderMode = 'inherit' | 'always' | 'disabled';
1679
+ type InputMode = 'inherit' | 'always' | 'disabled';
1678
1680
  type InternalMode = 'default' | 'front' | 'back';
1679
1681
  interface NodeProperties {
1680
1682
  id: string;
@@ -1700,6 +1702,7 @@ declare class Node extends CoreObject {
1700
1702
  processMode: ProcessMode;
1701
1703
  processSortMode: ProcessSortMode;
1702
1704
  renderMode: RenderMode;
1705
+ inputMode: InputMode;
1703
1706
  internalMode: InternalMode;
1704
1707
  mask?: Maskable;
1705
1708
  protected _readyed: boolean;
@@ -1727,8 +1730,9 @@ declare class Node extends CoreObject {
1727
1730
  setParent<T extends Node = Node>(parent: T | undefined): this;
1728
1731
  /** Children */
1729
1732
  protected _children: Children<Node>;
1730
- get children(): Children;
1731
- set children(value: Node[] | Children);
1733
+ get children(): Node[];
1734
+ set children(value: Node[]);
1735
+ getChildren(includeInternal: InternalMode): Node[];
1732
1736
  getChild<T extends Node = Node>(index?: number): T | undefined;
1733
1737
  get siblingIndex(): number;
1734
1738
  set siblingIndex(toIndex: number);
@@ -1737,6 +1741,7 @@ declare class Node extends CoreObject {
1737
1741
  get firstSibling(): Node | undefined;
1738
1742
  get lastSibling(): Node | undefined;
1739
1743
  canProcess(): boolean;
1744
+ canInput(): boolean;
1740
1745
  canRender(): boolean;
1741
1746
  protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1742
1747
  protected _onTreeEnter(tree: SceneTree): void;
@@ -3390,4 +3395,4 @@ interface RenderOptions {
3390
3395
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3391
3396
 
3392
3397
  export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, XScrollBar, YScrollBar, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3393
- export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEventMap, Camera2DProperties, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, CustomPropertyAccessor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEventMap, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
3398
+ export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEventMap, Camera2DProperties, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, CustomPropertyAccessor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEventMap, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
package/dist/index.d.mts CHANGED
@@ -1643,9 +1643,10 @@ declare class SceneTree extends MainLoop {
1643
1643
  free(): void;
1644
1644
  }
1645
1645
 
1646
- declare class Children<T extends Node = Node> extends Array<T> {
1647
- readonly front: T[];
1648
- readonly back: T[];
1646
+ declare class Children<T extends Node = Node> {
1647
+ front: T[];
1648
+ default: T[];
1649
+ back: T[];
1649
1650
  get internal(): T[];
1650
1651
  constructor(...items: T[]);
1651
1652
  set(items: T[]): this;
@@ -1675,6 +1676,7 @@ interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
1675
1676
  type ProcessMode = 'inherit' | 'pausable' | 'when_paused' | 'always' | 'disabled';
1676
1677
  type ProcessSortMode = 'default' | 'parent_before';
1677
1678
  type RenderMode = 'inherit' | 'always' | 'disabled';
1679
+ type InputMode = 'inherit' | 'always' | 'disabled';
1678
1680
  type InternalMode = 'default' | 'front' | 'back';
1679
1681
  interface NodeProperties {
1680
1682
  id: string;
@@ -1700,6 +1702,7 @@ declare class Node extends CoreObject {
1700
1702
  processMode: ProcessMode;
1701
1703
  processSortMode: ProcessSortMode;
1702
1704
  renderMode: RenderMode;
1705
+ inputMode: InputMode;
1703
1706
  internalMode: InternalMode;
1704
1707
  mask?: Maskable;
1705
1708
  protected _readyed: boolean;
@@ -1727,8 +1730,9 @@ declare class Node extends CoreObject {
1727
1730
  setParent<T extends Node = Node>(parent: T | undefined): this;
1728
1731
  /** Children */
1729
1732
  protected _children: Children<Node>;
1730
- get children(): Children;
1731
- set children(value: Node[] | Children);
1733
+ get children(): Node[];
1734
+ set children(value: Node[]);
1735
+ getChildren(includeInternal: InternalMode): Node[];
1732
1736
  getChild<T extends Node = Node>(index?: number): T | undefined;
1733
1737
  get siblingIndex(): number;
1734
1738
  set siblingIndex(toIndex: number);
@@ -1737,6 +1741,7 @@ declare class Node extends CoreObject {
1737
1741
  get firstSibling(): Node | undefined;
1738
1742
  get lastSibling(): Node | undefined;
1739
1743
  canProcess(): boolean;
1744
+ canInput(): boolean;
1740
1745
  canRender(): boolean;
1741
1746
  protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1742
1747
  protected _onTreeEnter(tree: SceneTree): void;
@@ -3390,4 +3395,4 @@ interface RenderOptions {
3390
3395
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3391
3396
 
3392
3397
  export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, XScrollBar, YScrollBar, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3393
- export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEventMap, Camera2DProperties, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, CustomPropertyAccessor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEventMap, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
3398
+ export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEventMap, Camera2DProperties, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, CustomPropertyAccessor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEventMap, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
package/dist/index.d.ts CHANGED
@@ -1643,9 +1643,10 @@ declare class SceneTree extends MainLoop {
1643
1643
  free(): void;
1644
1644
  }
1645
1645
 
1646
- declare class Children<T extends Node = Node> extends Array<T> {
1647
- readonly front: T[];
1648
- readonly back: T[];
1646
+ declare class Children<T extends Node = Node> {
1647
+ front: T[];
1648
+ default: T[];
1649
+ back: T[];
1649
1650
  get internal(): T[];
1650
1651
  constructor(...items: T[]);
1651
1652
  set(items: T[]): this;
@@ -1675,6 +1676,7 @@ interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
1675
1676
  type ProcessMode = 'inherit' | 'pausable' | 'when_paused' | 'always' | 'disabled';
1676
1677
  type ProcessSortMode = 'default' | 'parent_before';
1677
1678
  type RenderMode = 'inherit' | 'always' | 'disabled';
1679
+ type InputMode = 'inherit' | 'always' | 'disabled';
1678
1680
  type InternalMode = 'default' | 'front' | 'back';
1679
1681
  interface NodeProperties {
1680
1682
  id: string;
@@ -1700,6 +1702,7 @@ declare class Node extends CoreObject {
1700
1702
  processMode: ProcessMode;
1701
1703
  processSortMode: ProcessSortMode;
1702
1704
  renderMode: RenderMode;
1705
+ inputMode: InputMode;
1703
1706
  internalMode: InternalMode;
1704
1707
  mask?: Maskable;
1705
1708
  protected _readyed: boolean;
@@ -1727,8 +1730,9 @@ declare class Node extends CoreObject {
1727
1730
  setParent<T extends Node = Node>(parent: T | undefined): this;
1728
1731
  /** Children */
1729
1732
  protected _children: Children<Node>;
1730
- get children(): Children;
1731
- set children(value: Node[] | Children);
1733
+ get children(): Node[];
1734
+ set children(value: Node[]);
1735
+ getChildren(includeInternal: InternalMode): Node[];
1732
1736
  getChild<T extends Node = Node>(index?: number): T | undefined;
1733
1737
  get siblingIndex(): number;
1734
1738
  set siblingIndex(toIndex: number);
@@ -1737,6 +1741,7 @@ declare class Node extends CoreObject {
1737
1741
  get firstSibling(): Node | undefined;
1738
1742
  get lastSibling(): Node | undefined;
1739
1743
  canProcess(): boolean;
1744
+ canInput(): boolean;
1740
1745
  canRender(): boolean;
1741
1746
  protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1742
1747
  protected _onTreeEnter(tree: SceneTree): void;
@@ -3390,4 +3395,4 @@ interface RenderOptions {
3390
3395
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3391
3396
 
3392
3397
  export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, XScrollBar, YScrollBar, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3393
- export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEventMap, Camera2DProperties, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, CustomPropertyAccessor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEventMap, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
3398
+ export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEventMap, Camera2DProperties, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, CustomPropertyAccessor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEventMap, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };