@visactor/vrender 0.18.14-alpha.0 → 0.18.15-beta.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 +23 -11
- 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.18.
|
|
24
|
+
exports.version = "0.18.15-beta.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.18.15-beta.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
|
@@ -5252,6 +5252,7 @@
|
|
|
5252
5252
|
textBaseline: "top",
|
|
5253
5253
|
layoutDirection: "horizontal",
|
|
5254
5254
|
textConfig: [],
|
|
5255
|
+
forceBreakLine: !1,
|
|
5255
5256
|
maxHeight: void 0,
|
|
5256
5257
|
maxWidth: void 0,
|
|
5257
5258
|
singleLine: !1
|
|
@@ -15786,22 +15787,22 @@
|
|
|
15786
15787
|
_height = _this$lines$i.height;
|
|
15787
15788
|
if (top + _height < this[this.directionKey.top] || top + _height > this[this.directionKey.top] + frameHeight) return lastLineTag;
|
|
15788
15789
|
var lastLine = !1;
|
|
15789
|
-
this.ellipsis && this.lines[i + 1] && this.lines[i + 1].top + this.lines[i + 1].height > this[this.directionKey.top] + frameHeight && (lastLine = !0, lastLineTag = !0), this.lines[i].draw(ctx, lastLine, this.lines[i][this.directionKey.left] + deltaX, this.lines[i][this.directionKey.top] + deltaY, drawIcon);
|
|
15790
|
+
this.ellipsis && this.lines[i + 1] && this.lines[i + 1].top + this.lines[i + 1].height > this[this.directionKey.top] + frameHeight && (lastLine = !0, lastLineTag = !0), this.lines[i].draw(ctx, lastLine, this.lines[i][this.directionKey.left] + deltaX, this.lines[i][this.directionKey.top] + deltaY, this.ellipsis, drawIcon);
|
|
15790
15791
|
} else {
|
|
15791
15792
|
var detalHeight = Math.floor((frameHeight - this.actualHeight) / 2);
|
|
15792
15793
|
"vertical" === this.layoutDirection ? deltaX += detalHeight : deltaY += detalHeight;
|
|
15793
|
-
for (var _i = 0; _i < this.lines.length; _i++) this.lines[_i].draw(ctx, !1, this.lines[_i][this.directionKey.left] + deltaX, this.lines[_i][this.directionKey.top] + deltaY, drawIcon);
|
|
15794
|
+
for (var _i = 0; _i < this.lines.length; _i++) this.lines[_i].draw(ctx, !1, this.lines[_i][this.directionKey.left] + deltaX, this.lines[_i][this.directionKey.top] + deltaY, this.ellipsis, drawIcon);
|
|
15794
15795
|
}
|
|
15795
15796
|
} else if ("bottom" === this.verticalDirection && "vertical" !== this.layoutDirection) for (var _i2 = 0; _i2 < this.lines.length; _i2++) {
|
|
15796
15797
|
var _this$lines$_i = this.lines[_i2];
|
|
15797
15798
|
_this$lines$_i.top;
|
|
15798
15799
|
var _height2 = _this$lines$_i.height,
|
|
15799
15800
|
y = frameHeight - this.lines[_i2].top - this.lines[_i2].height;
|
|
15800
|
-
if (0 === frameHeight) this.lines[_i2].draw(ctx, !1, deltaX, y + deltaY, drawIcon);else {
|
|
15801
|
+
if (0 === frameHeight) this.lines[_i2].draw(ctx, !1, deltaX, y + deltaY, this.ellipsis, drawIcon);else {
|
|
15801
15802
|
if (y + _height2 > this[this.directionKey.top] + frameHeight || y < this[this.directionKey.top]) return lastLineTag;
|
|
15802
15803
|
{
|
|
15803
15804
|
var _lastLine = !1;
|
|
15804
|
-
this.ellipsis && this.lines[_i2 + 1] && y - this.lines[_i2 + 1].height < this[this.directionKey.top] && (_lastLine = !0, lastLineTag = !0), this.lines[_i2].draw(ctx, _lastLine, deltaX, y + deltaY, drawIcon);
|
|
15805
|
+
this.ellipsis && this.lines[_i2 + 1] && y - this.lines[_i2 + 1].height < this[this.directionKey.top] && (_lastLine = !0, lastLineTag = !0), this.lines[_i2].draw(ctx, _lastLine, deltaX, y + deltaY, this.ellipsis, drawIcon);
|
|
15805
15806
|
}
|
|
15806
15807
|
}
|
|
15807
15808
|
} else {
|
|
@@ -15811,11 +15812,11 @@
|
|
|
15811
15812
|
var _this$lines$_i2 = this.lines[_i3],
|
|
15812
15813
|
_top2 = _this$lines$_i2.top,
|
|
15813
15814
|
_height3 = _this$lines$_i2.height;
|
|
15814
|
-
if (0 === frameHeight) this.lines[_i3].draw(ctx, !1, this.lines[_i3][this.directionKey.left] + deltaX, this.lines[_i3][this.directionKey.top] + deltaY, drawIcon);else {
|
|
15815
|
+
if (0 === frameHeight) this.lines[_i3].draw(ctx, !1, this.lines[_i3][this.directionKey.left] + deltaX, this.lines[_i3][this.directionKey.top] + deltaY, this.ellipsis, drawIcon);else {
|
|
15815
15816
|
if (_top2 + _height3 < this[this.directionKey.top] || _top2 + _height3 > this[this.directionKey.top] + frameHeight) return lastLineTag;
|
|
15816
15817
|
{
|
|
15817
15818
|
var _lastLine2 = !1;
|
|
15818
|
-
this.ellipsis && this.lines[_i3 + 1] && this.lines[_i3 + 1].top + this.lines[_i3 + 1].height > this[this.directionKey.top] + frameHeight && (_lastLine2 = !0, lastLineTag = !0), this.lines[_i3].draw(ctx, _lastLine2, this.lines[_i3][this.directionKey.left] + deltaX, this.lines[_i3][this.directionKey.top] + deltaY, drawIcon);
|
|
15819
|
+
this.ellipsis && this.lines[_i3 + 1] && this.lines[_i3 + 1].top + this.lines[_i3 + 1].height > this[this.directionKey.top] + frameHeight && (_lastLine2 = !0, lastLineTag = !0), this.lines[_i3].draw(ctx, _lastLine2, this.lines[_i3][this.directionKey.left] + deltaX, this.lines[_i3][this.directionKey.top] + deltaY, this.ellipsis, drawIcon);
|
|
15819
15820
|
}
|
|
15820
15821
|
}
|
|
15821
15822
|
}
|
|
@@ -16186,12 +16187,15 @@
|
|
|
16186
16187
|
}
|
|
16187
16188
|
}, {
|
|
16188
16189
|
key: "draw",
|
|
16189
|
-
value: function draw(ctx, lastLine, x, y, drawIcon) {
|
|
16190
|
+
value: function draw(ctx, lastLine, x, y, drawEllipsis, drawIcon) {
|
|
16190
16191
|
var _this2 = this;
|
|
16191
|
-
if (lastLine) {
|
|
16192
|
+
if (drawEllipsis && (lastLine || this.paragraphs.some(function (p) {
|
|
16193
|
+
return p.overflow;
|
|
16194
|
+
}))) {
|
|
16192
16195
|
var otherParagraphWidth = 0;
|
|
16193
16196
|
for (var i = this.paragraphs.length - 1; i >= 0; i--) {
|
|
16194
16197
|
var paragraph = this.paragraphs[i];
|
|
16198
|
+
if (paragraph.overflow) continue;
|
|
16195
16199
|
if (paragraph instanceof RichTextIcon) break;
|
|
16196
16200
|
if ("vertical" === this.direction && "vertical" !== paragraph.direction) {
|
|
16197
16201
|
paragraph.verticalEllipsis = !0;
|
|
@@ -16468,6 +16472,7 @@
|
|
|
16468
16472
|
textBaseline = _this$attribute2.textBaseline,
|
|
16469
16473
|
layoutDirection = _this$attribute2.layoutDirection,
|
|
16470
16474
|
singleLine = _this$attribute2.singleLine,
|
|
16475
|
+
forceBreakLine = _this$attribute2.forceBreakLine,
|
|
16471
16476
|
paragraphs = [];
|
|
16472
16477
|
for (var i = 0; i < textConfig.length; i++) if ("image" in textConfig[i]) {
|
|
16473
16478
|
var config = this.combinedStyleToCharacter(textConfig[i]),
|
|
@@ -16492,7 +16497,14 @@
|
|
|
16492
16497
|
richTextHeightEnable = "number" == typeof height && Number.isFinite(height) && height > 0 && (!maxHeightFinite || height <= maxHeight),
|
|
16493
16498
|
frame = new Frame(0, 0, (richTextWidthEnable ? width : maxWidthFinite ? maxWidth : 0) || 0, (richTextHeightEnable ? height : maxHeightFinite ? maxHeight : 0) || 0, ellipsis, wordBreak, verticalDirection, textAlign, textBaseline, layoutDirection || "horizontal", !richTextWidthEnable && maxWidthFinite, !richTextHeightEnable && maxHeightFinite, singleLine || !1, null === (_a = this._frameCache) || void 0 === _a ? void 0 : _a.icons),
|
|
16494
16499
|
wrapper = new Wrapper(frame);
|
|
16495
|
-
|
|
16500
|
+
if (forceBreakLine) {
|
|
16501
|
+
var lineCount = 0,
|
|
16502
|
+
skip = !1;
|
|
16503
|
+
for (var _i = 0; _i < paragraphs.length; _i++) {
|
|
16504
|
+
var p = paragraphs[_i];
|
|
16505
|
+
skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1);
|
|
16506
|
+
}
|
|
16507
|
+
} else for (var _i2 = 0; _i2 < paragraphs.length; _i2++) wrapper.deal(paragraphs[_i2]);
|
|
16496
16508
|
wrapper.send();
|
|
16497
16509
|
if (!("horizontal" === frame.layoutDirection ? richTextWidthEnable : richTextHeightEnable)) {
|
|
16498
16510
|
var frameSize = frame.getActualSizeWidthEllipsis();
|
|
@@ -22142,7 +22154,7 @@
|
|
|
22142
22154
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22143
22155
|
}).forEach(function (group) {
|
|
22144
22156
|
group.isContainer ? _this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : _this2.renderItem(group, drawContext);
|
|
22145
|
-
}), context.restore(), context.
|
|
22157
|
+
}), context.restore(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1, context.draw();
|
|
22146
22158
|
}
|
|
22147
22159
|
}, {
|
|
22148
22160
|
key: "doRegister",
|
|
@@ -34918,7 +34930,7 @@
|
|
|
34918
34930
|
|
|
34919
34931
|
var roughModule = _roughModule;
|
|
34920
34932
|
|
|
34921
|
-
const version = "0.18.
|
|
34933
|
+
const version = "0.18.15-beta.1";
|
|
34922
34934
|
preLoadAllModule();
|
|
34923
34935
|
if (isBrowserEnv()) {
|
|
34924
34936
|
loadBrowserEnv(container);
|