@visactor/vrender-core 1.1.0-alpha.27 → 1.1.0-alpha.28

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 (76) hide show
  1. package/cjs/graphic/graphic.js +3 -3
  2. package/cjs/graphic/graphic.js.map +1 -1
  3. package/cjs/graphic/tools.js +3 -3
  4. package/cjs/graphic/tools.js.map +1 -1
  5. package/cjs/render/contributions/render/arc-module.js +4 -3
  6. package/cjs/render/contributions/render/arc-module.js.map +1 -1
  7. package/cjs/render/contributions/render/arc3d-module.js +2 -2
  8. package/cjs/render/contributions/render/arc3d-module.js.map +1 -1
  9. package/cjs/render/contributions/render/area-module.js +6 -6
  10. package/cjs/render/contributions/render/area-module.js.map +1 -1
  11. package/cjs/render/contributions/render/circle-module.js +3 -2
  12. package/cjs/render/contributions/render/circle-module.js.map +1 -1
  13. package/cjs/render/contributions/render/glyph-module.js +2 -2
  14. package/cjs/render/contributions/render/glyph-module.js.map +1 -1
  15. package/cjs/render/contributions/render/image-module.js +2 -1
  16. package/cjs/render/contributions/render/image-module.js.map +1 -1
  17. package/cjs/render/contributions/render/line-module.js +3 -5
  18. package/cjs/render/contributions/render/line-module.js.map +1 -1
  19. package/cjs/render/contributions/render/path-module.js +4 -3
  20. package/cjs/render/contributions/render/path-module.js.map +1 -1
  21. package/cjs/render/contributions/render/polygon-module.js +2 -1
  22. package/cjs/render/contributions/render/polygon-module.js.map +1 -1
  23. package/cjs/render/contributions/render/pyramid3d-module.js +2 -1
  24. package/cjs/render/contributions/render/pyramid3d-module.js.map +1 -1
  25. package/cjs/render/contributions/render/rect3d-module.js +2 -1
  26. package/cjs/render/contributions/render/rect3d-module.js.map +1 -1
  27. package/cjs/render/contributions/render/richtext-module.js +2 -1
  28. package/cjs/render/contributions/render/richtext-module.js.map +1 -1
  29. package/cjs/render/contributions/render/star-module.js +2 -1
  30. package/cjs/render/contributions/render/star-module.js.map +1 -1
  31. package/cjs/render/contributions/render/star-render.d.ts +2 -2
  32. package/cjs/render/contributions/render/star-render.js +3 -3
  33. package/cjs/render/contributions/render/star-render.js.map +1 -1
  34. package/cjs/render/contributions/render/symbol-module.js +3 -2
  35. package/cjs/render/contributions/render/symbol-module.js.map +1 -1
  36. package/cjs/render/contributions/render/text-module.js +2 -1
  37. package/cjs/render/contributions/render/text-module.js.map +1 -1
  38. package/dist/index.es.js +451 -423
  39. package/es/graphic/graphic.js +3 -3
  40. package/es/graphic/graphic.js.map +1 -1
  41. package/es/graphic/tools.js +2 -4
  42. package/es/graphic/tools.js.map +1 -1
  43. package/es/render/contributions/render/arc-module.js +3 -3
  44. package/es/render/contributions/render/arc-module.js.map +1 -1
  45. package/es/render/contributions/render/arc3d-module.js +2 -2
  46. package/es/render/contributions/render/arc3d-module.js.map +1 -1
  47. package/es/render/contributions/render/area-module.js +4 -6
  48. package/es/render/contributions/render/area-module.js.map +1 -1
  49. package/es/render/contributions/render/circle-module.js +3 -3
  50. package/es/render/contributions/render/circle-module.js.map +1 -1
  51. package/es/render/contributions/render/glyph-module.js +2 -2
  52. package/es/render/contributions/render/glyph-module.js.map +1 -1
  53. package/es/render/contributions/render/image-module.js +2 -2
  54. package/es/render/contributions/render/image-module.js.map +1 -1
  55. package/es/render/contributions/render/line-module.js +2 -5
  56. package/es/render/contributions/render/line-module.js.map +1 -1
  57. package/es/render/contributions/render/path-module.js +3 -3
  58. package/es/render/contributions/render/path-module.js.map +1 -1
  59. package/es/render/contributions/render/polygon-module.js +2 -2
  60. package/es/render/contributions/render/polygon-module.js.map +1 -1
  61. package/es/render/contributions/render/pyramid3d-module.js +2 -2
  62. package/es/render/contributions/render/pyramid3d-module.js.map +1 -1
  63. package/es/render/contributions/render/rect3d-module.js +2 -2
  64. package/es/render/contributions/render/rect3d-module.js.map +1 -1
  65. package/es/render/contributions/render/richtext-module.js +2 -2
  66. package/es/render/contributions/render/richtext-module.js.map +1 -1
  67. package/es/render/contributions/render/star-module.js +3 -2
  68. package/es/render/contributions/render/star-module.js.map +1 -1
  69. package/es/render/contributions/render/star-render.d.ts +2 -2
  70. package/es/render/contributions/render/star-render.js +3 -3
  71. package/es/render/contributions/render/star-render.js.map +1 -1
  72. package/es/render/contributions/render/symbol-module.js +3 -3
  73. package/es/render/contributions/render/symbol-module.js.map +1 -1
  74. package/es/render/contributions/render/text-module.js +2 -2
  75. package/es/render/contributions/render/text-module.js.map +1 -1
  76. package/package.json +3 -3
package/dist/index.es.js CHANGED
@@ -5984,6 +5984,292 @@ const builtInSymbolStrMap = {
5984
5984
  roundLine: 'M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z'
5985
5985
  };
5986
5986
 
5987
+ function getAllMatches(string, regex) {
5988
+ const matches = [];
5989
+ let match = regex.exec(string);
5990
+ while (match) {
5991
+ const allmatches = [];
5992
+ allmatches.startIndex = regex.lastIndex - match[0].length;
5993
+ const len = match.length;
5994
+ for (let index = 0; index < len; index++) {
5995
+ allmatches.push(match[index]);
5996
+ }
5997
+ matches.push(allmatches);
5998
+ match = regex.exec(string);
5999
+ }
6000
+ return matches;
6001
+ }
6002
+
6003
+ class XmlNode {
6004
+ constructor(tagname) {
6005
+ this.tagname = tagname;
6006
+ this.child = [];
6007
+ this[':@'] = {};
6008
+ }
6009
+ add(key, val) {
6010
+ if (key === '__proto__') {
6011
+ key = '#__proto__';
6012
+ }
6013
+ this.child.push({ [key]: val });
6014
+ }
6015
+ addChild(node) {
6016
+ if (node.tagname === '__proto__') {
6017
+ node.tagname = '#__proto__';
6018
+ }
6019
+ if (node[':@'] && Object.keys(node[':@']).length > 0) {
6020
+ this.child.push({ [node.tagname]: node.child, [':@']: node[':@'] });
6021
+ }
6022
+ else {
6023
+ this.child.push({ [node.tagname]: node.child });
6024
+ }
6025
+ }
6026
+ }
6027
+ function findClosingIndex(xmlData, str, i, errMsg) {
6028
+ const closingIndex = xmlData.indexOf(str, i);
6029
+ if (closingIndex === -1) {
6030
+ throw new Error(errMsg);
6031
+ }
6032
+ else {
6033
+ return closingIndex + str.length - 1;
6034
+ }
6035
+ }
6036
+ function tagExpWithClosingIndex(xmlData, i, closingChar = '>') {
6037
+ let attrBoundary;
6038
+ let tagExp = '';
6039
+ for (let index = i; index < xmlData.length; index++) {
6040
+ let ch = xmlData[index];
6041
+ if (attrBoundary) {
6042
+ if (ch === attrBoundary) {
6043
+ attrBoundary = '';
6044
+ }
6045
+ }
6046
+ else if (ch === '"' || ch === "'") {
6047
+ attrBoundary = ch;
6048
+ }
6049
+ else if (ch === closingChar[0]) {
6050
+ if (closingChar[1]) {
6051
+ if (xmlData[index + 1] === closingChar[1]) {
6052
+ return {
6053
+ data: tagExp,
6054
+ index: index
6055
+ };
6056
+ }
6057
+ }
6058
+ else {
6059
+ return {
6060
+ data: tagExp,
6061
+ index: index
6062
+ };
6063
+ }
6064
+ }
6065
+ else if (ch === '\t') {
6066
+ ch = ' ';
6067
+ }
6068
+ tagExp += ch;
6069
+ }
6070
+ }
6071
+ function readTagExp(xmlData, i, removeNSPrefix, closingChar = '>') {
6072
+ const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
6073
+ if (!result) {
6074
+ return;
6075
+ }
6076
+ let tagExp = result.data;
6077
+ const closeIndex = result.index;
6078
+ const separatorIndex = tagExp.search(/\s/);
6079
+ let tagName = tagExp;
6080
+ let attrExpPresent = true;
6081
+ if (separatorIndex !== -1) {
6082
+ tagName = tagExp.substr(0, separatorIndex).replace(/\s\s*$/, '');
6083
+ tagExp = tagExp.substr(separatorIndex + 1);
6084
+ }
6085
+ const rawTagName = tagName;
6086
+ if (removeNSPrefix) {
6087
+ const colonIndex = tagName.indexOf(':');
6088
+ if (colonIndex !== -1) {
6089
+ tagName = tagName.substr(colonIndex + 1);
6090
+ attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
6091
+ }
6092
+ }
6093
+ return {
6094
+ tagName: tagName,
6095
+ tagExp: tagExp,
6096
+ closeIndex: closeIndex,
6097
+ attrExpPresent: attrExpPresent,
6098
+ rawTagName: rawTagName
6099
+ };
6100
+ }
6101
+ const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
6102
+ class OrderedObjParser {
6103
+ constructor(options) {
6104
+ this.currentNode = null;
6105
+ this.options = options;
6106
+ this.tagsNodeStack = [];
6107
+ this.docTypeEntities = {};
6108
+ }
6109
+ addChild(currentNode, childNode, jPath) {
6110
+ const result = childNode.tagname;
6111
+ if (typeof result === 'string') {
6112
+ childNode.tagname = result;
6113
+ currentNode.addChild(childNode);
6114
+ }
6115
+ else {
6116
+ currentNode.addChild(childNode);
6117
+ }
6118
+ }
6119
+ buildAttributesMap(attrStr, jPath, tagName) {
6120
+ const attrs = {};
6121
+ if (!attrStr) {
6122
+ return;
6123
+ }
6124
+ const matches = getAllMatches(attrStr, attrsRegx);
6125
+ const len = matches.length;
6126
+ for (let i = 0; i < len; i++) {
6127
+ const attrName = matches[i][1];
6128
+ const oldVal = matches[i][4];
6129
+ const aName = attrName;
6130
+ if (attrName) {
6131
+ if (oldVal !== undefined) {
6132
+ attrs[aName] = isNaN(oldVal) ? oldVal : Number(oldVal);
6133
+ }
6134
+ else {
6135
+ attrs[aName] = true;
6136
+ }
6137
+ }
6138
+ }
6139
+ return attrs;
6140
+ }
6141
+ parseXml(xmlData) {
6142
+ xmlData = xmlData.replace(/\r\n?/g, '\n');
6143
+ const xmlObj = new XmlNode('!xml');
6144
+ let currentNode = xmlObj;
6145
+ let textData = '';
6146
+ let jPath = '';
6147
+ for (let i = 0; i < xmlData.length; i++) {
6148
+ const ch = xmlData[i];
6149
+ if (ch === '<') {
6150
+ if (xmlData[i + 1] === '/') {
6151
+ const closeIndex = findClosingIndex(xmlData, '>', i, 'Closing Tag is not closed.');
6152
+ const propIndex = jPath.lastIndexOf('.');
6153
+ jPath = jPath.substring(0, propIndex);
6154
+ currentNode = this.tagsNodeStack.pop();
6155
+ if (currentNode && currentNode.child && textData) {
6156
+ currentNode.child[currentNode.child.length - 1][':@'] &&
6157
+ (currentNode.child[currentNode.child.length - 1][':@'].text = textData);
6158
+ }
6159
+ textData = '';
6160
+ i = closeIndex;
6161
+ }
6162
+ else if (xmlData[i + 1] === '?') {
6163
+ const tagData = readTagExp(xmlData, i, false, '?>');
6164
+ i = tagData.closeIndex + 1;
6165
+ }
6166
+ else if (xmlData.substr(i + 1, 3) === '!--') {
6167
+ const endIndex = findClosingIndex(xmlData, '-->', i + 4, 'Comment is not closed.');
6168
+ i = endIndex;
6169
+ }
6170
+ else {
6171
+ const result = readTagExp(xmlData, i, false);
6172
+ let tagName = result.tagName;
6173
+ let tagExp = result.tagExp;
6174
+ const attrExpPresent = result.attrExpPresent;
6175
+ const closeIndex = result.closeIndex;
6176
+ if (tagName !== xmlObj.tagname) {
6177
+ jPath += jPath ? '.' + tagName : tagName;
6178
+ }
6179
+ if (tagExp.length > 0 && tagExp.lastIndexOf('/') === tagExp.length - 1) {
6180
+ if (tagName[tagName.length - 1] === '/') {
6181
+ tagName = tagName.substr(0, tagName.length - 1);
6182
+ jPath = jPath.substr(0, jPath.length - 1);
6183
+ tagExp = tagName;
6184
+ }
6185
+ else {
6186
+ tagExp = tagExp.substr(0, tagExp.length - 1);
6187
+ }
6188
+ const childNode = new XmlNode(tagName);
6189
+ if (tagName !== tagExp && attrExpPresent) {
6190
+ childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);
6191
+ }
6192
+ this.addChild(currentNode, childNode, jPath);
6193
+ jPath = jPath.substr(0, jPath.lastIndexOf('.'));
6194
+ }
6195
+ else {
6196
+ const childNode = new XmlNode(tagName);
6197
+ this.tagsNodeStack.push(currentNode);
6198
+ if (tagName !== tagExp && attrExpPresent) {
6199
+ childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);
6200
+ }
6201
+ this.addChild(currentNode, childNode, jPath);
6202
+ currentNode = childNode;
6203
+ }
6204
+ textData = '';
6205
+ i = closeIndex;
6206
+ }
6207
+ }
6208
+ else {
6209
+ textData += xmlData[i];
6210
+ }
6211
+ }
6212
+ return xmlObj.child;
6213
+ }
6214
+ }
6215
+
6216
+ function prettify(node, options) {
6217
+ return compress(node);
6218
+ }
6219
+ function compress(arr, jPath) {
6220
+ const compressedObj = {};
6221
+ for (let i = 0; i < arr.length; i++) {
6222
+ const tagObj = arr[i];
6223
+ const property = propName(tagObj);
6224
+ if (property === undefined) {
6225
+ continue;
6226
+ }
6227
+ else if (tagObj[property]) {
6228
+ const val = compress(tagObj[property]);
6229
+ isLeafTag(val);
6230
+ if (tagObj[':@']) {
6231
+ assignAttributes(val, tagObj[':@']);
6232
+ }
6233
+ if (compressedObj[property] !== undefined && compressedObj.hasOwnProperty(property)) {
6234
+ if (!Array.isArray(compressedObj[property])) {
6235
+ compressedObj[property] = [compressedObj[property]];
6236
+ }
6237
+ compressedObj[property].push(val);
6238
+ }
6239
+ else {
6240
+ compressedObj[property] = val;
6241
+ }
6242
+ }
6243
+ }
6244
+ return compressedObj;
6245
+ }
6246
+ function propName(obj) {
6247
+ const keys = Object.keys(obj);
6248
+ for (let i = 0; i < keys.length; i++) {
6249
+ const key = keys[i];
6250
+ if (key !== ':@') {
6251
+ return key;
6252
+ }
6253
+ }
6254
+ }
6255
+ function assignAttributes(obj, attrMap, jpath) {
6256
+ if (attrMap) {
6257
+ const keys = Object.keys(attrMap);
6258
+ const len = keys.length;
6259
+ for (let i = 0; i < len; i++) {
6260
+ const atrrName = keys[i];
6261
+ obj[atrrName] = attrMap[atrrName];
6262
+ }
6263
+ }
6264
+ }
6265
+ function isLeafTag(obj) {
6266
+ const propCount = Object.keys(obj).length;
6267
+ if (propCount === 0) {
6268
+ return true;
6269
+ }
6270
+ return false;
6271
+ }
6272
+
5987
6273
  function isSvg(str) {
5988
6274
  return str.startsWith('<svg') || str.startsWith('<?xml');
5989
6275
  }
@@ -5991,7 +6277,24 @@ function isXML(str) {
5991
6277
  return str.startsWith('<');
5992
6278
  }
5993
6279
 
5994
- const loadXMLParser$1 = () => require('../common/xml/parser');
6280
+ class XMLParser {
6281
+ constructor(options) {
6282
+ this.options = Object.assign({}, XMLParser.defaultOptions, options);
6283
+ }
6284
+ valid(xml) {
6285
+ return xml.startsWith('<');
6286
+ }
6287
+ parse(xmlData) {
6288
+ if (!this.valid) {
6289
+ return false;
6290
+ }
6291
+ const orderedObjParser = new OrderedObjParser(this.options);
6292
+ const orderedResult = orderedObjParser.parseXml(xmlData);
6293
+ return prettify(orderedResult, this.options);
6294
+ }
6295
+ }
6296
+ XMLParser.defaultOptions = {};
6297
+
5995
6298
  function incrementalAddTo(group, graphic) {
5996
6299
  group.incrementalAppendChild(graphic);
5997
6300
  }
@@ -6104,7 +6407,6 @@ function xul(str) {
6104
6407
  }
6105
6408
  const valid = isXML(xmlStr);
6106
6409
  if (valid === true) {
6107
- const { XMLParser } = loadXMLParser$1();
6108
6410
  const parser = new XMLParser();
6109
6411
  const data = parser.parse(xmlStr);
6110
6412
  data.tc &&
@@ -9435,7 +9737,6 @@ function flushStageSharedStateRefresh(stage) {
9435
9737
 
9436
9738
  const _tempBounds$1 = new AABBBounds();
9437
9739
  const loadShadowRootFactory = () => require('./shadow-root');
9438
- const loadXMLParser = () => require('../common/xml/parser');
9439
9740
  const tempMatrix = new Matrix();
9440
9741
  const PURE_STYLE_KEY = [
9441
9742
  'stroke',
@@ -10299,7 +10600,6 @@ class Graphic extends Node {
10299
10600
  symbolType = _symbolType || symbolType;
10300
10601
  const valid = isSvg(symbolType);
10301
10602
  if (valid === true) {
10302
- const { XMLParser } = loadXMLParser();
10303
10603
  const parser = new XMLParser();
10304
10604
  const { svg } = parser.parse(symbolType);
10305
10605
  if (!svg) {
@@ -28410,423 +28710,119 @@ class DefaultCircleAllocate extends DefaultGraphicAllocate {
28410
28710
  if (!this.pools.length) {
28411
28711
  return application.graphicService.creator.circle(attribute);
28412
28712
  }
28413
- const g = this.pools.pop();
28414
- g.initAttributes(attribute);
28415
- return g;
28416
- }
28417
- allocateByObj(area) {
28418
- if (!this.pools.length) {
28419
- return application.graphicService.creator.circle(area.attribute);
28420
- }
28421
- const g = this.pools.pop();
28422
- g.initAttributes(area.attribute);
28423
- return g;
28424
- }
28425
- }
28426
- const defaultCircleAllocate = new DefaultCircleAllocate();
28427
- class DefaultLineAllocate extends DefaultGraphicAllocate {
28428
- allocate(attribute) {
28429
- if (!this.pools.length) {
28430
- return application.graphicService.creator.line(attribute);
28431
- }
28432
- const g = this.pools.pop();
28433
- g.initAttributes(attribute);
28434
- return g;
28435
- }
28436
- allocateByObj(line) {
28437
- if (!this.pools.length) {
28438
- return application.graphicService.creator.line(line.attribute);
28439
- }
28440
- const g = this.pools.pop();
28441
- g.initAttributes(line.attribute);
28442
- return g;
28443
- }
28444
- }
28445
- const defaultLineAllocate = new DefaultLineAllocate();
28446
- class DefaultPathAllocate extends DefaultGraphicAllocate {
28447
- allocate(attribute) {
28448
- if (!this.pools.length) {
28449
- return application.graphicService.creator.path(attribute);
28450
- }
28451
- const g = this.pools.pop();
28452
- g.initAttributes(attribute);
28453
- return g;
28454
- }
28455
- allocateByObj(path) {
28456
- if (!this.pools.length) {
28457
- return application.graphicService.creator.path(path.attribute);
28458
- }
28459
- const g = this.pools.pop();
28460
- g.initAttributes(path.attribute);
28461
- return g;
28462
- }
28463
- }
28464
- const defaultPathAllocate = new DefaultPathAllocate();
28465
- class DefaultSymbolAllocate extends DefaultGraphicAllocate {
28466
- allocate(attribute) {
28467
- if (!this.pools.length) {
28468
- return application.graphicService.creator.symbol(attribute);
28469
- }
28470
- const g = this.pools.pop();
28471
- g.initAttributes(attribute);
28472
- return g;
28473
- }
28474
- allocateByObj(symbol) {
28475
- if (!this.pools.length) {
28476
- return application.graphicService.creator.symbol(symbol.attribute);
28477
- }
28478
- const g = this.pools.pop();
28479
- g.initAttributes(symbol.attribute);
28480
- return g;
28481
- }
28482
- }
28483
- const defaultSymbolAllocate = new DefaultSymbolAllocate();
28484
- class DefaultTextAllocate extends DefaultGraphicAllocate {
28485
- allocate(attribute) {
28486
- if (!this.pools.length) {
28487
- return application.graphicService.creator.text(attribute);
28488
- }
28489
- const g = this.pools.pop();
28490
- g.initAttributes(attribute);
28491
- return g;
28492
- }
28493
- allocateByObj(text) {
28494
- if (!this.pools.length) {
28495
- return application.graphicService.creator.text(text.attribute);
28496
- }
28497
- const g = this.pools.pop();
28498
- g.initAttributes(text.attribute);
28499
- return g;
28500
- }
28501
- }
28502
- const defaultTextAllocate = new DefaultTextAllocate();
28503
- class DefaultGraphicMemoryManager {
28504
- constructor() {
28505
- this.map = {
28506
- text: defaultTextAllocate,
28507
- symbol: defaultSymbolAllocate
28508
- };
28509
- }
28510
- gc(g) {
28511
- if (g.isContainer) {
28512
- g.forEachChildren(i => this.gc(i));
28513
- }
28514
- else {
28515
- this.gcItem(g);
28516
- }
28517
- }
28518
- gcItem(g) {
28519
- const allocate = this.map[g.type];
28520
- if (allocate) {
28521
- allocate.free(g);
28522
- }
28523
- }
28524
- }
28525
- const defaultGraphicMemoryManager = new DefaultGraphicMemoryManager();
28526
-
28527
- function getAllMatches(string, regex) {
28528
- const matches = [];
28529
- let match = regex.exec(string);
28530
- while (match) {
28531
- const allmatches = [];
28532
- allmatches.startIndex = regex.lastIndex - match[0].length;
28533
- const len = match.length;
28534
- for (let index = 0; index < len; index++) {
28535
- allmatches.push(match[index]);
28536
- }
28537
- matches.push(allmatches);
28538
- match = regex.exec(string);
28539
- }
28540
- return matches;
28541
- }
28542
-
28543
- class XmlNode {
28544
- constructor(tagname) {
28545
- this.tagname = tagname;
28546
- this.child = [];
28547
- this[':@'] = {};
28548
- }
28549
- add(key, val) {
28550
- if (key === '__proto__') {
28551
- key = '#__proto__';
28552
- }
28553
- this.child.push({ [key]: val });
28554
- }
28555
- addChild(node) {
28556
- if (node.tagname === '__proto__') {
28557
- node.tagname = '#__proto__';
28558
- }
28559
- if (node[':@'] && Object.keys(node[':@']).length > 0) {
28560
- this.child.push({ [node.tagname]: node.child, [':@']: node[':@'] });
28561
- }
28562
- else {
28563
- this.child.push({ [node.tagname]: node.child });
28564
- }
28565
- }
28566
- }
28567
- function findClosingIndex(xmlData, str, i, errMsg) {
28568
- const closingIndex = xmlData.indexOf(str, i);
28569
- if (closingIndex === -1) {
28570
- throw new Error(errMsg);
28571
- }
28572
- else {
28573
- return closingIndex + str.length - 1;
28574
- }
28575
- }
28576
- function tagExpWithClosingIndex(xmlData, i, closingChar = '>') {
28577
- let attrBoundary;
28578
- let tagExp = '';
28579
- for (let index = i; index < xmlData.length; index++) {
28580
- let ch = xmlData[index];
28581
- if (attrBoundary) {
28582
- if (ch === attrBoundary) {
28583
- attrBoundary = '';
28584
- }
28585
- }
28586
- else if (ch === '"' || ch === "'") {
28587
- attrBoundary = ch;
28588
- }
28589
- else if (ch === closingChar[0]) {
28590
- if (closingChar[1]) {
28591
- if (xmlData[index + 1] === closingChar[1]) {
28592
- return {
28593
- data: tagExp,
28594
- index: index
28595
- };
28596
- }
28597
- }
28598
- else {
28599
- return {
28600
- data: tagExp,
28601
- index: index
28602
- };
28603
- }
28604
- }
28605
- else if (ch === '\t') {
28606
- ch = ' ';
28607
- }
28608
- tagExp += ch;
28609
- }
28610
- }
28611
- function readTagExp(xmlData, i, removeNSPrefix, closingChar = '>') {
28612
- const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
28613
- if (!result) {
28614
- return;
28615
- }
28616
- let tagExp = result.data;
28617
- const closeIndex = result.index;
28618
- const separatorIndex = tagExp.search(/\s/);
28619
- let tagName = tagExp;
28620
- let attrExpPresent = true;
28621
- if (separatorIndex !== -1) {
28622
- tagName = tagExp.substr(0, separatorIndex).replace(/\s\s*$/, '');
28623
- tagExp = tagExp.substr(separatorIndex + 1);
28624
- }
28625
- const rawTagName = tagName;
28626
- if (removeNSPrefix) {
28627
- const colonIndex = tagName.indexOf(':');
28628
- if (colonIndex !== -1) {
28629
- tagName = tagName.substr(colonIndex + 1);
28630
- attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
28631
- }
28632
- }
28633
- return {
28634
- tagName: tagName,
28635
- tagExp: tagExp,
28636
- closeIndex: closeIndex,
28637
- attrExpPresent: attrExpPresent,
28638
- rawTagName: rawTagName
28639
- };
28640
- }
28641
- const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
28642
- class OrderedObjParser {
28643
- constructor(options) {
28644
- this.currentNode = null;
28645
- this.options = options;
28646
- this.tagsNodeStack = [];
28647
- this.docTypeEntities = {};
28648
- }
28649
- addChild(currentNode, childNode, jPath) {
28650
- const result = childNode.tagname;
28651
- if (typeof result === 'string') {
28652
- childNode.tagname = result;
28653
- currentNode.addChild(childNode);
28654
- }
28655
- else {
28656
- currentNode.addChild(childNode);
28657
- }
28713
+ const g = this.pools.pop();
28714
+ g.initAttributes(attribute);
28715
+ return g;
28658
28716
  }
28659
- buildAttributesMap(attrStr, jPath, tagName) {
28660
- const attrs = {};
28661
- if (!attrStr) {
28662
- return;
28717
+ allocateByObj(area) {
28718
+ if (!this.pools.length) {
28719
+ return application.graphicService.creator.circle(area.attribute);
28663
28720
  }
28664
- const matches = getAllMatches(attrStr, attrsRegx);
28665
- const len = matches.length;
28666
- for (let i = 0; i < len; i++) {
28667
- const attrName = matches[i][1];
28668
- const oldVal = matches[i][4];
28669
- const aName = attrName;
28670
- if (attrName) {
28671
- if (oldVal !== undefined) {
28672
- attrs[aName] = isNaN(oldVal) ? oldVal : Number(oldVal);
28673
- }
28674
- else {
28675
- attrs[aName] = true;
28676
- }
28677
- }
28721
+ const g = this.pools.pop();
28722
+ g.initAttributes(area.attribute);
28723
+ return g;
28724
+ }
28725
+ }
28726
+ const defaultCircleAllocate = new DefaultCircleAllocate();
28727
+ class DefaultLineAllocate extends DefaultGraphicAllocate {
28728
+ allocate(attribute) {
28729
+ if (!this.pools.length) {
28730
+ return application.graphicService.creator.line(attribute);
28678
28731
  }
28679
- return attrs;
28732
+ const g = this.pools.pop();
28733
+ g.initAttributes(attribute);
28734
+ return g;
28680
28735
  }
28681
- parseXml(xmlData) {
28682
- xmlData = xmlData.replace(/\r\n?/g, '\n');
28683
- const xmlObj = new XmlNode('!xml');
28684
- let currentNode = xmlObj;
28685
- let textData = '';
28686
- let jPath = '';
28687
- for (let i = 0; i < xmlData.length; i++) {
28688
- const ch = xmlData[i];
28689
- if (ch === '<') {
28690
- if (xmlData[i + 1] === '/') {
28691
- const closeIndex = findClosingIndex(xmlData, '>', i, 'Closing Tag is not closed.');
28692
- const propIndex = jPath.lastIndexOf('.');
28693
- jPath = jPath.substring(0, propIndex);
28694
- currentNode = this.tagsNodeStack.pop();
28695
- if (currentNode && currentNode.child && textData) {
28696
- currentNode.child[currentNode.child.length - 1][':@'] &&
28697
- (currentNode.child[currentNode.child.length - 1][':@'].text = textData);
28698
- }
28699
- textData = '';
28700
- i = closeIndex;
28701
- }
28702
- else if (xmlData[i + 1] === '?') {
28703
- const tagData = readTagExp(xmlData, i, false, '?>');
28704
- i = tagData.closeIndex + 1;
28705
- }
28706
- else if (xmlData.substr(i + 1, 3) === '!--') {
28707
- const endIndex = findClosingIndex(xmlData, '-->', i + 4, 'Comment is not closed.');
28708
- i = endIndex;
28709
- }
28710
- else {
28711
- const result = readTagExp(xmlData, i, false);
28712
- let tagName = result.tagName;
28713
- let tagExp = result.tagExp;
28714
- const attrExpPresent = result.attrExpPresent;
28715
- const closeIndex = result.closeIndex;
28716
- if (tagName !== xmlObj.tagname) {
28717
- jPath += jPath ? '.' + tagName : tagName;
28718
- }
28719
- if (tagExp.length > 0 && tagExp.lastIndexOf('/') === tagExp.length - 1) {
28720
- if (tagName[tagName.length - 1] === '/') {
28721
- tagName = tagName.substr(0, tagName.length - 1);
28722
- jPath = jPath.substr(0, jPath.length - 1);
28723
- tagExp = tagName;
28724
- }
28725
- else {
28726
- tagExp = tagExp.substr(0, tagExp.length - 1);
28727
- }
28728
- const childNode = new XmlNode(tagName);
28729
- if (tagName !== tagExp && attrExpPresent) {
28730
- childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);
28731
- }
28732
- this.addChild(currentNode, childNode, jPath);
28733
- jPath = jPath.substr(0, jPath.lastIndexOf('.'));
28734
- }
28735
- else {
28736
- const childNode = new XmlNode(tagName);
28737
- this.tagsNodeStack.push(currentNode);
28738
- if (tagName !== tagExp && attrExpPresent) {
28739
- childNode[':@'] = this.buildAttributesMap(tagExp, jPath, tagName);
28740
- }
28741
- this.addChild(currentNode, childNode, jPath);
28742
- currentNode = childNode;
28743
- }
28744
- textData = '';
28745
- i = closeIndex;
28746
- }
28747
- }
28748
- else {
28749
- textData += xmlData[i];
28750
- }
28736
+ allocateByObj(line) {
28737
+ if (!this.pools.length) {
28738
+ return application.graphicService.creator.line(line.attribute);
28751
28739
  }
28752
- return xmlObj.child;
28740
+ const g = this.pools.pop();
28741
+ g.initAttributes(line.attribute);
28742
+ return g;
28753
28743
  }
28754
28744
  }
28755
-
28756
- function prettify(node, options) {
28757
- return compress(node);
28758
- }
28759
- function compress(arr, jPath) {
28760
- const compressedObj = {};
28761
- for (let i = 0; i < arr.length; i++) {
28762
- const tagObj = arr[i];
28763
- const property = propName(tagObj);
28764
- if (property === undefined) {
28765
- continue;
28745
+ const defaultLineAllocate = new DefaultLineAllocate();
28746
+ class DefaultPathAllocate extends DefaultGraphicAllocate {
28747
+ allocate(attribute) {
28748
+ if (!this.pools.length) {
28749
+ return application.graphicService.creator.path(attribute);
28766
28750
  }
28767
- else if (tagObj[property]) {
28768
- const val = compress(tagObj[property]);
28769
- isLeafTag(val);
28770
- if (tagObj[':@']) {
28771
- assignAttributes(val, tagObj[':@']);
28772
- }
28773
- if (compressedObj[property] !== undefined && compressedObj.hasOwnProperty(property)) {
28774
- if (!Array.isArray(compressedObj[property])) {
28775
- compressedObj[property] = [compressedObj[property]];
28776
- }
28777
- compressedObj[property].push(val);
28778
- }
28779
- else {
28780
- compressedObj[property] = val;
28781
- }
28751
+ const g = this.pools.pop();
28752
+ g.initAttributes(attribute);
28753
+ return g;
28754
+ }
28755
+ allocateByObj(path) {
28756
+ if (!this.pools.length) {
28757
+ return application.graphicService.creator.path(path.attribute);
28782
28758
  }
28759
+ const g = this.pools.pop();
28760
+ g.initAttributes(path.attribute);
28761
+ return g;
28783
28762
  }
28784
- return compressedObj;
28785
28763
  }
28786
- function propName(obj) {
28787
- const keys = Object.keys(obj);
28788
- for (let i = 0; i < keys.length; i++) {
28789
- const key = keys[i];
28790
- if (key !== ':@') {
28791
- return key;
28764
+ const defaultPathAllocate = new DefaultPathAllocate();
28765
+ class DefaultSymbolAllocate extends DefaultGraphicAllocate {
28766
+ allocate(attribute) {
28767
+ if (!this.pools.length) {
28768
+ return application.graphicService.creator.symbol(attribute);
28792
28769
  }
28770
+ const g = this.pools.pop();
28771
+ g.initAttributes(attribute);
28772
+ return g;
28793
28773
  }
28794
- }
28795
- function assignAttributes(obj, attrMap, jpath) {
28796
- if (attrMap) {
28797
- const keys = Object.keys(attrMap);
28798
- const len = keys.length;
28799
- for (let i = 0; i < len; i++) {
28800
- const atrrName = keys[i];
28801
- obj[atrrName] = attrMap[atrrName];
28774
+ allocateByObj(symbol) {
28775
+ if (!this.pools.length) {
28776
+ return application.graphicService.creator.symbol(symbol.attribute);
28802
28777
  }
28778
+ const g = this.pools.pop();
28779
+ g.initAttributes(symbol.attribute);
28780
+ return g;
28803
28781
  }
28804
28782
  }
28805
- function isLeafTag(obj) {
28806
- const propCount = Object.keys(obj).length;
28807
- if (propCount === 0) {
28808
- return true;
28783
+ const defaultSymbolAllocate = new DefaultSymbolAllocate();
28784
+ class DefaultTextAllocate extends DefaultGraphicAllocate {
28785
+ allocate(attribute) {
28786
+ if (!this.pools.length) {
28787
+ return application.graphicService.creator.text(attribute);
28788
+ }
28789
+ const g = this.pools.pop();
28790
+ g.initAttributes(attribute);
28791
+ return g;
28792
+ }
28793
+ allocateByObj(text) {
28794
+ if (!this.pools.length) {
28795
+ return application.graphicService.creator.text(text.attribute);
28796
+ }
28797
+ const g = this.pools.pop();
28798
+ g.initAttributes(text.attribute);
28799
+ return g;
28809
28800
  }
28810
- return false;
28811
28801
  }
28812
-
28813
- class XMLParser {
28814
- constructor(options) {
28815
- this.options = Object.assign({}, XMLParser.defaultOptions, options);
28802
+ const defaultTextAllocate = new DefaultTextAllocate();
28803
+ class DefaultGraphicMemoryManager {
28804
+ constructor() {
28805
+ this.map = {
28806
+ text: defaultTextAllocate,
28807
+ symbol: defaultSymbolAllocate
28808
+ };
28816
28809
  }
28817
- valid(xml) {
28818
- return xml.startsWith('<');
28810
+ gc(g) {
28811
+ if (g.isContainer) {
28812
+ g.forEachChildren(i => this.gc(i));
28813
+ }
28814
+ else {
28815
+ this.gcItem(g);
28816
+ }
28819
28817
  }
28820
- parse(xmlData) {
28821
- if (!this.valid) {
28822
- return false;
28818
+ gcItem(g) {
28819
+ const allocate = this.map[g.type];
28820
+ if (allocate) {
28821
+ allocate.free(g);
28823
28822
  }
28824
- const orderedObjParser = new OrderedObjParser(this.options);
28825
- const orderedResult = orderedObjParser.parseXml(xmlData);
28826
- return prettify(orderedResult, this.options);
28827
28823
  }
28828
28824
  }
28829
- XMLParser.defaultOptions = {};
28825
+ const defaultGraphicMemoryManager = new DefaultGraphicMemoryManager();
28830
28826
 
28831
28827
  function describeServiceIdentifier(serviceIdentifier) {
28832
28828
  if (typeof serviceIdentifier === 'string') {
@@ -28864,8 +28860,10 @@ function bindArcRenderModule({ bind }) {
28864
28860
  if (isBindingContextLoaded(loadedArcModuleContexts, bind)) {
28865
28861
  return;
28866
28862
  }
28867
- bind(DefaultCanvasArcRender).toSelf().inSingletonScope();
28868
- bind(ArcRender).to(DefaultCanvasArcRender).inSingletonScope();
28863
+ bind(DefaultCanvasArcRender)
28864
+ .toDynamicValue(({ container }) => new DefaultCanvasArcRender(createContributionProvider(ArcRenderContribution, container)))
28865
+ .inSingletonScope();
28866
+ bind(ArcRender).toService(DefaultCanvasArcRender);
28869
28867
  bind(GraphicRender).toService(ArcRender);
28870
28868
  bind(ArcRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
28871
28869
  bindContributionProvider(bind, ArcRenderContribution);
@@ -28896,9 +28894,10 @@ function bindLineRenderModule({ bind }) {
28896
28894
  if (isBindingContextLoaded(loadedLineModuleContexts, bind)) {
28897
28895
  return;
28898
28896
  }
28899
- bind(DefaultCanvasLineRender).toSelf().inSingletonScope();
28900
- bind(DefaultIncrementalCanvasLineRender).toSelf().inSingletonScope();
28901
- bind(LineRender).to(DefaultCanvasLineRender).inSingletonScope();
28897
+ bind(DefaultCanvasLineRender)
28898
+ .toDynamicValue(() => new DefaultCanvasLineRender())
28899
+ .inSingletonScope();
28900
+ bind(LineRender).toService(DefaultCanvasLineRender);
28902
28901
  bind(GraphicRender).toService(LineRender);
28903
28902
  }
28904
28903
  const lineModule = bindLineRenderModule;
@@ -28908,12 +28907,13 @@ function bindAreaRenderModule({ bind }) {
28908
28907
  if (isBindingContextLoaded(loadedAreaModuleContexts, bind)) {
28909
28908
  return;
28910
28909
  }
28911
- bind(DefaultCanvasAreaRender).toSelf().inSingletonScope();
28912
- bind(AreaRender).to(DefaultCanvasAreaRender).inSingletonScope();
28910
+ bind(DefaultCanvasAreaRender)
28911
+ .toDynamicValue(({ container }) => new DefaultCanvasAreaRender(createContributionProvider(AreaRenderContribution, container)))
28912
+ .inSingletonScope();
28913
+ bind(AreaRender).toService(DefaultCanvasAreaRender);
28913
28914
  bind(GraphicRender).toService(AreaRender);
28914
28915
  bind(AreaRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
28915
28916
  bindContributionProvider(bind, AreaRenderContribution);
28916
- bind(DefaultIncrementalCanvasAreaRender).toSelf().inSingletonScope();
28917
28917
  }
28918
28918
  const areaModule = bindAreaRenderModule;
28919
28919
 
@@ -28922,8 +28922,10 @@ function bindSymbolRenderModule({ bind }) {
28922
28922
  if (isBindingContextLoaded(loadedSymbolModuleContexts, bind)) {
28923
28923
  return;
28924
28924
  }
28925
- bind(DefaultCanvasSymbolRender).toSelf().inSingletonScope();
28926
- bind(SymbolRender).to(DefaultCanvasSymbolRender).inSingletonScope();
28925
+ bind(DefaultCanvasSymbolRender)
28926
+ .toDynamicValue(({ container }) => new DefaultCanvasSymbolRender(createContributionProvider(SymbolRenderContribution, container)))
28927
+ .inSingletonScope();
28928
+ bind(SymbolRender).toService(DefaultCanvasSymbolRender);
28927
28929
  bind(GraphicRender).toService(SymbolRender);
28928
28930
  bind(SymbolRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
28929
28931
  bindContributionProvider(bind, SymbolRenderContribution);
@@ -28935,8 +28937,10 @@ function bindCircleRenderModule({ bind }) {
28935
28937
  if (isBindingContextLoaded(loadedCircleModuleContexts, bind)) {
28936
28938
  return;
28937
28939
  }
28938
- bind(DefaultCanvasCircleRender).toSelf().inSingletonScope();
28939
- bind(CircleRender).to(DefaultCanvasCircleRender).inSingletonScope();
28940
+ bind(DefaultCanvasCircleRender)
28941
+ .toDynamicValue(({ container }) => new DefaultCanvasCircleRender(createContributionProvider(CircleRenderContribution, container)))
28942
+ .inSingletonScope();
28943
+ bind(CircleRender).toService(DefaultCanvasCircleRender);
28940
28944
  bind(GraphicRender).toService(CircleRender);
28941
28945
  bind(CircleRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
28942
28946
  bindContributionProvider(bind, CircleRenderContribution);
@@ -28948,7 +28952,9 @@ function bindTextRenderModule({ bind }) {
28948
28952
  if (isBindingContextLoaded(loadedTextModuleContexts, bind)) {
28949
28953
  return;
28950
28954
  }
28951
- bind(TextRender).to(DefaultCanvasTextRender).inSingletonScope();
28955
+ bind(TextRender)
28956
+ .toDynamicValue(({ container }) => new DefaultCanvasTextRender(createContributionProvider(TextRenderContribution, container)))
28957
+ .inSingletonScope();
28952
28958
  bind(GraphicRender).toService(TextRender);
28953
28959
  bind(TextRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
28954
28960
  bindContributionProvider(bind, TextRenderContribution);
@@ -28960,8 +28966,10 @@ function bindPathRenderModule({ bind }) {
28960
28966
  if (isBindingContextLoaded(loadedPathModuleContexts, bind)) {
28961
28967
  return;
28962
28968
  }
28963
- bind(DefaultCanvasPathRender).toSelf().inSingletonScope();
28964
- bind(PathRender).to(DefaultCanvasPathRender).inSingletonScope();
28969
+ bind(DefaultCanvasPathRender)
28970
+ .toDynamicValue(({ container }) => new DefaultCanvasPathRender(createContributionProvider(PathRenderContribution, container)))
28971
+ .inSingletonScope();
28972
+ bind(PathRender).toService(DefaultCanvasPathRender);
28965
28973
  bind(GraphicRender).toService(PathRender);
28966
28974
  bind(PathRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
28967
28975
  bindContributionProvider(bind, PathRenderContribution);
@@ -28973,7 +28981,9 @@ function bindPolygonRenderModule({ bind }) {
28973
28981
  if (isBindingContextLoaded(loadedPolygonModuleContexts, bind)) {
28974
28982
  return;
28975
28983
  }
28976
- bind(PolygonRender).to(DefaultCanvasPolygonRender).inSingletonScope();
28984
+ bind(PolygonRender)
28985
+ .toDynamicValue(({ container }) => new DefaultCanvasPolygonRender(createContributionProvider(PolygonRenderContribution, container)))
28986
+ .inSingletonScope();
28977
28987
  bind(GraphicRender).toService(PolygonRender);
28978
28988
  bind(PolygonRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
28979
28989
  bindContributionProvider(bind, PolygonRenderContribution);
@@ -28981,12 +28991,12 @@ function bindPolygonRenderModule({ bind }) {
28981
28991
  const polygonModule = bindPolygonRenderModule;
28982
28992
 
28983
28993
  class DefaultCanvasStarRender extends BaseRender {
28984
- constructor(starRenderContribitions) {
28994
+ constructor(graphicRenderContributions) {
28985
28995
  super();
28986
- this.starRenderContribitions = starRenderContribitions;
28996
+ this.graphicRenderContributions = graphicRenderContributions;
28987
28997
  this.numberType = STAR_NUMBER_TYPE;
28988
28998
  this.builtinContributions = [defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution];
28989
- this.init(starRenderContribitions);
28999
+ this.init(graphicRenderContributions);
28990
29000
  }
28991
29001
  drawShape(star, context, x, y, drawContext, params, fillCb, strokeCb) {
28992
29002
  const starAttribute = getTheme(star, params === null || params === void 0 ? void 0 : params.theme).star;
@@ -29059,6 +29069,7 @@ function bindStarRenderModule({ bind }) {
29059
29069
  .inSingletonScope();
29060
29070
  bind(StarRender).toService(DefaultCanvasStarRender);
29061
29071
  bind(GraphicRender).toService(StarRender);
29072
+ bindContributionProvider(bind, StarRenderContribution);
29062
29073
  }
29063
29074
  const starModule = bindStarRenderModule;
29064
29075
 
@@ -29104,7 +29115,10 @@ function bindGlyphRenderModule({ bind }) {
29104
29115
  if (isBindingContextLoaded(loadedGlyphModuleContexts, bind)) {
29105
29116
  return;
29106
29117
  }
29107
- bind(GlyphRender).to(DefaultCanvasGlyphRender).inSingletonScope();
29118
+ bind(DefaultCanvasGlyphRender)
29119
+ .toDynamicValue(() => new DefaultCanvasGlyphRender())
29120
+ .inSingletonScope();
29121
+ bind(GlyphRender).toService(DefaultCanvasGlyphRender);
29108
29122
  bind(GraphicRender).toService(GlyphRender);
29109
29123
  }
29110
29124
  const glyphModule = bindGlyphRenderModule;
@@ -29183,7 +29197,10 @@ function bindRichtextRenderModule({ bind }) {
29183
29197
  if (isBindingContextLoaded(loadedRichtextModuleContexts, bind)) {
29184
29198
  return;
29185
29199
  }
29186
- bind(RichTextRender).to(DefaultCanvasRichTextRender).inSingletonScope();
29200
+ bind(DefaultCanvasRichTextRender)
29201
+ .toDynamicValue(() => new DefaultCanvasRichTextRender())
29202
+ .inSingletonScope();
29203
+ bind(RichTextRender).toService(DefaultCanvasRichTextRender);
29187
29204
  bind(GraphicRender).toService(RichTextRender);
29188
29205
  }
29189
29206
  const richtextModule = bindRichtextRenderModule;
@@ -29193,7 +29210,9 @@ function bindImageRenderModule({ bind }) {
29193
29210
  if (isBindingContextLoaded(loadedImageModuleContexts, bind)) {
29194
29211
  return;
29195
29212
  }
29196
- bind(ImageRender).to(DefaultCanvasImageRender).inSingletonScope();
29213
+ bind(ImageRender)
29214
+ .toDynamicValue(({ container }) => new DefaultCanvasImageRender(createContributionProvider(ImageRenderContribution, container)))
29215
+ .inSingletonScope();
29197
29216
  bind(GraphicRender).toService(ImageRender);
29198
29217
  bind(ImageRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
29199
29218
  bindContributionProvider(bind, ImageRenderContribution);
@@ -29341,7 +29360,10 @@ function bindRect3dRenderModule({ bind }) {
29341
29360
  if (isBindingContextLoaded(loadedRect3dModuleContexts, bind)) {
29342
29361
  return;
29343
29362
  }
29344
- bind(Rect3DRender).to(DefaultCanvasRect3dRender).inSingletonScope();
29363
+ bind(DefaultCanvasRect3dRender)
29364
+ .toDynamicValue(() => new DefaultCanvasRect3dRender())
29365
+ .inSingletonScope();
29366
+ bind(Rect3DRender).toService(DefaultCanvasRect3dRender);
29345
29367
  bind(GraphicRender).toService(Rect3DRender);
29346
29368
  }
29347
29369
  const rect3dModule = bindRect3dRenderModule;
@@ -29540,7 +29562,10 @@ function bindArc3dRenderModule({ bind }) {
29540
29562
  if (isBindingContextLoaded(loadedArc3dModuleContexts, bind)) {
29541
29563
  return;
29542
29564
  }
29543
- bind(Arc3dRender).to(DefaultCanvasArc3DRender).inSingletonScope();
29565
+ bind(DefaultCanvasArc3DRender)
29566
+ .toDynamicValue(() => new DefaultCanvasArc3DRender())
29567
+ .inSingletonScope();
29568
+ bind(Arc3dRender).toService(DefaultCanvasArc3DRender);
29544
29569
  bind(GraphicRender).toService(Arc3dRender);
29545
29570
  }
29546
29571
  const arc3dModule = bindArc3dRenderModule;
@@ -29586,7 +29611,10 @@ function bindPyramid3dRenderModule({ bind }) {
29586
29611
  if (isBindingContextLoaded(loadedPyramid3dModuleContexts, bind)) {
29587
29612
  return;
29588
29613
  }
29589
- bind(Pyramid3dRender).to(DefaultCanvasPyramid3dRender).inSingletonScope();
29614
+ bind(DefaultCanvasPyramid3dRender)
29615
+ .toDynamicValue(() => new DefaultCanvasPyramid3dRender())
29616
+ .inSingletonScope();
29617
+ bind(Pyramid3dRender).toService(DefaultCanvasPyramid3dRender);
29590
29618
  bind(GraphicRender).toService(Pyramid3dRender);
29591
29619
  }
29592
29620
  const pyramid3dModule = bindPyramid3dRenderModule;