@visactor/vrender-core 1.1.0-alpha.11 → 1.1.0-alpha.13
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/common/canvas-utils.js +1 -0
- package/cjs/common/diff.js +1 -2
- package/cjs/common/explicit-binding.js +1 -1
- package/cjs/common/generator.js +1 -1
- package/cjs/common/matrix.js +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/performance-raf.js +1 -1
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -2
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/common/utils.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +2 -0
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +2 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.js +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/entries/app-context.js +1 -1
- package/cjs/entries/browser.js +1 -1
- package/cjs/entries/index.js +1 -1
- package/cjs/entries/miniapp.js +1 -1
- package/cjs/entries/node.js +1 -1
- package/cjs/entries/runtime-installer.js +1 -1
- package/cjs/entries/types.js +1 -1
- package/cjs/graphic/graphic.d.ts +4 -0
- package/cjs/graphic/graphic.js +31 -4
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/interface/animation/animate.d.ts +1 -0
- package/cjs/interface/animation/animate.js.map +1 -1
- package/dist/index.es.js +77 -3
- package/es/common/canvas-utils.js +2 -1
- package/es/common/diff.js +1 -2
- package/es/common/explicit-binding.js +1 -1
- package/es/common/generator.js +1 -1
- package/es/common/matrix.js +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/performance-raf.js +1 -1
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -2
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/store.js +1 -1
- package/es/common/text.js +1 -1
- package/es/common/utils.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +2 -0
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +2 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.js +1 -1
- package/es/core/window.js +1 -1
- package/es/entries/app-context.js +1 -1
- package/es/entries/browser.js +1 -1
- package/es/entries/index.js +1 -1
- package/es/entries/miniapp.js +1 -1
- package/es/entries/node.js +1 -1
- package/es/entries/runtime-installer.js +1 -1
- package/es/entries/types.js +1 -1
- package/es/graphic/graphic.d.ts +4 -0
- package/es/graphic/graphic.js +31 -4
- package/es/graphic/graphic.js.map +1 -1
- package/es/interface/animation/animate.d.ts +1 -0
- package/es/interface/animation/animate.js.map +1 -1
- package/package.json +3 -3
|
@@ -57,4 +57,5 @@ function createConicGradient(context, color, x, y, w, h) {
|
|
|
57
57
|
})), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
//# sourceMappingURL=canvas-utils.js.map
|
|
60
61
|
exports.getScaledStroke = getScaledStroke, exports.createColor = createColor;
|
package/cjs/common/diff.js
CHANGED
|
@@ -13,4 +13,4 @@ function resolveContainerBinding(container, serviceIdentifier) {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", {
|
|
14
14
|
value: !0
|
|
15
15
|
}), exports.resolveContainerBinding = void 0, exports.resolveContainerBinding = resolveContainerBinding;
|
|
16
|
-
//# sourceMappingURL=explicit-binding.js.map
|
|
16
|
+
//# sourceMappingURL=explicit-binding.js.map
|
package/cjs/common/generator.js
CHANGED
package/cjs/common/matrix.js
CHANGED
|
@@ -129,4 +129,4 @@ exports.identityMat4 = identityMat4, exports.rotateX = rotateX, exports.rotateY
|
|
|
129
129
|
exports.rotateZ = rotateZ, exports.translate = translate, exports.mat3Tomat4 = mat3Tomat4,
|
|
130
130
|
exports.multiplyMat4Mat3 = multiplyMat4Mat3, exports.scaleMat4 = scaleMat4, exports.multiplyMat4Mat4 = multiplyMat4Mat4,
|
|
131
131
|
exports.lookAt = lookAt, exports.ortho = ortho, exports.transformMat4 = transformMat4;
|
|
132
|
-
//# sourceMappingURL=matrix.js.map
|
|
132
|
+
//# sourceMappingURL=matrix.js.map
|
|
@@ -200,4 +200,4 @@ exports.cubicSubdivide = cubicSubdivide, exports.alignSubpath = alignSubpath, ex
|
|
|
200
200
|
exports.findBestMorphingRotation = findBestMorphingRotation, exports.alignBezierCurves = alignBezierCurves,
|
|
201
201
|
exports.pathToBezierCurves = pathToBezierCurves, exports.applyTransformOnBezierCurves = applyTransformOnBezierCurves,
|
|
202
202
|
exports.bezierCurversToPath = bezierCurversToPath;
|
|
203
|
-
//# sourceMappingURL=morphing-utils.js.map
|
|
203
|
+
//# sourceMappingURL=morphing-utils.js.map
|
package/cjs/common/path-svg.js
CHANGED
package/cjs/common/polygon.js
CHANGED
|
@@ -41,8 +41,8 @@ function getProportionPoint(point, segment, length, dx, dy) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
//# sourceMappingURL=polygon.js.map
|
|
44
45
|
Object.defineProperty(exports, "__esModule", {
|
|
45
46
|
value: !0
|
|
46
47
|
}), exports.drawRoundedPolygon = exports.drawPolygon = void 0, exports.drawPolygon = drawPolygon,
|
|
47
|
-
exports.drawRoundedPolygon = drawRoundedPolygon;
|
|
48
|
-
//# sourceMappingURL=polygon.js.map
|
|
48
|
+
exports.drawRoundedPolygon = drawRoundedPolygon;
|
package/cjs/common/rect-utils.js
CHANGED
|
@@ -99,4 +99,4 @@ function drawIncrementalAreaSegments(path, lastSeg, segments, params) {
|
|
|
99
99
|
|
|
100
100
|
exports.drawSegments = drawSegments, exports.drawIncrementalSegments = drawIncrementalSegments,
|
|
101
101
|
exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
|
|
102
|
-
//# sourceMappingURL=render-curve.js.map
|
|
102
|
+
//# sourceMappingURL=render-curve.js.map
|
package/cjs/common/simplify.js
CHANGED
|
@@ -36,4 +36,4 @@ function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", {
|
|
37
37
|
value: !0
|
|
38
38
|
}), exports.flatten_simplify = void 0, exports.flatten_simplify = flatten_simplify;
|
|
39
|
-
//# sourceMappingURL=simplify.js.map
|
|
39
|
+
//# sourceMappingURL=simplify.js.map
|
package/cjs/common/sort.js
CHANGED
|
@@ -101,4 +101,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
101
101
|
value: !0
|
|
102
102
|
}), exports.findNextGraphic = exports.foreachAsync = exports.foreach = void 0, exports.foreach = foreach,
|
|
103
103
|
exports.foreachAsync = foreachAsync, exports.findNextGraphic = findNextGraphic;
|
|
104
|
-
//# sourceMappingURL=sort.js.map
|
|
104
|
+
//# sourceMappingURL=sort.js.map
|
package/cjs/common/split-path.js
CHANGED
package/cjs/common/store.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
class StageStore {}
|
|
2
|
-
//# sourceMappingURL=store.js.map
|
|
2
|
+
//# sourceMappingURL=store.js.map
|
package/cjs/common/text.js
CHANGED
|
@@ -34,4 +34,4 @@ function textAttributesToStyle(attrs) {
|
|
|
34
34
|
|
|
35
35
|
exports.textDrawOffsetY = textDrawOffsetY, exports.textDrawOffsetX = textDrawOffsetX,
|
|
36
36
|
exports.textLayoutOffsetY = textLayoutOffsetY, exports.textAttributesToStyle = textAttributesToStyle;
|
|
37
|
-
//# sourceMappingURL=text.js.map
|
|
37
|
+
//# sourceMappingURL=text.js.map
|
package/cjs/common/utils.js
CHANGED
package/cjs/core/camera.js
CHANGED
package/cjs/core/constants.js
CHANGED
|
@@ -7,4 +7,4 @@ exports.TransformUtil = Symbol.for("TransformUtil"), exports.GraphicUtil = Symbo
|
|
|
7
7
|
exports.LayerService = Symbol.for("LayerService"), exports.StaticLayerHandlerContribution = Symbol.for("StaticLayerHandlerContribution"),
|
|
8
8
|
exports.DynamicLayerHandlerContribution = Symbol.for("DynamicLayerHandlerContribution"),
|
|
9
9
|
exports.VirtualLayerHandlerContribution = Symbol.for("VirtualLayerHandlerContribution");
|
|
10
|
-
//# sourceMappingURL=constants.js.map
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
package/cjs/core/core-modules.js
CHANGED
package/cjs/core/global.js
CHANGED
package/cjs/core/index.js
CHANGED
|
@@ -22,4 +22,4 @@ __exportStar(require("./layer"), exports), __exportStar(require("./stage"), expo
|
|
|
22
22
|
__exportStar(require("./graphic-utils"), exports), __exportStar(require("./contributions"), exports),
|
|
23
23
|
__exportStar(require("./layer-service"), exports), __exportStar(require("./constants"), exports),
|
|
24
24
|
__exportStar(require("../interface/core"), exports);
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/core/layer.js
CHANGED
package/cjs/core/light.js
CHANGED
package/cjs/core/stage.js
CHANGED
package/cjs/core/window.js
CHANGED
package/cjs/entries/browser.js
CHANGED
package/cjs/entries/index.js
CHANGED
package/cjs/entries/miniapp.js
CHANGED
package/cjs/entries/node.js
CHANGED
|
@@ -108,4 +108,4 @@ exports.getRuntimeInstallerGlobal = getRuntimeInstallerGlobal, exports.configure
|
|
|
108
108
|
exports.installRuntimeGraphicRenderersToApp = installRuntimeGraphicRenderersToApp,
|
|
109
109
|
exports.installRuntimeDrawContributionsToApp = installRuntimeDrawContributionsToApp,
|
|
110
110
|
exports.installRuntimePickersToApp = installRuntimePickersToApp;
|
|
111
|
-
//# sourceMappingURL=runtime-installer.js.map
|
|
111
|
+
//# sourceMappingURL=runtime-installer.js.map
|
package/cjs/entries/types.js
CHANGED
package/cjs/graphic/graphic.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
52
52
|
static mixin(source: Dict<any>): void;
|
|
53
53
|
_events?: any;
|
|
54
54
|
context?: Record<string, any>;
|
|
55
|
+
private transientFromAttrsBeforePreventAnimate?;
|
|
56
|
+
private transientFromAttrsBeforePreventAnimateDiffAttrs?;
|
|
55
57
|
static userSymbolMap: Record<string, ISymbolClass>;
|
|
56
58
|
onBeforeAttributeUpdate?: (val: any, attributes: Partial<T>, key: null | string | string[], context?: ISetAttributeContext) => T | undefined;
|
|
57
59
|
parent: any;
|
|
@@ -189,6 +191,8 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
189
191
|
containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean;
|
|
190
192
|
protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds): void;
|
|
191
193
|
setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext, ignorePriority?: boolean): void;
|
|
194
|
+
protected captureTransientFromAttrsBeforePreventAnimate(params: Partial<T>, keys: string[], context?: ISetAttributeContext): void;
|
|
195
|
+
protected consumeTransientFromAttrsBeforePreventAnimate(rawDiffAttrs: Record<string, any>, diffAttrs: Record<string, any>): Record<string, any> | null;
|
|
192
196
|
setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
193
197
|
_setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
194
198
|
setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
package/cjs/graphic/graphic.js
CHANGED
|
@@ -519,12 +519,39 @@ class Graphic extends node_tree_1.Node {
|
|
|
519
519
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
520
520
|
}
|
|
521
521
|
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
522
|
+
if (!params) return;
|
|
523
|
+
const keys = Object.keys(params);
|
|
524
|
+
this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.visitTrackedAnimates((animate => {
|
|
525
|
+
(animate.priority !== 1 / 0 || ignorePriority) && animate.preventAttrs(keys);
|
|
526
526
|
})), this.applyTransientAttributes(params, forceUpdateTag, context);
|
|
527
527
|
}
|
|
528
|
+
captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
|
|
529
|
+
var _a;
|
|
530
|
+
const graphicContext = this.context, diffAttrs = null == graphicContext ? void 0 : graphicContext.diffAttrs, updateType = null == context ? void 0 : context.type;
|
|
531
|
+
if (!keys.length || !graphicContext || !diffAttrs || updateType === enums_1.AttributeUpdateType.STATE || null != updateType && updateType >= enums_1.AttributeUpdateType.ANIMATE_BIND && updateType <= enums_1.AttributeUpdateType.ANIMATE_END) return;
|
|
532
|
+
let fromAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs && null !== (_a = this.transientFromAttrsBeforePreventAnimate) && void 0 !== _a ? _a : null, captured = !1;
|
|
533
|
+
for (let i = 0; i < keys.length; i++) {
|
|
534
|
+
const key = keys[i];
|
|
535
|
+
if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) continue;
|
|
536
|
+
const previousValue = this.attribute[key], nextValue = params[key];
|
|
537
|
+
(0, vutils_1.isEqual)(previousValue, nextValue) || (null != fromAttrs || (fromAttrs = {}),
|
|
538
|
+
fromAttrs[key] = cloneAttributeValue(previousValue), captured = !0);
|
|
539
|
+
}
|
|
540
|
+
captured && (this.transientFromAttrsBeforePreventAnimate = fromAttrs, this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs);
|
|
541
|
+
}
|
|
542
|
+
consumeTransientFromAttrsBeforePreventAnimate(rawDiffAttrs, diffAttrs) {
|
|
543
|
+
const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate;
|
|
544
|
+
if (!transientFromAttrs || this.transientFromAttrsBeforePreventAnimateDiffAttrs !== rawDiffAttrs) return null;
|
|
545
|
+
let fromAttrs = null, remaining = !1;
|
|
546
|
+
for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && (Object.prototype.hasOwnProperty.call(diffAttrs, key) ? (null != fromAttrs || (fromAttrs = {}),
|
|
547
|
+
fromAttrs[key] = transientFromAttrs[key]) : remaining = !0);
|
|
548
|
+
if (remaining) {
|
|
549
|
+
const nextTransientFromAttrs = {};
|
|
550
|
+
for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && !Object.prototype.hasOwnProperty.call(diffAttrs, key) && (nextTransientFromAttrs[key] = transientFromAttrs[key]);
|
|
551
|
+
this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;
|
|
552
|
+
} else this.transientFromAttrsBeforePreventAnimate = null, this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;
|
|
553
|
+
return fromAttrs;
|
|
554
|
+
}
|
|
528
555
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
529
556
|
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0),
|
|
530
557
|
isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
|