modern-canvas 0.2.2 → 0.2.3

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.d.cts CHANGED
@@ -1410,21 +1410,19 @@ type CanvasItemStyleFilterKey = 'hue-rotate' | 'saturate' | 'brightness' | 'cont
1410
1410
  type CanvasItemStyleFilter = Record<CanvasItemStyleFilterKey, number>;
1411
1411
  interface CanvasItemStyleProperties extends IDOCTextStyleDeclaration, IDOCTransformStyleDeclaration {
1412
1412
  direction: 'inherit' | 'ltr' | 'rtl';
1413
- backgroundColor?: ColorValue;
1413
+ backgroundColor?: 'none' | ColorValue;
1414
1414
  backgroundImage?: string;
1415
1415
  filter: string;
1416
- shadowColor: ColorValue;
1417
- shadowOffsetX: number;
1418
- shadowOffsetY: number;
1419
- shadowBlur: number;
1416
+ boxShadow: 'none' | string;
1417
+ maskImage: 'none' | string;
1420
1418
  opacity: number;
1421
1419
  borderWidth: number;
1422
1420
  borderRadius: number;
1423
- borderColor: ColorValue;
1421
+ borderColor: 'none' | ColorValue;
1424
1422
  borderStyle: string;
1425
1423
  outlineWidth: number;
1426
1424
  outlineOffset: number;
1427
- outlineColor: ColorValue;
1425
+ outlineColor: 'none' | ColorValue;
1428
1426
  outlineStyle: string;
1429
1427
  visibility: Visibility;
1430
1428
  overflow: Overflow;
@@ -1434,23 +1432,21 @@ type PointerEvents = 'auto' | 'none';
1434
1432
  interface CanvasItemStyle extends CanvasItemStyleProperties {
1435
1433
  }
1436
1434
  declare class CanvasItemStyle extends Resource {
1437
- backgroundColor?: string;
1438
- backgroundImage?: string;
1439
- filter: string;
1435
+ backgroundColor: 'none' | ColorValue;
1436
+ backgroundImage: 'none' | string;
1437
+ filter: 'none' | string;
1440
1438
  direction: 'inherit' | 'ltr' | 'rtl';
1441
- shadowColor: string;
1442
- shadowOffsetX: number;
1443
- shadowOffsetY: number;
1444
- shadowBlur: number;
1439
+ boxShadow: 'none' | string;
1440
+ maskImage: 'none' | string;
1445
1441
  opacity: number;
1446
1442
  borderWidth: number;
1447
1443
  borderRadius: number;
1448
- borderColor: string;
1449
- borderStyle: string;
1444
+ borderColor: 'none' | ColorValue;
1445
+ borderStyle: 'none' | string;
1450
1446
  outlineWidth: number;
1451
1447
  outlineOffset: number;
1452
- outlineColor: string;
1453
- outlineStyle: string;
1448
+ outlineColor: 'none' | ColorValue;
1449
+ outlineStyle: 'none' | string;
1454
1450
  visibility: Visibility;
1455
1451
  overflow: Overflow;
1456
1452
  pointerEvents: PointerEvents;
@@ -1460,7 +1456,7 @@ declare class CanvasItemStyle extends Resource {
1460
1456
  canPointeEvents(): boolean;
1461
1457
  getComputedOpacity(): number;
1462
1458
  getComputedBackgroundColor(): Color;
1463
- getComputedBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
1459
+ loadBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
1464
1460
  getComputedTransform(): Transform2D;
1465
1461
  getComputedTransformOrigin(): number[];
1466
1462
  getComputedFilter(): CanvasItemStyleFilter;
@@ -1814,6 +1810,8 @@ declare class CanvasItem extends TimelineNode {
1814
1810
  setProperties(properties?: Record<PropertyKey, any>): this;
1815
1811
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1816
1812
  protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1813
+ protected _updateBoxShadow(): void;
1814
+ protected _updateMaskImage(): void;
1817
1815
  protected _updateBackgroundColor(): void;
1818
1816
  protected _updateBackgroundImage(): Promise<void>;
1819
1817
  protected _updateOpacity(): void;
@@ -1833,8 +1831,8 @@ declare class CanvasItem extends TimelineNode {
1833
1831
  protected _drawBorder(): void;
1834
1832
  protected _drawOutline(): void;
1835
1833
  protected _drawBoundingRect(): void;
1836
- protected _fill(): void;
1837
- protected _stroke(): void;
1834
+ protected _fillBoundingRect(): void;
1835
+ protected _strokeBoundingRect(): void;
1838
1836
  protected _relayout(batchables: CanvasBatchable[]): CanvasBatchable[];
1839
1837
  protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
1840
1838
  protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
@@ -1850,6 +1848,7 @@ declare class Node2D extends CanvasItem {
1850
1848
  constructor(properties?: Partial<Node2DProperties>, children?: Node[]);
1851
1849
  protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any): void;
1852
1850
  protected _updateTransform(): void;
1851
+ getRect(): Rect2;
1853
1852
  protected _updateOverflow(): void;
1854
1853
  protected _transformVertices(vertices: number[]): number[];
1855
1854
  protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
@@ -1919,14 +1918,12 @@ declare class Image2D extends Node2D {
1919
1918
  protected _updateFrameIndex(): this;
1920
1919
  protected _process(delta: number): void;
1921
1920
  protected _drawContent(): void;
1922
- protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
1923
1921
  }
1924
1922
 
1925
1923
  interface TextureRect2DProperties extends Node2DProperties {
1926
1924
  }
1927
1925
  declare class TextureRect2D<T extends Texture2D = Texture2D> extends Node2D implements Rectangulable {
1928
1926
  texture?: T;
1929
- getRect(): Rect2;
1930
1927
  protected _drawContent(): void;
1931
1928
  }
1932
1929
 
package/dist/index.d.mts CHANGED
@@ -1410,21 +1410,19 @@ type CanvasItemStyleFilterKey = 'hue-rotate' | 'saturate' | 'brightness' | 'cont
1410
1410
  type CanvasItemStyleFilter = Record<CanvasItemStyleFilterKey, number>;
1411
1411
  interface CanvasItemStyleProperties extends IDOCTextStyleDeclaration, IDOCTransformStyleDeclaration {
1412
1412
  direction: 'inherit' | 'ltr' | 'rtl';
1413
- backgroundColor?: ColorValue;
1413
+ backgroundColor?: 'none' | ColorValue;
1414
1414
  backgroundImage?: string;
1415
1415
  filter: string;
1416
- shadowColor: ColorValue;
1417
- shadowOffsetX: number;
1418
- shadowOffsetY: number;
1419
- shadowBlur: number;
1416
+ boxShadow: 'none' | string;
1417
+ maskImage: 'none' | string;
1420
1418
  opacity: number;
1421
1419
  borderWidth: number;
1422
1420
  borderRadius: number;
1423
- borderColor: ColorValue;
1421
+ borderColor: 'none' | ColorValue;
1424
1422
  borderStyle: string;
1425
1423
  outlineWidth: number;
1426
1424
  outlineOffset: number;
1427
- outlineColor: ColorValue;
1425
+ outlineColor: 'none' | ColorValue;
1428
1426
  outlineStyle: string;
1429
1427
  visibility: Visibility;
1430
1428
  overflow: Overflow;
@@ -1434,23 +1432,21 @@ type PointerEvents = 'auto' | 'none';
1434
1432
  interface CanvasItemStyle extends CanvasItemStyleProperties {
1435
1433
  }
1436
1434
  declare class CanvasItemStyle extends Resource {
1437
- backgroundColor?: string;
1438
- backgroundImage?: string;
1439
- filter: string;
1435
+ backgroundColor: 'none' | ColorValue;
1436
+ backgroundImage: 'none' | string;
1437
+ filter: 'none' | string;
1440
1438
  direction: 'inherit' | 'ltr' | 'rtl';
1441
- shadowColor: string;
1442
- shadowOffsetX: number;
1443
- shadowOffsetY: number;
1444
- shadowBlur: number;
1439
+ boxShadow: 'none' | string;
1440
+ maskImage: 'none' | string;
1445
1441
  opacity: number;
1446
1442
  borderWidth: number;
1447
1443
  borderRadius: number;
1448
- borderColor: string;
1449
- borderStyle: string;
1444
+ borderColor: 'none' | ColorValue;
1445
+ borderStyle: 'none' | string;
1450
1446
  outlineWidth: number;
1451
1447
  outlineOffset: number;
1452
- outlineColor: string;
1453
- outlineStyle: string;
1448
+ outlineColor: 'none' | ColorValue;
1449
+ outlineStyle: 'none' | string;
1454
1450
  visibility: Visibility;
1455
1451
  overflow: Overflow;
1456
1452
  pointerEvents: PointerEvents;
@@ -1460,7 +1456,7 @@ declare class CanvasItemStyle extends Resource {
1460
1456
  canPointeEvents(): boolean;
1461
1457
  getComputedOpacity(): number;
1462
1458
  getComputedBackgroundColor(): Color;
1463
- getComputedBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
1459
+ loadBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
1464
1460
  getComputedTransform(): Transform2D;
1465
1461
  getComputedTransformOrigin(): number[];
1466
1462
  getComputedFilter(): CanvasItemStyleFilter;
@@ -1814,6 +1810,8 @@ declare class CanvasItem extends TimelineNode {
1814
1810
  setProperties(properties?: Record<PropertyKey, any>): this;
1815
1811
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1816
1812
  protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1813
+ protected _updateBoxShadow(): void;
1814
+ protected _updateMaskImage(): void;
1817
1815
  protected _updateBackgroundColor(): void;
1818
1816
  protected _updateBackgroundImage(): Promise<void>;
1819
1817
  protected _updateOpacity(): void;
@@ -1833,8 +1831,8 @@ declare class CanvasItem extends TimelineNode {
1833
1831
  protected _drawBorder(): void;
1834
1832
  protected _drawOutline(): void;
1835
1833
  protected _drawBoundingRect(): void;
1836
- protected _fill(): void;
1837
- protected _stroke(): void;
1834
+ protected _fillBoundingRect(): void;
1835
+ protected _strokeBoundingRect(): void;
1838
1836
  protected _relayout(batchables: CanvasBatchable[]): CanvasBatchable[];
1839
1837
  protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
1840
1838
  protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
@@ -1850,6 +1848,7 @@ declare class Node2D extends CanvasItem {
1850
1848
  constructor(properties?: Partial<Node2DProperties>, children?: Node[]);
1851
1849
  protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any): void;
1852
1850
  protected _updateTransform(): void;
1851
+ getRect(): Rect2;
1853
1852
  protected _updateOverflow(): void;
1854
1853
  protected _transformVertices(vertices: number[]): number[];
1855
1854
  protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
@@ -1919,14 +1918,12 @@ declare class Image2D extends Node2D {
1919
1918
  protected _updateFrameIndex(): this;
1920
1919
  protected _process(delta: number): void;
1921
1920
  protected _drawContent(): void;
1922
- protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
1923
1921
  }
1924
1922
 
1925
1923
  interface TextureRect2DProperties extends Node2DProperties {
1926
1924
  }
1927
1925
  declare class TextureRect2D<T extends Texture2D = Texture2D> extends Node2D implements Rectangulable {
1928
1926
  texture?: T;
1929
- getRect(): Rect2;
1930
1927
  protected _drawContent(): void;
1931
1928
  }
1932
1929
 
package/dist/index.d.ts CHANGED
@@ -1410,21 +1410,19 @@ type CanvasItemStyleFilterKey = 'hue-rotate' | 'saturate' | 'brightness' | 'cont
1410
1410
  type CanvasItemStyleFilter = Record<CanvasItemStyleFilterKey, number>;
1411
1411
  interface CanvasItemStyleProperties extends IDOCTextStyleDeclaration, IDOCTransformStyleDeclaration {
1412
1412
  direction: 'inherit' | 'ltr' | 'rtl';
1413
- backgroundColor?: ColorValue;
1413
+ backgroundColor?: 'none' | ColorValue;
1414
1414
  backgroundImage?: string;
1415
1415
  filter: string;
1416
- shadowColor: ColorValue;
1417
- shadowOffsetX: number;
1418
- shadowOffsetY: number;
1419
- shadowBlur: number;
1416
+ boxShadow: 'none' | string;
1417
+ maskImage: 'none' | string;
1420
1418
  opacity: number;
1421
1419
  borderWidth: number;
1422
1420
  borderRadius: number;
1423
- borderColor: ColorValue;
1421
+ borderColor: 'none' | ColorValue;
1424
1422
  borderStyle: string;
1425
1423
  outlineWidth: number;
1426
1424
  outlineOffset: number;
1427
- outlineColor: ColorValue;
1425
+ outlineColor: 'none' | ColorValue;
1428
1426
  outlineStyle: string;
1429
1427
  visibility: Visibility;
1430
1428
  overflow: Overflow;
@@ -1434,23 +1432,21 @@ type PointerEvents = 'auto' | 'none';
1434
1432
  interface CanvasItemStyle extends CanvasItemStyleProperties {
1435
1433
  }
1436
1434
  declare class CanvasItemStyle extends Resource {
1437
- backgroundColor?: string;
1438
- backgroundImage?: string;
1439
- filter: string;
1435
+ backgroundColor: 'none' | ColorValue;
1436
+ backgroundImage: 'none' | string;
1437
+ filter: 'none' | string;
1440
1438
  direction: 'inherit' | 'ltr' | 'rtl';
1441
- shadowColor: string;
1442
- shadowOffsetX: number;
1443
- shadowOffsetY: number;
1444
- shadowBlur: number;
1439
+ boxShadow: 'none' | string;
1440
+ maskImage: 'none' | string;
1445
1441
  opacity: number;
1446
1442
  borderWidth: number;
1447
1443
  borderRadius: number;
1448
- borderColor: string;
1449
- borderStyle: string;
1444
+ borderColor: 'none' | ColorValue;
1445
+ borderStyle: 'none' | string;
1450
1446
  outlineWidth: number;
1451
1447
  outlineOffset: number;
1452
- outlineColor: string;
1453
- outlineStyle: string;
1448
+ outlineColor: 'none' | ColorValue;
1449
+ outlineStyle: 'none' | string;
1454
1450
  visibility: Visibility;
1455
1451
  overflow: Overflow;
1456
1452
  pointerEvents: PointerEvents;
@@ -1460,7 +1456,7 @@ declare class CanvasItemStyle extends Resource {
1460
1456
  canPointeEvents(): boolean;
1461
1457
  getComputedOpacity(): number;
1462
1458
  getComputedBackgroundColor(): Color;
1463
- getComputedBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
1459
+ loadBackgroundImage(): Promise<Texture2D<ImageBitmap> | undefined>;
1464
1460
  getComputedTransform(): Transform2D;
1465
1461
  getComputedTransformOrigin(): number[];
1466
1462
  getComputedFilter(): CanvasItemStyleFilter;
@@ -1814,6 +1810,8 @@ declare class CanvasItem extends TimelineNode {
1814
1810
  setProperties(properties?: Record<PropertyKey, any>): this;
1815
1811
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1816
1812
  protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1813
+ protected _updateBoxShadow(): void;
1814
+ protected _updateMaskImage(): void;
1817
1815
  protected _updateBackgroundColor(): void;
1818
1816
  protected _updateBackgroundImage(): Promise<void>;
1819
1817
  protected _updateOpacity(): void;
@@ -1833,8 +1831,8 @@ declare class CanvasItem extends TimelineNode {
1833
1831
  protected _drawBorder(): void;
1834
1832
  protected _drawOutline(): void;
1835
1833
  protected _drawBoundingRect(): void;
1836
- protected _fill(): void;
1837
- protected _stroke(): void;
1834
+ protected _fillBoundingRect(): void;
1835
+ protected _strokeBoundingRect(): void;
1838
1836
  protected _relayout(batchables: CanvasBatchable[]): CanvasBatchable[];
1839
1837
  protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
1840
1838
  protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
@@ -1850,6 +1848,7 @@ declare class Node2D extends CanvasItem {
1850
1848
  constructor(properties?: Partial<Node2DProperties>, children?: Node[]);
1851
1849
  protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any): void;
1852
1850
  protected _updateTransform(): void;
1851
+ getRect(): Rect2;
1853
1852
  protected _updateOverflow(): void;
1854
1853
  protected _transformVertices(vertices: number[]): number[];
1855
1854
  protected _reflow(batchables: CanvasBatchable[]): CanvasBatchable[];
@@ -1919,14 +1918,12 @@ declare class Image2D extends Node2D {
1919
1918
  protected _updateFrameIndex(): this;
1920
1919
  protected _process(delta: number): void;
1921
1920
  protected _drawContent(): void;
1922
- protected _repaint(batchables: CanvasBatchable[]): CanvasBatchable[];
1923
1921
  }
1924
1922
 
1925
1923
  interface TextureRect2DProperties extends Node2DProperties {
1926
1924
  }
1927
1925
  declare class TextureRect2D<T extends Texture2D = Texture2D> extends Node2D implements Rectangulable {
1928
1926
  texture?: T;
1929
- getRect(): Rect2;
1930
1927
  protected _drawContent(): void;
1931
1928
  }
1932
1929