@visactor/vrender 1.1.0-alpha.23 → 1.1.0-alpha.25
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/entries/bootstrap-browser-lite.d.ts +2 -0
- package/cjs/entries/bootstrap-browser-lite.js +27 -0
- package/cjs/entries/bootstrap-browser-lite.js.map +1 -0
- package/cjs/entries/bootstrap-browser.d.ts +2 -0
- package/cjs/entries/bootstrap-browser.js +19 -0
- package/cjs/entries/bootstrap-browser.js.map +1 -0
- package/cjs/entries/bootstrap-common.d.ts +3 -0
- package/cjs/entries/bootstrap-common.js +44 -0
- package/cjs/entries/bootstrap-common.js.map +1 -0
- package/cjs/entries/bootstrap-utils.d.ts +7 -0
- package/cjs/entries/bootstrap-utils.js +44 -0
- package/cjs/entries/bootstrap-utils.js.map +1 -0
- package/cjs/entries/bootstrap.js +33 -86
- package/cjs/entries/bootstrap.js.map +1 -1
- package/cjs/entries/browser.js +3 -26
- package/cjs/entries/browser.js.map +1 -1
- package/cjs/entries/shared-browser-lite.d.ts +12 -0
- package/cjs/entries/shared-browser-lite.js +31 -0
- package/cjs/entries/shared-browser-lite.js.map +1 -0
- package/cjs/entries/shared-browser.d.ts +12 -0
- package/cjs/entries/shared-browser.js +30 -0
- package/cjs/entries/shared-browser.js.map +1 -0
- package/cjs/entries/shared-registry.d.ts +16 -0
- package/cjs/entries/shared-registry.js +87 -0
- package/cjs/entries/shared-registry.js.map +1 -0
- package/cjs/entries/shared.d.ts +3 -7
- package/cjs/entries/shared.js +6 -69
- package/cjs/entries/shared.js.map +1 -1
- 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 +507 -1523
- package/dist/index.js +508 -1524
- package/dist/index.min.js +1 -1
- package/es/entries/bootstrap-browser-lite.d.ts +2 -0
- package/es/entries/bootstrap-browser-lite.js +51 -0
- package/es/entries/bootstrap-browser-lite.js.map +1 -0
- package/es/entries/bootstrap-browser.d.ts +2 -0
- package/es/entries/bootstrap-browser.js +15 -0
- package/es/entries/bootstrap-browser.js.map +1 -0
- package/es/entries/bootstrap-common.d.ts +3 -0
- package/es/entries/bootstrap-common.js +58 -0
- package/es/entries/bootstrap-common.js.map +1 -0
- package/es/entries/bootstrap-utils.d.ts +7 -0
- package/es/entries/bootstrap-utils.js +38 -0
- package/es/entries/bootstrap-utils.js.map +1 -0
- package/es/entries/bootstrap.js +78 -50
- package/es/entries/bootstrap.js.map +1 -1
- package/es/entries/browser.js +1 -3
- package/es/entries/browser.js.map +1 -1
- package/es/entries/shared-browser-lite.d.ts +12 -0
- package/es/entries/shared-browser-lite.js +28 -0
- package/es/entries/shared-browser-lite.js.map +1 -0
- package/es/entries/shared-browser.d.ts +12 -0
- package/es/entries/shared-browser.js +28 -0
- package/es/entries/shared-browser.js.map +1 -0
- package/es/entries/shared-registry.d.ts +16 -0
- package/es/entries/shared-registry.js +79 -0
- package/es/entries/shared-registry.js.map +1 -0
- package/es/entries/shared.d.ts +3 -7
- package/es/entries/shared.js +6 -69
- package/es/entries/shared.js.map +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 +56 -7
package/dist/index.js
CHANGED
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
var __awaiter$
|
|
172
|
+
var __awaiter$7 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
173
173
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
174
174
|
function fulfilled(value) {
|
|
175
175
|
try {
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
return this._env || this.setEnv("browser"), this.envContribution.loadBlob(url);
|
|
339
339
|
}
|
|
340
340
|
loadFont(name, source, descriptors) {
|
|
341
|
-
return __awaiter$
|
|
341
|
+
return __awaiter$7(this, void 0, void 0, function* () {
|
|
342
342
|
return this._env || this.setEnv("browser"), this.envContribution.loadFont(name, source, descriptors);
|
|
343
343
|
});
|
|
344
344
|
}
|
|
@@ -724,14 +724,14 @@
|
|
|
724
724
|
const isObjectLike = value => "object" == typeof value && null !== value;
|
|
725
725
|
var isObjectLike$1 = isObjectLike;
|
|
726
726
|
|
|
727
|
-
const isPlainObject$
|
|
727
|
+
const isPlainObject$2 = function (value) {
|
|
728
728
|
if (!isObjectLike$1(value) || !isType$1(value, "Object")) return !1;
|
|
729
729
|
if (null === Object.getPrototypeOf(value)) return !0;
|
|
730
730
|
let proto = value;
|
|
731
731
|
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
732
732
|
return Object.getPrototypeOf(value) === proto;
|
|
733
733
|
};
|
|
734
|
-
var isPlainObject$
|
|
734
|
+
var isPlainObject$3 = isPlainObject$2;
|
|
735
735
|
|
|
736
736
|
const isUndefined = value => void 0 === value;
|
|
737
737
|
var isUndefined$1 = isUndefined;
|
|
@@ -846,7 +846,7 @@
|
|
|
846
846
|
const length = objValue.length;
|
|
847
847
|
for (; ++index < length;) newValue[index] = objValue[index];
|
|
848
848
|
}
|
|
849
|
-
} else isPlainObject$
|
|
849
|
+
} else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
850
850
|
isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
|
|
851
851
|
}
|
|
852
852
|
function assignMergeValue(target, key, value) {
|
|
@@ -883,7 +883,7 @@
|
|
|
883
883
|
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
884
884
|
return !0;
|
|
885
885
|
}
|
|
886
|
-
if (!isPlainObject$
|
|
886
|
+
if (!isPlainObject$3(a)) return !1;
|
|
887
887
|
const ka = objectKeys(a),
|
|
888
888
|
kb = objectKeys(b);
|
|
889
889
|
if (ka.length !== kb.length) return !1;
|
|
@@ -2668,7 +2668,7 @@
|
|
|
2668
2668
|
};
|
|
2669
2669
|
const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
2670
2670
|
|
|
2671
|
-
var __awaiter$
|
|
2671
|
+
var __awaiter$6 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
2672
2672
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2673
2673
|
function fulfilled(value) {
|
|
2674
2674
|
try {
|
|
@@ -2718,6 +2718,7 @@
|
|
|
2718
2718
|
constructor() {
|
|
2719
2719
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
2720
2720
|
}
|
|
2721
|
+
onParentSharedStateTreeChanged(_stage, _layer) {}
|
|
2721
2722
|
forEachChildren(cb, reverse = !1) {
|
|
2722
2723
|
if (reverse) {
|
|
2723
2724
|
let child = this._lastChild,
|
|
@@ -2736,7 +2737,7 @@
|
|
|
2736
2737
|
}
|
|
2737
2738
|
}
|
|
2738
2739
|
forEachChildrenAsync(cb, reverse = !1) {
|
|
2739
|
-
return __awaiter$
|
|
2740
|
+
return __awaiter$6(this, void 0, void 0, function* () {
|
|
2740
2741
|
if (reverse) {
|
|
2741
2742
|
let child = this._lastChild,
|
|
2742
2743
|
i = 0;
|
|
@@ -5202,6 +5203,7 @@
|
|
|
5202
5203
|
cornerRadius: 0,
|
|
5203
5204
|
padRadius: 0,
|
|
5204
5205
|
padAngle: 0,
|
|
5206
|
+
clipRange: 1,
|
|
5205
5207
|
cap: !1,
|
|
5206
5208
|
forceShowCap: !1
|
|
5207
5209
|
});
|
|
@@ -6292,7 +6294,7 @@
|
|
|
6292
6294
|
return str.startsWith("<");
|
|
6293
6295
|
}
|
|
6294
6296
|
|
|
6295
|
-
var __awaiter$
|
|
6297
|
+
var __awaiter$5 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
6296
6298
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6297
6299
|
function fulfilled(value) {
|
|
6298
6300
|
try {
|
|
@@ -6321,7 +6323,7 @@
|
|
|
6321
6323
|
group.incrementalAppendChild(graphic);
|
|
6322
6324
|
}
|
|
6323
6325
|
function waitForAllSubLayers(stage) {
|
|
6324
|
-
return __awaiter$
|
|
6326
|
+
return __awaiter$5(this, void 0, void 0, function* () {
|
|
6325
6327
|
const promiseList = [],
|
|
6326
6328
|
layers = stage.getChildren();
|
|
6327
6329
|
yield new Promise(resolve => {
|
|
@@ -7903,8 +7905,8 @@
|
|
|
7903
7905
|
return conicalCanvas.width = imageData.width, conicalCanvas.height = imageData.height, conicalCtx.putImageData(imageData, 0, 0), pattern = context.createPattern(conicalCanvas, "no-repeat"), pattern && ConicalPatternStore.Set(stops, x, y, startAngle, endAngle, pattern, width, height), pattern;
|
|
7904
7906
|
}
|
|
7905
7907
|
|
|
7906
|
-
const FULL_DEFINITION_KEYS
|
|
7907
|
-
function isPlainObject$
|
|
7908
|
+
const FULL_DEFINITION_KEYS = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]);
|
|
7909
|
+
function isPlainObject$1(value) {
|
|
7908
7910
|
return null != value && "object" == typeof value && !Array.isArray(value);
|
|
7909
7911
|
}
|
|
7910
7912
|
function normalizePatch(value) {
|
|
@@ -7950,12 +7952,11 @@
|
|
|
7950
7952
|
priority: 0,
|
|
7951
7953
|
patch: void 0
|
|
7952
7954
|
};
|
|
7953
|
-
if ((isPlainObject$
|
|
7955
|
+
if ((isPlainObject$1(value) ? Object.keys(value) : []).some(key => FULL_DEFINITION_KEYS.has(key))) {
|
|
7954
7956
|
const definition = value;
|
|
7955
7957
|
return {
|
|
7956
7958
|
name: null !== (_a = definition.name) && void 0 !== _a ? _a : name,
|
|
7957
7959
|
priority: null !== (_b = definition.priority) && void 0 !== _b ? _b : 0,
|
|
7958
|
-
rank: definition.rank,
|
|
7959
7960
|
patch: normalizePatch(definition.patch),
|
|
7960
7961
|
resolver: definition.resolver,
|
|
7961
7962
|
declaredAffectedKeys: definition.declaredAffectedKeys,
|
|
@@ -7975,281 +7976,40 @@
|
|
|
7975
7976
|
rawRelationMap.set(name, new Set(definition[relation]));
|
|
7976
7977
|
}), compiled.forEach((definition, origin) => {
|
|
7977
7978
|
const closure = new Set(),
|
|
7978
|
-
walk = (stateName,
|
|
7979
|
+
walk = (stateName, visiting) => {
|
|
7979
7980
|
const nextStates = rawRelationMap.get(stateName);
|
|
7980
7981
|
nextStates && nextStates.size && nextStates.forEach(nextState => {
|
|
7981
|
-
nextState
|
|
7982
|
+
nextState === origin || visiting.has(nextState) || closure.has(nextState) || (closure.add(nextState), visiting.add(nextState), walk(nextState, visiting), visiting.delete(nextState));
|
|
7982
7983
|
});
|
|
7983
7984
|
};
|
|
7984
|
-
walk(origin, [origin]), definition[relation] = closure;
|
|
7985
|
+
walk(origin, new Set([origin])), definition[relation] = closure;
|
|
7985
7986
|
});
|
|
7986
7987
|
}
|
|
7987
7988
|
}
|
|
7988
7989
|
|
|
7989
|
-
|
|
7990
|
-
!function (UpdateCategory) {
|
|
7991
|
-
UpdateCategory[UpdateCategory.NONE = 0] = "NONE", UpdateCategory[UpdateCategory.PAINT = 1] = "PAINT", UpdateCategory[UpdateCategory.SHAPE = 2] = "SHAPE", UpdateCategory[UpdateCategory.BOUNDS = 4] = "BOUNDS", UpdateCategory[UpdateCategory.TRANSFORM = 8] = "TRANSFORM", UpdateCategory[UpdateCategory.LAYOUT = 16] = "LAYOUT", UpdateCategory[UpdateCategory.PICK = 32] = "PICK";
|
|
7992
|
-
}(UpdateCategory || (UpdateCategory = {}));
|
|
7993
|
-
const ATTRIBUTE_CATEGORY = {
|
|
7994
|
-
fill: UpdateCategory.PAINT,
|
|
7995
|
-
opacity: UpdateCategory.PAINT,
|
|
7996
|
-
fillOpacity: UpdateCategory.PAINT,
|
|
7997
|
-
strokeOpacity: UpdateCategory.PAINT,
|
|
7998
|
-
lineDash: UpdateCategory.PAINT,
|
|
7999
|
-
lineDashOffset: UpdateCategory.PAINT,
|
|
8000
|
-
lineCap: UpdateCategory.PAINT,
|
|
8001
|
-
lineJoin: UpdateCategory.PAINT,
|
|
8002
|
-
miterLimit: UpdateCategory.PAINT,
|
|
8003
|
-
shadowColor: UpdateCategory.PAINT,
|
|
8004
|
-
x: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8005
|
-
y: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8006
|
-
scaleX: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8007
|
-
scaleY: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8008
|
-
angle: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8009
|
-
anchor: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8010
|
-
anchor3d: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8011
|
-
postMatrix: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8012
|
-
layout: UpdateCategory.LAYOUT,
|
|
8013
|
-
zIndex: UpdateCategory.PAINT,
|
|
8014
|
-
visible: UpdateCategory.PAINT | UpdateCategory.PICK,
|
|
8015
|
-
lineWidth: UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.PICK,
|
|
8016
|
-
width: UpdateCategory.SHAPE | UpdateCategory.BOUNDS,
|
|
8017
|
-
height: UpdateCategory.SHAPE | UpdateCategory.BOUNDS
|
|
8018
|
-
};
|
|
8019
|
-
const ATTRIBUTE_DELTA_CLASSIFIER = {
|
|
8020
|
-
stroke: (prev, next) => (null != prev && !1 !== prev) !== (null != next && !1 !== next) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK : UpdateCategory.PAINT,
|
|
8021
|
-
shadowBlur: (prev, next) => {
|
|
8022
|
-
const prevBlur = Number(null != prev ? prev : 0),
|
|
8023
|
-
nextBlur = Number(null != next ? next : 0);
|
|
8024
|
-
return prevBlur !== nextBlur && (prevBlur > 0 || nextBlur > 0) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS : UpdateCategory.PAINT;
|
|
8025
|
-
}
|
|
8026
|
-
};
|
|
8027
|
-
function classifyAttributeDelta(key, prev, next) {
|
|
8028
|
-
var _a;
|
|
8029
|
-
const dynamicClassifier = ATTRIBUTE_DELTA_CLASSIFIER[key];
|
|
8030
|
-
return dynamicClassifier ? dynamicClassifier(prev, next) : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
|
|
8031
|
-
}
|
|
8032
|
-
function classifyAffectedKeyConservatively(key) {
|
|
8033
|
-
var _a;
|
|
8034
|
-
return "stroke" === key ? UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK : "shadowBlur" === key ? UpdateCategory.PAINT | UpdateCategory.BOUNDS : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
|
|
8035
|
-
}
|
|
8036
|
-
function classifyAffectedKeys(keys) {
|
|
8037
|
-
let category = UpdateCategory.NONE;
|
|
8038
|
-
for (const key of keys) category |= classifyAffectedKeyConservatively(key);
|
|
8039
|
-
return category;
|
|
8040
|
-
}
|
|
8041
|
-
|
|
8042
|
-
const STAGE_PERF_MONITOR = Symbol("vrender.statePerfMonitor");
|
|
8043
|
-
function createReasonBreakdown() {
|
|
8044
|
-
return {
|
|
8045
|
-
config_disabled: 0,
|
|
8046
|
-
context_disabled: 0,
|
|
8047
|
-
non_batch_operation: 0,
|
|
8048
|
-
mixed_update_category: 0,
|
|
8049
|
-
resolver_unstable_keys: 0,
|
|
8050
|
-
graphic_unavailable: 0
|
|
8051
|
-
};
|
|
8052
|
-
}
|
|
8053
|
-
function createEmptyStatePerfSnapshot() {
|
|
8054
|
-
return {
|
|
8055
|
-
counters: {
|
|
8056
|
-
stateCommits: 0,
|
|
8057
|
-
sharedRefreshCommits: 0,
|
|
8058
|
-
deferredJobsCreated: 0,
|
|
8059
|
-
deferredJobsCompleted: 0,
|
|
8060
|
-
deferredJobsCancelled: 0,
|
|
8061
|
-
deferredJobsCoalesced: 0,
|
|
8062
|
-
deferredGraphicsCommitted: 0,
|
|
8063
|
-
deferredBudgetYields: 0,
|
|
8064
|
-
deferredIneligibleGraphics: 0
|
|
8065
|
-
},
|
|
8066
|
-
deferredIneligibleByReason: createReasonBreakdown(),
|
|
8067
|
-
categoryBreakdown: {
|
|
8068
|
-
paint: 0,
|
|
8069
|
-
transform: 0,
|
|
8070
|
-
shape: 0,
|
|
8071
|
-
bounds: 0,
|
|
8072
|
-
layout: 0,
|
|
8073
|
-
pick: 0
|
|
8074
|
-
},
|
|
8075
|
-
refresh: {
|
|
8076
|
-
queuedGraphics: 0,
|
|
8077
|
-
flushedGraphics: 0,
|
|
8078
|
-
ensureFreshCalls: 0,
|
|
8079
|
-
renderScheduled: 0
|
|
8080
|
-
},
|
|
8081
|
-
resolver: {
|
|
8082
|
-
cacheHits: 0,
|
|
8083
|
-
cacheMisses: 0,
|
|
8084
|
-
invalidations: 0
|
|
8085
|
-
},
|
|
8086
|
-
cost: {
|
|
8087
|
-
resolverTotalMs: 0,
|
|
8088
|
-
resolverMaxMs: 0,
|
|
8089
|
-
patchTotalMs: 0,
|
|
8090
|
-
patchMaxMs: 0,
|
|
8091
|
-
sharedRefreshTotalMs: 0,
|
|
8092
|
-
sharedRefreshMaxMs: 0,
|
|
8093
|
-
batchSliceTotalMs: 0,
|
|
8094
|
-
batchSliceMaxMs: 0
|
|
8095
|
-
},
|
|
8096
|
-
allocationHints: {
|
|
8097
|
-
patchObjectsCreated: 0,
|
|
8098
|
-
batchEntriesCreated: 0,
|
|
8099
|
-
refreshQueuePushes: 0
|
|
8100
|
-
},
|
|
8101
|
-
batch: {
|
|
8102
|
-
pendingJobs: 0,
|
|
8103
|
-
maxPendingJobs: 0,
|
|
8104
|
-
maxGraphicsInJob: 0,
|
|
8105
|
-
maxFrameSliceCost: 0
|
|
8106
|
-
},
|
|
8107
|
-
events: []
|
|
8108
|
-
};
|
|
8109
|
-
}
|
|
8110
|
-
function cloneSnapshot(snapshot) {
|
|
8111
|
-
return {
|
|
8112
|
-
counters: Object.assign({}, snapshot.counters),
|
|
8113
|
-
deferredIneligibleByReason: Object.assign({}, snapshot.deferredIneligibleByReason),
|
|
8114
|
-
categoryBreakdown: Object.assign({}, snapshot.categoryBreakdown),
|
|
8115
|
-
refresh: Object.assign({}, snapshot.refresh),
|
|
8116
|
-
resolver: Object.assign({}, snapshot.resolver),
|
|
8117
|
-
cost: Object.assign({}, snapshot.cost),
|
|
8118
|
-
allocationHints: Object.assign({}, snapshot.allocationHints),
|
|
8119
|
-
batch: Object.assign({}, snapshot.batch),
|
|
8120
|
-
events: snapshot.events ? snapshot.events.slice() : []
|
|
8121
|
-
};
|
|
8122
|
-
}
|
|
8123
|
-
function isDeferredStateContextConfig(value) {
|
|
8124
|
-
return !!value && (Object.prototype.hasOwnProperty.call(value, "deferred") || Object.prototype.hasOwnProperty.call(value, "localEnabled"));
|
|
8125
|
-
}
|
|
8126
|
-
function normalizeDeferredStateOwnerConfig(value) {
|
|
8127
|
-
if (value) return isDeferredStateContextConfig(value) ? value : {
|
|
8128
|
-
deferred: value
|
|
8129
|
-
};
|
|
8130
|
-
}
|
|
8131
|
-
function normalizeDeferredStateConfig(config) {
|
|
8132
|
-
var _a, _b, _c;
|
|
8133
|
-
return {
|
|
8134
|
-
enabled: null !== (_a = null == config ? void 0 : config.enabled) && void 0 !== _a && _a,
|
|
8135
|
-
frameBudget: null !== (_b = null == config ? void 0 : config.frameBudget) && void 0 !== _b ? _b : 8,
|
|
8136
|
-
maxGraphicsPerFrame: null !== (_c = null == config ? void 0 : config.maxGraphicsPerFrame) && void 0 !== _c ? _c : 100
|
|
8137
|
-
};
|
|
8138
|
-
}
|
|
8139
|
-
function fingerprintDeferredStateConfig(config) {
|
|
8140
|
-
return `${config.enabled ? 1 : 0}:${config.frameBudget}:${config.maxGraphicsPerFrame}`;
|
|
8141
|
-
}
|
|
8142
|
-
class StatePerfMonitor {
|
|
8143
|
-
constructor(configSource) {
|
|
8144
|
-
this.configSource = configSource, this.snapshot = createEmptyStatePerfSnapshot();
|
|
8145
|
-
}
|
|
8146
|
-
setConfig(config) {
|
|
8147
|
-
this.configSource = config;
|
|
8148
|
-
}
|
|
8149
|
-
getSnapshot() {
|
|
8150
|
-
return cloneSnapshot(this.snapshot);
|
|
8151
|
-
}
|
|
8152
|
-
reset() {
|
|
8153
|
-
const next = createEmptyStatePerfSnapshot();
|
|
8154
|
-
Object.assign(this.snapshot.counters, next.counters), Object.assign(this.snapshot.deferredIneligibleByReason, next.deferredIneligibleByReason), Object.assign(this.snapshot.categoryBreakdown, next.categoryBreakdown), Object.assign(this.snapshot.refresh, next.refresh), Object.assign(this.snapshot.resolver, next.resolver), Object.assign(this.snapshot.cost, next.cost), Object.assign(this.snapshot.allocationHints, next.allocationHints), Object.assign(this.snapshot.batch, next.batch), this.snapshot.events = [];
|
|
8155
|
-
}
|
|
8156
|
-
incrementCounter(key, delta = 1) {
|
|
8157
|
-
this.isEnabled() && (this.snapshot.counters[key] += delta);
|
|
8158
|
-
}
|
|
8159
|
-
recordDeferredIneligible(reason, delta = 1) {
|
|
8160
|
-
this.isEnabled() && (this.snapshot.deferredIneligibleByReason[reason] += delta, this.snapshot.counters.deferredIneligibleGraphics += delta, this.recordEvent("deferred-ineligible", {
|
|
8161
|
-
reason: reason,
|
|
8162
|
-
count: delta
|
|
8163
|
-
}));
|
|
8164
|
-
}
|
|
8165
|
-
recordCategory(category) {
|
|
8166
|
-
this.isEnabled() && (category & UpdateCategory.PAINT && (this.snapshot.categoryBreakdown.paint += 1), category & UpdateCategory.TRANSFORM && (this.snapshot.categoryBreakdown.transform += 1), category & UpdateCategory.SHAPE && (this.snapshot.categoryBreakdown.shape += 1), category & UpdateCategory.BOUNDS && (this.snapshot.categoryBreakdown.bounds += 1), category & UpdateCategory.LAYOUT && (this.snapshot.categoryBreakdown.layout += 1), category & UpdateCategory.PICK && (this.snapshot.categoryBreakdown.pick += 1));
|
|
8167
|
-
}
|
|
8168
|
-
recordRefresh(key, delta = 1) {
|
|
8169
|
-
this.isEnabled() && (this.snapshot.refresh[key] += delta);
|
|
8170
|
-
}
|
|
8171
|
-
recordResolver(key, delta = 1) {
|
|
8172
|
-
this.isEnabled() && (this.snapshot.resolver[key] += delta);
|
|
8173
|
-
}
|
|
8174
|
-
recordCost(kind, durationMs) {
|
|
8175
|
-
if (this.isEnabled()) {
|
|
8176
|
-
if ("resolver" === kind) return this.snapshot.cost.resolverTotalMs += durationMs, void (this.snapshot.cost.resolverMaxMs = Math.max(this.snapshot.cost.resolverMaxMs, durationMs));
|
|
8177
|
-
if ("patch" === kind) return this.snapshot.cost.patchTotalMs += durationMs, void (this.snapshot.cost.patchMaxMs = Math.max(this.snapshot.cost.patchMaxMs, durationMs));
|
|
8178
|
-
if ("sharedRefresh" === kind) return this.snapshot.cost.sharedRefreshTotalMs += durationMs, void (this.snapshot.cost.sharedRefreshMaxMs = Math.max(this.snapshot.cost.sharedRefreshMaxMs, durationMs));
|
|
8179
|
-
this.snapshot.cost.batchSliceTotalMs += durationMs, this.snapshot.cost.batchSliceMaxMs = Math.max(this.snapshot.cost.batchSliceMaxMs, durationMs), this.snapshot.batch.maxFrameSliceCost = Math.max(this.snapshot.batch.maxFrameSliceCost, durationMs);
|
|
8180
|
-
}
|
|
8181
|
-
}
|
|
8182
|
-
recordAllocation(key, delta = 1) {
|
|
8183
|
-
this.isEnabled() && (this.snapshot.allocationHints[key] += delta);
|
|
8184
|
-
}
|
|
8185
|
-
updateBatchPending(pendingJobs) {
|
|
8186
|
-
this.isEnabled() && (this.snapshot.batch.pendingJobs = pendingJobs, this.snapshot.batch.maxPendingJobs = Math.max(this.snapshot.batch.maxPendingJobs, pendingJobs));
|
|
8187
|
-
}
|
|
8188
|
-
updateMaxGraphicsInJob(count) {
|
|
8189
|
-
this.isEnabled() && (this.snapshot.batch.maxGraphicsInJob = Math.max(this.snapshot.batch.maxGraphicsInJob, count));
|
|
8190
|
-
}
|
|
8191
|
-
recordEvent(type, detail) {
|
|
8192
|
-
var _a, _b, _c;
|
|
8193
|
-
if (!this.shouldRecordEvents()) return;
|
|
8194
|
-
const events = null !== (_a = this.snapshot.events) && void 0 !== _a ? _a : this.snapshot.events = [];
|
|
8195
|
-
events.push({
|
|
8196
|
-
type: type,
|
|
8197
|
-
at: Date.now(),
|
|
8198
|
-
detail: detail
|
|
8199
|
-
});
|
|
8200
|
-
const max = null !== (_c = null === (_b = this.getConfig()) || void 0 === _b ? void 0 : _b.maxEventRecords) && void 0 !== _c ? _c : 100;
|
|
8201
|
-
events.length > max && events.splice(0, events.length - max);
|
|
8202
|
-
}
|
|
8203
|
-
isEnabled() {
|
|
8204
|
-
var _a;
|
|
8205
|
-
return !0 === (null === (_a = this.getConfig()) || void 0 === _a ? void 0 : _a.enabled);
|
|
8206
|
-
}
|
|
8207
|
-
shouldRecordEvents() {
|
|
8208
|
-
const config = this.getConfig();
|
|
8209
|
-
return !!(null == config ? void 0 : config.enabled) && !!config.recordEvents;
|
|
8210
|
-
}
|
|
8211
|
-
getConfig() {
|
|
8212
|
-
return "function" == typeof this.configSource ? this.configSource() : this.configSource;
|
|
8213
|
-
}
|
|
8214
|
-
}
|
|
8215
|
-
function ensureStageStatePerfMonitor(stage) {
|
|
8216
|
-
const stageAny = stage;
|
|
8217
|
-
return stageAny[STAGE_PERF_MONITOR] || (stageAny[STAGE_PERF_MONITOR] = new StatePerfMonitor(() => stage.statePerfConfig)), stageAny[STAGE_PERF_MONITOR];
|
|
8218
|
-
}
|
|
8219
|
-
function getStageStatePerfMonitor(stage) {
|
|
8220
|
-
if (stage) return stage[STAGE_PERF_MONITOR];
|
|
8221
|
-
}
|
|
8222
|
-
function getActiveStageStatePerfMonitor(stage) {
|
|
8223
|
-
var _a;
|
|
8224
|
-
if (!stage) return;
|
|
8225
|
-
const current = getStageStatePerfMonitor(stage);
|
|
8226
|
-
return current || (!0 === (null === (_a = stage.statePerfConfig) || void 0 === _a ? void 0 : _a.enabled) ? ensureStageStatePerfMonitor(stage) : void 0);
|
|
8227
|
-
}
|
|
8228
|
-
|
|
8229
|
-
function isPlainObject$1(value) {
|
|
7990
|
+
function isPlainObject(value) {
|
|
8230
7991
|
return null != value && "object" == typeof value && !Array.isArray(value);
|
|
8231
7992
|
}
|
|
8232
|
-
function cloneValue
|
|
8233
|
-
if (!isPlainObject
|
|
7993
|
+
function cloneValue(value) {
|
|
7994
|
+
if (!isPlainObject(value)) return value;
|
|
8234
7995
|
const clone = {};
|
|
8235
7996
|
return Object.keys(value).forEach(key => {
|
|
8236
|
-
clone[key] = cloneValue
|
|
7997
|
+
clone[key] = cloneValue(value[key]);
|
|
8237
7998
|
}), clone;
|
|
8238
7999
|
}
|
|
8239
|
-
function deepMerge
|
|
8000
|
+
function deepMerge(base, value) {
|
|
8240
8001
|
var _a;
|
|
8241
|
-
const result = null !== (_a = cloneValue
|
|
8002
|
+
const result = null !== (_a = cloneValue(base)) && void 0 !== _a ? _a : {};
|
|
8242
8003
|
return Object.keys(value).forEach(key => {
|
|
8243
8004
|
const nextValue = value[key],
|
|
8244
8005
|
previousValue = result[key];
|
|
8245
|
-
isPlainObject
|
|
8006
|
+
isPlainObject(previousValue) && isPlainObject(nextValue) ? result[key] = deepMerge(previousValue, nextValue) : result[key] = cloneValue(nextValue);
|
|
8246
8007
|
}), result;
|
|
8247
8008
|
}
|
|
8248
|
-
const FULL_DEFINITION_KEYS = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]);
|
|
8249
8009
|
class StateEngine {
|
|
8250
8010
|
constructor(options) {
|
|
8251
8011
|
var _a;
|
|
8252
|
-
this._activeStates = [], this._effectiveStates = [], this._suppressed = [], this._resolvedPatch = {}, this.resolverPatchCache = new Map(), this.resolverCacheKey = "", this.resolverCacheValid = !1, this.baseAttributes = {}, this.compiledDefinitions = options.compiledDefinitions, this.stateSort = options.stateSort, this.
|
|
8012
|
+
this._activeStates = [], this._effectiveStates = [], this._suppressed = [], this._resolvedPatch = {}, this.resolverPatchCache = new Map(), this.resolverCacheKey = "", this.resolverCacheValid = !1, this.baseAttributes = {}, this.compiledDefinitions = options.compiledDefinitions, this.stateSort = options.stateSort, this.mergeMode = null !== (_a = options.mergeMode) && void 0 !== _a ? _a : "shallow";
|
|
8253
8013
|
}
|
|
8254
8014
|
get activeStates() {
|
|
8255
8015
|
return this._activeStates;
|
|
@@ -8319,23 +8079,11 @@
|
|
|
8319
8079
|
};
|
|
8320
8080
|
}
|
|
8321
8081
|
invalidateResolverCache() {
|
|
8322
|
-
|
|
8323
|
-
this.resolverPatchCache.clear(), this.resolverCacheKey = "", this.resolverCacheValid = !1, null === (_b = getActiveStageStatePerfMonitor(null === (_a = this.graphic) || void 0 === _a ? void 0 : _a.stage)) || void 0 === _b || _b.recordResolver("invalidations");
|
|
8082
|
+
this.resolverPatchCache.clear(), this.resolverCacheKey = "", this.resolverCacheValid = !1;
|
|
8324
8083
|
}
|
|
8325
8084
|
hasState(stateName) {
|
|
8326
8085
|
return !!this._activeStates.length && (null == stateName || this._activeStates.includes(stateName));
|
|
8327
8086
|
}
|
|
8328
|
-
getCompatPatch(stateName) {
|
|
8329
|
-
var _a, _b, _c;
|
|
8330
|
-
const targetStates = this._activeStates.length ? this._activeStates : this._effectiveStates,
|
|
8331
|
-
canUseStateProxy = this.canUseStateProxy(stateName),
|
|
8332
|
-
proxyPatch = canUseStateProxy ? null === (_a = this.stateProxy) || void 0 === _a ? void 0 : _a.call(this, stateName, targetStates) : void 0;
|
|
8333
|
-
if (this.stateProxy && canUseStateProxy) return null != proxyPatch ? proxyPatch : void 0;
|
|
8334
|
-
const value = null === (_b = this.states) || void 0 === _b ? void 0 : _b[stateName];
|
|
8335
|
-
if (null == value) return;
|
|
8336
|
-
if (!isPlainObject$1(value)) return value;
|
|
8337
|
-
return Object.keys(value).some(key => FULL_DEFINITION_KEYS.has(key)) ? cloneValue$1(null !== (_c = value.patch) && void 0 !== _c ? _c : void 0) : value;
|
|
8338
|
-
}
|
|
8339
8087
|
sortStates(states) {
|
|
8340
8088
|
const withDefinition = [],
|
|
8341
8089
|
withoutDefinition = [];
|
|
@@ -8366,68 +8114,33 @@
|
|
|
8366
8114
|
};
|
|
8367
8115
|
}
|
|
8368
8116
|
recomputePatch(effectiveStates) {
|
|
8369
|
-
var _a;
|
|
8370
|
-
const perfMonitor = getActiveStageStatePerfMonitor(null === (_a = this.graphic) || void 0 === _a ? void 0 : _a.stage),
|
|
8371
|
-
patchStart = perfMonitor ? performance.now() : 0;
|
|
8372
|
-
let resolverCost = 0;
|
|
8373
8117
|
const cacheKey = effectiveStates.join(","),
|
|
8374
|
-
nextPatch = {}
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
const canUseStateProxy = this.canUseStateProxy(stateName),
|
|
8378
|
-
proxyPatch = canUseStateProxy ? null === (_a = this.stateProxy) || void 0 === _a ? void 0 : _a.call(this, stateName, effectiveStates) : void 0;
|
|
8379
|
-
if (this.stateProxy && canUseStateProxy) return void (null != proxyPatch && this.mergeInto(nextPatch, proxyPatch));
|
|
8380
|
-
const definition = this.compiledDefinitions.get(stateName);
|
|
8381
|
-
if (definition) {
|
|
8382
|
-
if (definition.patch && this.mergeInto(nextPatch, definition.patch), definition.hasResolver) {
|
|
8383
|
-
const cachedPatch = this.resolverPatchCache.get(stateName);
|
|
8384
|
-
cachedPatch && (null == perfMonitor || perfMonitor.recordResolver("cacheHits"), this.mergeInto(nextPatch, cachedPatch));
|
|
8385
|
-
}
|
|
8386
|
-
} else {
|
|
8387
|
-
const compatPatch = this.getCompatPatch(stateName);
|
|
8388
|
-
compatPatch && this.mergeInto(nextPatch, compatPatch);
|
|
8389
|
-
}
|
|
8390
|
-
}) : (this.resolverPatchCache.clear(), this.resolverCacheKey = cacheKey, effectiveStates.forEach(stateName => {
|
|
8118
|
+
nextPatch = {},
|
|
8119
|
+
useResolverCache = this.resolverCacheValid && this.resolverCacheKey === cacheKey;
|
|
8120
|
+
useResolverCache || (this.resolverPatchCache.clear(), this.resolverCacheKey = cacheKey), effectiveStates.forEach(stateName => {
|
|
8391
8121
|
var _a;
|
|
8392
|
-
const canUseStateProxy = this.canUseStateProxy(stateName),
|
|
8393
|
-
proxyPatch = canUseStateProxy ? null === (_a = this.stateProxy) || void 0 === _a ? void 0 : _a.call(this, stateName, effectiveStates) : void 0;
|
|
8394
|
-
if (this.stateProxy && canUseStateProxy) return void (null != proxyPatch && this.mergeInto(nextPatch, proxyPatch));
|
|
8395
8122
|
const definition = this.compiledDefinitions.get(stateName);
|
|
8396
|
-
if (definition) {
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
resolvedPatch: nextPatch
|
|
8406
|
-
});
|
|
8407
|
-
if (perfMonitor) {
|
|
8408
|
-
const duration = performance.now() - resolverStart;
|
|
8409
|
-
resolverCost += duration, perfMonitor.recordCost("resolver", duration);
|
|
8410
|
-
}
|
|
8411
|
-
resolverPatch && (this.resolverPatchCache.set(stateName, resolverPatch), this.mergeInto(nextPatch, resolverPatch));
|
|
8412
|
-
}
|
|
8413
|
-
} else {
|
|
8414
|
-
const compatPatch = this.getCompatPatch(stateName);
|
|
8415
|
-
compatPatch && this.mergeInto(nextPatch, compatPatch);
|
|
8123
|
+
if (definition && (definition.patch && this.mergeInto(nextPatch, definition.patch), definition.hasResolver)) {
|
|
8124
|
+
const resolverPatch = useResolverCache ? this.resolverPatchCache.get(stateName) : null === (_a = definition.resolver) || void 0 === _a ? void 0 : _a.call(definition, {
|
|
8125
|
+
graphic: this.graphic,
|
|
8126
|
+
activeStates: this._activeStates,
|
|
8127
|
+
effectiveStates: this._effectiveStates,
|
|
8128
|
+
baseAttributes: this.baseAttributes,
|
|
8129
|
+
resolvedPatch: nextPatch
|
|
8130
|
+
});
|
|
8131
|
+
resolverPatch && (useResolverCache || this.resolverPatchCache.set(stateName, resolverPatch), this.mergeInto(nextPatch, resolverPatch));
|
|
8416
8132
|
}
|
|
8417
|
-
}), this.resolverCacheValid = !0), this._resolvedPatch = nextPatch
|
|
8418
|
-
const totalCost = performance.now() - patchStart;
|
|
8419
|
-
perfMonitor.recordCost("patch", Math.max(0, totalCost - resolverCost));
|
|
8420
|
-
}
|
|
8133
|
+
}), useResolverCache || (this.resolverCacheValid = !0), this._resolvedPatch = nextPatch;
|
|
8421
8134
|
}
|
|
8422
8135
|
mergeInto(target, patch) {
|
|
8423
8136
|
"deep" !== this.mergeMode ? Object.keys(patch).forEach(key => {
|
|
8424
|
-
target[key] = cloneValue
|
|
8137
|
+
target[key] = cloneValue(patch[key]);
|
|
8425
8138
|
}) : Object.keys(patch).forEach(key => {
|
|
8426
8139
|
var _a;
|
|
8427
8140
|
const nextValue = patch[key],
|
|
8428
8141
|
previousValue = target[key],
|
|
8429
8142
|
baseValue = null === (_a = this.baseAttributes) || void 0 === _a ? void 0 : _a[key];
|
|
8430
|
-
isPlainObject
|
|
8143
|
+
isPlainObject(previousValue) && isPlainObject(nextValue) ? target[key] = deepMerge(previousValue, nextValue) : !isPlainObject(previousValue) && isPlainObject(baseValue) && isPlainObject(nextValue) ? target[key] = deepMerge(baseValue, nextValue) : target[key] = cloneValue(nextValue);
|
|
8431
8144
|
});
|
|
8432
8145
|
}
|
|
8433
8146
|
sameArray(left, right) {
|
|
@@ -8435,186 +8148,50 @@
|
|
|
8435
8148
|
for (let index = 0; index < left.length; index++) if (left[index] !== right[index]) return !1;
|
|
8436
8149
|
return !0;
|
|
8437
8150
|
}
|
|
8438
|
-
canUseStateProxy(stateName) {
|
|
8439
|
-
return !!this.stateProxy && (!this.stateProxyEligibility || this.stateProxyEligibility(stateName));
|
|
8440
|
-
}
|
|
8441
8151
|
}
|
|
8442
8152
|
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
clearStates() {
|
|
8480
|
-
if (this.stateEngine) {
|
|
8481
|
-
const result = this.stateEngine.clearStates();
|
|
8482
|
-
return this.currentStates = [], {
|
|
8483
|
-
changed: result.changed,
|
|
8484
|
-
states: [],
|
|
8485
|
-
effectiveStates: []
|
|
8486
|
-
};
|
|
8487
|
-
}
|
|
8488
|
-
const changed = this.hasState();
|
|
8489
|
-
return this.currentStates = [], {
|
|
8490
|
-
changed: changed,
|
|
8491
|
-
states: []
|
|
8492
|
-
};
|
|
8493
|
-
}
|
|
8494
|
-
addState(stateName, keepCurrentStates) {
|
|
8495
|
-
var _a;
|
|
8496
|
-
if (this.stateEngine) {
|
|
8497
|
-
const result = this.stateEngine.addState(stateName, keepCurrentStates);
|
|
8498
|
-
return this.currentStates = [...result.activeStates], {
|
|
8499
|
-
changed: result.changed,
|
|
8500
|
-
states: [...result.activeStates],
|
|
8501
|
-
effectiveStates: [...result.effectiveStates]
|
|
8502
|
-
};
|
|
8503
|
-
}
|
|
8504
|
-
if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
|
|
8505
|
-
changed: !1,
|
|
8506
|
-
states: this.getCurrentStates()
|
|
8507
|
-
};
|
|
8508
|
-
const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([stateName]) : [stateName];
|
|
8509
|
-
return this.useStates(nextStates);
|
|
8510
|
-
}
|
|
8511
|
-
removeState(stateName) {
|
|
8512
|
-
if (this.stateEngine) {
|
|
8513
|
-
const result = this.stateEngine.removeState(stateName);
|
|
8514
|
-
return this.currentStates = [...result.activeStates], {
|
|
8515
|
-
changed: result.changed,
|
|
8516
|
-
states: [...result.activeStates],
|
|
8517
|
-
effectiveStates: [...result.effectiveStates]
|
|
8518
|
-
};
|
|
8519
|
-
}
|
|
8520
|
-
if (!this.currentStates) return {
|
|
8521
|
-
changed: !1,
|
|
8522
|
-
states: []
|
|
8523
|
-
};
|
|
8524
|
-
const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName,
|
|
8525
|
-
nextStates = this.currentStates.filter(filter);
|
|
8526
|
-
return nextStates.length === this.currentStates.length ? {
|
|
8527
|
-
changed: !1,
|
|
8528
|
-
states: this.getCurrentStates()
|
|
8529
|
-
} : this.useStates(nextStates);
|
|
8530
|
-
}
|
|
8531
|
-
toggleState(stateName) {
|
|
8532
|
-
if (this.stateEngine) {
|
|
8533
|
-
const result = this.stateEngine.toggleState(stateName);
|
|
8534
|
-
return this.currentStates = [...result.activeStates], {
|
|
8535
|
-
changed: result.changed,
|
|
8536
|
-
states: [...result.activeStates],
|
|
8537
|
-
effectiveStates: [...result.effectiveStates]
|
|
8538
|
-
};
|
|
8539
|
-
}
|
|
8540
|
-
if (this.hasState(stateName)) return this.removeState(stateName);
|
|
8541
|
-
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
8542
|
-
return nextStates.includes(stateName) || nextStates.push(stateName), this.useStates(nextStates);
|
|
8543
|
-
}
|
|
8544
|
-
sortStates(states) {
|
|
8545
|
-
return this.stateEngine ? [...this.stateEngine.activeStates] : this.stateSort ? [...states].sort(this.stateSort) : [...states];
|
|
8546
|
-
}
|
|
8547
|
-
registerExclusiveGroup(groupName, states) {
|
|
8548
|
-
const uniqueStates = Array.from(new Set(states));
|
|
8549
|
-
this.exclusiveGroups.set(groupName, uniqueStates), uniqueStates.forEach(stateName => this.exclusiveGroupMap.set(stateName, groupName));
|
|
8550
|
-
}
|
|
8551
|
-
getExclusiveGroup(stateName) {
|
|
8552
|
-
return this.exclusiveGroupMap.get(stateName);
|
|
8553
|
-
}
|
|
8554
|
-
getMutuallyExclusiveStates(stateName) {
|
|
8555
|
-
var _a;
|
|
8556
|
-
const groupName = this.getExclusiveGroup(stateName);
|
|
8557
|
-
return groupName ? (null !== (_a = this.exclusiveGroups.get(groupName)) && void 0 !== _a ? _a : []).filter(name => name !== stateName) : [];
|
|
8558
|
-
}
|
|
8559
|
-
isMutuallyExclusive(stateA, stateB) {
|
|
8560
|
-
const groupName = this.getExclusiveGroup(stateA);
|
|
8561
|
-
return !!groupName && groupName === this.getExclusiveGroup(stateB) && stateA !== stateB;
|
|
8562
|
-
}
|
|
8563
|
-
get effectiveStates() {
|
|
8564
|
-
var _a, _b, _c;
|
|
8565
|
-
return null !== (_c = null !== (_b = null === (_a = this.stateEngine) || void 0 === _a ? void 0 : _a.effectiveStates) && void 0 !== _b ? _b : this.currentStates) && void 0 !== _c ? _c : [];
|
|
8566
|
-
}
|
|
8567
|
-
get resolvedPatch() {
|
|
8568
|
-
var _a;
|
|
8569
|
-
return null === (_a = this.stateEngine) || void 0 === _a ? void 0 : _a.resolvedPatch;
|
|
8570
|
-
}
|
|
8571
|
-
sameStates(left, right) {
|
|
8572
|
-
if (left.length !== right.length) return !1;
|
|
8573
|
-
for (let index = 0; index < left.length; index++) if (left[index] !== right[index]) return !1;
|
|
8574
|
-
return !0;
|
|
8575
|
-
}
|
|
8576
|
-
}
|
|
8577
|
-
|
|
8578
|
-
function isPlainObject(value) {
|
|
8579
|
-
return null != value && "object" == typeof value && !Array.isArray(value);
|
|
8580
|
-
}
|
|
8581
|
-
function cloneValue(value) {
|
|
8582
|
-
if (!isPlainObject(value)) return value;
|
|
8583
|
-
const clone = {};
|
|
8584
|
-
for (const key in value) Object.prototype.hasOwnProperty.call(value, key) && (clone[key] = cloneValue(value[key]));
|
|
8585
|
-
return clone;
|
|
8586
|
-
}
|
|
8587
|
-
function deepMerge(base, value) {
|
|
8588
|
-
const result = cloneValue(base) || {};
|
|
8589
|
-
for (const key in value) {
|
|
8590
|
-
if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
|
|
8591
|
-
const nextValue = value[key],
|
|
8592
|
-
previousValue = result[key];
|
|
8593
|
-
isPlainObject(previousValue) && isPlainObject(nextValue) ? result[key] = deepMerge(previousValue, nextValue) : result[key] = cloneValue(nextValue);
|
|
8594
|
-
}
|
|
8595
|
-
return result;
|
|
8596
|
-
}
|
|
8597
|
-
class StateStyleResolver {
|
|
8598
|
-
constructor(options = {}) {
|
|
8599
|
-
this.options = options;
|
|
8600
|
-
}
|
|
8601
|
-
resolve(normalAttrs, states, stateProxy, currentStates, stateSort) {
|
|
8602
|
-
var _a;
|
|
8603
|
-
const mergeMode = null !== (_a = this.options.mergeMode) && void 0 !== _a ? _a : "shallow",
|
|
8604
|
-
sortedStates = stateSort ? currentStates.slice().sort(stateSort) : currentStates.slice(),
|
|
8605
|
-
resolvedAttrs = {};
|
|
8606
|
-
return sortedStates.forEach(stateName => {
|
|
8607
|
-
const attrs = stateProxy ? stateProxy(stateName, sortedStates) : null == states ? void 0 : states[stateName];
|
|
8608
|
-
if (null != attrs) for (const key in attrs) {
|
|
8609
|
-
if (!Object.prototype.hasOwnProperty.call(attrs, key)) continue;
|
|
8610
|
-
const nextValue = attrs[key];
|
|
8611
|
-
if ("deep" === mergeMode && isPlainObject(nextValue) && (isPlainObject(resolvedAttrs[key]) || isPlainObject(normalAttrs[key]))) {
|
|
8612
|
-
const baseValue = isPlainObject(resolvedAttrs[key]) ? resolvedAttrs[key] : isPlainObject(normalAttrs[key]) ? normalAttrs[key] : {};
|
|
8613
|
-
resolvedAttrs[key] = deepMerge(baseValue, nextValue);
|
|
8614
|
-
} else resolvedAttrs[key] = cloneValue(nextValue);
|
|
8615
|
-
}
|
|
8616
|
-
}), resolvedAttrs;
|
|
8153
|
+
var UpdateCategory;
|
|
8154
|
+
!function (UpdateCategory) {
|
|
8155
|
+
UpdateCategory[UpdateCategory.NONE = 0] = "NONE", UpdateCategory[UpdateCategory.PAINT = 1] = "PAINT", UpdateCategory[UpdateCategory.SHAPE = 2] = "SHAPE", UpdateCategory[UpdateCategory.BOUNDS = 4] = "BOUNDS", UpdateCategory[UpdateCategory.TRANSFORM = 8] = "TRANSFORM", UpdateCategory[UpdateCategory.LAYOUT = 16] = "LAYOUT", UpdateCategory[UpdateCategory.PICK = 32] = "PICK";
|
|
8156
|
+
}(UpdateCategory || (UpdateCategory = {}));
|
|
8157
|
+
const ATTRIBUTE_CATEGORY = {
|
|
8158
|
+
fill: UpdateCategory.PAINT,
|
|
8159
|
+
opacity: UpdateCategory.PAINT,
|
|
8160
|
+
fillOpacity: UpdateCategory.PAINT,
|
|
8161
|
+
strokeOpacity: UpdateCategory.PAINT,
|
|
8162
|
+
lineDash: UpdateCategory.PAINT,
|
|
8163
|
+
lineDashOffset: UpdateCategory.PAINT,
|
|
8164
|
+
lineCap: UpdateCategory.PAINT,
|
|
8165
|
+
lineJoin: UpdateCategory.PAINT,
|
|
8166
|
+
miterLimit: UpdateCategory.PAINT,
|
|
8167
|
+
shadowColor: UpdateCategory.PAINT,
|
|
8168
|
+
x: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8169
|
+
y: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8170
|
+
scaleX: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8171
|
+
scaleY: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8172
|
+
angle: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8173
|
+
anchor: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8174
|
+
anchor3d: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8175
|
+
postMatrix: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
8176
|
+
layout: UpdateCategory.LAYOUT,
|
|
8177
|
+
zIndex: UpdateCategory.PAINT,
|
|
8178
|
+
visible: UpdateCategory.PAINT | UpdateCategory.PICK,
|
|
8179
|
+
lineWidth: UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.PICK,
|
|
8180
|
+
width: UpdateCategory.SHAPE | UpdateCategory.BOUNDS,
|
|
8181
|
+
height: UpdateCategory.SHAPE | UpdateCategory.BOUNDS
|
|
8182
|
+
};
|
|
8183
|
+
const ATTRIBUTE_DELTA_CLASSIFIER = {
|
|
8184
|
+
stroke: (prev, next) => (null != prev && !1 !== prev) !== (null != next && !1 !== next) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK : UpdateCategory.PAINT,
|
|
8185
|
+
shadowBlur: (prev, next) => {
|
|
8186
|
+
const prevBlur = Number(null != prev ? prev : 0),
|
|
8187
|
+
nextBlur = Number(null != next ? next : 0);
|
|
8188
|
+
return prevBlur !== nextBlur && (prevBlur > 0 || nextBlur > 0) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS : UpdateCategory.PAINT;
|
|
8617
8189
|
}
|
|
8190
|
+
};
|
|
8191
|
+
function classifyAttributeDelta(key, prev, next) {
|
|
8192
|
+
var _a;
|
|
8193
|
+
const dynamicClassifier = ATTRIBUTE_DELTA_CLASSIFIER[key];
|
|
8194
|
+
return dynamicClassifier ? dynamicClassifier(prev, next) : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
|
|
8618
8195
|
}
|
|
8619
8196
|
|
|
8620
8197
|
function hasOwnKeys(value) {
|
|
@@ -8624,25 +8201,22 @@
|
|
|
8624
8201
|
return config ? Array.isArray(config) ? config.reduce((acc, key) => (acc[key] = 1, acc), {}) : Object.keys(config).reduce((acc, key) => (config[key] && (acc[key] = 1), acc), {}) : {};
|
|
8625
8202
|
}
|
|
8626
8203
|
class StateTransitionOrchestrator {
|
|
8627
|
-
analyzeTransition(
|
|
8204
|
+
analyzeTransition(targetAttrs, hasAnimation, options = {}) {
|
|
8628
8205
|
var _a, _b;
|
|
8629
8206
|
const plan = {
|
|
8630
|
-
stateNames: stateNames,
|
|
8631
8207
|
targetAttrs: Object.assign({}, targetAttrs),
|
|
8632
8208
|
animateAttrs: {},
|
|
8633
|
-
jumpAttrs: {},
|
|
8634
8209
|
noAnimateAttrs: {}
|
|
8635
8210
|
};
|
|
8636
8211
|
if (!hasAnimation) return plan;
|
|
8637
8212
|
const noWorkAnimateAttr = Object.assign(Object.assign({}, null !== (_a = options.noWorkAnimateAttr) && void 0 !== _a ? _a : {}), normalizeNoAnimateAttrConfig(null === (_b = options.animateConfig) || void 0 === _b ? void 0 : _b.noAnimateAttrs)),
|
|
8638
8213
|
isClear = !0 === options.isClear,
|
|
8639
|
-
|
|
8214
|
+
readDefaultAttribute = options.getDefaultAttribute,
|
|
8640
8215
|
shouldSkipDefaultAttribute = options.shouldSkipDefaultAttribute,
|
|
8641
8216
|
assignTransitionAttr = (key, value) => {
|
|
8642
|
-
if (noWorkAnimateAttr[key])
|
|
8643
|
-
if (isClear && void 0 === value) {
|
|
8217
|
+
if (noWorkAnimateAttr[key]) plan.noAnimateAttrs[key] = value;else if (isClear && void 0 === value) {
|
|
8644
8218
|
if (null == shouldSkipDefaultAttribute ? void 0 : shouldSkipDefaultAttribute(key, targetAttrs)) return;
|
|
8645
|
-
plan.animateAttrs[key] =
|
|
8219
|
+
plan.animateAttrs[key] = readDefaultAttribute(key);
|
|
8646
8220
|
} else plan.animateAttrs[key] = value;
|
|
8647
8221
|
};
|
|
8648
8222
|
for (const key in targetAttrs) {
|
|
@@ -8678,13 +8252,13 @@
|
|
|
8678
8252
|
type: exports.AttributeUpdateType.STATE
|
|
8679
8253
|
}), plan;
|
|
8680
8254
|
}
|
|
8681
|
-
applyClearTransition(graphic, targetAttrs, hasAnimation,
|
|
8682
|
-
var _a
|
|
8683
|
-
const plan = this.analyzeTransition(
|
|
8684
|
-
noWorkAnimateAttr:
|
|
8255
|
+
applyClearTransition(graphic, targetAttrs, hasAnimation, options = {}) {
|
|
8256
|
+
var _a;
|
|
8257
|
+
const plan = this.analyzeTransition(targetAttrs, hasAnimation, {
|
|
8258
|
+
noWorkAnimateAttr: graphic.getNoWorkAnimateAttr(),
|
|
8685
8259
|
isClear: !0,
|
|
8686
|
-
getDefaultAttribute:
|
|
8687
|
-
shouldSkipDefaultAttribute: null !== (
|
|
8260
|
+
getDefaultAttribute: graphic.getDefaultAttribute.bind(graphic),
|
|
8261
|
+
shouldSkipDefaultAttribute: null !== (_a = options.shouldSkipDefaultAttribute) && void 0 !== _a ? _a : graphic.shouldSkipStateTransitionDefaultAttribute.bind(graphic),
|
|
8688
8262
|
animateConfig: options.animateConfig,
|
|
8689
8263
|
extraAnimateAttrs: options.extraAnimateAttrs
|
|
8690
8264
|
});
|
|
@@ -8693,23 +8267,11 @@
|
|
|
8693
8267
|
}
|
|
8694
8268
|
|
|
8695
8269
|
const compiler = new StateDefinitionCompiler();
|
|
8696
|
-
function copyDefinitions(definitions) {
|
|
8697
|
-
return definitions ? Object.assign({}, definitions) : {};
|
|
8698
|
-
}
|
|
8699
8270
|
function buildEffectiveSourceDefinitions(parentScope, localStateDefinitions, themeStateDefinitions) {
|
|
8700
|
-
|
|
8701
|
-
return localStateDefinitions && Object.keys(localStateDefinitions).forEach(stateName => {
|
|
8702
|
-
merged[stateName] = localStateDefinitions[stateName];
|
|
8703
|
-
}), merged;
|
|
8704
|
-
}
|
|
8705
|
-
function initializeScope(scope, revision = 0) {
|
|
8706
|
-
var _a;
|
|
8707
|
-
const effectiveSourceDefinitions = buildEffectiveSourceDefinitions(scope.parentScope, scope.localStateDefinitions, scope.themeStateDefinitions);
|
|
8708
|
-
return scope.effectiveSourceDefinitions = effectiveSourceDefinitions, scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions), scope.parentRevisionAtBuild = null === (_a = scope.parentScope) || void 0 === _a ? void 0 : _a.revision, scope.revision = revision, scope.dirty = !1, scope;
|
|
8271
|
+
return Object.assign({}, parentScope ? parentScope.effectiveSourceDefinitions : themeStateDefinitions, localStateDefinitions);
|
|
8709
8272
|
}
|
|
8710
8273
|
function createRootSharedStateScope(stage, themeStateDefinitions) {
|
|
8711
|
-
return
|
|
8712
|
-
ownerKind: "root",
|
|
8274
|
+
return rebuildSharedStateScope({
|
|
8713
8275
|
ownerStage: stage,
|
|
8714
8276
|
themeStateDefinitions: themeStateDefinitions,
|
|
8715
8277
|
effectiveSourceDefinitions: {},
|
|
@@ -8720,9 +8282,7 @@
|
|
|
8720
8282
|
}, 0);
|
|
8721
8283
|
}
|
|
8722
8284
|
function createGroupSharedStateScope(group, parentScope, localStateDefinitions) {
|
|
8723
|
-
return
|
|
8724
|
-
ownerKind: "group",
|
|
8725
|
-
ownerGroup: group,
|
|
8285
|
+
return rebuildSharedStateScope({
|
|
8726
8286
|
ownerStage: group.stage,
|
|
8727
8287
|
parentScope: parentScope,
|
|
8728
8288
|
localStateDefinitions: localStateDefinitions,
|
|
@@ -8742,14 +8302,13 @@
|
|
|
8742
8302
|
function setRootSharedStateScopeThemeDefinitions(scope, themeStateDefinitions) {
|
|
8743
8303
|
return scope.themeStateDefinitions !== themeStateDefinitions && (scope.themeStateDefinitions = themeStateDefinitions, rebuildSharedStateScope(scope), !0);
|
|
8744
8304
|
}
|
|
8745
|
-
function rebuildSharedStateScope(scope) {
|
|
8305
|
+
function rebuildSharedStateScope(scope, revision = scope.revision + 1) {
|
|
8746
8306
|
var _a;
|
|
8747
8307
|
const effectiveSourceDefinitions = buildEffectiveSourceDefinitions(scope.parentScope, scope.localStateDefinitions, scope.themeStateDefinitions);
|
|
8748
|
-
return scope.effectiveSourceDefinitions = effectiveSourceDefinitions, scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions), scope.parentRevisionAtBuild = null === (_a = scope.parentScope) || void 0 === _a ? void 0 : _a.revision, scope.revision
|
|
8308
|
+
return scope.effectiveSourceDefinitions = effectiveSourceDefinitions, scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions), scope.parentRevisionAtBuild = null === (_a = scope.parentScope) || void 0 === _a ? void 0 : _a.revision, scope.revision = revision, scope.dirty = !1, scope;
|
|
8749
8309
|
}
|
|
8750
8310
|
function ensureSharedStateScopeFresh(scope) {
|
|
8751
|
-
|
|
8752
|
-
if (scope) return null === (_a = getActiveStageStatePerfMonitor(scope.ownerStage)) || void 0 === _a || _a.recordRefresh("ensureFreshCalls"), scope.parentScope && ensureSharedStateScopeFresh(scope.parentScope), (scope.dirty || scope.parentScope && scope.parentRevisionAtBuild !== scope.parentScope.revision) && rebuildSharedStateScope(scope), scope;
|
|
8311
|
+
if (scope) return scope.parentScope && ensureSharedStateScopeFresh(scope.parentScope), (scope.dirty || scope.parentScope && scope.parentRevisionAtBuild !== scope.parentScope.revision) && rebuildSharedStateScope(scope), scope;
|
|
8753
8312
|
}
|
|
8754
8313
|
function collectSharedStateScopeChain(scope) {
|
|
8755
8314
|
const chain = [];
|
|
@@ -8759,43 +8318,27 @@
|
|
|
8759
8318
|
}
|
|
8760
8319
|
|
|
8761
8320
|
function scheduleStageSharedStateRefresh(stage) {
|
|
8762
|
-
|
|
8763
|
-
stage && "released" !== stage.releaseStatus && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordRefresh("renderScheduled"), stage.renderNextFrame());
|
|
8321
|
+
stage && "released" !== stage.releaseStatus && stage.renderNextFrame();
|
|
8764
8322
|
}
|
|
8765
8323
|
function enqueueGraphicSharedStateRefresh(stage, graphic) {
|
|
8766
8324
|
var _a;
|
|
8767
8325
|
if (!stage) return;
|
|
8768
|
-
|
|
8769
|
-
if (!pending.has(graphic)) {
|
|
8770
|
-
pending.add(graphic);
|
|
8771
|
-
const perfMonitor = getActiveStageStatePerfMonitor(stage);
|
|
8772
|
-
null == perfMonitor || perfMonitor.recordRefresh("queuedGraphics"), null == perfMonitor || perfMonitor.recordAllocation("refreshQueuePushes");
|
|
8773
|
-
}
|
|
8326
|
+
(null !== (_a = stage._pendingSharedStateRefreshGraphics) && void 0 !== _a ? _a : stage._pendingSharedStateRefreshGraphics = new Set()).add(graphic);
|
|
8774
8327
|
}
|
|
8775
8328
|
function markScopeActiveDescendantsDirty(scope, stage) {
|
|
8776
|
-
|
|
8777
|
-
scope.subtreeActiveDescendants.forEach(graphic => {
|
|
8329
|
+
scope.subtreeActiveDescendants.size && (scope.subtreeActiveDescendants.forEach(graphic => {
|
|
8778
8330
|
var _a;
|
|
8779
8331
|
graphic.sharedStateDirty = !0;
|
|
8780
|
-
enqueueGraphicSharedStateRefresh(null !== (_a = null != stage ? stage : graphic.stage) && void 0 !== _a ? _a : scope.ownerStage, graphic)
|
|
8781
|
-
}),
|
|
8332
|
+
enqueueGraphicSharedStateRefresh(null !== (_a = null != stage ? stage : graphic.stage) && void 0 !== _a ? _a : scope.ownerStage, graphic);
|
|
8333
|
+
}), scheduleStageSharedStateRefresh(null != stage ? stage : scope.ownerStage));
|
|
8782
8334
|
}
|
|
8783
8335
|
function flushStageSharedStateRefresh(stage) {
|
|
8784
8336
|
const pending = stage._pendingSharedStateRefreshGraphics;
|
|
8785
8337
|
if (!pending || !pending.size) return;
|
|
8786
|
-
const
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
if ("released" === graphic.releaseStatus) return;
|
|
8791
|
-
if (graphic.stage !== stage) return;
|
|
8792
|
-
if (!graphic.sharedStateDirty) return;
|
|
8793
|
-
const refresh = graphic.refreshSharedStateBeforeRender;
|
|
8794
|
-
"function" == typeof refresh && (refresh.call(graphic), null == perfMonitor || perfMonitor.incrementCounter("sharedRefreshCommits"));
|
|
8795
|
-
}), perfMonitor && (perfMonitor.recordCost("sharedRefresh", performance.now() - start), perfMonitor.recordEvent("shared-refresh-flush", {
|
|
8796
|
-
stageId: stage._uid,
|
|
8797
|
-
flushedGraphics: graphics.length
|
|
8798
|
-
}));
|
|
8338
|
+
const graphics = Array.from(pending.values());
|
|
8339
|
+
pending.clear(), graphics.forEach(graphic => {
|
|
8340
|
+
"released" !== graphic.releaseStatus && graphic.stage === stage && graphic.sharedStateDirty && graphic.refreshSharedStateBeforeRender();
|
|
8341
|
+
});
|
|
8799
8342
|
}
|
|
8800
8343
|
|
|
8801
8344
|
const _tempBounds$1 = new AABBBounds(),
|
|
@@ -8806,7 +8349,6 @@
|
|
|
8806
8349
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
8807
8350
|
tempConstantAngleKey = ["angle"],
|
|
8808
8351
|
builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
|
|
8809
|
-
FULL_STATE_DEFINITION_KEYS = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]),
|
|
8810
8352
|
point = new Point(),
|
|
8811
8353
|
EMPTY_STATE_NAMES = [],
|
|
8812
8354
|
BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT | UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.TRANSFORM | UpdateCategory.LAYOUT;
|
|
@@ -8922,11 +8464,6 @@
|
|
|
8922
8464
|
getAttributes() {
|
|
8923
8465
|
return this.attribute;
|
|
8924
8466
|
}
|
|
8925
|
-
getStateStyleResolver(mergeMode) {
|
|
8926
|
-
return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new StateStyleResolver({
|
|
8927
|
-
mergeMode: "deep"
|
|
8928
|
-
})), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new StateStyleResolver()), this.stateStyleResolver);
|
|
8929
|
-
}
|
|
8930
8467
|
getStateTransitionOrchestrator() {
|
|
8931
8468
|
return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new StateTransitionOrchestrator()), this.stateTransitionOrchestrator;
|
|
8932
8469
|
}
|
|
@@ -8942,7 +8479,7 @@
|
|
|
8942
8479
|
syncSharedStateScopeBindingFromTree(markDirty = !0) {
|
|
8943
8480
|
var _a;
|
|
8944
8481
|
const nextScope = this.resolveBoundSharedStateScope();
|
|
8945
|
-
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(), !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0, this.
|
|
8482
|
+
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(), !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(), markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(), !0);
|
|
8946
8483
|
}
|
|
8947
8484
|
syncSharedStateScopeBindingOnTreeChange(markDirty = !0) {
|
|
8948
8485
|
var _a, _b;
|
|
@@ -8981,7 +8518,7 @@
|
|
|
8981
8518
|
}
|
|
8982
8519
|
getLocalStatesVersion() {
|
|
8983
8520
|
var _a, _b;
|
|
8984
|
-
return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states, this.
|
|
8521
|
+
return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states, this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1), null !== (_b = this.localStateDefinitionsVersion) && void 0 !== _b ? _b : 0;
|
|
8985
8522
|
}
|
|
8986
8523
|
resolveEffectiveCompiledDefinitions() {
|
|
8987
8524
|
this.syncSharedStateScopeBindingFromTree(!1);
|
|
@@ -8990,49 +8527,24 @@
|
|
|
8990
8527
|
const hasStates = !!this.states && Object.keys(this.states).length > 0;
|
|
8991
8528
|
if (!boundScope) {
|
|
8992
8529
|
if (!hasStates) return {
|
|
8993
|
-
compiledDefinitions: void 0
|
|
8994
|
-
stateProxyModeKey: "none"
|
|
8530
|
+
compiledDefinitions: void 0
|
|
8995
8531
|
};
|
|
8996
8532
|
const cacheKey = `local:${this.getLocalStatesVersion()}`;
|
|
8997
8533
|
return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = new StateDefinitionCompiler().compile(this.states), this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
8998
|
-
compiledDefinitions: this.compiledStateDefinitions
|
|
8999
|
-
stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
|
|
8534
|
+
compiledDefinitions: this.compiledStateDefinitions
|
|
9000
8535
|
};
|
|
9001
8536
|
}
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
|
|
9005
|
-
if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
|
|
9006
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
9007
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
9008
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
9009
|
-
};
|
|
9010
|
-
const localStates = this.states,
|
|
9011
|
-
missingLocalStateDefinitions = {},
|
|
9012
|
-
missingStateNames = [];
|
|
9013
|
-
if (Object.keys(localStates).forEach(stateName => {
|
|
9014
|
-
sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName], missingStateNames.push(stateName));
|
|
9015
|
-
}), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0, {
|
|
9016
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
9017
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
9018
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
9019
|
-
};
|
|
9020
|
-
const localStatesVersion = this.getLocalStatesVersion(),
|
|
9021
|
-
stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none",
|
|
9022
|
-
cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
|
|
9023
|
-
return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = new StateDefinitionCompiler().compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)), this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
9024
|
-
compiledDefinitions: this.localFallbackCompiledDefinitions,
|
|
9025
|
-
stateProxyModeKey: stateProxyModeKey,
|
|
9026
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
8537
|
+
return {
|
|
8538
|
+
compiledDefinitions: boundScope.effectiveCompiledDefinitions
|
|
9027
8539
|
};
|
|
9028
8540
|
}
|
|
9029
8541
|
recomputeCurrentStatePatch() {
|
|
9030
8542
|
var _a, _b;
|
|
9031
8543
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [], this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
|
|
9032
8544
|
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
|
|
9033
|
-
transition = this.
|
|
8545
|
+
transition = this.resolveUseStatesTransition(this.currentStates, stateResolveBaseAttrs),
|
|
9034
8546
|
effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
|
|
9035
|
-
resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) :
|
|
8547
|
+
resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
9036
8548
|
this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
|
|
9037
8549
|
}
|
|
9038
8550
|
buildStaticAttributeSnapshot() {
|
|
@@ -9096,12 +8608,7 @@
|
|
|
9096
8608
|
return nextCategory & UpdateCategory.PICK && (nextCategory |= UpdateCategory.BOUNDS), nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS), category | nextCategory;
|
|
9097
8609
|
}
|
|
9098
8610
|
submitUpdateByCategory(category, forceUpdateTag = !1) {
|
|
9099
|
-
var _a;
|
|
9100
8611
|
if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), void this.addUpdateLayoutTag();
|
|
9101
|
-
if (category !== UpdateCategory.NONE) {
|
|
9102
|
-
const stage = this.stage;
|
|
9103
|
-
stage && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordCategory(category));
|
|
9104
|
-
}
|
|
9105
8612
|
(category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(), category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(), category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag()) : this.addBroadUpdateTag();
|
|
9106
8613
|
}
|
|
9107
8614
|
submitUpdateByDelta(delta, forceUpdateTag = !1) {
|
|
@@ -9640,103 +9147,94 @@
|
|
|
9640
9147
|
var _a;
|
|
9641
9148
|
return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs), stateResolveBaseAttrs;
|
|
9642
9149
|
}
|
|
9643
|
-
|
|
9150
|
+
ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
9644
9151
|
const {
|
|
9645
|
-
compiledDefinitions: compiledDefinitions
|
|
9646
|
-
stateProxyEligibility: stateProxyEligibility,
|
|
9647
|
-
stateProxyModeKey: stateProxyModeKey
|
|
9152
|
+
compiledDefinitions: compiledDefinitions
|
|
9648
9153
|
} = this.resolveEffectiveCompiledDefinitions();
|
|
9649
|
-
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.
|
|
9154
|
+
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode || (this.stateEngine = new StateEngine({
|
|
9650
9155
|
compiledDefinitions: compiledDefinitions,
|
|
9651
9156
|
stateSort: this.stateSort,
|
|
9652
|
-
stateProxy: this.stateProxy,
|
|
9653
|
-
stateProxyEligibility: stateProxyEligibility,
|
|
9654
|
-
states: this.states,
|
|
9655
9157
|
mergeMode: this.stateMergeMode
|
|
9656
|
-
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.
|
|
9657
|
-
states: this.states,
|
|
9658
|
-
currentStates: this.currentStates,
|
|
9659
|
-
stateSort: this.stateSort,
|
|
9660
|
-
stateProxy: this.stateProxy,
|
|
9661
|
-
stateEngine: this.stateEngine
|
|
9662
|
-
});
|
|
9158
|
+
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0), this.syncStateResolveContext(stateResolveBaseAttrs), this.stateEngine && this.currentStates && !this.sameStateNames(this.stateEngine.activeStates, this.currentStates) && this.stateEngine.applyStates(this.currentStates), this.stateEngine;
|
|
9663
9159
|
}
|
|
9664
|
-
|
|
9160
|
+
toGraphicStateTransition(result) {
|
|
9161
|
+
return {
|
|
9162
|
+
changed: result.changed,
|
|
9163
|
+
states: [...result.activeStates],
|
|
9164
|
+
effectiveStates: [...result.effectiveStates]
|
|
9165
|
+
};
|
|
9166
|
+
}
|
|
9167
|
+
sortLocalStates(states) {
|
|
9168
|
+
return this.stateSort ? [...states].sort(this.stateSort) : [...states];
|
|
9169
|
+
}
|
|
9170
|
+
resolveLocalUseStatesTransition(states) {
|
|
9665
9171
|
var _a;
|
|
9666
|
-
if (!
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
nextStates = [stateName],
|
|
9671
|
-
changed = !this.sameStateNames(previousStates, nextStates),
|
|
9672
|
-
resolvedStateAttrs = {};
|
|
9673
|
-
if (hasDefinition) {
|
|
9674
|
-
const attrs = this.states[stateName];
|
|
9675
|
-
if (null != attrs) {
|
|
9676
|
-
if (!isPlainObjectValue(attrs)) return null;
|
|
9677
|
-
const keys = Object.keys(attrs);
|
|
9678
|
-
for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
|
|
9679
|
-
const key = keys[keyIndex];
|
|
9680
|
-
if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
|
|
9681
|
-
const attrValue = attrs[key];
|
|
9682
|
-
resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
|
|
9683
|
-
}
|
|
9684
|
-
}
|
|
9685
|
-
}
|
|
9686
|
-
return {
|
|
9687
|
-
changed: changed,
|
|
9688
|
-
states: nextStates,
|
|
9689
|
-
effectiveStates: nextStates,
|
|
9690
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
9691
|
-
};
|
|
9692
|
-
}
|
|
9693
|
-
const uniqueStates = Array.from(new Set(states)),
|
|
9694
|
-
withDefinition = [],
|
|
9695
|
-
withoutDefinition = [];
|
|
9696
|
-
for (let i = 0; i < uniqueStates.length; i++) {
|
|
9697
|
-
const stateName = uniqueStates[i];
|
|
9698
|
-
Object.prototype.hasOwnProperty.call(this.states, stateName) ? withDefinition.push(stateName) : withoutDefinition.push(stateName);
|
|
9699
|
-
}
|
|
9700
|
-
withDefinition.sort((left, right) => left.localeCompare(right));
|
|
9701
|
-
const nextStates = withDefinition.concat(withoutDefinition),
|
|
9702
|
-
changed = !this.sameStateNames(previousStates, nextStates),
|
|
9703
|
-
resolvedStateAttrs = {};
|
|
9704
|
-
for (let i = 0; i < nextStates.length; i++) {
|
|
9705
|
-
const stateName = nextStates[i];
|
|
9706
|
-
if (!Object.prototype.hasOwnProperty.call(this.states, stateName)) continue;
|
|
9707
|
-
const attrs = this.states[stateName];
|
|
9708
|
-
if (null == attrs) continue;
|
|
9709
|
-
if (!isPlainObjectValue(attrs)) return null;
|
|
9710
|
-
const keys = Object.keys(attrs);
|
|
9711
|
-
for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
|
|
9712
|
-
const key = keys[keyIndex];
|
|
9713
|
-
if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
|
|
9714
|
-
const attrValue = attrs[key];
|
|
9715
|
-
resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
|
|
9716
|
-
}
|
|
9717
|
-
}
|
|
9172
|
+
if (!states.length) return this.resolveLocalClearStatesTransition();
|
|
9173
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
|
|
9174
|
+
changed = previousStates.length !== states.length || states.some((stateName, index) => previousStates[index] !== stateName),
|
|
9175
|
+
nextStates = this.sortLocalStates(states);
|
|
9718
9176
|
return {
|
|
9719
9177
|
changed: changed,
|
|
9720
|
-
states: nextStates
|
|
9721
|
-
effectiveStates: nextStates,
|
|
9722
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
9178
|
+
states: changed ? nextStates : [...previousStates]
|
|
9723
9179
|
};
|
|
9724
9180
|
}
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9181
|
+
resolveLocalClearStatesTransition() {
|
|
9182
|
+
return {
|
|
9183
|
+
changed: this.hasState(),
|
|
9184
|
+
states: []
|
|
9185
|
+
};
|
|
9186
|
+
}
|
|
9187
|
+
resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
9188
|
+
const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
9189
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states);
|
|
9190
|
+
}
|
|
9191
|
+
resolveClearStatesTransition() {
|
|
9192
|
+
const stateEngine = this.ensureStateEngine();
|
|
9193
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.clearStates()) : this.resolveLocalClearStatesTransition();
|
|
9194
|
+
}
|
|
9195
|
+
resolveAddStateTransition(stateName, keepCurrentStates) {
|
|
9196
|
+
var _a;
|
|
9197
|
+
const stateEngine = this.ensureStateEngine();
|
|
9198
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
|
|
9199
|
+
if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
|
|
9200
|
+
changed: !1,
|
|
9201
|
+
states: [...this.currentStates]
|
|
9202
|
+
};
|
|
9203
|
+
const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([stateName]) : [stateName];
|
|
9204
|
+
return this.resolveLocalUseStatesTransition(nextStates);
|
|
9205
|
+
}
|
|
9206
|
+
resolveRemoveStateTransition(stateName) {
|
|
9207
|
+
const stateEngine = this.ensureStateEngine();
|
|
9208
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.removeState(stateName));
|
|
9209
|
+
if (!this.currentStates) return {
|
|
9210
|
+
changed: !1,
|
|
9211
|
+
states: []
|
|
9212
|
+
};
|
|
9213
|
+
const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName,
|
|
9214
|
+
nextStates = this.currentStates.filter(filter);
|
|
9215
|
+
return nextStates.length === this.currentStates.length ? {
|
|
9216
|
+
changed: !1,
|
|
9217
|
+
states: [...this.currentStates]
|
|
9218
|
+
} : this.resolveLocalUseStatesTransition(nextStates);
|
|
9219
|
+
}
|
|
9220
|
+
resolveToggleStateTransition(stateName) {
|
|
9221
|
+
const stateEngine = this.ensureStateEngine();
|
|
9222
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
|
|
9223
|
+
if (this.hasState(stateName)) return this.resolveRemoveStateTransition(stateName);
|
|
9224
|
+
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
9225
|
+
return nextStates.push(stateName), this.resolveLocalUseStatesTransition(nextStates);
|
|
9226
|
+
}
|
|
9227
|
+
resolveGraphicStateTransition(states, forceResolverRefresh = !1) {
|
|
9228
|
+
var _a;
|
|
9229
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
|
|
9230
|
+
stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
9231
|
+
forceResolverRefresh && (null == stateEngine || stateEngine.invalidateResolverCache());
|
|
9232
|
+
const transition = stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states),
|
|
9233
|
+
resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
9735
9234
|
return {
|
|
9736
9235
|
transition: transition,
|
|
9737
|
-
effectiveStates: null !== (
|
|
9738
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
9739
|
-
isSimpleLocalTransition: isSimpleLocalTransition
|
|
9236
|
+
effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
|
|
9237
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
9740
9238
|
};
|
|
9741
9239
|
}
|
|
9742
9240
|
normalizeSetStatesOptions(options) {
|
|
@@ -9767,24 +9265,14 @@
|
|
|
9767
9265
|
{
|
|
9768
9266
|
transition: transition,
|
|
9769
9267
|
effectiveStates: effectiveStates,
|
|
9770
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
9771
|
-
|
|
9772
|
-
} = this.resolveGraphicStateTransition(states, previousStates, !0),
|
|
9268
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
9269
|
+
} = this.resolveGraphicStateTransition(states, !0),
|
|
9773
9270
|
patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
targetStates: [...transition.states]
|
|
9780
|
-
});
|
|
9781
|
-
}
|
|
9782
|
-
hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9783
|
-
type: exports.AttributeUpdateType.STATE
|
|
9784
|
-
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
9785
|
-
type: exports.AttributeUpdateType.STATE
|
|
9786
|
-
}), this.emitStateUpdateEvent());
|
|
9787
|
-
}
|
|
9271
|
+
patchChanged && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) || (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged && (hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9272
|
+
type: exports.AttributeUpdateType.STATE
|
|
9273
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
9274
|
+
type: exports.AttributeUpdateType.STATE
|
|
9275
|
+
}), this.emitStateUpdateEvent())));
|
|
9788
9276
|
}
|
|
9789
9277
|
resolveStateAnimateConfig(animateConfig) {
|
|
9790
9278
|
var _a, _b, _c;
|
|
@@ -9797,8 +9285,8 @@
|
|
|
9797
9285
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
9798
9286
|
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
9799
9287
|
} : void 0;
|
|
9800
|
-
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation,
|
|
9801
|
-
const plan = this.getStateTransitionOrchestrator().analyzeTransition(
|
|
9288
|
+
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
|
|
9289
|
+
const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
|
|
9802
9290
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
9803
9291
|
animateConfig: resolvedAnimateConfig,
|
|
9804
9292
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
@@ -9822,43 +9310,29 @@
|
|
|
9822
9310
|
animate.stateNames && stateAnimates.push(animate);
|
|
9823
9311
|
}), stateAnimates.forEach(animate => animate.stop(type));
|
|
9824
9312
|
}
|
|
9825
|
-
getNormalAttribute(key) {
|
|
9826
|
-
var _a, _b;
|
|
9827
|
-
const value = this.attribute[key];
|
|
9828
|
-
return this.hasAnyTrackedAnimate() ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
|
|
9829
|
-
}
|
|
9830
9313
|
clearStates(hasAnimation) {
|
|
9831
9314
|
var _a, _b, _c;
|
|
9832
9315
|
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
|
|
9833
9316
|
previousResolvedStatePatch = this.resolvedStatePatch,
|
|
9834
|
-
transition = this.
|
|
9317
|
+
transition = this.resolveClearStatesTransition();
|
|
9835
9318
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [], this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, void this.clearSharedStateActiveRegistrations();
|
|
9836
9319
|
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
targetStates: []
|
|
9843
|
-
});
|
|
9844
|
-
}
|
|
9845
|
-
hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9846
|
-
type: exports.AttributeUpdateType.STATE
|
|
9847
|
-
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
9848
|
-
type: exports.AttributeUpdateType.STATE
|
|
9849
|
-
}), this.emitStateUpdateEvent());
|
|
9850
|
-
}
|
|
9320
|
+
transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9321
|
+
type: exports.AttributeUpdateType.STATE
|
|
9322
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
9323
|
+
type: exports.AttributeUpdateType.STATE
|
|
9324
|
+
}), this.emitStateUpdateEvent()));
|
|
9851
9325
|
}
|
|
9852
9326
|
removeState(stateName, hasAnimation) {
|
|
9853
|
-
const transition = this.
|
|
9327
|
+
const transition = this.resolveRemoveStateTransition(stateName);
|
|
9854
9328
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
9855
9329
|
}
|
|
9856
9330
|
toggleState(stateName, hasAnimation) {
|
|
9857
|
-
const transition = this.
|
|
9331
|
+
const transition = this.resolveToggleStateTransition(stateName);
|
|
9858
9332
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
9859
9333
|
}
|
|
9860
9334
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
9861
|
-
const transition = this.
|
|
9335
|
+
const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
|
|
9862
9336
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
9863
9337
|
}
|
|
9864
9338
|
setStates(states, options) {
|
|
@@ -9886,29 +9360,18 @@
|
|
|
9886
9360
|
{
|
|
9887
9361
|
transition: transition,
|
|
9888
9362
|
effectiveStates: effectiveStates,
|
|
9889
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
graphicId: this._uid,
|
|
9897
|
-
targetStates: [...transition.states]
|
|
9898
|
-
});
|
|
9899
|
-
}
|
|
9900
|
-
hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9901
|
-
type: exports.AttributeUpdateType.STATE
|
|
9902
|
-
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
9903
|
-
type: exports.AttributeUpdateType.STATE
|
|
9904
|
-
}), this.emitStateUpdateEvent());
|
|
9905
|
-
}
|
|
9363
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
9364
|
+
} = this.resolveGraphicStateTransition(states);
|
|
9365
|
+
!transition.changed && this.sameStateNames(previousStates, transition.states) || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9366
|
+
type: exports.AttributeUpdateType.STATE
|
|
9367
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
9368
|
+
type: exports.AttributeUpdateType.STATE
|
|
9369
|
+
}), this.emitStateUpdateEvent()));
|
|
9906
9370
|
}
|
|
9907
9371
|
invalidateResolver() {
|
|
9908
9372
|
var _a, _b;
|
|
9909
9373
|
if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
|
|
9910
|
-
this.syncStateResolveContext();
|
|
9911
|
-
this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1, this.stateEngine.invalidateResolverCache();
|
|
9374
|
+
this.syncStateResolveContext(), this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1, this.stateEngine.invalidateResolverCache();
|
|
9912
9375
|
const transition = this.stateEngine.applyStates(this.currentStates),
|
|
9913
9376
|
resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
9914
9377
|
this.effectiveStates = [...transition.effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
@@ -10049,7 +9512,7 @@
|
|
|
10049
9512
|
}
|
|
10050
9513
|
detachStageForRelease() {
|
|
10051
9514
|
var _a, _b, _c;
|
|
10052
|
-
(null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(), (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0, this.boundSharedStateRevision = void 0, this.
|
|
9515
|
+
(null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(), (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0, this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
|
|
10053
9516
|
}
|
|
10054
9517
|
setStageToShadowRoot(stage, layer) {
|
|
10055
9518
|
this.shadowRoot && this.shadowRoot.setStage(stage, layer);
|
|
@@ -11562,15 +11025,11 @@
|
|
|
11562
11025
|
const previousStates = this.currentStates ? this.currentStates.slice() : [];
|
|
11563
11026
|
if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
|
|
11564
11027
|
this.stopStateAnimates(), this.stateSort && (states = states.sort(this.stateSort));
|
|
11565
|
-
const stateAttrs = {}
|
|
11566
|
-
subAttrs = this.subGraphic.map(() => ({}));
|
|
11028
|
+
const stateAttrs = {};
|
|
11567
11029
|
states.forEach(stateName => {
|
|
11568
|
-
var _a;
|
|
11569
11030
|
const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];
|
|
11570
|
-
attrs &&
|
|
11571
|
-
|
|
11572
|
-
}));
|
|
11573
|
-
}), this.beforeStateUpdate(stateAttrs, previousStates, states, hasAnimation, !1) && (this.updateNormalAttrs(stateAttrs), this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation));
|
|
11031
|
+
attrs && Object.assign(stateAttrs, attrs.attributes);
|
|
11032
|
+
}), this.beforeStateUpdate(stateAttrs, previousStates, states, hasAnimation, !1) && (this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation));
|
|
11574
11033
|
}
|
|
11575
11034
|
clearStates(hasAnimation) {
|
|
11576
11035
|
this.stopStateAnimates();
|
|
@@ -11579,7 +11038,6 @@
|
|
|
11579
11038
|
if (!this.beforeStateUpdate(this.normalAttrs, previousStates, [], hasAnimation, !0)) return;
|
|
11580
11039
|
this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0);
|
|
11581
11040
|
} else this.currentStates = [];
|
|
11582
|
-
this.normalAttrs = null;
|
|
11583
11041
|
}
|
|
11584
11042
|
clone() {
|
|
11585
11043
|
const glyph = new Glyph(Object.assign({}, this.attribute));
|
|
@@ -12831,7 +12289,7 @@
|
|
|
12831
12289
|
return new Area(attributes);
|
|
12832
12290
|
}
|
|
12833
12291
|
|
|
12834
|
-
const ARC_UPDATE_TAG_KEY = ["innerRadius", "outerRadius", "startAngle", "endAngle", "cornerRadius", "padAngle", "padRadius", "cap", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
12292
|
+
const ARC_UPDATE_TAG_KEY = ["innerRadius", "outerRadius", "startAngle", "endAngle", "cornerRadius", "padAngle", "padRadius", "clipRange", "cap", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
12835
12293
|
class Arc extends Graphic {
|
|
12836
12294
|
constructor(params) {
|
|
12837
12295
|
super(params), this.type = "arc", this.numberType = ARC_NUMBER_TYPE;
|
|
@@ -12875,11 +12333,12 @@
|
|
|
12875
12333
|
endAngle = arcTheme.endAngle
|
|
12876
12334
|
} = this.attribute;
|
|
12877
12335
|
const {
|
|
12878
|
-
cap = arcTheme.cap
|
|
12336
|
+
cap = arcTheme.cap,
|
|
12337
|
+
clipRange = arcTheme.clipRange
|
|
12879
12338
|
} = this.attribute,
|
|
12880
|
-
sign = endAngle - startAngle >= 0 ? 1 : -1
|
|
12881
|
-
|
|
12882
|
-
if (startAngle = clampAngleByRadian(startAngle), endAngle = startAngle + deltaAngle, cap && abs(deltaAngle) < pi2 - epsilon) {
|
|
12339
|
+
sign = endAngle - startAngle >= 0 ? 1 : -1;
|
|
12340
|
+
let deltaAngle = endAngle - startAngle;
|
|
12341
|
+
if (deltaAngle *= Math.max(0, Math.min(clipRange, 1)), startAngle = clampAngleByRadian(startAngle), endAngle = startAngle + deltaAngle, cap && abs(deltaAngle) > epsilon && abs(deltaAngle) < pi2 - epsilon) {
|
|
12883
12342
|
let startCap = 1,
|
|
12884
12343
|
endCap = 1;
|
|
12885
12344
|
cap.length && (startCap = Number(cap[0]), endCap = Number(cap[1]));
|
|
@@ -13169,7 +12628,7 @@
|
|
|
13169
12628
|
}(exports.GroupUpdateAABBBoundsMode || (exports.GroupUpdateAABBBoundsMode = {}));
|
|
13170
12629
|
class Group extends Graphic {
|
|
13171
12630
|
constructor(params) {
|
|
13172
|
-
super(params), this.type = "group", this.parent = null, this.isContainer = !0, this.
|
|
12631
|
+
super(params), this.type = "group", this.parent = null, this.isContainer = !0, this.numberType = GROUP_NUMBER_TYPE, this._childUpdateTag = exports.UpdateTag.UPDATE_BOUNDS;
|
|
13173
12632
|
}
|
|
13174
12633
|
get sharedStateDefinitions() {
|
|
13175
12634
|
return this._sharedStateDefinitions;
|
|
@@ -13177,7 +12636,7 @@
|
|
|
13177
12636
|
set sharedStateDefinitions(value) {
|
|
13178
12637
|
if (this._sharedStateDefinitions === value) return;
|
|
13179
12638
|
const previousScope = this.sharedStateScope;
|
|
13180
|
-
this._sharedStateDefinitions = value, this.
|
|
12639
|
+
this._sharedStateDefinitions = value, this.ensureSharedStateScopeBound(), this.sharedStateScope && (setSharedStateScopeLocalDefinitions(this.sharedStateScope, value), markScopeActiveDescendantsDirty(this.sharedStateScope, this.stage)), previousScope !== this.sharedStateScope && this.notifyChildrenSharedStateTreeChanged();
|
|
13181
12640
|
}
|
|
13182
12641
|
setMode(mode) {
|
|
13183
12642
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -13281,17 +12740,17 @@
|
|
|
13281
12740
|
}
|
|
13282
12741
|
incrementalAppendChild(node) {
|
|
13283
12742
|
const data = super.appendChild(node);
|
|
13284
|
-
return data &&
|
|
12743
|
+
return data && this.syncChildSharedStateTreeBinding(data), this.addUpdateBoundTag(), this.getGraphicService().onAddIncremental(node, this, this.stage), data;
|
|
13285
12744
|
}
|
|
13286
12745
|
incrementalClearChild() {
|
|
13287
12746
|
super.removeAllChild(), this.addUpdateBoundTag(), this.getGraphicService().onClearIncremental(this, this.stage);
|
|
13288
12747
|
}
|
|
13289
12748
|
_updateChildToStage(child) {
|
|
13290
|
-
return child &&
|
|
12749
|
+
return child && this.syncChildSharedStateTreeBinding(child), this.addUpdateBoundTag(), child;
|
|
13291
12750
|
}
|
|
13292
12751
|
appendChild(node, addStage = !0) {
|
|
13293
12752
|
const data = super.appendChild(node);
|
|
13294
|
-
return data &&
|
|
12753
|
+
return data && addStage && this.syncChildSharedStateTreeBinding(data), this.addUpdateBoundTag(), data;
|
|
13295
12754
|
}
|
|
13296
12755
|
insertBefore(newNode, referenceNode) {
|
|
13297
12756
|
return this._updateChildToStage(super.insertBefore(newNode, referenceNode));
|
|
@@ -13303,9 +12762,8 @@
|
|
|
13303
12762
|
return this._updateChildToStage(super.insertInto(newNode, idx));
|
|
13304
12763
|
}
|
|
13305
12764
|
removeChild(child, highPerformance = !1) {
|
|
13306
|
-
var _a;
|
|
13307
12765
|
const data = super.removeChild(child);
|
|
13308
|
-
return data ? highPerformance ? (
|
|
12766
|
+
return data ? highPerformance ? (child.detachStageForRelease(), data) : (this.getGraphicService().onRemove(child), child.setStage(null, null), this.addUpdateBoundTag(), data) : data;
|
|
13309
12767
|
}
|
|
13310
12768
|
removeAllChild(deep = !1) {
|
|
13311
12769
|
const children = this.children.slice();
|
|
@@ -13318,14 +12776,10 @@
|
|
|
13318
12776
|
setStage(stage, layer) {
|
|
13319
12777
|
var _a, _b, _c, _d, _e, _f;
|
|
13320
12778
|
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
|
|
13321
|
-
needsSharedStateTreeSync = this.
|
|
13322
|
-
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.
|
|
13323
|
-
item.setStage(stage, this.layer);
|
|
13324
|
-
});
|
|
12779
|
+
needsSharedStateTreeSync = this.hasSharedStateDefinitions() || this.sharedStateScope || (null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty;
|
|
12780
|
+
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.notifyChildrenSharedStateTreeChanged();
|
|
13325
12781
|
const layerChanged = this.layer !== layer;
|
|
13326
|
-
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.
|
|
13327
|
-
item.onParentSharedStateTreeChanged && item.onParentSharedStateTreeChanged(stage, this.layer);
|
|
13328
|
-
});
|
|
12782
|
+
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.notifyChildrenSharedStateTreeChanged();
|
|
13329
12783
|
}
|
|
13330
12784
|
addUpdatePositionTag() {
|
|
13331
12785
|
super.addUpdatePositionTag(), this.forEachChildren(g => {
|
|
@@ -13372,24 +12826,26 @@
|
|
|
13372
12826
|
}
|
|
13373
12827
|
detachStageForRelease() {
|
|
13374
12828
|
super.detachStageForRelease(), this.sharedStateScope = void 0, this.forEachChildren(item => {
|
|
13375
|
-
|
|
13376
|
-
null === (_a = item.detachStageForRelease) || void 0 === _a || _a.call(item);
|
|
12829
|
+
item.detachStageForRelease();
|
|
13377
12830
|
});
|
|
13378
12831
|
}
|
|
13379
12832
|
ensureSharedStateScopeBound() {
|
|
13380
12833
|
var _a, _b, _c;
|
|
13381
12834
|
if (!this.hasSharedStateDefinitions()) return void (this.sharedStateScope = void 0);
|
|
13382
12835
|
const parentScope = null !== (_b = null === (_a = this.parent) || void 0 === _a ? void 0 : _a.sharedStateScope) && void 0 !== _b ? _b : null === (_c = this.stage) || void 0 === _c ? void 0 : _c.rootSharedStateScope;
|
|
13383
|
-
this.sharedStateScope ? (this.sharedStateScope.
|
|
12836
|
+
this.sharedStateScope ? (this.sharedStateScope.ownerStage = this.stage, setSharedStateScopeParent(this.sharedStateScope, parentScope), this.sharedStateScope.localStateDefinitions !== this._sharedStateDefinitions && setSharedStateScopeLocalDefinitions(this.sharedStateScope, this._sharedStateDefinitions)) : this.sharedStateScope = createGroupSharedStateScope(this, parentScope, this._sharedStateDefinitions);
|
|
13384
12837
|
}
|
|
13385
12838
|
hasSharedStateDefinitions() {
|
|
13386
|
-
return this.
|
|
12839
|
+
return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
|
|
13387
12840
|
}
|
|
13388
12841
|
notifyChildrenSharedStateTreeChanged() {
|
|
13389
12842
|
this.forEachChildren(item => {
|
|
13390
|
-
|
|
12843
|
+
this.syncChildSharedStateTreeBinding(item);
|
|
13391
12844
|
});
|
|
13392
12845
|
}
|
|
12846
|
+
syncChildSharedStateTreeBinding(child) {
|
|
12847
|
+
child.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
12848
|
+
}
|
|
13393
12849
|
onParentSharedStateTreeChanged(stage, layer) {
|
|
13394
12850
|
var _a;
|
|
13395
12851
|
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)), this.notifyChildrenSharedStateTreeChanged()) : this.setStage(stage, layer);
|
|
@@ -14304,7 +13760,7 @@
|
|
|
14304
13760
|
}
|
|
14305
13761
|
}
|
|
14306
13762
|
|
|
14307
|
-
var __awaiter$
|
|
13763
|
+
var __awaiter$4 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14308
13764
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14309
13765
|
function fulfilled(value) {
|
|
14310
13766
|
try {
|
|
@@ -14374,7 +13830,7 @@
|
|
|
14374
13830
|
} else graphic.forEachChildren(cb, reverse);
|
|
14375
13831
|
}
|
|
14376
13832
|
function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
|
|
14377
|
-
return __awaiter$
|
|
13833
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
14378
13834
|
yield graphic.forEachChildrenAsync(cb, reverse);
|
|
14379
13835
|
});
|
|
14380
13836
|
}
|
|
@@ -14947,9 +14403,6 @@
|
|
|
14947
14403
|
register(key, renderer) {
|
|
14948
14404
|
this.entries.set(key, renderer), this.cache.delete(key);
|
|
14949
14405
|
}
|
|
14950
|
-
registerMany(entries) {
|
|
14951
|
-
for (const [key, renderer] of entries) this.register(key, renderer);
|
|
14952
|
-
}
|
|
14953
14406
|
get(key) {
|
|
14954
14407
|
if (this.cache.has(key)) return this.cache.get(key);
|
|
14955
14408
|
const entry = this.entries.get(key);
|
|
@@ -14972,9 +14425,6 @@
|
|
|
14972
14425
|
register(key, picker) {
|
|
14973
14426
|
this.entries.set(key, picker);
|
|
14974
14427
|
}
|
|
14975
|
-
registerMany(entries) {
|
|
14976
|
-
for (const [key, picker] of entries) this.register(key, picker);
|
|
14977
|
-
}
|
|
14978
14428
|
get(key) {
|
|
14979
14429
|
return this.entries.get(key);
|
|
14980
14430
|
}
|
|
@@ -15016,9 +14466,6 @@
|
|
|
15016
14466
|
const current = null !== (_a = this.entries.get(key)) && void 0 !== _a ? _a : [];
|
|
15017
14467
|
current.push(contribution), this.entries.set(key, current);
|
|
15018
14468
|
}
|
|
15019
|
-
registerMany(entries) {
|
|
15020
|
-
for (const [key, contribution] of entries) this.register(key, contribution);
|
|
15021
|
-
}
|
|
15022
14469
|
get(key) {
|
|
15023
14470
|
var _a;
|
|
15024
14471
|
return [...(null !== (_a = this.entries.get(key)) && void 0 !== _a ? _a : [])];
|
|
@@ -15036,8 +14483,8 @@
|
|
|
15036
14483
|
};
|
|
15037
14484
|
class DefaultPluginService {
|
|
15038
14485
|
constructor(autoEnablePlugins = EMPTY_AUTO_ENABLE_PROVIDER, deps = {}) {
|
|
15039
|
-
var _a
|
|
15040
|
-
this.autoEnablePlugins = autoEnablePlugins, this.onStartupFinishedPlugin = [], this.onRegisterPlugin = [], this.actived = !1, this.pluginRegistry = null !== (_a = deps.pluginRegistry) && void 0 !== _a ? _a : new PluginRegistry()
|
|
14486
|
+
var _a;
|
|
14487
|
+
this.autoEnablePlugins = autoEnablePlugins, this.onStartupFinishedPlugin = [], this.onRegisterPlugin = [], this.actived = !1, this.pluginRegistry = null !== (_a = deps.pluginRegistry) && void 0 !== _a ? _a : new PluginRegistry();
|
|
15041
14488
|
}
|
|
15042
14489
|
active(stage, params) {
|
|
15043
14490
|
this.stage = stage, this.actived = !0;
|
|
@@ -15186,29 +14633,28 @@
|
|
|
15186
14633
|
class DirtyBoundsPlugin {
|
|
15187
14634
|
constructor() {
|
|
15188
14635
|
this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.dirtyBoundsHooksRegistered = !1, this.handlePaintOnlyUpdate = graphic => {
|
|
15189
|
-
var _a
|
|
14636
|
+
var _a;
|
|
15190
14637
|
const stage = this.pluginService.stage;
|
|
15191
14638
|
if (!stage || stage !== graphic.stage || !stage.renderCount) return;
|
|
15192
14639
|
const owner = null !== (_a = graphic.glyphHost) && void 0 !== _a ? _a : graphic;
|
|
15193
14640
|
if (!(owner._updateTag & exports.UpdateTag.UPDATE_PAINT) || owner._updateTag & exports.UpdateTag.UPDATE_BOUNDS) return;
|
|
15194
14641
|
const ownerBounds = this.ensurePaintDirtyBoundsCache(owner);
|
|
15195
|
-
ownerBounds && !ownerBounds.empty() && stage.dirty(ownerBounds),
|
|
14642
|
+
ownerBounds && !ownerBounds.empty() && stage.dirty(ownerBounds), owner.clearUpdatePaintTag();
|
|
15196
14643
|
const shadowRoot = owner.shadowRoot;
|
|
15197
14644
|
if (!shadowRoot) return;
|
|
15198
14645
|
const shadowBounds = this.ensurePaintDirtyBoundsCache(shadowRoot);
|
|
15199
|
-
shadowBounds && !shadowBounds.empty() && stage.dirty(shadowBounds),
|
|
14646
|
+
shadowBounds && !shadowBounds.empty() && stage.dirty(shadowBounds), shadowRoot.clearUpdatePaintTag();
|
|
15200
14647
|
};
|
|
15201
14648
|
}
|
|
15202
14649
|
ensurePaintDirtyBoundsCache(graphic) {
|
|
15203
|
-
var _a
|
|
14650
|
+
var _a;
|
|
15204
14651
|
const owner = graphic;
|
|
15205
|
-
|
|
15206
|
-
return owner._globalAABBBounds && "function" == typeof owner._globalAABBBounds.empty && !owner._globalAABBBounds.empty() || "function" != typeof owner.tryUpdateGlobalAABBBounds || owner.tryUpdateGlobalAABBBounds(), null !== (_b = owner._globalAABBBounds) && void 0 !== _b ? _b : owner.globalAABBBounds;
|
|
14652
|
+
return owner._AABBBounds.empty() && owner.doUpdateAABBBounds("imprecise" === (null === (_a = owner.attribute) || void 0 === _a ? void 0 : _a.boundsMode)), owner._globalAABBBounds && !owner._globalAABBBounds.empty() || owner.tryUpdateGlobalAABBBounds(), owner._globalAABBBounds;
|
|
15207
14653
|
}
|
|
15208
14654
|
getRemoveDirtyBounds(graphic) {
|
|
15209
14655
|
var _a;
|
|
15210
14656
|
const cachedBounds = (null !== (_a = graphic.glyphHost) && void 0 !== _a ? _a : graphic)._globalAABBBounds;
|
|
15211
|
-
if (cachedBounds &&
|
|
14657
|
+
if (cachedBounds && !cachedBounds.empty()) return cachedBounds;
|
|
15212
14658
|
}
|
|
15213
14659
|
registerDirtyBoundsHooks(stage) {
|
|
15214
14660
|
this.dirtyBoundsHooksRegistered || (stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handlePaintOnlyUpdate), stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
|
|
@@ -15261,256 +14707,6 @@
|
|
|
15261
14707
|
return isBrowserEnv() ? "browser" : "node";
|
|
15262
14708
|
}
|
|
15263
14709
|
|
|
15264
|
-
var __awaiter$4 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
15265
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15266
|
-
function fulfilled(value) {
|
|
15267
|
-
try {
|
|
15268
|
-
step(generator.next(value));
|
|
15269
|
-
} catch (e) {
|
|
15270
|
-
reject(e);
|
|
15271
|
-
}
|
|
15272
|
-
}
|
|
15273
|
-
function rejected(value) {
|
|
15274
|
-
try {
|
|
15275
|
-
step(generator.throw(value));
|
|
15276
|
-
} catch (e) {
|
|
15277
|
-
reject(e);
|
|
15278
|
-
}
|
|
15279
|
-
}
|
|
15280
|
-
function step(result) {
|
|
15281
|
-
var value;
|
|
15282
|
-
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function (resolve) {
|
|
15283
|
-
resolve(value);
|
|
15284
|
-
})).then(fulfilled, rejected);
|
|
15285
|
-
}
|
|
15286
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15287
|
-
});
|
|
15288
|
-
};
|
|
15289
|
-
function isRenderableGraphic(graphic) {
|
|
15290
|
-
return !!graphic.stage && "released" !== graphic.releaseStatus;
|
|
15291
|
-
}
|
|
15292
|
-
function createTargetStatesKey(targetStates) {
|
|
15293
|
-
return targetStates.length ? targetStates.join("|") : "__clear__";
|
|
15294
|
-
}
|
|
15295
|
-
function createIntentKey(contextOwnerId, configFingerprint, targetStatesKey) {
|
|
15296
|
-
return `${contextOwnerId}:${configFingerprint}:${targetStatesKey}`;
|
|
15297
|
-
}
|
|
15298
|
-
function hasMeaningfulDeferredConfig(config) {
|
|
15299
|
-
const normalized = normalizeDeferredStateOwnerConfig(config);
|
|
15300
|
-
return !!normalized && (null != normalized.localEnabled || null != normalized.deferred);
|
|
15301
|
-
}
|
|
15302
|
-
function getGraphicCompiledDefinitions(graphic) {
|
|
15303
|
-
const graphicAny = graphic;
|
|
15304
|
-
if ("function" == typeof graphicAny.resolveEffectiveCompiledDefinitions) {
|
|
15305
|
-
const result = graphicAny.resolveEffectiveCompiledDefinitions();
|
|
15306
|
-
return {
|
|
15307
|
-
compiledDefinitions: result.compiledDefinitions,
|
|
15308
|
-
stateProxyEligibility: result.stateProxyEligibility
|
|
15309
|
-
};
|
|
15310
|
-
}
|
|
15311
|
-
return {};
|
|
15312
|
-
}
|
|
15313
|
-
function getCurrentStateNames(graphic) {
|
|
15314
|
-
var _a, _b;
|
|
15315
|
-
return null !== (_b = null === (_a = graphic.currentStates) || void 0 === _a ? void 0 : _a.slice()) && void 0 !== _b ? _b : [];
|
|
15316
|
-
}
|
|
15317
|
-
class StateBatchScheduler {
|
|
15318
|
-
constructor(stage, perfMonitor) {
|
|
15319
|
-
this.stage = stage, this.perfMonitor = perfMonitor, this.jobsByIntentKey = new Map(), this.pendingIntentByGraphic = new Map(), this.nextJobId = 1, this.runningJobs = new Map();
|
|
15320
|
-
}
|
|
15321
|
-
schedule(graphics, targetStates) {
|
|
15322
|
-
const batchOperation = graphics.length > 1;
|
|
15323
|
-
graphics.forEach(graphic => {
|
|
15324
|
-
const eligibility = this.resolveEligibility(graphic, targetStates, batchOperation, !0);
|
|
15325
|
-
if ("reason" in eligibility) return this.removeGraphicFromPending(graphic), void ("graphic_unavailable" !== eligibility.reason && this.commitSynchronously(graphic, targetStates));
|
|
15326
|
-
this.enqueueDeferredIntent(graphic, targetStates, eligibility.context, eligibility.targetStatesKey);
|
|
15327
|
-
});
|
|
15328
|
-
}
|
|
15329
|
-
release() {
|
|
15330
|
-
var _a;
|
|
15331
|
-
this.jobsByIntentKey.forEach(job => {
|
|
15332
|
-
job.status = "cancelled";
|
|
15333
|
-
}), this.jobsByIntentKey.clear(), this.pendingIntentByGraphic.clear(), this.runningJobs.clear(), null === (_a = this.perfMonitor) || void 0 === _a || _a.updateBatchPending(0);
|
|
15334
|
-
}
|
|
15335
|
-
resolveEligibility(graphic, targetStates, batchOperation, recordObservability) {
|
|
15336
|
-
var _a, _b, _c, _d, _e, _f;
|
|
15337
|
-
if (!isRenderableGraphic(graphic)) return recordObservability && (null === (_a = this.perfMonitor) || void 0 === _a || _a.recordDeferredIneligible("graphic_unavailable")), {
|
|
15338
|
-
eligible: !1,
|
|
15339
|
-
reason: "graphic_unavailable"
|
|
15340
|
-
};
|
|
15341
|
-
if (!batchOperation) return recordObservability && (null === (_b = this.perfMonitor) || void 0 === _b || _b.recordDeferredIneligible("non_batch_operation")), {
|
|
15342
|
-
eligible: !1,
|
|
15343
|
-
reason: "non_batch_operation"
|
|
15344
|
-
};
|
|
15345
|
-
const context = this.resolveDeferredContext(graphic);
|
|
15346
|
-
if (!context) return recordObservability && (null === (_c = this.perfMonitor) || void 0 === _c || _c.recordDeferredIneligible("graphic_unavailable")), {
|
|
15347
|
-
eligible: !1,
|
|
15348
|
-
reason: "graphic_unavailable"
|
|
15349
|
-
};
|
|
15350
|
-
if (!context.config.enabled) {
|
|
15351
|
-
const normalizedOwnerConfig = normalizeDeferredStateOwnerConfig(context.contextOwner.deferredStateConfig),
|
|
15352
|
-
reason = !1 === (null == normalizedOwnerConfig ? void 0 : normalizedOwnerConfig.localEnabled) ? "context_disabled" : "config_disabled";
|
|
15353
|
-
return recordObservability && (null === (_d = this.perfMonitor) || void 0 === _d || _d.recordDeferredIneligible(reason)), {
|
|
15354
|
-
eligible: !1,
|
|
15355
|
-
reason: reason
|
|
15356
|
-
};
|
|
15357
|
-
}
|
|
15358
|
-
const classification = this.classifyGraphicTargetStates(graphic, targetStates);
|
|
15359
|
-
return classification.reason ? (recordObservability && (null === (_e = this.perfMonitor) || void 0 === _e || _e.recordDeferredIneligible(classification.reason)), {
|
|
15360
|
-
eligible: !1,
|
|
15361
|
-
reason: classification.reason
|
|
15362
|
-
}) : classification.category !== UpdateCategory.PAINT ? (recordObservability && (null === (_f = this.perfMonitor) || void 0 === _f || _f.recordDeferredIneligible("mixed_update_category")), {
|
|
15363
|
-
eligible: !1,
|
|
15364
|
-
reason: "mixed_update_category"
|
|
15365
|
-
}) : {
|
|
15366
|
-
eligible: !0,
|
|
15367
|
-
context: context,
|
|
15368
|
-
targetStatesKey: createTargetStatesKey(targetStates)
|
|
15369
|
-
};
|
|
15370
|
-
}
|
|
15371
|
-
resolveDeferredContext(graphic) {
|
|
15372
|
-
var _a;
|
|
15373
|
-
const stage = graphic.stage;
|
|
15374
|
-
if (!stage) return;
|
|
15375
|
-
let owner = stage,
|
|
15376
|
-
config = normalizeDeferredStateConfig(void 0);
|
|
15377
|
-
const ownerConfigs = [stage],
|
|
15378
|
-
parents = [];
|
|
15379
|
-
let parent = graphic.parent;
|
|
15380
|
-
for (; parent && parent !== stage;) parents.push(parent), parent = parent.parent;
|
|
15381
|
-
parents.reverse().forEach(current => ownerConfigs.push(current)), ownerConfigs.forEach(current => {
|
|
15382
|
-
const deferredStateConfig = normalizeDeferredStateOwnerConfig(current.deferredStateConfig);
|
|
15383
|
-
deferredStateConfig && (deferredStateConfig.deferred && (config = Object.assign(Object.assign({}, config), deferredStateConfig.deferred)), null != deferredStateConfig.localEnabled && (config.enabled = deferredStateConfig.localEnabled), hasMeaningfulDeferredConfig(current.deferredStateConfig) && (owner = current));
|
|
15384
|
-
});
|
|
15385
|
-
const normalized = normalizeDeferredStateConfig(config);
|
|
15386
|
-
return {
|
|
15387
|
-
contextOwner: owner,
|
|
15388
|
-
contextOwnerId: null !== (_a = owner._uid) && void 0 !== _a ? _a : 0,
|
|
15389
|
-
config: normalized,
|
|
15390
|
-
configFingerprint: fingerprintDeferredStateConfig(normalized)
|
|
15391
|
-
};
|
|
15392
|
-
}
|
|
15393
|
-
classifyGraphicTargetStates(graphic, targetStates) {
|
|
15394
|
-
const {
|
|
15395
|
-
compiledDefinitions: compiledDefinitions,
|
|
15396
|
-
stateProxyEligibility: stateProxyEligibility
|
|
15397
|
-
} = getGraphicCompiledDefinitions(graphic),
|
|
15398
|
-
candidateStates = Array.from(new Set([...getCurrentStateNames(graphic), ...targetStates]));
|
|
15399
|
-
let category = UpdateCategory.NONE;
|
|
15400
|
-
return candidateStates.forEach(stateName => {
|
|
15401
|
-
if (null == stateProxyEligibility ? void 0 : stateProxyEligibility(stateName)) return void (category = UpdateCategory.NONE);
|
|
15402
|
-
const definition = null == compiledDefinitions ? void 0 : compiledDefinitions.get(stateName);
|
|
15403
|
-
definition && (definition.hasResolver && 0 === definition.affectedKeys.size ? category = UpdateCategory.NONE : category |= classifyAffectedKeys(definition.affectedKeys));
|
|
15404
|
-
}), candidateStates.some(stateName => null == stateProxyEligibility ? void 0 : stateProxyEligibility(stateName)) || candidateStates.some(stateName => {
|
|
15405
|
-
const definition = null == compiledDefinitions ? void 0 : compiledDefinitions.get(stateName);
|
|
15406
|
-
return !!(null == definition ? void 0 : definition.hasResolver) && 0 === definition.affectedKeys.size;
|
|
15407
|
-
}) ? {
|
|
15408
|
-
category: UpdateCategory.NONE,
|
|
15409
|
-
reason: "resolver_unstable_keys"
|
|
15410
|
-
} : {
|
|
15411
|
-
category: category === UpdateCategory.NONE ? UpdateCategory.PAINT : category
|
|
15412
|
-
};
|
|
15413
|
-
}
|
|
15414
|
-
enqueueDeferredIntent(graphic, targetStates, context, targetStatesKey) {
|
|
15415
|
-
var _a, _b, _c, _d, _e, _f;
|
|
15416
|
-
const nextIntentKey = createIntentKey(context.contextOwnerId, context.configFingerprint, targetStatesKey),
|
|
15417
|
-
prevIntentKey = this.pendingIntentByGraphic.get(graphic);
|
|
15418
|
-
if (prevIntentKey === nextIntentKey) return void (null === (_a = this.perfMonitor) || void 0 === _a || _a.incrementCounter("deferredJobsCoalesced"));
|
|
15419
|
-
prevIntentKey && this.removeGraphicFromIntentJob(graphic, prevIntentKey);
|
|
15420
|
-
let job = this.jobsByIntentKey.get(nextIntentKey);
|
|
15421
|
-
job ? null === (_d = this.perfMonitor) || void 0 === _d || _d.incrementCounter("deferredJobsCoalesced") : (job = {
|
|
15422
|
-
id: this.nextJobId++,
|
|
15423
|
-
kind: "apply_states",
|
|
15424
|
-
intentKey: nextIntentKey,
|
|
15425
|
-
status: "pending",
|
|
15426
|
-
targetStates: [...targetStates],
|
|
15427
|
-
targetStatesKey: targetStatesKey,
|
|
15428
|
-
pendingGraphics: new Set(),
|
|
15429
|
-
orderedGraphics: [],
|
|
15430
|
-
config: context.config,
|
|
15431
|
-
contextOwner: context.contextOwner,
|
|
15432
|
-
contextOwnerId: context.contextOwnerId,
|
|
15433
|
-
configFingerprint: context.configFingerprint,
|
|
15434
|
-
createdAt: Date.now(),
|
|
15435
|
-
processedCount: 0
|
|
15436
|
-
}, this.jobsByIntentKey.set(nextIntentKey, job), null === (_b = this.perfMonitor) || void 0 === _b || _b.incrementCounter("deferredJobsCreated"), null === (_c = this.perfMonitor) || void 0 === _c || _c.updateBatchPending(this.jobsByIntentKey.size)), job.pendingGraphics.has(graphic) || (job.pendingGraphics.add(graphic), job.orderedGraphics.push(graphic), this.pendingIntentByGraphic.set(graphic, nextIntentKey), null === (_e = this.perfMonitor) || void 0 === _e || _e.recordAllocation("batchEntriesCreated"), null === (_f = this.perfMonitor) || void 0 === _f || _f.updateMaxGraphicsInJob(job.pendingGraphics.size)), this.ensureJobRunning(job);
|
|
15437
|
-
}
|
|
15438
|
-
removeGraphicFromPending(graphic) {
|
|
15439
|
-
const prevIntentKey = this.pendingIntentByGraphic.get(graphic);
|
|
15440
|
-
prevIntentKey && this.removeGraphicFromIntentJob(graphic, prevIntentKey);
|
|
15441
|
-
}
|
|
15442
|
-
removeGraphicFromIntentJob(graphic, intentKey) {
|
|
15443
|
-
var _a, _b, _c;
|
|
15444
|
-
const job = this.jobsByIntentKey.get(intentKey);
|
|
15445
|
-
job ? (job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.get(graphic) === intentKey && this.pendingIntentByGraphic.delete(graphic), 0 === job.pendingGraphics.size && "completed" !== job.status && (job.status = "cancelled", this.jobsByIntentKey.delete(intentKey), null === (_a = this.perfMonitor) || void 0 === _a || _a.incrementCounter("deferredJobsCancelled"), null === (_b = this.perfMonitor) || void 0 === _b || _b.recordEvent("deferred-job-cancel", {
|
|
15446
|
-
intentKey: intentKey,
|
|
15447
|
-
jobId: job.id
|
|
15448
|
-
}), null === (_c = this.perfMonitor) || void 0 === _c || _c.updateBatchPending(this.jobsByIntentKey.size))) : this.pendingIntentByGraphic.delete(graphic);
|
|
15449
|
-
}
|
|
15450
|
-
ensureJobRunning(job) {
|
|
15451
|
-
if (this.runningJobs.has(job.intentKey)) return;
|
|
15452
|
-
const runner = this.runJob(job).then(() => {
|
|
15453
|
-
this.runningJobs.delete(job.intentKey);
|
|
15454
|
-
}, () => {
|
|
15455
|
-
this.runningJobs.delete(job.intentKey);
|
|
15456
|
-
});
|
|
15457
|
-
this.runningJobs.set(job.intentKey, runner);
|
|
15458
|
-
}
|
|
15459
|
-
runJob(job) {
|
|
15460
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
15461
|
-
return __awaiter$4(this, void 0, void 0, function* () {
|
|
15462
|
-
if ("cancelled" === job.status) return;
|
|
15463
|
-
if (yield this.waitForNextFrame(), "cancelled" === job.status) return;
|
|
15464
|
-
job.status = "running", null === (_a = this.perfMonitor) || void 0 === _a || _a.recordEvent("deferred-job-start", {
|
|
15465
|
-
intentKey: job.intentKey,
|
|
15466
|
-
jobId: job.id
|
|
15467
|
-
});
|
|
15468
|
-
let index = 0,
|
|
15469
|
-
frameStart = performance.now(),
|
|
15470
|
-
processedInFrame = 0,
|
|
15471
|
-
committedInSlice = 0;
|
|
15472
|
-
for (; index < job.orderedGraphics.length;) {
|
|
15473
|
-
if ("cancelled" === job.status) return;
|
|
15474
|
-
processedInFrame > 0 && (processedInFrame >= job.config.maxGraphicsPerFrame || performance.now() - frameStart >= job.config.frameBudget) && (null === (_b = this.perfMonitor) || void 0 === _b || _b.incrementCounter("deferredBudgetYields"), null === (_c = this.perfMonitor) || void 0 === _c || _c.recordCost("batchSlice", performance.now() - frameStart), null === (_d = this.perfMonitor) || void 0 === _d || _d.recordEvent("deferred-job-yield", {
|
|
15475
|
-
intentKey: job.intentKey,
|
|
15476
|
-
jobId: job.id,
|
|
15477
|
-
processedInFrame: processedInFrame
|
|
15478
|
-
}), committedInSlice > 0 && this.stage.renderNextFrame(), yield this.waitForNextFrame(), frameStart = performance.now(), processedInFrame = 0, committedInSlice = 0);
|
|
15479
|
-
const graphic = job.orderedGraphics[index++];
|
|
15480
|
-
if (!job.pendingGraphics.has(graphic)) continue;
|
|
15481
|
-
if (!isRenderableGraphic(graphic)) {
|
|
15482
|
-
job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.get(graphic) === job.intentKey && this.pendingIntentByGraphic.delete(graphic);
|
|
15483
|
-
continue;
|
|
15484
|
-
}
|
|
15485
|
-
if (this.pendingIntentByGraphic.get(graphic) !== job.intentKey) {
|
|
15486
|
-
job.pendingGraphics.delete(graphic);
|
|
15487
|
-
continue;
|
|
15488
|
-
}
|
|
15489
|
-
const nextEligibility = this.resolveEligibility(graphic, job.targetStates, !0, !1);
|
|
15490
|
-
if (!nextEligibility.eligible) {
|
|
15491
|
-
job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic), this.commitSynchronously(graphic, job.targetStates);
|
|
15492
|
-
continue;
|
|
15493
|
-
}
|
|
15494
|
-
createIntentKey(nextEligibility.context.contextOwnerId, nextEligibility.context.configFingerprint, nextEligibility.targetStatesKey) === job.intentKey ? (this.commitSynchronously(graphic, job.targetStates), job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic), job.processedCount += 1, processedInFrame += 1, committedInSlice += 1, null === (_e = this.perfMonitor) || void 0 === _e || _e.incrementCounter("deferredGraphicsCommitted")) : (job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic), this.enqueueDeferredIntent(graphic, job.targetStates, nextEligibility.context, nextEligibility.targetStatesKey));
|
|
15495
|
-
}
|
|
15496
|
-
processedInFrame > 0 && (null === (_f = this.perfMonitor) || void 0 === _f || _f.recordCost("batchSlice", performance.now() - frameStart), this.stage.renderNextFrame()), 0 === job.pendingGraphics.size && this.jobsByIntentKey.get(job.intentKey) === job && (job.status = "completed", this.jobsByIntentKey.delete(job.intentKey), null === (_g = this.perfMonitor) || void 0 === _g || _g.incrementCounter("deferredJobsCompleted"), null === (_h = this.perfMonitor) || void 0 === _h || _h.recordEvent("deferred-job-complete", {
|
|
15497
|
-
intentKey: job.intentKey,
|
|
15498
|
-
jobId: job.id,
|
|
15499
|
-
processedCount: job.processedCount
|
|
15500
|
-
}), null === (_j = this.perfMonitor) || void 0 === _j || _j.updateBatchPending(this.jobsByIntentKey.size));
|
|
15501
|
-
});
|
|
15502
|
-
}
|
|
15503
|
-
waitForNextFrame() {
|
|
15504
|
-
const stageGlobal = this.stage.global;
|
|
15505
|
-
return (null == stageGlobal ? void 0 : stageGlobal.getSpecifiedPerformanceRAF) ? stageGlobal.getSpecifiedPerformanceRAF(this.stage.rafId).wait() : new Promise(resolve => {
|
|
15506
|
-
null == stageGlobal || stageGlobal.getSpecifiedRequestAnimationFrame(this.stage.rafId)(() => resolve());
|
|
15507
|
-
});
|
|
15508
|
-
}
|
|
15509
|
-
commitSynchronously(graphic, targetStates) {
|
|
15510
|
-
isRenderableGraphic(graphic) && (targetStates.length ? graphic.useStates(targetStates, !1) : graphic.clearStates(!1));
|
|
15511
|
-
}
|
|
15512
|
-
}
|
|
15513
|
-
|
|
15514
14710
|
const DefaultConfig = {
|
|
15515
14711
|
WIDTH: 500,
|
|
15516
14712
|
HEIGHT: 500,
|
|
@@ -15627,10 +14823,9 @@
|
|
|
15627
14823
|
main: !0
|
|
15628
14824
|
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.theme.onStateDefinitionsChange = () => {
|
|
15629
14825
|
var _a;
|
|
15630
|
-
const definitions = null === (_a = this.theme) || void 0 === _a ? void 0 : _a.stateDefinitions
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
setRootSharedStateScopeThemeDefinitions(rootScope, definitions), markScopeActiveDescendantsDirty(rootScope, this);
|
|
14826
|
+
const definitions = null === (_a = this.theme) || void 0 === _a ? void 0 : _a.stateDefinitions,
|
|
14827
|
+
rootScope = definitions && Object.keys(definitions).length ? this.ensureRootSharedStateScope(definitions) : this.rootSharedStateScope;
|
|
14828
|
+
rootScope && (setRootSharedStateScopeThemeDefinitions(rootScope, definitions), markScopeActiveDescendantsDirty(rootScope, this));
|
|
15634
14829
|
}, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), params.beforeRender && this._beforeRenderList.push(params.beforeRender), params.afterRender && this._afterRenderList.push(params.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
|
|
15635
14830
|
tickRenderMode: "effect"
|
|
15636
14831
|
}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
@@ -15898,18 +15093,6 @@
|
|
|
15898
15093
|
ensureRootSharedStateScope(themeStateDefinitions) {
|
|
15899
15094
|
return this.rootSharedStateScope ? (this.rootSharedStateScope.ownerStage = this, this.rootSharedStateScope) : (this.rootSharedStateScope = createRootSharedStateScope(this, themeStateDefinitions), this.rootSharedStateScope);
|
|
15900
15095
|
}
|
|
15901
|
-
getStateBatchScheduler() {
|
|
15902
|
-
return this._stateBatchScheduler || (this._stateBatchScheduler = new StateBatchScheduler(this, ensureStageStatePerfMonitor(this))), this._stateBatchScheduler;
|
|
15903
|
-
}
|
|
15904
|
-
scheduleStateBatch(graphics, targetStates) {
|
|
15905
|
-
this.getStateBatchScheduler().schedule(graphics, targetStates);
|
|
15906
|
-
}
|
|
15907
|
-
getStatePerfSnapshot() {
|
|
15908
|
-
return ensureStageStatePerfMonitor(this).getSnapshot();
|
|
15909
|
-
}
|
|
15910
|
-
resetStatePerfSnapshot() {
|
|
15911
|
-
ensureStageStatePerfMonitor(this).reset();
|
|
15912
|
-
}
|
|
15913
15096
|
_doRenderInThisFrame() {
|
|
15914
15097
|
if ("released" === this.releaseStatus) return;
|
|
15915
15098
|
this.startAnimate();
|
|
@@ -15985,12 +15168,12 @@
|
|
|
15985
15168
|
throw new Error("暂不支持");
|
|
15986
15169
|
}
|
|
15987
15170
|
release() {
|
|
15988
|
-
var _a, _b, _d
|
|
15989
|
-
|
|
15171
|
+
var _a, _b, _d;
|
|
15172
|
+
super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
|
|
15990
15173
|
layer.release();
|
|
15991
15174
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
15992
15175
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
15993
|
-
}), this.interactiveLayer.release()), this.window.release(), null === (
|
|
15176
|
+
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
|
|
15994
15177
|
}
|
|
15995
15178
|
setStage(stage) {}
|
|
15996
15179
|
dirty(b, matrix) {
|
|
@@ -20386,24 +19569,16 @@
|
|
|
20386
19569
|
this.context.release();
|
|
20387
19570
|
}
|
|
20388
19571
|
}
|
|
20389
|
-
function createBrowserApp
|
|
19572
|
+
function createBrowserApp(options = {}) {
|
|
20390
19573
|
return new BrowserEntry(options);
|
|
20391
19574
|
}
|
|
20392
19575
|
|
|
20393
|
-
class NodeEntry extends BrowserEntry {
|
|
20394
|
-
constructor(options = {}) {
|
|
20395
|
-
super(options);
|
|
20396
|
-
}
|
|
20397
|
-
}
|
|
19576
|
+
class NodeEntry extends BrowserEntry {}
|
|
20398
19577
|
function createNodeApp$1(options = {}) {
|
|
20399
19578
|
return new NodeEntry(options);
|
|
20400
19579
|
}
|
|
20401
19580
|
|
|
20402
|
-
class MiniappEntry extends BrowserEntry {
|
|
20403
|
-
constructor(options = {}) {
|
|
20404
|
-
super(options);
|
|
20405
|
-
}
|
|
20406
|
-
}
|
|
19581
|
+
class MiniappEntry extends BrowserEntry {}
|
|
20407
19582
|
function createMiniappApp$1(options = {}) {
|
|
20408
19583
|
return new MiniappEntry(options);
|
|
20409
19584
|
}
|
|
@@ -21196,7 +20371,7 @@
|
|
|
21196
20371
|
};
|
|
21197
20372
|
}
|
|
21198
20373
|
|
|
21199
|
-
var __rest$
|
|
20374
|
+
var __rest$f = undefined && undefined.__rest || function (s, e) {
|
|
21200
20375
|
var t = {};
|
|
21201
20376
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
21202
20377
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -21294,7 +20469,7 @@
|
|
|
21294
20469
|
{
|
|
21295
20470
|
textConfig = []
|
|
21296
20471
|
} = _a,
|
|
21297
|
-
rest = __rest$
|
|
20472
|
+
rest = __rest$f(_a, ["textConfig"]);
|
|
21298
20473
|
if ("Backspace" === ev.type && !textConfig.length) return;
|
|
21299
20474
|
let str = ev.data;
|
|
21300
20475
|
this.isComposing || "Backspace" === ev.type || str || (str = "\n"), this.selectionStartCursorIdx > this.cursorIndex && ([this.cursorIndex, this.selectionStartCursorIdx] = [this.selectionStartCursorIdx, this.cursorIndex]);
|
|
@@ -22316,77 +21491,82 @@
|
|
|
22316
21491
|
return instance;
|
|
22317
21492
|
}
|
|
22318
21493
|
|
|
22319
|
-
|
|
21494
|
+
function isBindingContextLoaded(loadedContexts, context) {
|
|
21495
|
+
const key = "object" == typeof context && null !== context || "function" == typeof context ? context : loadedContexts;
|
|
21496
|
+
return !!loadedContexts.has(key) || (loadedContexts.add(key), !1);
|
|
21497
|
+
}
|
|
21498
|
+
|
|
21499
|
+
const loadedArcModuleContexts = new WeakSet();
|
|
22320
21500
|
function bindArcRenderModule({
|
|
22321
21501
|
bind: bind
|
|
22322
21502
|
}) {
|
|
22323
|
-
|
|
21503
|
+
isBindingContextLoaded(loadedArcModuleContexts, bind) || (bind(DefaultCanvasArcRender).toSelf().inSingletonScope(), bind(ArcRender).to(DefaultCanvasArcRender).inSingletonScope(), bind(GraphicRender).toService(ArcRender), bind(ArcRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, ArcRenderContribution));
|
|
22324
21504
|
}
|
|
22325
21505
|
const arcModule = bindArcRenderModule;
|
|
22326
21506
|
|
|
22327
|
-
|
|
21507
|
+
const loadedRectModuleContexts = new WeakSet();
|
|
22328
21508
|
function bindRectRenderModule({
|
|
22329
21509
|
bind: bind
|
|
22330
21510
|
}) {
|
|
22331
|
-
|
|
21511
|
+
isBindingContextLoaded(loadedRectModuleContexts, bind) || (bind(DefaultCanvasRectRender).toDynamicValue(({
|
|
22332
21512
|
container: container
|
|
22333
21513
|
}) => new DefaultCanvasRectRender(createContributionProvider$1(RectRenderContribution, container))).inSingletonScope(), bind(RectRender).toService(DefaultCanvasRectRender), bind(GraphicRender).toService(RectRender), bind(SplitRectAfterRenderContribution).toSelf(), bind(SplitRectBeforeRenderContribution).toSelf(), bind(RectRenderContribution).toService(SplitRectAfterRenderContribution), bind(RectRenderContribution).toService(SplitRectBeforeRenderContribution), bind(RectRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, RectRenderContribution));
|
|
22334
21514
|
}
|
|
22335
21515
|
const rectModule = bindRectRenderModule;
|
|
22336
21516
|
|
|
22337
|
-
|
|
21517
|
+
const loadedLineModuleContexts = new WeakSet();
|
|
22338
21518
|
function bindLineRenderModule({
|
|
22339
21519
|
bind: bind
|
|
22340
21520
|
}) {
|
|
22341
|
-
|
|
21521
|
+
isBindingContextLoaded(loadedLineModuleContexts, bind) || (bind(DefaultCanvasLineRender).toSelf().inSingletonScope(), bind(DefaultIncrementalCanvasLineRender).toSelf().inSingletonScope(), bind(LineRender).to(DefaultCanvasLineRender).inSingletonScope(), bind(GraphicRender).toService(LineRender));
|
|
22342
21522
|
}
|
|
22343
21523
|
const lineModule = bindLineRenderModule;
|
|
22344
21524
|
|
|
22345
|
-
|
|
21525
|
+
const loadedAreaModuleContexts = new WeakSet();
|
|
22346
21526
|
function bindAreaRenderModule({
|
|
22347
21527
|
bind: bind
|
|
22348
21528
|
}) {
|
|
22349
|
-
|
|
21529
|
+
isBindingContextLoaded(loadedAreaModuleContexts, bind) || (bind(DefaultCanvasAreaRender).toSelf().inSingletonScope(), bind(AreaRender).to(DefaultCanvasAreaRender).inSingletonScope(), bind(GraphicRender).toService(AreaRender), bind(AreaRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, AreaRenderContribution), bind(DefaultIncrementalCanvasAreaRender).toSelf().inSingletonScope());
|
|
22350
21530
|
}
|
|
22351
21531
|
const areaModule = bindAreaRenderModule;
|
|
22352
21532
|
|
|
22353
|
-
|
|
21533
|
+
const loadedSymbolModuleContexts = new WeakSet();
|
|
22354
21534
|
function bindSymbolRenderModule({
|
|
22355
21535
|
bind: bind
|
|
22356
21536
|
}) {
|
|
22357
|
-
|
|
21537
|
+
isBindingContextLoaded(loadedSymbolModuleContexts, bind) || (bind(DefaultCanvasSymbolRender).toSelf().inSingletonScope(), bind(SymbolRender).to(DefaultCanvasSymbolRender).inSingletonScope(), bind(GraphicRender).toService(SymbolRender), bind(SymbolRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, SymbolRenderContribution));
|
|
22358
21538
|
}
|
|
22359
21539
|
const symbolModule = bindSymbolRenderModule;
|
|
22360
21540
|
|
|
22361
|
-
|
|
21541
|
+
const loadedCircleModuleContexts = new WeakSet();
|
|
22362
21542
|
function bindCircleRenderModule({
|
|
22363
21543
|
bind: bind
|
|
22364
21544
|
}) {
|
|
22365
|
-
|
|
21545
|
+
isBindingContextLoaded(loadedCircleModuleContexts, bind) || (bind(DefaultCanvasCircleRender).toSelf().inSingletonScope(), bind(CircleRender).to(DefaultCanvasCircleRender).inSingletonScope(), bind(GraphicRender).toService(CircleRender), bind(CircleRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, CircleRenderContribution));
|
|
22366
21546
|
}
|
|
22367
21547
|
const circleModule = bindCircleRenderModule;
|
|
22368
21548
|
|
|
22369
|
-
|
|
21549
|
+
const loadedTextModuleContexts = new WeakSet();
|
|
22370
21550
|
function bindTextRenderModule({
|
|
22371
21551
|
bind: bind
|
|
22372
21552
|
}) {
|
|
22373
|
-
|
|
21553
|
+
isBindingContextLoaded(loadedTextModuleContexts, bind) || (bind(TextRender).to(DefaultCanvasTextRender).inSingletonScope(), bind(GraphicRender).toService(TextRender), bind(TextRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, TextRenderContribution));
|
|
22374
21554
|
}
|
|
22375
21555
|
const textModule = bindTextRenderModule;
|
|
22376
21556
|
|
|
22377
|
-
|
|
21557
|
+
const loadedPathModuleContexts = new WeakSet();
|
|
22378
21558
|
function bindPathRenderModule({
|
|
22379
21559
|
bind: bind
|
|
22380
21560
|
}) {
|
|
22381
|
-
|
|
21561
|
+
isBindingContextLoaded(loadedPathModuleContexts, bind) || (bind(DefaultCanvasPathRender).toSelf().inSingletonScope(), bind(PathRender).to(DefaultCanvasPathRender).inSingletonScope(), bind(GraphicRender).toService(PathRender), bind(PathRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, PathRenderContribution));
|
|
22382
21562
|
}
|
|
22383
21563
|
const pathModule = bindPathRenderModule;
|
|
22384
21564
|
|
|
22385
|
-
|
|
21565
|
+
const loadedPolygonModuleContexts = new WeakSet();
|
|
22386
21566
|
function bindPolygonRenderModule({
|
|
22387
21567
|
bind: bind
|
|
22388
21568
|
}) {
|
|
22389
|
-
|
|
21569
|
+
isBindingContextLoaded(loadedPolygonModuleContexts, bind) || (bind(PolygonRender).to(DefaultCanvasPolygonRender).inSingletonScope(), bind(GraphicRender).toService(PolygonRender), bind(PolygonRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, PolygonRenderContribution));
|
|
22390
21570
|
}
|
|
22391
21571
|
const polygonModule = bindPolygonRenderModule;
|
|
22392
21572
|
|
|
@@ -22427,11 +21607,11 @@
|
|
|
22427
21607
|
}
|
|
22428
21608
|
}
|
|
22429
21609
|
|
|
22430
|
-
|
|
21610
|
+
const loadedStarModuleContexts = new WeakSet();
|
|
22431
21611
|
function bindStarRenderModule({
|
|
22432
21612
|
bind: bind
|
|
22433
21613
|
}) {
|
|
22434
|
-
|
|
21614
|
+
isBindingContextLoaded(loadedStarModuleContexts, bind) || (bind(DefaultCanvasStarRender).toDynamicValue(({
|
|
22435
21615
|
container: container
|
|
22436
21616
|
}) => new DefaultCanvasStarRender(createContributionProvider$1(StarRenderContribution, container))).inSingletonScope(), bind(StarRender).toService(DefaultCanvasStarRender), bind(GraphicRender).toService(StarRender));
|
|
22437
21617
|
}
|
|
@@ -22464,11 +21644,11 @@
|
|
|
22464
21644
|
}
|
|
22465
21645
|
}
|
|
22466
21646
|
|
|
22467
|
-
|
|
21647
|
+
const loadedGlyphModuleContexts = new WeakSet();
|
|
22468
21648
|
function bindGlyphRenderModule({
|
|
22469
21649
|
bind: bind
|
|
22470
21650
|
}) {
|
|
22471
|
-
|
|
21651
|
+
isBindingContextLoaded(loadedGlyphModuleContexts, bind) || (bind(GlyphRender).to(DefaultCanvasGlyphRender).inSingletonScope(), bind(GraphicRender).toService(GlyphRender));
|
|
22472
21652
|
}
|
|
22473
21653
|
const glyphModule = bindGlyphRenderModule;
|
|
22474
21654
|
|
|
@@ -22524,19 +21704,19 @@
|
|
|
22524
21704
|
}
|
|
22525
21705
|
}
|
|
22526
21706
|
|
|
22527
|
-
|
|
21707
|
+
const loadedRichtextModuleContexts = new WeakSet();
|
|
22528
21708
|
function bindRichtextRenderModule({
|
|
22529
21709
|
bind: bind
|
|
22530
21710
|
}) {
|
|
22531
|
-
|
|
21711
|
+
isBindingContextLoaded(loadedRichtextModuleContexts, bind) || (bind(RichTextRender).to(DefaultCanvasRichTextRender).inSingletonScope(), bind(GraphicRender).toService(RichTextRender));
|
|
22532
21712
|
}
|
|
22533
21713
|
const richtextModule = bindRichtextRenderModule;
|
|
22534
21714
|
|
|
22535
|
-
|
|
21715
|
+
const loadedImageModuleContexts = new WeakSet();
|
|
22536
21716
|
function bindImageRenderModule({
|
|
22537
21717
|
bind: bind
|
|
22538
21718
|
}) {
|
|
22539
|
-
|
|
21719
|
+
isBindingContextLoaded(loadedImageModuleContexts, bind) || (bind(ImageRender).to(DefaultCanvasImageRender).inSingletonScope(), bind(GraphicRender).toService(ImageRender), bind(ImageRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, ImageRenderContribution));
|
|
22540
21720
|
}
|
|
22541
21721
|
const imageModule = bindImageRenderModule;
|
|
22542
21722
|
|
|
@@ -22663,11 +21843,11 @@
|
|
|
22663
21843
|
}
|
|
22664
21844
|
}
|
|
22665
21845
|
|
|
22666
|
-
|
|
21846
|
+
const loadedRect3dModuleContexts = new WeakSet();
|
|
22667
21847
|
function bindRect3dRenderModule({
|
|
22668
21848
|
bind: bind
|
|
22669
21849
|
}) {
|
|
22670
|
-
|
|
21850
|
+
isBindingContextLoaded(loadedRect3dModuleContexts, bind) || (bind(Rect3DRender).to(DefaultCanvasRect3dRender).inSingletonScope(), bind(GraphicRender).toService(Rect3DRender));
|
|
22671
21851
|
}
|
|
22672
21852
|
const rect3dModule = bindRect3dRenderModule;
|
|
22673
21853
|
|
|
@@ -22792,11 +21972,11 @@
|
|
|
22792
21972
|
}
|
|
22793
21973
|
}
|
|
22794
21974
|
|
|
22795
|
-
|
|
21975
|
+
const loadedArc3dModuleContexts = new WeakSet();
|
|
22796
21976
|
function bindArc3dRenderModule({
|
|
22797
21977
|
bind: bind
|
|
22798
21978
|
}) {
|
|
22799
|
-
|
|
21979
|
+
isBindingContextLoaded(loadedArc3dModuleContexts, bind) || (bind(Arc3dRender).to(DefaultCanvasArc3DRender).inSingletonScope(), bind(GraphicRender).toService(Arc3dRender));
|
|
22800
21980
|
}
|
|
22801
21981
|
const arc3dModule = bindArc3dRenderModule;
|
|
22802
21982
|
|
|
@@ -22831,11 +22011,11 @@
|
|
|
22831
22011
|
}
|
|
22832
22012
|
}
|
|
22833
22013
|
|
|
22834
|
-
|
|
22014
|
+
const loadedPyramid3dModuleContexts = new WeakSet();
|
|
22835
22015
|
function bindPyramid3dRenderModule({
|
|
22836
22016
|
bind: bind
|
|
22837
22017
|
}) {
|
|
22838
|
-
|
|
22018
|
+
isBindingContextLoaded(loadedPyramid3dModuleContexts, bind) || (bind(Pyramid3dRender).to(DefaultCanvasPyramid3dRender).inSingletonScope(), bind(GraphicRender).toService(Pyramid3dRender));
|
|
22839
22019
|
}
|
|
22840
22020
|
const pyramid3dModule = bindPyramid3dRenderModule;
|
|
22841
22021
|
|
|
@@ -23800,11 +22980,11 @@
|
|
|
23800
22980
|
configureRuntimeApplicationForApp: configureRuntimeApplicationForApp,
|
|
23801
22981
|
container: container,
|
|
23802
22982
|
cornerTangents: cornerTangents,
|
|
23803
|
-
createApp: createBrowserApp
|
|
22983
|
+
createApp: createBrowserApp,
|
|
23804
22984
|
createArc: createArc,
|
|
23805
22985
|
createArc3d: createArc3d,
|
|
23806
22986
|
createArea: createArea,
|
|
23807
|
-
createBrowserApp: createBrowserApp
|
|
22987
|
+
createBrowserApp: createBrowserApp,
|
|
23808
22988
|
createCanvasEventTransformer: createCanvasEventTransformer,
|
|
23809
22989
|
createCircle: createCircle,
|
|
23810
22990
|
createColor: createColor,
|
|
@@ -31547,7 +30727,7 @@
|
|
|
31547
30727
|
}, params);
|
|
31548
30728
|
};
|
|
31549
30729
|
|
|
31550
|
-
var __rest$
|
|
30730
|
+
var __rest$e = undefined && undefined.__rest || function (s, e) {
|
|
31551
30731
|
var t = {};
|
|
31552
30732
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
31553
30733
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -31563,21 +30743,20 @@
|
|
|
31563
30743
|
function jsx(type, config, ...children) {
|
|
31564
30744
|
const _a = config || {},
|
|
31565
30745
|
{
|
|
31566
|
-
key: key,
|
|
31567
30746
|
name: name,
|
|
31568
30747
|
id: id,
|
|
31569
30748
|
attribute: attribute,
|
|
31570
|
-
|
|
30749
|
+
states: states,
|
|
31571
30750
|
animation: animation,
|
|
31572
30751
|
timeline: timeline
|
|
31573
30752
|
} = _a,
|
|
31574
|
-
props = __rest$
|
|
30753
|
+
props = __rest$e(_a, ["name", "id", "attribute", "states", "animation", "timeline"]);
|
|
31575
30754
|
let c = type;
|
|
31576
30755
|
isString$1(type) && (c = graphicCreator$1[type]);
|
|
31577
30756
|
const childrenList = [];
|
|
31578
30757
|
children.length && flatten(1 === children.length ? children[0] : children, childrenList);
|
|
31579
30758
|
const g = "Group" === c.name ? new c(attribute) : c(config);
|
|
31580
|
-
if (parseToGraphic$1(g, childrenList, props),
|
|
30759
|
+
if (parseToGraphic$1(g, childrenList, props), name && (g.name = name), id && (g.id = id), states && (g.states = states), isArray$1(animation)) {
|
|
31581
30760
|
const animate = g.animate();
|
|
31582
30761
|
timeline && animate.setTimeline(timeline), animation.forEach(item => {
|
|
31583
30762
|
animate[item[0]](...item.slice(1));
|
|
@@ -31613,7 +30792,7 @@
|
|
|
31613
30792
|
{
|
|
31614
30793
|
attribute: attribute,
|
|
31615
30794
|
children: children,
|
|
31616
|
-
|
|
30795
|
+
states: states,
|
|
31617
30796
|
id: id,
|
|
31618
30797
|
name: name
|
|
31619
30798
|
} = dom.props,
|
|
@@ -31621,7 +30800,7 @@
|
|
|
31621
30800
|
attribute: attribute
|
|
31622
30801
|
}),
|
|
31623
30802
|
out = parseToGraphic(g, dom.props, children);
|
|
31624
|
-
return out || (
|
|
30803
|
+
return out || (g.id = id, g.name = name, states && (g.states = states), parseChildren(children, g), g);
|
|
31625
30804
|
}
|
|
31626
30805
|
function parseChildren(children, g) {
|
|
31627
30806
|
isArray$1(children) ? children.forEach(item => {
|
|
@@ -33022,187 +32201,6 @@
|
|
|
33022
32201
|
loadLottieModule || (loadLottieModule = !0, container.bind(DefaultCanvasLottieRender).toDynamicValue(() => new DefaultCanvasLottieRender(createContributionProvider(RectRenderContribution, container))).inSingletonScope(), container.bind(GraphicRender).toService(DefaultCanvasLottieRender));
|
|
33023
32202
|
}
|
|
33024
32203
|
|
|
33025
|
-
var VRenderKitsRuntime = /*#__PURE__*/Object.freeze({
|
|
33026
|
-
__proto__: null,
|
|
33027
|
-
BrowserEnvContribution: BrowserEnvContribution,
|
|
33028
|
-
CanvasArc3dPicker: CanvasArc3dPicker,
|
|
33029
|
-
CanvasArcPicker: CanvasArcPicker,
|
|
33030
|
-
CanvasAreaPicker: CanvasAreaPicker,
|
|
33031
|
-
CanvasCirclePicker: CanvasCirclePicker,
|
|
33032
|
-
CanvasGifImagePicker: CanvasGifImagePicker,
|
|
33033
|
-
CanvasGlyphPicker: CanvasGlyphPicker,
|
|
33034
|
-
CanvasGroupPicker: CanvasGroupPicker,
|
|
33035
|
-
CanvasImagePicker: CanvasImagePicker,
|
|
33036
|
-
CanvasLinePicker: CanvasLinePicker,
|
|
33037
|
-
CanvasLottiePicker: CanvasLottiePicker,
|
|
33038
|
-
CanvasPathPicker: CanvasPathPicker,
|
|
33039
|
-
CanvasPickerContribution: CanvasPickerContribution,
|
|
33040
|
-
CanvasPolygonPicker: CanvasPolygonPicker,
|
|
33041
|
-
CanvasPyramid3dPicker: CanvasPyramid3dPicker,
|
|
33042
|
-
CanvasRect3dPicker: CanvasRect3dPicker,
|
|
33043
|
-
CanvasRectPicker: CanvasRectPicker,
|
|
33044
|
-
CanvasRichTextPicker: CanvasRichTextPicker,
|
|
33045
|
-
CanvasStarPicker: CanvasStarPicker,
|
|
33046
|
-
CanvasSymbolPicker: CanvasSymbolPicker,
|
|
33047
|
-
CanvasTextPicker: CanvasTextPicker,
|
|
33048
|
-
DragNDrop: DragNDrop,
|
|
33049
|
-
Fragment: Fragment,
|
|
33050
|
-
Gesture: Gesture,
|
|
33051
|
-
GifImage: GifImage,
|
|
33052
|
-
Lottie: Lottie,
|
|
33053
|
-
MathArcPicker: MathArcPicker,
|
|
33054
|
-
MathAreaPicker: MathAreaPicker,
|
|
33055
|
-
MathCirclePicker: MathCirclePicker,
|
|
33056
|
-
MathGlyphPicker: MathGlyphPicker,
|
|
33057
|
-
MathImagePicker: MathImagePicker,
|
|
33058
|
-
MathLinePicker: MathLinePicker,
|
|
33059
|
-
MathPathPicker: MathPathPicker,
|
|
33060
|
-
MathPickerContribution: MathPickerContribution,
|
|
33061
|
-
MathPolygonPicker: MathPolygonPicker,
|
|
33062
|
-
MathRectPicker: MathRectPicker,
|
|
33063
|
-
MathRichTextPicker: MathRichTextPicker,
|
|
33064
|
-
MathSymbolPicker: MathSymbolPicker,
|
|
33065
|
-
MathTextPicker: MathTextPicker,
|
|
33066
|
-
REACT_TO_CANOPUS_EVENTS: REACT_TO_CANOPUS_EVENTS,
|
|
33067
|
-
REACT_TO_CANOPUS_EVENTS_LIST: REACT_TO_CANOPUS_EVENTS_LIST,
|
|
33068
|
-
VArc: VArc,
|
|
33069
|
-
VArc3d: VArc3d,
|
|
33070
|
-
VArea: VArea,
|
|
33071
|
-
VCircle: VCircle,
|
|
33072
|
-
VGlyph: VGlyph,
|
|
33073
|
-
VGroup: VGroup,
|
|
33074
|
-
VImage: VImage,
|
|
33075
|
-
VLine: VLine,
|
|
33076
|
-
VPath: VPath,
|
|
33077
|
-
VPolygon: VPolygon,
|
|
33078
|
-
VPyramid3d: VPyramid3d,
|
|
33079
|
-
VRect: VRect,
|
|
33080
|
-
VRect3d: VRect3d,
|
|
33081
|
-
VRichText: VRichText,
|
|
33082
|
-
VSymbol: VSymbol,
|
|
33083
|
-
VText: VText,
|
|
33084
|
-
_registerArc: _registerArc,
|
|
33085
|
-
alternatingWave: alternatingWave,
|
|
33086
|
-
bindArc3dCanvasPickerContribution: bindArc3dCanvasPickerContribution,
|
|
33087
|
-
bindArcCanvasPickerContribution: bindArcCanvasPickerContribution,
|
|
33088
|
-
bindArcMathPickerContribution: bindArcMathPickerContribution,
|
|
33089
|
-
bindAreaCanvasPickerContribution: bindAreaCanvasPickerContribution,
|
|
33090
|
-
bindAreaMathPickerContribution: bindAreaMathPickerContribution,
|
|
33091
|
-
bindBrowserEnv: bindBrowserEnv,
|
|
33092
|
-
bindCircleCanvasPickerContribution: bindCircleCanvasPickerContribution,
|
|
33093
|
-
bindCircleMathPickerContribution: bindCircleMathPickerContribution,
|
|
33094
|
-
bindFeishuEnv: bindFeishuEnv,
|
|
33095
|
-
bindGifImageCanvasPickerContribution: bindGifImageCanvasPickerContribution,
|
|
33096
|
-
bindGifImageRenderContribution: bindGifImageRenderContribution,
|
|
33097
|
-
bindGlyphCanvasPickerContribution: bindGlyphCanvasPickerContribution,
|
|
33098
|
-
bindGlyphMathPickerContribution: bindGlyphMathPickerContribution,
|
|
33099
|
-
bindHarmonyEnv: bindHarmonyEnv,
|
|
33100
|
-
bindImageCanvasPickerContribution: bindImageCanvasPickerContribution,
|
|
33101
|
-
bindImageMathPickerContribution: bindImageMathPickerContribution,
|
|
33102
|
-
bindLineCanvasPickerContribution: bindLineCanvasPickerContribution,
|
|
33103
|
-
bindLineMathPickerContribution: bindLineMathPickerContribution,
|
|
33104
|
-
bindLottieCanvasPickerContribution: bindLottieCanvasPickerContribution,
|
|
33105
|
-
bindLottieRenderContribution: bindLottieRenderContribution,
|
|
33106
|
-
bindLynxEnv: bindLynxEnv,
|
|
33107
|
-
bindMathPicker: bindMathPicker,
|
|
33108
|
-
bindNodeEnv: bindNodeEnv,
|
|
33109
|
-
bindPathCanvasPickerContribution: bindPathCanvasPickerContribution,
|
|
33110
|
-
bindPathMathPickerContribution: bindPathMathPickerContribution,
|
|
33111
|
-
bindPolygonCanvasPickerContribution: bindPolygonCanvasPickerContribution,
|
|
33112
|
-
bindPolygonMathPickerContribution: bindPolygonMathPickerContribution,
|
|
33113
|
-
bindPyramid3dCanvasPickerContribution: bindPyramid3dCanvasPickerContribution,
|
|
33114
|
-
bindRect3dCanvasPickerContribution: bindRect3dCanvasPickerContribution,
|
|
33115
|
-
bindRectCanvasPickerContribution: bindRectCanvasPickerContribution,
|
|
33116
|
-
bindRectMathPickerContribution: bindRectMathPickerContribution,
|
|
33117
|
-
bindRichTextMathPickerContribution: bindRichTextMathPickerContribution,
|
|
33118
|
-
bindRichtextCanvasPickerContribution: bindRichtextCanvasPickerContribution,
|
|
33119
|
-
bindSymbolCanvasPickerContribution: bindSymbolCanvasPickerContribution,
|
|
33120
|
-
bindSymbolMathPickerContribution: bindSymbolMathPickerContribution,
|
|
33121
|
-
bindTTEnv: bindTTEnv,
|
|
33122
|
-
bindTaroEnv: bindTaroEnv,
|
|
33123
|
-
bindTextCanvasPickerContribution: bindTextCanvasPickerContribution,
|
|
33124
|
-
bindTextMathPickerContribution: bindTextMathPickerContribution,
|
|
33125
|
-
bindWxEnv: bindWxEnv,
|
|
33126
|
-
centerToCorner: centerToCorner,
|
|
33127
|
-
columnCenterToEdge: columnCenterToEdge,
|
|
33128
|
-
columnEdgeToCenter: columnEdgeToCenter,
|
|
33129
|
-
columnLeftToRight: columnLeftToRight,
|
|
33130
|
-
columnRightToLeft: columnRightToLeft,
|
|
33131
|
-
cornerToCenter: cornerToCenter,
|
|
33132
|
-
createGifImage: createGifImage,
|
|
33133
|
-
createImageElement: createImageElement$1,
|
|
33134
|
-
createLottie: createLottie,
|
|
33135
|
-
decodeReactDom: decodeReactDom,
|
|
33136
|
-
diagonalCenterToEdge: diagonalCenterToEdge,
|
|
33137
|
-
diagonalTopLeftToBottomRight: diagonalTopLeftToBottomRight,
|
|
33138
|
-
initAllEnv: initAllEnv,
|
|
33139
|
-
initBrowserEnv: initBrowserEnv,
|
|
33140
|
-
initFeishuEnv: initFeishuEnv,
|
|
33141
|
-
initHarmonyEnv: initHarmonyEnv,
|
|
33142
|
-
initLynxEnv: initLynxEnv,
|
|
33143
|
-
initNodeEnv: initNodeEnv,
|
|
33144
|
-
initTTEnv: initTTEnv,
|
|
33145
|
-
initTaroEnv: initTaroEnv,
|
|
33146
|
-
initWxEnv: initWxEnv,
|
|
33147
|
-
installBrowserEnvToApp: installBrowserEnvToApp,
|
|
33148
|
-
installBrowserPickersToApp: installBrowserPickersToApp,
|
|
33149
|
-
installDefaultGraphicsToApp: installDefaultGraphicsToApp,
|
|
33150
|
-
installFeishuEnvToApp: installFeishuEnvToApp,
|
|
33151
|
-
installHarmonyEnvToApp: installHarmonyEnvToApp,
|
|
33152
|
-
installLynxEnvToApp: installLynxEnvToApp,
|
|
33153
|
-
installMathPickersToApp: installMathPickersToApp,
|
|
33154
|
-
installNodeEnvToApp: installNodeEnvToApp,
|
|
33155
|
-
installNodePickersToApp: installNodePickersToApp,
|
|
33156
|
-
installTTEnvToApp: installTTEnvToApp,
|
|
33157
|
-
installTaroEnvToApp: installTaroEnvToApp,
|
|
33158
|
-
installWxEnvToApp: installWxEnvToApp,
|
|
33159
|
-
jsx: jsx,
|
|
33160
|
-
loadAllEnv: loadAllEnv,
|
|
33161
|
-
loadAllModule: loadAllModule,
|
|
33162
|
-
loadBrowserEnv: loadBrowserEnv,
|
|
33163
|
-
loadFeishuEnv: loadFeishuEnv,
|
|
33164
|
-
loadHarmonyEnv: loadHarmonyEnv,
|
|
33165
|
-
loadLynxEnv: loadLynxEnv,
|
|
33166
|
-
loadMathPicker: loadMathPicker,
|
|
33167
|
-
loadNodeEnv: loadNodeEnv,
|
|
33168
|
-
loadTTEnv: loadTTEnv,
|
|
33169
|
-
loadTaroEnv: loadTaroEnv,
|
|
33170
|
-
loadWxEnv: loadWxEnv,
|
|
33171
|
-
particleEffect: particleEffect,
|
|
33172
|
-
pulseWave: pulseWave,
|
|
33173
|
-
randomOpacity: randomOpacity,
|
|
33174
|
-
registerArc: registerArc,
|
|
33175
|
-
registerArc3d: registerArc3d,
|
|
33176
|
-
registerArea: registerArea,
|
|
33177
|
-
registerCircle: registerCircle,
|
|
33178
|
-
registerGifGraphic: registerGifGraphic,
|
|
33179
|
-
registerGifImage: registerGifImage,
|
|
33180
|
-
registerGlyph: registerGlyph,
|
|
33181
|
-
registerGroup: registerGroup,
|
|
33182
|
-
registerImage: registerImage,
|
|
33183
|
-
registerLine: registerLine,
|
|
33184
|
-
registerPath: registerPath,
|
|
33185
|
-
registerPolygon: registerPolygon,
|
|
33186
|
-
registerPyramid3d: registerPyramid3d,
|
|
33187
|
-
registerRect: registerRect,
|
|
33188
|
-
registerRect3d: registerRect3d,
|
|
33189
|
-
registerRichtext: registerRichtext,
|
|
33190
|
-
registerShadowRoot: registerShadowRoot,
|
|
33191
|
-
registerStar: registerStar,
|
|
33192
|
-
registerSymbol: registerSymbol,
|
|
33193
|
-
registerText: registerText,
|
|
33194
|
-
registerWrapText: registerWrapText,
|
|
33195
|
-
rippleEffect: rippleEffect,
|
|
33196
|
-
rotationScan: rotationScan,
|
|
33197
|
-
roughModule: roughModule,
|
|
33198
|
-
rowBottomToTop: rowBottomToTop,
|
|
33199
|
-
rowCenterToEdge: rowCenterToEdge,
|
|
33200
|
-
rowEdgeToCenter: rowEdgeToCenter,
|
|
33201
|
-
rowTopToBottom: rowTopToBottom,
|
|
33202
|
-
snakeWave: snakeWave,
|
|
33203
|
-
spiralEffect: spiralEffect
|
|
33204
|
-
});
|
|
33205
|
-
|
|
33206
32204
|
class Easing {
|
|
33207
32205
|
constructor() {}
|
|
33208
32206
|
static linear(t) {
|
|
@@ -33437,11 +32435,10 @@
|
|
|
33437
32435
|
}
|
|
33438
32436
|
function prepareAnimationFrameAttribute(target) {
|
|
33439
32437
|
const transientTarget = target;
|
|
33440
|
-
return transientTarget.attribute || (transientTarget.attribute = {}), transientTarget.attribute === transientTarget.baseAttributes &&
|
|
32438
|
+
return transientTarget.attribute || (transientTarget.attribute = {}), transientTarget.attribute === transientTarget.baseAttributes && transientTarget.detachAttributeFromBaseAttributes(), transientTarget.attributeMayContainTransientAttrs = !0, transientTarget.attribute;
|
|
33441
32439
|
}
|
|
33442
32440
|
function commitAnimationFrameAttribute(target) {
|
|
33443
|
-
|
|
33444
|
-
null === (_b = (_a = target).onAttributeUpdate) || void 0 === _b || _b.call(_a, animateUpdateContext);
|
|
32441
|
+
target.onAttributeUpdate(animateUpdateContext);
|
|
33445
32442
|
}
|
|
33446
32443
|
function applyAnimationFrameAttributes(target, attributes) {
|
|
33447
32444
|
if (!attributes) return;
|
|
@@ -33458,11 +32455,9 @@
|
|
|
33458
32455
|
commitAnimationFrameAttribute(target);
|
|
33459
32456
|
}
|
|
33460
32457
|
function applyAnimationTransientAttributes(target, attributes, type = exports.AttributeUpdateType.ANIMATE_UPDATE) {
|
|
33461
|
-
var _a;
|
|
33462
32458
|
if (!attributes) return;
|
|
33463
|
-
const context = getAnimationContext(type)
|
|
33464
|
-
|
|
33465
|
-
"function" != typeof transientTarget.applyAnimationTransientAttributes ? "function" != typeof transientTarget.applyTransientAttributes ? "function" != typeof transientTarget.setAttributesAndPreventAnimate ? (transientTarget.attribute || (transientTarget.attribute = {}), Object.assign(transientTarget.attribute, attributes), null === (_a = transientTarget.onAttributeUpdate) || void 0 === _a || _a.call(transientTarget, context)) : transientTarget.setAttributesAndPreventAnimate(attributes, !1, context) : transientTarget.applyTransientAttributes(attributes, !1, context) : transientTarget.applyAnimationTransientAttributes(attributes, !1, context);
|
|
32459
|
+
const context = getAnimationContext(type);
|
|
32460
|
+
target.applyAnimationTransientAttributes(attributes, !1, context);
|
|
33466
32461
|
}
|
|
33467
32462
|
function applyAppearStartAttributes(target, attributes) {
|
|
33468
32463
|
applyAnimationTransientAttributes(target, attributes, exports.AttributeUpdateType.ANIMATE_BIND);
|
|
@@ -33477,8 +32472,7 @@
|
|
|
33477
32472
|
constructor(type, props, duration, easing) {
|
|
33478
32473
|
var _a;
|
|
33479
32474
|
this._startTime = 0, this._hasFirstRun = !1, this._syncAttributeUpdate = () => {
|
|
33480
|
-
|
|
33481
|
-
null === (_b = (_a = this.target).addUpdateShapeAndBoundsTag) || void 0 === _b || _b.call(_a), null === (_d = (_c = this.target).addUpdatePositionTag) || void 0 === _d || _d.call(_c), null === (_f = (_e = this.target).onAttributeUpdate) || void 0 === _f || _f.call(_e, {
|
|
32475
|
+
this.target.addUpdateShapeAndBoundsTag(), this.target.addUpdatePositionTag(), this.target.onAttributeUpdate({
|
|
33482
32476
|
type: exports.AttributeUpdateType.ANIMATE_UPDATE
|
|
33483
32477
|
});
|
|
33484
32478
|
}, this.type = type, this.props = props, this.duration = duration, this.easing = easing ? "function" == typeof easing ? easing : null !== (_a = Easing[easing]) && void 0 !== _a ? _a : Easing.linear : Easing.linear, "wait" === type && (this.onUpdate = noop), this.id = Generator.GenAutoIncrementId(), this.syncAttributeUpdate = noop;
|
|
@@ -33551,15 +32545,10 @@
|
|
|
33551
32545
|
}
|
|
33552
32546
|
}
|
|
33553
32547
|
tryPreventConflict() {
|
|
33554
|
-
var _a, _b;
|
|
33555
32548
|
const animate = this.animate,
|
|
33556
32549
|
target = this.target,
|
|
33557
|
-
forEachTrackedAnimate = null !== (_b = null === (_a = target.forEachTrackedAnimate) || void 0 === _a ? void 0 : _a.bind(target)) && void 0 !== _b ? _b : cb => {
|
|
33558
|
-
var _a;
|
|
33559
|
-
null === (_a = target.animates) || void 0 === _a || _a.forEach(cb);
|
|
33560
|
-
},
|
|
33561
32550
|
propKeys = this.propKeys;
|
|
33562
|
-
forEachTrackedAnimate(a => {
|
|
32551
|
+
target.forEachTrackedAnimate(a => {
|
|
33563
32552
|
if (a === animate || a.priority > animate.priority || a.priority === 1 / 0) return;
|
|
33564
32553
|
const fromProps = a.getStartProps();
|
|
33565
32554
|
let conflictKeys = null;
|
|
@@ -33786,19 +32775,13 @@
|
|
|
33786
32775
|
super(from, to, duration, easing, params), this.from = null != from ? from : {};
|
|
33787
32776
|
}
|
|
33788
32777
|
applyTransientFromAttributes() {
|
|
33789
|
-
|
|
33790
|
-
const target = this.target;
|
|
33791
|
-
"function" != typeof target.applyTransientAttributes ? (Object.assign(null !== (_a = target.attribute) && void 0 !== _a ? _a : {}, this.from), null === (_b = target.onAttributeUpdate) || void 0 === _b || _b.call(target, {
|
|
33792
|
-
type: exports.AttributeUpdateType.ANIMATE_START
|
|
33793
|
-
})) : target.applyTransientAttributes(this.from, !1, {
|
|
33794
|
-
type: exports.AttributeUpdateType.ANIMATE_START
|
|
33795
|
-
});
|
|
32778
|
+
applyAnimationTransientAttributes(this.target, this.from, exports.AttributeUpdateType.ANIMATE_START);
|
|
33796
32779
|
}
|
|
33797
32780
|
onBind() {
|
|
33798
|
-
var _a, _b, _c
|
|
32781
|
+
var _a, _b, _c;
|
|
33799
32782
|
super.onBind(), Object.keys(this.from).forEach(key => {
|
|
33800
32783
|
null == this.props[key] && (this.props[key] = this.target.getGraphicAttribute(key));
|
|
33801
|
-
}), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) &&
|
|
32784
|
+
}), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = null === (_b = this.params) || void 0 === _b ? void 0 : _b.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.applyTransientFromAttributes();
|
|
33802
32785
|
}
|
|
33803
32786
|
onFirstRun() {
|
|
33804
32787
|
this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
|
|
@@ -33859,8 +32842,8 @@
|
|
|
33859
32842
|
bind(target) {
|
|
33860
32843
|
this.target = target;
|
|
33861
32844
|
const trackerTarget = this.target;
|
|
33862
|
-
return
|
|
33863
|
-
this.stop(), this.__skipRestoreStaticAttributeOnRemove ||
|
|
32845
|
+
return trackerTarget.detachAttributeFromBaseAttributes(), trackerTarget.trackAnimate(this), this.onRemove(() => {
|
|
32846
|
+
this.stop(), this.__skipRestoreStaticAttributeOnRemove || trackerTarget.restoreStaticAttribute(), trackerTarget.untrackAnimate(this.id);
|
|
33864
32847
|
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
33865
32848
|
}
|
|
33866
32849
|
to(props, duration = 300, easing = "linear") {
|
|
@@ -33997,8 +32980,7 @@
|
|
|
33997
32980
|
if (nextTime < this._startTime) return void (this.currentTime = nextTime);
|
|
33998
32981
|
if (nextTime >= this._startTime + this._totalDuration) {
|
|
33999
32982
|
null === (_a = this._lastStep) || void 0 === _a || _a.onUpdate(!0, 1, {}), null === (_b = this._lastStep) || void 0 === _b || _b.onEnd(), this.onEnd(), this.status = exports.AnimateStatus.END;
|
|
34000
|
-
|
|
34001
|
-
return "function" == typeof (null == trackerTarget ? void 0 : trackerTarget.restoreStaticAttribute) && trackerTarget.restoreStaticAttribute(), void (this.__skipRestoreStaticAttributeOnRemove = !0);
|
|
32983
|
+
return this.target.restoreStaticAttribute(), void (this.__skipRestoreStaticAttributeOnRemove = !0);
|
|
34002
32984
|
}
|
|
34003
32985
|
this.status = exports.AnimateStatus.RUNNING, this.currentTime <= this._startTime && this.onStart(), this.currentTime = nextTime;
|
|
34004
32986
|
let cycleTime = nextTime - this._startTime,
|
|
@@ -34690,9 +33672,8 @@
|
|
|
34690
33672
|
}
|
|
34691
33673
|
syncFinalAttrsFromContext(graphic) {
|
|
34692
33674
|
var _a;
|
|
34693
|
-
const finalAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.finalAttrs
|
|
34694
|
-
|
|
34695
|
-
finalAttrs && "function" == typeof setFinalAttributes && setFinalAttributes.call(graphic, finalAttrs);
|
|
33675
|
+
const finalAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.finalAttrs;
|
|
33676
|
+
finalAttrs && graphic.setFinalAttributes(finalAttrs);
|
|
34696
33677
|
}
|
|
34697
33678
|
executeItem(params, graphic, index = 0, count = 1) {
|
|
34698
33679
|
if (Array.isArray(params)) {
|
|
@@ -34945,8 +33926,7 @@
|
|
|
34945
33926
|
|
|
34946
33927
|
class AnimateExtension {
|
|
34947
33928
|
visitTrackedAnimates(cb) {
|
|
34948
|
-
|
|
34949
|
-
"function" != typeof target.forEachTrackedAnimate ? target.animates && target.animates.forEach(cb) : target.forEachTrackedAnimate(cb);
|
|
33929
|
+
this.forEachTrackedAnimate(cb);
|
|
34950
33930
|
}
|
|
34951
33931
|
getAttributes(final = !1) {
|
|
34952
33932
|
return final && this.finalAttribute ? this.finalAttribute : this.attribute;
|
|
@@ -34982,15 +33962,12 @@
|
|
|
34982
33962
|
applyFinalAttributeToAttribute() {
|
|
34983
33963
|
const finalAttribute = this.getFinalAttribute();
|
|
34984
33964
|
if (!finalAttribute) return;
|
|
34985
|
-
|
|
34986
|
-
"function" != typeof target.setAttributesAndPreventAnimate ? console.warn("[AnimateExtension] applyFinalAttributeToAttribute requires target.setAttributesAndPreventAnimate() to avoid committing finalAttribute into base attributes.") : target.setAttributesAndPreventAnimate(finalAttribute, !1, {
|
|
33965
|
+
this.setAttributesAndPreventAnimate(finalAttribute, !1, {
|
|
34987
33966
|
type: exports.AttributeUpdateType.ANIMATE_BIND
|
|
34988
33967
|
});
|
|
34989
33968
|
}
|
|
34990
33969
|
restoreStaticAttribute() {
|
|
34991
|
-
|
|
34992
|
-
if ("function" != typeof target._restoreAttributeFromStaticTruth) return "function" == typeof target.onStop ? (console.warn("[AnimateExtension] restoreStaticAttribute is using deprecated target.onStop(); implement _restoreAttributeFromStaticTruth() for explicit transient restore semantics."), void target.onStop()) : void console.warn("[AnimateExtension] restoreStaticAttribute requires target._restoreAttributeFromStaticTruth() or an equivalent transient restore path.");
|
|
34993
|
-
target._restoreAttributeFromStaticTruth({
|
|
33970
|
+
this._restoreAttributeFromStaticTruth({
|
|
34994
33971
|
type: exports.AttributeUpdateType.ANIMATE_END
|
|
34995
33972
|
});
|
|
34996
33973
|
}
|
|
@@ -35663,7 +34640,7 @@
|
|
|
35663
34640
|
var _a;
|
|
35664
34641
|
const commitTarget = target,
|
|
35665
34642
|
contextFinalAttrs = null === (_a = commitTarget.context) || void 0 === _a ? void 0 : _a.finalAttrs,
|
|
35666
|
-
finalAttribute =
|
|
34643
|
+
finalAttribute = commitTarget.getFinalAttribute();
|
|
35667
34644
|
let commitAttrs = null;
|
|
35668
34645
|
for (let i = 0; i < keys.length; i++) {
|
|
35669
34646
|
const key = keys[i];
|
|
@@ -35672,9 +34649,8 @@
|
|
|
35672
34649
|
return commitAttrs;
|
|
35673
34650
|
}
|
|
35674
34651
|
function commitAnimationStaticAttrs(target, keys, animate, fallbackAttrs) {
|
|
35675
|
-
var _a, _b;
|
|
35676
34652
|
const commitAttrs = buildAnimationStaticCommitAttrs(target, keys, animate, fallbackAttrs);
|
|
35677
|
-
return !!commitAttrs && (
|
|
34653
|
+
return !!commitAttrs && (target.setFinalAttributes(commitAttrs), target.setAttributes(commitAttrs, !1, {
|
|
35678
34654
|
type: exports.AttributeUpdateType.ANIMATE_END
|
|
35679
34655
|
}), !0);
|
|
35680
34656
|
}
|
|
@@ -35785,7 +34761,7 @@
|
|
|
35785
34761
|
super(from, to, duration, easing, params);
|
|
35786
34762
|
}
|
|
35787
34763
|
onBind() {
|
|
35788
|
-
var _a, _b, _c
|
|
34764
|
+
var _a, _b, _c;
|
|
35789
34765
|
super.onBind();
|
|
35790
34766
|
const attrs = this.target.getFinalAttribute(),
|
|
35791
34767
|
fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {},
|
|
@@ -35794,7 +34770,7 @@
|
|
|
35794
34770
|
this.keys.forEach(key => {
|
|
35795
34771
|
var _a, _b, _c;
|
|
35796
34772
|
to[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1, from[key] = null !== (_c = null !== (_b = from[key]) && void 0 !== _b ? _b : fromAttrs[key]) && void 0 !== _c ? _c : 0;
|
|
35797
|
-
}),
|
|
34773
|
+
}), this.target.applyFinalAttributeToAttribute(), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
|
|
35798
34774
|
}
|
|
35799
34775
|
onUpdate(end, ratio, out) {
|
|
35800
34776
|
const attrs = {};
|
|
@@ -35846,8 +34822,7 @@
|
|
|
35846
34822
|
super.onBind(), this.propKeys = ["x", "y", "z", "alpha", "zIndex"];
|
|
35847
34823
|
}
|
|
35848
34824
|
onFirstRun() {
|
|
35849
|
-
|
|
35850
|
-
super.onFirstRun(), null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a);
|
|
34825
|
+
super.onFirstRun(), this.target.applyFinalAttributeToAttribute();
|
|
35851
34826
|
}
|
|
35852
34827
|
onStart() {
|
|
35853
34828
|
var _a, _b;
|
|
@@ -35856,7 +34831,7 @@
|
|
|
35856
34831
|
center: center,
|
|
35857
34832
|
r: r
|
|
35858
34833
|
} = "function" == typeof this.params ? this.params() : this.params,
|
|
35859
|
-
source = null !== (_a = this.target.
|
|
34834
|
+
source = null !== (_a = this.target.getFinalAttribute()) && void 0 !== _a ? _a : this.target.attribute,
|
|
35860
34835
|
startX = source.x,
|
|
35861
34836
|
startY = source.y,
|
|
35862
34837
|
startZ = null !== (_b = source.z) && void 0 !== _b ? _b : 0,
|
|
@@ -36055,14 +35030,14 @@
|
|
|
36055
35030
|
}
|
|
36056
35031
|
class GrowAngleIn extends GrowAngleBase {
|
|
36057
35032
|
onBind() {
|
|
36058
|
-
var _a, _b, _c
|
|
35033
|
+
var _a, _b, _c;
|
|
36059
35034
|
super.onBind();
|
|
36060
35035
|
const {
|
|
36061
35036
|
from: from,
|
|
36062
35037
|
to: to
|
|
36063
35038
|
} = growAngleIn(this.target, this.params.options, this.params),
|
|
36064
35039
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
36065
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to,
|
|
35040
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs), this.determineUpdateFunction();
|
|
36066
35041
|
}
|
|
36067
35042
|
}
|
|
36068
35043
|
class GrowAngleOut extends GrowAngleBase {
|
|
@@ -36205,14 +35180,14 @@
|
|
|
36205
35180
|
super(from, to, duration, easing, params);
|
|
36206
35181
|
}
|
|
36207
35182
|
onBind() {
|
|
36208
|
-
var _a, _b, _c
|
|
35183
|
+
var _a, _b, _c;
|
|
36209
35184
|
super.onBind();
|
|
36210
35185
|
const {
|
|
36211
35186
|
from: from,
|
|
36212
35187
|
to: to
|
|
36213
35188
|
} = growCenterIn(this.target, this.params.options, this.params),
|
|
36214
35189
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
36215
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to,
|
|
35190
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
|
|
36216
35191
|
}
|
|
36217
35192
|
onEnd(cb) {
|
|
36218
35193
|
super.onEnd(cb);
|
|
@@ -36310,14 +35285,14 @@
|
|
|
36310
35285
|
super(from, to, duration, easing, params);
|
|
36311
35286
|
}
|
|
36312
35287
|
onBind() {
|
|
36313
|
-
var _a, _b, _c
|
|
35288
|
+
var _a, _b, _c;
|
|
36314
35289
|
super.onBind();
|
|
36315
35290
|
const {
|
|
36316
35291
|
from: from,
|
|
36317
35292
|
to: to
|
|
36318
35293
|
} = growHeightIn(this.target, this.params.options, this.params),
|
|
36319
35294
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
36320
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to,
|
|
35295
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
|
|
36321
35296
|
}
|
|
36322
35297
|
onEnd(cb) {
|
|
36323
35298
|
super.onEnd(cb);
|
|
@@ -36421,13 +35396,13 @@
|
|
|
36421
35396
|
}
|
|
36422
35397
|
class GrowPointsIn extends GworPointsBase {
|
|
36423
35398
|
onBind() {
|
|
36424
|
-
var _a
|
|
35399
|
+
var _a;
|
|
36425
35400
|
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
36426
35401
|
const {
|
|
36427
35402
|
from: from,
|
|
36428
35403
|
to: to
|
|
36429
35404
|
} = growPointsIn(this.target, this.params.options, this.params);
|
|
36430
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to,
|
|
35405
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
|
|
36431
35406
|
} else this.valid = !1;
|
|
36432
35407
|
}
|
|
36433
35408
|
}
|
|
@@ -36483,13 +35458,13 @@
|
|
|
36483
35458
|
};
|
|
36484
35459
|
class GrowPointsXIn extends GworPointsBase {
|
|
36485
35460
|
onBind() {
|
|
36486
|
-
var _a
|
|
35461
|
+
var _a;
|
|
36487
35462
|
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
36488
35463
|
const {
|
|
36489
35464
|
from: from,
|
|
36490
35465
|
to: to
|
|
36491
35466
|
} = growPointsXIn(this.target, this.params.options, this.params);
|
|
36492
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to,
|
|
35467
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
|
|
36493
35468
|
} else this.valid = !1;
|
|
36494
35469
|
}
|
|
36495
35470
|
}
|
|
@@ -36545,13 +35520,13 @@
|
|
|
36545
35520
|
};
|
|
36546
35521
|
class GrowPointsYIn extends GworPointsBase {
|
|
36547
35522
|
onBind() {
|
|
36548
|
-
var _a
|
|
35523
|
+
var _a;
|
|
36549
35524
|
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
36550
35525
|
const {
|
|
36551
35526
|
from: from,
|
|
36552
35527
|
to: to
|
|
36553
35528
|
} = growPointsYIn(this.target, this.params.options, this.params);
|
|
36554
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to,
|
|
35529
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
|
|
36555
35530
|
} else this.valid = !1;
|
|
36556
35531
|
}
|
|
36557
35532
|
}
|
|
@@ -36656,14 +35631,14 @@
|
|
|
36656
35631
|
}
|
|
36657
35632
|
class GrowRadiusIn extends GrowPointsBase {
|
|
36658
35633
|
onBind() {
|
|
36659
|
-
var _a, _b, _c
|
|
35634
|
+
var _a, _b, _c;
|
|
36660
35635
|
super.onBind();
|
|
36661
35636
|
const {
|
|
36662
35637
|
from: from,
|
|
36663
35638
|
to: to
|
|
36664
35639
|
} = growRadiusIn(this.target, this.params.options, this.params),
|
|
36665
35640
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
36666
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to,
|
|
35641
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
|
|
36667
35642
|
}
|
|
36668
35643
|
}
|
|
36669
35644
|
class GrowRadiusOut extends GrowPointsBase {
|
|
@@ -36778,14 +35753,14 @@
|
|
|
36778
35753
|
super(from, to, duration, easing, params);
|
|
36779
35754
|
}
|
|
36780
35755
|
onBind() {
|
|
36781
|
-
var _a, _b, _c
|
|
35756
|
+
var _a, _b, _c;
|
|
36782
35757
|
super.onBind();
|
|
36783
35758
|
const {
|
|
36784
35759
|
from: from,
|
|
36785
35760
|
to: to
|
|
36786
35761
|
} = growWidthIn(this.target, this.params.options, this.params),
|
|
36787
35762
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
36788
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to,
|
|
35763
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
|
|
36789
35764
|
}
|
|
36790
35765
|
onEnd(cb) {
|
|
36791
35766
|
super.onEnd(cb);
|
|
@@ -37549,36 +36524,40 @@
|
|
|
37549
36524
|
super(from, to, duration, easing, params);
|
|
37550
36525
|
}
|
|
37551
36526
|
onBind() {
|
|
37552
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
36527
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
37553
36528
|
let from, to;
|
|
37554
36529
|
super.onBind();
|
|
37555
36530
|
const attrs = this.target.getFinalAttribute(),
|
|
37556
|
-
fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {}
|
|
37557
|
-
|
|
36531
|
+
fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {},
|
|
36532
|
+
options = null === (_b = this.params) || void 0 === _b ? void 0 : _b.options,
|
|
36533
|
+
direction = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.direction) && void 0 !== _d ? _d : null == options ? void 0 : options.direction,
|
|
36534
|
+
fromScaleX = null !== (_j = null !== (_g = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.fromScaleX) && void 0 !== _f ? _f : null == options ? void 0 : options.fromScaleX) && void 0 !== _g ? _g : null === (_h = this.params) || void 0 === _h ? void 0 : _h.fromScale) && void 0 !== _j ? _j : null == options ? void 0 : options.fromScale,
|
|
36535
|
+
fromScaleY = null !== (_p = null !== (_m = null !== (_l = null === (_k = this.params) || void 0 === _k ? void 0 : _k.fromScaleY) && void 0 !== _l ? _l : null == options ? void 0 : options.fromScaleY) && void 0 !== _m ? _m : null === (_o = this.params) || void 0 === _o ? void 0 : _o.fromScale) && void 0 !== _p ? _p : null == options ? void 0 : options.fromScale;
|
|
36536
|
+
switch (direction) {
|
|
37558
36537
|
case "x":
|
|
37559
36538
|
from = {
|
|
37560
|
-
scaleX: null !== (
|
|
36539
|
+
scaleX: null !== (_q = null != fromScaleX ? fromScaleX : fromAttrs.scaleX) && void 0 !== _q ? _q : 0
|
|
37561
36540
|
}, to = {
|
|
37562
|
-
scaleX: null !== (
|
|
36541
|
+
scaleX: null !== (_r = null == attrs ? void 0 : attrs.scaleX) && void 0 !== _r ? _r : 1
|
|
37563
36542
|
}, this._updateFunction = this.updateX;
|
|
37564
36543
|
break;
|
|
37565
36544
|
case "y":
|
|
37566
36545
|
from = {
|
|
37567
|
-
scaleY: null !== (
|
|
36546
|
+
scaleY: null !== (_s = null != fromScaleY ? fromScaleY : fromAttrs.scaleY) && void 0 !== _s ? _s : 0
|
|
37568
36547
|
}, to = {
|
|
37569
|
-
scaleY: null !== (
|
|
36548
|
+
scaleY: null !== (_t = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _t ? _t : 1
|
|
37570
36549
|
}, this._updateFunction = this.updateY;
|
|
37571
36550
|
break;
|
|
37572
36551
|
default:
|
|
37573
36552
|
from = {
|
|
37574
|
-
scaleX: null !== (
|
|
37575
|
-
scaleY: null !== (
|
|
36553
|
+
scaleX: null !== (_u = null != fromScaleX ? fromScaleX : fromAttrs.scaleX) && void 0 !== _u ? _u : 0,
|
|
36554
|
+
scaleY: null !== (_v = null != fromScaleY ? fromScaleY : fromAttrs.scaleY) && void 0 !== _v ? _v : 0
|
|
37576
36555
|
}, to = {
|
|
37577
|
-
scaleX: null !== (
|
|
37578
|
-
scaleY: null !== (
|
|
36556
|
+
scaleX: null !== (_w = null == attrs ? void 0 : attrs.scaleX) && void 0 !== _w ? _w : 1,
|
|
36557
|
+
scaleY: null !== (_x = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _x ? _x : 1
|
|
37579
36558
|
}, this._updateFunction = this.updateXY;
|
|
37580
36559
|
}
|
|
37581
|
-
|
|
36560
|
+
this.target.applyFinalAttributeToAttribute(), this.props = to, this.from = from, this.to = to, !1 !== (null === (_y = this.params.controlOptions) || void 0 === _y ? void 0 : _y.immediatelyApply) && applyAppearStartAttributes(this.target, from);
|
|
37582
36561
|
}
|
|
37583
36562
|
onEnd(cb) {
|
|
37584
36563
|
super.onEnd(cb);
|
|
@@ -38145,9 +37124,7 @@
|
|
|
38145
37124
|
const {
|
|
38146
37125
|
options: options
|
|
38147
37126
|
} = this.params;
|
|
38148
|
-
diffAttrs = filterExcludedChannels(diffAttrs, null == options ? void 0 : options.excludeChannels), this.props = diffAttrs;
|
|
38149
|
-
const consumeTransientFromAttrs = this.target.consumeTransientFromAttrsBeforePreventAnimate;
|
|
38150
|
-
this.updateFromAttrs = "function" == typeof consumeTransientFromAttrs ? consumeTransientFromAttrs.call(this.target, diffAttrs) : null, this.clipPathSyncKeys = Object.keys(diffAttrs).filter(key => clipPathGeometryAttrs[key]), this.clipPathSyncDisabled = !this.clipPathSyncKeys.length, this.syncParentClipPathToTarget();
|
|
37127
|
+
diffAttrs = filterExcludedChannels(diffAttrs, null == options ? void 0 : options.excludeChannels), this.props = diffAttrs, this.updateFromAttrs = this.target.consumeTransientFromAttrsBeforePreventAnimate(diffAttrs), this.clipPathSyncKeys = Object.keys(diffAttrs).filter(key => clipPathGeometryAttrs[key]), this.clipPathSyncDisabled = !this.clipPathSyncKeys.length, this.syncParentClipPathToTarget();
|
|
38151
37128
|
}
|
|
38152
37129
|
trySyncStartProps() {
|
|
38153
37130
|
const updateFromAttrs = this.updateFromAttrs;
|
|
@@ -38165,7 +37142,7 @@
|
|
|
38165
37142
|
this.runInterpolateUpdate(this.fromProps, this.props, easedRatio), this.syncParentClipPathToTarget(), this.onUpdate(end, easedRatio, out);
|
|
38166
37143
|
}
|
|
38167
37144
|
syncParentClipPathToTarget() {
|
|
38168
|
-
var _a, _b
|
|
37145
|
+
var _a, _b;
|
|
38169
37146
|
if (this.clipPathSyncDisabled) return;
|
|
38170
37147
|
const target = this.target,
|
|
38171
37148
|
parent = target.parent,
|
|
@@ -38176,20 +37153,19 @@
|
|
|
38176
37153
|
const clipGraphic = path[childIndex];
|
|
38177
37154
|
if (!(null == clipGraphic ? void 0 : clipGraphic.attribute) || clipGraphic.type !== target.type || !this.isClipPathStaticTarget(clipGraphic)) return;
|
|
38178
37155
|
const syncAttrs = this.buildClipPathTransientAttrs(clipGraphic);
|
|
38179
|
-
syncAttrs && (applyAnimationFrameAttributes(clipGraphic, syncAttrs),
|
|
37156
|
+
syncAttrs && (applyAnimationFrameAttributes(clipGraphic, syncAttrs), clipGraphic.addUpdatePositionTag(), clipGraphic.addUpdateShapeAndBoundsTag());
|
|
38180
37157
|
}
|
|
38181
37158
|
getClipPathSyncChildIndex(parent) {
|
|
38182
|
-
var _a;
|
|
38183
37159
|
if (this.clipPathSyncParent === parent && this.clipPathSyncChildIndex >= 0) return this.clipPathSyncChildIndex;
|
|
38184
37160
|
const target = this.target;
|
|
38185
37161
|
let childIndex = -1;
|
|
38186
|
-
return
|
|
37162
|
+
return parent.forEachChildren((child, index) => child === target && (childIndex = index, !0)), this.clipPathSyncParent = parent, this.clipPathSyncChildIndex = childIndex, childIndex;
|
|
38187
37163
|
}
|
|
38188
37164
|
isClipPathStaticTarget(clipGraphic) {
|
|
38189
37165
|
var _a, _b;
|
|
38190
37166
|
const target = this.target,
|
|
38191
37167
|
targetFinalAttrs = this.getTargetFinalAttrs(),
|
|
38192
|
-
clipGraphicFinalAttrs =
|
|
37168
|
+
clipGraphicFinalAttrs = clipGraphic.getFinalAttribute(),
|
|
38193
37169
|
clipFinalAttrs = null !== (_a = null != clipGraphicFinalAttrs ? clipGraphicFinalAttrs : clipGraphic.baseAttributes) && void 0 !== _a ? _a : clipGraphic.attribute,
|
|
38194
37170
|
keys = null !== (_b = this.clipPathSyncKeys) && void 0 !== _b ? _b : [];
|
|
38195
37171
|
return !!(keys.length && targetFinalAttrs && clipFinalAttrs) && keys.every(key => {
|
|
@@ -38200,7 +37176,7 @@
|
|
|
38200
37176
|
getTargetFinalAttrs() {
|
|
38201
37177
|
var _a, _b, _c;
|
|
38202
37178
|
const target = this.target;
|
|
38203
|
-
return null !== (_c = null !== (_b = null === (_a = target.context) || void 0 === _a ? void 0 : _a.finalAttrs) && void 0 !== _b ? _b :
|
|
37179
|
+
return null !== (_c = null !== (_b = null === (_a = target.context) || void 0 === _a ? void 0 : _a.finalAttrs) && void 0 !== _b ? _b : target.getFinalAttribute()) && void 0 !== _c ? _c : null;
|
|
38204
37180
|
}
|
|
38205
37181
|
isSameClipPathValue(a, b) {
|
|
38206
37182
|
return "number" == typeof a && "number" == typeof b ? Math.abs(a - b) < 1e-8 : a === b;
|
|
@@ -38328,13 +37304,13 @@
|
|
|
38328
37304
|
}
|
|
38329
37305
|
class MoveIn extends MoveBase {
|
|
38330
37306
|
onBind() {
|
|
38331
|
-
var _a
|
|
37307
|
+
var _a;
|
|
38332
37308
|
super.onBind();
|
|
38333
37309
|
const {
|
|
38334
37310
|
from: from,
|
|
38335
37311
|
to: to
|
|
38336
37312
|
} = moveIn(this.target, this.params.options, this.params);
|
|
38337
|
-
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to,
|
|
37313
|
+
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
|
|
38338
37314
|
}
|
|
38339
37315
|
}
|
|
38340
37316
|
class MoveOut extends MoveBase {
|
|
@@ -38387,13 +37363,13 @@
|
|
|
38387
37363
|
}
|
|
38388
37364
|
class RotateIn extends RotateBase {
|
|
38389
37365
|
onBind() {
|
|
38390
|
-
var _a
|
|
37366
|
+
var _a;
|
|
38391
37367
|
super.onBind();
|
|
38392
37368
|
const {
|
|
38393
37369
|
from: from,
|
|
38394
37370
|
to: to
|
|
38395
37371
|
} = rotateIn(this.target, this.params.options);
|
|
38396
|
-
this.props = to, this.propKeys = ["angle"], this.from = from, this.to = to,
|
|
37372
|
+
this.props = to, this.propKeys = ["angle"], this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
|
|
38397
37373
|
}
|
|
38398
37374
|
}
|
|
38399
37375
|
class RotateOut extends RotateBase {
|
|
@@ -39900,7 +38876,7 @@
|
|
|
39900
38876
|
[key]: value
|
|
39901
38877
|
}, this.attribute, key, context);
|
|
39902
38878
|
if (params) return this._setAttributes(params, forceUpdateTag);
|
|
39903
|
-
isPlainObject$
|
|
38879
|
+
isPlainObject$3(this.attribute[key]) && isPlainObject$3(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge(this.attribute[key], value) : this.attribute[key] = value, this._skipRenderAttributes.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
|
|
39904
38880
|
}
|
|
39905
38881
|
setAttributes(params, forceUpdateTag, context) {
|
|
39906
38882
|
return params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this._setAttributes(params, forceUpdateTag);
|
|
@@ -39913,7 +38889,7 @@
|
|
|
39913
38889
|
isNil$1(keys) && (keys = Object.keys(params));
|
|
39914
38890
|
for (let i = 0; i < keys.length; i++) {
|
|
39915
38891
|
const key = keys[i];
|
|
39916
|
-
!isPlainObject$
|
|
38892
|
+
!isPlainObject$3(this.attribute[key]) || isFunction$1(this.attribute[key]) || isFunction$1(params[key]) ? this.attribute[key] = params[key] : merge(this.attribute[key], params[key]);
|
|
39917
38893
|
}
|
|
39918
38894
|
}
|
|
39919
38895
|
bindEvents() {}
|
|
@@ -40698,7 +39674,7 @@
|
|
|
40698
39674
|
registerGroup(), registerRect(), registerSymbol(), registerRichtext(), registerText();
|
|
40699
39675
|
}
|
|
40700
39676
|
|
|
40701
|
-
var __rest$
|
|
39677
|
+
var __rest$d = undefined && undefined.__rest || function (s, e) {
|
|
40702
39678
|
var t = {};
|
|
40703
39679
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
40704
39680
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -40752,7 +39728,7 @@
|
|
|
40752
39728
|
const {
|
|
40753
39729
|
visible: shapeVisible
|
|
40754
39730
|
} = shape,
|
|
40755
|
-
shapeStyle = __rest$
|
|
39731
|
+
shapeStyle = __rest$d(shape, ["visible"]);
|
|
40756
39732
|
if (isBoolean$1(shapeVisible)) {
|
|
40757
39733
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
40758
39734
|
maxSize = isNumber$2(size) ? size : Math.max(size[0], size[1]);
|
|
@@ -40853,7 +39829,7 @@
|
|
|
40853
39829
|
const {
|
|
40854
39830
|
visible: bgVisible
|
|
40855
39831
|
} = panel,
|
|
40856
|
-
backgroundStyle = __rest$
|
|
39832
|
+
backgroundStyle = __rest$d(panel, ["visible"]);
|
|
40857
39833
|
if (visible && isBoolean$1(bgVisible)) {
|
|
40858
39834
|
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
40859
39835
|
visible: bgVisible && !!text,
|
|
@@ -40935,7 +39911,7 @@
|
|
|
40935
39911
|
merge(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);
|
|
40936
39912
|
}
|
|
40937
39913
|
|
|
40938
|
-
var __rest$
|
|
39914
|
+
var __rest$c = undefined && undefined.__rest || function (s, e) {
|
|
40939
39915
|
var t = {};
|
|
40940
39916
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
40941
39917
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -41044,7 +40020,7 @@
|
|
|
41044
40020
|
visible: bgVisible,
|
|
41045
40021
|
square: square
|
|
41046
40022
|
} = panel,
|
|
41047
|
-
backgroundStyle = __rest$
|
|
40023
|
+
backgroundStyle = __rest$c(panel, ["visible", "square"]);
|
|
41048
40024
|
if (square) {
|
|
41049
40025
|
const maxWH = max(popTipWidth, poptipHeight);
|
|
41050
40026
|
popTipWidth = maxWH;
|
|
@@ -43025,7 +42001,7 @@
|
|
|
43025
42001
|
registerGroup(), registerPath();
|
|
43026
42002
|
}
|
|
43027
42003
|
|
|
43028
|
-
var __rest$
|
|
42004
|
+
var __rest$b = undefined && undefined.__rest || function (s, e) {
|
|
43029
42005
|
var t = {};
|
|
43030
42006
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
43031
42007
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -43132,7 +42108,7 @@
|
|
|
43132
42108
|
style: style,
|
|
43133
42109
|
state: state
|
|
43134
42110
|
} = _a,
|
|
43135
|
-
restLineAttrs = __rest$
|
|
42111
|
+
restLineAttrs = __rest$b(_a, ["startSymbol", "endSymbol", "style", "state"]),
|
|
43136
42112
|
lineAttrs = Object.assign({
|
|
43137
42113
|
startSymbol: startSymbol,
|
|
43138
42114
|
endSymbol: endSymbol,
|
|
@@ -43173,7 +42149,7 @@
|
|
|
43173
42149
|
state = {},
|
|
43174
42150
|
maxWidth: maxWidth
|
|
43175
42151
|
} = _d,
|
|
43176
|
-
restAttrs = __rest$
|
|
42152
|
+
restAttrs = __rest$b(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state", "maxWidth"]);
|
|
43177
42153
|
let percent = .5;
|
|
43178
42154
|
"start" === position ? percent = 0 : "end" === position && (percent = 1);
|
|
43179
42155
|
const {
|
|
@@ -43275,7 +42251,7 @@
|
|
|
43275
42251
|
text: textContent = "",
|
|
43276
42252
|
maxWidth: maxWidth
|
|
43277
42253
|
} = _c,
|
|
43278
|
-
restAttrs = __rest$
|
|
42254
|
+
restAttrs = __rest$b(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth"]),
|
|
43279
42255
|
point = this.getTickCoord(0);
|
|
43280
42256
|
"bottom" === orient || "top" === orient ? point.x = position : point.y = position;
|
|
43281
42257
|
let tickLength = 0;
|
|
@@ -43647,7 +42623,7 @@
|
|
|
43647
42623
|
});
|
|
43648
42624
|
}
|
|
43649
42625
|
|
|
43650
|
-
var __rest$
|
|
42626
|
+
var __rest$a = undefined && undefined.__rest || function (s, e) {
|
|
43651
42627
|
var t = {};
|
|
43652
42628
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
43653
42629
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -43706,7 +42682,7 @@
|
|
|
43706
42682
|
background: background,
|
|
43707
42683
|
state = {}
|
|
43708
42684
|
} = _d,
|
|
43709
|
-
restAttrs = __rest$
|
|
42685
|
+
restAttrs = __rest$a(_d, ["space", "textStyle", "shape", "background", "state"]);
|
|
43710
42686
|
let titlePoint = center,
|
|
43711
42687
|
labelHeight = 0;
|
|
43712
42688
|
(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.label.inside && (labelHeight = get$1(this.attribute.label, "style.fontSize", 12) + get$1(this.attribute.label, "space", 4));
|
|
@@ -43973,7 +42949,7 @@
|
|
|
43973
42949
|
for (let i = 0; i < domain.length; i++) {
|
|
43974
42950
|
const v = domain[i],
|
|
43975
42951
|
str = labelFormatter ? labelFormatter(v) : `${v}`;
|
|
43976
|
-
if (isPlainObject$
|
|
42952
|
+
if (isPlainObject$3(str)) {
|
|
43977
42953
|
labelBoundsList = void 0;
|
|
43978
42954
|
break;
|
|
43979
42955
|
}
|
|
@@ -45265,15 +44241,6 @@
|
|
|
45265
44241
|
return "left" === align ? 0 : "right" === align ? 1 : .5;
|
|
45266
44242
|
}
|
|
45267
44243
|
|
|
45268
|
-
var __rest$a = undefined && undefined.__rest || function (s, e) {
|
|
45269
|
-
var t = {};
|
|
45270
|
-
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
45271
|
-
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
45272
|
-
var i = 0;
|
|
45273
|
-
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
45274
|
-
}
|
|
45275
|
-
return t;
|
|
45276
|
-
};
|
|
45277
44244
|
class LabelUpdate extends AComponentAnimate {
|
|
45278
44245
|
onBind() {
|
|
45279
44246
|
const animator = createComponentAnimator(this.target);
|
|
@@ -45289,8 +44256,8 @@
|
|
|
45289
44256
|
} = this.params,
|
|
45290
44257
|
diff = {};
|
|
45291
44258
|
for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
|
|
45292
|
-
const rest =
|
|
45293
|
-
animator.animate(prevText, {
|
|
44259
|
+
const rest = Object.assign({}, diff);
|
|
44260
|
+
delete rest.text, animator.animate(prevText, {
|
|
45294
44261
|
type: "to",
|
|
45295
44262
|
to: rest,
|
|
45296
44263
|
duration: duration,
|
|
@@ -48752,6 +47719,10 @@
|
|
|
48752
47719
|
}
|
|
48753
47720
|
}
|
|
48754
47721
|
|
|
47722
|
+
function getSegmentLineGraphics(segment) {
|
|
47723
|
+
var _a;
|
|
47724
|
+
return segment ? [...(null !== (_a = segment.lines) && void 0 !== _a ? _a : []), segment.line].filter(Boolean) : [];
|
|
47725
|
+
}
|
|
48755
47726
|
function graphicFadeIn(graphic, delay, duration, easing) {
|
|
48756
47727
|
var _a, _b, _c, _d, _e;
|
|
48757
47728
|
if (!graphic) return;
|
|
@@ -48770,7 +47741,7 @@
|
|
|
48770
47741
|
}, duration, easing);
|
|
48771
47742
|
}
|
|
48772
47743
|
function segmentFadeIn(segment, delay, duration, easing) {
|
|
48773
|
-
segment && (graphicFadeIn(segment.startSymbol, delay, duration, easing), segment.
|
|
47744
|
+
segment && (graphicFadeIn(segment.startSymbol, delay, duration, easing), getSegmentLineGraphics(segment).forEach(line => graphicFadeIn(line, delay, duration, easing)), graphicFadeIn(segment.endSymbol, delay, duration, easing));
|
|
48774
47745
|
}
|
|
48775
47746
|
function tagFadeIn(tag, delay, duration, easing) {
|
|
48776
47747
|
tag && (graphicFadeIn(tag.getTextShape(), delay, duration, easing), graphicFadeIn(tag.getBgRect(), delay, duration, easing));
|
|
@@ -48789,7 +47760,7 @@
|
|
|
48789
47760
|
}, duration, easing));
|
|
48790
47761
|
}
|
|
48791
47762
|
function segmentFadeOut(segment, delay, duration, easing) {
|
|
48792
|
-
segment && (graphicFadeOut(segment.startSymbol, delay, duration, easing), segment.
|
|
47763
|
+
segment && (graphicFadeOut(segment.startSymbol, delay, duration, easing), getSegmentLineGraphics(segment).forEach(line => graphicFadeOut(line, delay, duration, easing)), graphicFadeOut(segment.endSymbol, delay, duration, easing));
|
|
48793
47764
|
}
|
|
48794
47765
|
function tagFadeOut(tag, delay, duration, easing) {
|
|
48795
47766
|
tag && (graphicFadeOut(tag.getTextShape(), delay, duration, easing), graphicFadeOut(tag.getBgRect(), delay, duration, easing));
|
|
@@ -48800,12 +47771,14 @@
|
|
|
48800
47771
|
lineDuration = .7 * duration,
|
|
48801
47772
|
endSymbolDuration = .1 * duration,
|
|
48802
47773
|
labelDuration = .1 * duration;
|
|
48803
|
-
graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing)
|
|
47774
|
+
graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing);
|
|
47775
|
+
const lines = getSegmentLineGraphics(line);
|
|
47776
|
+
lines.forEach(line => commitUpdateAnimationTarget(line, {
|
|
48804
47777
|
clipRange: 1
|
|
48805
47778
|
}, {
|
|
48806
47779
|
clipRange: 0
|
|
48807
|
-
})),
|
|
48808
|
-
const stepDuration = lineDuration /
|
|
47780
|
+
})), lines.forEach((l, index) => {
|
|
47781
|
+
const stepDuration = lineDuration / lines.length;
|
|
48809
47782
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
48810
47783
|
clipRange: 1
|
|
48811
47784
|
}, stepDuration, easing);
|
|
@@ -48862,12 +47835,14 @@
|
|
|
48862
47835
|
decorativeDuration = .05 * duration,
|
|
48863
47836
|
endSymbolDuration = .1 * duration,
|
|
48864
47837
|
labelDuration = .1 * duration;
|
|
48865
|
-
graphicFadeIn(itemLine.startSymbol, delay, startSymbolDuration, easing)
|
|
47838
|
+
graphicFadeIn(itemLine.startSymbol, delay, startSymbolDuration, easing);
|
|
47839
|
+
const lines = getSegmentLineGraphics(itemLine);
|
|
47840
|
+
lines.forEach(line => commitUpdateAnimationTarget(line, {
|
|
48866
47841
|
clipRange: 1
|
|
48867
47842
|
}, {
|
|
48868
47843
|
clipRange: 0
|
|
48869
|
-
})),
|
|
48870
|
-
const stepDuration = lineDuration /
|
|
47844
|
+
})), lines.forEach((l, index) => {
|
|
47845
|
+
const stepDuration = lineDuration / lines.length;
|
|
48871
47846
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
48872
47847
|
clipRange: 1
|
|
48873
47848
|
}, stepDuration, easing);
|
|
@@ -55879,48 +54854,6 @@
|
|
|
55879
54854
|
};
|
|
55880
54855
|
|
|
55881
54856
|
const BOOTSTRAP_STATE = Symbol.for('vrender.bootstrap.state');
|
|
55882
|
-
const installBrowserEnvToAppWithParams = installBrowserEnvToApp;
|
|
55883
|
-
const installNodeEnvToAppWithParams = installNodeEnvToApp;
|
|
55884
|
-
const runtimeKits = VRenderKitsRuntime;
|
|
55885
|
-
const miniEnvBootstraps = {
|
|
55886
|
-
taro: { installEnv: runtimeKits.installTaroEnvToApp, loadEnv: runtimeKits.loadTaroEnv },
|
|
55887
|
-
feishu: { installEnv: runtimeKits.installFeishuEnvToApp, loadEnv: runtimeKits.loadFeishuEnv },
|
|
55888
|
-
tt: { installEnv: runtimeKits.installTTEnvToApp, loadEnv: runtimeKits.loadTTEnv },
|
|
55889
|
-
wx: { installEnv: runtimeKits.installWxEnvToApp, loadEnv: runtimeKits.loadWxEnv },
|
|
55890
|
-
lynx: { installEnv: runtimeKits.installLynxEnvToApp, loadEnv: runtimeKits.loadLynxEnv },
|
|
55891
|
-
harmony: { installEnv: runtimeKits.installHarmonyEnvToApp, loadEnv: runtimeKits.loadHarmonyEnv }
|
|
55892
|
-
};
|
|
55893
|
-
const pluginRegistrations = [
|
|
55894
|
-
registerFlexLayoutPlugin,
|
|
55895
|
-
registerViewTransform3dPlugin,
|
|
55896
|
-
registerHtmlAttributePlugin,
|
|
55897
|
-
registerReactAttributePlugin,
|
|
55898
|
-
registerDirectionalLight,
|
|
55899
|
-
registerOrthoCamera
|
|
55900
|
-
];
|
|
55901
|
-
const animationRegistrations = [registerCustomAnimate, registerAnimate];
|
|
55902
|
-
const legacyGraphicRegistrations = [
|
|
55903
|
-
registerArc,
|
|
55904
|
-
registerArc3d,
|
|
55905
|
-
registerArea,
|
|
55906
|
-
registerCircle,
|
|
55907
|
-
registerGlyph,
|
|
55908
|
-
registerGifImage,
|
|
55909
|
-
registerGroup,
|
|
55910
|
-
registerImage,
|
|
55911
|
-
registerLine,
|
|
55912
|
-
registerPath,
|
|
55913
|
-
registerPolygon,
|
|
55914
|
-
registerPyramid3d,
|
|
55915
|
-
registerRect,
|
|
55916
|
-
registerRect3d,
|
|
55917
|
-
registerRichtext,
|
|
55918
|
-
registerShadowRoot,
|
|
55919
|
-
registerSymbol,
|
|
55920
|
-
registerText,
|
|
55921
|
-
registerWrapText,
|
|
55922
|
-
registerStar
|
|
55923
|
-
];
|
|
55924
54857
|
function ensureBootstrap(target, key) {
|
|
55925
54858
|
var _a;
|
|
55926
54859
|
const state = (_a = target[BOOTSTRAP_STATE]) !== null && _a !== void 0 ? _a : new Set();
|
|
@@ -55931,10 +54864,6 @@
|
|
|
55931
54864
|
state.add(key);
|
|
55932
54865
|
return true;
|
|
55933
54866
|
}
|
|
55934
|
-
function registerDefaultPipeline() {
|
|
55935
|
-
pluginRegistrations.forEach(register => register());
|
|
55936
|
-
animationRegistrations.forEach(register => register());
|
|
55937
|
-
}
|
|
55938
54867
|
function createBootstrapEntryKey(entry, prefix) {
|
|
55939
54868
|
var _a, _b, _c, _d;
|
|
55940
54869
|
const type = (_a = entry === null || entry === void 0 ? void 0 : entry.type) !== null && _a !== void 0 ? _a : 'unknown';
|
|
@@ -55978,6 +54907,52 @@
|
|
|
55978
54907
|
app.registry.picker.register(key, picker);
|
|
55979
54908
|
});
|
|
55980
54909
|
}
|
|
54910
|
+
|
|
54911
|
+
const installBrowserEnvToAppWithParams = installBrowserEnvToApp;
|
|
54912
|
+
const installNodeEnvToAppWithParams = installNodeEnvToApp;
|
|
54913
|
+
const miniEnvBootstraps = {
|
|
54914
|
+
taro: { installEnv: installTaroEnvToApp, loadEnv: loadTaroEnv },
|
|
54915
|
+
feishu: { installEnv: installFeishuEnvToApp, loadEnv: loadFeishuEnv },
|
|
54916
|
+
tt: { installEnv: installTTEnvToApp, loadEnv: loadTTEnv },
|
|
54917
|
+
wx: { installEnv: installWxEnvToApp, loadEnv: loadWxEnv },
|
|
54918
|
+
lynx: { installEnv: installLynxEnvToApp, loadEnv: loadLynxEnv },
|
|
54919
|
+
harmony: { installEnv: installHarmonyEnvToApp, loadEnv: loadHarmonyEnv }
|
|
54920
|
+
};
|
|
54921
|
+
const pluginRegistrations = [
|
|
54922
|
+
registerFlexLayoutPlugin,
|
|
54923
|
+
registerViewTransform3dPlugin,
|
|
54924
|
+
registerHtmlAttributePlugin,
|
|
54925
|
+
registerReactAttributePlugin,
|
|
54926
|
+
registerDirectionalLight,
|
|
54927
|
+
registerOrthoCamera
|
|
54928
|
+
];
|
|
54929
|
+
const animationRegistrations = [registerCustomAnimate, registerAnimate];
|
|
54930
|
+
const legacyGraphicRegistrations = [
|
|
54931
|
+
registerArc,
|
|
54932
|
+
registerArc3d,
|
|
54933
|
+
registerArea,
|
|
54934
|
+
registerCircle,
|
|
54935
|
+
registerGlyph,
|
|
54936
|
+
registerGifImage,
|
|
54937
|
+
registerGroup,
|
|
54938
|
+
registerImage,
|
|
54939
|
+
registerLine,
|
|
54940
|
+
registerPath,
|
|
54941
|
+
registerPolygon,
|
|
54942
|
+
registerPyramid3d,
|
|
54943
|
+
registerRect,
|
|
54944
|
+
registerRect3d,
|
|
54945
|
+
registerRichtext,
|
|
54946
|
+
registerShadowRoot,
|
|
54947
|
+
registerSymbol,
|
|
54948
|
+
registerText,
|
|
54949
|
+
registerWrapText,
|
|
54950
|
+
registerStar
|
|
54951
|
+
];
|
|
54952
|
+
function registerDefaultPipeline() {
|
|
54953
|
+
pluginRegistrations.forEach(register => register());
|
|
54954
|
+
animationRegistrations.forEach(register => register());
|
|
54955
|
+
}
|
|
55981
54956
|
function bootstrapVRenderBrowserApp(app, envParams) {
|
|
55982
54957
|
const target = app;
|
|
55983
54958
|
if (!ensureBootstrap(target, 'browser')) {
|
|
@@ -56033,7 +55008,7 @@
|
|
|
56033
55008
|
const bootstrap = miniEnvBootstraps[env];
|
|
56034
55009
|
bootstrap.installEnv(app, envParams);
|
|
56035
55010
|
installDefaultGraphicsToApp(app);
|
|
56036
|
-
|
|
55011
|
+
installMathPickersToApp(app);
|
|
56037
55012
|
bootstrap.loadEnv();
|
|
56038
55013
|
legacyGraphicRegistrations.forEach(register => register());
|
|
56039
55014
|
syncLegacyRenderersToApp(app);
|
|
@@ -56079,7 +55054,6 @@
|
|
|
56079
55054
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
56080
55055
|
};
|
|
56081
55056
|
|
|
56082
|
-
const { createBrowserApp } = VRenderCore;
|
|
56083
55057
|
function createBrowserVRenderApp(options = {}) {
|
|
56084
55058
|
const { envParams } = options, entryOptions = __rest(options, ["envParams"]);
|
|
56085
55059
|
return bootstrapVRenderBrowserApp(createBrowserApp(entryOptions), envParams);
|
|
@@ -56115,8 +55089,8 @@
|
|
|
56115
55089
|
return bootstrapVRenderNodeApp(createNodeApp(entryOptions), envParams);
|
|
56116
55090
|
}
|
|
56117
55091
|
|
|
56118
|
-
const SHARED_APP_REGISTRY_KEY = Symbol.for('visactor.vrender.sharedAppRegistry');
|
|
56119
55092
|
const DEFAULT_SHARED_APP_KEY = 'default';
|
|
55093
|
+
const SHARED_APP_REGISTRY_KEY = Symbol.for('visactor.vrender.sharedAppRegistry');
|
|
56120
55094
|
function getSharedAppRegistry() {
|
|
56121
55095
|
var _a;
|
|
56122
55096
|
const target = globalThis;
|
|
@@ -56156,36 +55130,8 @@
|
|
|
56156
55130
|
removeSharedAppRecord(env, key, record);
|
|
56157
55131
|
record.releaseApp();
|
|
56158
55132
|
}
|
|
56159
|
-
function
|
|
56160
|
-
const
|
|
56161
|
-
const entryOptions = Object.assign({}, options);
|
|
56162
|
-
delete entryOptions.env;
|
|
56163
|
-
delete entryOptions.key;
|
|
56164
|
-
if (env === 'browser') {
|
|
56165
|
-
return createBrowserVRenderApp(entryOptions);
|
|
56166
|
-
}
|
|
56167
|
-
if (env === 'node') {
|
|
56168
|
-
return createNodeVRenderApp(entryOptions);
|
|
56169
|
-
}
|
|
56170
|
-
if (env === 'taro') {
|
|
56171
|
-
return createTaroVRenderApp(entryOptions);
|
|
56172
|
-
}
|
|
56173
|
-
if (env === 'feishu') {
|
|
56174
|
-
return createFeishuVRenderApp(entryOptions);
|
|
56175
|
-
}
|
|
56176
|
-
if (env === 'tt') {
|
|
56177
|
-
return createTTVRenderApp(entryOptions);
|
|
56178
|
-
}
|
|
56179
|
-
if (env === 'wx') {
|
|
56180
|
-
return createWxVRenderApp(entryOptions);
|
|
56181
|
-
}
|
|
56182
|
-
if (env === 'lynx') {
|
|
56183
|
-
return createLynxVRenderApp(entryOptions);
|
|
56184
|
-
}
|
|
56185
|
-
return createHarmonyVRenderApp(entryOptions);
|
|
56186
|
-
}
|
|
56187
|
-
function createSharedAppRecord(env, key, options) {
|
|
56188
|
-
const app = createAppForSharedEnv(options);
|
|
55133
|
+
function createSharedAppRecord(env, key, options, createApp) {
|
|
55134
|
+
const app = createApp(options);
|
|
56189
55135
|
const originalRelease = app.release.bind(app);
|
|
56190
55136
|
const record = {
|
|
56191
55137
|
app,
|
|
@@ -56196,45 +55142,45 @@
|
|
|
56196
55142
|
app.release = () => releaseSharedAppRecord(env, key, record);
|
|
56197
55143
|
return record;
|
|
56198
55144
|
}
|
|
56199
|
-
function createSharedAppHandle(
|
|
55145
|
+
function createSharedAppHandle(registryEnv, handleEnv, key, record) {
|
|
56200
55146
|
let released = false;
|
|
56201
55147
|
return {
|
|
56202
55148
|
app: record.app,
|
|
56203
|
-
env,
|
|
55149
|
+
env: handleEnv,
|
|
56204
55150
|
key,
|
|
56205
55151
|
release() {
|
|
56206
55152
|
if (released) {
|
|
56207
55153
|
return;
|
|
56208
55154
|
}
|
|
56209
55155
|
released = true;
|
|
56210
|
-
const envRegistry = getSharedAppEnvRegistry(
|
|
55156
|
+
const envRegistry = getSharedAppEnvRegistry(registryEnv, false);
|
|
56211
55157
|
if ((envRegistry === null || envRegistry === void 0 ? void 0 : envRegistry.get(key)) !== record || record.released) {
|
|
56212
55158
|
return;
|
|
56213
55159
|
}
|
|
56214
55160
|
record.refCount -= 1;
|
|
56215
55161
|
if (record.refCount <= 0) {
|
|
56216
|
-
releaseSharedAppRecord(
|
|
55162
|
+
releaseSharedAppRecord(registryEnv, key, record);
|
|
56217
55163
|
}
|
|
56218
55164
|
}
|
|
56219
55165
|
};
|
|
56220
55166
|
}
|
|
56221
|
-
function
|
|
55167
|
+
function acquireSharedApp(registryEnv, options, createApp, handleEnv = registryEnv) {
|
|
56222
55168
|
var _a;
|
|
56223
55169
|
const key = (_a = options.key) !== null && _a !== void 0 ? _a : DEFAULT_SHARED_APP_KEY;
|
|
56224
|
-
const envRegistry = getOrCreateSharedAppEnvRegistry(
|
|
55170
|
+
const envRegistry = getOrCreateSharedAppEnvRegistry(registryEnv);
|
|
56225
55171
|
let record = envRegistry.get(key);
|
|
56226
55172
|
if (record === null || record === void 0 ? void 0 : record.app.released) {
|
|
56227
|
-
releaseSharedAppRecord(
|
|
55173
|
+
releaseSharedAppRecord(registryEnv, key, record);
|
|
56228
55174
|
record = undefined;
|
|
56229
55175
|
}
|
|
56230
55176
|
if (!record) {
|
|
56231
|
-
record = createSharedAppRecord(
|
|
55177
|
+
record = createSharedAppRecord(registryEnv, key, options, createApp);
|
|
56232
55178
|
envRegistry.set(key, record);
|
|
56233
55179
|
}
|
|
56234
55180
|
record.refCount += 1;
|
|
56235
|
-
return createSharedAppHandle(
|
|
55181
|
+
return createSharedAppHandle(registryEnv, handleEnv, key, record);
|
|
56236
55182
|
}
|
|
56237
|
-
function
|
|
55183
|
+
function getSharedApp(env, key = DEFAULT_SHARED_APP_KEY) {
|
|
56238
55184
|
var _a;
|
|
56239
55185
|
const record = (_a = getSharedAppEnvRegistry(env, false)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
56240
55186
|
if (!record || record.released || record.app.released) {
|
|
@@ -56242,7 +55188,7 @@
|
|
|
56242
55188
|
}
|
|
56243
55189
|
return record.app;
|
|
56244
55190
|
}
|
|
56245
|
-
function
|
|
55191
|
+
function releaseSharedApp(env, key = DEFAULT_SHARED_APP_KEY) {
|
|
56246
55192
|
var _a;
|
|
56247
55193
|
const record = (_a = getSharedAppEnvRegistry(env, false)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
56248
55194
|
if (record) {
|
|
@@ -56250,6 +55196,44 @@
|
|
|
56250
55196
|
}
|
|
56251
55197
|
}
|
|
56252
55198
|
|
|
55199
|
+
function createAppForSharedEnv(options) {
|
|
55200
|
+
const { env } = options;
|
|
55201
|
+
const entryOptions = Object.assign({}, options);
|
|
55202
|
+
delete entryOptions.env;
|
|
55203
|
+
delete entryOptions.key;
|
|
55204
|
+
if (env === 'browser') {
|
|
55205
|
+
return createBrowserVRenderApp(entryOptions);
|
|
55206
|
+
}
|
|
55207
|
+
if (env === 'node') {
|
|
55208
|
+
return createNodeVRenderApp(entryOptions);
|
|
55209
|
+
}
|
|
55210
|
+
if (env === 'taro') {
|
|
55211
|
+
return createTaroVRenderApp(entryOptions);
|
|
55212
|
+
}
|
|
55213
|
+
if (env === 'feishu') {
|
|
55214
|
+
return createFeishuVRenderApp(entryOptions);
|
|
55215
|
+
}
|
|
55216
|
+
if (env === 'tt') {
|
|
55217
|
+
return createTTVRenderApp(entryOptions);
|
|
55218
|
+
}
|
|
55219
|
+
if (env === 'wx') {
|
|
55220
|
+
return createWxVRenderApp(entryOptions);
|
|
55221
|
+
}
|
|
55222
|
+
if (env === 'lynx') {
|
|
55223
|
+
return createLynxVRenderApp(entryOptions);
|
|
55224
|
+
}
|
|
55225
|
+
return createHarmonyVRenderApp(entryOptions);
|
|
55226
|
+
}
|
|
55227
|
+
function acquireSharedVRenderApp(options) {
|
|
55228
|
+
return acquireSharedApp(options.env, options, createAppForSharedEnv, options.env);
|
|
55229
|
+
}
|
|
55230
|
+
function getSharedVRenderApp(env, key = DEFAULT_SHARED_APP_KEY) {
|
|
55231
|
+
return getSharedApp(env, key);
|
|
55232
|
+
}
|
|
55233
|
+
function releaseSharedVRenderApp(env, key = DEFAULT_SHARED_APP_KEY) {
|
|
55234
|
+
releaseSharedApp(env, key);
|
|
55235
|
+
}
|
|
55236
|
+
|
|
56253
55237
|
let browserApp;
|
|
56254
55238
|
let nodeApp;
|
|
56255
55239
|
function resolveLegacyApp() {
|
|
@@ -56264,7 +55248,7 @@
|
|
|
56264
55248
|
return resolveLegacyApp().createStage(params);
|
|
56265
55249
|
}
|
|
56266
55250
|
|
|
56267
|
-
const version = "1.1.0-alpha.
|
|
55251
|
+
const version = "1.1.0-alpha.25";
|
|
56268
55252
|
|
|
56269
55253
|
exports.AComponentAnimate = AComponentAnimate;
|
|
56270
55254
|
exports.ACustomAnimate = ACustomAnimate;
|
|
@@ -56845,11 +55829,11 @@
|
|
|
56845
55829
|
exports.convertDomainToTickData = convertDomainToTickData;
|
|
56846
55830
|
exports.cornerTangents = cornerTangents;
|
|
56847
55831
|
exports.cornerToCenter = cornerToCenter;
|
|
56848
|
-
exports.createApp = createBrowserApp
|
|
55832
|
+
exports.createApp = createBrowserApp;
|
|
56849
55833
|
exports.createArc = createArc;
|
|
56850
55834
|
exports.createArc3d = createArc3d;
|
|
56851
55835
|
exports.createArea = createArea;
|
|
56852
|
-
exports.createBrowserApp = createBrowserApp
|
|
55836
|
+
exports.createBrowserApp = createBrowserApp;
|
|
56853
55837
|
exports.createBrowserVRenderApp = createBrowserVRenderApp;
|
|
56854
55838
|
exports.createCanvasEventTransformer = createCanvasEventTransformer;
|
|
56855
55839
|
exports.createCircle = createCircle;
|