@visactor/vrender-core 1.1.0-alpha.22 → 1.1.0-alpha.24

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 (168) hide show
  1. package/cjs/canvas/constants.js +1 -2
  2. package/cjs/canvas/empty-context.js +2 -1
  3. package/cjs/common/Reflect-metadata.js +1 -1
  4. package/cjs/common/bezier-utils.js +1 -1
  5. package/cjs/common/bounds-context.js +1 -1
  6. package/cjs/common/canvas-utils.js +1 -1
  7. package/cjs/common/color-utils.js +1 -1
  8. package/cjs/common/contribution-provider.js +1 -1
  9. package/cjs/common/custom-path2d.js +1 -1
  10. package/cjs/common/diff.js +1 -1
  11. package/cjs/common/enums.js +1 -1
  12. package/cjs/common/event-listener-manager.js +1 -1
  13. package/cjs/common/event-transformer.js +1 -2
  14. package/cjs/common/explicit-binding.js +1 -1
  15. package/cjs/common/generator.js +1 -1
  16. package/cjs/common/matrix.js +1 -1
  17. package/cjs/common/module-guard.d.ts +1 -0
  18. package/cjs/common/module-guard.js +11 -0
  19. package/cjs/common/module-guard.js.map +1 -0
  20. package/cjs/common/morphing-utils.js +1 -1
  21. package/cjs/common/path-svg.js +1 -1
  22. package/cjs/common/performance-raf.js +1 -1
  23. package/cjs/entries/app-context.js +1 -1
  24. package/cjs/entries/browser.js +1 -1
  25. package/cjs/entries/index.js +1 -1
  26. package/cjs/entries/miniapp.js +1 -1
  27. package/cjs/entries/node.js +1 -1
  28. package/cjs/entries/runtime-installer.js +1 -1
  29. package/cjs/entries/types.js +1 -1
  30. package/cjs/event/constant.js +1 -1
  31. package/cjs/event/event-manager.js +1 -1
  32. package/cjs/event/event-system.js +1 -1
  33. package/cjs/event/event-target.js +1 -1
  34. package/cjs/event/index.js +2 -1
  35. package/cjs/event/util.js +1 -1
  36. package/cjs/factory/graphic-factory.js +1 -1
  37. package/cjs/factory/index.js +1 -1
  38. package/cjs/factory/layer-factory.js +1 -1
  39. package/cjs/factory/stage-factory.js +1 -1
  40. package/cjs/factory/types.js +1 -1
  41. package/cjs/graphic/arc.js +6 -4
  42. package/cjs/graphic/arc.js.map +1 -1
  43. package/cjs/graphic/config.js +1 -0
  44. package/cjs/graphic/config.js.map +1 -1
  45. package/cjs/graphic/graphic.d.ts +1 -0
  46. package/cjs/graphic/graphic.js +10 -3
  47. package/cjs/graphic/graphic.js.map +1 -1
  48. package/cjs/interface/global.d.ts +8 -4
  49. package/cjs/interface/global.js.map +1 -1
  50. package/cjs/interface/graphic/arc.d.ts +1 -0
  51. package/cjs/interface/graphic/arc.js.map +1 -1
  52. package/cjs/render/contributions/render/arc-module.js +2 -4
  53. package/cjs/render/contributions/render/arc-module.js.map +1 -1
  54. package/cjs/render/contributions/render/arc3d-module.js +2 -4
  55. package/cjs/render/contributions/render/arc3d-module.js.map +1 -1
  56. package/cjs/render/contributions/render/area-module.js +2 -4
  57. package/cjs/render/contributions/render/area-module.js.map +1 -1
  58. package/cjs/render/contributions/render/circle-module.js +2 -4
  59. package/cjs/render/contributions/render/circle-module.js.map +1 -1
  60. package/cjs/render/contributions/render/glyph-module.js +2 -4
  61. package/cjs/render/contributions/render/glyph-module.js.map +1 -1
  62. package/cjs/render/contributions/render/image-module.js +2 -4
  63. package/cjs/render/contributions/render/image-module.js.map +1 -1
  64. package/cjs/render/contributions/render/line-module.js +2 -4
  65. package/cjs/render/contributions/render/line-module.js.map +1 -1
  66. package/cjs/render/contributions/render/path-module.js +2 -4
  67. package/cjs/render/contributions/render/path-module.js.map +1 -1
  68. package/cjs/render/contributions/render/polygon-module.js +2 -4
  69. package/cjs/render/contributions/render/polygon-module.js.map +1 -1
  70. package/cjs/render/contributions/render/pyramid3d-module.js +2 -4
  71. package/cjs/render/contributions/render/pyramid3d-module.js.map +1 -1
  72. package/cjs/render/contributions/render/rect-module.js +2 -4
  73. package/cjs/render/contributions/render/rect-module.js.map +1 -1
  74. package/cjs/render/contributions/render/rect3d-module.js +2 -4
  75. package/cjs/render/contributions/render/rect3d-module.js.map +1 -1
  76. package/cjs/render/contributions/render/richtext-module.js +2 -4
  77. package/cjs/render/contributions/render/richtext-module.js.map +1 -1
  78. package/cjs/render/contributions/render/star-module.js +2 -4
  79. package/cjs/render/contributions/render/star-module.js.map +1 -1
  80. package/cjs/render/contributions/render/symbol-module.js +2 -4
  81. package/cjs/render/contributions/render/symbol-module.js.map +1 -1
  82. package/cjs/render/contributions/render/text-module.js +2 -4
  83. package/cjs/render/contributions/render/text-module.js.map +1 -1
  84. package/dist/index.es.js +62 -52
  85. package/es/canvas/constants.js +1 -2
  86. package/es/canvas/empty-context.js +2 -1
  87. package/es/common/Reflect-metadata.js +1 -1
  88. package/es/common/bezier-utils.js +1 -1
  89. package/es/common/bounds-context.js +1 -1
  90. package/es/common/canvas-utils.js +1 -1
  91. package/es/common/color-utils.js +1 -1
  92. package/es/common/contribution-provider.js +1 -1
  93. package/es/common/custom-path2d.js +1 -1
  94. package/es/common/diff.js +1 -1
  95. package/es/common/enums.js +1 -1
  96. package/es/common/event-listener-manager.js +1 -1
  97. package/es/common/event-transformer.js +1 -2
  98. package/es/common/explicit-binding.js +1 -1
  99. package/es/common/generator.js +1 -1
  100. package/es/common/matrix.js +1 -1
  101. package/es/common/module-guard.d.ts +1 -0
  102. package/es/common/module-guard.js +5 -0
  103. package/es/common/module-guard.js.map +1 -0
  104. package/es/common/morphing-utils.js +1 -1
  105. package/es/common/path-svg.js +1 -1
  106. package/es/common/performance-raf.js +1 -1
  107. package/es/entries/app-context.js +1 -1
  108. package/es/entries/browser.js +1 -1
  109. package/es/entries/index.js +1 -1
  110. package/es/entries/miniapp.js +1 -1
  111. package/es/entries/node.js +1 -1
  112. package/es/entries/runtime-installer.js +1 -1
  113. package/es/entries/types.js +1 -1
  114. package/es/event/constant.js +1 -1
  115. package/es/event/event-manager.js +1 -1
  116. package/es/event/event-system.js +1 -1
  117. package/es/event/event-target.js +1 -1
  118. package/es/event/index.js +2 -1
  119. package/es/event/util.js +1 -1
  120. package/es/factory/graphic-factory.js +1 -1
  121. package/es/factory/index.js +1 -1
  122. package/es/factory/layer-factory.js +1 -1
  123. package/es/factory/stage-factory.js +1 -1
  124. package/es/factory/types.js +1 -1
  125. package/es/graphic/arc.js +5 -4
  126. package/es/graphic/arc.js.map +1 -1
  127. package/es/graphic/config.js +1 -0
  128. package/es/graphic/config.js.map +1 -1
  129. package/es/graphic/graphic.d.ts +1 -0
  130. package/es/graphic/graphic.js +10 -3
  131. package/es/graphic/graphic.js.map +1 -1
  132. package/es/interface/global.d.ts +8 -4
  133. package/es/interface/global.js.map +1 -1
  134. package/es/interface/graphic/arc.d.ts +1 -0
  135. package/es/interface/graphic/arc.js.map +1 -1
  136. package/es/render/contributions/render/arc-module.js +4 -2
  137. package/es/render/contributions/render/arc-module.js.map +1 -1
  138. package/es/render/contributions/render/arc3d-module.js +4 -2
  139. package/es/render/contributions/render/arc3d-module.js.map +1 -1
  140. package/es/render/contributions/render/area-module.js +4 -2
  141. package/es/render/contributions/render/area-module.js.map +1 -1
  142. package/es/render/contributions/render/circle-module.js +4 -2
  143. package/es/render/contributions/render/circle-module.js.map +1 -1
  144. package/es/render/contributions/render/glyph-module.js +4 -2
  145. package/es/render/contributions/render/glyph-module.js.map +1 -1
  146. package/es/render/contributions/render/image-module.js +4 -2
  147. package/es/render/contributions/render/image-module.js.map +1 -1
  148. package/es/render/contributions/render/line-module.js +4 -2
  149. package/es/render/contributions/render/line-module.js.map +1 -1
  150. package/es/render/contributions/render/path-module.js +4 -2
  151. package/es/render/contributions/render/path-module.js.map +1 -1
  152. package/es/render/contributions/render/polygon-module.js +4 -2
  153. package/es/render/contributions/render/polygon-module.js.map +1 -1
  154. package/es/render/contributions/render/pyramid3d-module.js +4 -2
  155. package/es/render/contributions/render/pyramid3d-module.js.map +1 -1
  156. package/es/render/contributions/render/rect-module.js +4 -2
  157. package/es/render/contributions/render/rect-module.js.map +1 -1
  158. package/es/render/contributions/render/rect3d-module.js +4 -2
  159. package/es/render/contributions/render/rect3d-module.js.map +1 -1
  160. package/es/render/contributions/render/richtext-module.js +4 -2
  161. package/es/render/contributions/render/richtext-module.js.map +1 -1
  162. package/es/render/contributions/render/star-module.js +4 -2
  163. package/es/render/contributions/render/star-module.js.map +1 -1
  164. package/es/render/contributions/render/symbol-module.js +4 -2
  165. package/es/render/contributions/render/symbol-module.js.map +1 -1
  166. package/es/render/contributions/render/text-module.js +4 -2
  167. package/es/render/contributions/render/text-module.js.map +1 -1
  168. package/package.json +3 -3
package/dist/index.es.js CHANGED
@@ -4759,7 +4759,7 @@ function addAttributeToPrototype(obj, c, keys) {
4759
4759
  function rewriteProto(obj, c) {
4760
4760
  Object.setPrototypeOf(obj, c);
4761
4761
  }
4762
- const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), { startAngle: 0, endAngle: pi2, innerRadius: 0, outerRadius: 1, innerPadding: 0, outerPadding: 0, cornerRadius: 0, padRadius: 0, padAngle: 0, cap: false, forceShowCap: false });
4762
+ const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), { startAngle: 0, endAngle: pi2, innerRadius: 0, outerRadius: 1, innerPadding: 0, outerPadding: 0, cornerRadius: 0, padRadius: 0, padAngle: 0, clipRange: 1, cap: false, forceShowCap: false });
4763
4763
  const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, closePath: false, curveTension: 1 });
4764
4764
  const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), { radius: 1, startAngle: 0, endAngle: pi2 });
4765
4765
  const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start', baseOpacity: 1, cornerType: 'round' });
@@ -10496,6 +10496,7 @@ const FULL_STATE_DEFINITION_KEYS = new Set([
10496
10496
  ]);
10497
10497
  const point = new Point();
10498
10498
  const EMPTY_STATE_NAMES = [];
10499
+ const deprecatedLocalStateFallbackWarningStateNames = new Set();
10499
10500
  const BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT |
10500
10501
  UpdateCategory.SHAPE |
10501
10502
  UpdateCategory.BOUNDS |
@@ -10779,6 +10780,17 @@ class Graphic extends Node {
10779
10780
  }
10780
10781
  return (_b = this.localFallbackVersion) !== null && _b !== void 0 ? _b : 0;
10781
10782
  }
10783
+ warnDeprecatedLocalStatesFallback(stateNames) {
10784
+ for (let index = 0; index < stateNames.length; index++) {
10785
+ const stateName = stateNames[index];
10786
+ if (deprecatedLocalStateFallbackWarningStateNames.has(stateName)) {
10787
+ continue;
10788
+ }
10789
+ deprecatedLocalStateFallbackWarningStateNames.add(stateName);
10790
+ console.warn(`[VRender] graphic.states fallback for missing shared state definition "${stateName}" is deprecated. ` +
10791
+ 'Move the state definition to sharedStateDefinitions or use stateProxy for dynamic per-graphic styles.');
10792
+ }
10793
+ }
10782
10794
  resolveEffectiveCompiledDefinitions() {
10783
10795
  this.syncSharedStateScopeBindingFromTree(false);
10784
10796
  const boundScope = this.boundSharedStateScope;
@@ -10836,6 +10848,7 @@ class Graphic extends Node {
10836
10848
  stateProxyEligibility: sharedStateProxyEligibility
10837
10849
  };
10838
10850
  }
10851
+ this.warnDeprecatedLocalStatesFallback(missingStateNames);
10839
10852
  const localStatesVersion = this.getLocalStatesVersion();
10840
10853
  const stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join('|')}` : 'none';
10841
10854
  const cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
@@ -16674,6 +16687,7 @@ const ARC_UPDATE_TAG_KEY = [
16674
16687
  'cornerRadius',
16675
16688
  'padAngle',
16676
16689
  'padRadius',
16690
+ 'clipRange',
16677
16691
  'cap',
16678
16692
  ...GRAPHIC_UPDATE_TAG_KEY
16679
16693
  ];
@@ -16726,12 +16740,13 @@ class Arc extends Graphic {
16726
16740
  getParsedAngle() {
16727
16741
  const arcTheme = this.getGraphicTheme();
16728
16742
  let { startAngle = arcTheme.startAngle, endAngle = arcTheme.endAngle } = this.attribute;
16729
- const { cap = arcTheme.cap } = this.attribute;
16743
+ const { cap = arcTheme.cap, clipRange = arcTheme.clipRange } = this.attribute;
16730
16744
  const sign = endAngle - startAngle >= 0 ? 1 : -1;
16731
- const deltaAngle = endAngle - startAngle;
16745
+ let deltaAngle = endAngle - startAngle;
16746
+ deltaAngle *= Math.max(0, Math.min(clipRange, 1));
16732
16747
  startAngle = clampAngleByRadian(startAngle);
16733
16748
  endAngle = startAngle + deltaAngle;
16734
- if (cap && abs(deltaAngle) < pi2 - epsilon) {
16749
+ if (cap && abs(deltaAngle) > epsilon && abs(deltaAngle) < pi2 - epsilon) {
16735
16750
  let startCap = 1;
16736
16751
  let endCap = 1;
16737
16752
  if (cap.length) {
@@ -30149,12 +30164,22 @@ function resolveContainerBinding(container, serviceIdentifier) {
30149
30164
  return instance;
30150
30165
  }
30151
30166
 
30152
- let loadArcModule = false;
30167
+ function isBindingContextLoaded(loadedContexts, context) {
30168
+ const key = (typeof context === 'object' && context !== null) || typeof context === 'function'
30169
+ ? context
30170
+ : loadedContexts;
30171
+ if (loadedContexts.has(key)) {
30172
+ return true;
30173
+ }
30174
+ loadedContexts.add(key);
30175
+ return false;
30176
+ }
30177
+
30178
+ const loadedArcModuleContexts = new WeakSet();
30153
30179
  function bindArcRenderModule({ bind }) {
30154
- if (loadArcModule) {
30180
+ if (isBindingContextLoaded(loadedArcModuleContexts, bind)) {
30155
30181
  return;
30156
30182
  }
30157
- loadArcModule = true;
30158
30183
  bind(DefaultCanvasArcRender).toSelf().inSingletonScope();
30159
30184
  bind(ArcRender).to(DefaultCanvasArcRender).inSingletonScope();
30160
30185
  bind(GraphicRender).toService(ArcRender);
@@ -30163,12 +30188,11 @@ function bindArcRenderModule({ bind }) {
30163
30188
  }
30164
30189
  const arcModule = bindArcRenderModule;
30165
30190
 
30166
- let loadRectModule = false;
30191
+ const loadedRectModuleContexts = new WeakSet();
30167
30192
  function bindRectRenderModule({ bind }) {
30168
- if (loadRectModule) {
30193
+ if (isBindingContextLoaded(loadedRectModuleContexts, bind)) {
30169
30194
  return;
30170
30195
  }
30171
- loadRectModule = true;
30172
30196
  bind(DefaultCanvasRectRender)
30173
30197
  .toDynamicValue(({ container }) => new DefaultCanvasRectRender(createContributionProvider(RectRenderContribution, container)))
30174
30198
  .inSingletonScope();
@@ -30183,12 +30207,11 @@ function bindRectRenderModule({ bind }) {
30183
30207
  }
30184
30208
  const rectModule = bindRectRenderModule;
30185
30209
 
30186
- let loadLineModule = false;
30210
+ const loadedLineModuleContexts = new WeakSet();
30187
30211
  function bindLineRenderModule({ bind }) {
30188
- if (loadLineModule) {
30212
+ if (isBindingContextLoaded(loadedLineModuleContexts, bind)) {
30189
30213
  return;
30190
30214
  }
30191
- loadLineModule = true;
30192
30215
  bind(DefaultCanvasLineRender).toSelf().inSingletonScope();
30193
30216
  bind(DefaultIncrementalCanvasLineRender).toSelf().inSingletonScope();
30194
30217
  bind(LineRender).to(DefaultCanvasLineRender).inSingletonScope();
@@ -30196,12 +30219,11 @@ function bindLineRenderModule({ bind }) {
30196
30219
  }
30197
30220
  const lineModule = bindLineRenderModule;
30198
30221
 
30199
- let loadAreaModule = false;
30222
+ const loadedAreaModuleContexts = new WeakSet();
30200
30223
  function bindAreaRenderModule({ bind }) {
30201
- if (loadAreaModule) {
30224
+ if (isBindingContextLoaded(loadedAreaModuleContexts, bind)) {
30202
30225
  return;
30203
30226
  }
30204
- loadAreaModule = true;
30205
30227
  bind(DefaultCanvasAreaRender).toSelf().inSingletonScope();
30206
30228
  bind(AreaRender).to(DefaultCanvasAreaRender).inSingletonScope();
30207
30229
  bind(GraphicRender).toService(AreaRender);
@@ -30211,12 +30233,11 @@ function bindAreaRenderModule({ bind }) {
30211
30233
  }
30212
30234
  const areaModule = bindAreaRenderModule;
30213
30235
 
30214
- let loadSymbolModule = false;
30236
+ const loadedSymbolModuleContexts = new WeakSet();
30215
30237
  function bindSymbolRenderModule({ bind }) {
30216
- if (loadSymbolModule) {
30238
+ if (isBindingContextLoaded(loadedSymbolModuleContexts, bind)) {
30217
30239
  return;
30218
30240
  }
30219
- loadSymbolModule = true;
30220
30241
  bind(DefaultCanvasSymbolRender).toSelf().inSingletonScope();
30221
30242
  bind(SymbolRender).to(DefaultCanvasSymbolRender).inSingletonScope();
30222
30243
  bind(GraphicRender).toService(SymbolRender);
@@ -30225,12 +30246,11 @@ function bindSymbolRenderModule({ bind }) {
30225
30246
  }
30226
30247
  const symbolModule = bindSymbolRenderModule;
30227
30248
 
30228
- let loadCircleModule = false;
30249
+ const loadedCircleModuleContexts = new WeakSet();
30229
30250
  function bindCircleRenderModule({ bind }) {
30230
- if (loadCircleModule) {
30251
+ if (isBindingContextLoaded(loadedCircleModuleContexts, bind)) {
30231
30252
  return;
30232
30253
  }
30233
- loadCircleModule = true;
30234
30254
  bind(DefaultCanvasCircleRender).toSelf().inSingletonScope();
30235
30255
  bind(CircleRender).to(DefaultCanvasCircleRender).inSingletonScope();
30236
30256
  bind(GraphicRender).toService(CircleRender);
@@ -30239,12 +30259,11 @@ function bindCircleRenderModule({ bind }) {
30239
30259
  }
30240
30260
  const circleModule = bindCircleRenderModule;
30241
30261
 
30242
- let loadTextModule = false;
30262
+ const loadedTextModuleContexts = new WeakSet();
30243
30263
  function bindTextRenderModule({ bind }) {
30244
- if (loadTextModule) {
30264
+ if (isBindingContextLoaded(loadedTextModuleContexts, bind)) {
30245
30265
  return;
30246
30266
  }
30247
- loadTextModule = true;
30248
30267
  bind(TextRender).to(DefaultCanvasTextRender).inSingletonScope();
30249
30268
  bind(GraphicRender).toService(TextRender);
30250
30269
  bind(TextRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
@@ -30252,12 +30271,11 @@ function bindTextRenderModule({ bind }) {
30252
30271
  }
30253
30272
  const textModule = bindTextRenderModule;
30254
30273
 
30255
- let loadPathModule = false;
30274
+ const loadedPathModuleContexts = new WeakSet();
30256
30275
  function bindPathRenderModule({ bind }) {
30257
- if (loadPathModule) {
30276
+ if (isBindingContextLoaded(loadedPathModuleContexts, bind)) {
30258
30277
  return;
30259
30278
  }
30260
- loadPathModule = true;
30261
30279
  bind(DefaultCanvasPathRender).toSelf().inSingletonScope();
30262
30280
  bind(PathRender).to(DefaultCanvasPathRender).inSingletonScope();
30263
30281
  bind(GraphicRender).toService(PathRender);
@@ -30266,12 +30284,11 @@ function bindPathRenderModule({ bind }) {
30266
30284
  }
30267
30285
  const pathModule = bindPathRenderModule;
30268
30286
 
30269
- let loadPolygonModule = false;
30287
+ const loadedPolygonModuleContexts = new WeakSet();
30270
30288
  function bindPolygonRenderModule({ bind }) {
30271
- if (loadPolygonModule) {
30289
+ if (isBindingContextLoaded(loadedPolygonModuleContexts, bind)) {
30272
30290
  return;
30273
30291
  }
30274
- loadPolygonModule = true;
30275
30292
  bind(PolygonRender).to(DefaultCanvasPolygonRender).inSingletonScope();
30276
30293
  bind(GraphicRender).toService(PolygonRender);
30277
30294
  bind(PolygonRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
@@ -30348,12 +30365,11 @@ class DefaultCanvasStarRender extends BaseRender {
30348
30365
  }
30349
30366
  }
30350
30367
 
30351
- let loadStarModule = false;
30368
+ const loadedStarModuleContexts = new WeakSet();
30352
30369
  function bindStarRenderModule({ bind }) {
30353
- if (loadStarModule) {
30370
+ if (isBindingContextLoaded(loadedStarModuleContexts, bind)) {
30354
30371
  return;
30355
30372
  }
30356
- loadStarModule = true;
30357
30373
  bind(DefaultCanvasStarRender)
30358
30374
  .toDynamicValue(({ container }) => new DefaultCanvasStarRender(createContributionProvider(StarRenderContribution, container)))
30359
30375
  .inSingletonScope();
@@ -30399,12 +30415,11 @@ class DefaultCanvasGlyphRender {
30399
30415
  }
30400
30416
  }
30401
30417
 
30402
- let loadGlyphModule = false;
30418
+ const loadedGlyphModuleContexts = new WeakSet();
30403
30419
  function bindGlyphRenderModule({ bind }) {
30404
- if (loadGlyphModule) {
30420
+ if (isBindingContextLoaded(loadedGlyphModuleContexts, bind)) {
30405
30421
  return;
30406
30422
  }
30407
- loadGlyphModule = true;
30408
30423
  bind(GlyphRender).to(DefaultCanvasGlyphRender).inSingletonScope();
30409
30424
  bind(GraphicRender).toService(GlyphRender);
30410
30425
  }
@@ -30479,23 +30494,21 @@ class DefaultCanvasRichTextRender extends BaseRender {
30479
30494
  }
30480
30495
  }
30481
30496
 
30482
- let loadRichtextModule = false;
30497
+ const loadedRichtextModuleContexts = new WeakSet();
30483
30498
  function bindRichtextRenderModule({ bind }) {
30484
- if (loadRichtextModule) {
30499
+ if (isBindingContextLoaded(loadedRichtextModuleContexts, bind)) {
30485
30500
  return;
30486
30501
  }
30487
- loadRichtextModule = true;
30488
30502
  bind(RichTextRender).to(DefaultCanvasRichTextRender).inSingletonScope();
30489
30503
  bind(GraphicRender).toService(RichTextRender);
30490
30504
  }
30491
30505
  const richtextModule = bindRichtextRenderModule;
30492
30506
 
30493
- let loadImageModule = false;
30507
+ const loadedImageModuleContexts = new WeakSet();
30494
30508
  function bindImageRenderModule({ bind }) {
30495
- if (loadImageModule) {
30509
+ if (isBindingContextLoaded(loadedImageModuleContexts, bind)) {
30496
30510
  return;
30497
30511
  }
30498
- loadImageModule = true;
30499
30512
  bind(ImageRender).to(DefaultCanvasImageRender).inSingletonScope();
30500
30513
  bind(GraphicRender).toService(ImageRender);
30501
30514
  bind(ImageRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
@@ -30639,12 +30652,11 @@ class DefaultCanvasRect3dRender extends Base3dRender {
30639
30652
  }
30640
30653
  }
30641
30654
 
30642
- let loadRect3dModule = false;
30655
+ const loadedRect3dModuleContexts = new WeakSet();
30643
30656
  function bindRect3dRenderModule({ bind }) {
30644
- if (loadRect3dModule) {
30657
+ if (isBindingContextLoaded(loadedRect3dModuleContexts, bind)) {
30645
30658
  return;
30646
30659
  }
30647
- loadRect3dModule = true;
30648
30660
  bind(Rect3DRender).to(DefaultCanvasRect3dRender).inSingletonScope();
30649
30661
  bind(GraphicRender).toService(Rect3DRender);
30650
30662
  }
@@ -30839,12 +30851,11 @@ class DefaultCanvasArc3DRender extends BaseRender {
30839
30851
  }
30840
30852
  }
30841
30853
 
30842
- let loadArc3dModule = false;
30854
+ const loadedArc3dModuleContexts = new WeakSet();
30843
30855
  function bindArc3dRenderModule({ bind }) {
30844
- if (loadArc3dModule) {
30856
+ if (isBindingContextLoaded(loadedArc3dModuleContexts, bind)) {
30845
30857
  return;
30846
30858
  }
30847
- loadArc3dModule = true;
30848
30859
  bind(Arc3dRender).to(DefaultCanvasArc3DRender).inSingletonScope();
30849
30860
  bind(GraphicRender).toService(Arc3dRender);
30850
30861
  }
@@ -30886,12 +30897,11 @@ class DefaultCanvasPyramid3dRender extends Base3dRender {
30886
30897
  }
30887
30898
  }
30888
30899
 
30889
- let loadPyramid3dModule = false;
30900
+ const loadedPyramid3dModuleContexts = new WeakSet();
30890
30901
  function bindPyramid3dRenderModule({ bind }) {
30891
- if (loadPyramid3dModule) {
30902
+ if (isBindingContextLoaded(loadedPyramid3dModuleContexts, bind)) {
30892
30903
  return;
30893
30904
  }
30894
- loadPyramid3dModule = true;
30895
30905
  bind(Pyramid3dRender).to(DefaultCanvasPyramid3dRender).inSingletonScope();
30896
30906
  bind(GraphicRender).toService(Pyramid3dRender);
30897
30907
  }
@@ -1,4 +1,3 @@
1
1
  export const CanvasFactory = Symbol.for("CanvasFactory");
2
2
 
3
- export const Context2dFactory = Symbol.for("Context2dFactory");
4
- //# sourceMappingURL=constants.js.map
3
+ export const Context2dFactory = Symbol.for("Context2dFactory");
@@ -205,4 +205,5 @@ export class EmptyContext2d {
205
205
  release(...params) {
206
206
  this.stack.forEach((m => matrixAllocate.free(m))), this.stack.length = 0;
207
207
  }
208
- }
208
+ }
209
+ //# sourceMappingURL=empty-context.js.map
@@ -175,4 +175,4 @@ export default (function(Reflect) {
175
175
  }), previous && previous(key, value);
176
176
  })), Reflect;
177
177
  }({}));
178
- //# sourceMappingURL=Reflect-metadata.js.map
178
+ //# sourceMappingURL=Reflect-metadata.js.map
@@ -37,4 +37,4 @@ export function quadPointAt(p0, p1, p2, t) {
37
37
  export function quadLength(p0, p1, p2, iterationCount) {
38
38
  return snapLength([ p0.x, p1.x, p2.x ], [ p0.y, p1.y, p2.y ]);
39
39
  }
40
- //# sourceMappingURL=bezier-utils.js.map
40
+ //# sourceMappingURL=bezier-utils.js.map
@@ -50,4 +50,4 @@ export class BoundsContext {
50
50
  }
51
51
  release(...params) {}
52
52
  }
53
- //# sourceMappingURL=bounds-context.js.map
53
+ //# sourceMappingURL=bounds-context.js.map
@@ -52,4 +52,4 @@ function createConicGradient(context, color, x, y, w, h) {
52
52
  canvasGradient.addColorStop(stop.offset, stop.color);
53
53
  })), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
54
54
  }
55
- //# sourceMappingURL=canvas-utils.js.map
55
+ //# sourceMappingURL=canvas-utils.js.map
@@ -238,4 +238,4 @@ export class GradientParser {
238
238
  };
239
239
  }
240
240
  }
241
- //# sourceMappingURL=color-utils.js.map
241
+ //# sourceMappingURL=color-utils.js.map
@@ -40,4 +40,4 @@ export class ContributionStore {
40
40
  }
41
41
 
42
42
  ContributionStore.store = new Map;
43
- //# sourceMappingURL=contribution-provider.js.map
43
+ //# sourceMappingURL=contribution-provider.js.map
@@ -373,4 +373,4 @@ function scale(current, sX, sY) {
373
373
  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];
374
374
  return temp;
375
375
  }
376
- //# sourceMappingURL=custom-path2d.js.map
376
+ //# sourceMappingURL=custom-path2d.js.map
package/es/common/diff.js CHANGED
@@ -9,4 +9,4 @@ export function diff(oldAttrs, newAttrs, getAttr) {
9
9
  }
10
10
  return diffObj;
11
11
  }
12
- //# sourceMappingURL=diff.js.map
12
+ //# sourceMappingURL=diff.js.map
@@ -51,4 +51,4 @@ export var BaseRenderContributionTime;
51
51
  BaseRenderContributionTime[BaseRenderContributionTime.beforeFillStroke = 0] = "beforeFillStroke",
52
52
  BaseRenderContributionTime[BaseRenderContributionTime.afterFillStroke = 1] = "afterFillStroke";
53
53
  }(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
54
- //# sourceMappingURL=enums.js.map
54
+ //# sourceMappingURL=enums.js.map
@@ -71,4 +71,4 @@ export class EventListenerManager {
71
71
  throw new Error("_nativeDispatchEvent must be implemented by derived classes");
72
72
  }
73
73
  }
74
- //# sourceMappingURL=event-listener-manager.js.map
74
+ //# sourceMappingURL=event-listener-manager.js.map
@@ -113,5 +113,4 @@ export function mapToCanvasPointForCanvas(nativeEvent) {
113
113
  x: nativeEvent._canvasX || 0,
114
114
  y: nativeEvent._canvasY || 0
115
115
  };
116
- }
117
- //# sourceMappingURL=event-transformer.js.map
116
+ }
@@ -7,4 +7,4 @@ export function resolveContainerBinding(container, serviceIdentifier) {
7
7
  if (null == instance) throw new Error(`No binding found for ${describeServiceIdentifier(serviceIdentifier)}.`);
8
8
  return instance;
9
9
  }
10
- //# sourceMappingURL=explicit-binding.js.map
10
+ //# sourceMappingURL=explicit-binding.js.map
@@ -5,4 +5,4 @@ export class Generator {
5
5
  }
6
6
 
7
7
  Generator.auto_increment_id = 0;
8
- //# sourceMappingURL=generator.js.map
8
+ //# sourceMappingURL=generator.js.map
@@ -118,4 +118,4 @@ export function transformMat4(out, a, m) {
118
118
  return w = w || 1, out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w, out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w,
119
119
  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w, out;
120
120
  }
121
- //# sourceMappingURL=matrix.js.map
121
+ //# sourceMappingURL=matrix.js.map
@@ -0,0 +1 @@
1
+ export declare function isBindingContextLoaded(loadedContexts: WeakSet<object>, context: unknown): boolean;
@@ -0,0 +1,5 @@
1
+ export function isBindingContextLoaded(loadedContexts, context) {
2
+ const key = "object" == typeof context && null !== context || "function" == typeof context ? context : loadedContexts;
3
+ return !!loadedContexts.has(key) || (loadedContexts.add(key), !1);
4
+ }
5
+ //# sourceMappingURL=module-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/common/module-guard.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,sBAAsB,CAAC,cAA+B,EAAE,OAAgB;IACtF,MAAM,GAAG,GACP,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,IAAI,OAAO,OAAO,KAAK,UAAU;QAChF,CAAC,CAAE,OAAkB;QACrB,CAAC,CAAC,cAAc,CAAC;IAErB,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAC;KACb;IAED,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,OAAO,KAAK,CAAC;AACf,CAAC","file":"module-guard.js","sourcesContent":["export function isBindingContextLoaded(loadedContexts: WeakSet<object>, context: unknown): boolean {\n const key =\n (typeof context === 'object' && context !== null) || typeof context === 'function'\n ? (context as object)\n : loadedContexts;\n\n if (loadedContexts.has(key)) {\n return true;\n }\n\n loadedContexts.add(key);\n return false;\n}\n"]}
@@ -189,4 +189,4 @@ export function bezierCurversToPath(bezierCurves) {
189
189
  }
190
190
  return path;
191
191
  }
192
- //# sourceMappingURL=morphing-utils.js.map
192
+ //# sourceMappingURL=morphing-utils.js.map
@@ -55,4 +55,4 @@ export function parseSvgPath(str) {
55
55
  } else result.push(currCommandData);
56
56
  return result;
57
57
  }
58
- //# sourceMappingURL=path-svg.js.map
58
+ //# sourceMappingURL=path-svg.js.map
@@ -26,4 +26,4 @@ export class PerformanceRAF {
26
26
  }));
27
27
  }
28
28
  }
29
- //# sourceMappingURL=performance-raf.js.map
29
+ //# sourceMappingURL=performance-raf.js.map
@@ -83,4 +83,4 @@ export class AppContext {
83
83
  };
84
84
  }
85
85
  }
86
- //# sourceMappingURL=app-context.js.map
86
+ //# sourceMappingURL=app-context.js.map
@@ -33,4 +33,4 @@ export class BrowserEntry {
33
33
  export function createBrowserApp(options = {}) {
34
34
  return new BrowserEntry(options);
35
35
  }
36
- //# sourceMappingURL=browser.js.map
36
+ //# sourceMappingURL=browser.js.map
@@ -11,4 +11,4 @@ export * from "./miniapp";
11
11
  export * from "./runtime-installer";
12
12
 
13
13
  export { createBrowserApp as createApp } from "./browser";
14
- //# sourceMappingURL=index.js.map
14
+ //# sourceMappingURL=index.js.map
@@ -9,4 +9,4 @@ export class MiniappEntry extends BrowserEntry {
9
9
  export function createMiniappApp(options = {}) {
10
10
  return new MiniappEntry(options);
11
11
  }
12
- //# sourceMappingURL=miniapp.js.map
12
+ //# sourceMappingURL=miniapp.js.map
@@ -9,4 +9,4 @@ export class NodeEntry extends BrowserEntry {
9
9
  export function createNodeApp(options = {}) {
10
10
  return new NodeEntry(options);
11
11
  }
12
- //# sourceMappingURL=node.js.map
12
+ //# sourceMappingURL=node.js.map
@@ -127,4 +127,4 @@ export function installRuntimePickersToApp(app, serviceIdentifier) {
127
127
  const pickers = bindingContext.getAll(serviceIdentifier);
128
128
  app.registry.picker.clear(), registerRuntimeEntries(((key, picker) => app.registry.picker.register(key, picker)), pickers, "runtime-picker");
129
129
  }
130
- //# sourceMappingURL=runtime-installer.js.map
130
+ //# sourceMappingURL=runtime-installer.js.map
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -1,2 +1,2 @@
1
1
  export const WILDCARD = "*";
2
- //# sourceMappingURL=constant.js.map
2
+ //# sourceMappingURL=constant.js.map
@@ -299,4 +299,4 @@ export class EventManager {
299
299
  this.mappingTable = null, this.mappingState = null, this.cursorTarget = null;
300
300
  }
301
301
  }
302
- //# sourceMappingURL=event-manager.js.map
302
+ //# sourceMappingURL=event-manager.js.map
@@ -212,4 +212,4 @@ export class EventSystem {
212
212
  this.manager.pauseNotify = !1;
213
213
  }
214
214
  }
215
- //# sourceMappingURL=event-system.js.map
215
+ //# sourceMappingURL=event-system.js.map
@@ -12,4 +12,4 @@ export const EventTarget = {
12
12
  return this.dispatchEvent(new CustomEvent(eventName, object));
13
13
  }
14
14
  };
15
- //# sourceMappingURL=event-target.js.map
15
+ //# sourceMappingURL=event-target.js.map
package/es/event/index.js CHANGED
@@ -10,4 +10,5 @@ export * from "../interface/event";
10
10
 
11
11
  export * from "./util";
12
12
 
13
- export * from "./constant";
13
+ export * from "./constant";
14
+ //# sourceMappingURL=index.js.map
package/es/event/util.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const clock = "object" == typeof performance && performance.now ? performance : Date;
2
- //# sourceMappingURL=util.js.map
2
+ //# sourceMappingURL=util.js.map
@@ -12,4 +12,4 @@ export class GraphicFactory {
12
12
  this.registry.set(type, ctor);
13
13
  }
14
14
  }
15
- //# sourceMappingURL=graphic-factory.js.map
15
+ //# sourceMappingURL=graphic-factory.js.map
@@ -5,4 +5,4 @@ export * from "./stage-factory";
5
5
  export * from "./layer-factory";
6
6
 
7
7
  export * from "./graphic-factory";
8
- //# sourceMappingURL=index.js.map
8
+ //# sourceMappingURL=index.js.map
@@ -8,4 +8,4 @@ export class LayerFactory {
8
8
  return new this.LayerCtor(stage, global, window, params);
9
9
  }
10
10
  }
11
- //# sourceMappingURL=layer-factory.js.map
11
+ //# sourceMappingURL=layer-factory.js.map
@@ -9,4 +9,4 @@ export class StageFactory {
9
9
  return new this.StageCtor(params, null === (_a = this.depsFactory) || void 0 === _a ? void 0 : _a.call(this));
10
10
  }
11
11
  }
12
- //# sourceMappingURL=stage-factory.js.map
12
+ //# sourceMappingURL=stage-factory.js.map
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
package/es/graphic/arc.js CHANGED
@@ -14,7 +14,7 @@ import { ARC_NUMBER_TYPE } from "./constants";
14
14
 
15
15
  import { updateBoundsOfCommonOuterBorder } from "./graphic-service/common-outer-boder-bounds";
16
16
 
17
- const ARC_UPDATE_TAG_KEY = [ "innerRadius", "outerRadius", "startAngle", "endAngle", "cornerRadius", "padAngle", "padRadius", "cap", ...GRAPHIC_UPDATE_TAG_KEY ];
17
+ const ARC_UPDATE_TAG_KEY = [ "innerRadius", "outerRadius", "startAngle", "endAngle", "cornerRadius", "padAngle", "padRadius", "clipRange", "cap", ...GRAPHIC_UPDATE_TAG_KEY ];
18
18
 
19
19
  export class Arc extends Graphic {
20
20
  constructor(params) {
@@ -42,9 +42,10 @@ export class Arc extends Graphic {
42
42
  getParsedAngle() {
43
43
  const arcTheme = this.getGraphicTheme();
44
44
  let {startAngle: startAngle = arcTheme.startAngle, endAngle: endAngle = arcTheme.endAngle} = this.attribute;
45
- const {cap: cap = arcTheme.cap} = this.attribute, sign = endAngle - startAngle >= 0 ? 1 : -1, deltaAngle = endAngle - startAngle;
46
- if (startAngle = clampAngleByRadian(startAngle), endAngle = startAngle + deltaAngle,
47
- cap && abs(deltaAngle) < pi2 - epsilon) {
45
+ const {cap: cap = arcTheme.cap, clipRange: clipRange = arcTheme.clipRange} = this.attribute, sign = endAngle - startAngle >= 0 ? 1 : -1;
46
+ let deltaAngle = endAngle - startAngle;
47
+ if (deltaAngle *= Math.max(0, Math.min(clipRange, 1)), startAngle = clampAngleByRadian(startAngle),
48
+ endAngle = startAngle + deltaAngle, cap && abs(deltaAngle) > epsilon && abs(deltaAngle) < pi2 - epsilon) {
48
49
  let startCap = 1, endCap = 1;
49
50
  cap.length && (startCap = Number(cap[0]), endCap = Number(cap[1]));
50
51
  let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;