@visactor/vrender-core 0.16.10-alpha.1 → 0.16.11

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.
Files changed (105) hide show
  1. package/cjs/allocator/matrix-allocate.js +1 -2
  2. package/cjs/animate/custom-animate.js +2 -1
  3. package/cjs/common/Reflect-metadata.js +1 -1
  4. package/cjs/common/bezier-utils.js +2 -1
  5. package/cjs/common/bounds-context.js +1 -1
  6. package/cjs/common/canvas-utils.js +1 -1
  7. package/cjs/common/contribution-provider.js +1 -1
  8. package/cjs/common/custom-path2d.js +1 -1
  9. package/cjs/common/enums.js +1 -1
  10. package/cjs/common/generator.js +1 -1
  11. package/cjs/common/matrix.js +1 -1
  12. package/cjs/common/morphing-utils.js +1 -1
  13. package/cjs/common/path-svg.js +1 -1
  14. package/cjs/common/polygon.js +2 -2
  15. package/cjs/common/render-area.js +1 -1
  16. package/cjs/common/render-command-list.js +1 -1
  17. package/cjs/common/render-curve.js +2 -2
  18. package/cjs/common/seg-context.js +1 -1
  19. package/cjs/common/sort.js +1 -1
  20. package/cjs/common/split-path.js +2 -1
  21. package/cjs/common/store.js +1 -1
  22. package/cjs/common/text.js +1 -1
  23. package/cjs/common/utils.js +1 -1
  24. package/cjs/common/xml/OrderedObjParser.js +2 -2
  25. package/cjs/common/xml/OrderedObjParser.js.map +1 -1
  26. package/cjs/core/camera.js +1 -2
  27. package/cjs/core/global-module.js +0 -2
  28. package/cjs/core/global.js +1 -1
  29. package/cjs/core/graphic-utils.js +1 -1
  30. package/cjs/core/index.js +1 -1
  31. package/cjs/core/layer-service.js +1 -1
  32. package/cjs/core/layer.js +1 -1
  33. package/cjs/core/light.js +1 -1
  34. package/cjs/core/stage.js +1 -1
  35. package/cjs/core/window.js +1 -1
  36. package/cjs/event/constant.js +1 -1
  37. package/cjs/event/event-manager.js +1 -1
  38. package/cjs/event/event-system.js +1 -1
  39. package/cjs/event/event-target.js +1 -1
  40. package/cjs/event/index.js +1 -2
  41. package/cjs/event/util.js +1 -1
  42. package/cjs/graphic/arc.js +1 -1
  43. package/cjs/graphic/arc3d.js +1 -1
  44. package/cjs/graphic/area.js +1 -1
  45. package/cjs/graphic/bounds.js +1 -1
  46. package/cjs/graphic/circle.js +1 -1
  47. package/cjs/graphic/config.js +1 -1
  48. package/cjs/graphic/tools.js +1 -1
  49. package/cjs/graphic/tools.js.map +1 -1
  50. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
  51. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  52. package/dist/index.js +6 -2
  53. package/dist/index.min.js +1 -1
  54. package/es/allocator/matrix-allocate.js +1 -2
  55. package/es/animate/custom-animate.js +2 -1
  56. package/es/common/Reflect-metadata.js +1 -1
  57. package/es/common/bezier-utils.js +2 -1
  58. package/es/common/bounds-context.js +1 -1
  59. package/es/common/canvas-utils.js +1 -1
  60. package/es/common/contribution-provider.js +1 -1
  61. package/es/common/custom-path2d.js +1 -1
  62. package/es/common/enums.js +1 -1
  63. package/es/common/generator.js +1 -1
  64. package/es/common/matrix.js +1 -1
  65. package/es/common/morphing-utils.js +1 -1
  66. package/es/common/path-svg.js +1 -1
  67. package/es/common/polygon.js +1 -1
  68. package/es/common/render-area.js +1 -1
  69. package/es/common/render-command-list.js +1 -1
  70. package/es/common/render-curve.js +1 -1
  71. package/es/common/seg-context.js +1 -1
  72. package/es/common/sort.js +1 -1
  73. package/es/common/split-path.js +2 -1
  74. package/es/common/store.js +1 -1
  75. package/es/common/text.js +1 -1
  76. package/es/common/utils.js +1 -1
  77. package/es/common/xml/OrderedObjParser.js +2 -2
  78. package/es/common/xml/OrderedObjParser.js.map +1 -1
  79. package/es/core/camera.js +1 -2
  80. package/es/core/global-module.js +0 -2
  81. package/es/core/global.js +1 -1
  82. package/es/core/graphic-utils.js +1 -1
  83. package/es/core/index.js +1 -1
  84. package/es/core/layer-service.js +1 -1
  85. package/es/core/layer.js +1 -1
  86. package/es/core/light.js +1 -1
  87. package/es/core/stage.js +1 -1
  88. package/es/core/window.js +1 -1
  89. package/es/event/constant.js +1 -1
  90. package/es/event/event-manager.js +1 -1
  91. package/es/event/event-system.js +1 -1
  92. package/es/event/event-target.js +1 -1
  93. package/es/event/index.js +1 -2
  94. package/es/event/util.js +1 -1
  95. package/es/graphic/arc.js +1 -1
  96. package/es/graphic/arc3d.js +1 -1
  97. package/es/graphic/area.js +1 -1
  98. package/es/graphic/bounds.js +1 -1
  99. package/es/graphic/circle.js +1 -1
  100. package/es/graphic/config.js +1 -1
  101. package/es/graphic/tools.js +1 -1
  102. package/es/graphic/tools.js.map +1 -1
  103. package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
  104. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  105. package/package.json +3 -3
@@ -73,5 +73,4 @@ class DefaultMat4Allocate {
73
73
  }
74
74
 
75
75
  exports.DefaultMat4Allocate = DefaultMat4Allocate, exports.matrixAllocate = new DefaultMatrixAllocate,
76
- exports.mat4Allocate = new DefaultMat4Allocate;
77
- //# sourceMappingURL=matrix-allocate.js.map
76
+ exports.mat4Allocate = new DefaultMat4Allocate;
@@ -644,4 +644,5 @@ class AnimateGroup1 extends animate_1.ACustomAnimate {
644
644
  }
645
645
  }
646
646
 
647
- exports.AnimateGroup1 = AnimateGroup1;
647
+ exports.AnimateGroup1 = AnimateGroup1;
648
+ //# sourceMappingURL=custom-animate.js.map
@@ -389,4 +389,4 @@ Object.defineProperty(exports, "__esModule", {
389
389
  }(exporter);
390
390
  }(), Reflect;
391
391
  }(Reflect || (Reflect = {}));
392
- //# sourceMappingURL=Reflect-metadata.js.map
392
+ //# sourceMappingURL=Reflect-metadata.js.map
@@ -31,4 +31,5 @@ function cubicPointAt(p0, p1, p2, p3, t) {
31
31
  }
32
32
 
33
33
  exports.snapLength = snapLength, exports.cubicLength = cubicLength, exports.cubicCalc = cubicCalc,
34
- exports.cubicPointAt = cubicPointAt;
34
+ exports.cubicPointAt = cubicPointAt;
35
+ //# sourceMappingURL=bezier-utils.js.map
@@ -57,4 +57,4 @@ class BoundsContext {
57
57
  }
58
58
 
59
59
  exports.BoundsContext = BoundsContext;
60
- //# sourceMappingURL=bounds-context.js.map
60
+ //# sourceMappingURL=bounds-context.js.map
@@ -69,5 +69,5 @@ function createConicGradient(context, color, params, offsetX = 0, offsetY = 0) {
69
69
  })), canvasGradient.GetPattern(w + x, h + y, undefined);
70
70
  }
71
71
 
72
+ exports.getScaledStroke = getScaledStroke, exports.createColor = createColor;
72
73
  //# sourceMappingURL=canvas-utils.js.map
73
- exports.getScaledStroke = getScaledStroke, exports.createColor = createColor;
@@ -24,4 +24,4 @@ function bindContributionProviderNoSingletonScope(bind, id) {
24
24
  }
25
25
 
26
26
  exports.bindContributionProvider = bindContributionProvider, exports.bindContributionProviderNoSingletonScope = bindContributionProviderNoSingletonScope;
27
- //# sourceMappingURL=contribution-provider.js.map
27
+ //# sourceMappingURL=contribution-provider.js.map
@@ -330,4 +330,4 @@ function scale(current, sX, sY) {
330
330
  temp[7] = sY * current[7]; else if ("h" === c || "H" === c) temp[1] = sX * current[1]; else if ("v" === c || "V" === c) temp[1] = sY * current[1]; else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
331
331
  return temp;
332
332
  }
333
- //# sourceMappingURL=custom-path2d.js.map
333
+ //# sourceMappingURL=custom-path2d.js.map
@@ -46,4 +46,4 @@ function(Direction) {
46
46
  BaseRenderContributionTime[BaseRenderContributionTime.beforeFillStroke = 0] = "beforeFillStroke",
47
47
  BaseRenderContributionTime[BaseRenderContributionTime.afterFillStroke = 1] = "afterFillStroke";
48
48
  }(BaseRenderContributionTime = exports.BaseRenderContributionTime || (exports.BaseRenderContributionTime = {}));
49
- //# sourceMappingURL=enums.js.map
49
+ //# sourceMappingURL=enums.js.map
@@ -11,4 +11,4 @@ class Generator {
11
11
  }
12
12
 
13
13
  exports.Generator = Generator, Generator.auto_increment_id = 0;
14
- //# sourceMappingURL=generator.js.map
14
+ //# sourceMappingURL=generator.js.map
@@ -51,4 +51,4 @@ function transformMat4(out, a, m) {
51
51
  }
52
52
 
53
53
  exports.lookAt = lookAt, exports.ortho = ortho, exports.multiply = multiply, exports.transformMat4 = transformMat4;
54
- //# sourceMappingURL=matrix.js.map
54
+ //# sourceMappingURL=matrix.js.map
@@ -292,4 +292,4 @@ function bezierCurversToPath(bezierCurves) {
292
292
 
293
293
  exports.pathToBezierCurves = pathToBezierCurves, exports.applyTransformOnBezierCurves = applyTransformOnBezierCurves,
294
294
  exports.bezierCurversToPath = bezierCurversToPath;
295
- //# sourceMappingURL=morphing-utils.js.map
295
+ //# sourceMappingURL=morphing-utils.js.map
@@ -61,4 +61,4 @@ exports.enumCommandMap = {
61
61
  Q: 7,
62
62
  R: 8
63
63
  }, exports.parseSvgPath = parseSvgPath;
64
- //# sourceMappingURL=path-svg.js.map
64
+ //# sourceMappingURL=path-svg.js.map
@@ -39,8 +39,8 @@ function getProportionPoint(point, segment, length, dx, dy) {
39
39
  };
40
40
  }
41
41
 
42
- //# sourceMappingURL=polygon.js.map
43
42
  Object.defineProperty(exports, "__esModule", {
44
43
  value: !0
45
44
  }), exports.drawRoundedPolygon = exports.drawPolygon = void 0, exports.drawPolygon = drawPolygon,
46
- exports.drawRoundedPolygon = drawRoundedPolygon;
45
+ exports.drawRoundedPolygon = drawRoundedPolygon;
46
+ //# sourceMappingURL=polygon.js.map
@@ -132,5 +132,5 @@ function drawSegItem(ctx, curve, endPercent, params) {
132
132
  }
133
133
  }
134
134
 
135
+ exports.drawAreaSegments = drawAreaSegments;
135
136
  //# sourceMappingURL=render-area.js.map
136
- exports.drawAreaSegments = drawAreaSegments;
@@ -14,4 +14,4 @@ function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z
14
14
  }
15
15
 
16
16
  exports.renderCommandList = renderCommandList;
17
- //# sourceMappingURL=render-command-list.js.map
17
+ //# sourceMappingURL=render-command-list.js.map
@@ -118,6 +118,6 @@ function drawSegItem(ctx, curve, endPercent, params) {
118
118
  }
119
119
  }
120
120
 
121
- //# sourceMappingURL=render-curve.js.map
122
121
  exports.drawSegments = drawSegments, exports.drawIncrementalSegments = drawIncrementalSegments,
123
- exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
122
+ exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
123
+ //# sourceMappingURL=render-curve.js.map
@@ -95,4 +95,4 @@ class ReflectSegContext extends SegContext {
95
95
  }
96
96
 
97
97
  exports.ReflectSegContext = ReflectSegContext;
98
- //# sourceMappingURL=seg-context.js.map
98
+ //# sourceMappingURL=seg-context.js.map
@@ -98,4 +98,4 @@ Object.defineProperty(exports, "__esModule", {
98
98
  value: !0
99
99
  }), exports.findNextGraphic = exports.foreachAsync = exports.foreach = void 0, exports.foreach = foreach,
100
100
  exports.foreachAsync = foreachAsync, exports.findNextGraphic = findNextGraphic;
101
- //# sourceMappingURL=sort.js.map
101
+ //# sourceMappingURL=sort.js.map
@@ -268,4 +268,5 @@ const splitPath = (path, count) => {
268
268
  return res;
269
269
  };
270
270
 
271
- exports.splitPath = splitPath;
271
+ exports.splitPath = splitPath;
272
+ //# sourceMappingURL=split-path.js.map
@@ -1,2 +1,2 @@
1
1
  class StageStore {}
2
- //# sourceMappingURL=store.js.map
2
+ //# sourceMappingURL=store.js.map
@@ -24,4 +24,4 @@ Object.defineProperty(exports, "__esModule", {
24
24
  }), exports.textLayoutOffsetY = exports.textDrawOffsetX = exports.textDrawOffsetY = exports.getContextFont = void 0,
25
25
  exports.getContextFont = getContextFont, exports.textDrawOffsetY = textDrawOffsetY,
26
26
  exports.textDrawOffsetX = textDrawOffsetX, exports.textLayoutOffsetY = textLayoutOffsetY;
27
- //# sourceMappingURL=text.js.map
27
+ //# sourceMappingURL=text.js.map
@@ -151,4 +151,4 @@ class RafBasedSTO {
151
151
  }
152
152
 
153
153
  exports.RafBasedSTO = RafBasedSTO, RafBasedSTO.TimeOut = 1e3 / 60, exports.rafBasedSto = new RafBasedSTO;
154
- //# sourceMappingURL=utils.js.map
154
+ //# sourceMappingURL=utils.js.map
@@ -98,8 +98,8 @@ class OrderedObjParser {
98
98
  for (let i = 0; i < xmlData.length; i++) {
99
99
  if ("<" === xmlData[i]) if ("/" === xmlData[i + 1]) {
100
100
  const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."), propIndex = jPath.lastIndexOf(".");
101
- jPath = jPath.substring(0, propIndex), currentNode = this.tagsNodeStack.pop(), textData = "",
102
- i = closeIndex;
101
+ jPath = jPath.substring(0, propIndex), currentNode = this.tagsNodeStack.pop(), currentNode && currentNode.child && textData && currentNode.child[currentNode.child.length - 1][":@"] && (currentNode.child[currentNode.child.length - 1][":@"].text = textData),
102
+ textData = "", i = closeIndex;
103
103
  } else if ("?" === xmlData[i + 1]) {
104
104
  i = readTagExp(xmlData, i, !1, "?>").closeIndex + 1;
105
105
  } else if ("!--" === xmlData.substr(i + 1, 3)) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common/xml/OrderedObjParser.ts"],"names":[],"mappings":";;;AA2BA,mCAAwC;AAExC,MAAM,OAAO;IAIX,YAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAClB,CAAC;IACD,GAAG,CAAC,GAAW,EAAE,GAAW;QAE1B,IAAI,GAAG,KAAK,WAAW,EAAE;YACvB,GAAG,GAAG,YAAY,CAAC;SACpB;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,QAAQ,CAAC,IAAa;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,WAAW,EAAE;YAChC,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC;SAC7B;QACD,IAAI,IAAI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E;wBACD,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;wBAC7C,WAAW,GAAG,SAAS,CAAC;qBACzB;oBACD,QAAQ,GAAG,EAAE,CAAC;oBACd,CAAC,GAAG,UAAU,CAAC;iBAChB;aACF;iBAAM;gBACL,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;aACxB;SACF;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;CACF;AA7GD,4CA6GC","file":"OrderedObjParser.js","sourcesContent":["// 参考fast-xml-parser\n// https://github.com/NaturalIntelligence/fast-xml-parser\n/**\n * MIT License\n\nCopyright (c) 2017 Amit Kumar Gupta\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n */\nimport type { X2jOptions } from './type';\nimport { getAllMatches } from './utils';\n\nclass XmlNode {\n declare tagname: string;\n declare child: any[];\n\n constructor(tagname: string) {\n this.tagname = tagname;\n this.child = []; //nested tags, text, cdata, comments in order\n this[':@'] = {}; //attributes map\n }\n add(key: string, val: string) {\n // this.child.push( {name : key, val: val, isCdata: isCdata });\n if (key === '__proto__') {\n key = '#__proto__';\n }\n this.child.push({ [key]: val });\n }\n addChild(node: XmlNode) {\n if (node.tagname === '__proto__') {\n node.tagname = '#__proto__';\n }\n if (node[':@'] && Object.keys(node[':@']).length > 0) {\n this.child.push({ [node.tagname]: node.child, [':@']: node[':@'] });\n } else {\n this.child.push({ [node.tagname]: node.child });\n }\n }\n}\n\nfunction findClosingIndex(xmlData: string, str: string, i: number, errMsg: string) {\n const closingIndex = xmlData.indexOf(str, i);\n if (closingIndex === -1) {\n throw new Error(errMsg);\n } else {\n return closingIndex + str.length - 1;\n }\n}\n\n/**\n * Returns the tag Expression and where it is ending handling single-double quotes situation\n * @param {string} xmlData\n * @param {number} i starting index\n * @returns\n */\nfunction tagExpWithClosingIndex(xmlData: string, i: number, closingChar = '>') {\n let attrBoundary;\n let tagExp = '';\n for (let index = i; index < xmlData.length; index++) {\n let ch = xmlData[index];\n if (attrBoundary) {\n if (ch === attrBoundary) {\n attrBoundary = '';\n } //reset\n } else if (ch === '\"' || ch === \"'\") {\n attrBoundary = ch;\n } else if (ch === closingChar[0]) {\n if (closingChar[1]) {\n if (xmlData[index + 1] === closingChar[1]) {\n return {\n data: tagExp,\n index: index\n };\n }\n } else {\n return {\n data: tagExp,\n index: index\n };\n }\n } else if (ch === '\\t') {\n ch = ' ';\n }\n tagExp += ch;\n }\n}\n\nfunction readTagExp(xmlData: string, i: number, removeNSPrefix: boolean, closingChar = '>') {\n const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);\n if (!result) {\n return;\n }\n let tagExp = result.data;\n const closeIndex = result.index;\n const separatorIndex = tagExp.search(/\\s/);\n let tagName = tagExp;\n let attrExpPresent = true;\n if (separatorIndex !== -1) {\n //separate tag name and attributes expression\n tagName = tagExp.substr(0, separatorIndex).replace(/\\s\\s*$/, '');\n tagExp = tagExp.substr(separatorIndex + 1);\n }\n\n const rawTagName = tagName;\n if (removeNSPrefix) {\n const colonIndex = tagName.indexOf(':');\n if (colonIndex !== -1) {\n tagName = tagName.substr(colonIndex + 1);\n attrExpPresent = tagName !== result.data.substr(colonIndex + 1);\n }\n }\n\n return {\n tagName: tagName,\n tagExp: tagExp,\n closeIndex: closeIndex,\n attrExpPresent: attrExpPresent,\n rawTagName: rawTagName\n };\n}\n\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');\n\nexport class OrderedObjParser {\n declare options: Partial<X2jOptions>;\n declare currentNode: XmlNode | null;\n declare tagsNodeStack: XmlNode[];\n declare docTypeEntities: Record<string, any>;\n\n constructor(options: Partial<X2jOptions>) {\n this.currentNode = null;\n this.options = options;\n this.tagsNodeStack = [];\n this.docTypeEntities = {};\n }\n\n protected addChild(currentNode: XmlNode, childNode: XmlNode, jPath: string) {\n const result = childNode.tagname;\n if (typeof result === 'string') {\n childNode.tagname = result;\n currentNode.addChild(childNode);\n } else {\n currentNode.addChild(childNode);\n }\n }\n\n protected buildAttributesMap(attrStr: string, jPath: string, tagName: string) {\n const attrs = {};\n if (!attrStr) {\n return;\n }\n const matches = getAllMatches(attrStr, attrsRegx);\n const len = matches.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n const attrName = matches[i][1];\n const oldVal = matches[i][4];\n const aName = attrName;\n if (attrName) {\n if (oldVal !== undefined) {\n attrs[aName] = isNaN(oldVal) ? oldVal : Number(oldVal);\n } else {\n attrs[aName] = true;\n }\n }\n }\n return attrs;\n }\n\n parseXml(xmlData: string) {\n // 判断xml的合法性\n xmlData = xmlData.replace(/\\r\\n?/g, '\\n');\n const xmlObj = new XmlNode('!xml');\n let currentNode = xmlObj;\n let textData = '';\n let jPath = '';\n for (let i = 0; i < xmlData.length; i++) {\n const ch = xmlData[i];\n if (ch === '<') {\n if (xmlData[i + 1] === '/') {\n const closeIndex = findClosingIndex(xmlData, '>', i, 'Closing Tag is not closed.');\n const propIndex = jPath.lastIndexOf('.');\n jPath = jPath.substring(0, propIndex);\n currentNode = this.tagsNodeStack.pop();\n textData = '';\n i = closeIndex;\n } else if (xmlData[i + 1] === '?') {\n const tagData = readTagExp(xmlData, i, false, '?>');\n i = tagData.closeIndex + 1;\n } else if (xmlData.substr(i + 1, 3) === '!--') {\n const endIndex = findClosingIndex(xmlData, '-->', i + 4, 'Comment is not closed.');\n i = endIndex;\n } else {\n const result = readTagExp(xmlData, i, false);\n let tagName = result.tagName;\n let tagExp = result.tagExp;\n const attrExpPresent = result.attrExpPresent;\n const closeIndex = result.closeIndex;\n if (tagName !== xmlObj.tagname) {\n jPath += jPath ? '.' + tagName : tagName;\n }\n if (tagExp.length > 0 && tagExp.lastIndexOf('/') === tagExp.length - 1) {\n if (tagName[tagName.length - 1] === '/') {\n tagName = tagName.substr(0, tagName.length - 1);\n jPath = jPath.substr(0, jPath.length - 1);\n tagExp = tagName;\n } else {\n tagExp = tagExp.substr(0, tagExp.length - 1);\n }\n const childNode = new XmlNode(tagName);\n if (tagName !== tagExp && attrExpPresent) {\n childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n this.addChild(currentNode, childNode, jPath);\n jPath = jPath.substr(0, jPath.lastIndexOf('.'));\n } else {\n const childNode = new XmlNode(tagName);\n this.tagsNodeStack.push(currentNode);\n if (tagName !== tagExp && attrExpPresent) {\n childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n this.addChild(currentNode, childNode, jPath);\n currentNode = childNode;\n }\n textData = '';\n i = closeIndex;\n }\n } else {\n textData += xmlData[i];\n }\n }\n return xmlObj.child;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/common/xml/OrderedObjParser.ts"],"names":[],"mappings":";;;AA2BA,mCAAwC;AAExC,MAAM,OAAO;IAIX,YAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,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wBACD,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;wBACvC,IAAI,OAAO,KAAK,MAAM,IAAI,cAAc,EAAE;4BACxC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;yBACnE;wBACD,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;wBAC7C,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;qBACjD;yBAAM;wBACL,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;wBACvC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;wBACrC,IAAI,OAAO,KAAK,MAAM,IAAI,cAAc,EAAE;4BACxC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;yBACnE;wBACD,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;wBAC7C,WAAW,GAAG,SAAS,CAAC;qBACzB;oBACD,QAAQ,GAAG,EAAE,CAAC;oBACd,CAAC,GAAG,UAAU,CAAC;iBAChB;aACF;iBAAM;gBACL,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;aACxB;SACF;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;CACF;AAjHD,4CAiHC","file":"OrderedObjParser.js","sourcesContent":["// 参考fast-xml-parser\n// https://github.com/NaturalIntelligence/fast-xml-parser\n/**\n * MIT License\n\nCopyright (c) 2017 Amit Kumar Gupta\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n */\nimport type { X2jOptions } from './type';\nimport { getAllMatches } from './utils';\n\nclass XmlNode {\n declare tagname: string;\n declare child: any[];\n\n constructor(tagname: string) {\n this.tagname = tagname;\n this.child = []; //nested tags, text, cdata, comments in order\n this[':@'] = {}; //attributes map\n }\n add(key: string, val: string) {\n // this.child.push( {name : key, val: val, isCdata: isCdata });\n if (key === '__proto__') {\n key = '#__proto__';\n }\n this.child.push({ [key]: val });\n }\n addChild(node: XmlNode) {\n if (node.tagname === '__proto__') {\n node.tagname = '#__proto__';\n }\n if (node[':@'] && Object.keys(node[':@']).length > 0) {\n this.child.push({ [node.tagname]: node.child, [':@']: node[':@'] });\n } else {\n this.child.push({ [node.tagname]: node.child });\n }\n }\n}\n\nfunction findClosingIndex(xmlData: string, str: string, i: number, errMsg: string) {\n const closingIndex = xmlData.indexOf(str, i);\n if (closingIndex === -1) {\n throw new Error(errMsg);\n } else {\n return closingIndex + str.length - 1;\n }\n}\n\n/**\n * Returns the tag Expression and where it is ending handling single-double quotes situation\n * @param {string} xmlData\n * @param {number} i starting index\n * @returns\n */\nfunction tagExpWithClosingIndex(xmlData: string, i: number, closingChar = '>') {\n let attrBoundary;\n let tagExp = '';\n for (let index = i; index < xmlData.length; index++) {\n let ch = xmlData[index];\n if (attrBoundary) {\n if (ch === attrBoundary) {\n attrBoundary = '';\n } //reset\n } else if (ch === '\"' || ch === \"'\") {\n attrBoundary = ch;\n } else if (ch === closingChar[0]) {\n if (closingChar[1]) {\n if (xmlData[index + 1] === closingChar[1]) {\n return {\n data: tagExp,\n index: index\n };\n }\n } else {\n return {\n data: tagExp,\n index: index\n };\n }\n } else if (ch === '\\t') {\n ch = ' ';\n }\n tagExp += ch;\n }\n}\n\nfunction readTagExp(xmlData: string, i: number, removeNSPrefix: boolean, closingChar = '>') {\n const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);\n if (!result) {\n return;\n }\n let tagExp = result.data;\n const closeIndex = result.index;\n const separatorIndex = tagExp.search(/\\s/);\n let tagName = tagExp;\n let attrExpPresent = true;\n if (separatorIndex !== -1) {\n //separate tag name and attributes expression\n tagName = tagExp.substr(0, separatorIndex).replace(/\\s\\s*$/, '');\n tagExp = tagExp.substr(separatorIndex + 1);\n }\n\n const rawTagName = tagName;\n if (removeNSPrefix) {\n const colonIndex = tagName.indexOf(':');\n if (colonIndex !== -1) {\n tagName = tagName.substr(colonIndex + 1);\n attrExpPresent = tagName !== result.data.substr(colonIndex + 1);\n }\n }\n\n return {\n tagName: tagName,\n tagExp: tagExp,\n closeIndex: closeIndex,\n attrExpPresent: attrExpPresent,\n rawTagName: rawTagName\n };\n}\n\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');\n\nexport class OrderedObjParser {\n declare options: Partial<X2jOptions>;\n declare currentNode: XmlNode | null;\n declare tagsNodeStack: XmlNode[];\n declare docTypeEntities: Record<string, any>;\n\n constructor(options: Partial<X2jOptions>) {\n this.currentNode = null;\n this.options = options;\n this.tagsNodeStack = [];\n this.docTypeEntities = {};\n }\n\n protected addChild(currentNode: XmlNode, childNode: XmlNode, jPath: string) {\n const result = childNode.tagname;\n if (typeof result === 'string') {\n childNode.tagname = result;\n currentNode.addChild(childNode);\n } else {\n currentNode.addChild(childNode);\n }\n }\n\n protected buildAttributesMap(attrStr: string, jPath: string, tagName: string) {\n const attrs = {};\n if (!attrStr) {\n return;\n }\n const matches = getAllMatches(attrStr, attrsRegx);\n const len = matches.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n const attrName = matches[i][1];\n const oldVal = matches[i][4];\n const aName = attrName;\n if (attrName) {\n if (oldVal !== undefined) {\n attrs[aName] = isNaN(oldVal) ? oldVal : Number(oldVal);\n } else {\n attrs[aName] = true;\n }\n }\n }\n return attrs;\n }\n\n parseXml(xmlData: string) {\n // 判断xml的合法性\n xmlData = xmlData.replace(/\\r\\n?/g, '\\n');\n const xmlObj = new XmlNode('!xml');\n let currentNode = xmlObj;\n let textData = '';\n let jPath = '';\n for (let i = 0; i < xmlData.length; i++) {\n const ch = xmlData[i];\n if (ch === '<') {\n if (xmlData[i + 1] === '/') {\n const closeIndex = findClosingIndex(xmlData, '>', i, 'Closing Tag is not closed.');\n const propIndex = jPath.lastIndexOf('.');\n jPath = jPath.substring(0, propIndex);\n currentNode = this.tagsNodeStack.pop();\n if (currentNode && currentNode.child && textData) {\n currentNode.child[currentNode.child.length - 1][':@'] &&\n (currentNode.child[currentNode.child.length - 1][':@'].text = textData);\n }\n textData = '';\n i = closeIndex;\n } else if (xmlData[i + 1] === '?') {\n const tagData = readTagExp(xmlData, i, false, '?>');\n i = tagData.closeIndex + 1;\n } else if (xmlData.substr(i + 1, 3) === '!--') {\n const endIndex = findClosingIndex(xmlData, '-->', i + 4, 'Comment is not closed.');\n i = endIndex;\n } else {\n const result = readTagExp(xmlData, i, false);\n let tagName = result.tagName;\n let tagExp = result.tagExp;\n const attrExpPresent = result.attrExpPresent;\n const closeIndex = result.closeIndex;\n if (tagName !== xmlObj.tagname) {\n jPath += jPath ? '.' + tagName : tagName;\n }\n if (tagExp.length > 0 && tagExp.lastIndexOf('/') === tagExp.length - 1) {\n if (tagName[tagName.length - 1] === '/') {\n tagName = tagName.substr(0, tagName.length - 1);\n jPath = jPath.substr(0, jPath.length - 1);\n tagExp = tagName;\n } else {\n tagExp = tagExp.substr(0, tagExp.length - 1);\n }\n const childNode = new XmlNode(tagName);\n if (tagName !== tagExp && attrExpPresent) {\n childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n this.addChild(currentNode, childNode, jPath);\n jPath = jPath.substr(0, jPath.lastIndexOf('.'));\n } else {\n const childNode = new XmlNode(tagName);\n this.tagsNodeStack.push(currentNode);\n if (tagName !== tagExp && attrExpPresent) {\n childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);\n }\n this.addChild(currentNode, childNode, jPath);\n currentNode = childNode;\n }\n textData = '';\n i = closeIndex;\n }\n } else {\n textData += xmlData[i];\n }\n }\n return xmlObj.child;\n }\n}\n"]}
@@ -64,5 +64,4 @@ class OrthoCamera {
64
64
  }
65
65
  }
66
66
 
67
- exports.OrthoCamera = OrthoCamera;
68
- //# sourceMappingURL=camera.js.map
67
+ exports.OrthoCamera = OrthoCamera;
@@ -1,3 +1 @@
1
-
2
-
3
1
  //# sourceMappingURL=global-module.js.map
@@ -173,4 +173,4 @@ DefaultGlobal = __decorate([ (0, inversify_lite_1.injectable)(), __param(0, (0,
173
173
  inversify_lite_1.inject)(contribution_provider_1.ContributionProvider)), __param(0, (0,
174
174
  inversify_lite_1.named)(constants_1.EnvContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultGlobal),
175
175
  exports.DefaultGlobal = DefaultGlobal;
176
- //# sourceMappingURL=global.js.map
176
+ //# sourceMappingURL=global.js.map
@@ -136,4 +136,4 @@ let DefaultTransformUtil = class {
136
136
 
137
137
  DefaultTransformUtil = __decorate([ (0, inversify_lite_1.injectable)(), __metadata("design:paramtypes", []) ], DefaultTransformUtil),
138
138
  exports.DefaultTransformUtil = DefaultTransformUtil;
139
- //# sourceMappingURL=graphic-utils.js.map
139
+ //# sourceMappingURL=graphic-utils.js.map
package/cjs/core/index.js CHANGED
@@ -22,4 +22,4 @@ __exportStar(require("./layer"), exports), __exportStar(require("./stage"), expo
22
22
  __exportStar(require("./graphic-utils"), exports), __exportStar(require("./contributions"), exports),
23
23
  __exportStar(require("./layer-service"), exports), __exportStar(require("./constants"), exports),
24
24
  __exportStar(require("../interface/core"), exports);
25
- //# sourceMappingURL=index.js.map
25
+ //# sourceMappingURL=index.js.map
@@ -77,4 +77,4 @@ let DefaultLayerService = class {
77
77
  DefaultLayerService = __decorate([ (0, inversify_lite_1.injectable)(), __param(0, (0,
78
78
  inversify_lite_1.inject)(constants_1.VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultLayerService),
79
79
  exports.DefaultLayerService = DefaultLayerService;
80
- //# sourceMappingURL=layer-service.js.map
80
+ //# sourceMappingURL=layer-service.js.map
package/cjs/core/layer.js CHANGED
@@ -134,4 +134,4 @@ class Layer extends group_1.Group {
134
134
  }
135
135
 
136
136
  exports.Layer = Layer;
137
- //# sourceMappingURL=layer.js.map
137
+ //# sourceMappingURL=layer.js.map
package/cjs/core/light.js CHANGED
@@ -23,4 +23,4 @@ class DirectionalLight {
23
23
  }
24
24
 
25
25
  exports.DirectionalLight = DirectionalLight;
26
- //# sourceMappingURL=light.js.map
26
+ //# sourceMappingURL=light.js.map
package/cjs/core/stage.js CHANGED
@@ -438,4 +438,4 @@ class Stage extends graphic_1.Group {
438
438
  }
439
439
 
440
440
  exports.Stage = Stage;
441
- //# sourceMappingURL=stage.js.map
441
+ //# sourceMappingURL=stage.js.map
@@ -123,4 +123,4 @@ __decorate([ (0, inversify_lite_1.postConstruct)(), __metadata("design:type", Fu
123
123
  DefaultWindow = __decorate([ (0, inversify_lite_1.injectable)(), __param(0, (0,
124
124
  inversify_lite_1.inject)(constants_1.VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultWindow),
125
125
  exports.DefaultWindow = DefaultWindow;
126
- //# sourceMappingURL=window.js.map
126
+ //# sourceMappingURL=window.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.WILDCARD = void 0, exports.WILDCARD = "*";
6
- //# sourceMappingURL=constant.js.map
6
+ //# sourceMappingURL=constant.js.map
@@ -274,4 +274,4 @@ class EventManager {
274
274
  }
275
275
 
276
276
  exports.EventManager = EventManager;
277
- //# sourceMappingURL=event-manager.js.map
277
+ //# sourceMappingURL=event-manager.js.map
@@ -198,4 +198,4 @@ class EventSystem {
198
198
  }
199
199
 
200
200
  exports.EventSystem = EventSystem;
201
- //# sourceMappingURL=event-system.js.map
201
+ //# sourceMappingURL=event-system.js.map
@@ -19,4 +19,4 @@ exports.EventTarget = {
19
19
  return this.dispatchEvent(new federated_event_1.CustomEvent(eventName, object));
20
20
  }
21
21
  };
22
- //# sourceMappingURL=event-target.js.map
22
+ //# sourceMappingURL=event-target.js.map
@@ -20,5 +20,4 @@ Object.defineProperty(exports, "__esModule", {
20
20
  }), __exportStar(require("./federated-event"), exports), __exportStar(require("./event-manager"), exports),
21
21
  __exportStar(require("./event-target"), exports), __exportStar(require("./event-system"), exports),
22
22
  __exportStar(require("../interface/event"), exports), __exportStar(require("./util"), exports),
23
- __exportStar(require("./constant"), exports);
24
- //# sourceMappingURL=index.js.map
23
+ __exportStar(require("./constant"), exports);
package/cjs/event/util.js CHANGED
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.clock = void 0, exports.clock = "object" == typeof performance && performance.now ? performance : Date;
6
- //# sourceMappingURL=util.js.map
6
+ //# sourceMappingURL=util.js.map
@@ -131,4 +131,4 @@ class Arc extends graphic_1.Graphic {
131
131
  exports.Arc = Arc, Arc.NOWORK_ANIMATE_ATTR = Object.assign({
132
132
  cap: 1
133
133
  }, graphic_1.NOWORK_ANIMATE_ATTR);
134
- //# sourceMappingURL=arc.js.map
134
+ //# sourceMappingURL=arc.js.map
@@ -27,4 +27,4 @@ class Arc3d extends arc_1.Arc {
27
27
  exports.Arc3d = Arc3d, Arc3d.NOWORK_ANIMATE_ATTR = Object.assign({
28
28
  cap: 1
29
29
  }, graphic_1.NOWORK_ANIMATE_ATTR);
30
- //# sourceMappingURL=arc3d.js.map
30
+ //# sourceMappingURL=arc3d.js.map
@@ -75,4 +75,4 @@ exports.Area = Area, Area.NOWORK_ANIMATE_ATTR = Object.assign({
75
75
  segments: 1,
76
76
  curveType: 1
77
77
  }, graphic_1.NOWORK_ANIMATE_ATTR);
78
- //# sourceMappingURL=area.js.map
78
+ //# sourceMappingURL=area.js.map
@@ -21,4 +21,4 @@ function getRichTextBounds(params) {
21
21
  }
22
22
 
23
23
  exports.getRichTextBounds = getRichTextBounds;
24
- //# sourceMappingURL=bounds.js.map
24
+ //# sourceMappingURL=bounds.js.map
@@ -54,4 +54,4 @@ class Circle extends graphic_1.Graphic {
54
54
  }
55
55
 
56
56
  exports.Circle = Circle, Circle.NOWORK_ANIMATE_ATTR = graphic_1.NOWORK_ANIMATE_ATTR;
57
- //# sourceMappingURL=circle.js.map
57
+ //# sourceMappingURL=circle.js.map
@@ -233,4 +233,4 @@ exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAtt
233
233
  backgroundRadius: 4,
234
234
  opacity: 1
235
235
  });
236
- //# sourceMappingURL=config.js.map
236
+ //# sourceMappingURL=config.js.map
@@ -132,7 +132,7 @@ function parseRTTextXML(str) {
132
132
  }
133
133
 
134
134
  function parseCommonXML(str, output) {
135
- const attr = str["@_attribute"];
135
+ const attr = str.attribute;
136
136
  if (attr) {
137
137
  attr.split(";").forEach((attrItem => {
138
138
  if (!attrItem) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/tools.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA6C;AAC7C,iDAA6C;AAE7C,6CAA6D;AAC7D,uCAA0C;AAG1C,SAAgB,gBAAgB,CAAC,KAAa,EAAE,OA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,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAW;IAClC,MAAM,MAAM,GAA4B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3E,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAe,CAAC;IACrC,IAAI,KAAK,EAAE;QACT,MAAM,CAAC,KAAK,GAAI,KAAa,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KACtG;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","file":"tools.js","sourcesContent":["import { application } from '../application';\nimport { isXML } from '../common/xml/parser';\nimport type { IGraphic, IGroup, ILayer, IRichTextCharacter, IRichTextImageCharacter, IStage } from '../interface';\nimport { isArray, type IAABBBounds } from '@visactor/vutils';\nimport { XMLParser } from '../common/xml';\n\n// 不触发外部的render\nexport function incrementalAddTo(group: IGroup, graphic: IGraphic) {\n group.incrementalAppendChild(graphic);\n // if (group.layer && group.layer.subLayers) {\n // // const subLayer = group.layer.subLayers.get(group._uid);\n // }\n}\n\nexport async function waitForAllSubLayers(stage: IStage) {\n const promiseList: Promise<any>[] = [];\n const layers = stage.getChildren() as ILayer[];\n await new Promise(resolve => {\n application.global.getRequestAnimationFrame()(() => {\n resolve(null);\n });\n });\n layers.forEach(l => {\n if (l.subLayers.size) {\n l.subLayers.forEach(sl => {\n if (sl.drawContribution && sl.drawContribution.hooks && sl.drawContribution.rendering) {\n promiseList.push(\n new Promise(resolve => {\n sl.drawContribution!.hooks!.completeDraw.tap('outWait', () => {\n sl.drawContribution!.hooks!.completeDraw.taps = sl.drawContribution!.hooks!.completeDraw.taps.filter(\n i => {\n return i.name !== 'outWait';\n }\n );\n resolve(null);\n });\n })\n );\n }\n });\n }\n });\n await Promise.all(promiseList);\n}\n\nexport function boundStroke(bounds: IAABBBounds, halfW: number, miter: boolean, pad = 0) {\n bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0)));\n return bounds;\n}\n\nfunction miterAdjustment(miter: boolean, strokeWidth: number) {\n return miter ? strokeWidth : 0;\n}\n\n// function attachShadow(graphic: Graphic) {\n// graphic.shadowRoot = createShadowRoot(graphic);\n// graphic.addUpdateBoundTag();\n// return graphic.shadowRoot;\n// }\n\n// function detachShadow(graphic: Graphic) {\n// if (graphic.shadowRoot) {\n// graphic.addUpdateBoundTag();\n// graphic.shadowRoot = null;\n// }\n// }\n\nlet NUMBER_TYPE: number = 0;\nexport function genNumberType() {\n return NUMBER_TYPE++;\n}\n\nexport enum TextDirection {\n HORIZONTAL = 0,\n VERTICAL = 1\n}\nexport function verticalLayout(text: string) {\n const nextCharacter: { text: string; direction: TextDirection }[] = [];\n let flag = 0; // 0: 竖排,1: 旋转\n let currStr = '';\n for (let i = 0; i < text.length; i++) {\n if (rotateText(text[i])) {\n if (flag) {\n currStr += text[i];\n } else {\n flag = 1;\n currStr = text[i];\n }\n } else {\n if (flag) {\n nextCharacter.push({\n text: currStr,\n direction: TextDirection.VERTICAL\n });\n currStr = '';\n flag = 0;\n }\n nextCharacter.push({\n text: text[i],\n direction: TextDirection.HORIZONTAL\n });\n }\n }\n\n if (currStr) {\n nextCharacter.push({\n text: currStr,\n direction: TextDirection.VERTICAL\n });\n }\n return nextCharacter;\n}\n\n// ——, ……, (, )\nconst rotateCharList = ['…', '(', ')', '—', '【', '】', '「', '」', '《', '》'];\nconst rotateCharMap = new Map();\nrotateCharList.forEach(c => rotateCharMap.set(c, true));\nconst noRotateCharList = [''];\nconst noRotateCharMap = new Map();\nnoRotateCharList.forEach(c => noRotateCharMap.set(c, true));\n\nfunction rotateText(c: string) {\n if (rotateCharMap.has(c)) {\n return true;\n }\n if (noRotateCharMap.has(c)) {\n return false;\n }\n const cp = c.codePointAt(0);\n let rotate = false;\n // 默认ascii码就旋转\n if (cp < 256) {\n rotate = true;\n }\n return rotate;\n}\n\nexport function xul(str: string | string[]): IRichTextCharacter[] {\n const xmlStr = isArray(str) ? str[0] : str;\n const config: IRichTextCharacter[] = [];\n if (!xmlStr) {\n return config;\n }\n const valid = isXML(xmlStr);\n if (valid === true) {\n const parser = new XMLParser();\n const data = parser.parse(xmlStr);\n data.tc &&\n Object.keys(data.tc).forEach(k => {\n if (k === 'text') {\n config.push(parseRTTextXML(data.tc[k]));\n } else {\n config.push(parseRTImageXML(data.tc[k]));\n }\n });\n }\n return config;\n}\n\nfunction parseRTTextXML(str: string): IRichTextCharacter {\n const output: IRichTextCharacter = { text: '' };\n parseCommonXML(str, output);\n const inlineText = str['#text'];\n if (inlineText) {\n output.text = inlineText;\n }\n\n return output;\n}\n\nfunction parseCommonXML(str: string, output: IRichTextCharacter) {\n const attr = str['@_attribute'];\n if (attr) {\n const attrList = attr.split(';');\n attrList.forEach((attrItem: string) => {\n if (!attrItem) {\n return;\n }\n const kv = attrItem.split(':');\n\n if (kv.length === 2) {\n const val = parseFloat(kv[1]);\n output[kv[0].trim()] = isFinite(val) ? val : kv[1].trim();\n } else {\n let val = '';\n for (let i = 1; i < kv.length; i++) {\n if (i > 1) {\n val += ':';\n }\n val += kv[i].trim();\n }\n output[kv[0].trim()] = val;\n }\n });\n }\n}\n\nfunction parseRTImageXML(str: string): IRichTextCharacter {\n const output: IRichTextImageCharacter = { image: '', width: 0, height: 0 };\n parseCommonXML(str, output);\n const image = output.image as string;\n if (image) {\n output.image = (image as any).replaceAll('&quot', '\"').replaceAll('&lt', '<').replaceAll('&gt', '>');\n }\n return output;\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/tools.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA6C;AAC7C,iDAA6C;AAE7C,6CAA6D;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AAC;iBACrB;gBACD,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAW;IAClC,MAAM,MAAM,GAA4B,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3E,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAe,CAAC;IACrC,IAAI,KAAK,EAAE;QACT,MAAM,CAAC,KAAK,GAAI,KAAa,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KACtG;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","file":"tools.js","sourcesContent":["import { application } from '../application';\nimport { isXML } from '../common/xml/parser';\nimport type { IGraphic, IGroup, ILayer, IRichTextCharacter, IRichTextImageCharacter, IStage } from '../interface';\nimport { isArray, type IAABBBounds } from '@visactor/vutils';\nimport { XMLParser } from '../common/xml';\n\n// 不触发外部的render\nexport function incrementalAddTo(group: IGroup, graphic: IGraphic) {\n group.incrementalAppendChild(graphic);\n // if (group.layer && group.layer.subLayers) {\n // // const subLayer = group.layer.subLayers.get(group._uid);\n // }\n}\n\nexport async function waitForAllSubLayers(stage: IStage) {\n const promiseList: Promise<any>[] = [];\n const layers = stage.getChildren() as ILayer[];\n await new Promise(resolve => {\n application.global.getRequestAnimationFrame()(() => {\n resolve(null);\n });\n });\n layers.forEach(l => {\n if (l.subLayers.size) {\n l.subLayers.forEach(sl => {\n if (sl.drawContribution && sl.drawContribution.hooks && sl.drawContribution.rendering) {\n promiseList.push(\n new Promise(resolve => {\n sl.drawContribution!.hooks!.completeDraw.tap('outWait', () => {\n sl.drawContribution!.hooks!.completeDraw.taps = sl.drawContribution!.hooks!.completeDraw.taps.filter(\n i => {\n return i.name !== 'outWait';\n }\n );\n resolve(null);\n });\n })\n );\n }\n });\n }\n });\n await Promise.all(promiseList);\n}\n\nexport function boundStroke(bounds: IAABBBounds, halfW: number, miter: boolean, pad = 0) {\n bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0)));\n return bounds;\n}\n\nfunction miterAdjustment(miter: boolean, strokeWidth: number) {\n return miter ? strokeWidth : 0;\n}\n\n// function attachShadow(graphic: Graphic) {\n// graphic.shadowRoot = createShadowRoot(graphic);\n// graphic.addUpdateBoundTag();\n// return graphic.shadowRoot;\n// }\n\n// function detachShadow(graphic: Graphic) {\n// if (graphic.shadowRoot) {\n// graphic.addUpdateBoundTag();\n// graphic.shadowRoot = null;\n// }\n// }\n\nlet NUMBER_TYPE: number = 0;\nexport function genNumberType() {\n return NUMBER_TYPE++;\n}\n\nexport enum TextDirection {\n HORIZONTAL = 0,\n VERTICAL = 1\n}\nexport function verticalLayout(text: string) {\n const nextCharacter: { text: string; direction: TextDirection }[] = [];\n let flag = 0; // 0: 竖排,1: 旋转\n let currStr = '';\n for (let i = 0; i < text.length; i++) {\n if (rotateText(text[i])) {\n if (flag) {\n currStr += text[i];\n } else {\n flag = 1;\n currStr = text[i];\n }\n } else {\n if (flag) {\n nextCharacter.push({\n text: currStr,\n direction: TextDirection.VERTICAL\n });\n currStr = '';\n flag = 0;\n }\n nextCharacter.push({\n text: text[i],\n direction: TextDirection.HORIZONTAL\n });\n }\n }\n\n if (currStr) {\n nextCharacter.push({\n text: currStr,\n direction: TextDirection.VERTICAL\n });\n }\n return nextCharacter;\n}\n\n// ——, ……, (, )\nconst rotateCharList = ['…', '(', ')', '—', '【', '】', '「', '」', '《', '》'];\nconst rotateCharMap = new Map();\nrotateCharList.forEach(c => rotateCharMap.set(c, true));\nconst noRotateCharList = [''];\nconst noRotateCharMap = new Map();\nnoRotateCharList.forEach(c => noRotateCharMap.set(c, true));\n\nfunction rotateText(c: string) {\n if (rotateCharMap.has(c)) {\n return true;\n }\n if (noRotateCharMap.has(c)) {\n return false;\n }\n const cp = c.codePointAt(0);\n let rotate = false;\n // 默认ascii码就旋转\n if (cp < 256) {\n rotate = true;\n }\n return rotate;\n}\n\nexport function xul(str: string | string[]): IRichTextCharacter[] {\n const xmlStr = isArray(str) ? str[0] : str;\n const config: IRichTextCharacter[] = [];\n if (!xmlStr) {\n return config;\n }\n const valid = isXML(xmlStr);\n if (valid === true) {\n const parser = new XMLParser();\n const data = parser.parse(xmlStr);\n data.tc &&\n Object.keys(data.tc).forEach(k => {\n if (k === 'text') {\n config.push(parseRTTextXML(data.tc[k]));\n } else {\n config.push(parseRTImageXML(data.tc[k]));\n }\n });\n }\n return config;\n}\n\nfunction parseRTTextXML(str: string): IRichTextCharacter {\n const output: IRichTextCharacter = { text: '' };\n parseCommonXML(str, output);\n const inlineText = str['#text'];\n if (inlineText) {\n output.text = inlineText;\n }\n\n return output;\n}\n\nfunction parseCommonXML(str: string, output: IRichTextCharacter) {\n const attr = (str as any).attribute;\n if (attr) {\n const attrList = attr.split(';');\n attrList.forEach((attrItem: string) => {\n if (!attrItem) {\n return;\n }\n const kv = attrItem.split(':');\n\n if (kv.length === 2) {\n const val = parseFloat(kv[1]);\n output[kv[0].trim()] = isFinite(val) ? val : kv[1].trim();\n } else {\n let val = '';\n for (let i = 1; i < kv.length; i++) {\n if (i > 1) {\n val += ':';\n }\n val += kv[i].trim();\n }\n output[kv[0].trim()] = val;\n }\n });\n }\n}\n\nfunction parseRTImageXML(str: string): IRichTextCharacter {\n const output: IRichTextImageCharacter = { image: '', width: 0, height: 0 };\n parseCommonXML(str, output);\n const image = output.image as string;\n if (image) {\n output.image = (image as any).replaceAll('&quot', '\"').replaceAll('&lt', '<').replaceAll('&gt', '>');\n }\n return output;\n}\n"]}
@@ -53,7 +53,7 @@ class HtmlAttributePlugin {
53
53
  let nativeDom, nativeContainer;
54
54
  graphic.bindDom.forEach((({wrapGroup: wrapGroup}) => {
55
55
  application_1.application.global.removeDom(wrapGroup);
56
- })), nativeDom = "string" == typeof dom ? (new DOMParser).parseFromString(dom, "text/xml").firstChild : dom;
56
+ })), nativeDom = "string" == typeof dom ? (new DOMParser).parseFromString(dom, "text/html").firstChild : dom;
57
57
  const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
58
58
  nativeContainer = _container ? "string" == typeof _container ? application_1.application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
59
59
  const wrapGroup = application_1.application.global.createDom({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/builtin-plugin/html-attribute-plugin.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,mDAAgD;AAChD,2CAAiD;AAEjD,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAA0B,qBAAqB,CAAC;QACpD,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IA0ItC,CAAC;IAxIC,QAAQ,CAAC,OAAuB;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;YACpD,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;gBAClD,OAAO;aACR;YAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QACH,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE;YAC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C,CAAC;SACtF;QAED,SAAS,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;QAEvC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC7B,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;YACtC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC7C;QACD,IAAI,IAAI,GAAW,CAAC,CAAC;QACrB,IAAI,GAAG,GAAW,CAAC,CAAC;QACpB,IAAI,UAAU,KAAK,UAAU,EAAE;YAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;YACnC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;YAChB,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC;SAChB;aAAM;YACL,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;YAC7B,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC;YACZ,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;SACZ;QAGD,MAAM,WAAW,GAAG,yBAAW,CAAC,MAAM,CAAC,iBAAiB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACjF,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QACxD,MAAM,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC;QAEvD,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,IAAI,CAAC;QACtC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,SAAS,IAAI,CAAC;IACzC,CAAC;CACF;AA/ID,kDA+IC","file":"html-attribute-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport type { IGraphic, IPlugin, IPluginService, IRenderService, IDrawContext, IGroup } from '../../interface';\nimport { application } from '../../application';\nimport { DefaultAttribute } from '../../graphic';\n\nexport class HtmlAttributePlugin implements IPlugin {\n name: 'HtmlAttributePlugin' = 'HtmlAttributePlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n\n this.drawHTML(context.stage.renderService);\n });\n application.graphicService.hooks.onRelease.tap(this.key, graphic => {\n this.removeDom(graphic);\n });\n }\n deactivate(context: IPluginService): void {\n context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n\n protected drawHTML(renderService: IRenderService) {\n if (application.global.env === 'browser') {\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n this.renderGroupHTML(group as IGroup);\n });\n }\n }\n\n renderGroupHTML(group: IGroup) {\n this.renderGraphicHTML(group);\n group.forEachChildren((g: IGraphic) => {\n if (g.isContainer) {\n this.renderGroupHTML(g as IGroup);\n } else {\n this.renderGraphicHTML(g);\n }\n });\n }\n\n removeDom(graphic: IGraphic) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n }\n\n renderGraphicHTML(graphic: IGraphic) {\n const { html } = graphic.attribute;\n if (!html) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n return;\n }\n const stage = graphic.stage;\n if (!stage) {\n return;\n }\n const { dom, container, width, height, style, anchorType = 'boundsLeftTop' } = html;\n if (!graphic.bindDom) {\n graphic.bindDom = new Map();\n }\n const lastDom = graphic.bindDom.get(dom);\n // 如果存在了(dom存在,且container没有变化),就跳过\n if (lastDom && !(container && container !== lastDom.container)) {\n return;\n }\n // 清除上一次的dom\n graphic.bindDom.forEach(({ wrapGroup }) => {\n application.global.removeDom(wrapGroup);\n });\n // 转化这个dom为nativeDOM\n let nativeDom: HTMLElement;\n if (typeof dom === 'string') {\n nativeDom = new DOMParser().parseFromString(dom, 'text/xml').firstChild as any;\n } else {\n nativeDom = dom;\n }\n // 获取container的dom,默认为window的container\n let nativeContainer;\n const _container =\n container || (stage.params.enableHtmlAttribute === true ? null : stage.params.enableHtmlAttribute);\n if (_container) {\n if (typeof _container === 'string') {\n nativeContainer = application.global.getElementById(_container);\n } else {\n nativeContainer = _container;\n }\n } else {\n // nativeContainer = application.global.getRootElement();\n nativeContainer = graphic.stage.window.getContainer();\n }\n // 创建wrapGroup\n const wrapGroup = application.global.createDom({ tagName: 'div', width, height, style, parent: nativeContainer });\n if (wrapGroup) {\n wrapGroup.appendChild(nativeDom);\n graphic.bindDom.set(dom, { dom: nativeDom, container, wrapGroup: wrapGroup as any });\n }\n // 事件穿透\n wrapGroup.style.pointerEvents = 'none';\n // 定位wrapGroup\n if (!wrapGroup.style.position) {\n wrapGroup.style.position = 'absolute';\n nativeContainer.style.position = 'relative';\n }\n let left: number = 0;\n let top: number = 0;\n if (anchorType === 'position') {\n const matrix = graphic.transMatrix;\n left = matrix.e;\n top = matrix.f;\n } else {\n const b = graphic.AABBBounds;\n left = b.x1;\n top = b.y1;\n }\n // 查看wrapGroup的位置\n // const wrapGroupTL = application.global.getElementTopLeft(wrapGroup, false);\n const containerTL = application.global.getElementTopLeft(nativeContainer, false);\n const windowTL = stage.window.getTopLeft(false);\n const offsetX = left + windowTL.left - containerTL.left;\n const offsetTop = top + windowTL.top - containerTL.top;\n // wrapGroup.style.transform = `translate(${offsetX}px, ${offsetTop}px)`;\n wrapGroup.style.left = `${offsetX}px`;\n wrapGroup.style.top = `${offsetTop}px`;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/plugins/builtin-plugin/html-attribute-plugin.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,mDAAgD;AAChD,2CAAiD;AAEjD,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAA0B,qBAAqB,CAAC;QACpD,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IA0ItC,CAAC;IAxIC,QAAQ,CAAC,OAAuB;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;YACpD,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;gBAClD,OAAO;aACR;YAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QACH,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE;YACjE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC;IACD,UAAU,CAAC,OAAuB;QAChC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxF,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;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AI,UAAU,KAAK,UAAU,EAAE;YAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;YACnC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;YAChB,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC;SAChB;aAAM;YACL,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;YAC7B,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC;YACZ,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;SACZ;QAGD,MAAM,WAAW,GAAG,yBAAW,CAAC,MAAM,CAAC,iBAAiB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACjF,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QACxD,MAAM,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC;QAEvD,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,IAAI,CAAC;QACtC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,SAAS,IAAI,CAAC;IACzC,CAAC;CACF;AA/ID,kDA+IC","file":"html-attribute-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport type { IGraphic, IPlugin, IPluginService, IRenderService, IDrawContext, IGroup } from '../../interface';\nimport { application } from '../../application';\nimport { DefaultAttribute } from '../../graphic';\n\nexport class HtmlAttributePlugin implements IPlugin {\n name: 'HtmlAttributePlugin' = 'HtmlAttributePlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n\n this.drawHTML(context.stage.renderService);\n });\n application.graphicService.hooks.onRelease.tap(this.key, graphic => {\n this.removeDom(graphic);\n });\n }\n deactivate(context: IPluginService): void {\n context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n\n protected drawHTML(renderService: IRenderService) {\n if (application.global.env === 'browser') {\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n this.renderGroupHTML(group as IGroup);\n });\n }\n }\n\n renderGroupHTML(group: IGroup) {\n this.renderGraphicHTML(group);\n group.forEachChildren((g: IGraphic) => {\n if (g.isContainer) {\n this.renderGroupHTML(g as IGroup);\n } else {\n this.renderGraphicHTML(g);\n }\n });\n }\n\n removeDom(graphic: IGraphic) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n }\n\n renderGraphicHTML(graphic: IGraphic) {\n const { html } = graphic.attribute;\n if (!html) {\n if (graphic.bindDom && graphic.bindDom.size) {\n // 删除dom\n graphic.bindDom.forEach(item => {\n item.dom && item.dom.parentElement.removeChild(item.dom);\n });\n graphic.bindDom.clear();\n }\n return;\n }\n const stage = graphic.stage;\n if (!stage) {\n return;\n }\n const { dom, container, width, height, style, anchorType = 'boundsLeftTop' } = html;\n if (!graphic.bindDom) {\n graphic.bindDom = new Map();\n }\n const lastDom = graphic.bindDom.get(dom);\n // 如果存在了(dom存在,且container没有变化),就跳过\n if (lastDom && !(container && container !== lastDom.container)) {\n return;\n }\n // 清除上一次的dom\n graphic.bindDom.forEach(({ wrapGroup }) => {\n application.global.removeDom(wrapGroup);\n });\n // 转化这个dom为nativeDOM\n let nativeDom: HTMLElement;\n if (typeof dom === 'string') {\n nativeDom = new DOMParser().parseFromString(dom, 'text/html').firstChild as any;\n } else {\n nativeDom = dom;\n }\n // 获取container的dom,默认为window的container\n let nativeContainer;\n const _container =\n container || (stage.params.enableHtmlAttribute === true ? null : stage.params.enableHtmlAttribute);\n if (_container) {\n if (typeof _container === 'string') {\n nativeContainer = application.global.getElementById(_container);\n } else {\n nativeContainer = _container;\n }\n } else {\n // nativeContainer = application.global.getRootElement();\n nativeContainer = graphic.stage.window.getContainer();\n }\n // 创建wrapGroup\n const wrapGroup = application.global.createDom({ tagName: 'div', width, height, style, parent: nativeContainer });\n if (wrapGroup) {\n wrapGroup.appendChild(nativeDom);\n graphic.bindDom.set(dom, { dom: nativeDom, container, wrapGroup: wrapGroup as any });\n }\n // 事件穿透\n wrapGroup.style.pointerEvents = 'none';\n // 定位wrapGroup\n if (!wrapGroup.style.position) {\n wrapGroup.style.position = 'absolute';\n nativeContainer.style.position = 'relative';\n }\n let left: number = 0;\n let top: number = 0;\n if (anchorType === 'position') {\n const matrix = graphic.transMatrix;\n left = matrix.e;\n top = matrix.f;\n } else {\n const b = graphic.AABBBounds;\n left = b.x1;\n top = b.y1;\n }\n // 查看wrapGroup的位置\n // const wrapGroupTL = application.global.getElementTopLeft(wrapGroup, false);\n const containerTL = application.global.getElementTopLeft(nativeContainer, false);\n const windowTL = stage.window.getTopLeft(false);\n const offsetX = left + windowTL.left - containerTL.left;\n const offsetTop = top + windowTL.top - containerTL.top;\n // wrapGroup.style.transform = `translate(${offsetX}px, ${offsetTop}px)`;\n wrapGroup.style.left = `${offsetX}px`;\n wrapGroup.style.top = `${offsetTop}px`;\n }\n}\n"]}
package/dist/index.js CHANGED
@@ -12559,6 +12559,10 @@
12559
12559
  const propIndex = jPath.lastIndexOf('.');
12560
12560
  jPath = jPath.substring(0, propIndex);
12561
12561
  currentNode = this.tagsNodeStack.pop();
12562
+ if (currentNode && currentNode.child && textData) {
12563
+ currentNode.child[currentNode.child.length - 1][':@'] &&
12564
+ (currentNode.child[currentNode.child.length - 1][':@'].text = textData);
12565
+ }
12562
12566
  textData = '';
12563
12567
  i = closeIndex;
12564
12568
  }
@@ -12833,7 +12837,7 @@
12833
12837
  return output;
12834
12838
  }
12835
12839
  function parseCommonXML(str, output) {
12836
- const attr = str['@_attribute'];
12840
+ const attr = str.attribute;
12837
12841
  if (attr) {
12838
12842
  const attrList = attr.split(';');
12839
12843
  attrList.forEach((attrItem) => {
@@ -25250,7 +25254,7 @@
25250
25254
  });
25251
25255
  let nativeDom;
25252
25256
  if (typeof dom === 'string') {
25253
- nativeDom = new DOMParser().parseFromString(dom, 'text/xml').firstChild;
25257
+ nativeDom = new DOMParser().parseFromString(dom, 'text/html').firstChild;
25254
25258
  }
25255
25259
  else {
25256
25260
  nativeDom = dom;