@visactor/vrender 0.22.10 → 0.22.11
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 +256 -92
- package/dist/index.js +262 -91
- 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 +5 -5
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) {
|
|
@@ -580,6 +597,48 @@
|
|
|
580
597
|
const VGlobal = Symbol.for("VGlobal");
|
|
581
598
|
const DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
|
|
582
599
|
|
|
600
|
+
class EventListenerManager {
|
|
601
|
+
constructor() {
|
|
602
|
+
this._listenerMap = new Map(), this._eventListenerTransformer = event => event;
|
|
603
|
+
}
|
|
604
|
+
setEventListenerTransformer(transformer) {
|
|
605
|
+
this._eventListenerTransformer = transformer || (event => event);
|
|
606
|
+
}
|
|
607
|
+
addEventListener(type, listener, options) {
|
|
608
|
+
if (!listener) return;
|
|
609
|
+
const wrappedListener = event => {
|
|
610
|
+
const transformedEvent = this._eventListenerTransformer(event);
|
|
611
|
+
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
|
|
612
|
+
};
|
|
613
|
+
this._listenerMap.has(type) || this._listenerMap.set(type, new Map()), this._listenerMap.get(type).set(listener, wrappedListener), this._nativeAddEventListener(type, wrappedListener, options);
|
|
614
|
+
}
|
|
615
|
+
removeEventListener(type, listener, options) {
|
|
616
|
+
var _a;
|
|
617
|
+
if (!listener) return;
|
|
618
|
+
const wrappedListener = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener);
|
|
619
|
+
wrappedListener && (this._nativeRemoveEventListener(type, wrappedListener, options), this._listenerMap.get(type).delete(listener), 0 === this._listenerMap.get(type).size && this._listenerMap.delete(type));
|
|
620
|
+
}
|
|
621
|
+
dispatchEvent(event) {
|
|
622
|
+
return this._nativeDispatchEvent(event);
|
|
623
|
+
}
|
|
624
|
+
clearAllEventListeners() {
|
|
625
|
+
this._listenerMap.forEach((listenersMap, type) => {
|
|
626
|
+
listenersMap.forEach((wrappedListener, originalListener) => {
|
|
627
|
+
this._nativeRemoveEventListener(type, wrappedListener, void 0);
|
|
628
|
+
});
|
|
629
|
+
}), this._listenerMap.clear();
|
|
630
|
+
}
|
|
631
|
+
_nativeAddEventListener(type, listener, options) {
|
|
632
|
+
throw new Error("_nativeAddEventListener must be implemented by derived classes");
|
|
633
|
+
}
|
|
634
|
+
_nativeRemoveEventListener(type, listener, options) {
|
|
635
|
+
throw new Error("_nativeRemoveEventListener must be implemented by derived classes");
|
|
636
|
+
}
|
|
637
|
+
_nativeDispatchEvent(event) {
|
|
638
|
+
throw new Error("_nativeDispatchEvent must be implemented by derived classes");
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
583
642
|
var __decorate$1N = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
584
643
|
var d,
|
|
585
644
|
c = arguments.length,
|
|
@@ -620,7 +679,7 @@
|
|
|
620
679
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
621
680
|
});
|
|
622
681
|
};
|
|
623
|
-
exports.DefaultGlobal = class DefaultGlobal {
|
|
682
|
+
exports.DefaultGlobal = class DefaultGlobal extends EventListenerManager {
|
|
624
683
|
get env() {
|
|
625
684
|
return this._env;
|
|
626
685
|
}
|
|
@@ -664,10 +723,19 @@
|
|
|
664
723
|
this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
|
|
665
724
|
}
|
|
666
725
|
constructor(contributions) {
|
|
667
|
-
this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
726
|
+
super(), this.contributions = contributions, this._isImageAnonymous = !0, this.eventListenerTransformer = event => event, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
668
727
|
onSetEnv: new SyncHook(["lastEnv", "env", "global"])
|
|
669
728
|
}, this.measureTextMethod = "native", this.optimizeVisible = !1;
|
|
670
729
|
}
|
|
730
|
+
_nativeAddEventListener(type, listener, options) {
|
|
731
|
+
return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
|
|
732
|
+
}
|
|
733
|
+
_nativeRemoveEventListener(type, listener, options) {
|
|
734
|
+
return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
|
|
735
|
+
}
|
|
736
|
+
_nativeDispatchEvent(event) {
|
|
737
|
+
return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
|
|
738
|
+
}
|
|
671
739
|
bindContribution(params) {
|
|
672
740
|
const promiseArr = [];
|
|
673
741
|
if (this.contributions.getContributions().forEach(contribution => {
|
|
@@ -708,15 +776,6 @@
|
|
|
708
776
|
releaseCanvas(canvas) {
|
|
709
777
|
return this._env || this.setEnv("browser"), this.envContribution.releaseCanvas(canvas);
|
|
710
778
|
}
|
|
711
|
-
addEventListener(type, listener, options) {
|
|
712
|
-
return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
|
|
713
|
-
}
|
|
714
|
-
removeEventListener(type, listener, options) {
|
|
715
|
-
return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
|
|
716
|
-
}
|
|
717
|
-
dispatchEvent(event) {
|
|
718
|
-
return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
|
|
719
|
-
}
|
|
720
779
|
getRequestAnimationFrame() {
|
|
721
780
|
return this._env || this.setEnv("browser"), this.envContribution.getRequestAnimationFrame();
|
|
722
781
|
}
|
|
@@ -1178,14 +1237,14 @@
|
|
|
1178
1237
|
};
|
|
1179
1238
|
var isArrayLike$1 = isArrayLike;
|
|
1180
1239
|
|
|
1181
|
-
const isNumber = function (value) {
|
|
1240
|
+
const isNumber$1 = function (value) {
|
|
1182
1241
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1183
1242
|
const type = typeof value;
|
|
1184
1243
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
1185
1244
|
};
|
|
1186
|
-
var isNumber$
|
|
1245
|
+
var isNumber$2 = isNumber$1;
|
|
1187
1246
|
|
|
1188
|
-
const isValidNumber = value => isNumber$
|
|
1247
|
+
const isValidNumber = value => isNumber$2(value) && Number.isFinite(value);
|
|
1189
1248
|
var isValidNumber$1 = isValidNumber;
|
|
1190
1249
|
|
|
1191
1250
|
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
@@ -1268,7 +1327,7 @@
|
|
|
1268
1327
|
}(LoggerLevel || (LoggerLevel = {}));
|
|
1269
1328
|
class Logger {
|
|
1270
1329
|
static getInstance(level, method) {
|
|
1271
|
-
return Logger._instance && isNumber$
|
|
1330
|
+
return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1272
1331
|
}
|
|
1273
1332
|
static setInstance(logger) {
|
|
1274
1333
|
return Logger._instance = logger;
|
|
@@ -1412,10 +1471,10 @@
|
|
|
1412
1471
|
return this.x = x, this.y = y, this;
|
|
1413
1472
|
}
|
|
1414
1473
|
add(point) {
|
|
1415
|
-
return isNumber$
|
|
1474
|
+
return isNumber$2(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1416
1475
|
}
|
|
1417
1476
|
sub(point) {
|
|
1418
|
-
return isNumber$
|
|
1477
|
+
return isNumber$2(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1419
1478
|
}
|
|
1420
1479
|
multi(point) {
|
|
1421
1480
|
throw new Error("暂不支持");
|
|
@@ -2476,10 +2535,10 @@
|
|
|
2476
2535
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2477
2536
|
}
|
|
2478
2537
|
function rgb(value) {
|
|
2479
|
-
return isNumber$
|
|
2538
|
+
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);
|
|
2480
2539
|
}
|
|
2481
2540
|
function rgba(value) {
|
|
2482
|
-
return isNumber$
|
|
2541
|
+
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);
|
|
2483
2542
|
}
|
|
2484
2543
|
function SRGBToLinear(c) {
|
|
2485
2544
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -5265,6 +5324,9 @@
|
|
|
5265
5324
|
function isNotAroundZero(val) {
|
|
5266
5325
|
return val > EPSILON || val < -EPSILON;
|
|
5267
5326
|
}
|
|
5327
|
+
function isNumber(data) {
|
|
5328
|
+
return "number" == typeof data && Number.isFinite(data);
|
|
5329
|
+
}
|
|
5268
5330
|
const _v0 = [0, 0],
|
|
5269
5331
|
_v1 = [0, 0],
|
|
5270
5332
|
_v2 = [0, 0];
|
|
@@ -5669,7 +5731,7 @@
|
|
|
5669
5731
|
};
|
|
5670
5732
|
const VWindow = Symbol.for("VWindow");
|
|
5671
5733
|
const WindowHandlerContribution = Symbol.for("WindowHandlerContribution");
|
|
5672
|
-
exports.DefaultWindow = class DefaultWindow {
|
|
5734
|
+
exports.DefaultWindow = class DefaultWindow extends EventListenerManager {
|
|
5673
5735
|
get width() {
|
|
5674
5736
|
if (this._handler) {
|
|
5675
5737
|
const wh = this._handler.getWH();
|
|
@@ -5688,7 +5750,7 @@
|
|
|
5688
5750
|
return this._handler.getDpr();
|
|
5689
5751
|
}
|
|
5690
5752
|
constructor() {
|
|
5691
|
-
this.hooks = {
|
|
5753
|
+
super(), this.hooks = {
|
|
5692
5754
|
onChange: new SyncHook(["x", "y", "width", "height"])
|
|
5693
5755
|
}, this.active = () => {
|
|
5694
5756
|
const global = this.global;
|
|
@@ -5696,6 +5758,15 @@
|
|
|
5696
5758
|
container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
|
|
5697
5759
|
}, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
|
|
5698
5760
|
}
|
|
5761
|
+
_nativeAddEventListener(type, listener, options) {
|
|
5762
|
+
return this._handler.addEventListener(type, listener, options);
|
|
5763
|
+
}
|
|
5764
|
+
_nativeRemoveEventListener(type, listener, options) {
|
|
5765
|
+
return this._handler.removeEventListener(type, listener, options);
|
|
5766
|
+
}
|
|
5767
|
+
_nativeDispatchEvent(event) {
|
|
5768
|
+
return this._handler.dispatchEvent(event);
|
|
5769
|
+
}
|
|
5699
5770
|
postInit() {
|
|
5700
5771
|
this.global.hooks.onSetEnv.tap("window", this.active), this.active();
|
|
5701
5772
|
}
|
|
@@ -5735,7 +5806,7 @@
|
|
|
5735
5806
|
throw new Error("暂不支持");
|
|
5736
5807
|
}
|
|
5737
5808
|
release() {
|
|
5738
|
-
return this.global.hooks.onSetEnv.unTap("window", this.active), this._handler.releaseWindow();
|
|
5809
|
+
return this.global.hooks.onSetEnv.unTap("window", this.active), this.clearAllEventListeners(), this._handler.releaseWindow();
|
|
5739
5810
|
}
|
|
5740
5811
|
getContext() {
|
|
5741
5812
|
return this._handler.getContext();
|
|
@@ -5746,15 +5817,6 @@
|
|
|
5746
5817
|
getImageBuffer(type) {
|
|
5747
5818
|
return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
|
|
5748
5819
|
}
|
|
5749
|
-
addEventListener(type, listener, options) {
|
|
5750
|
-
return this._handler.addEventListener(type, listener, options);
|
|
5751
|
-
}
|
|
5752
|
-
removeEventListener(type, listener, options) {
|
|
5753
|
-
return this._handler.removeEventListener(type, listener, options);
|
|
5754
|
-
}
|
|
5755
|
-
dispatchEvent(event) {
|
|
5756
|
-
return this._handler.dispatchEvent(event);
|
|
5757
|
-
}
|
|
5758
5820
|
getBoundingClientRect() {
|
|
5759
5821
|
return this._handler.getBoundingClientRect();
|
|
5760
5822
|
}
|
|
@@ -6963,19 +7025,17 @@
|
|
|
6963
7025
|
globalObj: globalObj,
|
|
6964
7026
|
domElement: domElement
|
|
6965
7027
|
} = this;
|
|
6966
|
-
this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.
|
|
7028
|
+
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, {
|
|
6967
7029
|
capture: !0
|
|
6968
7030
|
}), this.eventsAdded = !0;
|
|
6969
7031
|
}
|
|
6970
7032
|
removeEvents() {
|
|
6971
|
-
var _a;
|
|
6972
7033
|
if (!this.eventsAdded || !this.domElement) return;
|
|
6973
7034
|
const {
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
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;
|
|
7035
|
+
globalObj: globalObj,
|
|
7036
|
+
domElement: domElement
|
|
7037
|
+
} = this;
|
|
7038
|
+
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;
|
|
6979
7039
|
}
|
|
6980
7040
|
mapToViewportPoint(event) {
|
|
6981
7041
|
return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
|
|
@@ -7969,7 +8029,7 @@
|
|
|
7969
8029
|
}
|
|
7970
8030
|
onBind() {
|
|
7971
8031
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7972
|
-
this.fromNumber = isNumber$
|
|
8032
|
+
this.fromNumber = isNumber$2(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$2(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
|
|
7973
8033
|
}
|
|
7974
8034
|
onEnd() {}
|
|
7975
8035
|
onUpdate(end, ratio, out) {
|
|
@@ -8397,23 +8457,27 @@
|
|
|
8397
8457
|
isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
|
|
8398
8458
|
}
|
|
8399
8459
|
onUpdate(end, ratio, out) {
|
|
8400
|
-
if (
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8460
|
+
if (end) Object.keys(this.to).forEach(k => {
|
|
8461
|
+
out[k] = this.to[k];
|
|
8462
|
+
});else {
|
|
8463
|
+
if (this.points = this.points.map((point, index) => {
|
|
8464
|
+
const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
|
|
8465
|
+
return newPoint.context = point.context, newPoint;
|
|
8466
|
+
}), this.clipRange) {
|
|
8467
|
+
if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints, out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
|
|
8468
|
+
out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
|
|
8469
|
+
}
|
|
8470
|
+
if (this.segmentsCache && this.to.segments) {
|
|
8471
|
+
let start = 0;
|
|
8472
|
+
out.segments = this.to.segments.map((segment, index) => {
|
|
8473
|
+
const end = start + this.segmentsCache[index],
|
|
8474
|
+
points = this.points.slice(start, end);
|
|
8475
|
+
return start = end, Object.assign(Object.assign({}, segment), {
|
|
8476
|
+
points: points
|
|
8477
|
+
});
|
|
8414
8478
|
});
|
|
8415
|
-
}
|
|
8416
|
-
}
|
|
8479
|
+
} else out.points = this.points;
|
|
8480
|
+
}
|
|
8417
8481
|
}
|
|
8418
8482
|
}
|
|
8419
8483
|
class GraphicAnimate extends ACustomAnimate {
|
|
@@ -9112,7 +9176,7 @@
|
|
|
9112
9176
|
return res;
|
|
9113
9177
|
};
|
|
9114
9178
|
const samplingPoints = (points, count) => {
|
|
9115
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
9179
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
|
|
9116
9180
|
if (0 === validatePoints.length) return [];
|
|
9117
9181
|
if (1 === validatePoints.length) return new Array(count).fill(0).map(i => validatePoints[0]);
|
|
9118
9182
|
const res = [];
|
|
@@ -9148,7 +9212,7 @@
|
|
|
9148
9212
|
var _a;
|
|
9149
9213
|
return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
|
|
9150
9214
|
}, []));
|
|
9151
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
9215
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
|
|
9152
9216
|
if (!validatePoints.length) return [];
|
|
9153
9217
|
const allPoints = [];
|
|
9154
9218
|
validatePoints.forEach(point => {
|
|
@@ -9354,10 +9418,10 @@
|
|
|
9354
9418
|
|
|
9355
9419
|
function colorArrayToString(color) {
|
|
9356
9420
|
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
9357
|
-
return Array.isArray(color) && isNumber$
|
|
9421
|
+
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;
|
|
9358
9422
|
}
|
|
9359
9423
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
9360
|
-
if (Array.isArray(from) && !isNumber$
|
|
9424
|
+
if (Array.isArray(from) && !isNumber$2(from[0]) || Array.isArray(to) && !isNumber$2(to[0])) {
|
|
9361
9425
|
return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$1(from) ? from[index] : from, isArray$1(to) ? to[index] : to, ratio, alphaChannel));
|
|
9362
9426
|
}
|
|
9363
9427
|
return _interpolateColor(from, to, ratio, alphaChannel, cb);
|
|
@@ -9885,13 +9949,13 @@
|
|
|
9885
9949
|
|
|
9886
9950
|
class BaseSymbol {
|
|
9887
9951
|
bounds(size, bounds) {
|
|
9888
|
-
if (isNumber$
|
|
9952
|
+
if (isNumber$2(size)) {
|
|
9889
9953
|
const halfS = size / 2;
|
|
9890
9954
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
9891
9955
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
9892
9956
|
}
|
|
9893
9957
|
parseSize(size) {
|
|
9894
|
-
return isNumber$
|
|
9958
|
+
return isNumber$2(size) ? size : Math.min(size[0], size[1]);
|
|
9895
9959
|
}
|
|
9896
9960
|
}
|
|
9897
9961
|
|
|
@@ -10310,10 +10374,10 @@
|
|
|
10310
10374
|
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";
|
|
10311
10375
|
}
|
|
10312
10376
|
draw(ctx, size, x, y) {
|
|
10313
|
-
return isNumber$
|
|
10377
|
+
return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
10314
10378
|
}
|
|
10315
10379
|
drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
10316
|
-
isNumber$
|
|
10380
|
+
isNumber$2(size) && (size = [size, size / 2]);
|
|
10317
10381
|
const drawLength = 2 * (size[0] + size[1]) * clipRange,
|
|
10318
10382
|
points = [{
|
|
10319
10383
|
x: x + size[0] / 2,
|
|
@@ -10345,7 +10409,7 @@
|
|
|
10345
10409
|
return !1;
|
|
10346
10410
|
}
|
|
10347
10411
|
drawOffset(ctx, size, x, y, offset) {
|
|
10348
|
-
return isNumber$
|
|
10412
|
+
return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
10349
10413
|
}
|
|
10350
10414
|
}
|
|
10351
10415
|
var rect = new RectSymbol();
|
|
@@ -10365,7 +10429,7 @@
|
|
|
10365
10429
|
return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
10366
10430
|
}
|
|
10367
10431
|
parseSize(size) {
|
|
10368
|
-
return isNumber$
|
|
10432
|
+
return isNumber$2(size) ? size : Math.min(size[0], size[1]);
|
|
10369
10433
|
}
|
|
10370
10434
|
drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
10371
10435
|
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
@@ -12608,12 +12672,12 @@
|
|
|
12608
12672
|
textBaseline: textBaseline
|
|
12609
12673
|
} = attribute;
|
|
12610
12674
|
if (null != attribute.forceBoundsHeight) {
|
|
12611
|
-
const h = isNumber$
|
|
12675
|
+
const h = isNumber$2(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
|
|
12612
12676
|
dy = textLayoutOffsetY(textBaseline, h, h);
|
|
12613
12677
|
aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);
|
|
12614
12678
|
}
|
|
12615
12679
|
if (null != attribute.forceBoundsWidth) {
|
|
12616
|
-
const w = isNumber$
|
|
12680
|
+
const w = isNumber$2(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
|
|
12617
12681
|
dx = textDrawOffsetX(textAlign, w);
|
|
12618
12682
|
aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
|
|
12619
12683
|
}
|
|
@@ -14712,7 +14776,7 @@
|
|
|
14712
14776
|
}
|
|
14713
14777
|
} else {
|
|
14714
14778
|
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
14715
|
-
if (isNumber$
|
|
14779
|
+
if (isNumber$2(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
14716
14780
|
const textParts = richTextConfig.text.split("\n");
|
|
14717
14781
|
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 {
|
|
14718
14782
|
const nextRichTextConfig = this.combinedStyleToCharacter(textConfig[i + 1]);
|
|
@@ -14999,7 +15063,7 @@
|
|
|
14999
15063
|
} = this.attribute;
|
|
15000
15064
|
if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
15001
15065
|
const deltaRadius = Math.abs(outerRadius - innerRadius),
|
|
15002
|
-
parseCR = cornerRadius => Math.min(isNumber$
|
|
15066
|
+
parseCR = cornerRadius => Math.min(isNumber$2(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
15003
15067
|
if (isArray$1(cornerRadius)) {
|
|
15004
15068
|
const crList = cornerRadius.map(cr => parseCR(cr) || 0);
|
|
15005
15069
|
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);
|
|
@@ -16001,7 +16065,7 @@
|
|
|
16001
16065
|
let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
16002
16066
|
let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
|
|
16003
16067
|
let cornerRadius;
|
|
16004
|
-
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
16068
|
+
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)) {
|
|
16005
16069
|
const cornerRadiusArr = rectCornerRadius;
|
|
16006
16070
|
let cr0, cr1;
|
|
16007
16071
|
switch (cornerRadiusArr.length) {
|
|
@@ -16277,6 +16341,9 @@
|
|
|
16277
16341
|
init(contributions) {
|
|
16278
16342
|
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));
|
|
16279
16343
|
}
|
|
16344
|
+
reInit() {
|
|
16345
|
+
this.init(this.graphicRenderContributions);
|
|
16346
|
+
}
|
|
16280
16347
|
beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, params) {
|
|
16281
16348
|
this._beforeRenderContribitions && this._beforeRenderContribitions.forEach(c => {
|
|
16282
16349
|
if (c.supportedAppName && graphic.stage && graphic.stage.params && graphic.stage.params.context && graphic.stage.params.context.appName) {
|
|
@@ -16446,8 +16513,8 @@
|
|
|
16446
16513
|
};
|
|
16447
16514
|
};
|
|
16448
16515
|
exports.DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
|
|
16449
|
-
constructor(
|
|
16450
|
-
super(), this.
|
|
16516
|
+
constructor(graphicRenderContributions) {
|
|
16517
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = ARC_NUMBER_TYPE, this.builtinContributions = [defaultArcRenderContribution, defaultArcBackgroundRenderContribution, defaultArcTextureRenderContribution], this.init(graphicRenderContributions);
|
|
16451
16518
|
}
|
|
16452
16519
|
drawArcTailCapPath(arc, context, cx, cy, outerRadius, innerRadius, _sa, _ea) {
|
|
16453
16520
|
const capAngle = _ea - _sa,
|
|
@@ -16622,8 +16689,8 @@
|
|
|
16622
16689
|
};
|
|
16623
16690
|
};
|
|
16624
16691
|
exports.DefaultCanvasCircleRender = class DefaultCanvasCircleRender extends BaseRender {
|
|
16625
|
-
constructor(
|
|
16626
|
-
super(), this.
|
|
16692
|
+
constructor(graphicRenderContributions) {
|
|
16693
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(graphicRenderContributions);
|
|
16627
16694
|
}
|
|
16628
16695
|
drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
16629
16696
|
const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle,
|
|
@@ -17009,8 +17076,8 @@
|
|
|
17009
17076
|
};
|
|
17010
17077
|
};
|
|
17011
17078
|
exports.DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
|
|
17012
|
-
constructor(
|
|
17013
|
-
super(), this.
|
|
17079
|
+
constructor(graphicRenderContributions) {
|
|
17080
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(graphicRenderContributions);
|
|
17014
17081
|
}
|
|
17015
17082
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
17016
17083
|
var _a, _b, _c;
|
|
@@ -17253,8 +17320,8 @@
|
|
|
17253
17320
|
};
|
|
17254
17321
|
};
|
|
17255
17322
|
exports.DefaultCanvasPathRender = class DefaultCanvasPathRender extends BaseRender {
|
|
17256
|
-
constructor(
|
|
17257
|
-
super(), this.
|
|
17323
|
+
constructor(graphicRenderContributions) {
|
|
17324
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = PATH_NUMBER_TYPE, this.builtinContributions = [defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution], this.init(graphicRenderContributions);
|
|
17258
17325
|
}
|
|
17259
17326
|
drawShape(path, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17260
17327
|
var _a, _b, _c;
|
|
@@ -17309,8 +17376,8 @@
|
|
|
17309
17376
|
};
|
|
17310
17377
|
};
|
|
17311
17378
|
exports.DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
|
|
17312
|
-
constructor(
|
|
17313
|
-
super(), this.
|
|
17379
|
+
constructor(graphicRenderContributions) {
|
|
17380
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.type = "rect", this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution], this.init(graphicRenderContributions);
|
|
17314
17381
|
}
|
|
17315
17382
|
drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17316
17383
|
var _a;
|
|
@@ -17381,8 +17448,8 @@
|
|
|
17381
17448
|
};
|
|
17382
17449
|
};
|
|
17383
17450
|
exports.DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRender {
|
|
17384
|
-
constructor(
|
|
17385
|
-
super(), this.
|
|
17451
|
+
constructor(graphicRenderContributions) {
|
|
17452
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(graphicRenderContributions);
|
|
17386
17453
|
}
|
|
17387
17454
|
drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17388
17455
|
var _a;
|
|
@@ -17553,8 +17620,8 @@
|
|
|
17553
17620
|
};
|
|
17554
17621
|
};
|
|
17555
17622
|
exports.DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
|
|
17556
|
-
constructor(
|
|
17557
|
-
super(), this.
|
|
17623
|
+
constructor(graphicRenderContributions) {
|
|
17624
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = TEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init(graphicRenderContributions);
|
|
17558
17625
|
}
|
|
17559
17626
|
drawShape(text, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17560
17627
|
var _a, _b, _c;
|
|
@@ -17768,8 +17835,8 @@
|
|
|
17768
17835
|
};
|
|
17769
17836
|
};
|
|
17770
17837
|
exports.DefaultCanvasPolygonRender = class DefaultCanvasPolygonRender extends BaseRender {
|
|
17771
|
-
constructor(
|
|
17772
|
-
super(), this.
|
|
17838
|
+
constructor(graphicRenderContributions) {
|
|
17839
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = POLYGON_NUMBER_TYPE, this.builtinContributions = [defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution], this.init(graphicRenderContributions);
|
|
17773
17840
|
}
|
|
17774
17841
|
drawShape(polygon, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17775
17842
|
const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon,
|
|
@@ -17824,6 +17891,9 @@
|
|
|
17824
17891
|
constructor(groupRenderContribitions) {
|
|
17825
17892
|
this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
|
|
17826
17893
|
}
|
|
17894
|
+
reInit() {
|
|
17895
|
+
this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution);
|
|
17896
|
+
}
|
|
17827
17897
|
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17828
17898
|
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
17829
17899
|
{
|
|
@@ -17954,8 +18024,8 @@
|
|
|
17954
18024
|
};
|
|
17955
18025
|
const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
|
|
17956
18026
|
exports.DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender {
|
|
17957
|
-
constructor(
|
|
17958
|
-
super(), this.
|
|
18027
|
+
constructor(graphicRenderContributions) {
|
|
18028
|
+
super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(graphicRenderContributions);
|
|
17959
18029
|
}
|
|
17960
18030
|
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17961
18031
|
const imageAttribute = getTheme(image).image,
|
|
@@ -18285,6 +18355,9 @@
|
|
|
18285
18355
|
afterDraw(params) {
|
|
18286
18356
|
this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
|
|
18287
18357
|
}
|
|
18358
|
+
reInit() {
|
|
18359
|
+
this.drawContribution.reInit();
|
|
18360
|
+
}
|
|
18288
18361
|
render(groups, params) {
|
|
18289
18362
|
this.renderTreeRoots = groups, this.drawParams = params;
|
|
18290
18363
|
const updateBounds = params.updateBounds;
|
|
@@ -18688,6 +18761,11 @@
|
|
|
18688
18761
|
constructor(contributions, drawItemInterceptorContributions) {
|
|
18689
18762
|
this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, 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();
|
|
18690
18763
|
}
|
|
18764
|
+
reInit() {
|
|
18765
|
+
this.init(), this.contributions.forEach(item => {
|
|
18766
|
+
item.reInit();
|
|
18767
|
+
});
|
|
18768
|
+
}
|
|
18691
18769
|
init() {
|
|
18692
18770
|
this.contributions.forEach(item => {
|
|
18693
18771
|
if (item.style) {
|
|
@@ -19815,6 +19893,9 @@
|
|
|
19815
19893
|
getPickerService() {
|
|
19816
19894
|
return this.pickerService || (this.pickerService = container.get(PickerService)), this.pickerService;
|
|
19817
19895
|
}
|
|
19896
|
+
reInit() {
|
|
19897
|
+
this.renderService.reInit(), this.pickerService.reInit();
|
|
19898
|
+
}
|
|
19818
19899
|
}
|
|
19819
19900
|
|
|
19820
19901
|
function createStage(params) {
|
|
@@ -20412,6 +20493,9 @@
|
|
|
20412
20493
|
constructor(pickItemInterceptorContributions, pickServiceInterceptorContributions) {
|
|
20413
20494
|
this.pickItemInterceptorContributions = pickItemInterceptorContributions, this.pickServiceInterceptorContributions = pickServiceInterceptorContributions, this.type = "default", this.global = application.global;
|
|
20414
20495
|
}
|
|
20496
|
+
reInit() {
|
|
20497
|
+
this._init();
|
|
20498
|
+
}
|
|
20415
20499
|
_init() {
|
|
20416
20500
|
this.InterceptorContributions = this.pickItemInterceptorContributions.getContributions().sort((a, b) => a.order - b.order), this.pickerServiceInterceptorContributions = this.pickServiceInterceptorContributions.getContributions().sort((a, b) => a.order - b.order);
|
|
20417
20501
|
}
|
|
@@ -20526,6 +20610,7 @@
|
|
|
20526
20610
|
this.configure(global, env);
|
|
20527
20611
|
}), this.configure(this.global, this.global.env);
|
|
20528
20612
|
}
|
|
20613
|
+
reInit() {}
|
|
20529
20614
|
configure(global, env) {}
|
|
20530
20615
|
pick(graphics, point, params) {
|
|
20531
20616
|
let result = {
|
|
@@ -20598,6 +20683,80 @@
|
|
|
20598
20683
|
return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
|
|
20599
20684
|
}
|
|
20600
20685
|
|
|
20686
|
+
function isIdentityMatrix(matrix) {
|
|
20687
|
+
return 1 === matrix.a && 0 === matrix.b && 0 === matrix.c && 1 === matrix.d && 0 === matrix.e && 0 === matrix.f;
|
|
20688
|
+
}
|
|
20689
|
+
function createEventTransformer(containerElement, getMatrix, getRect, transformPoint) {
|
|
20690
|
+
return event => {
|
|
20691
|
+
if (!(event instanceof MouseEvent || event instanceof TouchEvent || event instanceof PointerEvent)) return event;
|
|
20692
|
+
const transformMatrix = getMatrix();
|
|
20693
|
+
if (isIdentityMatrix(transformMatrix)) return event;
|
|
20694
|
+
const containerRect = getRect(),
|
|
20695
|
+
transformedEvent = new event.constructor(event.type, event);
|
|
20696
|
+
if (Object.defineProperties(transformedEvent, {
|
|
20697
|
+
target: {
|
|
20698
|
+
value: event.target
|
|
20699
|
+
},
|
|
20700
|
+
currentTarget: {
|
|
20701
|
+
value: event.currentTarget
|
|
20702
|
+
}
|
|
20703
|
+
}), event instanceof MouseEvent || event instanceof PointerEvent) transformPoint(event.clientX, event.clientY, transformMatrix, containerRect, transformedEvent);else if (event instanceof TouchEvent) {
|
|
20704
|
+
if (event.touches.length > 0) {
|
|
20705
|
+
const touch = transformedEvent.touches[0];
|
|
20706
|
+
transformPoint(touch.clientX, touch.clientY, transformMatrix, containerRect, touch);
|
|
20707
|
+
}
|
|
20708
|
+
if (event.changedTouches.length > 0) {
|
|
20709
|
+
const touch = transformedEvent.changedTouches[0];
|
|
20710
|
+
transformPoint(touch.clientX, touch.clientY, transformMatrix, containerRect, touch);
|
|
20711
|
+
}
|
|
20712
|
+
}
|
|
20713
|
+
return transformedEvent;
|
|
20714
|
+
};
|
|
20715
|
+
}
|
|
20716
|
+
function createCanvasEventTransformer(canvasElement, getMatrix, getRect, transformPoint) {
|
|
20717
|
+
return createEventTransformer(canvasElement.parentElement || canvasElement, getMatrix, getRect, transformPoint);
|
|
20718
|
+
}
|
|
20719
|
+
function registerWindowEventTransformer(window, container, getMatrix, getRect, transformPoint) {
|
|
20720
|
+
const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
|
|
20721
|
+
window.setEventListenerTransformer(transformer);
|
|
20722
|
+
}
|
|
20723
|
+
function registerGlobalEventTransformer(global, container, getMatrix, getRect, transformPoint) {
|
|
20724
|
+
const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
|
|
20725
|
+
global.setEventListenerTransformer(transformer);
|
|
20726
|
+
}
|
|
20727
|
+
function transformPointForCanvas(clientX, clientY, matrix, rect, transformedEvent) {
|
|
20728
|
+
const transformedPoint = {
|
|
20729
|
+
x: clientX,
|
|
20730
|
+
y: clientY
|
|
20731
|
+
};
|
|
20732
|
+
matrix.transformPoint(transformedPoint, transformedPoint), Object.defineProperties(transformedEvent, {
|
|
20733
|
+
_canvasX: {
|
|
20734
|
+
value: transformedPoint.x
|
|
20735
|
+
},
|
|
20736
|
+
_canvasY: {
|
|
20737
|
+
value: transformedPoint.y
|
|
20738
|
+
}
|
|
20739
|
+
});
|
|
20740
|
+
}
|
|
20741
|
+
function mapToCanvasPointForCanvas(nativeEvent) {
|
|
20742
|
+
var _a;
|
|
20743
|
+
if (isNumber(nativeEvent._canvasX) && isNumber(nativeEvent._canvasY)) return {
|
|
20744
|
+
x: nativeEvent._canvasX,
|
|
20745
|
+
y: nativeEvent._canvasY
|
|
20746
|
+
};
|
|
20747
|
+
if (nativeEvent.changedTouches) {
|
|
20748
|
+
const data = null !== (_a = nativeEvent.changedTouches[0]) && void 0 !== _a ? _a : {};
|
|
20749
|
+
return {
|
|
20750
|
+
x: data._canvasX,
|
|
20751
|
+
y: data._canvasY
|
|
20752
|
+
};
|
|
20753
|
+
}
|
|
20754
|
+
return {
|
|
20755
|
+
x: nativeEvent._canvasX || 0,
|
|
20756
|
+
y: nativeEvent._canvasY || 0
|
|
20757
|
+
};
|
|
20758
|
+
}
|
|
20759
|
+
|
|
20601
20760
|
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
20602
20761
|
var t = {};
|
|
20603
20762
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
@@ -21809,6 +21968,7 @@
|
|
|
21809
21968
|
constructor() {
|
|
21810
21969
|
this.numberType = GLYPH_NUMBER_TYPE;
|
|
21811
21970
|
}
|
|
21971
|
+
reInit() {}
|
|
21812
21972
|
drawShape(glyph, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
21813
21973
|
drawContext.drawContribution && glyph.getSubGraphic().forEach(item => {
|
|
21814
21974
|
const renderer = drawContext.drawContribution.getRenderContribution(item);
|
|
@@ -24341,6 +24501,10 @@
|
|
|
24341
24501
|
drawShape(graphic, ctx, x, y, drawContext, params, fillCb, strokeCb) {
|
|
24342
24502
|
if (this.canvasRenderer.drawShape) return this.canvasRenderer.drawShape(graphic, ctx, x, y, drawContext, params, fillCb, strokeCb);
|
|
24343
24503
|
}
|
|
24504
|
+
reInit() {
|
|
24505
|
+
var _a;
|
|
24506
|
+
null === (_a = this.canvasRenderer) || void 0 === _a || _a.reInit();
|
|
24507
|
+
}
|
|
24344
24508
|
}
|
|
24345
24509
|
|
|
24346
24510
|
var __decorate$18 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -27156,7 +27320,7 @@
|
|
|
27156
27320
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
27157
27321
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
27158
27322
|
let picked = !0;
|
|
27159
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
27323
|
+
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) => {
|
|
27160
27324
|
if (picked) return !0;
|
|
27161
27325
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
27162
27326
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
@@ -31896,7 +32060,7 @@
|
|
|
31896
32060
|
|
|
31897
32061
|
const roughModule = _roughModule;
|
|
31898
32062
|
|
|
31899
|
-
const version = "0.22.
|
|
32063
|
+
const version = "0.22.11";
|
|
31900
32064
|
preLoadAllModule();
|
|
31901
32065
|
if (isBrowserEnv()) {
|
|
31902
32066
|
loadBrowserEnv(container);
|
|
@@ -31993,6 +32157,7 @@
|
|
|
31993
32157
|
exports.ContainerModule = ContainerModule;
|
|
31994
32158
|
exports.Context2dFactory = Context2dFactory;
|
|
31995
32159
|
exports.ContributionProvider = ContributionProvider;
|
|
32160
|
+
exports.ContributionStore = ContributionStore;
|
|
31996
32161
|
exports.CurveContext = CurveContext;
|
|
31997
32162
|
exports.CustomEvent = CustomEvent;
|
|
31998
32163
|
exports.CustomPath2D = CustomPath2D;
|
|
@@ -32283,9 +32448,11 @@
|
|
|
32283
32448
|
exports.createArc = createArc;
|
|
32284
32449
|
exports.createArc3d = createArc3d;
|
|
32285
32450
|
exports.createArea = createArea;
|
|
32451
|
+
exports.createCanvasEventTransformer = createCanvasEventTransformer;
|
|
32286
32452
|
exports.createCircle = createCircle;
|
|
32287
32453
|
exports.createColor = createColor;
|
|
32288
32454
|
exports.createConicalGradient = createConicalGradient;
|
|
32455
|
+
exports.createEventTransformer = createEventTransformer;
|
|
32289
32456
|
exports.createGifImage = createGifImage;
|
|
32290
32457
|
exports.createGlyph = createGlyph;
|
|
32291
32458
|
exports.createGroup = createGroup;
|
|
@@ -32445,6 +32612,7 @@
|
|
|
32445
32612
|
exports.lottieCanvasPickModule = lottieCanvasPickModule;
|
|
32446
32613
|
exports.lottieModule = lottieModule;
|
|
32447
32614
|
exports.lynxEnvModule = lynxEnvModule;
|
|
32615
|
+
exports.mapToCanvasPointForCanvas = mapToCanvasPointForCanvas;
|
|
32448
32616
|
exports.mat3Tomat4 = mat3Tomat4;
|
|
32449
32617
|
exports.mat4Allocate = mat4Allocate;
|
|
32450
32618
|
exports.matrixAllocate = matrixAllocate;
|
|
@@ -32504,6 +32672,7 @@
|
|
|
32504
32672
|
exports.registerFlexLayoutPlugin = registerFlexLayoutPlugin;
|
|
32505
32673
|
exports.registerGifGraphic = registerGifGraphic;
|
|
32506
32674
|
exports.registerGifImage = registerGifImage;
|
|
32675
|
+
exports.registerGlobalEventTransformer = registerGlobalEventTransformer;
|
|
32507
32676
|
exports.registerGlyph = registerGlyph;
|
|
32508
32677
|
exports.registerGlyphGraphic = registerGlyphGraphic;
|
|
32509
32678
|
exports.registerGroup = registerGroup;
|
|
@@ -32536,6 +32705,7 @@
|
|
|
32536
32705
|
exports.registerText = registerText;
|
|
32537
32706
|
exports.registerTextGraphic = registerTextGraphic;
|
|
32538
32707
|
exports.registerViewTransform3dPlugin = registerViewTransform3dPlugin;
|
|
32708
|
+
exports.registerWindowEventTransformer = registerWindowEventTransformer;
|
|
32539
32709
|
exports.registerWrapText = registerWrapText;
|
|
32540
32710
|
exports.registerWrapTextGraphic = registerWrapTextGraphic;
|
|
32541
32711
|
exports.renderCommandList = renderCommandList;
|
|
@@ -32586,6 +32756,7 @@
|
|
|
32586
32756
|
exports.textModule = textModule;
|
|
32587
32757
|
exports.transformKeys = transformKeys;
|
|
32588
32758
|
exports.transformMat4 = transformMat4;
|
|
32759
|
+
exports.transformPointForCanvas = transformPointForCanvas;
|
|
32589
32760
|
exports.transformUtil = transformUtil;
|
|
32590
32761
|
exports.translate = translate;
|
|
32591
32762
|
exports.ttEnvModule = ttEnvModule;
|