victory-scatter 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,11 +1,10 @@
1
1
  # victory-scatter
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
7
+ - Pin all internal victory package versions ([#2876](https://github.com/FormidableLabs/victory/pull/2876))
9
8
 
10
9
  ## 37.0.2
11
10
 
@@ -5103,9 +5103,9 @@ __webpack_require__.r(__webpack_exports__);
5103
5103
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
5104
5104
  /* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
5105
5105
  /* 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");
5106
- /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
5106
+ /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
5107
5107
  /* 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");
5108
- /* 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");
5108
+ /* 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");
5109
5109
 
5110
5110
  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); }
5111
5111
 
@@ -5205,7 +5205,7 @@ const VictoryContainer = initialProps => {
5205
5205
  };
5206
5206
  // eslint-disable-next-line react-hooks/exhaustive-deps
5207
5207
  }, []);
5208
- 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", {
5208
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
5209
5209
  className: className,
5210
5210
  style: {
5211
5211
  ...style,
@@ -5218,8 +5218,8 @@ const VictoryContainer = initialProps => {
5218
5218
  "data-ouia-component-id": ouiaId,
5219
5219
  "data-ouia-component-type": ouiaType,
5220
5220
  "data-ouia-safe": ouiaSafe,
5221
- ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_5__.mergeRefs)([localContainerRef, containerRef])
5222
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
5221
+ ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
5222
+ }, /*#__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({
5223
5223
  width: width,
5224
5224
  height: height,
5225
5225
  tabIndex: tabIndex,
@@ -5780,9 +5780,6 @@ const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().
5780
5780
  PortalContext.displayName = "PortalContext";
5781
5781
  const usePortalContext = () => {
5782
5782
  const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
5783
- if (!context) {
5784
- throw new Error("`usePortalContext` must be used within a `<PortalProvider />`");
5785
- }
5786
5783
  return context;
5787
5784
  };
5788
5785
  const PortalProvider = _ref => {
@@ -5838,12 +5835,10 @@ const PortalOutlet = _ref => {
5838
5835
  ...props
5839
5836
  } = _ref;
5840
5837
  const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
5841
- const children = Array.from(portalContext.children.entries()).map(_ref2 => {
5842
- let [key, node] = _ref2;
5843
- return !node.key ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(node, {
5844
- key
5845
- }) : node;
5846
- });
5838
+ if (!portalContext) {
5839
+ return null;
5840
+ }
5841
+ const children = Array.from(portalContext.children.values());
5847
5842
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
5848
5843
  };
5849
5844
 
@@ -5909,26 +5904,28 @@ const VictoryPortal = initialProps => {
5909
5904
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
5910
5905
  _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
5911
5906
  }
5907
+ const children = Array.isArray(props.children) ? props.children[0] : props.children;
5908
+ const {
5909
+ groupComponent
5910
+ } = props;
5911
+ const childProps = children && children.props || {};
5912
+ const standardProps = childProps.groupComponent ? {
5913
+ groupComponent,
5914
+ standalone: false
5915
+ } : {};
5916
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
5917
+ key: childProps.key ?? id
5918
+ });
5919
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
5912
5920
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
5913
- const children = Array.isArray(props.children) ? props.children[0] : props.children;
5914
- const {
5915
- groupComponent
5916
- } = props;
5917
- const childProps = children && children.props || {};
5918
- const standardProps = childProps.groupComponent ? {
5919
- groupComponent,
5920
- standalone: false
5921
- } : {};
5922
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
5923
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
5924
- portalContext.addChild(id, child);
5921
+ portalContext?.addChild(id, child);
5925
5922
  // eslint-disable-next-line react-hooks/exhaustive-deps
5926
5923
  }, [props.children]);
5927
5924
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
5928
- return () => portalContext.removeChild(id);
5925
+ return () => portalContext?.removeChild(id);
5929
5926
  // eslint-disable-next-line react-hooks/exhaustive-deps
5930
5927
  }, []);
5931
- return null;
5928
+ return portalContext ? null : child;
5932
5929
  };
5933
5930
  VictoryPortal.role = "portal";
5934
5931