victory-core 36.6.2 → 36.6.5

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 (228) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/victory-core.js +2053 -4568
  3. package/dist/victory-core.min.js +1 -1
  4. package/es/index.d.ts +0 -1
  5. package/es/index.js +1 -3
  6. package/es/types/callbacks.d.ts +0 -1
  7. package/es/types/callbacks.js +1 -2
  8. package/es/types/prop-types.d.ts +3 -3
  9. package/es/types/prop-types.js +1 -2
  10. package/es/v37/clone.d.ts +23 -0
  11. package/es/v37/clone.js +32 -0
  12. package/es/v37/index.d.ts +5 -0
  13. package/es/v37/index.js +4 -0
  14. package/es/{victory-state → v37/victory-state}/defaults.d.ts +0 -0
  15. package/es/v37/victory-state/defaults.js +2 -0
  16. package/es/v37/victory-state/helpers/get-axis-data.d.ts +3 -0
  17. package/es/{victory-state → v37/victory-state}/helpers/get-axis-data.js +2 -3
  18. package/es/{victory-state → v37/victory-state}/helpers/get-data.d.ts +1 -1
  19. package/es/{victory-state → v37/victory-state}/helpers/get-data.js +2 -3
  20. package/{lib → es/v37}/victory-state/helpers/get-domain.d.ts +1 -1
  21. package/es/{victory-state → v37/victory-state}/helpers/get-domain.js +2 -3
  22. package/{lib → es/v37}/victory-state/helpers/get-range.d.ts +1 -1
  23. package/es/{victory-state → v37/victory-state}/helpers/get-range.js +3 -4
  24. package/{lib → es/v37}/victory-state/helpers/get-scale.d.ts +1 -1
  25. package/es/{victory-state → v37/victory-state}/helpers/get-scale.js +3 -4
  26. package/es/v37/victory-state/index.d.ts +4 -0
  27. package/es/{victory-state → v37/victory-state}/index.js +1 -1
  28. package/{lib → es/v37}/victory-state/types.d.ts +2 -2
  29. package/es/v37/victory-state/types.js +1 -0
  30. package/{lib → es/v37}/victory-state/victory-provider.d.ts +5 -4
  31. package/es/{victory-state → v37/victory-state}/victory-provider.js +59 -29
  32. package/es/v37/victory-state/with-victory-provider.d.ts +7 -0
  33. package/es/v37/victory-state/with-victory-provider.js +43 -0
  34. package/es/{victory-util → v37}/with-container.d.ts +2 -2
  35. package/es/{victory-util → v37}/with-container.js +2 -3
  36. package/es/v37/with-normalized-props.d.ts +17 -0
  37. package/es/v37/with-normalized-props.js +18 -0
  38. package/es/victory-accessible-group/victory-accessible-group.js +1 -2
  39. package/es/victory-animation/util.js +1 -2
  40. package/es/victory-animation/victory-animation.js +1 -2
  41. package/es/victory-clip-container/victory-clip-container.js +1 -2
  42. package/es/victory-container/victory-container.js +1 -2
  43. package/es/victory-label/victory-label.d.ts +5 -4
  44. package/es/victory-label/victory-label.js +1 -2
  45. package/es/victory-portal/portal-context.js +1 -2
  46. package/es/victory-portal/portal.js +1 -2
  47. package/es/victory-portal/victory-portal.js +1 -2
  48. package/es/victory-primitives/arc.js +1 -2
  49. package/es/victory-primitives/background.js +1 -2
  50. package/es/victory-primitives/border.js +1 -2
  51. package/es/victory-primitives/circle.js +1 -2
  52. package/es/victory-primitives/clip-path.js +1 -2
  53. package/es/victory-primitives/index.js +1 -2
  54. package/es/victory-primitives/line-segment.js +1 -2
  55. package/es/victory-primitives/line.js +1 -2
  56. package/es/victory-primitives/path.js +1 -2
  57. package/es/victory-primitives/point.js +1 -2
  58. package/es/victory-primitives/rect.js +1 -2
  59. package/es/victory-primitives/text.js +1 -2
  60. package/es/victory-primitives/tspan.js +1 -2
  61. package/es/victory-primitives/types.js +1 -2
  62. package/es/victory-primitives/whisker.js +1 -2
  63. package/es/victory-theme/grayscale.js +1 -2
  64. package/es/victory-theme/material.js +1 -2
  65. package/es/victory-theme/types.js +1 -2
  66. package/es/victory-theme/victory-theme.js +1 -2
  67. package/es/victory-transition/victory-transition.js +1 -2
  68. package/es/victory-util/add-events.js +1 -2
  69. package/es/victory-util/axis.js +1 -2
  70. package/es/victory-util/collection.js +1 -2
  71. package/es/victory-util/common-props.js +1 -2
  72. package/es/victory-util/data.js +1 -2
  73. package/es/victory-util/default-transitions.js +1 -2
  74. package/es/victory-util/domain.js +1 -2
  75. package/es/victory-util/events.js +1 -2
  76. package/es/victory-util/helpers.d.ts +3 -2
  77. package/es/victory-util/helpers.js +1 -2
  78. package/es/victory-util/hooks/index.js +1 -2
  79. package/es/victory-util/hooks/use-animation-state.js +1 -2
  80. package/es/victory-util/hooks/use-previous-props.js +1 -2
  81. package/es/victory-util/immutable-types.d.ts +2523 -0
  82. package/es/victory-util/immutable.d.ts +1 -1
  83. package/es/victory-util/immutable.js +1 -2
  84. package/es/victory-util/index.d.ts +0 -1
  85. package/es/victory-util/index.js +1 -3
  86. package/es/victory-util/label-helpers.js +1 -2
  87. package/es/victory-util/line-helpers.js +1 -2
  88. package/es/victory-util/log.js +1 -2
  89. package/es/victory-util/point-path-helpers.js +1 -2
  90. package/es/victory-util/prop-types.js +1 -2
  91. package/es/victory-util/scale.js +1 -2
  92. package/es/victory-util/selection.js +1 -2
  93. package/es/victory-util/style.js +1 -2
  94. package/es/victory-util/textsize.js +1 -2
  95. package/es/victory-util/timer-context.js +1 -2
  96. package/es/victory-util/timer.js +1 -2
  97. package/es/victory-util/transitions.js +1 -2
  98. package/es/victory-util/type-helpers.js +1 -2
  99. package/es/victory-util/user-props.js +1 -2
  100. package/es/victory-util/wrapper.js +1 -2
  101. package/lib/index.d.ts +0 -1
  102. package/lib/index.js +1 -16
  103. package/lib/types/callbacks.d.ts +0 -1
  104. package/lib/types/callbacks.js +1 -2
  105. package/lib/types/prop-types.d.ts +3 -3
  106. package/lib/types/prop-types.js +1 -2
  107. package/lib/v37/clone.d.ts +23 -0
  108. package/lib/v37/clone.js +43 -0
  109. package/lib/v37/index.d.ts +5 -0
  110. package/lib/v37/index.js +57 -0
  111. package/lib/{victory-state → v37/victory-state}/defaults.d.ts +0 -0
  112. package/lib/{victory-state → v37/victory-state}/defaults.js +1 -2
  113. package/lib/v37/victory-state/helpers/get-axis-data.d.ts +3 -0
  114. package/lib/{victory-state → v37/victory-state}/helpers/get-axis-data.js +2 -3
  115. package/lib/{victory-state → v37/victory-state}/helpers/get-data.d.ts +1 -1
  116. package/lib/{victory-state → v37/victory-state}/helpers/get-data.js +2 -3
  117. package/{es → lib/v37}/victory-state/helpers/get-domain.d.ts +1 -1
  118. package/lib/{victory-state → v37/victory-state}/helpers/get-domain.js +2 -3
  119. package/{es → lib/v37}/victory-state/helpers/get-range.d.ts +1 -1
  120. package/lib/{victory-state → v37/victory-state}/helpers/get-range.js +3 -4
  121. package/{es → lib/v37}/victory-state/helpers/get-scale.d.ts +1 -1
  122. package/lib/{victory-state → v37/victory-state}/helpers/get-scale.js +3 -4
  123. package/lib/v37/victory-state/index.d.ts +4 -0
  124. package/lib/{victory-state → v37/victory-state}/index.js +13 -1
  125. package/{es → lib/v37}/victory-state/types.d.ts +2 -2
  126. package/lib/v37/victory-state/types.js +1 -0
  127. package/{es → lib/v37}/victory-state/victory-provider.d.ts +5 -4
  128. package/lib/{victory-state → v37/victory-state}/victory-provider.js +61 -30
  129. package/lib/v37/victory-state/with-victory-provider.d.ts +7 -0
  130. package/lib/v37/victory-state/with-victory-provider.js +56 -0
  131. package/lib/{victory-util → v37}/with-container.d.ts +2 -2
  132. package/lib/{victory-util → v37}/with-container.js +2 -3
  133. package/lib/v37/with-normalized-props.d.ts +17 -0
  134. package/lib/v37/with-normalized-props.js +29 -0
  135. package/lib/victory-accessible-group/victory-accessible-group.js +1 -2
  136. package/lib/victory-animation/util.js +1 -2
  137. package/lib/victory-animation/victory-animation.js +1 -2
  138. package/lib/victory-clip-container/victory-clip-container.js +1 -2
  139. package/lib/victory-container/victory-container.js +1 -2
  140. package/lib/victory-label/victory-label.d.ts +5 -4
  141. package/lib/victory-label/victory-label.js +1 -2
  142. package/lib/victory-portal/portal-context.js +1 -2
  143. package/lib/victory-portal/portal.js +1 -2
  144. package/lib/victory-portal/victory-portal.js +1 -2
  145. package/lib/victory-primitives/arc.js +1 -2
  146. package/lib/victory-primitives/background.js +1 -2
  147. package/lib/victory-primitives/border.js +1 -2
  148. package/lib/victory-primitives/circle.js +1 -2
  149. package/lib/victory-primitives/clip-path.js +1 -2
  150. package/lib/victory-primitives/index.js +1 -2
  151. package/lib/victory-primitives/line-segment.js +1 -2
  152. package/lib/victory-primitives/line.js +1 -2
  153. package/lib/victory-primitives/path.js +1 -2
  154. package/lib/victory-primitives/point.js +1 -2
  155. package/lib/victory-primitives/rect.js +1 -2
  156. package/lib/victory-primitives/text.js +1 -2
  157. package/lib/victory-primitives/tspan.js +1 -2
  158. package/lib/victory-primitives/types.js +1 -2
  159. package/lib/victory-primitives/whisker.js +1 -2
  160. package/lib/victory-theme/grayscale.js +1 -2
  161. package/lib/victory-theme/material.js +1 -2
  162. package/lib/victory-theme/types.js +1 -2
  163. package/lib/victory-theme/victory-theme.js +1 -2
  164. package/lib/victory-transition/victory-transition.js +1 -2
  165. package/lib/victory-util/add-events.js +1 -2
  166. package/lib/victory-util/axis.js +1 -2
  167. package/lib/victory-util/collection.js +1 -2
  168. package/lib/victory-util/common-props.js +1 -2
  169. package/lib/victory-util/data.js +1 -2
  170. package/lib/victory-util/default-transitions.js +1 -2
  171. package/lib/victory-util/domain.js +1 -2
  172. package/lib/victory-util/events.js +1 -2
  173. package/lib/victory-util/helpers.d.ts +3 -2
  174. package/lib/victory-util/helpers.js +1 -2
  175. package/lib/victory-util/hooks/index.js +1 -2
  176. package/lib/victory-util/hooks/use-animation-state.js +1 -2
  177. package/lib/victory-util/hooks/use-previous-props.js +1 -2
  178. package/lib/victory-util/immutable-types.d.ts +2523 -0
  179. package/lib/victory-util/immutable.d.ts +1 -1
  180. package/lib/victory-util/immutable.js +1 -2
  181. package/lib/victory-util/index.d.ts +0 -1
  182. package/lib/victory-util/index.js +1 -16
  183. package/lib/victory-util/label-helpers.js +1 -2
  184. package/lib/victory-util/line-helpers.js +1 -2
  185. package/lib/victory-util/log.js +1 -2
  186. package/lib/victory-util/point-path-helpers.js +1 -2
  187. package/lib/victory-util/prop-types.js +1 -2
  188. package/lib/victory-util/scale.js +1 -2
  189. package/lib/victory-util/selection.js +1 -2
  190. package/lib/victory-util/style.js +1 -2
  191. package/lib/victory-util/textsize.js +1 -2
  192. package/lib/victory-util/timer-context.js +1 -2
  193. package/lib/victory-util/timer.js +1 -2
  194. package/lib/victory-util/transitions.js +1 -2
  195. package/lib/victory-util/type-helpers.js +1 -2
  196. package/lib/victory-util/user-props.js +1 -2
  197. package/lib/victory-util/wrapper.js +1 -2
  198. package/package.json +12 -4
  199. package/src/index.ts +0 -1
  200. package/src/types/callbacks.ts +0 -2
  201. package/src/types/prop-types.ts +4 -3
  202. package/src/v37/clone.tsx +30 -0
  203. package/src/v37/index.tsx +4 -0
  204. package/src/{victory-state → v37/victory-state}/defaults.ts +0 -0
  205. package/src/{victory-state → v37/victory-state}/helpers/get-axis-data.ts +2 -2
  206. package/src/{victory-state → v37/victory-state}/helpers/get-data.ts +3 -3
  207. package/src/{victory-state → v37/victory-state}/helpers/get-domain.ts +2 -2
  208. package/src/{victory-state → v37/victory-state}/helpers/get-range.ts +3 -3
  209. package/src/{victory-state → v37/victory-state}/helpers/get-scale.ts +6 -3
  210. package/src/{victory-state → v37/victory-state}/index.ts +1 -0
  211. package/src/{victory-state → v37/victory-state}/types.ts +2 -2
  212. package/src/{victory-state → v37/victory-state}/victory-provider.tsx +61 -27
  213. package/src/v37/victory-state/with-victory-provider.tsx +53 -0
  214. package/src/{victory-util → v37}/with-container.tsx +2 -2
  215. package/src/v37/with-normalized-props.tsx +43 -0
  216. package/src/victory-label/victory-label.tsx +4 -4
  217. package/src/victory-util/data.ts +1 -1
  218. package/src/victory-util/helpers.ts +3 -2
  219. package/src/victory-util/immutable-types.d.ts +2523 -0
  220. package/src/victory-util/immutable.ts +1 -1
  221. package/src/victory-util/index.ts +0 -1
  222. package/es/victory-state/defaults.js +0 -3
  223. package/es/victory-state/helpers/get-axis-data.d.ts +0 -3
  224. package/es/victory-state/index.d.ts +0 -3
  225. package/es/victory-state/types.js +0 -2
  226. package/lib/victory-state/helpers/get-axis-data.d.ts +0 -3
  227. package/lib/victory-state/index.d.ts +0 -3
  228. package/lib/victory-state/types.js +0 -2
@@ -1,4 +1,4 @@
1
- import type { Iterable, List, Map } from "immutable";
1
+ import type { Iterable, List, Map } from "./immutable-types";
2
2
  export declare const IMMUTABLE_ITERABLE = "@@__IMMUTABLE_ITERABLE__@@";
3
3
  export declare const IMMUTABLE_RECORD = "@@__IMMUTABLE_RECORD__@@";
4
4
  export declare const IMMUTABLE_LIST = "@@__IMMUTABLE_LIST__@@";
@@ -26,5 +26,4 @@ export function shallowToJS(x, whitelist) {
26
26
  result[key] = curr;
27
27
  return result;
28
28
  }, isList(x) ? [] : {}) : x;
29
- }
30
- //# sourceMappingURL=immutable.js.map
29
+ }
@@ -25,5 +25,4 @@ export { default as TimerContext } from "./timer-context";
25
25
  export * as Transitions from "./transitions";
26
26
  export * as UserProps from "./user-props";
27
27
  export * as Wrapper from "./wrapper";
28
- export * from "./with-container";
29
28
  //# sourceMappingURL=index.d.ts.map
@@ -43,6 +43,4 @@ export { _Transitions as Transitions };
43
43
  import * as _UserProps from "./user-props";
44
44
  export { _UserProps as UserProps };
45
45
  import * as _Wrapper from "./wrapper";
46
- export { _Wrapper as Wrapper };
47
- export * from "./with-container";
48
- //# sourceMappingURL=index.js.map
46
+ export { _Wrapper as Wrapper };
@@ -232,5 +232,4 @@ export function getProps(props, index) {
232
232
 
233
233
  var tooltipTheme = theme && theme.tooltip || {};
234
234
  return _defaults({}, labelProps, Helpers.omit(tooltipTheme, ["style"]));
235
- }
236
- //# sourceMappingURL=label-helpers.js.map
235
+ }
@@ -59,5 +59,4 @@ export var getLineFunction = function (props) {
59
59
  scale = props.scale,
60
60
  horizontal = props.horizontal;
61
61
  return polar ? d3Shape.lineRadial().defined(defined).curve(getInterpolationFunction(props)).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : d3Shape.line().defined(defined).curve(getInterpolationFunction(props)).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale));
62
- };
63
- //# sourceMappingURL=line-helpers.js.map
62
+ };
@@ -8,5 +8,4 @@ export function warn(message) {
8
8
  console.warn(message);
9
9
  }
10
10
  }
11
- }
12
- //# sourceMappingURL=log.js.map
11
+ }
@@ -68,5 +68,4 @@ export function star(x, y, size) {
68
68
  });
69
69
 
70
70
  return "M ".concat(starCoords.join("L"), " z");
71
- }
72
- //# sourceMappingURL=point-path-helpers.js.map
71
+ }
@@ -238,5 +238,4 @@ export var regExp = makeChainable(function (props, propName, componentName) {
238
238
  }
239
239
 
240
240
  return null;
241
- });
242
- //# sourceMappingURL=prop-types.js.map
241
+ });
@@ -139,5 +139,4 @@ export function getType(scale) {
139
139
  return scale[type.method] !== undefined;
140
140
  })[0];
141
141
  return scaleType ? scaleType.name : undefined;
142
- }
143
- //# sourceMappingURL=scale.js.map
142
+ }
@@ -111,5 +111,4 @@ export function getBounds(props) {
111
111
  x: makeBound(point1.x, point2.x),
112
112
  y: makeBound(point1.y, point2.y)
113
113
  };
114
- }
115
- //# sourceMappingURL=selection.js.map
114
+ }
@@ -53,5 +53,4 @@ export function getColorScale(name) {
53
53
  green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
54
54
  };
55
55
  return name ? scales[name] : scales.grayscale;
56
- }
57
- //# sourceMappingURL=style.js.map
56
+ }
@@ -284,5 +284,4 @@ export var _approximateTextSizeInternal = {
284
284
 
285
285
  export var approximateTextSize = function (text, style) {
286
286
  return _approximateTextSizeInternal.impl(text, style);
287
- };
288
- //# sourceMappingURL=textsize.js.map
287
+ };
@@ -10,5 +10,4 @@ var TimerContext = /*#__PURE__*/React.createContext({
10
10
  animationTimer: new Timer()
11
11
  });
12
12
  TimerContext.displayName = "TimerContext";
13
- export default TimerContext;
14
- //# sourceMappingURL=timer-context.js.map
13
+ export default TimerContext;
@@ -84,5 +84,4 @@ var Timer = /*#__PURE__*/function () {
84
84
  return Timer;
85
85
  }();
86
86
 
87
- export { Timer as default };
88
- //# sourceMappingURL=timer.js.map
87
+ export { Timer as default };
@@ -406,5 +406,4 @@ export function getTransitionPropsFactory(props, state, setState) {
406
406
  data: data
407
407
  };
408
408
  };
409
- }
410
- //# sourceMappingURL=transitions.js.map
409
+ }
@@ -24,5 +24,4 @@ export function isDate(value) {
24
24
  }
25
25
  export function isKeyValueObject(datum) {
26
26
  return typeof datum === "object" && !Array.isArray(datum) && !(datum instanceof Date);
27
- }
28
- //# sourceMappingURL=type-helpers.js.map
27
+ }
@@ -122,5 +122,4 @@ export var getSafeUserProps = function (props) {
122
122
 
123
123
  export var withSafeUserProps = function (component, props) {
124
124
  return /*#__PURE__*/React.cloneElement(component, getSafeUserProps(props));
125
- };
126
- //# sourceMappingURL=user-props.js.map
125
+ };
@@ -446,5 +446,4 @@ export function getCategories(props, childComponents, allStrings) {
446
446
  x: xCategories.length > 0 ? xCategories : undefined,
447
447
  y: yCategories.length > 0 ? yCategories : undefined
448
448
  };
449
- }
450
- //# sourceMappingURL=wrapper.js.map
449
+ }
package/lib/index.d.ts CHANGED
@@ -15,5 +15,4 @@ export * from "./victory-primitives";
15
15
  export { Border as Box } from "./victory-primitives";
16
16
  export type { BorderProps as BoxProps } from "./victory-primitives";
17
17
  export * from "./victory-util";
18
- export * from "./victory-state";
19
18
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -221,19 +221,4 @@ Object.keys(_victoryUtil).forEach(function (key) {
221
221
  return _victoryUtil[key];
222
222
  }
223
223
  });
224
- });
225
-
226
- var _victoryState = require("./victory-state");
227
-
228
- Object.keys(_victoryState).forEach(function (key) {
229
- if (key === "default" || key === "__esModule") return;
230
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
231
- if (key in exports && exports[key] === _victoryState[key]) return;
232
- Object.defineProperty(exports, key, {
233
- enumerable: true,
234
- get: function () {
235
- return _victoryState[key];
236
- }
237
- });
238
- });
239
- //# sourceMappingURL=index.js.map
224
+ });
@@ -34,5 +34,4 @@ export declare type VictoryOrientationCallback = (args: CallbackArgs) => Orienta
34
34
  export declare type NumberOrCallback = number | VictoryNumberCallback;
35
35
  export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
36
36
  export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
37
- export declare type ValueOrCallback<TValue> = TValue | ((args: CallbackArgs) => TValue);
38
37
  //# sourceMappingURL=callbacks.d.ts.map
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=callbacks.js.map
1
+ "use strict";
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { ScaleLinear, ScaleLogarithmic, ScalePower, ScaleTime } from "victory-vendor/d3-scale";
3
3
  import { AnimationEasing, AnimationStyle } from "../victory-animation/victory-animation";
4
- import { StringOrNumberOrCallback } from "./callbacks";
4
+ import { CallbackArgs, StringOrNumberOrCallback } from "./callbacks";
5
5
  export declare type AxisType = "x" | "y";
6
6
  export declare type DatumValue = number | string | Date | null | undefined;
7
7
  export declare type Datum = any;
@@ -10,7 +10,7 @@ export declare type ForAxes<T> = T | {
10
10
  y?: T;
11
11
  };
12
12
  export declare type ID = number | string;
13
- export declare type ValueOrAccessor<ValueType = unknown, PropsType = object> = ValueType | ((props: PropsType) => ValueType);
13
+ export declare type ValueOrAccessor<ValueType, PropsType = CallbackArgs> = ValueType | ((props: PropsType) => ValueType);
14
14
  export declare type Tuple<T> = [T, T];
15
15
  export declare type ValueOrAxes<T> = T | ForAxes<T>;
16
16
  export declare type DomainPaddingPropType = ValueOrAxes<PaddingType>;
@@ -105,7 +105,7 @@ export declare type CategoryPropType = string[] | {
105
105
  x: string[];
106
106
  y: string[];
107
107
  };
108
- export declare type DataGetterPropType = ValueOrAccessor<string | string[] | number | number[]>;
108
+ export declare type DataGetterPropType = ValueOrAccessor<string | string[] | number | number[], any>;
109
109
  export declare type InterpolationPropType = "basis" | "basisClosed" | "basisOpen" | "bundle" | "cardinal" | "cardinalClosed" | "cardinalOpen" | "catmullRom" | "catmullRomClosed" | "catmullRomOpen" | "linear" | "linearClosed" | "monotoneX" | "monotoneY" | "natural" | "radial" | "step" | "stepAfter" | "stepBefore";
110
110
  export declare type ColorScalePropType = "grayscale" | "qualitative" | "heatmap" | "warm" | "cool" | "red" | "green" | "blue" | string[];
111
111
  export declare type SortOrderPropType = "ascending" | "descending";
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=prop-types.js.map
1
+ "use strict";
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ /**
3
+ * Syntax sugar for `React.cloneElement`, so that we can use JSX instead
4
+ *
5
+ * @example
6
+ * // Before:
7
+ * const children = React.cloneElement(props.groupComponent, { prop2 }, props.children);
8
+ * return React.cloneElement(props.containerComponent, { prop1 }, children);
9
+ *
10
+ * // After:
11
+ * return (
12
+ * <Clone element={props.containerComponent} prop1={prop1}>
13
+ * <Clone element={props.groupComponent} prop2={prop2}>
14
+ * {props.children}
15
+ * </Clone>
16
+ * </Clone>
17
+ * );
18
+ */
19
+ export declare const Clone: <TProps>(props: React.PropsWithChildren<{
20
+ element: React.ReactElement<TProps, string | React.JSXElementConstructor<any>>;
21
+ children?: React.ReactNode | React.ReactNode[];
22
+ } & TProps>) => React.ReactElement<TProps, string | React.JSXElementConstructor<any>>;
23
+ //# sourceMappingURL=clone.d.ts.map
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Clone = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _excluded = ["children", "element"];
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
+
16
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
+
18
+ /**
19
+ * Syntax sugar for `React.cloneElement`, so that we can use JSX instead
20
+ *
21
+ * @example
22
+ * // Before:
23
+ * const children = React.cloneElement(props.groupComponent, { prop2 }, props.children);
24
+ * return React.cloneElement(props.containerComponent, { prop1 }, children);
25
+ *
26
+ * // After:
27
+ * return (
28
+ * <Clone element={props.containerComponent} prop1={prop1}>
29
+ * <Clone element={props.groupComponent} prop2={prop2}>
30
+ * {props.children}
31
+ * </Clone>
32
+ * </Clone>
33
+ * );
34
+ */
35
+ var Clone = function (props) {
36
+ var children = props.children,
37
+ element = props.element,
38
+ rest = _objectWithoutProperties(props, _excluded);
39
+
40
+ return /*#__PURE__*/_react.default.cloneElement(element, rest, children);
41
+ };
42
+
43
+ exports.Clone = Clone;
@@ -0,0 +1,5 @@
1
+ export * from "./victory-state";
2
+ export * from "./clone";
3
+ export * from "./with-normalized-props";
4
+ export * from "./with-container";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _victoryState = require("./victory-state");
8
+
9
+ Object.keys(_victoryState).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _victoryState[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _victoryState[key];
16
+ }
17
+ });
18
+ });
19
+
20
+ var _clone = require("./clone");
21
+
22
+ Object.keys(_clone).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _clone[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _clone[key];
29
+ }
30
+ });
31
+ });
32
+
33
+ var _withNormalizedProps = require("./with-normalized-props");
34
+
35
+ Object.keys(_withNormalizedProps).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _withNormalizedProps[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function () {
41
+ return _withNormalizedProps[key];
42
+ }
43
+ });
44
+ });
45
+
46
+ var _withContainer = require("./with-container");
47
+
48
+ Object.keys(_withContainer).forEach(function (key) {
49
+ if (key === "default" || key === "__esModule") return;
50
+ if (key in exports && exports[key] === _withContainer[key]) return;
51
+ Object.defineProperty(exports, key, {
52
+ enumerable: true,
53
+ get: function () {
54
+ return _withContainer[key];
55
+ }
56
+ });
57
+ });
@@ -7,5 +7,4 @@ exports.DEFAULT_WIDTH = exports.DEFAULT_HEIGHT = void 0;
7
7
  var DEFAULT_HEIGHT = 300;
8
8
  exports.DEFAULT_HEIGHT = DEFAULT_HEIGHT;
9
9
  var DEFAULT_WIDTH = 450;
10
- exports.DEFAULT_WIDTH = DEFAULT_WIDTH;
11
- //# sourceMappingURL=defaults.js.map
10
+ exports.DEFAULT_WIDTH = DEFAULT_WIDTH;
@@ -0,0 +1,3 @@
1
+ import { AxisType, Datum } from "../../../types/prop-types";
2
+ export declare function getAxisData(data: Datum[], axis: AxisType): any;
3
+ //# sourceMappingURL=get-axis-data.d.ts.map
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getAxisData = getAxisData;
7
7
 
8
- var _typeHelpers = require("../../victory-util/type-helpers");
8
+ var _typeHelpers = require("../../../victory-util/type-helpers");
9
9
 
10
10
  function getAxisData(data, axis) {
11
11
  return data.reduce(function (acc, datum) {
@@ -19,5 +19,4 @@ function getAxisData(data, axis) {
19
19
 
20
20
  return acc;
21
21
  }, []);
22
- }
23
- //# sourceMappingURL=get-axis-data.js.map
22
+ }
@@ -1,4 +1,4 @@
1
- import { DatumValue } from "../../types/prop-types";
1
+ import { DatumValue } from "../../../types/prop-types";
2
2
  import { VictoryProviderProps } from "../types";
3
3
  declare type DataProps = Pick<VictoryProviderProps, "data" | "x" | "y" | "sortKey" | "sortOrder" | "samples">;
4
4
  export interface FormattedDatum {
@@ -11,7 +11,7 @@ var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
11
11
 
12
12
  var _get2 = _interopRequireDefault(require("lodash/get"));
13
13
 
14
- var _typeHelpers = require("../../victory-util/type-helpers");
14
+ var _typeHelpers = require("../../../victory-util/type-helpers");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
@@ -95,5 +95,4 @@ function getData() {
95
95
  }
96
96
 
97
97
  return formattedData;
98
- }
99
- //# sourceMappingURL=get-data.js.map
98
+ }
@@ -1,5 +1,5 @@
1
1
  import { VictoryProviderProps } from "../types";
2
- import { AxisType, DomainTuple } from "../../types/prop-types";
2
+ import { AxisType, DomainTuple } from "../../../types/prop-types";
3
3
  declare type DomainProps = Pick<VictoryProviderProps, "data" | "domain" | "maxDomain" | "minDomain" | "includeZero">;
4
4
  export declare function getDomain({ data, includeZero, ...props }: DomainProps, axis: AxisType): DomainTuple;
5
5
  export {};
@@ -9,7 +9,7 @@ var d3Array = _interopRequireWildcard(require("victory-vendor/d3-array"));
9
9
 
10
10
  var _getAxisData = require("./get-axis-data");
11
11
 
12
- var _typeHelpers = require("../../victory-util/type-helpers");
12
+ var _typeHelpers = require("../../../victory-util/type-helpers");
13
13
 
14
14
  var _excluded = ["data", "includeZero"];
15
15
 
@@ -78,5 +78,4 @@ function getDomain(_ref, axis) {
78
78
 
79
79
 
80
80
  return getDomainFromMinMax(minDomain, maxDomain);
81
- }
82
- //# sourceMappingURL=get-domain.js.map
81
+ }
@@ -1,4 +1,4 @@
1
- import { AxisType } from "../../types/prop-types";
1
+ import { AxisType } from "../../../types/prop-types";
2
2
  import { VictoryProviderProps } from "../types";
3
3
  declare type RangeProps = Pick<VictoryProviderProps, "range" | "padding" | "height" | "width">;
4
4
  export declare function getRange({ range, height, width, ...props }: RangeProps, axis: AxisType): number[];
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getRange = getRange;
7
7
 
8
- var _helpers = require("../../victory-util/helpers");
8
+ var _helpers = require("../../../victory-util/helpers");
9
9
 
10
- var _typeHelpers = require("../../victory-util/type-helpers");
10
+ var _typeHelpers = require("../../../victory-util/type-helpers");
11
11
 
12
12
  var _excluded = ["range", "height", "width"];
13
13
 
@@ -42,5 +42,4 @@ function getRange(_ref, axis) {
42
42
  y: [height - padding.top, padding.bottom]
43
43
  };
44
44
  return rangeForAxis[axis];
45
- }
46
- //# sourceMappingURL=get-range.js.map
45
+ }
@@ -1,4 +1,4 @@
1
- import { AxisType, D3ScaleFn } from "../../types/prop-types";
1
+ import { AxisType, D3ScaleFn } from "../../../types/prop-types";
2
2
  import { VictoryProviderProps } from "../types";
3
3
  declare type ScaleProps = Pick<VictoryProviderProps, "data" | "scale">;
4
4
  export declare function getScale({ data, ...props }: ScaleProps, axis: AxisType): D3ScaleFn;
@@ -7,9 +7,9 @@ exports.getScale = getScale;
7
7
 
8
8
  var _d3Scale = require("victory-vendor/d3-scale");
9
9
 
10
- var Collection = _interopRequireWildcard(require("../../victory-util/collection"));
10
+ var Collection = _interopRequireWildcard(require("../../../victory-util/collection"));
11
11
 
12
- var _typeHelpers = require("../../victory-util/type-helpers");
12
+ var _typeHelpers = require("../../../victory-util/type-helpers");
13
13
 
14
14
  var _getAxisData = require("./get-axis-data");
15
15
 
@@ -70,5 +70,4 @@ function getScale(_ref, axis) {
70
70
  }
71
71
 
72
72
  return DEFAULT_SCALE;
73
- }
74
- //# sourceMappingURL=get-scale.js.map
73
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./victory-provider";
2
+ export * from "./types";
3
+ export * from "./with-victory-provider";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -29,4 +29,16 @@ Object.keys(_types).forEach(function (key) {
29
29
  }
30
30
  });
31
31
  });
32
- //# sourceMappingURL=index.js.map
32
+
33
+ var _withVictoryProvider = require("./with-victory-provider");
34
+
35
+ Object.keys(_withVictoryProvider).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _withVictoryProvider[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function () {
41
+ return _withVictoryProvider[key];
42
+ }
43
+ });
44
+ });
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { D3ScaleFn, Datum, DomainTuple, RangeTuple, ScalePropType, ValueOrAxes } from "../types/prop-types";
3
- import { PaddingProps } from "../victory-theme/types";
2
+ import { D3ScaleFn, Datum, DomainTuple, RangeTuple, ScalePropType, ValueOrAxes } from "../../types/prop-types";
3
+ import { PaddingProps } from "../../victory-theme/types";
4
4
  export interface VictoryCalculatedStateProps {
5
5
  data?: Datum[];
6
6
  domain?: ValueOrAxes<DomainTuple>;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { D3ScaleFn, DomainTuple, ForAxes } from "../types/prop-types";
2
+ import { D3ScaleFn, DomainTuple, ForAxes } from "../../types/prop-types";
3
3
  import { FormattedDatum } from "./helpers/get-data";
4
4
  import { VictoryCalculatedStateProps, VictoryProviderProps } from "./types";
5
5
  declare type ScaleType = Required<ForAxes<D3ScaleFn>>;
@@ -8,13 +8,14 @@ export interface ContextType {
8
8
  data: FormattedDatum[];
9
9
  scale: ScaleType;
10
10
  domain: DomainType;
11
- setChildProps: (id: string, props: VictoryProviderProps) => void;
11
+ updateChildProps: (id: symbol, props: VictoryProviderProps | null) => void;
12
12
  }
13
- export declare function VictoryProvider({ children, ...initialProps }: VictoryProviderProps): JSX.Element;
13
+ export declare function VictoryProvider({ children, ...providerProps }: VictoryProviderProps): JSX.Element;
14
+ export declare function useVictoryContextMaybe<T>(selector: (value: ContextType | null) => T): T;
14
15
  export declare function useVictoryContext<T>(selector: (value: ContextType) => T): T;
15
16
  export declare function useScale(): ScaleType;
16
17
  export declare function useData(): FormattedDatum[];
17
18
  export declare function useDomain(): DomainType;
18
- export declare function useVictoryProviderSync(id: string, props: VictoryCalculatedStateProps): VictoryCalculatedStateProps;
19
+ export declare function useVictoryProviderSync(props: VictoryCalculatedStateProps): void;
19
20
  export {};
20
21
  //# sourceMappingURL=victory-provider.d.ts.map