@visactor/vrender 0.17.4-alpha.0 → 0.17.5-alpha.0
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 +55 -42
- 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.17.
|
|
24
|
+
exports.version = "0.17.5-alpha.0", (0, vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
25
25
|
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
26
26
|
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
|
27
27
|
(0, vrender_kits_2.registerCircle)(), (0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAA4E;AAC5E,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,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 { container, isBrowserEnv, isNodeEnv } 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.17.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAA4E;AAC5E,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,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 { container, isBrowserEnv, isNodeEnv } 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.17.5-alpha.0\";\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
|
@@ -2171,13 +2171,6 @@
|
|
|
2171
2171
|
};
|
|
2172
2172
|
var isBase64$1 = isBase64;
|
|
2173
2173
|
|
|
2174
|
-
var get = function get(obj, path, defaultValue) {
|
|
2175
|
-
var paths = isString$1(path) ? path.split(".") : path;
|
|
2176
|
-
for (var p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
2177
|
-
return void 0 === obj ? defaultValue : obj;
|
|
2178
|
-
};
|
|
2179
|
-
var get$1 = get;
|
|
2180
|
-
|
|
2181
2174
|
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
2182
2175
|
has = function has(object, key) {
|
|
2183
2176
|
return null != object && hasOwnProperty.call(object, key);
|
|
@@ -5125,6 +5118,7 @@
|
|
|
5125
5118
|
wordBreak: "break-all",
|
|
5126
5119
|
ignoreBuf: !1,
|
|
5127
5120
|
verticalMode: 0,
|
|
5121
|
+
wrap: !1,
|
|
5128
5122
|
whiteSpace: "no-wrap",
|
|
5129
5123
|
heightLimit: 1 / 0,
|
|
5130
5124
|
lineClamp: 1 / 0,
|
|
@@ -7292,7 +7286,7 @@
|
|
|
7292
7286
|
function EventManager(root, config) {
|
|
7293
7287
|
var _this = this;
|
|
7294
7288
|
_classCallCheck(this, EventManager);
|
|
7295
|
-
this.dispatch = new EventEmitter(), this.mappingState = {
|
|
7289
|
+
this.dispatch = new EventEmitter(), this.cursorTarget = null, this.mappingState = {
|
|
7296
7290
|
trackingData: {}
|
|
7297
7291
|
}, this.eventPool = new Map(), this.onPointerDown = function (from, target) {
|
|
7298
7292
|
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
@@ -7332,14 +7326,14 @@
|
|
|
7332
7326
|
}
|
|
7333
7327
|
_this.freeEvent(overEvent);
|
|
7334
7328
|
}
|
|
7335
|
-
_this.dispatchEvent(e, "pointermove"), "touch" === e.pointerType && _this.dispatchEvent(e, "touchmove"), isMouse && (_this.dispatchEvent(e, "mousemove"), _this.cursor = (null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.cursor) || _this.rootTarget.getCursor()), trackingData.overTargets = e.composedPath(), _this.freeEvent(e);
|
|
7329
|
+
_this.dispatchEvent(e, "pointermove"), "touch" === e.pointerType && _this.dispatchEvent(e, "touchmove"), isMouse && (_this.dispatchEvent(e, "mousemove"), _this.cursorTarget = e.target, _this.cursor = (null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.cursor) || _this.rootTarget.getCursor()), trackingData.overTargets = e.composedPath(), _this.freeEvent(e);
|
|
7336
7330
|
}, this.onPointerOver = function (from, target) {
|
|
7337
7331
|
var _a, _b;
|
|
7338
7332
|
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
7339
7333
|
var trackingData = _this.trackingData(from.pointerId),
|
|
7340
7334
|
e = _this.createPointerEvent(from, from.type, target),
|
|
7341
7335
|
isMouse = isMouseLike(e.pointerType);
|
|
7342
|
-
_this.dispatchEvent(e, "pointerover"), isMouse && _this.dispatchEvent(e, "mouseover"), "mouse" === e.pointerType && (_this.cursor = (null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.cursor) || _this.rootTarget.getCursor());
|
|
7336
|
+
_this.dispatchEvent(e, "pointerover"), isMouse && _this.dispatchEvent(e, "mouseover"), "mouse" === e.pointerType && (_this.cursorTarget = e.target, _this.cursor = (null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.cursor) || _this.rootTarget.getCursor());
|
|
7343
7337
|
var enterEvent = _this.clonePointerEvent(e, "pointerenter");
|
|
7344
7338
|
for (enterEvent.eventPhase = enterEvent.AT_TARGET; enterEvent.target && enterEvent.target !== _this.rootTarget.parent;) enterEvent.currentTarget = enterEvent.target, _this.notifyTarget(enterEvent), isMouse && _this.notifyTarget(enterEvent, "mouseenter"), enterEvent.target = enterEvent.target.parent;
|
|
7345
7339
|
trackingData.overTargets = e.composedPath(), _this.freeEvent(e), _this.freeEvent(enterEvent);
|
|
@@ -7355,7 +7349,7 @@
|
|
|
7355
7349
|
for (leaveEvent.eventPhase = leaveEvent.AT_TARGET; leaveEvent.target && leaveEvent.target !== _this.rootTarget.parent;) leaveEvent.currentTarget = leaveEvent.target, _this.notifyTarget(leaveEvent), isMouse && _this.notifyTarget(leaveEvent, "mouseleave"), leaveEvent.target = leaveEvent.target.parent;
|
|
7356
7350
|
trackingData.overTargets = [], _this.freeEvent(outEvent), _this.freeEvent(leaveEvent);
|
|
7357
7351
|
}
|
|
7358
|
-
_this.cursor = "";
|
|
7352
|
+
_this.cursorTarget = null, _this.cursor = "";
|
|
7359
7353
|
}, this.onPointerUp = function (from, target) {
|
|
7360
7354
|
var _a;
|
|
7361
7355
|
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
@@ -7558,7 +7552,7 @@
|
|
|
7558
7552
|
value: function pickTarget(x, y, e) {
|
|
7559
7553
|
var target;
|
|
7560
7554
|
var pickResult = this.rootTarget.pick(x, y);
|
|
7561
|
-
return target = pickResult && pickResult.graphic ? pickResult.graphic : pickResult && pickResult.group ? pickResult.group :
|
|
7555
|
+
return target = pickResult && pickResult.graphic ? pickResult.graphic : pickResult && pickResult.group ? pickResult.group : this.rootTarget.AABBBounds.contains(x, y) ? this.rootTarget : null, e && (e.pickParams = pickResult.params), target;
|
|
7562
7556
|
}
|
|
7563
7557
|
}]);
|
|
7564
7558
|
return EventManager;
|
|
@@ -7599,7 +7593,7 @@
|
|
|
7599
7593
|
federatedEvent = _this.bootstrapEvent(_this.rootPointerEvent, _nativeEvent);
|
|
7600
7594
|
_this.manager.mapEvent(federatedEvent);
|
|
7601
7595
|
}
|
|
7602
|
-
_this.setCursor(_this.manager.cursor);
|
|
7596
|
+
_this.setCursor(_this.manager.cursor, _this.manager.cursorTarget);
|
|
7603
7597
|
}, this.onPointerMove = function (nativeEvent) {
|
|
7604
7598
|
if (_this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
|
|
7605
7599
|
if (_this.isEventOutsideOfTargetElement(nativeEvent)) return;
|
|
@@ -7608,7 +7602,7 @@
|
|
|
7608
7602
|
var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvents[i]);
|
|
7609
7603
|
_this.manager.mapEvent(event);
|
|
7610
7604
|
}
|
|
7611
|
-
_this.setCursor(_this.manager.cursor);
|
|
7605
|
+
_this.setCursor(_this.manager.cursor, _this.manager.cursorTarget);
|
|
7612
7606
|
}, this.onPointerUp = function (nativeEvent) {
|
|
7613
7607
|
if (_this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
|
|
7614
7608
|
var outside = _this.isEventOutsideOfTargetElement(nativeEvent) ? "outside" : "",
|
|
@@ -7617,7 +7611,7 @@
|
|
|
7617
7611
|
var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvents[i]);
|
|
7618
7612
|
event.type += outside, _this.manager.mapEvent(event);
|
|
7619
7613
|
}
|
|
7620
|
-
_this.setCursor(_this.manager.cursor);
|
|
7614
|
+
_this.setCursor(_this.manager.cursor, _this.manager.cursorTarget);
|
|
7621
7615
|
}, this.onPointerOverOut = function (nativeEvent) {
|
|
7622
7616
|
if (_this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
|
|
7623
7617
|
var normalizedEvents = _this.normalizeToPointerData(nativeEvent);
|
|
@@ -7625,7 +7619,7 @@
|
|
|
7625
7619
|
var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvents[i]);
|
|
7626
7620
|
_this.manager.mapEvent(event);
|
|
7627
7621
|
}
|
|
7628
|
-
_this.setCursor(_this.manager.cursor);
|
|
7622
|
+
_this.setCursor(_this.manager.cursor, _this.manager.cursorTarget);
|
|
7629
7623
|
}, this.onWheel = function (nativeEvent) {
|
|
7630
7624
|
var wheelEvent = _this.normalizeWheelEvent(nativeEvent);
|
|
7631
7625
|
_this.manager.mapEvent(wheelEvent);
|
|
@@ -7652,8 +7646,9 @@
|
|
|
7652
7646
|
}
|
|
7653
7647
|
}, {
|
|
7654
7648
|
key: "setCursor",
|
|
7655
|
-
value: function setCursor() {
|
|
7656
|
-
|
|
7649
|
+
value: function setCursor(mode, target) {
|
|
7650
|
+
if (!target && !this.manager.rootTarget.window._handler.canvas.controled) return;
|
|
7651
|
+
mode || (mode = "default");
|
|
7657
7652
|
var applyStyles = this.applyStyles,
|
|
7658
7653
|
domElement = this.domElement;
|
|
7659
7654
|
if (this.currentCursor === mode) return;
|
|
@@ -9765,6 +9760,7 @@
|
|
|
9765
9760
|
var _ref3 = "function" == typeof this.params ? this.params() : this.params,
|
|
9766
9761
|
center = _ref3.center,
|
|
9767
9762
|
r = _ref3.r,
|
|
9763
|
+
cb = _ref3.cb,
|
|
9768
9764
|
deltaAngle = 2 * Math.PI * ratio,
|
|
9769
9765
|
theta = this.theta + deltaAngle,
|
|
9770
9766
|
phi = this.phi,
|
|
@@ -9772,7 +9768,7 @@
|
|
|
9772
9768
|
y = r * Math.cos(phi) + center.y,
|
|
9773
9769
|
z = r * Math.sin(phi) * Math.sin(theta) + center.z;
|
|
9774
9770
|
for (out.x = x, out.y = y, out.z = z, out.alpha = theta + pi / 2; out.alpha > pi2;) out.alpha -= pi2;
|
|
9775
|
-
out.alpha = pi2 - out.alpha, out.zIndex = -1e4 * out.z;
|
|
9771
|
+
out.alpha = pi2 - out.alpha, out.zIndex = -1e4 * out.z, cb && cb(out);
|
|
9776
9772
|
}
|
|
9777
9773
|
}]);
|
|
9778
9774
|
return RotateBySphereAnimate;
|
|
@@ -13679,7 +13675,7 @@
|
|
|
13679
13675
|
return CanvasTextLayout;
|
|
13680
13676
|
}();
|
|
13681
13677
|
|
|
13682
|
-
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
13678
|
+
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
13683
13679
|
var Text = /*#__PURE__*/function (_Graphic) {
|
|
13684
13680
|
_inherits(Text, _Graphic);
|
|
13685
13681
|
var _super = _createSuper(Text);
|
|
@@ -13739,7 +13735,9 @@
|
|
|
13739
13735
|
key: "_isValid",
|
|
13740
13736
|
value: function _isValid() {
|
|
13741
13737
|
var text = this.attribute.text;
|
|
13742
|
-
return
|
|
13738
|
+
return isArray$1(text) ? !text.every(function (t) {
|
|
13739
|
+
return null == t || "" === t;
|
|
13740
|
+
}) : null != text && "" !== text;
|
|
13743
13741
|
}
|
|
13744
13742
|
}, {
|
|
13745
13743
|
key: "doUpdateAABBBounds",
|
|
@@ -13887,7 +13885,10 @@
|
|
|
13887
13885
|
value: function updateHorizontalSinglelineAABBBounds(text) {
|
|
13888
13886
|
var _a, _b;
|
|
13889
13887
|
var textTheme = getTheme(this).text,
|
|
13890
|
-
|
|
13888
|
+
_this$attribute$wrap = this.attribute.wrap,
|
|
13889
|
+
wrap = _this$attribute$wrap === void 0 ? textTheme.wrap : _this$attribute$wrap;
|
|
13890
|
+
if (wrap) return this.updateWrapAABBBounds([text]);
|
|
13891
|
+
var textMeasure = application.graphicUtil.textMeasure;
|
|
13891
13892
|
var width, str;
|
|
13892
13893
|
var attribute = this.attribute,
|
|
13893
13894
|
_attribute$maxLineWid3 = attribute.maxLineWidth,
|
|
@@ -14045,7 +14046,10 @@
|
|
|
14045
14046
|
value: function updateHorizontalMultilineAABBBounds(text) {
|
|
14046
14047
|
var _a, _b;
|
|
14047
14048
|
var textTheme = getTheme(this).text,
|
|
14048
|
-
attribute = this.attribute,
|
|
14049
|
+
_this$attribute$wrap2 = this.attribute.wrap,
|
|
14050
|
+
wrap = _this$attribute$wrap2 === void 0 ? textTheme.wrap : _this$attribute$wrap2;
|
|
14051
|
+
if (wrap) return this.updateWrapAABBBounds(text);
|
|
14052
|
+
var attribute = this.attribute,
|
|
14049
14053
|
_attribute$fontFamily3 = attribute.fontFamily,
|
|
14050
14054
|
fontFamily = _attribute$fontFamily3 === void 0 ? textTheme.fontFamily : _attribute$fontFamily3,
|
|
14051
14055
|
_attribute$textAlign3 = attribute.textAlign,
|
|
@@ -14232,9 +14236,11 @@
|
|
|
14232
14236
|
var WrapText = /*#__PURE__*/function (_Text) {
|
|
14233
14237
|
_inherits(WrapText, _Text);
|
|
14234
14238
|
var _super = _createSuper(WrapText);
|
|
14235
|
-
function WrapText() {
|
|
14239
|
+
function WrapText(params) {
|
|
14236
14240
|
_classCallCheck(this, WrapText);
|
|
14237
|
-
return _super.
|
|
14241
|
+
return _super.call(this, Object.assign(Object.assign({}, params), {
|
|
14242
|
+
wrap: !0
|
|
14243
|
+
}));
|
|
14238
14244
|
}
|
|
14239
14245
|
_createClass(WrapText, [{
|
|
14240
14246
|
key: "_isValid",
|
|
@@ -20266,7 +20272,7 @@
|
|
|
20266
20272
|
if (context.beginPath(), keepDirIn3d && context.camera && context.project) {
|
|
20267
20273
|
var p = context.project(x, y, z),
|
|
20268
20274
|
camera = context.camera;
|
|
20269
|
-
context.camera = null, !1 === parsedPath.draw(context, size, p.x, p.y, void 0, function (p, a) {
|
|
20275
|
+
context.camera = null, !1 === parsedPath.draw(context, isArray$1(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, void 0, function (p, a) {
|
|
20270
20276
|
var _a, _b, _c;
|
|
20271
20277
|
if (symbol._parsedPath.svgCache) {
|
|
20272
20278
|
var obj = Object.assign({}, a);
|
|
@@ -22891,6 +22897,8 @@
|
|
|
22891
22897
|
key: "tryLayout",
|
|
22892
22898
|
value: function tryLayout(graphic) {
|
|
22893
22899
|
var _this = this;
|
|
22900
|
+
if (this.layouting) return;
|
|
22901
|
+
this.layouting = !0;
|
|
22894
22902
|
var p = graphic.parent;
|
|
22895
22903
|
if (!p || !graphic.needUpdateLayout()) return;
|
|
22896
22904
|
var theme = getTheme(p).group,
|
|
@@ -23017,7 +23025,7 @@
|
|
|
23017
23025
|
}
|
|
23018
23026
|
children.forEach(function (child, idx) {
|
|
23019
23027
|
child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
|
|
23020
|
-
}), p.addUpdateLayoutTag(), clip || this.tempBounds.equals(p.AABBBounds) || this.tryLayout(p);
|
|
23028
|
+
}), p.addUpdateLayoutTag(), clip || this.tempBounds.equals(p.AABBBounds) || (this.tryLayout(p), this.layouting = !1);
|
|
23021
23029
|
}
|
|
23022
23030
|
}, {
|
|
23023
23031
|
key: "layoutMain",
|
|
@@ -23038,33 +23046,38 @@
|
|
|
23038
23046
|
var _pos3 = padding;
|
|
23039
23047
|
for (var _i3 = lastIdx; _i3 <= currSeg.idx; _i3++) children[_i3].attribute[main.field] = _pos3 + getPadding(children[_i3], main.field), _pos3 += mianLenArray[_i3].mainLen + 2 * padding;
|
|
23040
23048
|
}
|
|
23041
|
-
} else if ("space-between" === justifyContent)
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
+
} else if ("space-between" === justifyContent) {
|
|
23050
|
+
if (currSeg.mainLen >= main.len) {
|
|
23051
|
+
var _pos4 = 0;
|
|
23052
|
+
for (var _i4 = lastIdx; _i4 <= currSeg.idx; _i4++) children[_i4].attribute[main.field] = _pos4 + getPadding(children[_i4], main.field), _pos4 += mianLenArray[_i4].mainLen;
|
|
23053
|
+
} else {
|
|
23054
|
+
var _size = currSeg.idx - lastIdx + 1,
|
|
23055
|
+
_padding2 = (main.len - currSeg.mainLen) / (2 * _size - 2);
|
|
23056
|
+
var _pos5 = 0;
|
|
23057
|
+
for (var _i5 = lastIdx; _i5 <= currSeg.idx; _i5++) children[_i5].attribute[main.field] = _pos5 + getPadding(children[_i5], main.field), _pos5 += mianLenArray[_i5].mainLen + 2 * _padding2;
|
|
23058
|
+
}
|
|
23059
|
+
} else if ("center" === justifyContent) {
|
|
23060
|
+
var _pos6 = (main.len - currSeg.mainLen) / 2;
|
|
23061
|
+
for (var _i6 = lastIdx; _i6 <= currSeg.idx; _i6++) children[_i6].attribute[main.field] = _pos6 + getPadding(children[_i6], main.field), _pos6 += mianLenArray[_i6].mainLen;
|
|
23049
23062
|
}
|
|
23050
23063
|
}
|
|
23051
23064
|
}, {
|
|
23052
23065
|
key: "layoutCross",
|
|
23053
23066
|
value: function layoutCross(children, alignItem, cross, anchorPos, lenArray, currSeg, lastIdx) {
|
|
23054
|
-
if ("flex-end" === alignItem) for (var i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[cross.field] = anchorPos - lenArray[i].crossLen + getPadding(children[i], cross.field);else if ("center" === alignItem) for (var
|
|
23067
|
+
if ("flex-end" === alignItem) for (var i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[cross.field] = anchorPos - lenArray[i].crossLen + getPadding(children[i], cross.field);else if ("center" === alignItem) for (var _i7 = lastIdx; _i7 <= currSeg.idx; _i7++) children[_i7].attribute[cross.field] = anchorPos - lenArray[_i7].crossLen / 2 + getPadding(children[_i7], cross.field);else for (var _i8 = lastIdx; _i8 <= currSeg.idx; _i8++) children[_i8].attribute[cross.field] = anchorPos + getPadding(children[_i8], cross.field);
|
|
23055
23068
|
}
|
|
23056
23069
|
}, {
|
|
23057
23070
|
key: "activate",
|
|
23058
23071
|
value: function activate(context) {
|
|
23059
23072
|
var _this2 = this;
|
|
23060
23073
|
this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, function (graphic) {
|
|
23061
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic);
|
|
23074
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic), _this2.layouting = !1;
|
|
23062
23075
|
}), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, function (graphic, stage, willUpdate, bounds) {
|
|
23063
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage &&
|
|
23076
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage && graphic.isContainer && _tempBounds.copy(bounds);
|
|
23064
23077
|
}), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, function (graphic, stage, bounds, params, selfChange) {
|
|
23065
|
-
stage && stage === _this2.pluginService.stage &&
|
|
23078
|
+
stage && stage === _this2.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) || (_this2.tryLayout(graphic), _this2.layouting = !1));
|
|
23066
23079
|
}), application.graphicService.hooks.onSetStage.tap(this.key, function (graphic) {
|
|
23067
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic);
|
|
23080
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic), _this2.layouting = !1;
|
|
23068
23081
|
});
|
|
23069
23082
|
}
|
|
23070
23083
|
}, {
|
|
@@ -23842,7 +23855,7 @@
|
|
|
23842
23855
|
}, {
|
|
23843
23856
|
key: "setCursor",
|
|
23844
23857
|
value: function setCursor(mode) {
|
|
23845
|
-
this._cursor = mode, this.eventSystem.setCursor(mode);
|
|
23858
|
+
this._cursor = mode, this.eventSystem.setCursor(mode, "ignore");
|
|
23846
23859
|
}
|
|
23847
23860
|
}, {
|
|
23848
23861
|
key: "getCursor",
|
|
@@ -34327,7 +34340,7 @@
|
|
|
34327
34340
|
|
|
34328
34341
|
var roughModule = _roughModule;
|
|
34329
34342
|
|
|
34330
|
-
const version = "0.17.
|
|
34343
|
+
const version = "0.17.5-alpha.0";
|
|
34331
34344
|
if (isBrowserEnv()) {
|
|
34332
34345
|
loadBrowserEnv(container);
|
|
34333
34346
|
}
|