@visactor/vrender 0.18.14-alpha.0 → 0.19.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +25 -46
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.
|
|
24
|
+
exports.version = "0.19.0-alpha.1", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
25
|
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
26
|
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
27
|
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.19.0-alpha.1\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -5679,14 +5679,13 @@
|
|
|
5679
5679
|
}, {
|
|
5680
5680
|
key: "clipTextWithSuffix",
|
|
5681
5681
|
value: function clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
|
|
5682
|
-
var forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
5683
5682
|
if ("" === suffix) return this.clipText(text, options, width, wordBreak);
|
|
5684
5683
|
if (0 === text.length) return {
|
|
5685
5684
|
str: "",
|
|
5686
5685
|
width: 0
|
|
5687
5686
|
};
|
|
5688
5687
|
var length = this.measureTextWidth(text, options);
|
|
5689
|
-
if (
|
|
5688
|
+
if (length <= width) return {
|
|
5690
5689
|
str: text,
|
|
5691
5690
|
width: length
|
|
5692
5691
|
};
|
|
@@ -5695,16 +5694,12 @@
|
|
|
5695
5694
|
str: "",
|
|
5696
5695
|
width: 0
|
|
5697
5696
|
};
|
|
5698
|
-
if (forceSuffix && length + suffixWidth <= width) return {
|
|
5699
|
-
str: text + suffix,
|
|
5700
|
-
width: length + suffixWidth
|
|
5701
|
-
};
|
|
5702
5697
|
width -= suffixWidth;
|
|
5703
5698
|
var data = this._clipText(text, options, width, 0, text.length - 1, position, suffix);
|
|
5704
5699
|
if (wordBreak && data.str !== text) {
|
|
5705
5700
|
var index = testLetter(text, data.str.length);
|
|
5706
|
-
index !== data.str.length && (data.
|
|
5707
|
-
}
|
|
5701
|
+
index !== data.str.length && (data.str = text.substring(0, index), data.width = this.measureTextWidth(data.str, options));
|
|
5702
|
+
}
|
|
5708
5703
|
return data.str = data.result, data.width += suffixWidth, data;
|
|
5709
5704
|
}
|
|
5710
5705
|
}]);
|
|
@@ -7537,12 +7532,7 @@
|
|
|
7537
7532
|
for (; overTargetAncestor && overTargetAncestor !== _this.rootTarget.parent && overTargetAncestor !== e.target;) overTargetAncestor = overTargetAncestor.parent;
|
|
7538
7533
|
if (!overTargetAncestor || overTargetAncestor === _this.rootTarget.parent) {
|
|
7539
7534
|
var enterEvent = _this.clonePointerEvent(e, "pointerenter");
|
|
7540
|
-
enterEvent.eventPhase = enterEvent.AT_TARGET;
|
|
7541
|
-
var currentTarget = enterEvent.target;
|
|
7542
|
-
var outTargetAncestors = new Set();
|
|
7543
|
-
var ancestor = outTarget;
|
|
7544
|
-
for (; ancestor && ancestor !== _this.rootTarget;) outTargetAncestors.add(ancestor), ancestor = ancestor.parent;
|
|
7545
|
-
for (; currentTarget && currentTarget !== outTarget && currentTarget !== _this.rootTarget.parent;) outTargetAncestors.has(currentTarget) || (enterEvent.currentTarget = currentTarget, _this.notifyTarget(enterEvent), isMouse && _this.notifyTarget(enterEvent, "mouseenter")), currentTarget = currentTarget.parent;
|
|
7535
|
+
for (enterEvent.eventPhase = enterEvent.AT_TARGET; enterEvent.target && enterEvent.target !== outTarget && enterEvent.target !== _this.rootTarget.parent;) enterEvent.currentTarget = enterEvent.target, _this.notifyTarget(enterEvent), isMouse && _this.notifyTarget(enterEvent, "mouseenter"), enterEvent.target = enterEvent.target.parent;
|
|
7546
7536
|
_this.freeEvent(enterEvent);
|
|
7547
7537
|
}
|
|
7548
7538
|
_this.freeEvent(overEvent);
|
|
@@ -7786,6 +7776,8 @@
|
|
|
7786
7776
|
}();
|
|
7787
7777
|
|
|
7788
7778
|
var EventTarget = {
|
|
7779
|
+
pickable: !0,
|
|
7780
|
+
visible: !0,
|
|
7789
7781
|
dispatchEvent: function dispatchEvent(e) {
|
|
7790
7782
|
var _a;
|
|
7791
7783
|
if (!(e instanceof FederatedEvent)) throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");
|
|
@@ -11821,17 +11813,19 @@
|
|
|
11821
11813
|
var _a, _b, _c, _d;
|
|
11822
11814
|
if (hasAnimation) {
|
|
11823
11815
|
var keys = Object.keys(attrs),
|
|
11824
|
-
|
|
11816
|
+
noWorkAAttr = this.getNoWorkAnimateAttr(),
|
|
11825
11817
|
animateAttrs = {};
|
|
11826
11818
|
var noAnimateAttrs;
|
|
11827
|
-
keys.forEach(function (key) {
|
|
11828
|
-
|
|
11819
|
+
isClear ? keys.forEach(function (key) {
|
|
11820
|
+
noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = void 0 === attrs[key] ? _this3.getDefaultAttribute(key) : attrs[key];
|
|
11821
|
+
}) : keys.forEach(function (key) {
|
|
11822
|
+
noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = attrs[key];
|
|
11829
11823
|
});
|
|
11830
11824
|
var animate = this.animate();
|
|
11831
11825
|
animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
|
|
11832
11826
|
type: exports.AttributeUpdateType.STATE
|
|
11833
11827
|
});
|
|
11834
|
-
} else this.
|
|
11828
|
+
} else this.setAttributes(attrs, !1, {
|
|
11835
11829
|
type: exports.AttributeUpdateType.STATE
|
|
11836
11830
|
});
|
|
11837
11831
|
}
|
|
@@ -11848,14 +11842,6 @@
|
|
|
11848
11842
|
newNormalAttrs[key] = _this4.getNormalAttribute(key);
|
|
11849
11843
|
}), this.normalAttrs = newNormalAttrs;
|
|
11850
11844
|
}
|
|
11851
|
-
}, {
|
|
11852
|
-
key: "stopStateAnimates",
|
|
11853
|
-
value: function stopStateAnimates() {
|
|
11854
|
-
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
|
|
11855
|
-
this.animates && this.animates.forEach(function (animate) {
|
|
11856
|
-
animate.stateNames && animate.stop(type);
|
|
11857
|
-
});
|
|
11858
|
-
}
|
|
11859
11845
|
}, {
|
|
11860
11846
|
key: "getNormalAttribute",
|
|
11861
11847
|
value: function getNormalAttribute(key) {
|
|
@@ -13903,7 +13889,7 @@
|
|
|
13903
13889
|
var str = lines[i];
|
|
13904
13890
|
var needCut = !0;
|
|
13905
13891
|
if (i === lineCountLimit - 1) {
|
|
13906
|
-
var _clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition
|
|
13892
|
+
var _clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
|
|
13907
13893
|
linesLayout.push({
|
|
13908
13894
|
str: _clip.str,
|
|
13909
13895
|
width: _clip.width
|
|
@@ -17685,8 +17671,6 @@
|
|
|
17685
17671
|
}, {
|
|
17686
17672
|
key: "updateGroupAABBBounds",
|
|
17687
17673
|
value: function updateGroupAABBBounds(attribute, groupTheme, aabbBounds, graphic) {
|
|
17688
|
-
var originalAABBBounds = aabbBounds;
|
|
17689
|
-
aabbBounds = aabbBounds.clone();
|
|
17690
17674
|
var width = attribute.width,
|
|
17691
17675
|
height = attribute.height,
|
|
17692
17676
|
path = attribute.path,
|
|
@@ -17694,12 +17678,12 @@
|
|
|
17694
17678
|
clip = _attribute$clip === void 0 ? groupTheme.clip : _attribute$clip;
|
|
17695
17679
|
path && path.length ? path.forEach(function (g) {
|
|
17696
17680
|
aabbBounds.union(g.AABBBounds);
|
|
17697
|
-
}) : null != width && null != height && aabbBounds.set(0, 0,
|
|
17681
|
+
}) : null != width && null != height && aabbBounds.set(0, 0, width, height), clip || graphic.forEachChildren(function (node) {
|
|
17698
17682
|
aabbBounds.union(node.AABBBounds);
|
|
17699
17683
|
});
|
|
17700
17684
|
var tb1 = this.tempAABBBounds1,
|
|
17701
17685
|
tb2 = this.tempAABBBounds2;
|
|
17702
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, groupTheme, !1, graphic),
|
|
17686
|
+
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, groupTheme, !1, graphic), aabbBounds;
|
|
17703
17687
|
}
|
|
17704
17688
|
}, {
|
|
17705
17689
|
key: "updateGlyphAABBBounds",
|
|
@@ -20659,14 +20643,9 @@
|
|
|
20659
20643
|
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
|
|
20660
20644
|
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
20661
20645
|
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
20662
|
-
var
|
|
20646
|
+
var b,
|
|
20663
20647
|
background = graphic.attribute.background;
|
|
20664
20648
|
if (!background) return;
|
|
20665
|
-
var restore = function restore() {
|
|
20666
|
-
"richtext" === graphic.type && (context.restore(), context.save(), matrix && context.setTransformFromMatrix(matrix, !0, 1));
|
|
20667
|
-
};
|
|
20668
|
-
var b;
|
|
20669
|
-
"richtext" === graphic.type && (matrix = context.currentMatrix.clone(), context.restore(), context.save(), context.setTransformForCurrent());
|
|
20670
20649
|
var shouldReCalBounds = isObject$1(background) && background.background,
|
|
20671
20650
|
onlyTranslate = graphic.transMatrix.onlyTranslate();
|
|
20672
20651
|
if (shouldReCalBounds) {
|
|
@@ -20691,13 +20670,13 @@
|
|
|
20691
20670
|
})).clone());
|
|
20692
20671
|
if (graphic.backgroundImg && graphic.resources) {
|
|
20693
20672
|
var res = graphic.resources.get(background);
|
|
20694
|
-
if ("success" !== res.state || !res.data) return
|
|
20673
|
+
if ("success" !== res.state || !res.data) return;
|
|
20695
20674
|
context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
20696
20675
|
} else {
|
|
20697
20676
|
var backgroundCornerRadius = graphic.attribute.backgroundCornerRadius;
|
|
20698
20677
|
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
20699
20678
|
}
|
|
20700
|
-
shouldReCalBounds && boundsAllocate.free(b)
|
|
20679
|
+
shouldReCalBounds && boundsAllocate.free(b);
|
|
20701
20680
|
}
|
|
20702
20681
|
}]);
|
|
20703
20682
|
}(DefaultBaseBackgroundRenderContribution);
|
|
@@ -21455,7 +21434,7 @@
|
|
|
21455
21434
|
value: function render(groups, params) {
|
|
21456
21435
|
this.renderTreeRoots = groups, this.drawParams = params;
|
|
21457
21436
|
var updateBounds = params.updateBounds;
|
|
21458
|
-
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params)
|
|
21437
|
+
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
|
|
21459
21438
|
}
|
|
21460
21439
|
}]);
|
|
21461
21440
|
}();
|
|
@@ -23262,7 +23241,7 @@
|
|
|
23262
23241
|
}), !isFinite(boundsLegal)) return;
|
|
23263
23242
|
width = childrenWidth, height = childrenHeight;
|
|
23264
23243
|
}
|
|
23265
|
-
|
|
23244
|
+
p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
|
|
23266
23245
|
var result = {
|
|
23267
23246
|
main: {
|
|
23268
23247
|
len: width,
|
|
@@ -23303,7 +23282,7 @@
|
|
|
23303
23282
|
}), tempMainL = 0, tempCrossL = 0) : (mainList.push({
|
|
23304
23283
|
idx: i - 1,
|
|
23305
23284
|
mainLen: tempMainL,
|
|
23306
|
-
crossLen:
|
|
23285
|
+
crossLen: crossLen
|
|
23307
23286
|
}), tempMainL = mainLen, tempCrossL = crossLen) : (tempMainL += mainLen, tempCrossL = Math.max(tempCrossL, crossLen));
|
|
23308
23287
|
}), mainList.push({
|
|
23309
23288
|
idx: mianLenArray.length - 1,
|
|
@@ -24294,7 +24273,7 @@
|
|
|
24294
24273
|
value: function release() {
|
|
24295
24274
|
_get(_getPrototypeOf(Stage.prototype), "release", this).call(this), 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(function (layer) {
|
|
24296
24275
|
layer.release();
|
|
24297
|
-
}), this.interactiveLayer && this.interactiveLayer.release(), this.window.release()
|
|
24276
|
+
}), this.interactiveLayer && this.interactiveLayer.release(), this.window.release();
|
|
24298
24277
|
}
|
|
24299
24278
|
}, {
|
|
24300
24279
|
key: "setStage",
|
|
@@ -29111,9 +29090,9 @@
|
|
|
29111
29090
|
if (target && !isRoot) {
|
|
29112
29091
|
var handlePointerMove = function handlePointerMove(moveEvent) {
|
|
29113
29092
|
if (dragstartTriggered || (moveEvent.type = "dragstart", null == target || target.dispatchEvent(moveEvent), dragstartTriggered = !0), moveEvent.type = "drag", null == target || target.dispatchEvent(moveEvent), !isRoot) {
|
|
29114
|
-
target.
|
|
29093
|
+
target.pickable = !1;
|
|
29115
29094
|
var elemBelow = (null == rootNode ? void 0 : rootNode.pick(moveEvent.global.x, moveEvent.global.y)).graphic;
|
|
29116
|
-
target.
|
|
29095
|
+
target.pickable = !0, currentDroppable !== elemBelow && (currentDroppable && (moveEvent.type = "dragleave", moveEvent.target = currentDroppable, currentDroppable.dispatchEvent(moveEvent)), elemBelow && (moveEvent.type = "dragenter", moveEvent.target = elemBelow, elemBelow.dispatchEvent(moveEvent)), currentDroppable = elemBelow, currentDroppable && (moveEvent.type = "dragover", moveEvent.target = currentDroppable, currentDroppable.dispatchEvent(moveEvent)));
|
|
29117
29096
|
}
|
|
29118
29097
|
};
|
|
29119
29098
|
var currentDroppable,
|
|
@@ -34918,7 +34897,7 @@
|
|
|
34918
34897
|
|
|
34919
34898
|
var roughModule = _roughModule;
|
|
34920
34899
|
|
|
34921
|
-
const version = "0.
|
|
34900
|
+
const version = "0.19.0-alpha.1";
|
|
34922
34901
|
preLoadAllModule();
|
|
34923
34902
|
if (isBrowserEnv()) {
|
|
34924
34903
|
loadBrowserEnv(container);
|