modern-canvas 0.4.51 → 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,23 +7081,25 @@ 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")
7150
7091
  ], exports.ColorReplaceEffect);
7151
7092
 
7152
7093
  class CanvasContext extends modernPath2d.Path2D {
7153
- textureTransform;
7154
7094
  fillStyle;
7155
7095
  strokeStyle;
7156
7096
  lineCap;
7157
7097
  lineJoin;
7158
7098
  lineWidth;
7159
7099
  miterLimit;
7100
+ // custom
7101
+ uvTransform;
7102
+ vertTransform;
7160
7103
  _defaultStyle = Texture2D.EMPTY;
7161
7104
  _draws = [];
7162
7105
  _toTexture(source) {
@@ -7178,7 +7121,8 @@ class CanvasContext extends modernPath2d.Path2D {
7178
7121
  type: "stroke",
7179
7122
  path,
7180
7123
  texture,
7181
- textureTransform: this.textureTransform,
7124
+ uvTransform: this.uvTransform,
7125
+ vertTransform: this.vertTransform,
7182
7126
  style: {
7183
7127
  alignment: 0.5,
7184
7128
  cap: this.lineCap ?? "butt",
@@ -7207,7 +7151,8 @@ class CanvasContext extends modernPath2d.Path2D {
7207
7151
  type: "fill",
7208
7152
  path,
7209
7153
  texture,
7210
- textureTransform: this.textureTransform
7154
+ uvTransform: this.uvTransform,
7155
+ vertTransform: this.vertTransform
7211
7156
  });
7212
7157
  super.reset();
7213
7158
  }
@@ -7215,7 +7160,8 @@ class CanvasContext extends modernPath2d.Path2D {
7215
7160
  super.copy(source);
7216
7161
  this.strokeStyle = source.strokeStyle;
7217
7162
  this.fillStyle = source.fillStyle;
7218
- this.textureTransform = source.textureTransform;
7163
+ this.uvTransform = source.uvTransform;
7164
+ this.vertTransform = source.vertTransform;
7219
7165
  this.lineCap = source.lineCap;
7220
7166
  this.lineJoin = source.lineJoin;
7221
7167
  this.lineWidth = source.lineWidth;
@@ -7227,7 +7173,8 @@ class CanvasContext extends modernPath2d.Path2D {
7227
7173
  super.reset();
7228
7174
  this.strokeStyle = void 0;
7229
7175
  this.fillStyle = void 0;
7230
- this.textureTransform = void 0;
7176
+ this.uvTransform = void 0;
7177
+ this.vertTransform = void 0;
7231
7178
  this.lineCap = void 0;
7232
7179
  this.lineJoin = void 0;
7233
7180
  this.lineWidth = void 0;
@@ -7235,8 +7182,9 @@ class CanvasContext extends modernPath2d.Path2D {
7235
7182
  this._draws.length = 0;
7236
7183
  return this;
7237
7184
  }
7238
- buildUvs(start, vertices, uvs, texture, textureTransform) {
7185
+ buildUvs(start, vertices, uvs, texture, uvTransform) {
7239
7186
  if (texture) {
7187
+ const _uvTransform = uvTransform ? typeof uvTransform === "function" ? uvTransform : (x, y) => uvTransform.applyToPoint(x, y) : uvTransform;
7240
7188
  const w = texture.width;
7241
7189
  const h = texture.height;
7242
7190
  for (let len = vertices.length, i = start; i < len; i += 2) {
@@ -7244,8 +7192,8 @@ class CanvasContext extends modernPath2d.Path2D {
7244
7192
  const y = vertices[i + 1];
7245
7193
  let uvX;
7246
7194
  let uvY;
7247
- if (textureTransform) {
7248
- [uvX, uvY] = textureTransform?.applyToPoint(x, y);
7195
+ if (_uvTransform) {
7196
+ [uvX, uvY] = _uvTransform(x, y);
7249
7197
  } else {
7250
7198
  [uvX, uvY] = [x / w, y / h];
7251
7199
  }
@@ -7259,59 +7207,35 @@ class CanvasContext extends modernPath2d.Path2D {
7259
7207
  }
7260
7208
  toBatchables() {
7261
7209
  const batchables = [];
7262
- let vertices = [];
7263
- let indices = [];
7264
- let uvs = [];
7265
- let texture;
7266
- const push = (draw) => {
7267
- batchables.push({
7268
- vertices,
7269
- indices,
7270
- uvs,
7271
- texture,
7272
- type: draw.type,
7273
- disableWrapMode: draw.disableWrapMode
7274
- });
7275
- vertices = [];
7276
- indices = [];
7277
- uvs = [];
7278
- texture = void 0;
7279
- };
7280
7210
  for (let len = this._draws.length, i = 0; i < len; i++) {
7281
- const draw = this._draws[i];
7282
- const prev = this._draws[i - 1];
7283
- if (vertices.length && prev && prev?.type !== draw.type) {
7284
- push(prev);
7285
- }
7286
- const oldTexture = texture;
7287
- if (!oldTexture) {
7288
- texture = draw.texture;
7289
- }
7290
- if (vertices.length && oldTexture !== draw.texture && !oldTexture?.is(draw.texture)) {
7291
- push(draw);
7292
- texture = draw.texture;
7293
- }
7294
- const start = vertices.length;
7295
- if (draw.type === "fill") {
7296
- draw.path.fillTriangulate({
7211
+ const current = this._draws[i];
7212
+ const vertices = [];
7213
+ const indices = [];
7214
+ const uvs = [];
7215
+ if (current.type === "fill") {
7216
+ current.path.fillTriangulate({
7297
7217
  vertices,
7298
7218
  indices
7299
7219
  });
7300
- this.buildUvs(start, vertices, uvs, draw.texture, draw.textureTransform);
7301
7220
  } else {
7302
- draw.path.strokeTriangulate({
7221
+ current.path.strokeTriangulate({
7303
7222
  vertices,
7304
7223
  indices,
7305
- lineStyle: draw.style,
7224
+ lineStyle: current.style,
7306
7225
  flipAlignment: false,
7307
7226
  closed: true
7308
7227
  });
7309
- this.buildUvs(start, vertices, uvs, draw.texture, draw.textureTransform);
7310
7228
  }
7311
- }
7312
- const last = this._draws[this._draws.length - 1];
7313
- if (last && vertices.length) {
7314
- push(last);
7229
+ this.buildUvs(0, vertices, uvs, current.texture, current.uvTransform);
7230
+ batchables.push({
7231
+ vertices,
7232
+ indices,
7233
+ uvs,
7234
+ texture: current.texture,
7235
+ type: current.type,
7236
+ disableWrapMode: current.disableWrapMode,
7237
+ vertTransform: current.vertTransform
7238
+ });
7315
7239
  }
7316
7240
  return batchables;
7317
7241
  }
@@ -7390,11 +7314,6 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7390
7314
  requestRelayout() {
7391
7315
  this._relayouting = true;
7392
7316
  this.requestUpdate();
7393
- this.forEachChild((node) => {
7394
- if (node instanceof exports.CanvasItem) {
7395
- node.requestRelayout();
7396
- }
7397
- });
7398
7317
  }
7399
7318
  requestRepaint() {
7400
7319
  this._repainting = true;
@@ -7444,7 +7363,8 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7444
7363
  this.requestUpdate();
7445
7364
  }
7446
7365
  }
7447
- _update() {
7366
+ _update(changed) {
7367
+ super._update(changed);
7448
7368
  const parent = this.getParent();
7449
7369
  if (this._parentGlobalVisible !== parent?.globalVisible) {
7450
7370
  this._updateGlobalVisible();
@@ -7491,10 +7411,10 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7491
7411
  }
7492
7412
  };
7493
7413
  __decorateClass$I([
7494
- property()
7414
+ modernIdoc.property()
7495
7415
  ], exports.CanvasItem.prototype, "modulate", 2);
7496
7416
  __decorateClass$I([
7497
- property()
7417
+ modernIdoc.property()
7498
7418
  ], exports.CanvasItem.prototype, "blendMode", 2);
7499
7419
  __decorateClass$I([
7500
7420
  protectedProperty({ default: true })
@@ -7585,16 +7505,16 @@ exports.Timeline = class Timeline extends exports.Node {
7585
7505
  }
7586
7506
  };
7587
7507
  __decorateClass$H([
7588
- property({ default: 0 })
7508
+ modernIdoc.property({ default: 0 })
7589
7509
  ], exports.Timeline.prototype, "startTime", 2);
7590
7510
  __decorateClass$H([
7591
- property({ default: 0 })
7511
+ modernIdoc.property({ default: 0 })
7592
7512
  ], exports.Timeline.prototype, "currentTime", 2);
7593
7513
  __decorateClass$H([
7594
- property({ default: Number.MAX_SAFE_INTEGER })
7514
+ modernIdoc.property({ default: Number.MAX_SAFE_INTEGER })
7595
7515
  ], exports.Timeline.prototype, "endTime", 2);
7596
7516
  __decorateClass$H([
7597
- property({ default: false })
7517
+ modernIdoc.property({ default: false })
7598
7518
  ], exports.Timeline.prototype, "loop", 2);
7599
7519
  exports.Timeline = __decorateClass$H([
7600
7520
  customNode("Timeline")
@@ -7680,10 +7600,10 @@ class SceneTree extends MainLoop {
7680
7600
  }
7681
7601
  }
7682
7602
  __decorateClass$G([
7683
- property({ default: false })
7603
+ modernIdoc.property({ default: false })
7684
7604
  ], SceneTree.prototype, "processPaused");
7685
7605
  __decorateClass$G([
7686
- property()
7606
+ modernIdoc.property()
7687
7607
  ], SceneTree.prototype, "backgroundColor");
7688
7608
  __decorateClass$G([
7689
7609
  protectedProperty({ default: false })
@@ -7826,10 +7746,10 @@ void main(void) {
7826
7746
  frag: frag$2
7827
7747
  }));
7828
7748
  __decorateClass$E([
7829
- property({ default: 4 })
7749
+ modernIdoc.property({ default: 4 })
7830
7750
  ], exports.GaussianBlurEffect.prototype, "strength", 2);
7831
7751
  __decorateClass$E([
7832
- property({ default: 3 })
7752
+ modernIdoc.property({ default: 3 })
7833
7753
  ], exports.GaussianBlurEffect.prototype, "quality", 2);
7834
7754
  exports.GaussianBlurEffect = __decorateClass$E([
7835
7755
  customNode("GaussianBlurEffect")
@@ -7908,19 +7828,19 @@ void main(void) {
7908
7828
  }`
7909
7829
  }));
7910
7830
  __decorateClass$D([
7911
- property({ default: 0 })
7831
+ modernIdoc.property({ default: 0 })
7912
7832
  ], exports.DropShadowEffect.prototype, "color", 2);
7913
7833
  __decorateClass$D([
7914
- property({ default: 4 })
7834
+ modernIdoc.property({ default: 4 })
7915
7835
  ], exports.DropShadowEffect.prototype, "blur", 2);
7916
7836
  __decorateClass$D([
7917
- property({ default: 4 })
7837
+ modernIdoc.property({ default: 4 })
7918
7838
  ], exports.DropShadowEffect.prototype, "offsetX", 2);
7919
7839
  __decorateClass$D([
7920
- property({ default: 4 })
7840
+ modernIdoc.property({ default: 4 })
7921
7841
  ], exports.DropShadowEffect.prototype, "offsetY", 2);
7922
7842
  __decorateClass$D([
7923
- property({ default: false })
7843
+ modernIdoc.property({ default: false })
7924
7844
  ], exports.DropShadowEffect.prototype, "shadowOnly", 2);
7925
7845
  exports.DropShadowEffect = __decorateClass$D([
7926
7846
  customNode("DropShadowEffect")
@@ -7980,7 +7900,7 @@ void main(void) {
7980
7900
  }`
7981
7901
  }));
7982
7902
  __decorateClass$C([
7983
- property({ default: 5 })
7903
+ modernIdoc.property({ default: 5 })
7984
7904
  ], exports.EmbossEffect.prototype, "strength", 2);
7985
7905
  exports.EmbossEffect = __decorateClass$C([
7986
7906
  customNode("EmbossEffect")
@@ -8169,31 +8089,31 @@ void main(void) {
8169
8089
  }`
8170
8090
  }));
8171
8091
  __decorateClass$B([
8172
- property({ default: 10 })
8092
+ modernIdoc.property({ default: 10 })
8173
8093
  ], exports.GlitchEffect.prototype, "slices", 2);
8174
8094
  __decorateClass$B([
8175
- property({ default: 512 })
8095
+ modernIdoc.property({ default: 512 })
8176
8096
  ], exports.GlitchEffect.prototype, "sampleSize", 2);
8177
8097
  __decorateClass$B([
8178
- property({ default: 100 })
8098
+ modernIdoc.property({ default: 100 })
8179
8099
  ], exports.GlitchEffect.prototype, "offset", 2);
8180
8100
  __decorateClass$B([
8181
- property({ default: 0 })
8101
+ modernIdoc.property({ default: 0 })
8182
8102
  ], exports.GlitchEffect.prototype, "direction", 2);
8183
8103
  __decorateClass$B([
8184
- property({ default: 2 })
8104
+ modernIdoc.property({ default: 2 })
8185
8105
  ], exports.GlitchEffect.prototype, "fillMode", 2);
8186
8106
  __decorateClass$B([
8187
- property({ default: 0 })
8107
+ modernIdoc.property({ default: 0 })
8188
8108
  ], exports.GlitchEffect.prototype, "seed", 2);
8189
8109
  __decorateClass$B([
8190
- property({ default: [2, 2] })
8110
+ modernIdoc.property({ default: [2, 2] })
8191
8111
  ], exports.GlitchEffect.prototype, "red", 2);
8192
8112
  __decorateClass$B([
8193
- property({ default: [-10, 4] })
8113
+ modernIdoc.property({ default: [-10, 4] })
8194
8114
  ], exports.GlitchEffect.prototype, "green", 2);
8195
8115
  __decorateClass$B([
8196
- property({ default: [10, -4] })
8116
+ modernIdoc.property({ default: [10, -4] })
8197
8117
  ], exports.GlitchEffect.prototype, "blue", 2);
8198
8118
  exports.GlitchEffect = __decorateClass$B([
8199
8119
  customNode("GlitchEffect")
@@ -8386,25 +8306,25 @@ void main(void) {
8386
8306
  }`
8387
8307
  }));
8388
8308
  __decorateClass$A([
8389
- property({ default: 0 })
8309
+ modernIdoc.property({ default: 0 })
8390
8310
  ], exports.GodrayEffect.prototype, "time", 2);
8391
8311
  __decorateClass$A([
8392
- property({ default: 30 })
8312
+ modernIdoc.property({ default: 30 })
8393
8313
  ], exports.GodrayEffect.prototype, "angle", 2);
8394
8314
  __decorateClass$A([
8395
- property({ default: 0.5 })
8315
+ modernIdoc.property({ default: 0.5 })
8396
8316
  ], exports.GodrayEffect.prototype, "gain", 2);
8397
8317
  __decorateClass$A([
8398
- property({ default: 2.5 })
8318
+ modernIdoc.property({ default: 2.5 })
8399
8319
  ], exports.GodrayEffect.prototype, "lacunarity", 2);
8400
8320
  __decorateClass$A([
8401
- property({ default: true })
8321
+ modernIdoc.property({ default: true })
8402
8322
  ], exports.GodrayEffect.prototype, "parallel", 2);
8403
8323
  __decorateClass$A([
8404
- property({ default: () => [0, 0] })
8324
+ modernIdoc.property({ default: () => [0, 0] })
8405
8325
  ], exports.GodrayEffect.prototype, "center", 2);
8406
8326
  __decorateClass$A([
8407
- property({ default: 1 })
8327
+ modernIdoc.property({ default: 1 })
8408
8328
  ], exports.GodrayEffect.prototype, "alpha", 2);
8409
8329
  exports.GodrayEffect = __decorateClass$A([
8410
8330
  customNode("GodrayEffect")
@@ -8509,13 +8429,13 @@ void main() {
8509
8429
  }
8510
8430
  };
8511
8431
  __decorateClass$z([
8512
- property({ default: 4 })
8432
+ modernIdoc.property({ default: 4 })
8513
8433
  ], exports.KawaseBlurEffect.prototype, "strength", 2);
8514
8434
  __decorateClass$z([
8515
- property({ default: 3 })
8435
+ modernIdoc.property({ default: 3 })
8516
8436
  ], exports.KawaseBlurEffect.prototype, "quality", 2);
8517
8437
  __decorateClass$z([
8518
- property({ default: [1, 1] })
8438
+ modernIdoc.property({ default: [1, 1] })
8519
8439
  ], exports.KawaseBlurEffect.prototype, "pixelSize", 2);
8520
8440
  exports.KawaseBlurEffect = __decorateClass$z([
8521
8441
  customNode("KawaseBlurEffect")
@@ -8622,7 +8542,7 @@ __decorateClass$y([
8622
8542
  protectedProperty()
8623
8543
  ], exports.MaskEffect.prototype, "texture", 2);
8624
8544
  __decorateClass$y([
8625
- property({ default: "" })
8545
+ modernIdoc.property({ default: "" })
8626
8546
  ], exports.MaskEffect.prototype, "src", 2);
8627
8547
  exports.MaskEffect = __decorateClass$y([
8628
8548
  customNode("MaskEffect")
@@ -8725,25 +8645,25 @@ void main() {
8725
8645
  __publicField$7(exports.OutlineEffect, "MIN_SAMPLES", 1);
8726
8646
  __publicField$7(exports.OutlineEffect, "MAX_SAMPLES", 100);
8727
8647
  __decorateClass$x([
8728
- property({ default: 0 })
8648
+ modernIdoc.property({ default: 0 })
8729
8649
  ], exports.OutlineEffect.prototype, "color", 2);
8730
8650
  __decorateClass$x([
8731
- property({ default: 1 })
8651
+ modernIdoc.property({ default: 1 })
8732
8652
  ], exports.OutlineEffect.prototype, "width", 2);
8733
8653
  __decorateClass$x([
8734
- property({ default: "solid" })
8654
+ modernIdoc.property({ default: "solid" })
8735
8655
  ], exports.OutlineEffect.prototype, "style", 2);
8736
8656
  __decorateClass$x([
8737
- property()
8657
+ modernIdoc.property()
8738
8658
  ], exports.OutlineEffect.prototype, "image", 2);
8739
8659
  __decorateClass$x([
8740
- property({ default: 1 })
8660
+ modernIdoc.property({ default: 1 })
8741
8661
  ], exports.OutlineEffect.prototype, "opacity", 2);
8742
8662
  __decorateClass$x([
8743
- property({ default: 0.1 })
8663
+ modernIdoc.property({ default: 0.1 })
8744
8664
  ], exports.OutlineEffect.prototype, "quality", 2);
8745
8665
  __decorateClass$x([
8746
- property({ default: false })
8666
+ modernIdoc.property({ default: false })
8747
8667
  ], exports.OutlineEffect.prototype, "knockout", 2);
8748
8668
  exports.OutlineEffect = __decorateClass$x([
8749
8669
  customNode("OutlineEffect")
@@ -8814,7 +8734,7 @@ void main(void) {
8814
8734
  }`
8815
8735
  }));
8816
8736
  __decorateClass$w([
8817
- property({ default: 10 })
8737
+ modernIdoc.property({ default: 10 })
8818
8738
  ], exports.PixelateEffect.prototype, "strength", 2);
8819
8739
  exports.PixelateEffect = __decorateClass$w([
8820
8740
  customNode("PixelateEffect")
@@ -8942,16 +8862,16 @@ void main() {
8942
8862
  }`
8943
8863
  }));
8944
8864
  __decorateClass$v([
8945
- property()
8865
+ modernIdoc.property()
8946
8866
  ], exports.ZoomBlurEffect.prototype, "center", 2);
8947
8867
  __decorateClass$v([
8948
- property({ default: 20 })
8868
+ modernIdoc.property({ default: 20 })
8949
8869
  ], exports.ZoomBlurEffect.prototype, "innerRadius", 2);
8950
8870
  __decorateClass$v([
8951
- property({ default: -1 })
8871
+ modernIdoc.property({ default: -1 })
8952
8872
  ], exports.ZoomBlurEffect.prototype, "radius", 2);
8953
8873
  __decorateClass$v([
8954
- property({ default: 0.1 })
8874
+ modernIdoc.property({ default: 0.1 })
8955
8875
  ], exports.ZoomBlurEffect.prototype, "strength", 2);
8956
8876
  exports.ZoomBlurEffect = __decorateClass$v([
8957
8877
  customNode("ZoomBlurEffect")
@@ -9024,7 +8944,7 @@ class BaseElement2DFill extends CoreObject {
9024
8944
  _getDrawOptions() {
9025
8945
  let disableWrapMode = false;
9026
8946
  const { width, height } = this.parent.size;
9027
- const textureTransform = new Transform2D().scale(1 / width, 1 / height);
8947
+ const uvTransform = new Transform2D().scale(1 / width, 1 / height);
9028
8948
  if (this.cropRect) {
9029
8949
  const {
9030
8950
  left = 0,
@@ -9032,7 +8952,7 @@ class BaseElement2DFill extends CoreObject {
9032
8952
  right = 0,
9033
8953
  bottom = 0
9034
8954
  } = this.cropRect;
9035
- textureTransform.scale(
8955
+ uvTransform.scale(
9036
8956
  Math.abs(1 - (left + right)),
9037
8957
  Math.abs(1 - (top + bottom))
9038
8958
  ).translate(left, top);
@@ -9047,55 +8967,57 @@ class BaseElement2DFill extends CoreObject {
9047
8967
  // flip, TODO
9048
8968
  // alignment, TODO
9049
8969
  } = this.tile;
9050
- textureTransform.translate(-translateX / width, -translateY / height).scale(1 / scaleX, 1 / scaleY);
8970
+ uvTransform.translate(-translateX / width, -translateY / height).scale(1 / scaleX, 1 / scaleY);
9051
8971
  disableWrapMode = true;
9052
8972
  } else if (this.stretchRect) {
9053
8973
  const { left = 0, top = 0, right = 0, bottom = 0 } = this.stretchRect;
9054
- textureTransform.scale(
8974
+ uvTransform.scale(
9055
8975
  Math.abs(1 - (-left + -right)),
9056
8976
  Math.abs(1 - (-top + -bottom))
9057
8977
  ).translate(-left, -top);
9058
8978
  disableWrapMode = true;
9059
8979
  }
9060
- return { disableWrapMode, textureTransform };
8980
+ return { disableWrapMode, uvTransform };
9061
8981
  }
9062
8982
  draw() {
9063
8983
  const ctx = this.parent.context;
9064
- const { textureTransform, disableWrapMode } = this._getDrawOptions();
9065
- ctx.textureTransform = textureTransform;
8984
+ const { uvTransform, disableWrapMode } = this._getDrawOptions();
8985
+ ctx.uvTransform = uvTransform;
9066
8986
  ctx.fillStyle = this._texture ?? this.color;
9067
- ctx.fill({ disableWrapMode });
8987
+ ctx.fill({
8988
+ disableWrapMode
8989
+ });
9068
8990
  }
9069
8991
  }
9070
8992
  __decorateClass$u([
9071
- property()
8993
+ modernIdoc.property()
9072
8994
  ], BaseElement2DFill.prototype, "color");
9073
8995
  __decorateClass$u([
9074
- property()
8996
+ modernIdoc.property()
9075
8997
  ], BaseElement2DFill.prototype, "image");
9076
8998
  __decorateClass$u([
9077
- property()
8999
+ modernIdoc.property()
9078
9000
  ], BaseElement2DFill.prototype, "linearGradient");
9079
9001
  __decorateClass$u([
9080
- property()
9002
+ modernIdoc.property()
9081
9003
  ], BaseElement2DFill.prototype, "radialGradient");
9082
9004
  __decorateClass$u([
9083
- property()
9005
+ modernIdoc.property()
9084
9006
  ], BaseElement2DFill.prototype, "cropRect");
9085
9007
  __decorateClass$u([
9086
- property()
9008
+ modernIdoc.property()
9087
9009
  ], BaseElement2DFill.prototype, "stretchRect");
9088
9010
  __decorateClass$u([
9089
- property()
9011
+ modernIdoc.property()
9090
9012
  ], BaseElement2DFill.prototype, "dpi");
9091
9013
  __decorateClass$u([
9092
- property()
9014
+ modernIdoc.property()
9093
9015
  ], BaseElement2DFill.prototype, "rotateWithShape");
9094
9016
  __decorateClass$u([
9095
- property()
9017
+ modernIdoc.property()
9096
9018
  ], BaseElement2DFill.prototype, "tile");
9097
9019
  __decorateClass$u([
9098
- property()
9020
+ modernIdoc.property()
9099
9021
  ], BaseElement2DFill.prototype, "opacity");
9100
9022
 
9101
9023
  var __defProp$m = Object.defineProperty;
@@ -9115,7 +9037,7 @@ class BaseElement2DBackground extends BaseElement2DFill {
9115
9037
  }
9116
9038
  }
9117
9039
  __decorateClass$t([
9118
- property()
9040
+ modernIdoc.property()
9119
9041
  ], BaseElement2DBackground.prototype, "fillWithShape");
9120
9042
 
9121
9043
  var __defProp$l = Object.defineProperty;
@@ -9135,7 +9057,7 @@ class BaseElement2DForeground extends BaseElement2DFill {
9135
9057
  }
9136
9058
  }
9137
9059
  __decorateClass$s([
9138
- property()
9060
+ modernIdoc.property()
9139
9061
  ], BaseElement2DForeground.prototype, "fillWithShape");
9140
9062
 
9141
9063
  var __defProp$k = Object.defineProperty;
@@ -9169,21 +9091,21 @@ class BaseElement2DOutline extends BaseElement2DFill {
9169
9091
  }
9170
9092
  draw() {
9171
9093
  const ctx = this.parent.context;
9172
- const { textureTransform, disableWrapMode } = this._getDrawOptions();
9094
+ const { uvTransform, disableWrapMode } = this._getDrawOptions();
9173
9095
  ctx.lineWidth = this.width || 1;
9174
- ctx.textureTransform = textureTransform;
9096
+ ctx.uvTransform = uvTransform;
9175
9097
  ctx.strokeStyle = this._texture ?? this.color;
9176
9098
  ctx.stroke({ disableWrapMode });
9177
9099
  }
9178
9100
  }
9179
9101
  __decorateClass$r([
9180
- property({ default: 0 })
9102
+ modernIdoc.property({ default: 0 })
9181
9103
  ], BaseElement2DOutline.prototype, "color");
9182
9104
  __decorateClass$r([
9183
- property({ default: 0 })
9105
+ modernIdoc.property({ default: 0 })
9184
9106
  ], BaseElement2DOutline.prototype, "width");
9185
9107
  __decorateClass$r([
9186
- property({ default: "solid" })
9108
+ modernIdoc.property({ default: "solid" })
9187
9109
  ], BaseElement2DOutline.prototype, "style");
9188
9110
 
9189
9111
  var __defProp$j = Object.defineProperty;
@@ -9233,16 +9155,16 @@ class BaseElement2DShadow extends CoreObject {
9233
9155
  }
9234
9156
  }
9235
9157
  __decorateClass$q([
9236
- property({ default: "#000000" })
9158
+ modernIdoc.property({ default: "#000000" })
9237
9159
  ], BaseElement2DShadow.prototype, "color");
9238
9160
  __decorateClass$q([
9239
- property({ default: 0 })
9161
+ modernIdoc.property({ default: 0 })
9240
9162
  ], BaseElement2DShadow.prototype, "blur");
9241
9163
  __decorateClass$q([
9242
- property({ default: 0 })
9164
+ modernIdoc.property({ default: 0 })
9243
9165
  ], BaseElement2DShadow.prototype, "offsetY");
9244
9166
  __decorateClass$q([
9245
- property({ default: 0 })
9167
+ modernIdoc.property({ default: 0 })
9246
9168
  ], BaseElement2DShadow.prototype, "offsetX");
9247
9169
 
9248
9170
  var __defProp$i = Object.defineProperty;
@@ -9326,16 +9248,16 @@ class BaseElement2DShape extends CoreObject {
9326
9248
  }
9327
9249
  }
9328
9250
  __decorateClass$p([
9329
- property()
9251
+ modernIdoc.property()
9330
9252
  ], BaseElement2DShape.prototype, "preset");
9331
9253
  __decorateClass$p([
9332
- property()
9254
+ modernIdoc.property()
9333
9255
  ], BaseElement2DShape.prototype, "svg");
9334
9256
  __decorateClass$p([
9335
- property()
9257
+ modernIdoc.property()
9336
9258
  ], BaseElement2DShape.prototype, "viewBox");
9337
9259
  __decorateClass$p([
9338
- property({ default: () => [] })
9260
+ modernIdoc.property({ default: () => [] })
9339
9261
  ], BaseElement2DShape.prototype, "paths");
9340
9262
 
9341
9263
  class BaseElement2DStyle extends Resource {
@@ -9350,7 +9272,7 @@ delete defaultStyles$1.left;
9350
9272
  delete defaultStyles$1.width;
9351
9273
  delete defaultStyles$1.height;
9352
9274
  for (const key in defaultStyles$1) {
9353
- defineProperty(BaseElement2DStyle, key, {
9275
+ modernIdoc.defineProperty(BaseElement2DStyle, key, {
9354
9276
  default: defaultStyles$1[key]
9355
9277
  });
9356
9278
  }
@@ -9369,11 +9291,8 @@ class BaseElement2DText extends CoreObject {
9369
9291
  super();
9370
9292
  this.parent = parent;
9371
9293
  }
9372
- effects;
9373
- measureDom;
9374
- fonts;
9294
+ base = new modernText.Text();
9375
9295
  texture = new CanvasTexture();
9376
- baseText = new modernText.Text();
9377
9296
  measureResult;
9378
9297
  setProperties(properties) {
9379
9298
  return super.setProperties(
@@ -9385,7 +9304,7 @@ class BaseElement2DText extends CoreObject {
9385
9304
  switch (key) {
9386
9305
  case "content":
9387
9306
  case "effects":
9388
- case "measureDom":
9307
+ case "measureDOM":
9389
9308
  case "fonts":
9390
9309
  case "split":
9391
9310
  this.parent.requestRedraw();
@@ -9393,21 +9312,17 @@ class BaseElement2DText extends CoreObject {
9393
9312
  }
9394
9313
  }
9395
9314
  _updateText() {
9396
- this.baseText.style = {
9315
+ this.base.style = {
9397
9316
  justifyContent: "center",
9398
9317
  alignItems: "center",
9399
9318
  textAlign: "center",
9400
9319
  ...this.parent.style.toJSON()
9401
9320
  };
9402
- this.baseText.content = this.content ?? "";
9403
- this.baseText.effects = this.effects;
9404
- this.baseText.fonts = this.fonts;
9405
- this.baseText.measureDom = this.measureDom;
9406
- this.baseText.requestUpdate();
9321
+ this.base.requestUpdate();
9407
9322
  }
9408
9323
  measure() {
9409
9324
  this._updateText();
9410
- return this.baseText.measure();
9325
+ return this.base.measure();
9411
9326
  }
9412
9327
  updateMeasure() {
9413
9328
  this.measureResult = this.measure();
@@ -9415,34 +9330,42 @@ class BaseElement2DText extends CoreObject {
9415
9330
  }
9416
9331
  canDraw() {
9417
9332
  return Boolean(
9418
- this.content && this.texture?.valid
9333
+ !/^\s*$/.test(this.base.toString()) && this.texture?.valid
9419
9334
  );
9420
9335
  }
9421
9336
  draw() {
9422
- const ctx = this.parent.context;
9423
- this.baseText.render({
9337
+ this.base.render({
9424
9338
  pixelRatio: this.texture.pixelRatio,
9425
9339
  view: this.texture.source
9426
9340
  });
9427
9341
  this.texture.requestUpload();
9428
9342
  const textWidth = this.measureResult?.boundingBox.width ?? this.parent.size.width;
9429
9343
  const textHeight = this.measureResult?.boundingBox.height ?? this.parent.size.height;
9344
+ const ctx = this.parent.context;
9430
9345
  ctx.fillStyle = this.texture;
9431
- ctx.textureTransform = new Transform2D().scale(1 / textWidth, 1 / textHeight);
9346
+ ctx.uvTransform = new Transform2D().scale(1 / textWidth, 1 / textHeight);
9347
+ ctx.vertTransform = () => {
9348
+ const parent = this.parent;
9349
+ const origin = parent.getTransformOrigin();
9350
+ return new Transform2D().translate(-origin.x, -origin.y).scale(
9351
+ parent.globalScale.x > 0 ? 1 : -1,
9352
+ parent.globalScale.y > 0 ? 1 : -1
9353
+ ).translate(origin.x, origin.y);
9354
+ };
9432
9355
  ctx.fill();
9433
9356
  }
9434
9357
  }
9435
9358
  __decorateClass$o([
9436
- property({ default: "" })
9359
+ modernIdoc.property({ alias: "base.content" })
9437
9360
  ], BaseElement2DText.prototype, "content");
9438
9361
  __decorateClass$o([
9439
- property()
9362
+ modernIdoc.property({ alias: "base.effects" })
9440
9363
  ], BaseElement2DText.prototype, "effects");
9441
9364
  __decorateClass$o([
9442
- protectedProperty()
9443
- ], BaseElement2DText.prototype, "measureDom");
9365
+ protectedProperty({ alias: "base.measureDOM" })
9366
+ ], BaseElement2DText.prototype, "measureDOM");
9444
9367
  __decorateClass$o([
9445
- protectedProperty()
9368
+ protectedProperty({ alias: "base.fonts" })
9446
9369
  ], BaseElement2DText.prototype, "fonts");
9447
9370
 
9448
9371
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
@@ -9469,8 +9392,19 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
9469
9392
  super();
9470
9393
  this.setProperties(properties).append(nodes);
9471
9394
  }
9395
+ getTransformOrigin() {
9396
+ return new Vector2(0, 0);
9397
+ }
9398
+ getTransform(cb) {
9399
+ const origin = this.getTransformOrigin();
9400
+ const transform = new Transform2D();
9401
+ transform.translate(-origin.x, -origin.y).scale(this.scale.x, this.scale.y).skew(this.skew.x, this.skew.y).rotate(this.rotation);
9402
+ cb?.(transform);
9403
+ transform.translate(this.position.x, this.position.y).translate(origin.x, origin.y);
9404
+ return transform;
9405
+ }
9472
9406
  _updateTransform() {
9473
- this.transform.identity().scale(this.scale.x, this.scale.y).skew(this.skew.x, this.skew.y).rotate(this.rotation).translate(this.position.x, this.position.y);
9407
+ this.transform.copy(this.getTransform());
9474
9408
  }
9475
9409
  _updateGlobalTransform() {
9476
9410
  const parent = this.getParent();
@@ -9497,8 +9431,17 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
9497
9431
  this.globalSkew.y = Math.atan2(b, d) - this.globalRotation;
9498
9432
  this.requestRelayout();
9499
9433
  }
9500
- _transformVertices(vertices) {
9501
- const [a, c, tx, b, d, ty] = this.globalTransform.toArray();
9434
+ _transformVertices(vertices, vertTransform) {
9435
+ let a, c, tx, b, d, ty;
9436
+ if (vertTransform) {
9437
+ const globalTransform = this.globalTransform.clone();
9438
+ globalTransform.multiply(
9439
+ typeof vertTransform === "function" ? vertTransform?.() : vertTransform
9440
+ );
9441
+ [a, c, tx, b, d, ty] = globalTransform.toArray();
9442
+ } else {
9443
+ [a, c, tx, b, d, ty] = this.globalTransform.toArray();
9444
+ }
9502
9445
  const newVertices = vertices.slice();
9503
9446
  for (let len = vertices.length, i = 0; i < len; i += 2) {
9504
9447
  const x = vertices[i];
@@ -9514,7 +9457,7 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
9514
9457
  return super._relayout(batchables).map((batchable) => {
9515
9458
  return {
9516
9459
  ...batchable,
9517
- vertices: this._transformVertices(batchable.vertices)
9460
+ vertices: this._transformVertices(batchable.vertices, batchable.vertTransform)
9518
9461
  };
9519
9462
  });
9520
9463
  }
@@ -9721,14 +9664,17 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9721
9664
  }
9722
9665
  }
9723
9666
  }
9724
- _updateTransform() {
9667
+ getTransformOrigin() {
9725
9668
  const { width, height } = this.size;
9726
9669
  const [originX, originY] = parseCSSTransformOrigin(this.style.transformOrigin);
9727
- const offsetX = originX * width;
9728
- const offsetY = originY * height;
9729
- this.transform.identity().translate(-offsetX, -offsetY).scale(this.scale.x, this.scale.y).skew(this.skew.x, this.skew.y).rotate(this.rotation);
9730
- parseCSSTransform(this.style.transform ?? "", width, height, this.transform);
9731
- this.transform.translate(this.position.x, this.position.y).translate(offsetX, offsetY);
9670
+ return new Vector2(originX * width, originY * height);
9671
+ }
9672
+ getTransform(cb) {
9673
+ const { width, height } = this.size;
9674
+ return super.getTransform((transform) => {
9675
+ parseCSSTransform(this.style.transform ?? "", width, height, transform);
9676
+ cb?.(transform);
9677
+ });
9732
9678
  }
9733
9679
  _updateGlobalTransform() {
9734
9680
  super._updateGlobalTransform();
@@ -9894,7 +9840,7 @@ const defaultStyles = {
9894
9840
  height: 0
9895
9841
  };
9896
9842
  for (const key in defaultStyles) {
9897
- defineProperty(Element2DStyle, key, { default: defaultStyles[key] });
9843
+ modernIdoc.defineProperty(Element2DStyle, key, { default: defaultStyles[key] });
9898
9844
  }
9899
9845
 
9900
9846
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
@@ -10520,7 +10466,7 @@ exports.Image2D = class Image2D extends exports.Element2D {
10520
10466
  const sy = 1 / h;
10521
10467
  const tx = left * width * sx;
10522
10468
  const ty = top * height * sy;
10523
- this.context.textureTransform = new Transform2D().scale(sx, sy).translate(tx, ty);
10469
+ this.context.uvTransform = new Transform2D().scale(sx, sy).translate(tx, ty);
10524
10470
  this.shape.draw();
10525
10471
  this.context.fill();
10526
10472
  }
@@ -10538,13 +10484,13 @@ __decorateClass$i([
10538
10484
  protectedProperty()
10539
10485
  ], exports.Image2D.prototype, "texture", 2);
10540
10486
  __decorateClass$i([
10541
- property({ default: "" })
10487
+ modernIdoc.property({ default: "" })
10542
10488
  ], exports.Image2D.prototype, "src", 2);
10543
10489
  __decorateClass$i([
10544
- property()
10490
+ modernIdoc.property()
10545
10491
  ], exports.Image2D.prototype, "srcRect", 2);
10546
10492
  __decorateClass$i([
10547
- property({ default: false })
10493
+ modernIdoc.property({ default: false })
10548
10494
  ], exports.Image2D.prototype, "gif", 2);
10549
10495
  exports.Image2D = __decorateClass$i([
10550
10496
  customNode("Image2D")
@@ -10560,7 +10506,7 @@ class TextureRect2D extends exports.Element2D {
10560
10506
  if (this.texture?.valid) {
10561
10507
  const { width, height } = this.size;
10562
10508
  this.context.fillStyle = this.texture;
10563
- this.context.textureTransform = new Transform2D().scale(
10509
+ this.context.uvTransform = new Transform2D().scale(
10564
10510
  1 / width,
10565
10511
  1 / height
10566
10512
  );
@@ -10621,7 +10567,7 @@ exports.Lottie2D = class Lottie2D extends TextureRect2D {
10621
10567
  }
10622
10568
  };
10623
10569
  __decorateClass$h([
10624
- property({ default: "" })
10570
+ modernIdoc.property({ default: "" })
10625
10571
  ], exports.Lottie2D.prototype, "src", 2);
10626
10572
  exports.Lottie2D = __decorateClass$h([
10627
10573
  customNode("Lottie2D")
@@ -10658,7 +10604,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10658
10604
  switch (key) {
10659
10605
  case "content":
10660
10606
  case "effects":
10661
- case "measureDom":
10607
+ case "measureDOM":
10662
10608
  case "fonts":
10663
10609
  case "split":
10664
10610
  this._updateSplit();
@@ -10673,10 +10619,6 @@ exports.Text2D = class Text2D extends TextureRect2D {
10673
10619
  }
10674
10620
  _updateBase() {
10675
10621
  this.base.style = this.style.toJSON();
10676
- this.base.content = this.content ?? "";
10677
- this.base.effects = this.effects;
10678
- this.base.fonts = this.fonts;
10679
- this.base.measureDom = this.measureDom;
10680
10622
  this.emit("updateBase", this.base);
10681
10623
  this.base.requestUpdate();
10682
10624
  }
@@ -10789,19 +10731,19 @@ exports.Text2D = class Text2D extends TextureRect2D {
10789
10731
  }
10790
10732
  };
10791
10733
  __decorateClass$g([
10792
- property({ default: false })
10734
+ modernIdoc.property({ default: false })
10793
10735
  ], exports.Text2D.prototype, "split", 2);
10794
10736
  __decorateClass$g([
10795
- property({ default: "" })
10737
+ modernIdoc.property({ alias: "base.content" })
10796
10738
  ], exports.Text2D.prototype, "content", 2);
10797
10739
  __decorateClass$g([
10798
- property()
10740
+ modernIdoc.property({ alias: "base.effects" })
10799
10741
  ], exports.Text2D.prototype, "effects", 2);
10800
10742
  __decorateClass$g([
10801
- protectedProperty()
10802
- ], exports.Text2D.prototype, "measureDom", 2);
10743
+ protectedProperty({ alias: "base.measureDOM" })
10744
+ ], exports.Text2D.prototype, "measureDOM", 2);
10803
10745
  __decorateClass$g([
10804
- protectedProperty()
10746
+ protectedProperty({ alias: "base.fonts" })
10805
10747
  ], exports.Text2D.prototype, "fonts", 2);
10806
10748
  exports.Text2D = __decorateClass$g([
10807
10749
  customNode("Text2D")
@@ -10860,7 +10802,7 @@ class TransformRect2D extends exports.Element2D {
10860
10802
  }
10861
10803
  }
10862
10804
  __decorateClass$f([
10863
- property({ default: 6 })
10805
+ modernIdoc.property({ default: 6 })
10864
10806
  ], TransformRect2D.prototype, "handleSize");
10865
10807
 
10866
10808
  var __defProp$b = Object.defineProperty;
@@ -10924,7 +10866,7 @@ exports.Video2D = class Video2D extends TextureRect2D {
10924
10866
  }
10925
10867
  };
10926
10868
  __decorateClass$e([
10927
- property({ default: "" })
10869
+ modernIdoc.property({ default: "" })
10928
10870
  ], exports.Video2D.prototype, "src", 2);
10929
10871
  exports.Video2D = __decorateClass$e([
10930
10872
  customNode("Video2D")
@@ -11001,7 +10943,7 @@ exports.Animation = class Animation extends exports.TimelineNode {
11001
10943
  easing;
11002
10944
  _keyframes = [];
11003
10945
  _isFirstUpdatePosition = false;
11004
- _cachedProps = new RawWeakMap();
10946
+ _cachedProps = new modernIdoc.RawWeakMap();
11005
10947
  _stoped = false;
11006
10948
  constructor(properties, children = []) {
11007
10949
  super();
@@ -11258,16 +11200,16 @@ exports.Animation = class Animation extends exports.TimelineNode {
11258
11200
  }
11259
11201
  };
11260
11202
  __decorateClass$d([
11261
- property({ default: "parent" })
11203
+ modernIdoc.property({ default: "parent" })
11262
11204
  ], exports.Animation.prototype, "effectMode", 2);
11263
11205
  __decorateClass$d([
11264
- property({ default: false })
11206
+ modernIdoc.property({ default: false })
11265
11207
  ], exports.Animation.prototype, "loop", 2);
11266
11208
  __decorateClass$d([
11267
- property({ default: () => [] })
11209
+ modernIdoc.property({ default: () => [] })
11268
11210
  ], exports.Animation.prototype, "keyframes", 2);
11269
11211
  __decorateClass$d([
11270
- property()
11212
+ modernIdoc.property()
11271
11213
  ], exports.Animation.prototype, "easing", 2);
11272
11214
  exports.Animation = __decorateClass$d([
11273
11215
  customNode("Animation", {
@@ -12470,7 +12412,7 @@ exports.AudioWaveform = class AudioWaveform extends exports.Element2D {
12470
12412
  const src = this._src;
12471
12413
  if (src?.valid) {
12472
12414
  this.context.fillStyle = src;
12473
- this.context.textureTransform = new Transform2D().scale(
12415
+ this.context.uvTransform = new Transform2D().scale(
12474
12416
  1 / this.style.width,
12475
12417
  1 / this.style.height
12476
12418
  );
@@ -12478,13 +12420,13 @@ exports.AudioWaveform = class AudioWaveform extends exports.Element2D {
12478
12420
  }
12479
12421
  };
12480
12422
  __decorateClass$b([
12481
- property()
12423
+ modernIdoc.property()
12482
12424
  ], exports.AudioWaveform.prototype, "src", 2);
12483
12425
  __decorateClass$b([
12484
- property()
12426
+ modernIdoc.property()
12485
12427
  ], exports.AudioWaveform.prototype, "gap", 2);
12486
12428
  __decorateClass$b([
12487
- property()
12429
+ modernIdoc.property()
12488
12430
  ], exports.AudioWaveform.prototype, "color", 2);
12489
12431
  exports.AudioWaveform = __decorateClass$b([
12490
12432
  customNode("AudioWaveform")
@@ -12574,25 +12516,25 @@ exports.Range = class Range extends exports.Control {
12574
12516
  }
12575
12517
  };
12576
12518
  __decorateClass$9([
12577
- property({ default: false })
12519
+ modernIdoc.property({ default: false })
12578
12520
  ], exports.Range.prototype, "allowGreater", 2);
12579
12521
  __decorateClass$9([
12580
- property({ default: false })
12522
+ modernIdoc.property({ default: false })
12581
12523
  ], exports.Range.prototype, "allowLesser", 2);
12582
12524
  __decorateClass$9([
12583
- property({ default: 1 })
12525
+ modernIdoc.property({ default: 1 })
12584
12526
  ], exports.Range.prototype, "page", 2);
12585
12527
  __decorateClass$9([
12586
- property({ default: 0 })
12528
+ modernIdoc.property({ default: 0 })
12587
12529
  ], exports.Range.prototype, "minValue", 2);
12588
12530
  __decorateClass$9([
12589
- property({ default: 100 })
12531
+ modernIdoc.property({ default: 100 })
12590
12532
  ], exports.Range.prototype, "maxValue", 2);
12591
12533
  __decorateClass$9([
12592
- property({ default: 0.01 })
12534
+ modernIdoc.property({ default: 0.01 })
12593
12535
  ], exports.Range.prototype, "step", 2);
12594
12536
  __decorateClass$9([
12595
- property({ default: 0 })
12537
+ modernIdoc.property({ default: 0 })
12596
12538
  ], exports.Range.prototype, "value", 2);
12597
12539
  exports.Range = __decorateClass$9([
12598
12540
  customNode("Range")
@@ -12744,7 +12686,7 @@ exports.Ruler = class Ruler extends exports.Control {
12744
12686
  const texture = this.texture;
12745
12687
  if (texture?.valid) {
12746
12688
  this.context.fillStyle = texture;
12747
- this.context.textureTransform = new Transform2D().scale(
12689
+ this.context.uvTransform = new Transform2D().scale(
12748
12690
  1 / this.size.width,
12749
12691
  1 / this.size.height
12750
12692
  );
@@ -12754,31 +12696,31 @@ exports.Ruler = class Ruler extends exports.Control {
12754
12696
  }
12755
12697
  };
12756
12698
  __decorateClass$8([
12757
- property({ default: 0 })
12699
+ modernIdoc.property({ default: 0 })
12758
12700
  ], exports.Ruler.prototype, "offsetX", 2);
12759
12701
  __decorateClass$8([
12760
- property({ default: 0 })
12702
+ modernIdoc.property({ default: 0 })
12761
12703
  ], exports.Ruler.prototype, "offsetY", 2);
12762
12704
  __decorateClass$8([
12763
- property({ default: 20 })
12705
+ modernIdoc.property({ default: 20 })
12764
12706
  ], exports.Ruler.prototype, "thickness", 2);
12765
12707
  __decorateClass$8([
12766
- property({ default: 3 })
12708
+ modernIdoc.property({ default: 3 })
12767
12709
  ], exports.Ruler.prototype, "markHeight", 2);
12768
12710
  __decorateClass$8([
12769
- property({ default: "#b2b6bc" })
12711
+ modernIdoc.property({ default: "#b2b6bc" })
12770
12712
  ], exports.Ruler.prototype, "color", 2);
12771
12713
  __decorateClass$8([
12772
- property({ default: "#f9f9fa" })
12714
+ modernIdoc.property({ default: "#f9f9fa" })
12773
12715
  ], exports.Ruler.prototype, "markBackgroundColor", 2);
12774
12716
  __decorateClass$8([
12775
- property({ default: "#b2b6bc" })
12717
+ modernIdoc.property({ default: "#b2b6bc" })
12776
12718
  ], exports.Ruler.prototype, "markColor", 2);
12777
12719
  __decorateClass$8([
12778
- property({ default: 300 })
12720
+ modernIdoc.property({ default: 300 })
12779
12721
  ], exports.Ruler.prototype, "gap", 2);
12780
12722
  __decorateClass$8([
12781
- property({ default: 1 })
12723
+ modernIdoc.property({ default: 1 })
12782
12724
  ], exports.Ruler.prototype, "gapScale", 2);
12783
12725
  exports.Ruler = __decorateClass$8([
12784
12726
  customNode("Ruler")
@@ -12851,7 +12793,7 @@ exports.ScrollBar = class ScrollBar extends exports.Range {
12851
12793
  }
12852
12794
  };
12853
12795
  __decorateClass$7([
12854
- property({ default: "vertical" })
12796
+ modernIdoc.property({ default: "vertical" })
12855
12797
  ], exports.ScrollBar.prototype, "direction", 2);
12856
12798
  exports.ScrollBar = __decorateClass$7([
12857
12799
  customNode("ScrollBar")
@@ -12962,13 +12904,13 @@ exports.Scaler = class Scaler extends exports.Node {
12962
12904
  }
12963
12905
  };
12964
12906
  __decorateClass$4([
12965
- property({ default: 1 })
12907
+ modernIdoc.property({ default: 1 })
12966
12908
  ], exports.Scaler.prototype, "value", 2);
12967
12909
  __decorateClass$4([
12968
- property({ default: 0.05 })
12910
+ modernIdoc.property({ default: 0.05 })
12969
12911
  ], exports.Scaler.prototype, "minValue", 2);
12970
12912
  __decorateClass$4([
12971
- property({ default: 10 })
12913
+ modernIdoc.property({ default: 10 })
12972
12914
  ], exports.Scaler.prototype, "maxValue", 2);
12973
12915
  exports.Scaler = __decorateClass$4([
12974
12916
  customNode("Scaler", {
@@ -13677,7 +13619,7 @@ class CanvasItemEditor extends exports.Control {
13677
13619
  style: {
13678
13620
  visibility: "hidden",
13679
13621
  outlineStyle: "solid",
13680
- outlineColor: 16711935,
13622
+ outlineColor: "#00FF00FF",
13681
13623
  outlineWidth: 2,
13682
13624
  pointerEvents: "none"
13683
13625
  }
@@ -13714,7 +13656,7 @@ class CanvasItemEditor extends exports.Control {
13714
13656
  style: {
13715
13657
  width: 500,
13716
13658
  height: 500,
13717
- backgroundColor: 4294967295,
13659
+ backgroundColor: "#FFFFFFFF",
13718
13660
  overflow: "hidden",
13719
13661
  pointerEvents: "none",
13720
13662
  boxShadow: "2px 2px 2px 1px rgba(0, 0, 0, 0.2)"
@@ -14216,14 +14158,12 @@ exports.curves = curves;
14216
14158
  exports.customNode = customNode;
14217
14159
  exports.customNodes = customNodes;
14218
14160
  exports.defaultOptions = defaultOptions;
14219
- exports.defineProperty = defineProperty;
14220
14161
  exports.determineCrossOrigin = determineCrossOrigin;
14221
14162
  exports.ease = ease;
14222
14163
  exports.easeIn = easeIn;
14223
14164
  exports.easeInOut = easeInOut;
14224
14165
  exports.easeOut = easeOut;
14225
14166
  exports.frag = frag$1;
14226
- exports.getDeclarations = getDeclarations;
14227
14167
  exports.getDefaultCssPropertyValue = getDefaultCssPropertyValue;
14228
14168
  exports.isCanvasElement = isCanvasElement;
14229
14169
  exports.isElementNode = isElementNode;
@@ -14242,7 +14182,6 @@ exports.parseCSSTransform = parseCSSTransform;
14242
14182
  exports.parseCSSTransformOrigin = parseCSSTransformOrigin;
14243
14183
  exports.parseCssFunctions = parseCssFunctions;
14244
14184
  exports.parseCssProperty = parseCssProperty;
14245
- exports.property = property;
14246
14185
  exports.protectedProperty = protectedProperty;
14247
14186
  exports.render = render;
14248
14187
  exports.timingFunctions = timingFunctions;