@visactor/vrender 0.20.0-alpha.4 → 0.20.1-alpha.0
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +46 -237
- package/dist/index.js +46 -237
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +4 -4
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.20.
|
|
24
|
+
exports.version = "0.20.1-alpha.0", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
25
|
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
26
|
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
27
|
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.20.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.20.1-alpha.0\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -29,40 +29,11 @@ class Metadata {
|
|
|
29
29
|
var Reflect$1 = (function (Reflect) {
|
|
30
30
|
var target;
|
|
31
31
|
return function (exporter) {
|
|
32
|
-
const
|
|
33
|
-
supportsSymbol = "function" == typeof Symbol,
|
|
32
|
+
const supportsSymbol = "function" == typeof Symbol,
|
|
34
33
|
toPrimitiveSymbol = supportsSymbol && void 0 !== Symbol.toPrimitive ? Symbol.toPrimitive : "@@toPrimitive",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
__proto__: []
|
|
39
|
-
} instanceof Array,
|
|
40
|
-
downLevel = !supportsCreate && !supportsProto,
|
|
41
|
-
HashMap = {
|
|
42
|
-
create: supportsCreate ? function () {
|
|
43
|
-
return MakeDictionary(Object.create(null));
|
|
44
|
-
} : supportsProto ? function () {
|
|
45
|
-
return MakeDictionary({
|
|
46
|
-
__proto__: null
|
|
47
|
-
});
|
|
48
|
-
} : function () {
|
|
49
|
-
return MakeDictionary({});
|
|
50
|
-
},
|
|
51
|
-
has: downLevel ? function (map, key) {
|
|
52
|
-
return hasOwn.call(map, key);
|
|
53
|
-
} : function (map, key) {
|
|
54
|
-
return key in map;
|
|
55
|
-
},
|
|
56
|
-
get: downLevel ? function (map, key) {
|
|
57
|
-
return hasOwn.call(map, key) ? map[key] : void 0;
|
|
58
|
-
} : function (map, key) {
|
|
59
|
-
return map[key];
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
functionPrototype = Object.getPrototypeOf(Function),
|
|
63
|
-
usePolyfill = "object" == typeof process && process.env && "true" === process.env.REFLECT_METADATA_USE_MAP_POLYFILL,
|
|
64
|
-
_Map = usePolyfill || "function" != typeof Map || "function" != typeof Map.prototype.entries ? CreateMapPolyfill() : Map,
|
|
65
|
-
Metadata = (usePolyfill || "function" != typeof Set || "function" != typeof Set.prototype.entries ? CreateSetPolyfill() : Set, new (usePolyfill || "function" != typeof WeakMap ? CreateWeakMapPolyfill() : WeakMap)());
|
|
34
|
+
functionPrototype = (Object.getPrototypeOf(Function)),
|
|
35
|
+
_Map = ("object" == typeof process && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL, Map),
|
|
36
|
+
Metadata = (new WeakMap());
|
|
66
37
|
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
67
38
|
if (!IsObject(target)) throw new TypeError();
|
|
68
39
|
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
@@ -219,183 +190,6 @@ var Reflect$1 = (function (Reflect) {
|
|
|
219
190
|
const constructor = prototypeProto.constructor;
|
|
220
191
|
return "function" != typeof constructor || constructor === O ? proto : constructor;
|
|
221
192
|
}
|
|
222
|
-
function CreateMapPolyfill() {
|
|
223
|
-
const cacheSentinel = {},
|
|
224
|
-
arraySentinel = [],
|
|
225
|
-
MapIterator = function () {
|
|
226
|
-
function MapIterator(keys, values, selector) {
|
|
227
|
-
this._index = 0, this._keys = keys, this._values = values, this._selector = selector;
|
|
228
|
-
}
|
|
229
|
-
return MapIterator.prototype["@@iterator"] = function () {
|
|
230
|
-
return this;
|
|
231
|
-
}, MapIterator.prototype[iteratorSymbol] = function () {
|
|
232
|
-
return this;
|
|
233
|
-
}, MapIterator.prototype.next = function () {
|
|
234
|
-
const index = this._index;
|
|
235
|
-
if (index >= 0 && index < this._keys.length) {
|
|
236
|
-
const result = this._selector(this._keys[index], this._values[index]);
|
|
237
|
-
return index + 1 >= this._keys.length ? (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel) : this._index++, {
|
|
238
|
-
value: result,
|
|
239
|
-
done: !1
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
return {
|
|
243
|
-
value: void 0,
|
|
244
|
-
done: !0
|
|
245
|
-
};
|
|
246
|
-
}, MapIterator.prototype.throw = function (error) {
|
|
247
|
-
throw this._index >= 0 && (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel), error;
|
|
248
|
-
}, MapIterator.prototype.return = function (value) {
|
|
249
|
-
return this._index >= 0 && (this._index = -1, this._keys = arraySentinel, this._values = arraySentinel), {
|
|
250
|
-
value: value,
|
|
251
|
-
done: !0
|
|
252
|
-
};
|
|
253
|
-
}, MapIterator;
|
|
254
|
-
}();
|
|
255
|
-
return function () {
|
|
256
|
-
function Map() {
|
|
257
|
-
this._keys = [], this._values = [], this._cacheKey = cacheSentinel, this._cacheIndex = -2;
|
|
258
|
-
}
|
|
259
|
-
return Object.defineProperty(Map.prototype, "size", {
|
|
260
|
-
get: function () {
|
|
261
|
-
return this._keys.length;
|
|
262
|
-
},
|
|
263
|
-
enumerable: !0,
|
|
264
|
-
configurable: !0
|
|
265
|
-
}), Map.prototype.has = function (key) {
|
|
266
|
-
return this._find(key, !1) >= 0;
|
|
267
|
-
}, Map.prototype.get = function (key) {
|
|
268
|
-
const index = this._find(key, !1);
|
|
269
|
-
return index >= 0 ? this._values[index] : void 0;
|
|
270
|
-
}, Map.prototype.set = function (key, value) {
|
|
271
|
-
const index = this._find(key, !0);
|
|
272
|
-
return this._values[index] = value, this;
|
|
273
|
-
}, Map.prototype.delete = function (key) {
|
|
274
|
-
const index = this._find(key, !1);
|
|
275
|
-
if (index >= 0) {
|
|
276
|
-
const size = this._keys.length;
|
|
277
|
-
for (let i = index + 1; i < size; i++) this._keys[i - 1] = this._keys[i], this._values[i - 1] = this._values[i];
|
|
278
|
-
return this._keys.length--, this._values.length--, key === this._cacheKey && (this._cacheKey = cacheSentinel, this._cacheIndex = -2), !0;
|
|
279
|
-
}
|
|
280
|
-
return !1;
|
|
281
|
-
}, Map.prototype.clear = function () {
|
|
282
|
-
this._keys.length = 0, this._values.length = 0, this._cacheKey = cacheSentinel, this._cacheIndex = -2;
|
|
283
|
-
}, Map.prototype.keys = function () {
|
|
284
|
-
return new MapIterator(this._keys, this._values, getKey);
|
|
285
|
-
}, Map.prototype.values = function () {
|
|
286
|
-
return new MapIterator(this._keys, this._values, getValue);
|
|
287
|
-
}, Map.prototype.entries = function () {
|
|
288
|
-
return new MapIterator(this._keys, this._values, getEntry);
|
|
289
|
-
}, Map.prototype["@@iterator"] = function () {
|
|
290
|
-
return this.entries();
|
|
291
|
-
}, Map.prototype[iteratorSymbol] = function () {
|
|
292
|
-
return this.entries();
|
|
293
|
-
}, Map.prototype._find = function (key, insert) {
|
|
294
|
-
return this._cacheKey !== key && (this._cacheIndex = this._keys.indexOf(this._cacheKey = key)), this._cacheIndex < 0 && insert && (this._cacheIndex = this._keys.length, this._keys.push(key), this._values.push(void 0)), this._cacheIndex;
|
|
295
|
-
}, Map;
|
|
296
|
-
}();
|
|
297
|
-
function getKey(key, _) {
|
|
298
|
-
return key;
|
|
299
|
-
}
|
|
300
|
-
function getValue(_, value) {
|
|
301
|
-
return value;
|
|
302
|
-
}
|
|
303
|
-
function getEntry(key, value) {
|
|
304
|
-
return [key, value];
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
function CreateSetPolyfill() {
|
|
308
|
-
return function () {
|
|
309
|
-
function Set() {
|
|
310
|
-
this._map = new _Map();
|
|
311
|
-
}
|
|
312
|
-
return Object.defineProperty(Set.prototype, "size", {
|
|
313
|
-
get: function () {
|
|
314
|
-
return this._map.size;
|
|
315
|
-
},
|
|
316
|
-
enumerable: !0,
|
|
317
|
-
configurable: !0
|
|
318
|
-
}), Set.prototype.has = function (value) {
|
|
319
|
-
return this._map.has(value);
|
|
320
|
-
}, Set.prototype.add = function (value) {
|
|
321
|
-
return this._map.set(value, value), this;
|
|
322
|
-
}, Set.prototype.delete = function (value) {
|
|
323
|
-
return this._map.delete(value);
|
|
324
|
-
}, Set.prototype.clear = function () {
|
|
325
|
-
this._map.clear();
|
|
326
|
-
}, Set.prototype.keys = function () {
|
|
327
|
-
return this._map.keys();
|
|
328
|
-
}, Set.prototype.values = function () {
|
|
329
|
-
return this._map.values();
|
|
330
|
-
}, Set.prototype.entries = function () {
|
|
331
|
-
return this._map.entries();
|
|
332
|
-
}, Set.prototype["@@iterator"] = function () {
|
|
333
|
-
return this.keys();
|
|
334
|
-
}, Set.prototype[iteratorSymbol] = function () {
|
|
335
|
-
return this.keys();
|
|
336
|
-
}, Set;
|
|
337
|
-
}();
|
|
338
|
-
}
|
|
339
|
-
function CreateWeakMapPolyfill() {
|
|
340
|
-
const UUID_SIZE = 16,
|
|
341
|
-
keys = HashMap.create(),
|
|
342
|
-
rootKey = CreateUniqueKey();
|
|
343
|
-
return function () {
|
|
344
|
-
function WeakMap() {
|
|
345
|
-
this._key = CreateUniqueKey();
|
|
346
|
-
}
|
|
347
|
-
return WeakMap.prototype.has = function (target) {
|
|
348
|
-
const table = GetOrCreateWeakMapTable(target, !1);
|
|
349
|
-
return void 0 !== table && HashMap.has(table, this._key);
|
|
350
|
-
}, WeakMap.prototype.get = function (target) {
|
|
351
|
-
const table = GetOrCreateWeakMapTable(target, !1);
|
|
352
|
-
return void 0 !== table ? HashMap.get(table, this._key) : void 0;
|
|
353
|
-
}, WeakMap.prototype.set = function (target, value) {
|
|
354
|
-
return GetOrCreateWeakMapTable(target, !0)[this._key] = value, this;
|
|
355
|
-
}, WeakMap.prototype.delete = function (target) {
|
|
356
|
-
const table = GetOrCreateWeakMapTable(target, !1);
|
|
357
|
-
return void 0 !== table && delete table[this._key];
|
|
358
|
-
}, WeakMap.prototype.clear = function () {
|
|
359
|
-
this._key = CreateUniqueKey();
|
|
360
|
-
}, WeakMap;
|
|
361
|
-
}();
|
|
362
|
-
function CreateUniqueKey() {
|
|
363
|
-
let key;
|
|
364
|
-
do {
|
|
365
|
-
key = "@@WeakMap@@" + CreateUUID();
|
|
366
|
-
} while (HashMap.has(keys, key));
|
|
367
|
-
return keys[key] = !0, key;
|
|
368
|
-
}
|
|
369
|
-
function GetOrCreateWeakMapTable(target, create) {
|
|
370
|
-
if (!hasOwn.call(target, rootKey)) {
|
|
371
|
-
if (!create) return;
|
|
372
|
-
Object.defineProperty(target, rootKey, {
|
|
373
|
-
value: HashMap.create()
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
return target[rootKey];
|
|
377
|
-
}
|
|
378
|
-
function FillRandomBytes(buffer, size) {
|
|
379
|
-
for (let i = 0; i < size; ++i) buffer[i] = 255 * Math.random() | 0;
|
|
380
|
-
return buffer;
|
|
381
|
-
}
|
|
382
|
-
function GenRandomBytes(size) {
|
|
383
|
-
return "function" == typeof Uint8Array ? "undefined" != typeof crypto ? crypto.getRandomValues(new Uint8Array(size)) : FillRandomBytes(new Uint8Array(size), size) : FillRandomBytes(new Array(size), size);
|
|
384
|
-
}
|
|
385
|
-
function CreateUUID() {
|
|
386
|
-
const data = GenRandomBytes(UUID_SIZE);
|
|
387
|
-
data[6] = 79 & data[6] | 64, data[8] = 191 & data[8] | 128;
|
|
388
|
-
let result = "";
|
|
389
|
-
for (let offset = 0; offset < UUID_SIZE; ++offset) {
|
|
390
|
-
const byte = data[offset];
|
|
391
|
-
4 !== offset && 6 !== offset && 8 !== offset || (result += "-"), byte < 16 && (result += "0"), result += byte.toString(16).toLowerCase();
|
|
392
|
-
}
|
|
393
|
-
return result;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
function MakeDictionary(obj) {
|
|
397
|
-
return obj.__ = void 0, delete obj.__, obj;
|
|
398
|
-
}
|
|
399
193
|
exporter("defineMetadata", defineMetadata), exporter("hasMetadata", hasMetadata), exporter("hasOwnMetadata", hasOwnMetadata), exporter("getMetadata", getMetadata);
|
|
400
194
|
}((target = Reflect, function (key, value) {
|
|
401
195
|
"function" != typeof target[key] && Object.defineProperty(target, key, {
|
|
@@ -12183,7 +11977,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
12183
11977
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
12184
11978
|
|
|
12185
11979
|
const halfPi = pi / 2;
|
|
12186
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
11980
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
12187
11981
|
let cornerRadius;
|
|
12188
11982
|
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
12189
11983
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -12215,27 +12009,28 @@ function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
|
12215
12009
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
12216
12010
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
12217
12011
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
12218
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
12012
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
12013
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
12219
12014
|
const centerX = rightTopPoint1[0],
|
|
12220
12015
|
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
12221
12016
|
path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
|
|
12222
12017
|
}
|
|
12223
|
-
if (path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
12018
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
12224
12019
|
const centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
12225
12020
|
centerY = rightBottomPoint2[1];
|
|
12226
|
-
path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
12021
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
|
|
12227
12022
|
}
|
|
12228
|
-
if (path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
12023
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
12229
12024
|
const centerX = leftBottomPoint1[0],
|
|
12230
12025
|
centerY = leftBottomPoint1[1] - _cornerRadius[3];
|
|
12231
|
-
path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
12026
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
|
|
12232
12027
|
}
|
|
12233
|
-
if (path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
12028
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
12234
12029
|
const centerX = leftTopPoint1[0],
|
|
12235
12030
|
centerY = leftTopPoint1[1] + _cornerRadius[0];
|
|
12236
|
-
path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
12031
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
|
|
12237
12032
|
}
|
|
12238
|
-
return path.closePath(), path;
|
|
12033
|
+
return !edgeCb && path.closePath(), path;
|
|
12239
12034
|
}
|
|
12240
12035
|
|
|
12241
12036
|
var __decorate$1z = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -12312,14 +12107,24 @@ let SplitRectAfterRenderContribution = class {
|
|
|
12312
12107
|
y1: y1,
|
|
12313
12108
|
x: originX = groupAttribute.x,
|
|
12314
12109
|
y: originY = groupAttribute.y,
|
|
12315
|
-
stroke = groupAttribute.stroke
|
|
12110
|
+
stroke = groupAttribute.stroke,
|
|
12111
|
+
cornerRadius = groupAttribute.cornerRadius
|
|
12316
12112
|
} = rect.attribute;
|
|
12317
12113
|
let {
|
|
12318
12114
|
width: width,
|
|
12319
12115
|
height: height
|
|
12320
12116
|
} = rect.attribute;
|
|
12321
12117
|
if (width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0, Array.isArray(stroke) && stroke.some(s => !1 === s)) {
|
|
12322
|
-
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute),
|
|
12118
|
+
if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num))) {
|
|
12119
|
+
let lastStroke,
|
|
12120
|
+
lastStrokeI = 0;
|
|
12121
|
+
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
|
|
12122
|
+
stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
|
|
12123
|
+
stroke: stroke[i]
|
|
12124
|
+
}), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
|
|
12125
|
+
})), void context.stroke();
|
|
12126
|
+
}
|
|
12127
|
+
if (context.beginPath(), context.moveTo(x, y), stroke[0] ? context.lineTo(x + width, y) : context.moveTo(x + width, y), stroke[1] ? context.lineTo(x + width, y + height) : context.moveTo(x + width, y + height), stroke[2] ? context.lineTo(x, y + height) : context.moveTo(x, y + height), stroke[3]) {
|
|
12323
12128
|
const adjustY = stroke[0] ? y - context.lineWidth / 2 : y;
|
|
12324
12129
|
context.lineTo(x, adjustY);
|
|
12325
12130
|
} else context.moveTo(x, y);
|
|
@@ -13163,9 +12968,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13163
12968
|
data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
13164
12969
|
if (!data) return;
|
|
13165
12970
|
const {
|
|
13166
|
-
doFill: doFill
|
|
13167
|
-
doStroke: doStroke
|
|
12971
|
+
doFill: doFill
|
|
13168
12972
|
} = data,
|
|
12973
|
+
doStroke = data.doStroke && data.sVisible,
|
|
13169
12974
|
{
|
|
13170
12975
|
clipRange = areaAttribute.clipRange,
|
|
13171
12976
|
closePath: closePath,
|
|
@@ -13983,7 +13788,9 @@ let DefaultCanvasGroupRender = class {
|
|
|
13983
13788
|
clip: clip,
|
|
13984
13789
|
baseOpacity = 1
|
|
13985
13790
|
} = group.attribute;
|
|
13986
|
-
clip ? context.save() : context.highPerformanceSave()
|
|
13791
|
+
clip ? context.save() : context.highPerformanceSave();
|
|
13792
|
+
const baseGlobalAlpha = context.baseGlobalAlpha;
|
|
13793
|
+
context.baseGlobalAlpha *= baseOpacity;
|
|
13987
13794
|
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
13988
13795
|
lastModelMatrix = context.modelMatrix;
|
|
13989
13796
|
if (context.camera) {
|
|
@@ -13997,7 +13804,7 @@ let DefaultCanvasGroupRender = class {
|
|
|
13997
13804
|
scrollY = groupAttribute.scrollY
|
|
13998
13805
|
} = group.attribute;
|
|
13999
13806
|
let p;
|
|
14000
|
-
(scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha
|
|
13807
|
+
(scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha = baseGlobalAlpha, p && p.then ? p.then(() => {
|
|
14001
13808
|
clip ? context.restore() : context.highPerformanceRestore();
|
|
14002
13809
|
}) : clip ? context.restore() : context.highPerformanceRestore();
|
|
14003
13810
|
}
|
|
@@ -14176,7 +13983,7 @@ class ShadowRootDrawItemInterceptorContribution {
|
|
|
14176
13983
|
const m = graphic.globalTransMatrix.getInverse();
|
|
14177
13984
|
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
14178
13985
|
}
|
|
14179
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext,
|
|
13986
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && (drawContribution.dirtyBounds.copy(tempDirtyBounds), drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds)), !0;
|
|
14180
13987
|
}
|
|
14181
13988
|
}
|
|
14182
13989
|
class DebugDrawItemInterceptorContribution {
|
|
@@ -16544,20 +16351,21 @@ class Wrapper {
|
|
|
16544
16351
|
this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
|
|
16545
16352
|
}
|
|
16546
16353
|
deal(paragraph) {
|
|
16547
|
-
|
|
16354
|
+
let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
16355
|
+
paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), 0 !== paragraph.text.length && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
|
|
16548
16356
|
}
|
|
16549
|
-
cut(paragraph) {
|
|
16357
|
+
cut(paragraph, singleLine) {
|
|
16550
16358
|
const availableWidth = this[this.directionKey.width] - this.lineWidth || 0,
|
|
16551
16359
|
guessIndex = Math.ceil(availableWidth / paragraph[this.directionKey.width] * paragraph.length) || 0,
|
|
16552
16360
|
index = getStrByWithCanvas(paragraph.text, availableWidth, paragraph.character, guessIndex, "break-word" === this.frame.wordBreak);
|
|
16553
16361
|
if (0 !== index) {
|
|
16554
16362
|
const [p1, p2] = seperateParagraph(paragraph, index);
|
|
16555
|
-
this.store(p1), this.deal(p2);
|
|
16363
|
+
this.store(p1), singleLine ? this.send() : this.deal(p2);
|
|
16556
16364
|
} else 0 !== this.lineBuffer.length && (this.send(), this.deal(paragraph));
|
|
16557
16365
|
}
|
|
16558
16366
|
}
|
|
16559
16367
|
|
|
16560
|
-
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16368
|
+
const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16561
16369
|
class RichText extends Graphic {
|
|
16562
16370
|
constructor(params) {
|
|
16563
16371
|
super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE;
|
|
@@ -16759,7 +16567,7 @@ class RichText extends Graphic {
|
|
|
16759
16567
|
skip = !1;
|
|
16760
16568
|
for (let i = 0; i < paragraphs.length; i++) {
|
|
16761
16569
|
const p = paragraphs[i];
|
|
16762
|
-
skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0);
|
|
16570
|
+
skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p, !0), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0), wrapper.send();
|
|
16763
16571
|
}
|
|
16764
16572
|
} else for (let i = 0; i < paragraphs.length; i++) wrapper.deal(paragraphs[i]);
|
|
16765
16573
|
wrapper.send();
|
|
@@ -16800,10 +16608,11 @@ class RichText extends Graphic {
|
|
|
16800
16608
|
let pickIcon;
|
|
16801
16609
|
return frameCache.icons.forEach(icon => {
|
|
16802
16610
|
var _a, _b;
|
|
16803
|
-
icon.AABBBounds.
|
|
16611
|
+
const bounds = icon.AABBBounds.clone();
|
|
16612
|
+
bounds.translate(icon._marginArray[3], icon._marginArray[0]), bounds.containsPoint({
|
|
16804
16613
|
x: point.x - x,
|
|
16805
16614
|
y: point.y - y
|
|
16806
|
-
}) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x, pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y);
|
|
16615
|
+
}) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x + icon._marginArray[3], pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y + icon._marginArray[0]);
|
|
16807
16616
|
}), pickIcon;
|
|
16808
16617
|
}
|
|
16809
16618
|
getNoWorkAnimateAttr() {
|
|
@@ -24248,7 +24057,7 @@ let BrowserContext2d = class {
|
|
|
24248
24057
|
opacity = defaultParams.opacity,
|
|
24249
24058
|
fill = defaultParams.fill
|
|
24250
24059
|
} = attribute;
|
|
24251
|
-
fillOpacity > 1e-12 && opacity > 1e-12
|
|
24060
|
+
_context.globalAlpha = fillOpacity * opacity * this.baseGlobalAlpha, fillOpacity > 1e-12 && opacity > 1e-12 && (_context.fillStyle = createColor(this, fill, params, offsetX, offsetY));
|
|
24252
24061
|
}
|
|
24253
24062
|
setShadowBlendStyle(params, attribute, defaultParams) {
|
|
24254
24063
|
if (Array.isArray(defaultParams)) {
|
|
@@ -24291,7 +24100,7 @@ let BrowserContext2d = class {
|
|
|
24291
24100
|
strokeOpacity = defaultParams.strokeOpacity,
|
|
24292
24101
|
opacity = defaultParams.opacity
|
|
24293
24102
|
} = attribute;
|
|
24294
|
-
if (strokeOpacity > 1e-12 && opacity > 1e-12) {
|
|
24103
|
+
if (_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, strokeOpacity > 1e-12 && opacity > 1e-12) {
|
|
24295
24104
|
const {
|
|
24296
24105
|
lineWidth = defaultParams.lineWidth,
|
|
24297
24106
|
stroke = defaultParams.stroke,
|
|
@@ -24300,7 +24109,7 @@ let BrowserContext2d = class {
|
|
|
24300
24109
|
lineCap = defaultParams.lineCap,
|
|
24301
24110
|
miterLimit = defaultParams.miterLimit
|
|
24302
24111
|
} = attribute;
|
|
24303
|
-
_context.
|
|
24112
|
+
_context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24304
24113
|
}
|
|
24305
24114
|
}
|
|
24306
24115
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -28444,7 +28253,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28444
28253
|
|
|
28445
28254
|
const roughModule = _roughModule;
|
|
28446
28255
|
|
|
28447
|
-
const version = "0.20.
|
|
28256
|
+
const version = "0.20.1-alpha.0";
|
|
28448
28257
|
preLoadAllModule();
|
|
28449
28258
|
if (isBrowserEnv()) {
|
|
28450
28259
|
loadBrowserEnv(container);
|