modern-canvas 0.7.1 → 0.7.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.cjs +33 -9
- package/dist/index.d.cts +3 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +16 -16
- package/dist/index.mjs +33 -9
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -6165,20 +6165,20 @@ __decorateClass$S([
|
|
|
6165
6165
|
modernIdoc.property({ fallback: modernIdoc.idGenerator() })
|
|
6166
6166
|
], exports.Node.prototype, "name", 2);
|
|
6167
6167
|
__decorateClass$S([
|
|
6168
|
-
modernIdoc.property({
|
|
6168
|
+
modernIdoc.property({ default: () => ({}) })
|
|
6169
|
+
], exports.Node.prototype, "meta", 2);
|
|
6170
|
+
__decorateClass$S([
|
|
6171
|
+
modernIdoc.property({ protected: true, fallback: "inherit" })
|
|
6169
6172
|
], exports.Node.prototype, "processMode", 2);
|
|
6170
6173
|
__decorateClass$S([
|
|
6171
|
-
modernIdoc.property({ fallback: "default" })
|
|
6174
|
+
modernIdoc.property({ protected: true, fallback: "default" })
|
|
6172
6175
|
], exports.Node.prototype, "processSortMode", 2);
|
|
6173
6176
|
__decorateClass$S([
|
|
6174
|
-
modernIdoc.property({ fallback: "inherit" })
|
|
6177
|
+
modernIdoc.property({ protected: true, fallback: "inherit" })
|
|
6175
6178
|
], exports.Node.prototype, "renderMode", 2);
|
|
6176
6179
|
__decorateClass$S([
|
|
6177
|
-
modernIdoc.property({ fallback: "default" })
|
|
6180
|
+
modernIdoc.property({ protected: true, fallback: "default" })
|
|
6178
6181
|
], exports.Node.prototype, "internalMode", 2);
|
|
6179
|
-
__decorateClass$S([
|
|
6180
|
-
modernIdoc.property({ default: () => ({}) })
|
|
6181
|
-
], exports.Node.prototype, "meta", 2);
|
|
6182
6182
|
__decorateClass$S([
|
|
6183
6183
|
modernIdoc.property({ protected: true })
|
|
6184
6184
|
], exports.Node.prototype, "mask", 2);
|
|
@@ -9312,6 +9312,14 @@ class BaseElement2DBackground extends BaseElement2DFill {
|
|
|
9312
9312
|
modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeBackground(properties)
|
|
9313
9313
|
);
|
|
9314
9314
|
}
|
|
9315
|
+
_updateProperty(key, value, oldValue, declaration) {
|
|
9316
|
+
super._updateProperty(key, value, oldValue, declaration);
|
|
9317
|
+
switch (key) {
|
|
9318
|
+
case "fillWithShape":
|
|
9319
|
+
this.parent.requestRedraw();
|
|
9320
|
+
break;
|
|
9321
|
+
}
|
|
9322
|
+
}
|
|
9315
9323
|
}
|
|
9316
9324
|
__decorateClass$r([
|
|
9317
9325
|
modernIdoc.property()
|
|
@@ -9332,6 +9340,14 @@ class BaseElement2DForeground extends BaseElement2DFill {
|
|
|
9332
9340
|
modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeForeground(properties)
|
|
9333
9341
|
);
|
|
9334
9342
|
}
|
|
9343
|
+
_updateProperty(key, value, oldValue, declaration) {
|
|
9344
|
+
super._updateProperty(key, value, oldValue, declaration);
|
|
9345
|
+
switch (key) {
|
|
9346
|
+
case "fillWithShape":
|
|
9347
|
+
this.parent.requestRedraw();
|
|
9348
|
+
break;
|
|
9349
|
+
}
|
|
9350
|
+
}
|
|
9335
9351
|
}
|
|
9336
9352
|
__decorateClass$q([
|
|
9337
9353
|
modernIdoc.property()
|
|
@@ -9939,7 +9955,11 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
|
9939
9955
|
}
|
|
9940
9956
|
if (this._background.canDraw()) {
|
|
9941
9957
|
this._tree?.log(this.name, "background drawing");
|
|
9942
|
-
this.
|
|
9958
|
+
if (this._background.fillWithShape) {
|
|
9959
|
+
this._shape.draw();
|
|
9960
|
+
} else {
|
|
9961
|
+
this._shape.drawRect();
|
|
9962
|
+
}
|
|
9943
9963
|
this._background.draw();
|
|
9944
9964
|
}
|
|
9945
9965
|
if (this._fill.canDraw()) {
|
|
@@ -9954,7 +9974,11 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
|
9954
9974
|
}
|
|
9955
9975
|
if (this._foreground.canDraw()) {
|
|
9956
9976
|
this._tree?.log(this.name, "foreground drawing");
|
|
9957
|
-
this.
|
|
9977
|
+
if (this._foreground.fillWithShape) {
|
|
9978
|
+
this._shape.draw();
|
|
9979
|
+
} else {
|
|
9980
|
+
this._shape.drawRect();
|
|
9981
|
+
}
|
|
9958
9982
|
this._foreground.draw();
|
|
9959
9983
|
}
|
|
9960
9984
|
if (this._text.canDraw()) {
|
package/dist/index.d.cts
CHANGED
|
@@ -1634,11 +1634,11 @@ declare class Node extends CoreObject {
|
|
|
1634
1634
|
readonly is: string;
|
|
1635
1635
|
id: string;
|
|
1636
1636
|
name: string;
|
|
1637
|
+
meta: Record<string, any>;
|
|
1637
1638
|
processMode: ProcessMode;
|
|
1638
1639
|
processSortMode: ProcessSortMode;
|
|
1639
1640
|
renderMode: RenderMode;
|
|
1640
1641
|
internalMode: InternalMode;
|
|
1641
|
-
meta: Record<string, any>;
|
|
1642
1642
|
mask?: Maskable;
|
|
1643
1643
|
protected _readyed: boolean;
|
|
1644
1644
|
constructor(properties?: Partial<NodeProperties>, nodes?: Node[]);
|
|
@@ -1953,11 +1953,13 @@ declare class BaseElement2DFill extends CoreObject {
|
|
|
1953
1953
|
declare class BaseElement2DBackground extends BaseElement2DFill {
|
|
1954
1954
|
fillWithShape: NormalizedBackground['fillWithShape'];
|
|
1955
1955
|
setProperties(properties?: Background): this;
|
|
1956
|
+
protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1956
1957
|
}
|
|
1957
1958
|
|
|
1958
1959
|
declare class BaseElement2DForeground extends BaseElement2DFill {
|
|
1959
1960
|
fillWithShape: NormalizedForeground['fillWithShape'];
|
|
1960
1961
|
setProperties(properties?: Foreground): this;
|
|
1962
|
+
protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1961
1963
|
}
|
|
1962
1964
|
|
|
1963
1965
|
declare class BaseElement2DOutline extends BaseElement2DFill {
|
package/dist/index.d.mts
CHANGED
|
@@ -1634,11 +1634,11 @@ declare class Node extends CoreObject {
|
|
|
1634
1634
|
readonly is: string;
|
|
1635
1635
|
id: string;
|
|
1636
1636
|
name: string;
|
|
1637
|
+
meta: Record<string, any>;
|
|
1637
1638
|
processMode: ProcessMode;
|
|
1638
1639
|
processSortMode: ProcessSortMode;
|
|
1639
1640
|
renderMode: RenderMode;
|
|
1640
1641
|
internalMode: InternalMode;
|
|
1641
|
-
meta: Record<string, any>;
|
|
1642
1642
|
mask?: Maskable;
|
|
1643
1643
|
protected _readyed: boolean;
|
|
1644
1644
|
constructor(properties?: Partial<NodeProperties>, nodes?: Node[]);
|
|
@@ -1953,11 +1953,13 @@ declare class BaseElement2DFill extends CoreObject {
|
|
|
1953
1953
|
declare class BaseElement2DBackground extends BaseElement2DFill {
|
|
1954
1954
|
fillWithShape: NormalizedBackground['fillWithShape'];
|
|
1955
1955
|
setProperties(properties?: Background): this;
|
|
1956
|
+
protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1956
1957
|
}
|
|
1957
1958
|
|
|
1958
1959
|
declare class BaseElement2DForeground extends BaseElement2DFill {
|
|
1959
1960
|
fillWithShape: NormalizedForeground['fillWithShape'];
|
|
1960
1961
|
setProperties(properties?: Foreground): this;
|
|
1962
|
+
protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1961
1963
|
}
|
|
1962
1964
|
|
|
1963
1965
|
declare class BaseElement2DOutline extends BaseElement2DFill {
|
package/dist/index.d.ts
CHANGED
|
@@ -1634,11 +1634,11 @@ declare class Node extends CoreObject {
|
|
|
1634
1634
|
readonly is: string;
|
|
1635
1635
|
id: string;
|
|
1636
1636
|
name: string;
|
|
1637
|
+
meta: Record<string, any>;
|
|
1637
1638
|
processMode: ProcessMode;
|
|
1638
1639
|
processSortMode: ProcessSortMode;
|
|
1639
1640
|
renderMode: RenderMode;
|
|
1640
1641
|
internalMode: InternalMode;
|
|
1641
|
-
meta: Record<string, any>;
|
|
1642
1642
|
mask?: Maskable;
|
|
1643
1643
|
protected _readyed: boolean;
|
|
1644
1644
|
constructor(properties?: Partial<NodeProperties>, nodes?: Node[]);
|
|
@@ -1953,11 +1953,13 @@ declare class BaseElement2DFill extends CoreObject {
|
|
|
1953
1953
|
declare class BaseElement2DBackground extends BaseElement2DFill {
|
|
1954
1954
|
fillWithShape: NormalizedBackground['fillWithShape'];
|
|
1955
1955
|
setProperties(properties?: Background): this;
|
|
1956
|
+
protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1956
1957
|
}
|
|
1957
1958
|
|
|
1958
1959
|
declare class BaseElement2DForeground extends BaseElement2DFill {
|
|
1959
1960
|
fillWithShape: NormalizedForeground['fillWithShape'];
|
|
1960
1961
|
setProperties(properties?: Foreground): this;
|
|
1962
|
+
protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1961
1963
|
}
|
|
1962
1964
|
|
|
1963
1965
|
declare class BaseElement2DOutline extends BaseElement2DFill {
|