@visactor/vrender 0.17.7 → 0.17.8
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 +2 -1
- package/cjs/index.js +11 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.js +264 -184
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +5 -3
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -17,17 +17,17 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
|
-
}), exports.version = void 0;
|
|
20
|
+
}), exports.version = void 0, require("@visactor/vrender-core");
|
|
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.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
(0, vrender_kits_2.
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
__exportStar(require("@visactor/vrender-kits"), exports);
|
|
24
|
+
exports.version = "0.17.8", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
|
+
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
|
+
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
|
+
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
|
28
|
+
(0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(), (0, vrender_kits_2.registerImage)(),
|
|
29
|
+
(0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(), (0, vrender_kits_2.registerPolygon)(),
|
|
30
|
+
(0, vrender_kits_2.registerPyramid3d)(), (0, vrender_kits_2.registerRect)(), (0,
|
|
31
|
+
vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(), (0, vrender_kits_2.registerShadowRoot)(),
|
|
32
|
+
(0, vrender_kits_2.registerSymbol)(), (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(),
|
|
33
|
+
__exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,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.17.8\";\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
|
@@ -3264,7 +3264,7 @@
|
|
|
3264
3264
|
key: "initContext",
|
|
3265
3265
|
value: function initContext() {
|
|
3266
3266
|
if (this._notSupportCanvas) return !1;
|
|
3267
|
-
if (isNil$1(this._canvas) && (isValid$1(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$1(this._canvas) && "undefined" != typeof window && void 0 !== window.document && isValid$1(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$1(this._context) && isValid$1(this._canvas)) {
|
|
3267
|
+
if (isNil$1(this._canvas) && (isValid$1(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$1(this._canvas) && "undefined" != typeof window && void 0 !== window.document && globalThis && isValid$1(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$1(this._context) && isValid$1(this._canvas)) {
|
|
3268
3268
|
var context = this._canvas.getContext("2d");
|
|
3269
3269
|
isValid$1(context) && (context.save(), context.font = getContextFont$1(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
3270
3270
|
}
|
|
@@ -6196,6 +6196,168 @@
|
|
|
6196
6196
|
},
|
|
6197
6197
|
__metadata$1d = undefined && undefined.__metadata || function (k, v) {
|
|
6198
6198
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
6199
|
+
};
|
|
6200
|
+
var VWindow = Symbol["for"]("VWindow");
|
|
6201
|
+
var WindowHandlerContribution = Symbol["for"]("WindowHandlerContribution");
|
|
6202
|
+
exports.DefaultWindow = /*#__PURE__*/function () {
|
|
6203
|
+
function DefaultWindow() {
|
|
6204
|
+
_classCallCheck(this, DefaultWindow);
|
|
6205
|
+
this.hooks = {
|
|
6206
|
+
onChange: new SyncHook(["x", "y", "width", "height"])
|
|
6207
|
+
}, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
|
|
6208
|
+
}
|
|
6209
|
+
_createClass(DefaultWindow, [{
|
|
6210
|
+
key: "width",
|
|
6211
|
+
get: function get() {
|
|
6212
|
+
if (this._handler) {
|
|
6213
|
+
var wh = this._handler.getWH();
|
|
6214
|
+
return this._width = wh.width;
|
|
6215
|
+
}
|
|
6216
|
+
return this._width;
|
|
6217
|
+
}
|
|
6218
|
+
}, {
|
|
6219
|
+
key: "height",
|
|
6220
|
+
get: function get() {
|
|
6221
|
+
if (this._handler) {
|
|
6222
|
+
var wh = this._handler.getWH();
|
|
6223
|
+
return this._height = wh.height;
|
|
6224
|
+
}
|
|
6225
|
+
return this._height;
|
|
6226
|
+
}
|
|
6227
|
+
}, {
|
|
6228
|
+
key: "dpr",
|
|
6229
|
+
get: function get() {
|
|
6230
|
+
return this._handler.getDpr();
|
|
6231
|
+
}
|
|
6232
|
+
}, {
|
|
6233
|
+
key: "postInit",
|
|
6234
|
+
value: function postInit() {
|
|
6235
|
+
var _this = this;
|
|
6236
|
+
this.global.hooks.onSetEnv.tap("window", function () {
|
|
6237
|
+
_this.active();
|
|
6238
|
+
}), this.active();
|
|
6239
|
+
}
|
|
6240
|
+
}, {
|
|
6241
|
+
key: "active",
|
|
6242
|
+
value: function active() {
|
|
6243
|
+
var global = this.global;
|
|
6244
|
+
if (!global.env || this.actived) return;
|
|
6245
|
+
container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
|
|
6246
|
+
}
|
|
6247
|
+
}, {
|
|
6248
|
+
key: "style",
|
|
6249
|
+
get: function get() {
|
|
6250
|
+
return this._handler.getStyle();
|
|
6251
|
+
},
|
|
6252
|
+
set: function set(style) {
|
|
6253
|
+
this._handler.setStyle(style);
|
|
6254
|
+
}
|
|
6255
|
+
}, {
|
|
6256
|
+
key: "create",
|
|
6257
|
+
value: function create(params) {
|
|
6258
|
+
this._handler.createWindow(params);
|
|
6259
|
+
var windowWH = this._handler.getWH();
|
|
6260
|
+
this._width = windowWH.width, this._height = windowWH.height, this.title = this._handler.getTitle(), this.resizable = !0;
|
|
6261
|
+
}
|
|
6262
|
+
}, {
|
|
6263
|
+
key: "setWindowHandler",
|
|
6264
|
+
value: function setWindowHandler(handler) {
|
|
6265
|
+
this._handler = handler;
|
|
6266
|
+
}
|
|
6267
|
+
}, {
|
|
6268
|
+
key: "setDpr",
|
|
6269
|
+
value: function setDpr(dpr) {
|
|
6270
|
+
return this._handler.setDpr(dpr);
|
|
6271
|
+
}
|
|
6272
|
+
}, {
|
|
6273
|
+
key: "resize",
|
|
6274
|
+
value: function resize(w, h) {
|
|
6275
|
+
return this._handler.resizeWindow(w, h);
|
|
6276
|
+
}
|
|
6277
|
+
}, {
|
|
6278
|
+
key: "configure",
|
|
6279
|
+
value: function configure() {
|
|
6280
|
+
throw new Error("暂不支持");
|
|
6281
|
+
}
|
|
6282
|
+
}, {
|
|
6283
|
+
key: "release",
|
|
6284
|
+
value: function release() {
|
|
6285
|
+
return this._handler.releaseWindow();
|
|
6286
|
+
}
|
|
6287
|
+
}, {
|
|
6288
|
+
key: "getContext",
|
|
6289
|
+
value: function getContext() {
|
|
6290
|
+
return this._handler.getContext();
|
|
6291
|
+
}
|
|
6292
|
+
}, {
|
|
6293
|
+
key: "getNativeHandler",
|
|
6294
|
+
value: function getNativeHandler() {
|
|
6295
|
+
return this._handler.getNativeHandler();
|
|
6296
|
+
}
|
|
6297
|
+
}, {
|
|
6298
|
+
key: "getImageBuffer",
|
|
6299
|
+
value: function getImageBuffer(type) {
|
|
6300
|
+
return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
|
|
6301
|
+
}
|
|
6302
|
+
}, {
|
|
6303
|
+
key: "addEventListener",
|
|
6304
|
+
value: function addEventListener(type, listener, options) {
|
|
6305
|
+
return this._handler.addEventListener(type, listener, options);
|
|
6306
|
+
}
|
|
6307
|
+
}, {
|
|
6308
|
+
key: "removeEventListener",
|
|
6309
|
+
value: function removeEventListener(type, listener, options) {
|
|
6310
|
+
return this._handler.removeEventListener(type, listener, options);
|
|
6311
|
+
}
|
|
6312
|
+
}, {
|
|
6313
|
+
key: "dispatchEvent",
|
|
6314
|
+
value: function dispatchEvent(event) {
|
|
6315
|
+
return this._handler.dispatchEvent(event);
|
|
6316
|
+
}
|
|
6317
|
+
}, {
|
|
6318
|
+
key: "getBoundingClientRect",
|
|
6319
|
+
value: function getBoundingClientRect() {
|
|
6320
|
+
return this._handler.getBoundingClientRect();
|
|
6321
|
+
}
|
|
6322
|
+
}, {
|
|
6323
|
+
key: "getContainer",
|
|
6324
|
+
value: function getContainer() {
|
|
6325
|
+
return this._handler.container;
|
|
6326
|
+
}
|
|
6327
|
+
}, {
|
|
6328
|
+
key: "clearViewBox",
|
|
6329
|
+
value: function clearViewBox(viewBox, color) {
|
|
6330
|
+
this._handler.clearViewBox(viewBox, color);
|
|
6331
|
+
}
|
|
6332
|
+
}, {
|
|
6333
|
+
key: "isVisible",
|
|
6334
|
+
value: function isVisible(bbox) {
|
|
6335
|
+
return this._handler.isVisible(bbox);
|
|
6336
|
+
}
|
|
6337
|
+
}, {
|
|
6338
|
+
key: "onVisibleChange",
|
|
6339
|
+
value: function onVisibleChange(cb) {
|
|
6340
|
+
return this._handler.onVisibleChange(cb);
|
|
6341
|
+
}
|
|
6342
|
+
}, {
|
|
6343
|
+
key: "getTopLeft",
|
|
6344
|
+
value: function getTopLeft(baseWindow) {
|
|
6345
|
+
return this._handler.getTopLeft(baseWindow);
|
|
6346
|
+
}
|
|
6347
|
+
}]);
|
|
6348
|
+
return DefaultWindow;
|
|
6349
|
+
}();
|
|
6350
|
+
exports.DefaultWindow = __decorate$1A([injectable(), __metadata$1d("design:paramtypes", [])], exports.DefaultWindow);
|
|
6351
|
+
|
|
6352
|
+
var __decorate$1z = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
6353
|
+
var d,
|
|
6354
|
+
c = arguments.length,
|
|
6355
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
6356
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
6357
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6358
|
+
},
|
|
6359
|
+
__metadata$1c = undefined && undefined.__metadata || function (k, v) {
|
|
6360
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
6199
6361
|
},
|
|
6200
6362
|
__param$Q = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
6201
6363
|
return function (target, key) {
|
|
@@ -6276,10 +6438,45 @@
|
|
|
6276
6438
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
6277
6439
|
}, null != option ? option : {}), textSpec);
|
|
6278
6440
|
}
|
|
6441
|
+
}, {
|
|
6442
|
+
key: "drawGraphicToCanvas",
|
|
6443
|
+
value: function drawGraphicToCanvas(graphic, stage, canvas) {
|
|
6444
|
+
if (!stage.defaultLayer) return null;
|
|
6445
|
+
var window = container.get(VWindow),
|
|
6446
|
+
bounds = graphic.AABBBounds,
|
|
6447
|
+
width = bounds.width(),
|
|
6448
|
+
height = bounds.height();
|
|
6449
|
+
window.create({
|
|
6450
|
+
width: width,
|
|
6451
|
+
height: height,
|
|
6452
|
+
canvas: canvas,
|
|
6453
|
+
dpr: stage.window.dpr,
|
|
6454
|
+
canvasControled: !0,
|
|
6455
|
+
offscreen: !0,
|
|
6456
|
+
title: ""
|
|
6457
|
+
});
|
|
6458
|
+
var x = -bounds.x1,
|
|
6459
|
+
y = -bounds.y1,
|
|
6460
|
+
disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
|
|
6461
|
+
stage.params.optimize.disableCheckGraphicWidthOutRange = !0, stage.defaultLayer.getNativeHandler().drawTo(window, [graphic], {
|
|
6462
|
+
x: x,
|
|
6463
|
+
y: y,
|
|
6464
|
+
width: width,
|
|
6465
|
+
height: height,
|
|
6466
|
+
stage: stage,
|
|
6467
|
+
layer: stage.defaultLayer,
|
|
6468
|
+
renderService: stage.renderService,
|
|
6469
|
+
background: "transparent",
|
|
6470
|
+
clear: !0,
|
|
6471
|
+
updateBounds: !1
|
|
6472
|
+
}), stage.params.optimize.disableCheckGraphicWidthOutRange = disableCheckGraphicWidthOutRange;
|
|
6473
|
+
var c = window.getNativeHandler();
|
|
6474
|
+
return c.nativeCanvas ? c.nativeCanvas : null;
|
|
6475
|
+
}
|
|
6279
6476
|
}]);
|
|
6280
6477
|
return DefaultGraphicUtil;
|
|
6281
6478
|
}();
|
|
6282
|
-
exports.DefaultGraphicUtil = __decorate$
|
|
6479
|
+
exports.DefaultGraphicUtil = __decorate$1z([injectable(), __param$Q(0, inject(ContributionProvider)), __param$Q(0, named(TextMeasureContribution)), __metadata$1c("design:paramtypes", [Object])], exports.DefaultGraphicUtil);
|
|
6283
6480
|
var TransformMode;
|
|
6284
6481
|
!function (TransformMode) {
|
|
6285
6482
|
TransformMode[TransformMode.transform = 0] = "transform", TransformMode[TransformMode.matrix = 1] = "matrix";
|
|
@@ -6356,7 +6553,7 @@
|
|
|
6356
6553
|
}]);
|
|
6357
6554
|
return DefaultTransformUtil;
|
|
6358
6555
|
}();
|
|
6359
|
-
exports.DefaultTransformUtil = __decorate$
|
|
6556
|
+
exports.DefaultTransformUtil = __decorate$1z([injectable(), __metadata$1c("design:paramtypes", [])], exports.DefaultTransformUtil);
|
|
6360
6557
|
|
|
6361
6558
|
var defaultThemeObj = {
|
|
6362
6559
|
arc: DefaultArcAttribute,
|
|
@@ -12871,14 +13068,14 @@
|
|
|
12871
13068
|
var VirtualLayerHandlerContribution = Symbol["for"]("VirtualLayerHandlerContribution");
|
|
12872
13069
|
|
|
12873
13070
|
var _DefaultLayerService_,
|
|
12874
|
-
__decorate$
|
|
13071
|
+
__decorate$1y = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12875
13072
|
var d,
|
|
12876
13073
|
c = arguments.length,
|
|
12877
13074
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12878
13075
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12879
13076
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12880
13077
|
},
|
|
12881
|
-
__metadata$
|
|
13078
|
+
__metadata$1b = undefined && undefined.__metadata || function (k, v) {
|
|
12882
13079
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12883
13080
|
};
|
|
12884
13081
|
exports.DefaultLayerService = _DefaultLayerService_ = /*#__PURE__*/function () {
|
|
@@ -12964,169 +13161,7 @@
|
|
|
12964
13161
|
}]);
|
|
12965
13162
|
return DefaultLayerService_1;
|
|
12966
13163
|
}();
|
|
12967
|
-
exports.DefaultLayerService.idprefix = "visactor_layer", exports.DefaultLayerService.prefix_count = 0, exports.DefaultLayerService = _DefaultLayerService_ = __decorate$
|
|
12968
|
-
|
|
12969
|
-
var __decorate$1y = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12970
|
-
var d,
|
|
12971
|
-
c = arguments.length,
|
|
12972
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12973
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12974
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12975
|
-
},
|
|
12976
|
-
__metadata$1b = undefined && undefined.__metadata || function (k, v) {
|
|
12977
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12978
|
-
};
|
|
12979
|
-
var VWindow = Symbol["for"]("VWindow");
|
|
12980
|
-
var WindowHandlerContribution = Symbol["for"]("WindowHandlerContribution");
|
|
12981
|
-
exports.DefaultWindow = /*#__PURE__*/function () {
|
|
12982
|
-
function DefaultWindow() {
|
|
12983
|
-
_classCallCheck(this, DefaultWindow);
|
|
12984
|
-
this.hooks = {
|
|
12985
|
-
onChange: new SyncHook(["x", "y", "width", "height"])
|
|
12986
|
-
}, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
|
|
12987
|
-
}
|
|
12988
|
-
_createClass(DefaultWindow, [{
|
|
12989
|
-
key: "width",
|
|
12990
|
-
get: function get() {
|
|
12991
|
-
if (this._handler) {
|
|
12992
|
-
var wh = this._handler.getWH();
|
|
12993
|
-
return this._width = wh.width;
|
|
12994
|
-
}
|
|
12995
|
-
return this._width;
|
|
12996
|
-
}
|
|
12997
|
-
}, {
|
|
12998
|
-
key: "height",
|
|
12999
|
-
get: function get() {
|
|
13000
|
-
if (this._handler) {
|
|
13001
|
-
var wh = this._handler.getWH();
|
|
13002
|
-
return this._height = wh.height;
|
|
13003
|
-
}
|
|
13004
|
-
return this._height;
|
|
13005
|
-
}
|
|
13006
|
-
}, {
|
|
13007
|
-
key: "dpr",
|
|
13008
|
-
get: function get() {
|
|
13009
|
-
return this._handler.getDpr();
|
|
13010
|
-
}
|
|
13011
|
-
}, {
|
|
13012
|
-
key: "postInit",
|
|
13013
|
-
value: function postInit() {
|
|
13014
|
-
var _this = this;
|
|
13015
|
-
this.global.hooks.onSetEnv.tap("window", function () {
|
|
13016
|
-
_this.active();
|
|
13017
|
-
}), this.active();
|
|
13018
|
-
}
|
|
13019
|
-
}, {
|
|
13020
|
-
key: "active",
|
|
13021
|
-
value: function active() {
|
|
13022
|
-
var global = this.global;
|
|
13023
|
-
if (!global.env || this.actived) return;
|
|
13024
|
-
container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
|
|
13025
|
-
}
|
|
13026
|
-
}, {
|
|
13027
|
-
key: "style",
|
|
13028
|
-
get: function get() {
|
|
13029
|
-
return this._handler.getStyle();
|
|
13030
|
-
},
|
|
13031
|
-
set: function set(style) {
|
|
13032
|
-
this._handler.setStyle(style);
|
|
13033
|
-
}
|
|
13034
|
-
}, {
|
|
13035
|
-
key: "create",
|
|
13036
|
-
value: function create(params) {
|
|
13037
|
-
this._handler.createWindow(params);
|
|
13038
|
-
var windowWH = this._handler.getWH();
|
|
13039
|
-
this._width = windowWH.width, this._height = windowWH.height, this.title = this._handler.getTitle(), this.resizable = !0;
|
|
13040
|
-
}
|
|
13041
|
-
}, {
|
|
13042
|
-
key: "setWindowHandler",
|
|
13043
|
-
value: function setWindowHandler(handler) {
|
|
13044
|
-
this._handler = handler;
|
|
13045
|
-
}
|
|
13046
|
-
}, {
|
|
13047
|
-
key: "setDpr",
|
|
13048
|
-
value: function setDpr(dpr) {
|
|
13049
|
-
return this._handler.setDpr(dpr);
|
|
13050
|
-
}
|
|
13051
|
-
}, {
|
|
13052
|
-
key: "resize",
|
|
13053
|
-
value: function resize(w, h) {
|
|
13054
|
-
return this._handler.resizeWindow(w, h);
|
|
13055
|
-
}
|
|
13056
|
-
}, {
|
|
13057
|
-
key: "configure",
|
|
13058
|
-
value: function configure() {
|
|
13059
|
-
throw new Error("暂不支持");
|
|
13060
|
-
}
|
|
13061
|
-
}, {
|
|
13062
|
-
key: "release",
|
|
13063
|
-
value: function release() {
|
|
13064
|
-
return this._handler.releaseWindow();
|
|
13065
|
-
}
|
|
13066
|
-
}, {
|
|
13067
|
-
key: "getContext",
|
|
13068
|
-
value: function getContext() {
|
|
13069
|
-
return this._handler.getContext();
|
|
13070
|
-
}
|
|
13071
|
-
}, {
|
|
13072
|
-
key: "getNativeHandler",
|
|
13073
|
-
value: function getNativeHandler() {
|
|
13074
|
-
return this._handler.getNativeHandler();
|
|
13075
|
-
}
|
|
13076
|
-
}, {
|
|
13077
|
-
key: "getImageBuffer",
|
|
13078
|
-
value: function getImageBuffer(type) {
|
|
13079
|
-
return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
|
|
13080
|
-
}
|
|
13081
|
-
}, {
|
|
13082
|
-
key: "addEventListener",
|
|
13083
|
-
value: function addEventListener(type, listener, options) {
|
|
13084
|
-
return this._handler.addEventListener(type, listener, options);
|
|
13085
|
-
}
|
|
13086
|
-
}, {
|
|
13087
|
-
key: "removeEventListener",
|
|
13088
|
-
value: function removeEventListener(type, listener, options) {
|
|
13089
|
-
return this._handler.removeEventListener(type, listener, options);
|
|
13090
|
-
}
|
|
13091
|
-
}, {
|
|
13092
|
-
key: "dispatchEvent",
|
|
13093
|
-
value: function dispatchEvent(event) {
|
|
13094
|
-
return this._handler.dispatchEvent(event);
|
|
13095
|
-
}
|
|
13096
|
-
}, {
|
|
13097
|
-
key: "getBoundingClientRect",
|
|
13098
|
-
value: function getBoundingClientRect() {
|
|
13099
|
-
return this._handler.getBoundingClientRect();
|
|
13100
|
-
}
|
|
13101
|
-
}, {
|
|
13102
|
-
key: "getContainer",
|
|
13103
|
-
value: function getContainer() {
|
|
13104
|
-
return this._handler.container;
|
|
13105
|
-
}
|
|
13106
|
-
}, {
|
|
13107
|
-
key: "clearViewBox",
|
|
13108
|
-
value: function clearViewBox(viewBox, color) {
|
|
13109
|
-
this._handler.clearViewBox(viewBox, color);
|
|
13110
|
-
}
|
|
13111
|
-
}, {
|
|
13112
|
-
key: "isVisible",
|
|
13113
|
-
value: function isVisible(bbox) {
|
|
13114
|
-
return this._handler.isVisible(bbox);
|
|
13115
|
-
}
|
|
13116
|
-
}, {
|
|
13117
|
-
key: "onVisibleChange",
|
|
13118
|
-
value: function onVisibleChange(cb) {
|
|
13119
|
-
return this._handler.onVisibleChange(cb);
|
|
13120
|
-
}
|
|
13121
|
-
}, {
|
|
13122
|
-
key: "getTopLeft",
|
|
13123
|
-
value: function getTopLeft(baseWindow) {
|
|
13124
|
-
return this._handler.getTopLeft(baseWindow);
|
|
13125
|
-
}
|
|
13126
|
-
}]);
|
|
13127
|
-
return DefaultWindow;
|
|
13128
|
-
}();
|
|
13129
|
-
exports.DefaultWindow = __decorate$1y([injectable(), __metadata$1b("design:paramtypes", [])], exports.DefaultWindow);
|
|
13164
|
+
exports.DefaultLayerService.idprefix = "visactor_layer", exports.DefaultLayerService.prefix_count = 0, exports.DefaultLayerService = _DefaultLayerService_ = __decorate$1y([injectable(), __metadata$1b("design:paramtypes", [])], exports.DefaultLayerService);
|
|
13130
13165
|
|
|
13131
13166
|
var coreModule = new ContainerModule(function (bind) {
|
|
13132
13167
|
bind(VGlobal).to(exports.DefaultGlobal).inSingletonScope(), bind(VWindow).to(exports.DefaultWindow), bind(GraphicUtil).to(exports.DefaultGraphicUtil).inSingletonScope(), bind(TransformUtil).to(exports.DefaultTransformUtil).inSingletonScope(), bind(LayerService).to(exports.DefaultLayerService).inSingletonScope();
|
|
@@ -13701,7 +13736,7 @@
|
|
|
13701
13736
|
var _a;
|
|
13702
13737
|
var attribute = this.attribute,
|
|
13703
13738
|
textTheme = getTheme(this).text;
|
|
13704
|
-
if (this.
|
|
13739
|
+
if (!this.isSimplify()) return;
|
|
13705
13740
|
var _attribute$maxLineWid = attribute.maxLineWidth,
|
|
13706
13741
|
maxLineWidth = _attribute$maxLineWid === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid;
|
|
13707
13742
|
return Number.isFinite(maxLineWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
|
|
@@ -13709,23 +13744,28 @@
|
|
|
13709
13744
|
}, {
|
|
13710
13745
|
key: "clipedWidth",
|
|
13711
13746
|
get: function get() {
|
|
13712
|
-
if (
|
|
13747
|
+
if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
|
|
13713
13748
|
}
|
|
13714
13749
|
}, {
|
|
13715
13750
|
key: "cliped",
|
|
13716
13751
|
get: function get() {
|
|
13717
13752
|
var textTheme = getTheme(this).text,
|
|
13718
13753
|
attribute = this.attribute;
|
|
13719
|
-
if (this.
|
|
13754
|
+
if (!this.isSimplify()) return;
|
|
13720
13755
|
var _attribute$maxLineWid2 = attribute.maxLineWidth,
|
|
13721
13756
|
maxLineWidth = _attribute$maxLineWid2 === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid2;
|
|
13722
|
-
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), this.clipedText !== attribute.text.toString());
|
|
13757
|
+
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
13723
13758
|
}
|
|
13724
13759
|
}, {
|
|
13725
13760
|
key: "multilineLayout",
|
|
13726
13761
|
get: function get() {
|
|
13727
13762
|
if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
13728
13763
|
}
|
|
13764
|
+
}, {
|
|
13765
|
+
key: "isSimplify",
|
|
13766
|
+
value: function isSimplify() {
|
|
13767
|
+
return !this.isMultiLine && "vertical" !== this.attribute.direction;
|
|
13768
|
+
}
|
|
13729
13769
|
}, {
|
|
13730
13770
|
key: "isMultiLine",
|
|
13731
13771
|
get: function get() {
|
|
@@ -15439,7 +15479,14 @@
|
|
|
15439
15479
|
}, {
|
|
15440
15480
|
key: "toCustomPath",
|
|
15441
15481
|
value: function toCustomPath() {
|
|
15442
|
-
|
|
15482
|
+
var attribute = this.attribute;
|
|
15483
|
+
var width = isNil$1(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
|
|
15484
|
+
height = isNil$1(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
|
|
15485
|
+
x = 0,
|
|
15486
|
+
y = 0;
|
|
15487
|
+
width < 0 && (x = width, width = -width), height < 0 && (y = height, height = -height);
|
|
15488
|
+
var path = new CustomPath2D();
|
|
15489
|
+
return path.moveTo(x, y), path.rect(x, y, width, height), path;
|
|
15443
15490
|
}
|
|
15444
15491
|
}, {
|
|
15445
15492
|
key: "clone",
|
|
@@ -19959,7 +20006,7 @@
|
|
|
19959
20006
|
y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
|
|
19960
20007
|
});
|
|
19961
20008
|
}
|
|
19962
|
-
lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType), bottomCaches.unshift(lastBottomSeg);
|
|
20009
|
+
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType), bottomCaches.unshift(lastBottomSeg));
|
|
19963
20010
|
}
|
|
19964
20011
|
area.cacheArea = bottomCaches.map(function (item, index) {
|
|
19965
20012
|
return {
|
|
@@ -21023,8 +21070,8 @@
|
|
|
21023
21070
|
}();
|
|
21024
21071
|
exports.Canvas3DPickItemInterceptor = __decorate$1i([injectable()], exports.Canvas3DPickItemInterceptor);
|
|
21025
21072
|
|
|
21026
|
-
var pickModule = new ContainerModule(function (bind) {
|
|
21027
|
-
bind(PickerService).toService(GlobalPickerService), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
|
|
21073
|
+
var pickModule = new ContainerModule(function (bind, unbind, isBound) {
|
|
21074
|
+
isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
|
|
21028
21075
|
});
|
|
21029
21076
|
|
|
21030
21077
|
var graphicModule = new ContainerModule(function (bind) {
|
|
@@ -21836,12 +21883,12 @@
|
|
|
21836
21883
|
}
|
|
21837
21884
|
var d = context.dpr % 1;
|
|
21838
21885
|
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
21839
|
-
var drawInArea = dirtyBounds.width() * context.dpr
|
|
21886
|
+
var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
21840
21887
|
context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
|
|
21841
21888
|
var _a, _b;
|
|
21842
21889
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
21843
21890
|
}).forEach(function (group) {
|
|
21844
|
-
_this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0));
|
|
21891
|
+
group.isContainer ? _this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : _this2.renderItem(group, drawContext);
|
|
21845
21892
|
}), context.restore(), context.restore(), context.draw(), context.inuse = !1;
|
|
21846
21893
|
}
|
|
21847
21894
|
}, {
|
|
@@ -22622,7 +22669,11 @@
|
|
|
22622
22669
|
container.load(renderModule);
|
|
22623
22670
|
}
|
|
22624
22671
|
|
|
22625
|
-
|
|
22672
|
+
var loaded$r = !1;
|
|
22673
|
+
function preLoadAllModule() {
|
|
22674
|
+
loaded$r || (loaded$r = !0, container.load(coreModule), container.load(graphicModule), container.load(renderModule$1), container.load(pickModule), container.load(pluginModule), load$1(container), load(container));
|
|
22675
|
+
}
|
|
22676
|
+
preLoadAllModule();
|
|
22626
22677
|
var vglobal = container.get(VGlobal);
|
|
22627
22678
|
application.global = vglobal;
|
|
22628
22679
|
var graphicUtil = container.get(GraphicUtil);
|
|
@@ -23279,11 +23330,26 @@
|
|
|
23279
23330
|
return OrthoCamera;
|
|
23280
23331
|
}();
|
|
23281
23332
|
|
|
23333
|
+
var _isBrowserEnv;
|
|
23334
|
+
function initIsBrowserEnv() {
|
|
23335
|
+
if (null == _isBrowserEnv) {
|
|
23336
|
+
try {
|
|
23337
|
+
_isBrowserEnv = !!window;
|
|
23338
|
+
} catch (err) {
|
|
23339
|
+
_isBrowserEnv = !1;
|
|
23340
|
+
}
|
|
23341
|
+
if (_isBrowserEnv) try {
|
|
23342
|
+
_isBrowserEnv = !tt;
|
|
23343
|
+
} catch (err) {
|
|
23344
|
+
_isBrowserEnv = !0;
|
|
23345
|
+
}
|
|
23346
|
+
}
|
|
23347
|
+
}
|
|
23282
23348
|
function isBrowserEnv() {
|
|
23283
|
-
return
|
|
23349
|
+
return initIsBrowserEnv(), _isBrowserEnv;
|
|
23284
23350
|
}
|
|
23285
23351
|
function isNodeEnv() {
|
|
23286
|
-
return
|
|
23352
|
+
return initIsBrowserEnv(), !_isBrowserEnv;
|
|
23287
23353
|
}
|
|
23288
23354
|
function getCurrentEnv() {
|
|
23289
23355
|
return isBrowserEnv() ? "browser" : "node";
|
|
@@ -30829,7 +30895,7 @@
|
|
|
30829
30895
|
key: "mapToCanvasPoint",
|
|
30830
30896
|
value: function mapToCanvasPoint(event) {
|
|
30831
30897
|
var _a;
|
|
30832
|
-
return
|
|
30898
|
+
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
30833
30899
|
}
|
|
30834
30900
|
}]);
|
|
30835
30901
|
return FeishuEnvContribution;
|
|
@@ -31319,6 +31385,12 @@
|
|
|
31319
31385
|
rafBasedSto.clear(h);
|
|
31320
31386
|
};
|
|
31321
31387
|
}
|
|
31388
|
+
}, {
|
|
31389
|
+
key: "mapToCanvasPoint",
|
|
31390
|
+
value: function mapToCanvasPoint(event) {
|
|
31391
|
+
var _a;
|
|
31392
|
+
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
31393
|
+
}
|
|
31322
31394
|
}, {
|
|
31323
31395
|
key: "addEventListener",
|
|
31324
31396
|
value: function addEventListener(type, listener, options) {
|
|
@@ -32177,6 +32249,12 @@
|
|
|
32177
32249
|
value: function getStaticCanvasCount() {
|
|
32178
32250
|
return 9999;
|
|
32179
32251
|
}
|
|
32252
|
+
}, {
|
|
32253
|
+
key: "mapToCanvasPoint",
|
|
32254
|
+
value: function mapToCanvasPoint(event) {
|
|
32255
|
+
var _a;
|
|
32256
|
+
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
32257
|
+
}
|
|
32180
32258
|
}, {
|
|
32181
32259
|
key: "configure",
|
|
32182
32260
|
value: function configure(service, params) {
|
|
@@ -32748,7 +32826,7 @@
|
|
|
32748
32826
|
key: "mapToCanvasPoint",
|
|
32749
32827
|
value: function mapToCanvasPoint(event) {
|
|
32750
32828
|
var _a;
|
|
32751
|
-
return
|
|
32829
|
+
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
32752
32830
|
}
|
|
32753
32831
|
}]);
|
|
32754
32832
|
return WxEnvContribution;
|
|
@@ -34359,7 +34437,8 @@
|
|
|
34359
34437
|
|
|
34360
34438
|
var roughModule = _roughModule;
|
|
34361
34439
|
|
|
34362
|
-
const version = "0.17.
|
|
34440
|
+
const version = "0.17.8";
|
|
34441
|
+
preLoadAllModule();
|
|
34363
34442
|
if (isBrowserEnv()) {
|
|
34364
34443
|
loadBrowserEnv(container);
|
|
34365
34444
|
}
|
|
@@ -34827,6 +34906,7 @@
|
|
|
34827
34906
|
exports.polygonCanvasPickModule = polygonCanvasPickModule;
|
|
34828
34907
|
exports.polygonMathPickModule = polygonMathPickModule;
|
|
34829
34908
|
exports.polygonModule = polygonModule;
|
|
34909
|
+
exports.preLoadAllModule = preLoadAllModule;
|
|
34830
34910
|
exports.pyramid3dCanvasPickModule = pyramid3dCanvasPickModule;
|
|
34831
34911
|
exports.pyramid3dModule = pyramid3dModule;
|
|
34832
34912
|
exports.rafBasedSto = rafBasedSto;
|