@visactor/vrender 1.0.0-alpha.17 → 1.0.0-alpha.18
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 +248 -85
- package/dist/index.js +254 -84
- 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 +6 -6
package/dist/index.js
CHANGED
|
@@ -492,11 +492,14 @@
|
|
|
492
492
|
const ContributionProvider = Symbol("ContributionProvider");
|
|
493
493
|
class ContributionProviderCache {
|
|
494
494
|
constructor(serviceIdentifier, container) {
|
|
495
|
-
this.serviceIdentifier = serviceIdentifier, this.container = container;
|
|
495
|
+
this.serviceIdentifier = serviceIdentifier, this.container = container, ContributionStore.setStore(this.serviceIdentifier, this);
|
|
496
496
|
}
|
|
497
497
|
getContributions() {
|
|
498
498
|
return this.caches || (this.caches = [], this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier))), this.caches;
|
|
499
499
|
}
|
|
500
|
+
refresh() {
|
|
501
|
+
this.caches && (this.caches.length = 0, this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier)));
|
|
502
|
+
}
|
|
500
503
|
}
|
|
501
504
|
function bindContributionProvider(bind, id) {
|
|
502
505
|
bind(ContributionProvider).toDynamicValue(_ref => {
|
|
@@ -514,6 +517,20 @@
|
|
|
514
517
|
return new ContributionProviderCache(id, container);
|
|
515
518
|
}).whenTargetNamed(id);
|
|
516
519
|
}
|
|
520
|
+
class ContributionStore {
|
|
521
|
+
static getStore(id) {
|
|
522
|
+
return this.store.get(id);
|
|
523
|
+
}
|
|
524
|
+
static setStore(id, cache) {
|
|
525
|
+
this.store.set(id, cache);
|
|
526
|
+
}
|
|
527
|
+
static refreshAllContributions() {
|
|
528
|
+
this.store.forEach(cache => {
|
|
529
|
+
cache.refresh();
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
ContributionStore.store = new Map();
|
|
517
534
|
|
|
518
535
|
class Hook {
|
|
519
536
|
constructor(args, name) {
|
|
@@ -602,6 +619,48 @@
|
|
|
602
619
|
}
|
|
603
620
|
}
|
|
604
621
|
|
|
622
|
+
class EventListenerManager {
|
|
623
|
+
constructor() {
|
|
624
|
+
this._listenerMap = new Map(), this._eventListenerTransformer = event => event;
|
|
625
|
+
}
|
|
626
|
+
setEventListenerTransformer(transformer) {
|
|
627
|
+
this._eventListenerTransformer = transformer || (event => event);
|
|
628
|
+
}
|
|
629
|
+
addEventListener(type, listener, options) {
|
|
630
|
+
if (!listener) return;
|
|
631
|
+
const wrappedListener = event => {
|
|
632
|
+
const transformedEvent = this._eventListenerTransformer(event);
|
|
633
|
+
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
|
|
634
|
+
};
|
|
635
|
+
this._listenerMap.has(type) || this._listenerMap.set(type, new Map()), this._listenerMap.get(type).set(listener, wrappedListener), this._nativeAddEventListener(type, wrappedListener, options);
|
|
636
|
+
}
|
|
637
|
+
removeEventListener(type, listener, options) {
|
|
638
|
+
var _a;
|
|
639
|
+
if (!listener) return;
|
|
640
|
+
const wrappedListener = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener);
|
|
641
|
+
wrappedListener && (this._nativeRemoveEventListener(type, wrappedListener, options), this._listenerMap.get(type).delete(listener), 0 === this._listenerMap.get(type).size && this._listenerMap.delete(type));
|
|
642
|
+
}
|
|
643
|
+
dispatchEvent(event) {
|
|
644
|
+
return this._nativeDispatchEvent(event);
|
|
645
|
+
}
|
|
646
|
+
clearAllEventListeners() {
|
|
647
|
+
this._listenerMap.forEach((listenersMap, type) => {
|
|
648
|
+
listenersMap.forEach((wrappedListener, originalListener) => {
|
|
649
|
+
this._nativeRemoveEventListener(type, wrappedListener, void 0);
|
|
650
|
+
});
|
|
651
|
+
}), this._listenerMap.clear();
|
|
652
|
+
}
|
|
653
|
+
_nativeAddEventListener(type, listener, options) {
|
|
654
|
+
throw new Error("_nativeAddEventListener must be implemented by derived classes");
|
|
655
|
+
}
|
|
656
|
+
_nativeRemoveEventListener(type, listener, options) {
|
|
657
|
+
throw new Error("_nativeRemoveEventListener must be implemented by derived classes");
|
|
658
|
+
}
|
|
659
|
+
_nativeDispatchEvent(event) {
|
|
660
|
+
throw new Error("_nativeDispatchEvent must be implemented by derived classes");
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
605
664
|
var __decorate$1N = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
606
665
|
var d,
|
|
607
666
|
c = arguments.length,
|
|
@@ -642,7 +701,7 @@
|
|
|
642
701
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
643
702
|
});
|
|
644
703
|
};
|
|
645
|
-
exports.DefaultGlobal = class DefaultGlobal {
|
|
704
|
+
exports.DefaultGlobal = class DefaultGlobal extends EventListenerManager {
|
|
646
705
|
get env() {
|
|
647
706
|
return this._env;
|
|
648
707
|
}
|
|
@@ -686,10 +745,19 @@
|
|
|
686
745
|
this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
|
|
687
746
|
}
|
|
688
747
|
constructor(contributions) {
|
|
689
|
-
this.contributions = contributions, this._isImageAnonymous = !0, this._performanceRAFList = [], this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
748
|
+
super(), this.contributions = contributions, this._isImageAnonymous = !0, this._performanceRAFList = [], this.eventListenerTransformer = event => event, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
690
749
|
onSetEnv: new SyncHook(["lastEnv", "env", "global"])
|
|
691
750
|
}, this.measureTextMethod = "native", this.optimizeVisible = !1;
|
|
692
751
|
}
|
|
752
|
+
_nativeAddEventListener(type, listener, options) {
|
|
753
|
+
return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
|
|
754
|
+
}
|
|
755
|
+
_nativeRemoveEventListener(type, listener, options) {
|
|
756
|
+
return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
|
|
757
|
+
}
|
|
758
|
+
_nativeDispatchEvent(event) {
|
|
759
|
+
return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
|
|
760
|
+
}
|
|
693
761
|
bindContribution(params) {
|
|
694
762
|
const promiseArr = [];
|
|
695
763
|
if (this.contributions.getContributions().forEach(contribution => {
|
|
@@ -730,15 +798,6 @@
|
|
|
730
798
|
releaseCanvas(canvas) {
|
|
731
799
|
return this._env || this.setEnv("browser"), this.envContribution.releaseCanvas(canvas);
|
|
732
800
|
}
|
|
733
|
-
addEventListener(type, listener, options) {
|
|
734
|
-
return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
|
|
735
|
-
}
|
|
736
|
-
removeEventListener(type, listener, options) {
|
|
737
|
-
return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
|
|
738
|
-
}
|
|
739
|
-
dispatchEvent(event) {
|
|
740
|
-
return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
|
|
741
|
-
}
|
|
742
801
|
getRequestAnimationFrame() {
|
|
743
802
|
return this._env || this.setEnv("browser"), this.envContribution.getRequestAnimationFrame();
|
|
744
803
|
}
|
|
@@ -1229,14 +1288,14 @@
|
|
|
1229
1288
|
};
|
|
1230
1289
|
var isArrayLike$1 = isArrayLike;
|
|
1231
1290
|
|
|
1232
|
-
const isNumber = function (value) {
|
|
1291
|
+
const isNumber$1 = function (value) {
|
|
1233
1292
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1234
1293
|
const type = typeof value;
|
|
1235
1294
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
1236
1295
|
};
|
|
1237
|
-
var isNumber$
|
|
1296
|
+
var isNumber$2 = isNumber$1;
|
|
1238
1297
|
|
|
1239
|
-
const isValidNumber = value => isNumber$
|
|
1298
|
+
const isValidNumber = value => isNumber$2(value) && Number.isFinite(value);
|
|
1240
1299
|
var isValidNumber$1 = isValidNumber;
|
|
1241
1300
|
|
|
1242
1301
|
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
@@ -1377,7 +1436,7 @@
|
|
|
1377
1436
|
}(LoggerLevel || (LoggerLevel = {}));
|
|
1378
1437
|
class Logger {
|
|
1379
1438
|
static getInstance(level, method) {
|
|
1380
|
-
return Logger._instance && isNumber$
|
|
1439
|
+
return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1381
1440
|
}
|
|
1382
1441
|
static setInstance(logger) {
|
|
1383
1442
|
return Logger._instance = logger;
|
|
@@ -1516,10 +1575,10 @@
|
|
|
1516
1575
|
return this.x = x, this.y = y, this;
|
|
1517
1576
|
}
|
|
1518
1577
|
add(point) {
|
|
1519
|
-
return isNumber$
|
|
1578
|
+
return isNumber$2(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1520
1579
|
}
|
|
1521
1580
|
sub(point) {
|
|
1522
|
-
return isNumber$
|
|
1581
|
+
return isNumber$2(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1523
1582
|
}
|
|
1524
1583
|
multi(point) {
|
|
1525
1584
|
throw new Error("暂不支持");
|
|
@@ -2577,10 +2636,10 @@
|
|
|
2577
2636
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2578
2637
|
}
|
|
2579
2638
|
function rgb(value) {
|
|
2580
|
-
return isNumber$
|
|
2639
|
+
return isNumber$2(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
2581
2640
|
}
|
|
2582
2641
|
function rgba(value) {
|
|
2583
|
-
return isNumber$
|
|
2642
|
+
return isNumber$2(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
2584
2643
|
}
|
|
2585
2644
|
function SRGBToLinear(c) {
|
|
2586
2645
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -5363,6 +5422,9 @@
|
|
|
5363
5422
|
function isNotAroundZero(val) {
|
|
5364
5423
|
return val > EPSILON || val < -EPSILON;
|
|
5365
5424
|
}
|
|
5425
|
+
function isNumber(data) {
|
|
5426
|
+
return "number" == typeof data && Number.isFinite(data);
|
|
5427
|
+
}
|
|
5366
5428
|
const _v0 = [0, 0],
|
|
5367
5429
|
_v1 = [0, 0],
|
|
5368
5430
|
_v2 = [0, 0];
|
|
@@ -5767,7 +5829,7 @@
|
|
|
5767
5829
|
};
|
|
5768
5830
|
const VWindow = Symbol.for("VWindow");
|
|
5769
5831
|
const WindowHandlerContribution = Symbol.for("WindowHandlerContribution");
|
|
5770
|
-
exports.DefaultWindow = class DefaultWindow {
|
|
5832
|
+
exports.DefaultWindow = class DefaultWindow extends EventListenerManager {
|
|
5771
5833
|
get width() {
|
|
5772
5834
|
if (this._handler) {
|
|
5773
5835
|
const wh = this._handler.getWH();
|
|
@@ -5786,7 +5848,7 @@
|
|
|
5786
5848
|
return this._handler.getDpr();
|
|
5787
5849
|
}
|
|
5788
5850
|
constructor() {
|
|
5789
|
-
this.hooks = {
|
|
5851
|
+
super(), this.hooks = {
|
|
5790
5852
|
onChange: new SyncHook(["x", "y", "width", "height"])
|
|
5791
5853
|
}, this.active = () => {
|
|
5792
5854
|
const global = this.global;
|
|
@@ -5794,6 +5856,15 @@
|
|
|
5794
5856
|
container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
|
|
5795
5857
|
}, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
|
|
5796
5858
|
}
|
|
5859
|
+
_nativeAddEventListener(type, listener, options) {
|
|
5860
|
+
return this._handler.addEventListener(type, listener, options);
|
|
5861
|
+
}
|
|
5862
|
+
_nativeRemoveEventListener(type, listener, options) {
|
|
5863
|
+
return this._handler.removeEventListener(type, listener, options);
|
|
5864
|
+
}
|
|
5865
|
+
_nativeDispatchEvent(event) {
|
|
5866
|
+
return this._handler.dispatchEvent(event);
|
|
5867
|
+
}
|
|
5797
5868
|
postInit() {
|
|
5798
5869
|
this.global.hooks.onSetEnv.tap("window", this.active), this.active();
|
|
5799
5870
|
}
|
|
@@ -5833,7 +5904,7 @@
|
|
|
5833
5904
|
throw new Error("暂不支持");
|
|
5834
5905
|
}
|
|
5835
5906
|
release() {
|
|
5836
|
-
return this.global.hooks.onSetEnv.unTap("window", this.active), this._handler.releaseWindow();
|
|
5907
|
+
return this.global.hooks.onSetEnv.unTap("window", this.active), this.clearAllEventListeners(), this._handler.releaseWindow();
|
|
5837
5908
|
}
|
|
5838
5909
|
getContext() {
|
|
5839
5910
|
return this._handler.getContext();
|
|
@@ -5844,15 +5915,6 @@
|
|
|
5844
5915
|
getImageBuffer(type) {
|
|
5845
5916
|
return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
|
|
5846
5917
|
}
|
|
5847
|
-
addEventListener(type, listener, options) {
|
|
5848
|
-
return this._handler.addEventListener(type, listener, options);
|
|
5849
|
-
}
|
|
5850
|
-
removeEventListener(type, listener, options) {
|
|
5851
|
-
return this._handler.removeEventListener(type, listener, options);
|
|
5852
|
-
}
|
|
5853
|
-
dispatchEvent(event) {
|
|
5854
|
-
return this._handler.dispatchEvent(event);
|
|
5855
|
-
}
|
|
5856
5918
|
getBoundingClientRect() {
|
|
5857
5919
|
return this._handler.getBoundingClientRect();
|
|
5858
5920
|
}
|
|
@@ -7061,19 +7123,17 @@
|
|
|
7061
7123
|
globalObj: globalObj,
|
|
7062
7124
|
domElement: domElement
|
|
7063
7125
|
} = this;
|
|
7064
|
-
this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.
|
|
7126
|
+
this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.addEventListener("pointermove", this.onPointerMove, !0), globalObj.addEventListener("pointerup", this.onPointerUp, !0)) : (domElement.addEventListener("pointermove", this.onPointerMove, !0), domElement.addEventListener("pointerup", this.onPointerUp, !0)), domElement.addEventListener("pointerdown", this.onPointerDown, !0), domElement.addEventListener("pointerleave", this.onPointerOverOut, !0), domElement.addEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.addEventListener("mousemove", this.onPointerMove, !0), globalObj.addEventListener("mouseup", this.onPointerUp, !0)) : (domElement.addEventListener("mousemove", this.onPointerMove, !0), domElement.addEventListener("mouseup", this.onPointerUp, !0)), domElement.addEventListener("mousedown", this.onPointerDown, !0), domElement.addEventListener("mouseout", this.onPointerOverOut, !0), domElement.addEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.addEventListener("touchstart", this.onPointerDown, !0), domElement.addEventListener("touchend", this.onPointerUp, !0), domElement.addEventListener("touchmove", this.onPointerMove, !0)), domElement.addEventListener("wheel", this.onWheel, {
|
|
7065
7127
|
capture: !0
|
|
7066
7128
|
}), this.eventsAdded = !0;
|
|
7067
7129
|
}
|
|
7068
7130
|
removeEvents() {
|
|
7069
|
-
var _a;
|
|
7070
7131
|
if (!this.eventsAdded || !this.domElement) return;
|
|
7071
7132
|
const {
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
this.supportsPointerEvents ? (globalDocument.removeEventListener("pointermove", this.onPointerMove, !0), globalDocument.removeEventListener("pointerup", this.onPointerUp, !0), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalDocument.removeEventListener("mousemove", this.onPointerMove, !0), globalDocument.removeEventListener("mouseup", this.onPointerUp, !0), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
|
|
7133
|
+
globalObj: globalObj,
|
|
7134
|
+
domElement: domElement
|
|
7135
|
+
} = this;
|
|
7136
|
+
this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.removeEventListener("pointermove", this.onPointerMove, !0), globalObj.removeEventListener("pointerup", this.onPointerUp, !0)) : (domElement.removeEventListener("pointermove", this.onPointerMove, !0), domElement.removeEventListener("pointerup", this.onPointerUp, !0)), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.removeEventListener("mousemove", this.onPointerMove, !0), globalObj.removeEventListener("mouseup", this.onPointerUp, !0)) : (domElement.removeEventListener("mousemove", this.onPointerMove, !0), domElement.removeEventListener("mouseup", this.onPointerUp, !0)), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
|
|
7077
7137
|
}
|
|
7078
7138
|
mapToViewportPoint(event) {
|
|
7079
7139
|
return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
|
|
@@ -7390,13 +7450,13 @@
|
|
|
7390
7450
|
|
|
7391
7451
|
class BaseSymbol {
|
|
7392
7452
|
bounds(size, bounds) {
|
|
7393
|
-
if (isNumber$
|
|
7453
|
+
if (isNumber$2(size)) {
|
|
7394
7454
|
const halfS = size / 2;
|
|
7395
7455
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
7396
7456
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
7397
7457
|
}
|
|
7398
7458
|
parseSize(size) {
|
|
7399
|
-
return isNumber$
|
|
7459
|
+
return isNumber$2(size) ? size : Math.min(size[0], size[1]);
|
|
7400
7460
|
}
|
|
7401
7461
|
}
|
|
7402
7462
|
|
|
@@ -7815,10 +7875,10 @@
|
|
|
7815
7875
|
super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
|
|
7816
7876
|
}
|
|
7817
7877
|
draw(ctx, size, x, y) {
|
|
7818
|
-
return isNumber$
|
|
7878
|
+
return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
7819
7879
|
}
|
|
7820
7880
|
drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
7821
|
-
isNumber$
|
|
7881
|
+
isNumber$2(size) && (size = [size, size / 2]);
|
|
7822
7882
|
const drawLength = 2 * (size[0] + size[1]) * clipRange,
|
|
7823
7883
|
points = [{
|
|
7824
7884
|
x: x + size[0] / 2,
|
|
@@ -7850,7 +7910,7 @@
|
|
|
7850
7910
|
return !1;
|
|
7851
7911
|
}
|
|
7852
7912
|
drawOffset(ctx, size, x, y, offset) {
|
|
7853
|
-
return isNumber$
|
|
7913
|
+
return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
7854
7914
|
}
|
|
7855
7915
|
}
|
|
7856
7916
|
var rect = new RectSymbol();
|
|
@@ -7870,7 +7930,7 @@
|
|
|
7870
7930
|
return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
7871
7931
|
}
|
|
7872
7932
|
parseSize(size) {
|
|
7873
|
-
return isNumber$
|
|
7933
|
+
return isNumber$2(size) ? size : Math.min(size[0], size[1]);
|
|
7874
7934
|
}
|
|
7875
7935
|
drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
7876
7936
|
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
@@ -8839,10 +8899,10 @@
|
|
|
8839
8899
|
|
|
8840
8900
|
function colorArrayToString(color) {
|
|
8841
8901
|
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
8842
|
-
return Array.isArray(color) && isNumber$
|
|
8902
|
+
return Array.isArray(color) && isNumber$2(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
|
|
8843
8903
|
}
|
|
8844
8904
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
8845
|
-
if (Array.isArray(from) && !isNumber$
|
|
8905
|
+
if (Array.isArray(from) && !isNumber$2(from[0]) || Array.isArray(to) && !isNumber$2(to[0])) {
|
|
8846
8906
|
return new Array(4).fill(0).map((_, index) => {
|
|
8847
8907
|
var _a, _b;
|
|
8848
8908
|
return _interpolateColor(isArray$1(from) ? null !== (_a = from[index]) && void 0 !== _a ? _a : from[0] : from, isArray$1(to) ? null !== (_b = to[index]) && void 0 !== _b ? _b : to[0] : to, ratio, alphaChannel);
|
|
@@ -10523,12 +10583,12 @@
|
|
|
10523
10583
|
textBaseline: textBaseline
|
|
10524
10584
|
} = attribute;
|
|
10525
10585
|
if (null != attribute.forceBoundsHeight) {
|
|
10526
|
-
const h = isNumber$
|
|
10586
|
+
const h = isNumber$2(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
|
|
10527
10587
|
dy = textLayoutOffsetY(textBaseline, h, h);
|
|
10528
10588
|
aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);
|
|
10529
10589
|
}
|
|
10530
10590
|
if (null != attribute.forceBoundsWidth) {
|
|
10531
|
-
const w = isNumber$
|
|
10591
|
+
const w = isNumber$2(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
|
|
10532
10592
|
dx = textDrawOffsetX(textAlign, w);
|
|
10533
10593
|
aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
|
|
10534
10594
|
}
|
|
@@ -12650,7 +12710,7 @@
|
|
|
12650
12710
|
}
|
|
12651
12711
|
} else {
|
|
12652
12712
|
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
12653
|
-
if (isNumber$
|
|
12713
|
+
if (isNumber$2(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
12654
12714
|
const textParts = richTextConfig.text.split("\n");
|
|
12655
12715
|
for (let j = 0; j < textParts.length; j++) if (0 === j) paragraphs.push(new Paragraph(textParts[j], !1, richTextConfig, ascentDescentMode));else if (textParts[j] || i === textConfig.length - 1) paragraphs.push(new Paragraph(textParts[j], !0, richTextConfig, ascentDescentMode));else {
|
|
12656
12716
|
const nextRichTextConfig = this.combinedStyleToCharacter(textConfig[i + 1]);
|
|
@@ -12939,7 +12999,7 @@
|
|
|
12939
12999
|
} = this.attribute;
|
|
12940
13000
|
if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
12941
13001
|
const deltaRadius = Math.abs(outerRadius - innerRadius),
|
|
12942
|
-
parseCR = cornerRadius => Math.min(isNumber$
|
|
13002
|
+
parseCR = cornerRadius => Math.min(isNumber$2(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
12943
13003
|
if (isArray$1(cornerRadius)) {
|
|
12944
13004
|
const crList = cornerRadius.map(cr => parseCR(cr) || 0);
|
|
12945
13005
|
return 0 === crList.length ? [crList[0], crList[0], crList[0], crList[0]] : 2 === crList.length ? [crList[0], crList[1], crList[0], crList[1]] : (3 === crList.length && crList.push(0), crList);
|
|
@@ -13943,7 +14003,7 @@
|
|
|
13943
14003
|
let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
13944
14004
|
let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
|
|
13945
14005
|
let cornerRadius;
|
|
13946
|
-
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
14006
|
+
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$2(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
13947
14007
|
const cornerRadiusArr = rectCornerRadius;
|
|
13948
14008
|
let cr0, cr1;
|
|
13949
14009
|
switch (cornerRadiusArr.length) {
|
|
@@ -14219,6 +14279,9 @@
|
|
|
14219
14279
|
init(contributions) {
|
|
14220
14280
|
contributions && (this._renderContribitions = contributions.getContributions()), this._renderContribitions || (this._renderContribitions = []), this.builtinContributions || (this.builtinContributions = []), this.builtinContributions.push(defaultBaseClipRenderBeforeContribution), this.builtinContributions.push(defaultBaseClipRenderAfterContribution), this.builtinContributions.forEach(item => this._renderContribitions.push(item)), this._renderContribitions.length && (this._renderContribitions.sort((a, b) => b.order - a.order), this._beforeRenderContribitions = this._renderContribitions.filter(c => c.time === exports.BaseRenderContributionTime.beforeFillStroke), this._afterRenderContribitions = this._renderContribitions.filter(c => c.time === exports.BaseRenderContributionTime.afterFillStroke));
|
|
14221
14281
|
}
|
|
14282
|
+
reInit() {
|
|
14283
|
+
this.init(this.graphicRenderContributions);
|
|
14284
|
+
}
|
|
14222
14285
|
beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, params) {
|
|
14223
14286
|
this._beforeRenderContribitions && this._beforeRenderContribitions.forEach(c => {
|
|
14224
14287
|
if (c.supportedAppName && graphic.stage && graphic.stage.params && graphic.stage.params.context && graphic.stage.params.context.appName) {
|
|
@@ -14388,8 +14451,8 @@
|
|
|
14388
14451
|
};
|
|
14389
14452
|
};
|
|
14390
14453
|
exports.DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
|
|
14391
|
-
constructor(
|
|
14392
|
-
super(), this.
|
|
14454
|
+
constructor(graphicRenderContributions) {
|
|
14455
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = ARC_NUMBER_TYPE, this.builtinContributions = [defaultArcRenderContribution, defaultArcBackgroundRenderContribution, defaultArcTextureRenderContribution], this.init(graphicRenderContributions);
|
|
14393
14456
|
}
|
|
14394
14457
|
drawArcTailCapPath(arc, context, cx, cy, outerRadius, innerRadius, _sa, _ea) {
|
|
14395
14458
|
const capAngle = _ea - _sa,
|
|
@@ -14560,8 +14623,8 @@
|
|
|
14560
14623
|
};
|
|
14561
14624
|
};
|
|
14562
14625
|
exports.DefaultCanvasCircleRender = class DefaultCanvasCircleRender extends BaseRender {
|
|
14563
|
-
constructor(
|
|
14564
|
-
super(), this.
|
|
14626
|
+
constructor(graphicRenderContributions) {
|
|
14627
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(graphicRenderContributions);
|
|
14565
14628
|
}
|
|
14566
14629
|
drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
14567
14630
|
const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle,
|
|
@@ -14947,8 +15010,8 @@
|
|
|
14947
15010
|
};
|
|
14948
15011
|
};
|
|
14949
15012
|
exports.DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
14950
|
-
constructor(
|
|
14951
|
-
super(), this.
|
|
15013
|
+
constructor(graphicRenderContributions) {
|
|
15014
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(graphicRenderContributions);
|
|
14952
15015
|
}
|
|
14953
15016
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
14954
15017
|
var _a, _b, _c;
|
|
@@ -15191,8 +15254,8 @@
|
|
|
15191
15254
|
};
|
|
15192
15255
|
};
|
|
15193
15256
|
exports.DefaultCanvasPathRender = class DefaultCanvasPathRender extends BaseRender {
|
|
15194
|
-
constructor(
|
|
15195
|
-
super(), this.
|
|
15257
|
+
constructor(graphicRenderContributions) {
|
|
15258
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = PATH_NUMBER_TYPE, this.builtinContributions = [defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution], this.init(graphicRenderContributions);
|
|
15196
15259
|
}
|
|
15197
15260
|
drawShape(path, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
15198
15261
|
var _a, _b, _c;
|
|
@@ -15247,8 +15310,8 @@
|
|
|
15247
15310
|
};
|
|
15248
15311
|
};
|
|
15249
15312
|
exports.DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
15250
|
-
constructor(
|
|
15251
|
-
super(), this.
|
|
15313
|
+
constructor(graphicRenderContributions) {
|
|
15314
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.type = "rect", this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution], this.init(graphicRenderContributions);
|
|
15252
15315
|
}
|
|
15253
15316
|
drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb, rectAttribute) {
|
|
15254
15317
|
rectAttribute = null != rectAttribute ? rectAttribute : getTheme(rect, null == params ? void 0 : params.theme).rect;
|
|
@@ -15317,8 +15380,8 @@
|
|
|
15317
15380
|
};
|
|
15318
15381
|
};
|
|
15319
15382
|
exports.DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRender {
|
|
15320
|
-
constructor(
|
|
15321
|
-
super(), this.
|
|
15383
|
+
constructor(graphicRenderContributions) {
|
|
15384
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(graphicRenderContributions);
|
|
15322
15385
|
}
|
|
15323
15386
|
drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb, symbolAttribute) {
|
|
15324
15387
|
var _a;
|
|
@@ -15488,8 +15551,8 @@
|
|
|
15488
15551
|
};
|
|
15489
15552
|
};
|
|
15490
15553
|
exports.DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
|
|
15491
|
-
constructor(
|
|
15492
|
-
super(), this.
|
|
15554
|
+
constructor(graphicRenderContributions) {
|
|
15555
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = TEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init(graphicRenderContributions);
|
|
15493
15556
|
}
|
|
15494
15557
|
drawShape(text, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
15495
15558
|
var _a, _b, _c;
|
|
@@ -15703,8 +15766,8 @@
|
|
|
15703
15766
|
};
|
|
15704
15767
|
};
|
|
15705
15768
|
exports.DefaultCanvasPolygonRender = class DefaultCanvasPolygonRender extends BaseRender {
|
|
15706
|
-
constructor(
|
|
15707
|
-
super(), this.
|
|
15769
|
+
constructor(graphicRenderContributions) {
|
|
15770
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = POLYGON_NUMBER_TYPE, this.builtinContributions = [defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution], this.init(graphicRenderContributions);
|
|
15708
15771
|
}
|
|
15709
15772
|
drawShape(polygon, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
15710
15773
|
const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon,
|
|
@@ -15759,6 +15822,9 @@
|
|
|
15759
15822
|
constructor(groupRenderContribitions) {
|
|
15760
15823
|
this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
|
|
15761
15824
|
}
|
|
15825
|
+
reInit() {
|
|
15826
|
+
this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution);
|
|
15827
|
+
}
|
|
15762
15828
|
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb, groupAttribute) {
|
|
15763
15829
|
const {
|
|
15764
15830
|
clip: clip,
|
|
@@ -15901,8 +15967,8 @@
|
|
|
15901
15967
|
};
|
|
15902
15968
|
const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
|
|
15903
15969
|
exports.DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender {
|
|
15904
|
-
constructor(
|
|
15905
|
-
super(), this.
|
|
15970
|
+
constructor(graphicRenderContributions) {
|
|
15971
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(graphicRenderContributions);
|
|
15906
15972
|
}
|
|
15907
15973
|
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
15908
15974
|
const imageAttribute = getTheme(image).image,
|
|
@@ -16233,6 +16299,9 @@
|
|
|
16233
16299
|
afterDraw(params) {
|
|
16234
16300
|
this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
|
|
16235
16301
|
}
|
|
16302
|
+
reInit() {
|
|
16303
|
+
this.drawContribution.reInit();
|
|
16304
|
+
}
|
|
16236
16305
|
render(groups, params) {
|
|
16237
16306
|
this.renderTreeRoots = groups, this.drawParams = params;
|
|
16238
16307
|
const updateBounds = params.updateBounds;
|
|
@@ -16643,6 +16712,11 @@
|
|
|
16643
16712
|
}, !1, !!(null === (_a = drawContext.context) || void 0 === _a ? void 0 : _a.camera));
|
|
16644
16713
|
}, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, isArray$1(this.contributions) || (this.contributions = [this.contributions]), this.init();
|
|
16645
16714
|
}
|
|
16715
|
+
reInit() {
|
|
16716
|
+
this.init(), this.contributions.forEach(item => {
|
|
16717
|
+
item.reInit();
|
|
16718
|
+
});
|
|
16719
|
+
}
|
|
16646
16720
|
init() {
|
|
16647
16721
|
this.contributions.forEach(item => {
|
|
16648
16722
|
if (item.style) {
|
|
@@ -17786,6 +17860,9 @@
|
|
|
17786
17860
|
getPickerService() {
|
|
17787
17861
|
return this.pickerService || (this.pickerService = container.get(PickerService)), this.pickerService;
|
|
17788
17862
|
}
|
|
17863
|
+
reInit() {
|
|
17864
|
+
this.renderService.reInit(), this.pickerService.reInit();
|
|
17865
|
+
}
|
|
17789
17866
|
}
|
|
17790
17867
|
|
|
17791
17868
|
function createStage(params) {
|
|
@@ -18064,6 +18141,9 @@
|
|
|
18064
18141
|
constructor(pickItemInterceptorContributions, pickServiceInterceptorContributions) {
|
|
18065
18142
|
this.pickItemInterceptorContributions = pickItemInterceptorContributions, this.pickServiceInterceptorContributions = pickServiceInterceptorContributions, this.type = "default", this.global = application.global;
|
|
18066
18143
|
}
|
|
18144
|
+
reInit() {
|
|
18145
|
+
this._init();
|
|
18146
|
+
}
|
|
18067
18147
|
_init() {
|
|
18068
18148
|
this.InterceptorContributions = this.pickItemInterceptorContributions.getContributions().sort((a, b) => a.order - b.order), this.pickerServiceInterceptorContributions = this.pickServiceInterceptorContributions.getContributions().sort((a, b) => a.order - b.order);
|
|
18069
18149
|
}
|
|
@@ -18178,6 +18258,7 @@
|
|
|
18178
18258
|
this.configure(global, env);
|
|
18179
18259
|
}), this.configure(this.global, this.global.env);
|
|
18180
18260
|
}
|
|
18261
|
+
reInit() {}
|
|
18181
18262
|
configure(global, env) {}
|
|
18182
18263
|
pick(graphics, point, params) {
|
|
18183
18264
|
let result = {
|
|
@@ -18562,7 +18643,7 @@
|
|
|
18562
18643
|
return res;
|
|
18563
18644
|
};
|
|
18564
18645
|
const samplingPoints = (points, count) => {
|
|
18565
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
18646
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
|
|
18566
18647
|
if (0 === validatePoints.length) return [];
|
|
18567
18648
|
if (1 === validatePoints.length) return new Array(count).fill(0).map(i => validatePoints[0]);
|
|
18568
18649
|
const res = [];
|
|
@@ -18598,7 +18679,7 @@
|
|
|
18598
18679
|
var _a;
|
|
18599
18680
|
return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
|
|
18600
18681
|
}, []));
|
|
18601
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
18682
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
|
|
18602
18683
|
if (!validatePoints.length) return [];
|
|
18603
18684
|
const allPoints = [];
|
|
18604
18685
|
validatePoints.forEach(point => {
|
|
@@ -18762,6 +18843,80 @@
|
|
|
18762
18843
|
return res;
|
|
18763
18844
|
};
|
|
18764
18845
|
|
|
18846
|
+
function isIdentityMatrix(matrix) {
|
|
18847
|
+
return 1 === matrix.a && 0 === matrix.b && 0 === matrix.c && 1 === matrix.d && 0 === matrix.e && 0 === matrix.f;
|
|
18848
|
+
}
|
|
18849
|
+
function createEventTransformer(containerElement, getMatrix, getRect, transformPoint) {
|
|
18850
|
+
return event => {
|
|
18851
|
+
if (!(event instanceof MouseEvent || event instanceof TouchEvent || event instanceof PointerEvent)) return event;
|
|
18852
|
+
const transformMatrix = getMatrix();
|
|
18853
|
+
if (isIdentityMatrix(transformMatrix)) return event;
|
|
18854
|
+
const containerRect = getRect(),
|
|
18855
|
+
transformedEvent = new event.constructor(event.type, event);
|
|
18856
|
+
if (Object.defineProperties(transformedEvent, {
|
|
18857
|
+
target: {
|
|
18858
|
+
value: event.target
|
|
18859
|
+
},
|
|
18860
|
+
currentTarget: {
|
|
18861
|
+
value: event.currentTarget
|
|
18862
|
+
}
|
|
18863
|
+
}), event instanceof MouseEvent || event instanceof PointerEvent) transformPoint(event.clientX, event.clientY, transformMatrix, containerRect, transformedEvent);else if (event instanceof TouchEvent) {
|
|
18864
|
+
if (event.touches.length > 0) {
|
|
18865
|
+
const touch = transformedEvent.touches[0];
|
|
18866
|
+
transformPoint(touch.clientX, touch.clientY, transformMatrix, containerRect, touch);
|
|
18867
|
+
}
|
|
18868
|
+
if (event.changedTouches.length > 0) {
|
|
18869
|
+
const touch = transformedEvent.changedTouches[0];
|
|
18870
|
+
transformPoint(touch.clientX, touch.clientY, transformMatrix, containerRect, touch);
|
|
18871
|
+
}
|
|
18872
|
+
}
|
|
18873
|
+
return transformedEvent;
|
|
18874
|
+
};
|
|
18875
|
+
}
|
|
18876
|
+
function createCanvasEventTransformer(canvasElement, getMatrix, getRect, transformPoint) {
|
|
18877
|
+
return createEventTransformer(canvasElement.parentElement || canvasElement, getMatrix, getRect, transformPoint);
|
|
18878
|
+
}
|
|
18879
|
+
function registerWindowEventTransformer(window, container, getMatrix, getRect, transformPoint) {
|
|
18880
|
+
const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
|
|
18881
|
+
window.setEventListenerTransformer(transformer);
|
|
18882
|
+
}
|
|
18883
|
+
function registerGlobalEventTransformer(global, container, getMatrix, getRect, transformPoint) {
|
|
18884
|
+
const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
|
|
18885
|
+
global.setEventListenerTransformer(transformer);
|
|
18886
|
+
}
|
|
18887
|
+
function transformPointForCanvas(clientX, clientY, matrix, rect, transformedEvent) {
|
|
18888
|
+
const transformedPoint = {
|
|
18889
|
+
x: clientX,
|
|
18890
|
+
y: clientY
|
|
18891
|
+
};
|
|
18892
|
+
matrix.transformPoint(transformedPoint, transformedPoint), Object.defineProperties(transformedEvent, {
|
|
18893
|
+
_canvasX: {
|
|
18894
|
+
value: transformedPoint.x
|
|
18895
|
+
},
|
|
18896
|
+
_canvasY: {
|
|
18897
|
+
value: transformedPoint.y
|
|
18898
|
+
}
|
|
18899
|
+
});
|
|
18900
|
+
}
|
|
18901
|
+
function mapToCanvasPointForCanvas(nativeEvent) {
|
|
18902
|
+
var _a;
|
|
18903
|
+
if (isNumber(nativeEvent._canvasX) && isNumber(nativeEvent._canvasY)) return {
|
|
18904
|
+
x: nativeEvent._canvasX,
|
|
18905
|
+
y: nativeEvent._canvasY
|
|
18906
|
+
};
|
|
18907
|
+
if (nativeEvent.changedTouches) {
|
|
18908
|
+
const data = null !== (_a = nativeEvent.changedTouches[0]) && void 0 !== _a ? _a : {};
|
|
18909
|
+
return {
|
|
18910
|
+
x: data._canvasX,
|
|
18911
|
+
y: data._canvasY
|
|
18912
|
+
};
|
|
18913
|
+
}
|
|
18914
|
+
return {
|
|
18915
|
+
x: nativeEvent._canvasX || 0,
|
|
18916
|
+
y: nativeEvent._canvasY || 0
|
|
18917
|
+
};
|
|
18918
|
+
}
|
|
18919
|
+
|
|
18765
18920
|
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
18766
18921
|
var t = {};
|
|
18767
18922
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
@@ -19974,6 +20129,7 @@
|
|
|
19974
20129
|
constructor() {
|
|
19975
20130
|
this.numberType = GLYPH_NUMBER_TYPE;
|
|
19976
20131
|
}
|
|
20132
|
+
reInit() {}
|
|
19977
20133
|
drawShape(glyph, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
19978
20134
|
drawContext.drawContribution && glyph.getSubGraphic().forEach(item => {
|
|
19979
20135
|
const renderer = drawContext.drawContribution.getRenderContribution(item);
|
|
@@ -22979,6 +23135,10 @@
|
|
|
22979
23135
|
};
|
|
22980
23136
|
this.canvasRenderer.drawShape(graphic, roughContext, 0, 0, drawContext, params, () => (doRender(), !1), () => (doRender(), !1)), context.restore();
|
|
22981
23137
|
}
|
|
23138
|
+
reInit() {
|
|
23139
|
+
var _a;
|
|
23140
|
+
null === (_a = this.canvasRenderer) || void 0 === _a || _a.reInit();
|
|
23141
|
+
}
|
|
22982
23142
|
}
|
|
22983
23143
|
|
|
22984
23144
|
var __decorate$18 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -25591,7 +25751,7 @@
|
|
|
25591
25751
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
25592
25752
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
25593
25753
|
let picked = !0;
|
|
25594
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
25754
|
+
if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
25595
25755
|
if (picked) return !0;
|
|
25596
25756
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25597
25757
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
@@ -32406,6 +32566,9 @@
|
|
|
32406
32566
|
isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
|
|
32407
32567
|
}
|
|
32408
32568
|
onUpdate(end, ratio, out) {
|
|
32569
|
+
if (end) return Object.keys(this.to).forEach(k => {
|
|
32570
|
+
this.target.attribute[k] = this.to[k];
|
|
32571
|
+
}), this.target.addUpdatePositionTag(), void this.target.addUpdateShapeAndBoundsTag();
|
|
32409
32572
|
if (this.points = this.points.map((point, index) => {
|
|
32410
32573
|
const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
|
|
32411
32574
|
return newPoint.context = point.context, newPoint;
|
|
@@ -32585,7 +32748,7 @@
|
|
|
32585
32748
|
growAngleInOverall = (graphic, options, animationParameters) => {
|
|
32586
32749
|
const attrs = graphic.getFinalAttribute();
|
|
32587
32750
|
if (options && "anticlockwise" === options.orient) {
|
|
32588
|
-
const overallValue = isNumber$
|
|
32751
|
+
const overallValue = isNumber$2(options.overall) ? options.overall : 2 * Math.PI;
|
|
32589
32752
|
return {
|
|
32590
32753
|
from: {
|
|
32591
32754
|
startAngle: overallValue,
|
|
@@ -32597,7 +32760,7 @@
|
|
|
32597
32760
|
}
|
|
32598
32761
|
};
|
|
32599
32762
|
}
|
|
32600
|
-
const overallValue = isNumber$
|
|
32763
|
+
const overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
32601
32764
|
return {
|
|
32602
32765
|
from: {
|
|
32603
32766
|
startAngle: overallValue,
|
|
@@ -32634,7 +32797,7 @@
|
|
|
32634
32797
|
growAngleOutOverall = (graphic, options, animationParameters) => {
|
|
32635
32798
|
const attrs = graphic.attribute;
|
|
32636
32799
|
if (options && "anticlockwise" === options.orient) {
|
|
32637
|
-
const overallValue = isNumber$
|
|
32800
|
+
const overallValue = isNumber$2(options.overall) ? options.overall : 2 * Math.PI;
|
|
32638
32801
|
return {
|
|
32639
32802
|
from: {
|
|
32640
32803
|
startAngle: attrs.startAngle,
|
|
@@ -32646,7 +32809,7 @@
|
|
|
32646
32809
|
}
|
|
32647
32810
|
};
|
|
32648
32811
|
}
|
|
32649
|
-
const overallValue = isNumber$
|
|
32812
|
+
const overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
32650
32813
|
return {
|
|
32651
32814
|
from: {
|
|
32652
32815
|
startAngle: attrs.startAngle,
|
|
@@ -32922,7 +33085,7 @@
|
|
|
32922
33085
|
y1 = attrs.y1,
|
|
32923
33086
|
height = attrs.height;
|
|
32924
33087
|
let overallValue;
|
|
32925
|
-
return options && "negative" === options.orient ? isNumber$
|
|
33088
|
+
return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
32926
33089
|
from: {
|
|
32927
33090
|
y: overallValue,
|
|
32928
33091
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -32995,7 +33158,7 @@
|
|
|
32995
33158
|
y1 = attrs.y1,
|
|
32996
33159
|
height = attrs.height;
|
|
32997
33160
|
let overallValue;
|
|
32998
|
-
return options && "negative" === options.orient ? isNumber$
|
|
33161
|
+
return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
32999
33162
|
to: {
|
|
33000
33163
|
y: overallValue,
|
|
33001
33164
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -33241,7 +33404,7 @@
|
|
|
33241
33404
|
},
|
|
33242
33405
|
growRadiusInOverall = (graphic, options, animationParameters) => {
|
|
33243
33406
|
const attrs = graphic.getFinalAttribute(),
|
|
33244
|
-
overallValue = isNumber$
|
|
33407
|
+
overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
33245
33408
|
return {
|
|
33246
33409
|
from: {
|
|
33247
33410
|
innerRadius: overallValue,
|
|
@@ -33277,7 +33440,7 @@
|
|
|
33277
33440
|
},
|
|
33278
33441
|
growRadiusOutOverall = (graphic, options, animationParameters) => {
|
|
33279
33442
|
const attrs = graphic.getFinalAttribute(),
|
|
33280
|
-
overallValue = isNumber$
|
|
33443
|
+
overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
33281
33444
|
return {
|
|
33282
33445
|
from: {
|
|
33283
33446
|
innerRadius: null == attrs ? void 0 : attrs.innerRadius,
|
|
@@ -33366,7 +33529,7 @@
|
|
|
33366
33529
|
x1 = attrs.x1,
|
|
33367
33530
|
width = attrs.width;
|
|
33368
33531
|
let overallValue;
|
|
33369
|
-
return options && "negative" === options.orient ? isNumber$
|
|
33532
|
+
return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? null == options ? void 0 : options.overall : 0, {
|
|
33370
33533
|
from: {
|
|
33371
33534
|
x: overallValue,
|
|
33372
33535
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -33413,7 +33576,7 @@
|
|
|
33413
33576
|
x1 = attrs.x1,
|
|
33414
33577
|
width = attrs.width;
|
|
33415
33578
|
let overallValue;
|
|
33416
|
-
return options && "negative" === options.orient ? isNumber$
|
|
33579
|
+
return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
33417
33580
|
to: {
|
|
33418
33581
|
x: overallValue,
|
|
33419
33582
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -35222,7 +35385,7 @@
|
|
|
35222
35385
|
AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("fromTo", FromTo), AnimateExecutor.registerBuiltInAnimate("scaleIn", ScaleIn), AnimateExecutor.registerBuiltInAnimate("scaleOut", ScaleOut), AnimateExecutor.registerBuiltInAnimate("growHeightIn", GrowHeightIn), AnimateExecutor.registerBuiltInAnimate("growHeightOut", GrowHeightOut), AnimateExecutor.registerBuiltInAnimate("growWidthIn", GrowWidthIn), AnimateExecutor.registerBuiltInAnimate("growWidthOut", GrowWidthOut), AnimateExecutor.registerBuiltInAnimate("growCenterIn", GrowCenterIn), AnimateExecutor.registerBuiltInAnimate("growCenterOut", GrowCenterOut), AnimateExecutor.registerBuiltInAnimate("clipIn", ClipIn), AnimateExecutor.registerBuiltInAnimate("clipOut", ClipOut), AnimateExecutor.registerBuiltInAnimate("fadeIn", FadeIn), AnimateExecutor.registerBuiltInAnimate("fadeOut", FadeOut), AnimateExecutor.registerBuiltInAnimate("growPointsIn", GrowPointsIn), AnimateExecutor.registerBuiltInAnimate("growPointsOut", GrowPointsOut), AnimateExecutor.registerBuiltInAnimate("growPointsXIn", GrowPointsXIn), AnimateExecutor.registerBuiltInAnimate("growPointsXOut", GrowPointsXOut), AnimateExecutor.registerBuiltInAnimate("growPointsYIn", GrowPointsYIn), AnimateExecutor.registerBuiltInAnimate("growPointsYOut", GrowPointsYOut), AnimateExecutor.registerBuiltInAnimate("growAngleIn", GrowAngleIn), AnimateExecutor.registerBuiltInAnimate("growAngleOut", GrowAngleOut), AnimateExecutor.registerBuiltInAnimate("growRadiusIn", GrowRadiusIn), AnimateExecutor.registerBuiltInAnimate("growRadiusOut", GrowRadiusOut), AnimateExecutor.registerBuiltInAnimate("moveIn", MoveIn), AnimateExecutor.registerBuiltInAnimate("moveOut", MoveOut), AnimateExecutor.registerBuiltInAnimate("rotateIn", RotateIn), AnimateExecutor.registerBuiltInAnimate("rotateOut", RotateOut), AnimateExecutor.registerBuiltInAnimate("update", Update), AnimateExecutor.registerBuiltInAnimate("state", State), AnimateExecutor.registerBuiltInAnimate("labelItemAppear", LabelItemAppear), AnimateExecutor.registerBuiltInAnimate("labelItemDisappear", LabelItemDisappear), AnimateExecutor.registerBuiltInAnimate("poptipAppear", PoptipAppear), AnimateExecutor.registerBuiltInAnimate("poptipDisappear", PoptipDisappear), AnimateExecutor.registerBuiltInAnimate("inputText", InputText), AnimateExecutor.registerBuiltInAnimate("inputRichText", InputRichText), AnimateExecutor.registerBuiltInAnimate("outputRichText", OutputRichText), AnimateExecutor.registerBuiltInAnimate("slideRichText", SlideRichText), AnimateExecutor.registerBuiltInAnimate("slideOutRichText", SlideOutRichText), AnimateExecutor.registerBuiltInAnimate("slideIn", SlideIn), AnimateExecutor.registerBuiltInAnimate("growIn", GrowIn), AnimateExecutor.registerBuiltInAnimate("spinIn", SpinIn), AnimateExecutor.registerBuiltInAnimate("moveScaleIn", MoveScaleIn), AnimateExecutor.registerBuiltInAnimate("moveRotateIn", MoveRotateIn), AnimateExecutor.registerBuiltInAnimate("strokeIn", StrokeIn), AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut), AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut), AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut), AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut), AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut), AnimateExecutor.registerBuiltInAnimate("strokeOut", StrokeOut), AnimateExecutor.registerBuiltInAnimate("pulse", PulseAnimate), AnimateExecutor.registerBuiltInAnimate("MotionPath", MotionPath), AnimateExecutor.registerBuiltInAnimate("streamLight", StreamLight);
|
|
35223
35386
|
};
|
|
35224
35387
|
|
|
35225
|
-
const version = "1.0.0-alpha.
|
|
35388
|
+
const version = "1.0.0-alpha.18";
|
|
35226
35389
|
preLoadAllModule();
|
|
35227
35390
|
if (isBrowserEnv()) {
|
|
35228
35391
|
loadBrowserEnv(container);
|
|
@@ -35325,6 +35488,7 @@
|
|
|
35325
35488
|
exports.ContainerModule = ContainerModule;
|
|
35326
35489
|
exports.Context2dFactory = Context2dFactory;
|
|
35327
35490
|
exports.ContributionProvider = ContributionProvider;
|
|
35491
|
+
exports.ContributionStore = ContributionStore;
|
|
35328
35492
|
exports.CubicBezierCurve = CubicBezierCurve;
|
|
35329
35493
|
exports.CurveContext = CurveContext;
|
|
35330
35494
|
exports.CustomEvent = CustomEvent;
|
|
@@ -35655,10 +35819,12 @@
|
|
|
35655
35819
|
exports.createArc = createArc;
|
|
35656
35820
|
exports.createArc3d = createArc3d;
|
|
35657
35821
|
exports.createArea = createArea;
|
|
35822
|
+
exports.createCanvasEventTransformer = createCanvasEventTransformer;
|
|
35658
35823
|
exports.createCircle = createCircle;
|
|
35659
35824
|
exports.createColor = createColor;
|
|
35660
35825
|
exports.createComponentAnimator = createComponentAnimator;
|
|
35661
35826
|
exports.createConicalGradient = createConicalGradient;
|
|
35827
|
+
exports.createEventTransformer = createEventTransformer;
|
|
35662
35828
|
exports.createGifImage = createGifImage;
|
|
35663
35829
|
exports.createGlyph = createGlyph;
|
|
35664
35830
|
exports.createGroup = createGroup;
|
|
@@ -35818,6 +35984,7 @@
|
|
|
35818
35984
|
exports.lottieCanvasPickModule = lottieCanvasPickModule;
|
|
35819
35985
|
exports.lottieModule = lottieModule;
|
|
35820
35986
|
exports.lynxEnvModule = lynxEnvModule;
|
|
35987
|
+
exports.mapToCanvasPointForCanvas = mapToCanvasPointForCanvas;
|
|
35821
35988
|
exports.mat3Tomat4 = mat3Tomat4;
|
|
35822
35989
|
exports.mat4Allocate = mat4Allocate;
|
|
35823
35990
|
exports.matrixAllocate = matrixAllocate;
|
|
@@ -35879,6 +36046,7 @@
|
|
|
35879
36046
|
exports.registerFlexLayoutPlugin = registerFlexLayoutPlugin;
|
|
35880
36047
|
exports.registerGifGraphic = registerGifGraphic;
|
|
35881
36048
|
exports.registerGifImage = registerGifImage;
|
|
36049
|
+
exports.registerGlobalEventTransformer = registerGlobalEventTransformer;
|
|
35882
36050
|
exports.registerGlyph = registerGlyph;
|
|
35883
36051
|
exports.registerGlyphGraphic = registerGlyphGraphic;
|
|
35884
36052
|
exports.registerGroup = registerGroup;
|
|
@@ -35911,6 +36079,7 @@
|
|
|
35911
36079
|
exports.registerText = registerText;
|
|
35912
36080
|
exports.registerTextGraphic = registerTextGraphic;
|
|
35913
36081
|
exports.registerViewTransform3dPlugin = registerViewTransform3dPlugin;
|
|
36082
|
+
exports.registerWindowEventTransformer = registerWindowEventTransformer;
|
|
35914
36083
|
exports.registerWrapText = registerWrapText;
|
|
35915
36084
|
exports.registerWrapTextGraphic = registerWrapTextGraphic;
|
|
35916
36085
|
exports.renderCommandList = renderCommandList;
|
|
@@ -35960,6 +36129,7 @@
|
|
|
35960
36129
|
exports.textMathPickModule = textMathPickModule;
|
|
35961
36130
|
exports.textModule = textModule;
|
|
35962
36131
|
exports.transformMat4 = transformMat4;
|
|
36132
|
+
exports.transformPointForCanvas = transformPointForCanvas;
|
|
35963
36133
|
exports.transformUtil = transformUtil;
|
|
35964
36134
|
exports.transitionRegistry = transitionRegistry;
|
|
35965
36135
|
exports.translate = translate;
|