@visactor/vrender 0.17.22-alpha.0 → 0.17.22

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "0.17.22-alpha.0";
2
+ export declare const version = "0.17.22";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
package/cjs/index.js CHANGED
@@ -21,14 +21,13 @@ 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.22-alpha.0", (0, vrender_core_1.preLoadAllModule)(), (0,
25
- vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
26
- vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
27
- (0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
28
- (0, vrender_kits_2.registerCircle)(), (0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(),
29
- (0, vrender_kits_2.registerImage)(), (0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(),
30
- (0, vrender_kits_2.registerPolygon)(), (0, vrender_kits_2.registerPyramid3d)(),
31
- (0, vrender_kits_2.registerRect)(), (0, vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(),
32
- (0, vrender_kits_2.registerShadowRoot)(), (0, vrender_kits_2.registerSymbol)(),
33
- (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(), __exportStar(require("@visactor/vrender-core"), exports),
34
- __exportStar(require("@visactor/vrender-kits"), exports);
24
+ exports.version = "0.17.22", (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,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,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.22-alpha.0\";\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"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,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.22\";\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
@@ -6707,7 +6707,7 @@
6707
6707
  }();
6708
6708
  var globalTheme = new Theme();
6709
6709
  function getTheme(graphic, theme) {
6710
- return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
6710
+ return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
6711
6711
  }
6712
6712
  function getThemeFromGroup(graphic) {
6713
6713
  var g;
@@ -6971,12 +6971,12 @@
6971
6971
  }
6972
6972
  }, {
6973
6973
  key: "removeAllChild",
6974
- value: function removeAllChild() {
6974
+ value: function removeAllChild(deep) {
6975
6975
  if (!this._idMap) return;
6976
6976
  var child = this._firstChild;
6977
6977
  for (; child;) {
6978
6978
  var next = child._next;
6979
- child.parent = null, child._prev = null, child._next = null, child = next;
6979
+ child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
6980
6980
  }
6981
6981
  this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
6982
6982
  }
@@ -11587,7 +11587,8 @@
11587
11587
  }, {
11588
11588
  key: "tryUpdateGlobalAABBBounds",
11589
11589
  value: function tryUpdateGlobalAABBBounds() {
11590
- return this._globalAABBBounds ? this._globalAABBBounds.setValue(this._AABBBounds.x1, this._AABBBounds.y1, this._AABBBounds.x2, this._AABBBounds.y2) : this._globalAABBBounds = this.AABBBounds.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
11590
+ var b = this.AABBBounds;
11591
+ return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
11591
11592
  }
11592
11593
  }, {
11593
11594
  key: "tryUpdateGlobalTransMatrix",
@@ -12893,8 +12894,9 @@
12893
12894
  }, {
12894
12895
  key: "removeAllChild",
12895
12896
  value: function removeAllChild() {
12897
+ var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
12896
12898
  this.forEachChildren(function (child) {
12897
- application.graphicService.onRemove(child);
12899
+ application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
12898
12900
  }), _get(_getPrototypeOf(Group.prototype), "removeAllChild", this).call(this), this.addUpdateBoundTag();
12899
12901
  }
12900
12902
  }, {
@@ -22266,7 +22268,7 @@
22266
22268
  var d = context.dpr % 1;
22267
22269
  (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);
22268
22270
  var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
22269
- 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.clear(), this.backupDirtyBounds.clear()), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22271
+ 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) {
22270
22272
  var _a, _b;
22271
22273
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22272
22274
  }).forEach(function (group) {
@@ -22329,7 +22331,7 @@
22329
22331
  }, subLayers.set(group._uid, incrementalLayer));
22330
22332
  var incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
22331
22333
  idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
22332
- idc.dirtyBounds.clear(), idc.backupDirtyBounds.clear(), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22334
+ idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22333
22335
  drawContribution: idc,
22334
22336
  clear: "transparent",
22335
22337
  layer: incrementalLayer.layer,
@@ -23207,6 +23209,8 @@
23207
23209
  var _this = this;
23208
23210
  this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, function (stage) {
23209
23211
  stage && stage === _this.pluginService.stage && _this.drawHTML(context.stage.renderService);
23212
+ }), application.graphicService.hooks.onRemove.tap(this.key, function (graphic) {
23213
+ _this.removeDom(graphic);
23210
23214
  }), application.graphicService.hooks.onRelease.tap(this.key, function (graphic) {
23211
23215
  _this.removeDom(graphic);
23212
23216
  });
@@ -23263,26 +23267,27 @@
23263
23267
  anchorType = _html$anchorType === void 0 ? "boundsLeftTop" : _html$anchorType;
23264
23268
  graphic.bindDom || (graphic.bindDom = new Map());
23265
23269
  var lastDom = graphic.bindDom.get(dom);
23266
- if (lastDom && (!container || container === lastDom.container)) return;
23267
- var nativeDom, nativeContainer;
23268
- graphic.bindDom.forEach(function (_ref) {
23269
- var wrapGroup = _ref.wrapGroup;
23270
- application.global.removeDom(wrapGroup);
23271
- }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
23272
- var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
23273
- nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
23274
- var wrapGroup = application.global.createDom({
23275
- tagName: "div",
23276
- width: width,
23277
- height: height,
23278
- style: style,
23279
- parent: nativeContainer
23280
- });
23281
- wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
23282
- dom: nativeDom,
23283
- container: container,
23284
- wrapGroup: wrapGroup
23285
- })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
23270
+ var wrapGroup, nativeContainer;
23271
+ if (!lastDom || container && container !== lastDom.container) {
23272
+ var nativeDom;
23273
+ graphic.bindDom.forEach(function (_ref) {
23274
+ var wrapGroup = _ref.wrapGroup;
23275
+ application.global.removeDom(wrapGroup);
23276
+ }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
23277
+ var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
23278
+ nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
23279
+ tagName: "div",
23280
+ width: width,
23281
+ height: height,
23282
+ style: style,
23283
+ parent: nativeContainer
23284
+ }), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
23285
+ dom: nativeDom,
23286
+ container: container,
23287
+ wrapGroup: wrapGroup
23288
+ }));
23289
+ } else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
23290
+ wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
23286
23291
  var left = 0,
23287
23292
  top = 0;
23288
23293
  var b = graphic.globalAABBBounds;
@@ -35035,7 +35040,7 @@
35035
35040
 
35036
35041
  var roughModule = _roughModule;
35037
35042
 
35038
- const version = "0.17.22-alpha.0";
35043
+ const version = "0.17.22";
35039
35044
  preLoadAllModule();
35040
35045
  if (isBrowserEnv()) {
35041
35046
  loadBrowserEnv(container);