modern-canvas 0.4.52 → 0.4.53

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
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ const modernIdoc = require('modern-idoc');
3
4
  const colord = require('colord');
4
5
  const namesPlugin = require('colord/plugins/names');
5
- const modernIdoc = require('modern-idoc');
6
6
  const modernPath2d = require('modern-path2d');
7
7
  const modernText = require('modern-text');
8
8
  const load = require('yoga-layout/load');
@@ -11,270 +11,6 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
11
11
 
12
12
  const namesPlugin__default = /*#__PURE__*/_interopDefaultCompat(namesPlugin);
13
13
 
14
- const PI = Math.PI;
15
- const PI_2 = PI * 2;
16
- let UID$1 = 0;
17
- function uid(object) {
18
- return object?.__SPECTOR_Object_TAG?.id ?? ++UID$1;
19
- }
20
- function isPow2(v) {
21
- return !(v & v - 1) && !!v;
22
- }
23
-
24
- const FUNCTIONS_RE = /([\w-]+)\((.+?)\)/g;
25
- const ARGS_RE = /[^,]+/g;
26
- const ARG_RE = /([-e.\d]+)(.*)/;
27
- function getDefaultCssPropertyValue(value) {
28
- if (Array.isArray(value)) {
29
- return value.map((func) => {
30
- return {
31
- name: func.name,
32
- args: func.args.map((arg) => {
33
- return {
34
- ...arg,
35
- normalizedIntValue: arg.normalizedDefaultIntValue
36
- };
37
- })
38
- };
39
- });
40
- } else {
41
- return {
42
- ...value,
43
- normalizedIntValue: value.normalizedDefaultIntValue
44
- };
45
- }
46
- }
47
- function parseCssProperty(name, propertyValue, context = {}) {
48
- const functions = parseCssFunctions(propertyValue, context);
49
- return functions.length ? functions : parseArgument(name, propertyValue, context);
50
- }
51
- function parseCssFunctions(propertyValue, context = {}) {
52
- const functions = [];
53
- let match;
54
- while ((match = FUNCTIONS_RE.exec(propertyValue)) !== null) {
55
- const [, name, value] = match;
56
- if (name) {
57
- functions.push({
58
- name,
59
- args: parseArguments(name, value, context)
60
- });
61
- }
62
- }
63
- return functions;
64
- }
65
- function parseArguments(name, value, context = {}) {
66
- const values = [];
67
- let match;
68
- let i = 0;
69
- while ((match = ARGS_RE.exec(value)) !== null) {
70
- values.push(
71
- parseArgument(name, match[0], {
72
- ...context,
73
- index: i++
74
- })
75
- );
76
- }
77
- return values;
78
- }
79
- function parseArgument(name, value, context = {}) {
80
- const { width = 1, height = 1, index = 0 } = context;
81
- const matched = value.match(ARG_RE);
82
- const result = {
83
- unit: matched?.[2] ?? null,
84
- value,
85
- intValue: Number(matched?.[1]),
86
- normalizedIntValue: 0,
87
- normalizedDefaultIntValue: 0
88
- };
89
- switch (name) {
90
- case "scale":
91
- case "scaleX":
92
- case "scaleY":
93
- case "scale3d":
94
- result.normalizedDefaultIntValue = 1;
95
- break;
96
- }
97
- switch (result.unit) {
98
- case "%":
99
- result.normalizedIntValue = result.intValue / 100;
100
- break;
101
- case "rad":
102
- result.normalizedIntValue = result.intValue / PI_2;
103
- break;
104
- case "deg":
105
- result.normalizedIntValue = result.intValue / 360;
106
- break;
107
- case "px":
108
- switch (index) {
109
- case 0:
110
- result.normalizedIntValue = result.intValue / width;
111
- break;
112
- case 1:
113
- result.normalizedIntValue = result.intValue / height;
114
- break;
115
- }
116
- break;
117
- case "turn":
118
- case "em":
119
- // div fontSize
120
- case "rem":
121
- // div fontSize
122
- default:
123
- result.normalizedIntValue = result.intValue;
124
- break;
125
- }
126
- return result;
127
- }
128
-
129
- const SUPPORTS_WEBGL2 = "WebGL2RenderingContext" in globalThis;
130
- const SUPPORTS_IMAGE_BITMAP = "ImageBitmap" in globalThis;
131
- const SUPPORTS_RESIZE_OBSERVER = "ResizeObserver" in globalThis;
132
- const SUPPORTS_POINTER_EVENTS = "PointerEvent" in globalThis;
133
- const SUPPORTS_WHEEL_EVENTS = "WheelEvent" in globalThis;
134
- const SUPPORTS_MOUSE_EVENTS = "MouseEvent" in globalThis;
135
- const SUPPORTS_TOUCH_EVENTS = "ontouchstart" in globalThis;
136
- const SUPPORTS_CLICK_EVENTS = "onclick" in globalThis;
137
- const SUPPORTS_CREATE_IMAGE_BITMAP = "createImageBitmap" in globalThis;
138
- const SUPPORTS_AUDIO_CONTEXT = "AudioContext" in globalThis;
139
- const SUPPORTS_WEBKIT_AUDIO_CONTEXT = "webkitAudioContext" in globalThis;
140
- const SUPPORTS_OFFLINE_AUDIO_CONTEXT = "OfflineAudioContext" in globalThis;
141
- const SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT = "webkitOfflineAudioContext" in globalThis;
142
- const SUPPORTS_WEB_AUDIO = SUPPORTS_AUDIO_CONTEXT || SUPPORTS_WEBKIT_AUDIO_CONTEXT;
143
- const IN_BROWSER = typeof window !== "undefined";
144
- const DEVICE_PIXEL_RATIO = globalThis.devicePixelRatio || 1;
145
- const isElementNode = (node) => node !== null && typeof node === "object" && node.nodeType === 1;
146
- const isVideoElement = (node) => isElementNode(node) && node.tagName === "VIDEO";
147
- const isImageElement = (node) => isElementNode(node) && node.tagName === "IMG";
148
- function isCanvasElement(node) {
149
- return typeof node === "object" && node !== null && node.nodeType === 1 && node.tagName === "CANVAS";
150
- }
151
- function isWebgl2(gl) {
152
- return SUPPORTS_WEBGL2 && gl instanceof globalThis.WebGL2RenderingContext;
153
- }
154
- function createHTMLCanvas() {
155
- if (IN_BROWSER) {
156
- return globalThis.document.createElement("canvas");
157
- }
158
- return void 0;
159
- }
160
- function determineCrossOrigin(url, loc = globalThis.location) {
161
- if (url.startsWith("data:")) {
162
- return "";
163
- }
164
- loc = loc || globalThis.location;
165
- const parsedUrl = new URL(url, document.baseURI);
166
- if (parsedUrl.hostname !== loc.hostname || parsedUrl.port !== loc.port || parsedUrl.protocol !== loc.protocol) {
167
- return "anonymous";
168
- }
169
- return "";
170
- }
171
- function crossOrigin(element, url, crossorigin) {
172
- if (crossorigin === null && !url.startsWith("data:")) {
173
- element.crossOrigin = determineCrossOrigin(url);
174
- } else if (crossorigin !== false) {
175
- element.crossOrigin = typeof crossorigin === "string" ? crossorigin : "anonymous";
176
- }
177
- }
178
-
179
- class RawWeakMap {
180
- _map = /* @__PURE__ */ new WeakMap();
181
- // fix: vue reactive object
182
- _toRaw(value) {
183
- if (value && typeof value === "object") {
184
- const raw = value.__v_raw;
185
- if (raw) {
186
- value = this._toRaw(raw);
187
- }
188
- }
189
- return value;
190
- }
191
- /**
192
- * Removes the specified element from the WeakMap.
193
- * @returns true if the element was successfully removed, or false if it was not present.
194
- */
195
- delete(key) {
196
- return this._map.delete(this._toRaw(key));
197
- }
198
- /**
199
- * @returns a specified element.
200
- */
201
- get(key) {
202
- return this._map.get(this._toRaw(key));
203
- }
204
- /**
205
- * @returns a boolean indicating whether an element with the specified key exists or not.
206
- */
207
- has(key) {
208
- return this._map.has(this._toRaw(key));
209
- }
210
- /**
211
- * Adds a new element with a specified key and value.
212
- * @param key Must be an object or symbol.
213
- */
214
- set(key, value) {
215
- this._map.set(this._toRaw(key), this._toRaw(value));
216
- return this;
217
- }
218
- }
219
-
220
- const declarationMap = new RawWeakMap();
221
- function getDeclarations(constructor) {
222
- let declarations = declarationMap.get(constructor);
223
- if (!declarations) {
224
- const superConstructor = Object.getPrototypeOf(constructor);
225
- declarations = new Map(superConstructor ? getDeclarations(superConstructor) : void 0);
226
- declarationMap.set(constructor, declarations);
227
- }
228
- return declarations;
229
- }
230
- function defineProperty(constructor, name, declaration = {}) {
231
- getDeclarations(constructor).set(name, declaration);
232
- const {
233
- default: defaultValue,
234
- alias
235
- } = declaration;
236
- let descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, name);
237
- if (!descriptor) {
238
- const key = alias ?? Symbol.for(String(name));
239
- descriptor = {
240
- get() {
241
- return this[key];
242
- },
243
- set(v) {
244
- this[key] = v;
245
- }
246
- };
247
- }
248
- const getDefaultValue = () => typeof defaultValue === "function" ? defaultValue() : defaultValue;
249
- Object.defineProperty(constructor.prototype, name, {
250
- get() {
251
- let value = descriptor.get?.call(this);
252
- if (value === void 0) {
253
- value = getDefaultValue();
254
- if (value !== void 0) {
255
- descriptor.set?.call(this, value);
256
- }
257
- }
258
- return value;
259
- },
260
- set(value) {
261
- let oldValue = descriptor.get?.call(this);
262
- if (oldValue === void 0) {
263
- oldValue = getDefaultValue();
264
- }
265
- descriptor.set?.call(this, value);
266
- this.requestUpdate?.(name, oldValue, declaration);
267
- },
268
- configurable: true,
269
- enumerable: true
270
- });
271
- }
272
- function property(options) {
273
- return function(proto, name) {
274
- defineProperty(proto.constructor, name, options);
275
- };
276
- }
277
-
278
14
  const customNodes = /* @__PURE__ */ new Map();
279
15
  function customNode(tag, defaultProperties) {
280
16
  return function(constructor) {
@@ -285,7 +21,7 @@ function customNode(tag, defaultProperties) {
285
21
  });
286
22
  if (defaultProperties) {
287
23
  Object.keys(defaultProperties).forEach((key) => {
288
- defineProperty(constructor, key, { default: defaultProperties[key] });
24
+ modernIdoc.defineProperty(constructor, key, { default: defaultProperties[key] });
289
25
  });
290
26
  }
291
27
  customNodes.set(tag, constructor);
@@ -293,7 +29,7 @@ function customNode(tag, defaultProperties) {
293
29
  }
294
30
 
295
31
  function protectedProperty(options) {
296
- return property({ ...options, protected: true });
32
+ return modernIdoc.property({ ...options, protected: true });
297
33
  }
298
34
 
299
35
  function createNode(tag = "node", options = {}) {
@@ -474,9 +210,9 @@ class EventEmitter {
474
210
  }
475
211
  }
476
212
 
477
- let UID = 0;
213
+ let UID$1 = 0;
478
214
  class CoreObject extends EventEmitter {
479
- instanceId = ++UID;
215
+ instanceId = ++UID$1;
480
216
  _defaultProperties;
481
217
  _updatedProperties = /* @__PURE__ */ new Map();
482
218
  _changedProperties = /* @__PURE__ */ new Set();
@@ -512,7 +248,7 @@ class CoreObject extends EventEmitter {
512
248
  return this._updatedProperties.has(key);
513
249
  }
514
250
  getPropertyDeclarations() {
515
- return getDeclarations(this.constructor);
251
+ return modernIdoc.getDeclarations(this.constructor);
516
252
  }
517
253
  getPropertyDeclaration(key) {
518
254
  return this.getPropertyDeclarations().get(key);
@@ -560,9 +296,8 @@ class CoreObject extends EventEmitter {
560
296
  }
561
297
  return this;
562
298
  }
563
- requestUpdate(key, oldValue, declaration) {
299
+ requestUpdate(key, newValue, oldValue, declaration) {
564
300
  if (key !== void 0) {
565
- const newValue = this[key];
566
301
  if (!Object.is(newValue, oldValue)) {
567
302
  this._updatedProperties.set(key, oldValue);
568
303
  this._changedProperties.add(key);
@@ -606,6 +341,212 @@ class RefCounted extends CoreObject {
606
341
  //
607
342
  }
608
343
 
344
+ const PI = Math.PI;
345
+ const PI_2 = PI * 2;
346
+ let UID = 0;
347
+ function uid(object) {
348
+ return object?.__SPECTOR_Object_TAG?.id ?? ++UID;
349
+ }
350
+ function isPow2(v) {
351
+ return !(v & v - 1) && !!v;
352
+ }
353
+
354
+ const FUNCTIONS_RE = /([\w-]+)\((.+?)\)/g;
355
+ const ARGS_RE = /[^,]+/g;
356
+ const ARG_RE = /([-e.\d]+)(.*)/;
357
+ function getDefaultCssPropertyValue(value) {
358
+ if (Array.isArray(value)) {
359
+ return value.map((func) => {
360
+ return {
361
+ name: func.name,
362
+ args: func.args.map((arg) => {
363
+ return {
364
+ ...arg,
365
+ normalizedIntValue: arg.normalizedDefaultIntValue
366
+ };
367
+ })
368
+ };
369
+ });
370
+ } else {
371
+ return {
372
+ ...value,
373
+ normalizedIntValue: value.normalizedDefaultIntValue
374
+ };
375
+ }
376
+ }
377
+ function parseCssProperty(name, propertyValue, context = {}) {
378
+ const functions = parseCssFunctions(propertyValue, context);
379
+ return functions.length ? functions : parseArgument(name, propertyValue, context);
380
+ }
381
+ function parseCssFunctions(propertyValue, context = {}) {
382
+ const functions = [];
383
+ let match;
384
+ while ((match = FUNCTIONS_RE.exec(propertyValue)) !== null) {
385
+ const [, name, value] = match;
386
+ if (name) {
387
+ functions.push({
388
+ name,
389
+ args: parseArguments(name, value, context)
390
+ });
391
+ }
392
+ }
393
+ return functions;
394
+ }
395
+ function parseArguments(name, value, context = {}) {
396
+ const values = [];
397
+ let match;
398
+ let i = 0;
399
+ while ((match = ARGS_RE.exec(value)) !== null) {
400
+ values.push(
401
+ parseArgument(name, match[0], {
402
+ ...context,
403
+ index: i++
404
+ })
405
+ );
406
+ }
407
+ return values;
408
+ }
409
+ function parseArgument(name, value, context = {}) {
410
+ const { width = 1, height = 1, index = 0 } = context;
411
+ const matched = value.match(ARG_RE);
412
+ const result = {
413
+ unit: matched?.[2] ?? null,
414
+ value,
415
+ intValue: Number(matched?.[1]),
416
+ normalizedIntValue: 0,
417
+ normalizedDefaultIntValue: 0
418
+ };
419
+ switch (name) {
420
+ case "scale":
421
+ case "scaleX":
422
+ case "scaleY":
423
+ case "scale3d":
424
+ result.normalizedDefaultIntValue = 1;
425
+ break;
426
+ }
427
+ switch (result.unit) {
428
+ case "%":
429
+ result.normalizedIntValue = result.intValue / 100;
430
+ break;
431
+ case "rad":
432
+ result.normalizedIntValue = result.intValue / PI_2;
433
+ break;
434
+ case "deg":
435
+ result.normalizedIntValue = result.intValue / 360;
436
+ break;
437
+ case "px":
438
+ switch (index) {
439
+ case 0:
440
+ result.normalizedIntValue = result.intValue / width;
441
+ break;
442
+ case 1:
443
+ result.normalizedIntValue = result.intValue / height;
444
+ break;
445
+ }
446
+ break;
447
+ case "turn":
448
+ case "em":
449
+ // div fontSize
450
+ case "rem":
451
+ // div fontSize
452
+ default:
453
+ result.normalizedIntValue = result.intValue;
454
+ break;
455
+ }
456
+ return result;
457
+ }
458
+
459
+ const SUPPORTS_WEBGL2 = "WebGL2RenderingContext" in globalThis;
460
+ const SUPPORTS_IMAGE_BITMAP = "ImageBitmap" in globalThis;
461
+ const SUPPORTS_RESIZE_OBSERVER = "ResizeObserver" in globalThis;
462
+ const SUPPORTS_POINTER_EVENTS = "PointerEvent" in globalThis;
463
+ const SUPPORTS_WHEEL_EVENTS = "WheelEvent" in globalThis;
464
+ const SUPPORTS_MOUSE_EVENTS = "MouseEvent" in globalThis;
465
+ const SUPPORTS_TOUCH_EVENTS = "ontouchstart" in globalThis;
466
+ const SUPPORTS_CLICK_EVENTS = "onclick" in globalThis;
467
+ const SUPPORTS_CREATE_IMAGE_BITMAP = "createImageBitmap" in globalThis;
468
+ const SUPPORTS_AUDIO_CONTEXT = "AudioContext" in globalThis;
469
+ const SUPPORTS_WEBKIT_AUDIO_CONTEXT = "webkitAudioContext" in globalThis;
470
+ const SUPPORTS_OFFLINE_AUDIO_CONTEXT = "OfflineAudioContext" in globalThis;
471
+ const SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT = "webkitOfflineAudioContext" in globalThis;
472
+ const SUPPORTS_WEB_AUDIO = SUPPORTS_AUDIO_CONTEXT || SUPPORTS_WEBKIT_AUDIO_CONTEXT;
473
+ const IN_BROWSER = typeof window !== "undefined";
474
+ const DEVICE_PIXEL_RATIO = globalThis.devicePixelRatio || 1;
475
+ const isElementNode = (node) => node !== null && typeof node === "object" && node.nodeType === 1;
476
+ const isVideoElement = (node) => isElementNode(node) && node.tagName === "VIDEO";
477
+ const isImageElement = (node) => isElementNode(node) && node.tagName === "IMG";
478
+ function isCanvasElement(node) {
479
+ return typeof node === "object" && node !== null && node.nodeType === 1 && node.tagName === "CANVAS";
480
+ }
481
+ function isWebgl2(gl) {
482
+ return SUPPORTS_WEBGL2 && gl instanceof globalThis.WebGL2RenderingContext;
483
+ }
484
+ function createHTMLCanvas() {
485
+ if (IN_BROWSER) {
486
+ return globalThis.document.createElement("canvas");
487
+ }
488
+ return void 0;
489
+ }
490
+ function determineCrossOrigin(url, loc = globalThis.location) {
491
+ if (url.startsWith("data:")) {
492
+ return "";
493
+ }
494
+ loc = loc || globalThis.location;
495
+ const parsedUrl = new URL(url, document.baseURI);
496
+ if (parsedUrl.hostname !== loc.hostname || parsedUrl.port !== loc.port || parsedUrl.protocol !== loc.protocol) {
497
+ return "anonymous";
498
+ }
499
+ return "";
500
+ }
501
+ function crossOrigin(element, url, crossorigin) {
502
+ if (crossorigin === null && !url.startsWith("data:")) {
503
+ element.crossOrigin = determineCrossOrigin(url);
504
+ } else if (crossorigin !== false) {
505
+ element.crossOrigin = typeof crossorigin === "string" ? crossorigin : "anonymous";
506
+ }
507
+ }
508
+
509
+ class RawWeakMap {
510
+ _map = /* @__PURE__ */ new WeakMap();
511
+ // fix: vue reactive object
512
+ _toRaw(value) {
513
+ if (value && typeof value === "object") {
514
+ const raw = value.__v_raw;
515
+ if (raw) {
516
+ value = this._toRaw(raw);
517
+ }
518
+ }
519
+ return value;
520
+ }
521
+ /**
522
+ * Removes the specified element from the WeakMap.
523
+ * @returns true if the element was successfully removed, or false if it was not present.
524
+ */
525
+ delete(key) {
526
+ return this._map.delete(this._toRaw(key));
527
+ }
528
+ /**
529
+ * @returns a specified element.
530
+ */
531
+ get(key) {
532
+ return this._map.get(this._toRaw(key));
533
+ }
534
+ /**
535
+ * @returns a boolean indicating whether an element with the specified key exists or not.
536
+ */
537
+ has(key) {
538
+ return this._map.has(this._toRaw(key));
539
+ }
540
+ /**
541
+ * Adds a new element with a specified key and value.
542
+ * @param key Must be an object or symbol.
543
+ */
544
+ set(key, value) {
545
+ this._map.set(this._toRaw(key), this._toRaw(value));
546
+ return this;
547
+ }
548
+ }
549
+
609
550
  class InputEvent {
610
551
  bubbles = true;
611
552
  cancelable = false;
@@ -1502,18 +1443,18 @@ class ColorMatrix extends Matrix {
1502
1443
  const lumG = 0.715;
1503
1444
  const lumB = 0.072;
1504
1445
  return this.multiply([
1505
- lumR + cos * (1 - lumR) + sin * -0.213,
1506
- lumG + cos * -0.715 + sin * -0.715,
1507
- lumB + cos * -0.072 + sin * (1 - lumB),
1446
+ lumR + cos * (1 - lumR) + sin * -lumR,
1447
+ lumG + cos * -lumG + sin * -lumG,
1448
+ lumB + cos * -lumB + sin * (1 - lumB),
1508
1449
  0,
1509
1450
  0,
1510
- lumR + cos * -0.213 + sin * 0.143,
1451
+ lumR + cos * -lumR + sin * 0.143,
1511
1452
  lumG + cos * (1 - lumG) + sin * 0.14,
1512
- lumB + cos * -0.072 + sin * -0.283,
1453
+ lumB + cos * -lumB + sin * -0.283,
1513
1454
  0,
1514
1455
  0,
1515
- lumR + cos * -0.213 + sin * -0.787,
1516
- lumG + cos * -0.715 + sin * lumG,
1456
+ lumR + cos * -lumR + sin * -0.787,
1457
+ lumG + cos * -lumG + sin * lumG,
1517
1458
  lumB + cos * (1 - lumB) + sin * lumB,
1518
1459
  0,
1519
1460
  0,
@@ -2230,10 +2171,10 @@ class MainLoop extends CoreObject {
2230
2171
  }
2231
2172
  }
2232
2173
  __decorateClass$Y([
2233
- property({ default: 24 })
2174
+ modernIdoc.property({ default: 24 })
2234
2175
  ], MainLoop.prototype, "fps");
2235
2176
  __decorateClass$Y([
2236
- property({ default: 1 })
2177
+ modernIdoc.property({ default: 1 })
2237
2178
  ], MainLoop.prototype, "speed");
2238
2179
 
2239
2180
  class Renderer {
@@ -3324,7 +3265,7 @@ class WebGLProgramModule extends WebGLModule {
3324
3265
  return {
3325
3266
  attributes: /* @__PURE__ */ new Map(),
3326
3267
  uniforms: /* @__PURE__ */ new Map(),
3327
- boundUniforms: new RawWeakMap()
3268
+ boundUniforms: new modernIdoc.RawWeakMap()
3328
3269
  };
3329
3270
  });
3330
3271
  }
@@ -5089,19 +5030,19 @@ __decorateClass$U([
5089
5030
  protectedProperty()
5090
5031
  ], Texture2D.prototype, "source");
5091
5032
  __decorateClass$U([
5092
- property({ default: 0 })
5033
+ modernIdoc.property({ default: 0 })
5093
5034
  ], Texture2D.prototype, "width");
5094
5035
  __decorateClass$U([
5095
- property({ default: 0 })
5036
+ modernIdoc.property({ default: 0 })
5096
5037
  ], Texture2D.prototype, "height");
5097
5038
  __decorateClass$U([
5098
- property({ default: "linear" })
5039
+ modernIdoc.property({ default: "linear" })
5099
5040
  ], Texture2D.prototype, "filterMode");
5100
5041
  __decorateClass$U([
5101
- property({ default: "clamp_to_edge" })
5042
+ modernIdoc.property({ default: "clamp_to_edge" })
5102
5043
  ], Texture2D.prototype, "wrapMode");
5103
5044
  __decorateClass$U([
5104
- property({ default: 1 })
5045
+ modernIdoc.property({ default: 1 })
5105
5046
  ], Texture2D.prototype, "pixelRatio");
5106
5047
 
5107
5048
  class AnimatedTexture extends Resource {
@@ -5156,7 +5097,7 @@ class CanvasTexture extends Texture2D {
5156
5097
  }
5157
5098
  }
5158
5099
  __decorateClass$T([
5159
- property({ default: 2 })
5100
+ modernIdoc.property({ default: 2 })
5160
5101
  ], CanvasTexture.prototype, "pixelRatio");
5161
5102
 
5162
5103
  class ColorTexture extends Texture2D {
@@ -6140,25 +6081,25 @@ exports.Node = class Node extends CoreObject {
6140
6081
  }
6141
6082
  };
6142
6083
  __decorateClass$R([
6143
- property()
6084
+ modernIdoc.property()
6144
6085
  ], exports.Node.prototype, "name", 2);
6145
6086
  __decorateClass$R([
6146
- property()
6087
+ modernIdoc.property()
6147
6088
  ], exports.Node.prototype, "mask", 2);
6148
6089
  __decorateClass$R([
6149
- property({ default: "inherit" })
6090
+ modernIdoc.property({ default: "inherit" })
6150
6091
  ], exports.Node.prototype, "processMode", 2);
6151
6092
  __decorateClass$R([
6152
- property({ default: "default" })
6093
+ modernIdoc.property({ default: "default" })
6153
6094
  ], exports.Node.prototype, "processSortMode", 2);
6154
6095
  __decorateClass$R([
6155
- property({ default: "inherit" })
6096
+ modernIdoc.property({ default: "inherit" })
6156
6097
  ], exports.Node.prototype, "renderMode", 2);
6157
6098
  __decorateClass$R([
6158
- property({ default: "default" })
6099
+ modernIdoc.property({ default: "default" })
6159
6100
  ], exports.Node.prototype, "internalMode", 2);
6160
6101
  __decorateClass$R([
6161
- property({ default: () => ({}) })
6102
+ modernIdoc.property({ default: () => ({}) })
6162
6103
  ], exports.Node.prototype, "meta", 2);
6163
6104
  exports.Node = __decorateClass$R([
6164
6105
  customNode("Node")
@@ -6232,13 +6173,13 @@ exports.TimelineNode = class TimelineNode extends exports.Node {
6232
6173
  }
6233
6174
  };
6234
6175
  __decorateClass$Q([
6235
- property({ default: 0 })
6176
+ modernIdoc.property({ default: 0 })
6236
6177
  ], exports.TimelineNode.prototype, "delay", 2);
6237
6178
  __decorateClass$Q([
6238
- property({ default: 0 })
6179
+ modernIdoc.property({ default: 0 })
6239
6180
  ], exports.TimelineNode.prototype, "duration", 2);
6240
6181
  __decorateClass$Q([
6241
- property({ default: false })
6182
+ modernIdoc.property({ default: false })
6242
6183
  ], exports.TimelineNode.prototype, "paused", 2);
6243
6184
  __decorateClass$Q([
6244
6185
  protectedProperty()
@@ -6393,16 +6334,16 @@ exports.Viewport = class Viewport extends exports.Node {
6393
6334
  }
6394
6335
  };
6395
6336
  __decorateClass$P([
6396
- property({ default: 0 })
6337
+ modernIdoc.property({ default: 0 })
6397
6338
  ], exports.Viewport.prototype, "x", 2);
6398
6339
  __decorateClass$P([
6399
- property({ default: 0 })
6340
+ modernIdoc.property({ default: 0 })
6400
6341
  ], exports.Viewport.prototype, "y", 2);
6401
6342
  __decorateClass$P([
6402
- property({ default: 0 })
6343
+ modernIdoc.property({ default: 0 })
6403
6344
  ], exports.Viewport.prototype, "width", 2);
6404
6345
  __decorateClass$P([
6405
- property({ default: 0 })
6346
+ modernIdoc.property({ default: 0 })
6406
6347
  ], exports.Viewport.prototype, "height", 2);
6407
6348
  exports.Viewport = __decorateClass$P([
6408
6349
  customNode("Viewport")
@@ -6660,13 +6601,13 @@ __decorateClass$O([
6660
6601
  protectedProperty()
6661
6602
  ], exports.Effect.prototype, "material", 2);
6662
6603
  __decorateClass$O([
6663
- property()
6604
+ modernIdoc.property()
6664
6605
  ], exports.Effect.prototype, "effectMode", 2);
6665
6606
  __decorateClass$O([
6666
- property({ default: "" })
6607
+ modernIdoc.property({ default: "" })
6667
6608
  ], exports.Effect.prototype, "glsl", 2);
6668
6609
  __decorateClass$O([
6669
- property({ default: "" })
6610
+ modernIdoc.property({ default: "" })
6670
6611
  ], exports.Effect.prototype, "glslSrc", 2);
6671
6612
  exports.Effect = __decorateClass$O([
6672
6613
  customNode("Effect")
@@ -6741,28 +6682,28 @@ void main(void) {
6741
6682
  }`
6742
6683
  }));
6743
6684
  __decorateClass$N([
6744
- property({ default: 1 })
6685
+ modernIdoc.property({ default: 1 })
6745
6686
  ], exports.ColorAdjustEffect.prototype, "saturation", 2);
6746
6687
  __decorateClass$N([
6747
- property({ default: 1 })
6688
+ modernIdoc.property({ default: 1 })
6748
6689
  ], exports.ColorAdjustEffect.prototype, "contrast", 2);
6749
6690
  __decorateClass$N([
6750
- property({ default: 1 })
6691
+ modernIdoc.property({ default: 1 })
6751
6692
  ], exports.ColorAdjustEffect.prototype, "brightness", 2);
6752
6693
  __decorateClass$N([
6753
- property({ default: 1 })
6694
+ modernIdoc.property({ default: 1 })
6754
6695
  ], exports.ColorAdjustEffect.prototype, "red", 2);
6755
6696
  __decorateClass$N([
6756
- property({ default: 1 })
6697
+ modernIdoc.property({ default: 1 })
6757
6698
  ], exports.ColorAdjustEffect.prototype, "green", 2);
6758
6699
  __decorateClass$N([
6759
- property({ default: 1 })
6700
+ modernIdoc.property({ default: 1 })
6760
6701
  ], exports.ColorAdjustEffect.prototype, "blue", 2);
6761
6702
  __decorateClass$N([
6762
- property({ default: 1 })
6703
+ modernIdoc.property({ default: 1 })
6763
6704
  ], exports.ColorAdjustEffect.prototype, "alpha", 2);
6764
6705
  __decorateClass$N([
6765
- property({ default: 1 })
6706
+ modernIdoc.property({ default: 1 })
6766
6707
  ], exports.ColorAdjustEffect.prototype, "gamma", 2);
6767
6708
  exports.ColorAdjustEffect = __decorateClass$N([
6768
6709
  customNode("ColorAdjustEffect")
@@ -6857,7 +6798,7 @@ void main(void) {
6857
6798
  }`
6858
6799
  }));
6859
6800
  __decorateClass$M([
6860
- property()
6801
+ modernIdoc.property()
6861
6802
  ], exports.ColorFilterEffect.prototype, "filter", 2);
6862
6803
  exports.ColorFilterEffect = __decorateClass$M([
6863
6804
  customNode("ColorFilterEffect")
@@ -6948,10 +6889,10 @@ void main(void) {
6948
6889
  }`
6949
6890
  }));
6950
6891
  __decorateClass$L([
6951
- property({ default: () => [] })
6892
+ modernIdoc.property({ default: () => [] })
6952
6893
  ], exports.ColorOverlayEffect.prototype, "colors", 2);
6953
6894
  __decorateClass$L([
6954
- property({ default: 0.5 })
6895
+ modernIdoc.property({ default: 0.5 })
6955
6896
  ], exports.ColorOverlayEffect.prototype, "alpha", 2);
6956
6897
  exports.ColorOverlayEffect = __decorateClass$L([
6957
6898
  customNode("ColorOverlayEffect")
@@ -7033,10 +6974,10 @@ void main(void) {
7033
6974
  }`
7034
6975
  }));
7035
6976
  __decorateClass$K([
7036
- property({ default: () => [] })
6977
+ modernIdoc.property({ default: () => [] })
7037
6978
  ], exports.ColorRemoveEffect.prototype, "colors", 2);
7038
6979
  __decorateClass$K([
7039
- property({ default: 0.5 })
6980
+ modernIdoc.property({ default: 0.5 })
7040
6981
  ], exports.ColorRemoveEffect.prototype, "epsilon", 2);
7041
6982
  exports.ColorRemoveEffect = __decorateClass$K([
7042
6983
  customNode("ColorRemoveEffect")
@@ -7140,10 +7081,10 @@ void main(void) {
7140
7081
  }`
7141
7082
  }));
7142
7083
  __decorateClass$J([
7143
- property({ default: [] })
7084
+ modernIdoc.property({ default: [] })
7144
7085
  ], exports.ColorReplaceEffect.prototype, "colors", 2);
7145
7086
  __decorateClass$J([
7146
- property({ default: 0.05 })
7087
+ modernIdoc.property({ default: 0.05 })
7147
7088
  ], exports.ColorReplaceEffect.prototype, "epsilon", 2);
7148
7089
  exports.ColorReplaceEffect = __decorateClass$J([
7149
7090
  customNode("ColorReplaceEffect")
@@ -7422,7 +7363,8 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7422
7363
  this.requestUpdate();
7423
7364
  }
7424
7365
  }
7425
- _update() {
7366
+ _update(changed) {
7367
+ super._update(changed);
7426
7368
  const parent = this.getParent();
7427
7369
  if (this._parentGlobalVisible !== parent?.globalVisible) {
7428
7370
  this._updateGlobalVisible();
@@ -7469,10 +7411,10 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7469
7411
  }
7470
7412
  };
7471
7413
  __decorateClass$I([
7472
- property()
7414
+ modernIdoc.property()
7473
7415
  ], exports.CanvasItem.prototype, "modulate", 2);
7474
7416
  __decorateClass$I([
7475
- property()
7417
+ modernIdoc.property()
7476
7418
  ], exports.CanvasItem.prototype, "blendMode", 2);
7477
7419
  __decorateClass$I([
7478
7420
  protectedProperty({ default: true })
@@ -7563,16 +7505,16 @@ exports.Timeline = class Timeline extends exports.Node {
7563
7505
  }
7564
7506
  };
7565
7507
  __decorateClass$H([
7566
- property({ default: 0 })
7508
+ modernIdoc.property({ default: 0 })
7567
7509
  ], exports.Timeline.prototype, "startTime", 2);
7568
7510
  __decorateClass$H([
7569
- property({ default: 0 })
7511
+ modernIdoc.property({ default: 0 })
7570
7512
  ], exports.Timeline.prototype, "currentTime", 2);
7571
7513
  __decorateClass$H([
7572
- property({ default: Number.MAX_SAFE_INTEGER })
7514
+ modernIdoc.property({ default: Number.MAX_SAFE_INTEGER })
7573
7515
  ], exports.Timeline.prototype, "endTime", 2);
7574
7516
  __decorateClass$H([
7575
- property({ default: false })
7517
+ modernIdoc.property({ default: false })
7576
7518
  ], exports.Timeline.prototype, "loop", 2);
7577
7519
  exports.Timeline = __decorateClass$H([
7578
7520
  customNode("Timeline")
@@ -7658,10 +7600,10 @@ class SceneTree extends MainLoop {
7658
7600
  }
7659
7601
  }
7660
7602
  __decorateClass$G([
7661
- property({ default: false })
7603
+ modernIdoc.property({ default: false })
7662
7604
  ], SceneTree.prototype, "processPaused");
7663
7605
  __decorateClass$G([
7664
- property()
7606
+ modernIdoc.property()
7665
7607
  ], SceneTree.prototype, "backgroundColor");
7666
7608
  __decorateClass$G([
7667
7609
  protectedProperty({ default: false })
@@ -7804,10 +7746,10 @@ void main(void) {
7804
7746
  frag: frag$2
7805
7747
  }));
7806
7748
  __decorateClass$E([
7807
- property({ default: 4 })
7749
+ modernIdoc.property({ default: 4 })
7808
7750
  ], exports.GaussianBlurEffect.prototype, "strength", 2);
7809
7751
  __decorateClass$E([
7810
- property({ default: 3 })
7752
+ modernIdoc.property({ default: 3 })
7811
7753
  ], exports.GaussianBlurEffect.prototype, "quality", 2);
7812
7754
  exports.GaussianBlurEffect = __decorateClass$E([
7813
7755
  customNode("GaussianBlurEffect")
@@ -7886,19 +7828,19 @@ void main(void) {
7886
7828
  }`
7887
7829
  }));
7888
7830
  __decorateClass$D([
7889
- property({ default: 0 })
7831
+ modernIdoc.property({ default: 0 })
7890
7832
  ], exports.DropShadowEffect.prototype, "color", 2);
7891
7833
  __decorateClass$D([
7892
- property({ default: 4 })
7834
+ modernIdoc.property({ default: 4 })
7893
7835
  ], exports.DropShadowEffect.prototype, "blur", 2);
7894
7836
  __decorateClass$D([
7895
- property({ default: 4 })
7837
+ modernIdoc.property({ default: 4 })
7896
7838
  ], exports.DropShadowEffect.prototype, "offsetX", 2);
7897
7839
  __decorateClass$D([
7898
- property({ default: 4 })
7840
+ modernIdoc.property({ default: 4 })
7899
7841
  ], exports.DropShadowEffect.prototype, "offsetY", 2);
7900
7842
  __decorateClass$D([
7901
- property({ default: false })
7843
+ modernIdoc.property({ default: false })
7902
7844
  ], exports.DropShadowEffect.prototype, "shadowOnly", 2);
7903
7845
  exports.DropShadowEffect = __decorateClass$D([
7904
7846
  customNode("DropShadowEffect")
@@ -7958,7 +7900,7 @@ void main(void) {
7958
7900
  }`
7959
7901
  }));
7960
7902
  __decorateClass$C([
7961
- property({ default: 5 })
7903
+ modernIdoc.property({ default: 5 })
7962
7904
  ], exports.EmbossEffect.prototype, "strength", 2);
7963
7905
  exports.EmbossEffect = __decorateClass$C([
7964
7906
  customNode("EmbossEffect")
@@ -8147,31 +8089,31 @@ void main(void) {
8147
8089
  }`
8148
8090
  }));
8149
8091
  __decorateClass$B([
8150
- property({ default: 10 })
8092
+ modernIdoc.property({ default: 10 })
8151
8093
  ], exports.GlitchEffect.prototype, "slices", 2);
8152
8094
  __decorateClass$B([
8153
- property({ default: 512 })
8095
+ modernIdoc.property({ default: 512 })
8154
8096
  ], exports.GlitchEffect.prototype, "sampleSize", 2);
8155
8097
  __decorateClass$B([
8156
- property({ default: 100 })
8098
+ modernIdoc.property({ default: 100 })
8157
8099
  ], exports.GlitchEffect.prototype, "offset", 2);
8158
8100
  __decorateClass$B([
8159
- property({ default: 0 })
8101
+ modernIdoc.property({ default: 0 })
8160
8102
  ], exports.GlitchEffect.prototype, "direction", 2);
8161
8103
  __decorateClass$B([
8162
- property({ default: 2 })
8104
+ modernIdoc.property({ default: 2 })
8163
8105
  ], exports.GlitchEffect.prototype, "fillMode", 2);
8164
8106
  __decorateClass$B([
8165
- property({ default: 0 })
8107
+ modernIdoc.property({ default: 0 })
8166
8108
  ], exports.GlitchEffect.prototype, "seed", 2);
8167
8109
  __decorateClass$B([
8168
- property({ default: [2, 2] })
8110
+ modernIdoc.property({ default: [2, 2] })
8169
8111
  ], exports.GlitchEffect.prototype, "red", 2);
8170
8112
  __decorateClass$B([
8171
- property({ default: [-10, 4] })
8113
+ modernIdoc.property({ default: [-10, 4] })
8172
8114
  ], exports.GlitchEffect.prototype, "green", 2);
8173
8115
  __decorateClass$B([
8174
- property({ default: [10, -4] })
8116
+ modernIdoc.property({ default: [10, -4] })
8175
8117
  ], exports.GlitchEffect.prototype, "blue", 2);
8176
8118
  exports.GlitchEffect = __decorateClass$B([
8177
8119
  customNode("GlitchEffect")
@@ -8364,25 +8306,25 @@ void main(void) {
8364
8306
  }`
8365
8307
  }));
8366
8308
  __decorateClass$A([
8367
- property({ default: 0 })
8309
+ modernIdoc.property({ default: 0 })
8368
8310
  ], exports.GodrayEffect.prototype, "time", 2);
8369
8311
  __decorateClass$A([
8370
- property({ default: 30 })
8312
+ modernIdoc.property({ default: 30 })
8371
8313
  ], exports.GodrayEffect.prototype, "angle", 2);
8372
8314
  __decorateClass$A([
8373
- property({ default: 0.5 })
8315
+ modernIdoc.property({ default: 0.5 })
8374
8316
  ], exports.GodrayEffect.prototype, "gain", 2);
8375
8317
  __decorateClass$A([
8376
- property({ default: 2.5 })
8318
+ modernIdoc.property({ default: 2.5 })
8377
8319
  ], exports.GodrayEffect.prototype, "lacunarity", 2);
8378
8320
  __decorateClass$A([
8379
- property({ default: true })
8321
+ modernIdoc.property({ default: true })
8380
8322
  ], exports.GodrayEffect.prototype, "parallel", 2);
8381
8323
  __decorateClass$A([
8382
- property({ default: () => [0, 0] })
8324
+ modernIdoc.property({ default: () => [0, 0] })
8383
8325
  ], exports.GodrayEffect.prototype, "center", 2);
8384
8326
  __decorateClass$A([
8385
- property({ default: 1 })
8327
+ modernIdoc.property({ default: 1 })
8386
8328
  ], exports.GodrayEffect.prototype, "alpha", 2);
8387
8329
  exports.GodrayEffect = __decorateClass$A([
8388
8330
  customNode("GodrayEffect")
@@ -8487,13 +8429,13 @@ void main() {
8487
8429
  }
8488
8430
  };
8489
8431
  __decorateClass$z([
8490
- property({ default: 4 })
8432
+ modernIdoc.property({ default: 4 })
8491
8433
  ], exports.KawaseBlurEffect.prototype, "strength", 2);
8492
8434
  __decorateClass$z([
8493
- property({ default: 3 })
8435
+ modernIdoc.property({ default: 3 })
8494
8436
  ], exports.KawaseBlurEffect.prototype, "quality", 2);
8495
8437
  __decorateClass$z([
8496
- property({ default: [1, 1] })
8438
+ modernIdoc.property({ default: [1, 1] })
8497
8439
  ], exports.KawaseBlurEffect.prototype, "pixelSize", 2);
8498
8440
  exports.KawaseBlurEffect = __decorateClass$z([
8499
8441
  customNode("KawaseBlurEffect")
@@ -8600,7 +8542,7 @@ __decorateClass$y([
8600
8542
  protectedProperty()
8601
8543
  ], exports.MaskEffect.prototype, "texture", 2);
8602
8544
  __decorateClass$y([
8603
- property({ default: "" })
8545
+ modernIdoc.property({ default: "" })
8604
8546
  ], exports.MaskEffect.prototype, "src", 2);
8605
8547
  exports.MaskEffect = __decorateClass$y([
8606
8548
  customNode("MaskEffect")
@@ -8703,25 +8645,25 @@ void main() {
8703
8645
  __publicField$7(exports.OutlineEffect, "MIN_SAMPLES", 1);
8704
8646
  __publicField$7(exports.OutlineEffect, "MAX_SAMPLES", 100);
8705
8647
  __decorateClass$x([
8706
- property({ default: 0 })
8648
+ modernIdoc.property({ default: 0 })
8707
8649
  ], exports.OutlineEffect.prototype, "color", 2);
8708
8650
  __decorateClass$x([
8709
- property({ default: 1 })
8651
+ modernIdoc.property({ default: 1 })
8710
8652
  ], exports.OutlineEffect.prototype, "width", 2);
8711
8653
  __decorateClass$x([
8712
- property({ default: "solid" })
8654
+ modernIdoc.property({ default: "solid" })
8713
8655
  ], exports.OutlineEffect.prototype, "style", 2);
8714
8656
  __decorateClass$x([
8715
- property()
8657
+ modernIdoc.property()
8716
8658
  ], exports.OutlineEffect.prototype, "image", 2);
8717
8659
  __decorateClass$x([
8718
- property({ default: 1 })
8660
+ modernIdoc.property({ default: 1 })
8719
8661
  ], exports.OutlineEffect.prototype, "opacity", 2);
8720
8662
  __decorateClass$x([
8721
- property({ default: 0.1 })
8663
+ modernIdoc.property({ default: 0.1 })
8722
8664
  ], exports.OutlineEffect.prototype, "quality", 2);
8723
8665
  __decorateClass$x([
8724
- property({ default: false })
8666
+ modernIdoc.property({ default: false })
8725
8667
  ], exports.OutlineEffect.prototype, "knockout", 2);
8726
8668
  exports.OutlineEffect = __decorateClass$x([
8727
8669
  customNode("OutlineEffect")
@@ -8792,7 +8734,7 @@ void main(void) {
8792
8734
  }`
8793
8735
  }));
8794
8736
  __decorateClass$w([
8795
- property({ default: 10 })
8737
+ modernIdoc.property({ default: 10 })
8796
8738
  ], exports.PixelateEffect.prototype, "strength", 2);
8797
8739
  exports.PixelateEffect = __decorateClass$w([
8798
8740
  customNode("PixelateEffect")
@@ -8920,16 +8862,16 @@ void main() {
8920
8862
  }`
8921
8863
  }));
8922
8864
  __decorateClass$v([
8923
- property()
8865
+ modernIdoc.property()
8924
8866
  ], exports.ZoomBlurEffect.prototype, "center", 2);
8925
8867
  __decorateClass$v([
8926
- property({ default: 20 })
8868
+ modernIdoc.property({ default: 20 })
8927
8869
  ], exports.ZoomBlurEffect.prototype, "innerRadius", 2);
8928
8870
  __decorateClass$v([
8929
- property({ default: -1 })
8871
+ modernIdoc.property({ default: -1 })
8930
8872
  ], exports.ZoomBlurEffect.prototype, "radius", 2);
8931
8873
  __decorateClass$v([
8932
- property({ default: 0.1 })
8874
+ modernIdoc.property({ default: 0.1 })
8933
8875
  ], exports.ZoomBlurEffect.prototype, "strength", 2);
8934
8876
  exports.ZoomBlurEffect = __decorateClass$v([
8935
8877
  customNode("ZoomBlurEffect")
@@ -9048,34 +8990,34 @@ class BaseElement2DFill extends CoreObject {
9048
8990
  }
9049
8991
  }
9050
8992
  __decorateClass$u([
9051
- property()
8993
+ modernIdoc.property()
9052
8994
  ], BaseElement2DFill.prototype, "color");
9053
8995
  __decorateClass$u([
9054
- property()
8996
+ modernIdoc.property()
9055
8997
  ], BaseElement2DFill.prototype, "image");
9056
8998
  __decorateClass$u([
9057
- property()
8999
+ modernIdoc.property()
9058
9000
  ], BaseElement2DFill.prototype, "linearGradient");
9059
9001
  __decorateClass$u([
9060
- property()
9002
+ modernIdoc.property()
9061
9003
  ], BaseElement2DFill.prototype, "radialGradient");
9062
9004
  __decorateClass$u([
9063
- property()
9005
+ modernIdoc.property()
9064
9006
  ], BaseElement2DFill.prototype, "cropRect");
9065
9007
  __decorateClass$u([
9066
- property()
9008
+ modernIdoc.property()
9067
9009
  ], BaseElement2DFill.prototype, "stretchRect");
9068
9010
  __decorateClass$u([
9069
- property()
9011
+ modernIdoc.property()
9070
9012
  ], BaseElement2DFill.prototype, "dpi");
9071
9013
  __decorateClass$u([
9072
- property()
9014
+ modernIdoc.property()
9073
9015
  ], BaseElement2DFill.prototype, "rotateWithShape");
9074
9016
  __decorateClass$u([
9075
- property()
9017
+ modernIdoc.property()
9076
9018
  ], BaseElement2DFill.prototype, "tile");
9077
9019
  __decorateClass$u([
9078
- property()
9020
+ modernIdoc.property()
9079
9021
  ], BaseElement2DFill.prototype, "opacity");
9080
9022
 
9081
9023
  var __defProp$m = Object.defineProperty;
@@ -9095,7 +9037,7 @@ class BaseElement2DBackground extends BaseElement2DFill {
9095
9037
  }
9096
9038
  }
9097
9039
  __decorateClass$t([
9098
- property()
9040
+ modernIdoc.property()
9099
9041
  ], BaseElement2DBackground.prototype, "fillWithShape");
9100
9042
 
9101
9043
  var __defProp$l = Object.defineProperty;
@@ -9115,7 +9057,7 @@ class BaseElement2DForeground extends BaseElement2DFill {
9115
9057
  }
9116
9058
  }
9117
9059
  __decorateClass$s([
9118
- property()
9060
+ modernIdoc.property()
9119
9061
  ], BaseElement2DForeground.prototype, "fillWithShape");
9120
9062
 
9121
9063
  var __defProp$k = Object.defineProperty;
@@ -9157,13 +9099,13 @@ class BaseElement2DOutline extends BaseElement2DFill {
9157
9099
  }
9158
9100
  }
9159
9101
  __decorateClass$r([
9160
- property({ default: 0 })
9102
+ modernIdoc.property({ default: 0 })
9161
9103
  ], BaseElement2DOutline.prototype, "color");
9162
9104
  __decorateClass$r([
9163
- property({ default: 0 })
9105
+ modernIdoc.property({ default: 0 })
9164
9106
  ], BaseElement2DOutline.prototype, "width");
9165
9107
  __decorateClass$r([
9166
- property({ default: "solid" })
9108
+ modernIdoc.property({ default: "solid" })
9167
9109
  ], BaseElement2DOutline.prototype, "style");
9168
9110
 
9169
9111
  var __defProp$j = Object.defineProperty;
@@ -9213,16 +9155,16 @@ class BaseElement2DShadow extends CoreObject {
9213
9155
  }
9214
9156
  }
9215
9157
  __decorateClass$q([
9216
- property({ default: "#000000" })
9158
+ modernIdoc.property({ default: "#000000" })
9217
9159
  ], BaseElement2DShadow.prototype, "color");
9218
9160
  __decorateClass$q([
9219
- property({ default: 0 })
9161
+ modernIdoc.property({ default: 0 })
9220
9162
  ], BaseElement2DShadow.prototype, "blur");
9221
9163
  __decorateClass$q([
9222
- property({ default: 0 })
9164
+ modernIdoc.property({ default: 0 })
9223
9165
  ], BaseElement2DShadow.prototype, "offsetY");
9224
9166
  __decorateClass$q([
9225
- property({ default: 0 })
9167
+ modernIdoc.property({ default: 0 })
9226
9168
  ], BaseElement2DShadow.prototype, "offsetX");
9227
9169
 
9228
9170
  var __defProp$i = Object.defineProperty;
@@ -9306,16 +9248,16 @@ class BaseElement2DShape extends CoreObject {
9306
9248
  }
9307
9249
  }
9308
9250
  __decorateClass$p([
9309
- property()
9251
+ modernIdoc.property()
9310
9252
  ], BaseElement2DShape.prototype, "preset");
9311
9253
  __decorateClass$p([
9312
- property()
9254
+ modernIdoc.property()
9313
9255
  ], BaseElement2DShape.prototype, "svg");
9314
9256
  __decorateClass$p([
9315
- property()
9257
+ modernIdoc.property()
9316
9258
  ], BaseElement2DShape.prototype, "viewBox");
9317
9259
  __decorateClass$p([
9318
- property({ default: () => [] })
9260
+ modernIdoc.property({ default: () => [] })
9319
9261
  ], BaseElement2DShape.prototype, "paths");
9320
9262
 
9321
9263
  class BaseElement2DStyle extends Resource {
@@ -9330,7 +9272,7 @@ delete defaultStyles$1.left;
9330
9272
  delete defaultStyles$1.width;
9331
9273
  delete defaultStyles$1.height;
9332
9274
  for (const key in defaultStyles$1) {
9333
- defineProperty(BaseElement2DStyle, key, {
9275
+ modernIdoc.defineProperty(BaseElement2DStyle, key, {
9334
9276
  default: defaultStyles$1[key]
9335
9277
  });
9336
9278
  }
@@ -9349,11 +9291,8 @@ class BaseElement2DText extends CoreObject {
9349
9291
  super();
9350
9292
  this.parent = parent;
9351
9293
  }
9352
- effects;
9353
- measureDom;
9354
- fonts;
9294
+ base = new modernText.Text();
9355
9295
  texture = new CanvasTexture();
9356
- baseText = new modernText.Text();
9357
9296
  measureResult;
9358
9297
  setProperties(properties) {
9359
9298
  return super.setProperties(
@@ -9365,7 +9304,7 @@ class BaseElement2DText extends CoreObject {
9365
9304
  switch (key) {
9366
9305
  case "content":
9367
9306
  case "effects":
9368
- case "measureDom":
9307
+ case "measureDOM":
9369
9308
  case "fonts":
9370
9309
  case "split":
9371
9310
  this.parent.requestRedraw();
@@ -9373,21 +9312,17 @@ class BaseElement2DText extends CoreObject {
9373
9312
  }
9374
9313
  }
9375
9314
  _updateText() {
9376
- this.baseText.style = {
9315
+ this.base.style = {
9377
9316
  justifyContent: "center",
9378
9317
  alignItems: "center",
9379
9318
  textAlign: "center",
9380
9319
  ...this.parent.style.toJSON()
9381
9320
  };
9382
- this.baseText.content = this.content ?? "";
9383
- this.baseText.effects = this.effects;
9384
- this.baseText.fonts = this.fonts;
9385
- this.baseText.measureDom = this.measureDom;
9386
- this.baseText.requestUpdate();
9321
+ this.base.requestUpdate();
9387
9322
  }
9388
9323
  measure() {
9389
9324
  this._updateText();
9390
- return this.baseText.measure();
9325
+ return this.base.measure();
9391
9326
  }
9392
9327
  updateMeasure() {
9393
9328
  this.measureResult = this.measure();
@@ -9395,11 +9330,11 @@ class BaseElement2DText extends CoreObject {
9395
9330
  }
9396
9331
  canDraw() {
9397
9332
  return Boolean(
9398
- this.content && this.texture?.valid
9333
+ !/^\s*$/.test(this.base.toString()) && this.texture?.valid
9399
9334
  );
9400
9335
  }
9401
9336
  draw() {
9402
- this.baseText.render({
9337
+ this.base.render({
9403
9338
  pixelRatio: this.texture.pixelRatio,
9404
9339
  view: this.texture.source
9405
9340
  });
@@ -9421,16 +9356,16 @@ class BaseElement2DText extends CoreObject {
9421
9356
  }
9422
9357
  }
9423
9358
  __decorateClass$o([
9424
- property({ default: "" })
9359
+ modernIdoc.property({ alias: "base.content" })
9425
9360
  ], BaseElement2DText.prototype, "content");
9426
9361
  __decorateClass$o([
9427
- property()
9362
+ modernIdoc.property({ alias: "base.effects" })
9428
9363
  ], BaseElement2DText.prototype, "effects");
9429
9364
  __decorateClass$o([
9430
- protectedProperty()
9431
- ], BaseElement2DText.prototype, "measureDom");
9365
+ protectedProperty({ alias: "base.measureDOM" })
9366
+ ], BaseElement2DText.prototype, "measureDOM");
9432
9367
  __decorateClass$o([
9433
- protectedProperty()
9368
+ protectedProperty({ alias: "base.fonts" })
9434
9369
  ], BaseElement2DText.prototype, "fonts");
9435
9370
 
9436
9371
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
@@ -9905,7 +9840,7 @@ const defaultStyles = {
9905
9840
  height: 0
9906
9841
  };
9907
9842
  for (const key in defaultStyles) {
9908
- defineProperty(Element2DStyle, key, { default: defaultStyles[key] });
9843
+ modernIdoc.defineProperty(Element2DStyle, key, { default: defaultStyles[key] });
9909
9844
  }
9910
9845
 
9911
9846
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
@@ -10549,13 +10484,13 @@ __decorateClass$i([
10549
10484
  protectedProperty()
10550
10485
  ], exports.Image2D.prototype, "texture", 2);
10551
10486
  __decorateClass$i([
10552
- property({ default: "" })
10487
+ modernIdoc.property({ default: "" })
10553
10488
  ], exports.Image2D.prototype, "src", 2);
10554
10489
  __decorateClass$i([
10555
- property()
10490
+ modernIdoc.property()
10556
10491
  ], exports.Image2D.prototype, "srcRect", 2);
10557
10492
  __decorateClass$i([
10558
- property({ default: false })
10493
+ modernIdoc.property({ default: false })
10559
10494
  ], exports.Image2D.prototype, "gif", 2);
10560
10495
  exports.Image2D = __decorateClass$i([
10561
10496
  customNode("Image2D")
@@ -10632,7 +10567,7 @@ exports.Lottie2D = class Lottie2D extends TextureRect2D {
10632
10567
  }
10633
10568
  };
10634
10569
  __decorateClass$h([
10635
- property({ default: "" })
10570
+ modernIdoc.property({ default: "" })
10636
10571
  ], exports.Lottie2D.prototype, "src", 2);
10637
10572
  exports.Lottie2D = __decorateClass$h([
10638
10573
  customNode("Lottie2D")
@@ -10669,7 +10604,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10669
10604
  switch (key) {
10670
10605
  case "content":
10671
10606
  case "effects":
10672
- case "measureDom":
10607
+ case "measureDOM":
10673
10608
  case "fonts":
10674
10609
  case "split":
10675
10610
  this._updateSplit();
@@ -10684,10 +10619,6 @@ exports.Text2D = class Text2D extends TextureRect2D {
10684
10619
  }
10685
10620
  _updateBase() {
10686
10621
  this.base.style = this.style.toJSON();
10687
- this.base.content = this.content ?? "";
10688
- this.base.effects = this.effects;
10689
- this.base.fonts = this.fonts;
10690
- this.base.measureDom = this.measureDom;
10691
10622
  this.emit("updateBase", this.base);
10692
10623
  this.base.requestUpdate();
10693
10624
  }
@@ -10800,19 +10731,19 @@ exports.Text2D = class Text2D extends TextureRect2D {
10800
10731
  }
10801
10732
  };
10802
10733
  __decorateClass$g([
10803
- property({ default: false })
10734
+ modernIdoc.property({ default: false })
10804
10735
  ], exports.Text2D.prototype, "split", 2);
10805
10736
  __decorateClass$g([
10806
- property({ default: "" })
10737
+ modernIdoc.property({ alias: "base.content" })
10807
10738
  ], exports.Text2D.prototype, "content", 2);
10808
10739
  __decorateClass$g([
10809
- property()
10740
+ modernIdoc.property({ alias: "base.effects" })
10810
10741
  ], exports.Text2D.prototype, "effects", 2);
10811
10742
  __decorateClass$g([
10812
- protectedProperty()
10813
- ], exports.Text2D.prototype, "measureDom", 2);
10743
+ protectedProperty({ alias: "base.measureDOM" })
10744
+ ], exports.Text2D.prototype, "measureDOM", 2);
10814
10745
  __decorateClass$g([
10815
- protectedProperty()
10746
+ protectedProperty({ alias: "base.fonts" })
10816
10747
  ], exports.Text2D.prototype, "fonts", 2);
10817
10748
  exports.Text2D = __decorateClass$g([
10818
10749
  customNode("Text2D")
@@ -10871,7 +10802,7 @@ class TransformRect2D extends exports.Element2D {
10871
10802
  }
10872
10803
  }
10873
10804
  __decorateClass$f([
10874
- property({ default: 6 })
10805
+ modernIdoc.property({ default: 6 })
10875
10806
  ], TransformRect2D.prototype, "handleSize");
10876
10807
 
10877
10808
  var __defProp$b = Object.defineProperty;
@@ -10935,7 +10866,7 @@ exports.Video2D = class Video2D extends TextureRect2D {
10935
10866
  }
10936
10867
  };
10937
10868
  __decorateClass$e([
10938
- property({ default: "" })
10869
+ modernIdoc.property({ default: "" })
10939
10870
  ], exports.Video2D.prototype, "src", 2);
10940
10871
  exports.Video2D = __decorateClass$e([
10941
10872
  customNode("Video2D")
@@ -11012,7 +10943,7 @@ exports.Animation = class Animation extends exports.TimelineNode {
11012
10943
  easing;
11013
10944
  _keyframes = [];
11014
10945
  _isFirstUpdatePosition = false;
11015
- _cachedProps = new RawWeakMap();
10946
+ _cachedProps = new modernIdoc.RawWeakMap();
11016
10947
  _stoped = false;
11017
10948
  constructor(properties, children = []) {
11018
10949
  super();
@@ -11269,16 +11200,16 @@ exports.Animation = class Animation extends exports.TimelineNode {
11269
11200
  }
11270
11201
  };
11271
11202
  __decorateClass$d([
11272
- property({ default: "parent" })
11203
+ modernIdoc.property({ default: "parent" })
11273
11204
  ], exports.Animation.prototype, "effectMode", 2);
11274
11205
  __decorateClass$d([
11275
- property({ default: false })
11206
+ modernIdoc.property({ default: false })
11276
11207
  ], exports.Animation.prototype, "loop", 2);
11277
11208
  __decorateClass$d([
11278
- property({ default: () => [] })
11209
+ modernIdoc.property({ default: () => [] })
11279
11210
  ], exports.Animation.prototype, "keyframes", 2);
11280
11211
  __decorateClass$d([
11281
- property()
11212
+ modernIdoc.property()
11282
11213
  ], exports.Animation.prototype, "easing", 2);
11283
11214
  exports.Animation = __decorateClass$d([
11284
11215
  customNode("Animation", {
@@ -12489,13 +12420,13 @@ exports.AudioWaveform = class AudioWaveform extends exports.Element2D {
12489
12420
  }
12490
12421
  };
12491
12422
  __decorateClass$b([
12492
- property()
12423
+ modernIdoc.property()
12493
12424
  ], exports.AudioWaveform.prototype, "src", 2);
12494
12425
  __decorateClass$b([
12495
- property()
12426
+ modernIdoc.property()
12496
12427
  ], exports.AudioWaveform.prototype, "gap", 2);
12497
12428
  __decorateClass$b([
12498
- property()
12429
+ modernIdoc.property()
12499
12430
  ], exports.AudioWaveform.prototype, "color", 2);
12500
12431
  exports.AudioWaveform = __decorateClass$b([
12501
12432
  customNode("AudioWaveform")
@@ -12585,25 +12516,25 @@ exports.Range = class Range extends exports.Control {
12585
12516
  }
12586
12517
  };
12587
12518
  __decorateClass$9([
12588
- property({ default: false })
12519
+ modernIdoc.property({ default: false })
12589
12520
  ], exports.Range.prototype, "allowGreater", 2);
12590
12521
  __decorateClass$9([
12591
- property({ default: false })
12522
+ modernIdoc.property({ default: false })
12592
12523
  ], exports.Range.prototype, "allowLesser", 2);
12593
12524
  __decorateClass$9([
12594
- property({ default: 1 })
12525
+ modernIdoc.property({ default: 1 })
12595
12526
  ], exports.Range.prototype, "page", 2);
12596
12527
  __decorateClass$9([
12597
- property({ default: 0 })
12528
+ modernIdoc.property({ default: 0 })
12598
12529
  ], exports.Range.prototype, "minValue", 2);
12599
12530
  __decorateClass$9([
12600
- property({ default: 100 })
12531
+ modernIdoc.property({ default: 100 })
12601
12532
  ], exports.Range.prototype, "maxValue", 2);
12602
12533
  __decorateClass$9([
12603
- property({ default: 0.01 })
12534
+ modernIdoc.property({ default: 0.01 })
12604
12535
  ], exports.Range.prototype, "step", 2);
12605
12536
  __decorateClass$9([
12606
- property({ default: 0 })
12537
+ modernIdoc.property({ default: 0 })
12607
12538
  ], exports.Range.prototype, "value", 2);
12608
12539
  exports.Range = __decorateClass$9([
12609
12540
  customNode("Range")
@@ -12765,31 +12696,31 @@ exports.Ruler = class Ruler extends exports.Control {
12765
12696
  }
12766
12697
  };
12767
12698
  __decorateClass$8([
12768
- property({ default: 0 })
12699
+ modernIdoc.property({ default: 0 })
12769
12700
  ], exports.Ruler.prototype, "offsetX", 2);
12770
12701
  __decorateClass$8([
12771
- property({ default: 0 })
12702
+ modernIdoc.property({ default: 0 })
12772
12703
  ], exports.Ruler.prototype, "offsetY", 2);
12773
12704
  __decorateClass$8([
12774
- property({ default: 20 })
12705
+ modernIdoc.property({ default: 20 })
12775
12706
  ], exports.Ruler.prototype, "thickness", 2);
12776
12707
  __decorateClass$8([
12777
- property({ default: 3 })
12708
+ modernIdoc.property({ default: 3 })
12778
12709
  ], exports.Ruler.prototype, "markHeight", 2);
12779
12710
  __decorateClass$8([
12780
- property({ default: "#b2b6bc" })
12711
+ modernIdoc.property({ default: "#b2b6bc" })
12781
12712
  ], exports.Ruler.prototype, "color", 2);
12782
12713
  __decorateClass$8([
12783
- property({ default: "#f9f9fa" })
12714
+ modernIdoc.property({ default: "#f9f9fa" })
12784
12715
  ], exports.Ruler.prototype, "markBackgroundColor", 2);
12785
12716
  __decorateClass$8([
12786
- property({ default: "#b2b6bc" })
12717
+ modernIdoc.property({ default: "#b2b6bc" })
12787
12718
  ], exports.Ruler.prototype, "markColor", 2);
12788
12719
  __decorateClass$8([
12789
- property({ default: 300 })
12720
+ modernIdoc.property({ default: 300 })
12790
12721
  ], exports.Ruler.prototype, "gap", 2);
12791
12722
  __decorateClass$8([
12792
- property({ default: 1 })
12723
+ modernIdoc.property({ default: 1 })
12793
12724
  ], exports.Ruler.prototype, "gapScale", 2);
12794
12725
  exports.Ruler = __decorateClass$8([
12795
12726
  customNode("Ruler")
@@ -12862,7 +12793,7 @@ exports.ScrollBar = class ScrollBar extends exports.Range {
12862
12793
  }
12863
12794
  };
12864
12795
  __decorateClass$7([
12865
- property({ default: "vertical" })
12796
+ modernIdoc.property({ default: "vertical" })
12866
12797
  ], exports.ScrollBar.prototype, "direction", 2);
12867
12798
  exports.ScrollBar = __decorateClass$7([
12868
12799
  customNode("ScrollBar")
@@ -12973,13 +12904,13 @@ exports.Scaler = class Scaler extends exports.Node {
12973
12904
  }
12974
12905
  };
12975
12906
  __decorateClass$4([
12976
- property({ default: 1 })
12907
+ modernIdoc.property({ default: 1 })
12977
12908
  ], exports.Scaler.prototype, "value", 2);
12978
12909
  __decorateClass$4([
12979
- property({ default: 0.05 })
12910
+ modernIdoc.property({ default: 0.05 })
12980
12911
  ], exports.Scaler.prototype, "minValue", 2);
12981
12912
  __decorateClass$4([
12982
- property({ default: 10 })
12913
+ modernIdoc.property({ default: 10 })
12983
12914
  ], exports.Scaler.prototype, "maxValue", 2);
12984
12915
  exports.Scaler = __decorateClass$4([
12985
12916
  customNode("Scaler", {
@@ -13688,7 +13619,7 @@ class CanvasItemEditor extends exports.Control {
13688
13619
  style: {
13689
13620
  visibility: "hidden",
13690
13621
  outlineStyle: "solid",
13691
- outlineColor: 16711935,
13622
+ outlineColor: "#00FF00FF",
13692
13623
  outlineWidth: 2,
13693
13624
  pointerEvents: "none"
13694
13625
  }
@@ -13725,7 +13656,7 @@ class CanvasItemEditor extends exports.Control {
13725
13656
  style: {
13726
13657
  width: 500,
13727
13658
  height: 500,
13728
- backgroundColor: 4294967295,
13659
+ backgroundColor: "#FFFFFFFF",
13729
13660
  overflow: "hidden",
13730
13661
  pointerEvents: "none",
13731
13662
  boxShadow: "2px 2px 2px 1px rgba(0, 0, 0, 0.2)"
@@ -14227,14 +14158,12 @@ exports.curves = curves;
14227
14158
  exports.customNode = customNode;
14228
14159
  exports.customNodes = customNodes;
14229
14160
  exports.defaultOptions = defaultOptions;
14230
- exports.defineProperty = defineProperty;
14231
14161
  exports.determineCrossOrigin = determineCrossOrigin;
14232
14162
  exports.ease = ease;
14233
14163
  exports.easeIn = easeIn;
14234
14164
  exports.easeInOut = easeInOut;
14235
14165
  exports.easeOut = easeOut;
14236
14166
  exports.frag = frag$1;
14237
- exports.getDeclarations = getDeclarations;
14238
14167
  exports.getDefaultCssPropertyValue = getDefaultCssPropertyValue;
14239
14168
  exports.isCanvasElement = isCanvasElement;
14240
14169
  exports.isElementNode = isElementNode;
@@ -14253,7 +14182,6 @@ exports.parseCSSTransform = parseCSSTransform;
14253
14182
  exports.parseCSSTransformOrigin = parseCSSTransformOrigin;
14254
14183
  exports.parseCssFunctions = parseCssFunctions;
14255
14184
  exports.parseCssProperty = parseCssProperty;
14256
- exports.property = property;
14257
14185
  exports.protectedProperty = protectedProperty;
14258
14186
  exports.render = render;
14259
14187
  exports.timingFunctions = timingFunctions;