victory-area 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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,10 @@
1
1
  # victory-area
2
2
 
3
- ## 37.0.3-next.0
3
+ ## 37.1.0
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
6
 
7
- - Updated dependencies [65d02419f]
8
- - victory-core@37.0.3-next.0
9
- - victory-vendor@37.0.3-next.0
7
+ - Pin all internal victory package versions ([#2876](https://github.com/FormidableLabs/victory/pull/2876))
10
8
 
11
9
  ## 37.0.2
12
10
 
@@ -5445,9 +5445,9 @@ __webpack_require__.r(__webpack_exports__);
5445
5445
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
5446
5446
  /* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
5447
5447
  /* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
5448
- /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
5448
+ /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
5449
5449
  /* harmony import */ var _victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-portal/portal-outlet */ "../../victory-core/es/victory-portal/portal-outlet.js");
5450
- /* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
5450
+ /* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
5451
5451
 
5452
5452
  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); }
5453
5453
 
@@ -5547,7 +5547,7 @@ const VictoryContainer = initialProps => {
5547
5547
  };
5548
5548
  // eslint-disable-next-line react-hooks/exhaustive-deps
5549
5549
  }, []);
5550
- 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", {
5550
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
5551
5551
  className: className,
5552
5552
  style: {
5553
5553
  ...style,
@@ -5560,8 +5560,8 @@ const VictoryContainer = initialProps => {
5560
5560
  "data-ouia-component-id": ouiaId,
5561
5561
  "data-ouia-component-type": ouiaType,
5562
5562
  "data-ouia-safe": ouiaSafe,
5563
- ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_5__.mergeRefs)([localContainerRef, containerRef])
5564
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
5563
+ ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
5564
+ }, /*#__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({
5565
5565
  width: width,
5566
5566
  height: height,
5567
5567
  tabIndex: tabIndex,
@@ -6122,9 +6122,6 @@ const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().
6122
6122
  PortalContext.displayName = "PortalContext";
6123
6123
  const usePortalContext = () => {
6124
6124
  const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
6125
- if (!context) {
6126
- throw new Error("`usePortalContext` must be used within a `<PortalProvider />`");
6127
- }
6128
6125
  return context;
6129
6126
  };
6130
6127
  const PortalProvider = _ref => {
@@ -6180,12 +6177,10 @@ const PortalOutlet = _ref => {
6180
6177
  ...props
6181
6178
  } = _ref;
6182
6179
  const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
6183
- const children = Array.from(portalContext.children.entries()).map(_ref2 => {
6184
- let [key, node] = _ref2;
6185
- return !node.key ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(node, {
6186
- key
6187
- }) : node;
6188
- });
6180
+ if (!portalContext) {
6181
+ return null;
6182
+ }
6183
+ const children = Array.from(portalContext.children.values());
6189
6184
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
6190
6185
  };
6191
6186
 
@@ -6251,26 +6246,28 @@ const VictoryPortal = initialProps => {
6251
6246
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6252
6247
  _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6253
6248
  }
6249
+ const children = Array.isArray(props.children) ? props.children[0] : props.children;
6250
+ const {
6251
+ groupComponent
6252
+ } = props;
6253
+ const childProps = children && children.props || {};
6254
+ const standardProps = childProps.groupComponent ? {
6255
+ groupComponent,
6256
+ standalone: false
6257
+ } : {};
6258
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6259
+ key: childProps.key ?? id
6260
+ });
6261
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6254
6262
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6255
- const children = Array.isArray(props.children) ? props.children[0] : props.children;
6256
- const {
6257
- groupComponent
6258
- } = props;
6259
- const childProps = children && children.props || {};
6260
- const standardProps = childProps.groupComponent ? {
6261
- groupComponent,
6262
- standalone: false
6263
- } : {};
6264
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
6265
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6266
- portalContext.addChild(id, child);
6263
+ portalContext?.addChild(id, child);
6267
6264
  // eslint-disable-next-line react-hooks/exhaustive-deps
6268
6265
  }, [props.children]);
6269
6266
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6270
- return () => portalContext.removeChild(id);
6267
+ return () => portalContext?.removeChild(id);
6271
6268
  // eslint-disable-next-line react-hooks/exhaustive-deps
6272
6269
  }, []);
6273
- return null;
6270
+ return portalContext ? null : child;
6274
6271
  };
6275
6272
  VictoryPortal.role = "portal";
6276
6273