victory-core 37.0.3-next.0 → 37.1.0

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 (140) hide show
  1. package/CHANGELOG.md +5 -4
  2. package/dist/victory-core.js +25 -28
  3. package/dist/victory-core.min.js +1 -1
  4. package/es/index.d.ts +18 -18
  5. package/es/types/callbacks.d.ts +36 -36
  6. package/es/types/prop-types.d.ts +130 -130
  7. package/es/victory-accessible-group/victory-accessible-group.d.ts +10 -10
  8. package/es/victory-animation/util.d.ts +66 -66
  9. package/es/victory-animation/victory-animation.d.ts +34 -34
  10. package/es/victory-clip-container/victory-clip-container.d.ts +46 -46
  11. package/es/victory-container/victory-container.d.ts +62 -62
  12. package/es/victory-container/victory-container.js +2 -2
  13. package/es/victory-label/victory-label.d.ts +58 -58
  14. package/es/victory-portal/portal-context.d.ts +12 -12
  15. package/es/victory-portal/portal-context.js +0 -3
  16. package/es/victory-portal/portal-outlet.d.ts +11 -11
  17. package/es/victory-portal/portal-outlet.js +4 -6
  18. package/es/victory-portal/portal.d.ts +9 -9
  19. package/es/victory-portal/victory-portal.d.ts +9 -9
  20. package/es/victory-portal/victory-portal.js +16 -14
  21. package/es/victory-primitives/arc.d.ts +14 -14
  22. package/es/victory-primitives/background.d.ts +13 -13
  23. package/es/victory-primitives/border.d.ts +10 -10
  24. package/es/victory-primitives/circle.d.ts +3 -3
  25. package/es/victory-primitives/clip-path.d.ts +7 -7
  26. package/es/victory-primitives/index.d.ts +14 -14
  27. package/es/victory-primitives/line-segment.d.ts +11 -11
  28. package/es/victory-primitives/line.d.ts +3 -3
  29. package/es/victory-primitives/path.d.ts +3 -3
  30. package/es/victory-primitives/point.d.ts +13 -13
  31. package/es/victory-primitives/rect.d.ts +3 -3
  32. package/es/victory-primitives/text.d.ts +8 -8
  33. package/es/victory-primitives/tspan.d.ts +3 -3
  34. package/es/victory-primitives/types.d.ts +7 -7
  35. package/es/victory-primitives/whisker.d.ts +15 -15
  36. package/es/victory-theme/grayscale.d.ts +2 -2
  37. package/es/victory-theme/material.d.ts +2 -2
  38. package/es/victory-theme/types.d.ts +238 -238
  39. package/es/victory-theme/victory-theme.d.ts +5 -5
  40. package/es/victory-transition/victory-transition.d.ts +53 -53
  41. package/es/victory-util/add-events.d.ts +126 -126
  42. package/es/victory-util/axis.d.ts +50 -50
  43. package/es/victory-util/collection.d.ts +15 -15
  44. package/es/victory-util/common-props.d.ts +79 -79
  45. package/es/victory-util/data.d.ts +74 -74
  46. package/es/victory-util/default-transitions.d.ts +4 -4
  47. package/es/victory-util/domain.d.ts +90 -90
  48. package/es/victory-util/events.d.ts +64 -64
  49. package/es/victory-util/helpers.d.ts +96 -96
  50. package/es/victory-util/hooks/index.d.ts +2 -2
  51. package/es/victory-util/hooks/use-animation-state.d.ts +21 -21
  52. package/es/victory-util/hooks/use-previous-props.d.ts +1 -1
  53. package/es/victory-util/immutable.d.ts +11 -11
  54. package/es/victory-util/index.d.ts +27 -27
  55. package/es/victory-util/label-helpers.d.ts +26 -26
  56. package/es/victory-util/line-helpers.d.ts +4 -4
  57. package/es/victory-util/log.d.ts +1 -1
  58. package/es/victory-util/merge-refs.d.ts +12 -12
  59. package/es/victory-util/point-path-helpers.d.ts +9 -9
  60. package/es/victory-util/scale.d.ts +9 -9
  61. package/es/victory-util/selection.d.ts +28 -28
  62. package/es/victory-util/style.d.ts +18 -18
  63. package/es/victory-util/textsize.d.ts +35 -35
  64. package/es/victory-util/timer-context.d.ts +11 -11
  65. package/es/victory-util/timer.d.ts +16 -16
  66. package/es/victory-util/transitions.d.ts +48 -48
  67. package/es/victory-util/type-helpers.d.ts +9 -9
  68. package/es/victory-util/user-props.d.ts +26 -26
  69. package/es/victory-util/wrapper.d.ts +33 -33
  70. package/lib/index.d.ts +18 -18
  71. package/lib/types/callbacks.d.ts +36 -36
  72. package/lib/types/prop-types.d.ts +130 -130
  73. package/lib/victory-accessible-group/victory-accessible-group.d.ts +10 -10
  74. package/lib/victory-animation/util.d.ts +66 -66
  75. package/lib/victory-animation/victory-animation.d.ts +34 -34
  76. package/lib/victory-clip-container/victory-clip-container.d.ts +46 -46
  77. package/lib/victory-container/victory-container.d.ts +62 -62
  78. package/lib/victory-container/victory-container.js +2 -2
  79. package/lib/victory-label/victory-label.d.ts +58 -58
  80. package/lib/victory-portal/portal-context.d.ts +12 -12
  81. package/lib/victory-portal/portal-context.js +0 -3
  82. package/lib/victory-portal/portal-outlet.d.ts +11 -11
  83. package/lib/victory-portal/portal-outlet.js +4 -6
  84. package/lib/victory-portal/portal.d.ts +9 -9
  85. package/lib/victory-portal/victory-portal.d.ts +9 -9
  86. package/lib/victory-portal/victory-portal.js +16 -14
  87. package/lib/victory-primitives/arc.d.ts +14 -14
  88. package/lib/victory-primitives/background.d.ts +13 -13
  89. package/lib/victory-primitives/border.d.ts +10 -10
  90. package/lib/victory-primitives/circle.d.ts +3 -3
  91. package/lib/victory-primitives/clip-path.d.ts +7 -7
  92. package/lib/victory-primitives/index.d.ts +14 -14
  93. package/lib/victory-primitives/line-segment.d.ts +11 -11
  94. package/lib/victory-primitives/line.d.ts +3 -3
  95. package/lib/victory-primitives/path.d.ts +3 -3
  96. package/lib/victory-primitives/point.d.ts +13 -13
  97. package/lib/victory-primitives/rect.d.ts +3 -3
  98. package/lib/victory-primitives/text.d.ts +8 -8
  99. package/lib/victory-primitives/tspan.d.ts +3 -3
  100. package/lib/victory-primitives/types.d.ts +7 -7
  101. package/lib/victory-primitives/whisker.d.ts +15 -15
  102. package/lib/victory-theme/grayscale.d.ts +2 -2
  103. package/lib/victory-theme/material.d.ts +2 -2
  104. package/lib/victory-theme/types.d.ts +238 -238
  105. package/lib/victory-theme/victory-theme.d.ts +5 -5
  106. package/lib/victory-transition/victory-transition.d.ts +53 -53
  107. package/lib/victory-util/add-events.d.ts +126 -126
  108. package/lib/victory-util/axis.d.ts +50 -50
  109. package/lib/victory-util/collection.d.ts +15 -15
  110. package/lib/victory-util/common-props.d.ts +79 -79
  111. package/lib/victory-util/data.d.ts +74 -74
  112. package/lib/victory-util/default-transitions.d.ts +4 -4
  113. package/lib/victory-util/domain.d.ts +90 -90
  114. package/lib/victory-util/events.d.ts +64 -64
  115. package/lib/victory-util/helpers.d.ts +96 -96
  116. package/lib/victory-util/hooks/index.d.ts +2 -2
  117. package/lib/victory-util/hooks/use-animation-state.d.ts +21 -21
  118. package/lib/victory-util/hooks/use-previous-props.d.ts +1 -1
  119. package/lib/victory-util/immutable.d.ts +11 -11
  120. package/lib/victory-util/index.d.ts +27 -27
  121. package/lib/victory-util/label-helpers.d.ts +26 -26
  122. package/lib/victory-util/line-helpers.d.ts +4 -4
  123. package/lib/victory-util/log.d.ts +1 -1
  124. package/lib/victory-util/merge-refs.d.ts +12 -12
  125. package/lib/victory-util/point-path-helpers.d.ts +9 -9
  126. package/lib/victory-util/scale.d.ts +9 -9
  127. package/lib/victory-util/selection.d.ts +28 -28
  128. package/lib/victory-util/style.d.ts +18 -18
  129. package/lib/victory-util/textsize.d.ts +35 -35
  130. package/lib/victory-util/timer-context.d.ts +11 -11
  131. package/lib/victory-util/timer.d.ts +16 -16
  132. package/lib/victory-util/transitions.d.ts +48 -48
  133. package/lib/victory-util/type-helpers.d.ts +9 -9
  134. package/lib/victory-util/user-props.d.ts +26 -26
  135. package/lib/victory-util/wrapper.d.ts +33 -33
  136. package/package.json +5 -2
  137. package/src/victory-container/victory-container.tsx +18 -18
  138. package/src/victory-portal/portal-context.tsx +0 -6
  139. package/src/victory-portal/portal-outlet.tsx +4 -3
  140. package/src/victory-portal/victory-portal.tsx +19 -18
package/CHANGELOG.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # victory-core
2
2
 
3
- ## 37.0.3-next.0
3
+ ## 37.1.0
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
+
7
+ - Refactor containers and portal to function components ([#2799](https://github.com/FormidableLabs/victory/pull/2799))
6
8
 
7
- - 65d02419f: Refactor containers and portal to function components
8
- - victory-vendor@37.0.3-next.0
9
+ * Pin all internal victory package versions ([#2876](https://github.com/FormidableLabs/victory/pull/2876))
9
10
 
10
11
  ## 37.0.2
11
12
 
@@ -635,9 +635,9 @@ __webpack_require__.r(__webpack_exports__);
635
635
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
636
636
  /* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "./victory-portal/portal.tsx");
637
637
  /* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/user-props */ "./victory-util/user-props.ts");
638
- /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util */ "./victory-util/merge-refs.ts");
638
+ /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "./victory-util/merge-refs.ts");
639
639
  /* harmony import */ var _victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-portal/portal-outlet */ "./victory-portal/portal-outlet.tsx");
640
- /* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-portal/portal-context */ "./victory-portal/portal-context.tsx");
640
+ /* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-portal/portal-context */ "./victory-portal/portal-context.tsx");
641
641
 
642
642
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
643
643
 
@@ -737,7 +737,7 @@ const VictoryContainer = initialProps => {
737
737
  };
738
738
  // eslint-disable-next-line react-hooks/exhaustive-deps
739
739
  }, []);
740
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_4__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
740
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
741
741
  className: className,
742
742
  style: {
743
743
  ...style,
@@ -750,8 +750,8 @@ const VictoryContainer = initialProps => {
750
750
  "data-ouia-component-id": ouiaId,
751
751
  "data-ouia-component-type": ouiaType,
752
752
  "data-ouia-safe": ouiaSafe,
753
- ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_5__.mergeRefs)([localContainerRef, containerRef])
754
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
753
+ ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
754
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
755
755
  width: width,
756
756
  height: height,
757
757
  tabIndex: tabIndex,
@@ -1312,9 +1312,6 @@ const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().
1312
1312
  PortalContext.displayName = "PortalContext";
1313
1313
  const usePortalContext = () => {
1314
1314
  const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
1315
- if (!context) {
1316
- throw new Error("`usePortalContext` must be used within a `<PortalProvider />`");
1317
- }
1318
1315
  return context;
1319
1316
  };
1320
1317
  const PortalProvider = _ref => {
@@ -1370,12 +1367,10 @@ const PortalOutlet = _ref => {
1370
1367
  ...props
1371
1368
  } = _ref;
1372
1369
  const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
1373
- const children = Array.from(portalContext.children.entries()).map(_ref2 => {
1374
- let [key, node] = _ref2;
1375
- return !node.key ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(node, {
1376
- key
1377
- }) : node;
1378
- });
1370
+ if (!portalContext) {
1371
+ return null;
1372
+ }
1373
+ const children = Array.from(portalContext.children.values());
1379
1374
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
1380
1375
  };
1381
1376
 
@@ -1441,26 +1436,28 @@ const VictoryPortal = initialProps => {
1441
1436
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
1442
1437
  _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
1443
1438
  }
1439
+ const children = Array.isArray(props.children) ? props.children[0] : props.children;
1440
+ const {
1441
+ groupComponent
1442
+ } = props;
1443
+ const childProps = children && children.props || {};
1444
+ const standardProps = childProps.groupComponent ? {
1445
+ groupComponent,
1446
+ standalone: false
1447
+ } : {};
1448
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
1449
+ key: childProps.key ?? id
1450
+ });
1451
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
1444
1452
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
1445
- const children = Array.isArray(props.children) ? props.children[0] : props.children;
1446
- const {
1447
- groupComponent
1448
- } = props;
1449
- const childProps = children && children.props || {};
1450
- const standardProps = childProps.groupComponent ? {
1451
- groupComponent,
1452
- standalone: false
1453
- } : {};
1454
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
1455
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
1456
- portalContext.addChild(id, child);
1453
+ portalContext?.addChild(id, child);
1457
1454
  // eslint-disable-next-line react-hooks/exhaustive-deps
1458
1455
  }, [props.children]);
1459
1456
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
1460
- return () => portalContext.removeChild(id);
1457
+ return () => portalContext?.removeChild(id);
1461
1458
  // eslint-disable-next-line react-hooks/exhaustive-deps
1462
1459
  }, []);
1463
- return null;
1460
+ return portalContext ? null : child;
1464
1461
  };
1465
1462
  VictoryPortal.role = "portal";
1466
1463