victory-histogram 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,13 +1,10 @@
1
1
  # victory-histogram
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-bar@37.0.3-next.0
10
- - victory-vendor@37.0.3-next.0
7
+ - Pin all internal victory package versions ([#2876](https://github.com/FormidableLabs/victory/pull/2876))
11
8
 
12
9
  ## 37.0.2
13
10
 
@@ -6193,9 +6193,9 @@ __webpack_require__.r(__webpack_exports__);
6193
6193
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6194
6194
  /* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
6195
6195
  /* 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");
6196
- /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
6196
+ /* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
6197
6197
  /* 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");
6198
- /* 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");
6198
+ /* 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");
6199
6199
 
6200
6200
  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); }
6201
6201
 
@@ -6295,7 +6295,7 @@ const VictoryContainer = initialProps => {
6295
6295
  };
6296
6296
  // eslint-disable-next-line react-hooks/exhaustive-deps
6297
6297
  }, []);
6298
- 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", {
6298
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
6299
6299
  className: className,
6300
6300
  style: {
6301
6301
  ...style,
@@ -6308,8 +6308,8 @@ const VictoryContainer = initialProps => {
6308
6308
  "data-ouia-component-id": ouiaId,
6309
6309
  "data-ouia-component-type": ouiaType,
6310
6310
  "data-ouia-safe": ouiaSafe,
6311
- ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_5__.mergeRefs)([localContainerRef, containerRef])
6312
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
6311
+ ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
6312
+ }, /*#__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({
6313
6313
  width: width,
6314
6314
  height: height,
6315
6315
  tabIndex: tabIndex,
@@ -6870,9 +6870,6 @@ const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().
6870
6870
  PortalContext.displayName = "PortalContext";
6871
6871
  const usePortalContext = () => {
6872
6872
  const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
6873
- if (!context) {
6874
- throw new Error("`usePortalContext` must be used within a `<PortalProvider />`");
6875
- }
6876
6873
  return context;
6877
6874
  };
6878
6875
  const PortalProvider = _ref => {
@@ -6928,12 +6925,10 @@ const PortalOutlet = _ref => {
6928
6925
  ...props
6929
6926
  } = _ref;
6930
6927
  const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
6931
- const children = Array.from(portalContext.children.entries()).map(_ref2 => {
6932
- let [key, node] = _ref2;
6933
- return !node.key ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(node, {
6934
- key
6935
- }) : node;
6936
- });
6928
+ if (!portalContext) {
6929
+ return null;
6930
+ }
6931
+ const children = Array.from(portalContext.children.values());
6937
6932
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
6938
6933
  };
6939
6934
 
@@ -6999,26 +6994,28 @@ const VictoryPortal = initialProps => {
6999
6994
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
7000
6995
  _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
7001
6996
  }
6997
+ const children = Array.isArray(props.children) ? props.children[0] : props.children;
6998
+ const {
6999
+ groupComponent
7000
+ } = props;
7001
+ const childProps = children && children.props || {};
7002
+ const standardProps = childProps.groupComponent ? {
7003
+ groupComponent,
7004
+ standalone: false
7005
+ } : {};
7006
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
7007
+ key: childProps.key ?? id
7008
+ });
7009
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7002
7010
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7003
- const children = Array.isArray(props.children) ? props.children[0] : props.children;
7004
- const {
7005
- groupComponent
7006
- } = props;
7007
- const childProps = children && children.props || {};
7008
- const standardProps = childProps.groupComponent ? {
7009
- groupComponent,
7010
- standalone: false
7011
- } : {};
7012
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]));
7013
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7014
- portalContext.addChild(id, child);
7011
+ portalContext?.addChild(id, child);
7015
7012
  // eslint-disable-next-line react-hooks/exhaustive-deps
7016
7013
  }, [props.children]);
7017
7014
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7018
- return () => portalContext.removeChild(id);
7015
+ return () => portalContext?.removeChild(id);
7019
7016
  // eslint-disable-next-line react-hooks/exhaustive-deps
7020
7017
  }, []);
7021
- return null;
7018
+ return portalContext ? null : child;
7022
7019
  };
7023
7020
  VictoryPortal.role = "portal";
7024
7021