@cutting/svg 4.45.3 → 4.47.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 (69) hide show
  1. package/.eslintrc.json +1 -1
  2. package/.turbo/turbo-build.log +5 -11
  3. package/CHANGELOG.md +25 -0
  4. package/demo/{public/index.html → index.html} +2 -1
  5. package/demo/{App.tsx → src/App.tsx} +4 -3
  6. package/demo/{global.css.ts → src/global.css.ts} +0 -0
  7. package/demo/src/index.tsx +21 -0
  8. package/dist/esm/components/Group/Group.d.ts +14 -14
  9. package/dist/esm/components/Line/Line.d.ts +11 -11
  10. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.d.ts +14 -14
  11. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +1 -1
  12. package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.d.ts +17 -17
  13. package/dist/esm/index.d.ts +5 -5
  14. package/dist/esm/index.d.ts.map +1 -1
  15. package/dist/esm/index.js +2 -1
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/types/types.d.ts +8 -8
  18. package/package.json +33 -33
  19. package/src/components/ParentsizeSVG/ParentSizeSVG.test.tsx +1 -1
  20. package/src/components/ParentsizeSVG/ParentsizeSVG.tsx +2 -2
  21. package/src/components/ResponsiveSVG/ResponsiveSVG.test.tsx +6 -5
  22. package/src/components/ResponsiveSVG/ResponsiveSVG.tsx +1 -1
  23. package/src/index.ts +4 -4
  24. package/vite.config.ts +30 -0
  25. package/.vscode/launch.json +0 -28
  26. package/build.config.js +0 -10
  27. package/demo/index.tsx +0 -16
  28. package/dist/cjs/components/Group/Group.d.ts +0 -15
  29. package/dist/cjs/components/Group/Group.d.ts.map +0 -1
  30. package/dist/cjs/components/Line/Line.d.ts +0 -12
  31. package/dist/cjs/components/Line/Line.d.ts.map +0 -1
  32. package/dist/cjs/components/ParentsizeSVG/ParentsizeSVG.d.ts +0 -15
  33. package/dist/cjs/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +0 -1
  34. package/dist/cjs/components/ResponsiveSVG/ResponsiveSVG.d.ts +0 -18
  35. package/dist/cjs/components/ResponsiveSVG/ResponsiveSVG.d.ts.map +0 -1
  36. package/dist/cjs/index.d.ts +0 -6
  37. package/dist/cjs/index.d.ts.map +0 -1
  38. package/dist/cjs/index.js +0 -9
  39. package/dist/cjs/svg.cjs.development.js +0 -160
  40. package/dist/cjs/svg.cjs.development.js.map +0 -1
  41. package/dist/cjs/svg.cjs.production.min.js +0 -2
  42. package/dist/cjs/svg.cjs.production.min.js.map +0 -1
  43. package/dist/cjs/types/types.d.ts +0 -9
  44. package/dist/cjs/types/types.d.ts.map +0 -1
  45. package/dist/esm/components/Group/Group.js +0 -1
  46. package/dist/esm/components/Group/Group.js.map +0 -1
  47. package/dist/esm/components/Line/Line.js +0 -1
  48. package/dist/esm/components/Line/Line.js.map +0 -1
  49. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.js +0 -1
  50. package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.js.map +0 -1
  51. package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.js +0 -1
  52. package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.js.map +0 -1
  53. package/dist/esm/types/types.js +0 -1
  54. package/dist/esm/types/types.js.map +0 -1
  55. package/dist/tsconfig.dist.tsbuildinfo +0 -1
  56. package/dist/umd/components/Group/Group.d.ts +0 -15
  57. package/dist/umd/components/Group/Group.d.ts.map +0 -1
  58. package/dist/umd/components/Line/Line.d.ts +0 -12
  59. package/dist/umd/components/Line/Line.d.ts.map +0 -1
  60. package/dist/umd/components/ParentsizeSVG/ParentsizeSVG.d.ts +0 -15
  61. package/dist/umd/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +0 -1
  62. package/dist/umd/components/ResponsiveSVG/ResponsiveSVG.d.ts +0 -18
  63. package/dist/umd/components/ResponsiveSVG/ResponsiveSVG.d.ts.map +0 -1
  64. package/dist/umd/index.d.ts +0 -6
  65. package/dist/umd/index.d.ts.map +0 -1
  66. package/dist/umd/index.js +0 -2
  67. package/dist/umd/index.js.map +0 -1
  68. package/dist/umd/types/types.d.ts +0 -9
  69. package/dist/umd/types/types.d.ts.map +0 -1
@@ -1,12 +0,0 @@
1
- import type { AddSVGProps, Point } from '../../types/types';
2
- export declare type LineProps = {
3
- className?: string;
4
- innerRef?: React.Ref<SVGLineElement>;
5
- fill?: string;
6
- /** Starting x,y point of the line. */
7
- from?: Point;
8
- /** Ending x,y point of the line. */
9
- to?: Point;
10
- };
11
- export declare function Line({ from, to, fill, className, innerRef, ...restProps }: AddSVGProps<LineProps, SVGLineElement>): JSX.Element;
12
- //# sourceMappingURL=Line.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/components/Line/Line.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE5D,oBAAY,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,oCAAoC;IACpC,EAAE,CAAC,EAAE,KAAK,CAAC;CACZ,CAAC;AAEF,wBAAgB,IAAI,CAAC,EACnB,IAAqB,EACrB,EAAmB,EACnB,IAAoB,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,GAAG,CAAC,OAAO,CAgBtD"}
@@ -1,15 +0,0 @@
1
- import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
2
- import type { UseParentSizeOptions } from '@cutting/use-get-parent-size';
3
- import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';
4
- declare type Align = 'none' | 'center';
5
- export declare type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {
6
- parentRef: RefObject<E>;
7
- style?: CSSProperties;
8
- align?: Align;
9
- scale?: number;
10
- options?: Partial<UseParentSizeOptions>;
11
- } & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;
12
- export declare const DefaultStyle: CSSProperties;
13
- export declare function ParentsizeSVG<E extends HTMLElement>({ parentRef, children, style, scale, align, options: { debounceDelay, ...optionsRest }, ...rest }: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null;
14
- export {};
15
- //# sourceMappingURL=ParentsizeSVG.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParentsizeSVG.d.ts","sourceRoot":"","sources":["../../../../src/components/ParentsizeSVG/ParentsizeSVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,aAAK,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/B,oBAAY,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IACpE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACzC,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAExE,eAAO,MAAM,YAAY,EAAE,aAOjB,CAAC;AAEX,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,EACnD,SAAS,EACT,QAAQ,EACR,KAAoB,EACpB,KAAS,EACT,KAAc,EACd,OAAO,EAAE,EAAE,aAAkB,EAAE,GAAG,WAAW,EAAO,EACpD,GAAG,IAAI,EACR,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAwB/D"}
@@ -1,18 +0,0 @@
1
- import type { ReactNode, Ref } from 'react';
2
- import type { PreserveAspectRatio } from '../../types/types';
3
- export interface Point {
4
- x: number;
5
- y: number;
6
- }
7
- export interface ResponsiveSVGProps {
8
- width: number;
9
- height: number;
10
- origin?: Point;
11
- preserveAspectRatio?: PreserveAspectRatio;
12
- innerRef?: Ref<SVGSVGElement>;
13
- className?: string;
14
- hide?: boolean;
15
- children: ReactNode;
16
- }
17
- export declare function ResponsiveSVG({ height, width, children, origin, preserveAspectRatio, innerRef, className, }: ResponsiveSVGProps): JSX.Element;
18
- //# sourceMappingURL=ResponsiveSVG.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResponsiveSVG.d.ts","sourceRoot":"","sources":["../../../../src/components/ResponsiveSVG/ResponsiveSVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAuB,EACvB,mBAAqC,EACrC,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAyBlC"}
@@ -1,6 +0,0 @@
1
- export type { Point } from './types/types';
2
- export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG';
3
- export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG';
4
- export { Group } from './components/Group/Group';
5
- export { Line } from './components/Line/Line';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/cjs/index.js DELETED
@@ -1,9 +0,0 @@
1
-
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./svg.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./svg.cjs.development.js')
8
- }
9
-
@@ -1,160 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
7
- var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
8
- var react = require('react');
9
- var useGetParentSize = require('@cutting/use-get-parent-size');
10
- var cx = require('classnames');
11
-
12
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
13
-
14
- var _objectSpread__default = /*#__PURE__*/_interopDefault(_objectSpread);
15
- var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);
16
- var cx__default = /*#__PURE__*/_interopDefault(cx);
17
-
18
- function ResponsiveSVG(_ref) {
19
- let {
20
- height,
21
- width,
22
- children,
23
- origin = {
24
- x: 0,
25
- y: 0
26
- },
27
- preserveAspectRatio = 'xMaxYMid meet',
28
- innerRef,
29
- className
30
- } = _ref;
31
- const aspect = width / height;
32
- const adjustedHeight = Math.ceil(width / aspect);
33
- return jsxRuntime.jsx("div", {
34
- "data-selector": "cutting-svg-container",
35
- style: {
36
- position: 'relative',
37
- overflow: 'visible',
38
- height: '1px'
39
- },
40
- children: jsxRuntime.jsx("svg", {
41
- style: {
42
- overflow: 'visible'
43
- },
44
- className: className,
45
- preserveAspectRatio: preserveAspectRatio,
46
- viewBox: "".concat(origin.x, " ").concat(origin.y, " ").concat(width, " ").concat(adjustedHeight),
47
- ref: innerRef,
48
- children: children
49
- })
50
- });
51
- }
52
-
53
- const _excluded$2 = ["debounceDelay"],
54
- _excluded2 = ["parentRef", "children", "style", "scale", "align", "options"];
55
- const DefaultStyle = {
56
- display: 'flex',
57
- flexDirection: 'column',
58
- flexGrow: 1,
59
- flexShrink: 1,
60
- flexBasis: '0%',
61
- overflow: 'hidden'
62
- };
63
- function ParentsizeSVG(_ref) {
64
- let {
65
- parentRef,
66
- children,
67
- style = DefaultStyle,
68
- scale = 1,
69
- align = 'none',
70
- options: {
71
- debounceDelay = 50
72
- } = {}
73
- } = _ref,
74
- optionsRest = _objectWithoutProperties__default["default"](_ref.options, _excluded$2),
75
- rest = _objectWithoutProperties__default["default"](_ref, _excluded2);
76
-
77
- const {
78
- width,
79
- height
80
- } = useGetParentSize.useParentSize(parentRef, _objectSpread__default["default"]({
81
- debounceDelay
82
- }, optionsRest));
83
- react.useEffect(() => {
84
- if (!parentRef.current) {
85
- return;
86
- }
87
-
88
- for (const [key, value] of Object.entries(style)) {
89
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
- parentRef.current.style[key] = value;
91
- }
92
- }, [parentRef, style]);
93
- const transform = align === 'center' ? "translate(".concat(width / 2, ",").concat(height / 2 - 20, ") scale(").concat(scale, ")") : "translate(0,0) scale(".concat(scale, ")");
94
- return jsxRuntime.jsx(ResponsiveSVG, _objectSpread__default["default"](_objectSpread__default["default"]({
95
- width: width,
96
- height: height
97
- }, rest), {}, {
98
- children: jsxRuntime.jsx("g", {
99
- transform: transform,
100
- children: children
101
- })
102
- }));
103
- }
104
-
105
- const _excluded$1 = ["y", "x", "transform", "className", "children", "innerRef"];
106
- function Group(_ref) {
107
- let {
108
- y = 0,
109
- x = 0,
110
- transform,
111
- className,
112
- children,
113
- innerRef
114
- } = _ref,
115
- restProps = _objectWithoutProperties__default["default"](_ref, _excluded$1);
116
-
117
- return jsxRuntime.jsx("g", _objectSpread__default["default"](_objectSpread__default["default"]({
118
- ref: innerRef,
119
- className: cx__default["default"]('visx-group', className),
120
- transform: transform || "translate(".concat(x, ", ").concat(y, ")")
121
- }, restProps), {}, {
122
- children: children
123
- }));
124
- }
125
-
126
- const _excluded = ["from", "to", "fill", "className", "innerRef"];
127
- function Line(_ref) {
128
- let {
129
- from = {
130
- x: 0,
131
- y: 0
132
- },
133
- to = {
134
- x: 1,
135
- y: 1
136
- },
137
- fill = 'transparent',
138
- className,
139
- innerRef
140
- } = _ref,
141
- restProps = _objectWithoutProperties__default["default"](_ref, _excluded);
142
-
143
- const isRectilinear = from.x === to.x || from.y === to.y;
144
- return jsxRuntime.jsx("line", _objectSpread__default["default"]({
145
- ref: innerRef,
146
- className: cx__default["default"]('visx-line', className),
147
- x1: from.x,
148
- y1: from.y,
149
- x2: to.x,
150
- y2: to.y,
151
- fill: fill,
152
- shapeRendering: isRectilinear ? 'crispEdges' : 'auto'
153
- }, restProps));
154
- }
155
-
156
- exports.Group = Group;
157
- exports.Line = Line;
158
- exports.ParentsizeSVG = ParentsizeSVG;
159
- exports.ResponsiveSVG = ResponsiveSVG;
160
- //# sourceMappingURL=svg.cjs.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"svg.cjs.development.js","sources":["../../src/components/ResponsiveSVG/ResponsiveSVG.tsx","../../src/components/ParentsizeSVG/ParentsizeSVG.tsx","../../src/components/Group/Group.tsx","../../src/components/Line/Line.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { PreserveAspectRatio } from '../../types/types';\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface ResponsiveSVGProps {\n width: number;\n height: number;\n origin?: Point;\n preserveAspectRatio?: PreserveAspectRatio;\n innerRef?: Ref<SVGSVGElement>;\n className?: string;\n hide?: boolean;\n children: ReactNode;\n}\n\nexport function ResponsiveSVG({\n height,\n width,\n children,\n origin = { x: 0, y: 0 },\n preserveAspectRatio = 'xMaxYMid meet',\n innerRef,\n className,\n}: ResponsiveSVGProps): JSX.Element {\n const aspect = width / height;\n\n const adjustedHeight = Math.ceil(width / aspect);\n\n return (\n <div\n data-selector=\"cutting-svg-container\"\n style={{\n position: 'relative',\n overflow: 'visible',\n height: '1px',\n }}\n >\n <svg\n style={{ overflow: 'visible' }}\n className={className}\n preserveAspectRatio={preserveAspectRatio}\n viewBox={`${origin.x} ${origin.y} ${width} ${adjustedHeight}`}\n ref={innerRef}\n >\n {children}\n </svg>\n </div>\n );\n}\n","import type { CSSProperties, PropsWithChildren, RefObject } from 'react';\nimport { useEffect } from 'react';\nimport type { UseParentSizeOptions } from '@cutting/use-get-parent-size';\nimport { useParentSize } from '@cutting/use-get-parent-size';\nimport type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';\nimport { ResponsiveSVG } from '../ResponsiveSVG/ResponsiveSVG';\n\ntype Align = 'none' | 'center';\n\nexport type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {\n parentRef: RefObject<E>;\n style?: CSSProperties;\n align?: Align;\n scale?: number;\n options?: Partial<UseParentSizeOptions>;\n} & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;\n\nexport const DefaultStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: '0%',\n overflow: 'hidden',\n} as const;\n\nexport function ParentsizeSVG<E extends HTMLElement>({\n parentRef,\n children,\n style = DefaultStyle,\n scale = 1,\n align = 'none',\n options: { debounceDelay = 50, ...optionsRest } = {},\n ...rest\n}: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null {\n const { width, height } = useParentSize(parentRef, { debounceDelay, ...optionsRest });\n\n useEffect(() => {\n if (!parentRef.current) {\n return;\n }\n\n for (const [key, value] of Object.entries(style)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parentRef.current.style[key as any] = value;\n }\n }, [parentRef, style]);\n\n const transform =\n align === 'center'\n ? `translate(${width / 2},${height / 2 - 20}) scale(${scale})`\n : `translate(0,0) scale(${scale})`;\n\n return (\n <ResponsiveSVG width={width} height={height} {...rest}>\n <g transform={transform}>{children}</g>\n </ResponsiveSVG>\n );\n}\n","import cx from 'classnames';\n\ntype GroupOnlyProps = {\n /** Top offset applied to `<g/>`. */\n y?: number;\n /** Left offset applied to `<g/>`. */\n x?: number;\n /** Override `x` and `y` to provide the entire `transform` string. */\n transform?: string;\n className?: string;\n children?: React.ReactNode;\n innerRef?: React.Ref<SVGGElement>;\n};\n\ntype GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;\n\nexport function Group({\n y = 0,\n x = 0,\n transform,\n className,\n children,\n innerRef,\n ...restProps\n}: GroupProps): JSX.Element {\n return (\n <g\n ref={innerRef}\n className={cx('visx-group', className)}\n transform={transform || `translate(${x}, ${y})`}\n {...restProps}\n >\n {children}\n </g>\n );\n}\n","import cx from 'classnames';\nimport type { AddSVGProps, Point } from '../../types/types';\n\nexport type LineProps = {\n className?: string;\n innerRef?: React.Ref<SVGLineElement>;\n fill?: string;\n /** Starting x,y point of the line. */\n from?: Point;\n /** Ending x,y point of the line. */\n to?: Point;\n};\n\nexport function Line({\n from = { x: 0, y: 0 },\n to = { x: 1, y: 1 },\n fill = 'transparent',\n className,\n innerRef,\n ...restProps\n}: AddSVGProps<LineProps, SVGLineElement>): JSX.Element {\n const isRectilinear = from.x === to.x || from.y === to.y;\n\n return (\n <line\n ref={innerRef}\n className={cx('visx-line', className)}\n x1={from.x}\n y1={from.y}\n x2={to.x}\n y2={to.y}\n fill={fill}\n shapeRendering={isRectilinear ? 'crispEdges' : 'auto'}\n {...restProps}\n />\n );\n}\n"],"names":["ResponsiveSVG","height","width","children","origin","x","y","preserveAspectRatio","innerRef","className","aspect","adjustedHeight","Math","ceil","_jsx","style","position","overflow","viewBox","ref","DefaultStyle","display","flexDirection","flexGrow","flexShrink","flexBasis","ParentsizeSVG","parentRef","scale","align","options","debounceDelay","optionsRest","_excluded","rest","_objectWithoutProperties","useParentSize","_objectSpread","useEffect","current","key","value","Object","entries","transform","Group","restProps","cx","Line","from","to","fill","isRectilinear","x1","y1","x2","y2","shapeRendering"],"mappings":";;;;;;;;;;;;;;;;;AAmBgB,SAAAA,aAAA,CAQK,IAAA,EAAA;AAAA,EARS,IAAA;AAC5BC,IAAAA,MAD4B;AAE5BC,IAAAA,KAF4B;AAG5BC,IAAAA,QAH4B;AAI5BC,IAAAA,MAAM,GAAG;AAAEC,MAAAA,CAAC,EAAE,CAAL;AAAQC,MAAAA,CAAC,EAAE,CAAA;AAAX,KAJmB;AAK5BC,IAAAA,mBAAmB,GAAG,eALM;AAM5BC,IAAAA,QAN4B;AAO5BC,IAAAA,SAAAA;AAP4B,GAQT,GAAA,IAAA,CAAA;AACnB,EAAA,MAAMC,MAAM,GAAGR,KAAK,GAAGD,MAAvB,CAAA;AAEA,EAAMU,MAAAA,cAAc,GAAGC,IAAI,CAACC,IAAL,CAAUX,KAAK,GAAGQ,MAAlB,CAAvB,CAAA;AAEA,EACEI,OAAAA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AAL,KAAW4C,EAAE,CAAC5C,CAAvD,CAAA;AAEA,EACEQ,OAAAA,cACE,CAAA,MAAA,EAAAuB,iCAAA,CAAA;AAAAlB,IAAAA,GAAG,EAAEX,QAAL;AACAC,IAAAA,SAAS,EAAEsC,sBAAE,CAAC,WAAD,EAActC,SAAd,CADb;AAEA4C,IAAAA,EAAE,EAAEJ,IAAI,CAAC5C,CAFT;AAGAiD,IAAAA,EAAE,EAAEL,IAAI,CAAC3C,CAHT;AAIAiD,IAAAA,EAAE,EAAEL,EAAE,CAAC7C,CAJP;AAKAmD,IAAAA,EAAE,EAAEN,EAAE,CAAC5C,CALP;AAMA6C,IAAAA,IAAI,EAAEA,IANN;AAOAM,IAAAA,cAAc,EAAEL,aAAa,GAAG,YAAH,GAAkB,MAAA;AAP/C,GAAA,EAQIN,SARJ,CAFJ,CAAA,CAAA;AAaD;;;;;;;"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@babel/runtime/helpers/objectSpread2"),r=require("@babel/runtime/helpers/objectWithoutProperties"),n=require("react"),s=require("@cutting/use-get-parent-size"),a=require("classnames");function i(e){return e&&e.__esModule?e:{default:e}}var l=i(t),c=i(r),o=i(a);function f(t){let{height:r,width:n,children:s,origin:a={x:0,y:0},preserveAspectRatio:i="xMaxYMid meet",innerRef:l,className:c}=t;const o=Math.ceil(n/(n/r));return e.jsx("div",{"data-selector":"cutting-svg-container",style:{position:"relative",overflow:"visible",height:"1px"},children:e.jsx("svg",{style:{overflow:"visible"},className:c,preserveAspectRatio:i,viewBox:"".concat(a.x," ").concat(a.y," ").concat(n," ").concat(o),ref:l,children:s})})}const u=["debounceDelay"],d=["parentRef","children","style","scale","align","options"],x={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:"0%",overflow:"hidden"},p=["y","x","transform","className","children","innerRef"],h=["from","to","fill","className","innerRef"];exports.Group=function(t){let{y:r=0,x:n=0,transform:s,className:a,children:i,innerRef:f}=t,u=c.default(t,p);return e.jsx("g",l.default(l.default({ref:f,className:o.default("visx-group",a),transform:s||"translate(".concat(n,", ").concat(r,")")},u),{},{children:i}))},exports.Line=function(t){let{from:r={x:0,y:0},to:n={x:1,y:1},fill:s="transparent",className:a,innerRef:i}=t,f=c.default(t,h);const u=r.x===n.x||r.y===n.y;return e.jsx("line",l.default({ref:i,className:o.default("visx-line",a),x1:r.x,y1:r.y,x2:n.x,y2:n.y,fill:s,shapeRendering:u?"crispEdges":"auto"},f))},exports.ParentsizeSVG=function(t){let{parentRef:r,children:a,style:i=x,scale:o=1,align:p="none",options:{debounceDelay:h=50}={}}=t,y=c.default(t.options,u),m=c.default(t,d);const{width:v,height:g}=s.useParentSize(r,l.default({debounceDelay:h},y));n.useEffect((()=>{if(r.current)for(const[e,t]of Object.entries(i))r.current.style[e]=t}),[r,i]);const b="center"===p?"translate(".concat(v/2,",").concat(g/2-20,") scale(").concat(o,")"):"translate(0,0) scale(".concat(o,")");return e.jsx(f,l.default(l.default({width:v,height:g},m),{},{children:e.jsx("g",{transform:b,children:a})}))},exports.ResponsiveSVG=f;
2
- //# sourceMappingURL=svg.cjs.production.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"svg.cjs.production.min.js","sources":["../../src/components/ResponsiveSVG/ResponsiveSVG.tsx","../../src/components/ParentsizeSVG/ParentsizeSVG.tsx","../../src/components/Group/Group.tsx","../../src/components/Line/Line.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { PreserveAspectRatio } from '../../types/types';\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface ResponsiveSVGProps {\n width: number;\n height: number;\n origin?: Point;\n preserveAspectRatio?: PreserveAspectRatio;\n innerRef?: Ref<SVGSVGElement>;\n className?: string;\n hide?: boolean;\n children: ReactNode;\n}\n\nexport function ResponsiveSVG({\n height,\n width,\n children,\n origin = { x: 0, y: 0 },\n preserveAspectRatio = 'xMaxYMid meet',\n innerRef,\n className,\n}: ResponsiveSVGProps): JSX.Element {\n const aspect = width / height;\n\n const adjustedHeight = Math.ceil(width / aspect);\n\n return (\n <div\n data-selector=\"cutting-svg-container\"\n style={{\n position: 'relative',\n overflow: 'visible',\n height: '1px',\n }}\n >\n <svg\n style={{ overflow: 'visible' }}\n className={className}\n preserveAspectRatio={preserveAspectRatio}\n viewBox={`${origin.x} ${origin.y} ${width} ${adjustedHeight}`}\n ref={innerRef}\n >\n {children}\n </svg>\n </div>\n );\n}\n","import type { CSSProperties, PropsWithChildren, RefObject } from 'react';\nimport { useEffect } from 'react';\nimport type { UseParentSizeOptions } from '@cutting/use-get-parent-size';\nimport { useParentSize } from '@cutting/use-get-parent-size';\nimport type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';\nimport { ResponsiveSVG } from '../ResponsiveSVG/ResponsiveSVG';\n\ntype Align = 'none' | 'center';\n\nexport type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {\n parentRef: RefObject<E>;\n style?: CSSProperties;\n align?: Align;\n scale?: number;\n options?: Partial<UseParentSizeOptions>;\n} & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;\n\nexport const DefaultStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: '0%',\n overflow: 'hidden',\n} as const;\n\nexport function ParentsizeSVG<E extends HTMLElement>({\n parentRef,\n children,\n style = DefaultStyle,\n scale = 1,\n align = 'none',\n options: { debounceDelay = 50, ...optionsRest } = {},\n ...rest\n}: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null {\n const { width, height } = useParentSize(parentRef, { debounceDelay, ...optionsRest });\n\n useEffect(() => {\n if (!parentRef.current) {\n return;\n }\n\n for (const [key, value] of Object.entries(style)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parentRef.current.style[key as any] = value;\n }\n }, [parentRef, style]);\n\n const transform =\n align === 'center'\n ? `translate(${width / 2},${height / 2 - 20}) scale(${scale})`\n : `translate(0,0) scale(${scale})`;\n\n return (\n <ResponsiveSVG width={width} height={height} {...rest}>\n <g transform={transform}>{children}</g>\n </ResponsiveSVG>\n );\n}\n","import cx from 'classnames';\n\ntype GroupOnlyProps = {\n /** Top offset applied to `<g/>`. */\n y?: number;\n /** Left offset applied to `<g/>`. */\n x?: number;\n /** Override `x` and `y` to provide the entire `transform` string. */\n transform?: string;\n className?: string;\n children?: React.ReactNode;\n innerRef?: React.Ref<SVGGElement>;\n};\n\ntype GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;\n\nexport function Group({\n y = 0,\n x = 0,\n transform,\n className,\n children,\n innerRef,\n ...restProps\n}: GroupProps): JSX.Element {\n return (\n <g\n ref={innerRef}\n className={cx('visx-group', className)}\n transform={transform || `translate(${x}, ${y})`}\n {...restProps}\n >\n {children}\n </g>\n );\n}\n","import cx from 'classnames';\nimport type { AddSVGProps, Point } from '../../types/types';\n\nexport type LineProps = {\n className?: string;\n innerRef?: React.Ref<SVGLineElement>;\n fill?: string;\n /** Starting x,y point of the line. */\n from?: Point;\n /** Ending x,y point of the line. */\n to?: Point;\n};\n\nexport function Line({\n from = { x: 0, y: 0 },\n to = { x: 1, y: 1 },\n fill = 'transparent',\n className,\n innerRef,\n ...restProps\n}: AddSVGProps<LineProps, SVGLineElement>): JSX.Element {\n const isRectilinear = from.x === to.x || from.y === to.y;\n\n return (\n <line\n ref={innerRef}\n className={cx('visx-line', className)}\n x1={from.x}\n y1={from.y}\n x2={to.x}\n y2={to.y}\n fill={fill}\n shapeRendering={isRectilinear ? 'crispEdges' : 'auto'}\n {...restProps}\n />\n );\n}\n"],"names":["ResponsiveSVG","_ref","height","width","children","origin","x","y","preserveAspectRatio","innerRef","className","adjustedHeight","Math","ceil","_jsx","style","position","overflow","viewBox","concat","ref","DefaultStyle","display","flexDirection","flexGrow","flexShrink","flexBasis","transform","restProps","_objectWithoutProperties","_excluded","_objectSpread","cx","from","to","fill","isRectilinear","jsx","x1","y1","x2","y2","shapeRendering","parentRef","scale","align","options","debounceDelay","optionsRest","rest","_excluded2","useParentSize","useEffect","current","key","value","Object","entries"],"mappings":"sXAmBgB,SAAAA,EAQKC,GARS,IAAAC,OAC5BA,EAD4BC,MAE5BA,EAF4BC,SAG5BA,EAH4BC,OAI5BA,EAAS,CAAEC,EAAG,EAAGC,EAAG,GAJQC,oBAK5BA,EAAsB,gBALMC,SAM5BA,EAN4BC,UAO5BA,GACmBT,EACnB,MAEMU,EAAiBC,KAAKC,KAAKV,GAFlBA,EAAQD,IAKrBY,OAAAA,EAAAA,IAAA,MAAA,CAAA,gBACgB,wBACdC,MAAO,CACLC,SAAU,WACVC,SAAU,UACVf,OAAQ,OACTE,SAEDU,aACEC,MAAO,CAAEE,SAAU,WACnBP,UAAWA,EACXF,oBAAqBA,EACrBU,QAAO,GAAAC,OAAKd,EAAOC,EAAZ,KAAAa,OAAiBd,EAAOE,EAAxB,KAAAY,OAA6BhB,EAA7B,KAAAgB,OAAsCR,GAC7CS,IAAKX,EAAQL,SAEZA,6FC/BIiB,EAA8B,CACzCC,QAAS,OACTC,cAAe,SACfC,SAAU,EACVC,WAAY,EACZC,UAAW,KACXT,SAAU,gICPN,SAQOhB,GARS,IAAAM,EACpBA,EAAI,EADgBD,EAEpBA,EAAI,EAFgBqB,UAGpBA,EAHoBjB,UAIpBA,EAJoBN,SAKpBA,EALoBK,SAMpBA,GAEWR,EADR2B,EACQC,EAAA,QAAA5B,EAAA6B,GAEThB,OAAAA,MAAA,IAAAiB,EAAA,QAAAA,UAAA,CACEX,IAAKX,EACLC,UAAWsB,EAAAA,QAAG,aAActB,GAC5BiB,UAAWA,GAA0BrB,aAAAA,OAAAA,eAAMC,EAAvB,MAChBqB,GAJN,GAAA,CAIexB,SAEZA,4BCZkCH,GAPpB,IAAAgC,KACnBA,EAAO,CAAE3B,EAAG,EAAGC,EAAG,GADC2B,GAEnBA,EAAK,CAAE5B,EAA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'xMaxYMin' | 'xMinYMid' | 'xMidYMid' | 'xMaxYMid' | 'xMinYMax' | 'xMidYMax' | 'xMaxYMax';
2
- export declare type MeetOrSlice = 'meet' | 'slice';
3
- export declare type PreserveAspectRatio = `${PreserveAspectRatioAlignment} ${MeetOrSlice}`;
4
- export declare type AddSVGProps<Props, Element extends SVGElement> = Props & Omit<React.SVGProps<Element>, keyof Props>;
5
- export interface Point {
6
- x: number;
7
- y: number;
8
- }
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types/types.ts"],"names":[],"mappings":"AAAA,oBAAY,4BAA4B,GACpC,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3C,oBAAY,mBAAmB,GAAG,GAAG,4BAA4B,IAAI,WAAW,EAAE,CAAC;AAEnF,oBAAY,WAAW,CAAC,KAAK,EAAE,OAAO,SAAS,UAAU,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,CAAC,CAAC;AAEhH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX"}
@@ -1 +0,0 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import cx from"classnames";export function Group({y:r=0,x:s=0,transform:e,className:a,children:n,innerRef:t,...m}){return _jsx("g",{ref:t,className:cx("visx-group",a),transform:e||`translate(${s}, ${r})`,...m,children:n})}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../src/components/Group/Group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAgB5B,MAAM,UAAU,KAAK,CAAC,EACpB,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,SAAS,EACD;IACX,OAAO,CACL,YACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,EACtC,SAAS,EAAE,SAAS,IAAI,aAAa,CAAC,KAAK,CAAC,GAAG,KAC3C,SAAS,YAEZ,QAAQ,GACP,CACL,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import cx from"classnames";export function Line({from:e={x:0,y:0},to:s={x:1,y:1},fill:r="transparent",className:x,innerRef:n,...i}){const a=e.x===s.x||e.y===s.y;return _jsx("line",{ref:n,className:cx("visx-line",x),x1:e.x,y1:e.y,x2:s.x,y2:s.y,fill:r,shapeRendering:a?"crispEdges":"auto",...i})}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Line.js","sourceRoot":"","sources":["../../../../src/components/Line/Line.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAa5B,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EACrB,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EACnB,IAAI,GAAG,aAAa,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EAC2B;IACvC,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAEzD,OAAO,CACL,eACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,EACrC,EAAE,EAAE,IAAI,CAAC,CAAC,EACV,EAAE,EAAE,IAAI,CAAC,CAAC,EACV,EAAE,EAAE,EAAE,CAAC,CAAC,EACR,EAAE,EAAE,EAAE,CAAC,CAAC,EACR,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,KACjD,SAAS,GACb,CACH,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useEffect}from"react";import{useParentSize}from"@cutting/use-get-parent-size";import{ResponsiveSVG}from"../ResponsiveSVG/ResponsiveSVG";export const DefaultStyle={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:"0%",overflow:"hidden"};export function ParentsizeSVG({parentRef:e,children:t,style:r=DefaultStyle,scale:n=1,align:s="none",options:{debounceDelay:i=50,...o}={},...l}){const{width:a,height:c}=useParentSize(e,{debounceDelay:i,...o});useEffect((()=>{if(e.current)for(const[t,n]of Object.entries(r))e.current.style[t]=n}),[e,r]);return _jsx(ResponsiveSVG,{width:a,height:c,...l,children:_jsx("g",{transform:"center"===s?`translate(${a/2},${c/2-20}) scale(${n})`:`translate(0,0) scale(${n})`,children:t})})}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParentsizeSVG.js","sourceRoot":"","sources":["../../../../src/components/ParentsizeSVG/ParentsizeSVG.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAY/D,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,QAAQ;CACV,CAAC;AAEX,MAAM,UAAU,aAAa,CAAwB,EACnD,SAAS,EACT,QAAQ,EACR,KAAK,GAAG,YAAY,EACpB,KAAK,GAAG,CAAC,EACT,KAAK,GAAG,MAAM,EACd,OAAO,EAAE,EAAE,aAAa,GAAG,EAAE,EAAE,GAAG,WAAW,EAAE,GAAG,EAAE,EACpD,GAAG,IAAI,EACkC;IACzC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;IAEtF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;YACtB,OAAO;SACR;QAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAChD,8DAA8D;YAC9D,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,GAAU,CAAC,GAAG,KAAK,CAAC;SAC7C;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvB,MAAM,SAAS,GACb,KAAK,KAAK,QAAQ;QAChB,CAAC,CAAC,aAAa,KAAK,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,GAAG;QAC9D,CAAC,CAAC,wBAAwB,KAAK,GAAG,CAAC;IAEvC,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAM,IAAI,YACnD,YAAG,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAK,GACzB,CACjB,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";export function ResponsiveSVG({height:e,width:i,children:s,origin:t={x:0,y:0},preserveAspectRatio:r="xMaxYMid meet",innerRef:o,className:n}){const a=i/e,c=Math.ceil(i/a);return _jsx("div",{"data-selector":"cutting-svg-container",style:{position:"relative",overflow:"visible",height:"1px"},children:_jsx("svg",{style:{overflow:"visible"},className:n,preserveAspectRatio:r,viewBox:`${t.x} ${t.y} ${i} ${c}`,ref:o,children:s})})}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResponsiveSVG.js","sourceRoot":"","sources":["../../../../src/components/ResponsiveSVG/ResponsiveSVG.tsx"],"names":[],"mappings":";AAmBA,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EACvB,mBAAmB,GAAG,eAAe,EACrC,QAAQ,EACR,SAAS,GACU;IACnB,MAAM,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IAE9B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;IAEjD,OAAO,CACL,+BACgB,uBAAuB,EACrC,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,KAAK;SACd,YAED,cACE,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC9B,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,cAAc,EAAE,EAC7D,GAAG,EAAE,QAAQ,YAEZ,QAAQ,GACL,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- export{};
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types/types.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/@types/react/jsx-runtime.d.ts","../src/types/types.ts","../src/components/ResponsiveSVG/ResponsiveSVG.tsx","../node_modules/@cutting/use-get-parent-size/node_modules/@types/react/index.d.ts","../node_modules/@cutting/use-get-parent-size/dist/esm/useParentSize/types.d.ts","../node_modules/@cutting/use-get-parent-size/dist/esm/useParentSize/useParentSize.d.ts","../node_modules/@cutting/use-get-parent-size/dist/esm/index.d.ts","../src/components/ParentsizeSVG/ParentsizeSVG.tsx","../node_modules/classnames/index.d.ts","../src/components/Group/Group.tsx","../src/components/Line/Line.tsx","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/webpack-env/index.d.ts","../node_modules/@cutting/useful-types/global.d.ts","../node_modules/@cutting/use-get-parent-size/node_modules/@types/react/global.d.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"5075b36ab861c8c0c45377cb8c96270d7c65f0eeaf105d53fac6850da61f1027","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"99856c03c8c3158a466ab51bfe9322e864a325632a03eee5f396ec57401ab8ac","affectsGlobalScope":true},"af7fd2870746deed40e130fc0a3966de74e8f52a97ec114d0fbb35876ab05ca9","fdc2fb7650d20725b5071c5ab1f88167aa7fed7d5bcdfd7587e0ebe7098bde81","1296a5ce9e4c670487d9a95d3b89d726918ec1075bdacc2abdc15178e9e3ee3e",{"version":"99856c03c8c3158a466ab51bfe9322e864a325632a03eee5f396ec57401ab8ac","affectsGlobalScope":true},"5be5cef57c4f2ed975d5c25b0f80c90743d30a81070130c72950c97ff07dd081","a07f5f79ed2f1890657db5a8c58221cb9f83d7f0609cb4ea888af4161c061592","c69a59e3e36c8e6ccfbf742458a188e2a929015ed6718d430419401353bc9fc3","6d46dc874cb5d3eb8eff45cd960740ea4ab82cb181d4364b39e4f7256c5d8373","d153cbce75b7e1621eda0a4148748f44edd71ff44cc5351bac1c7787da4d5b05","c72b9978350f95cdb683c82a639306adf59962a9b0df225fb34bc6f564db8916","556899aeccc161beaef2eb2da06268b3a40b62ddb533ff840838865ad5a33094","b6c3dfc96aa0449be1e1fcfc75d0636360a897f060993846b62ade1584fbe3c7","0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"c2ab70bbc7a24c42a790890739dd8a0ba9d2e15038b40dff8163a97a5d148c00","affectsGlobalScope":true},"422dbb183fdced59425ca072c8bd09efaa77ce4e2ab928ec0d8a1ce062d2a45a",{"version":"712ba0d43b44d144dfd01593f61af6e2e21cfae83e834d297643e7973e55ed61","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","98a3ebfa494b46265634a73459050befba5da8fdc6ca0ef9b7269421780f4ff3","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","cc0b61316c4f37393f1f9595e93b673f4184e9d07f4c127165a490ec4a928668","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"bfea28e6162ed21a0aeed181b623dcf250aa79abf49e24a6b7e012655af36d81","affectsGlobalScope":true},"b8aca9d0c81abb02bec9b7621983ae65bde71da6727580070602bd2500a9ce2a","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","10d4796a130577d57003a77b95d8723530bbec84718e364aa2129fa8ffba0378","ad41bb744149e92adb06eb953da195115620a3f2ad48e7d3ae04d10762dae197","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"5d0a9ea09d990b5788f867f1c79d4878f86f7384cb7dab38eecbf22f9efd063d","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"4cd4cff679c9b3d9239fd7bf70293ca4594583767526916af8e5d5a47d0219c7","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"3345c276cab0e76dda86c0fb79104ff915a4580ba0f3e440870e183b1baec476","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","103d70bfbeb3cd3a3f26d1705bf986322d8738c2c143f38ebb743b1e228d7444","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7",{"version":"3a2da34079a2567161c1359316a32e712404b56566c45332ac9dcee015ecce9f","affectsGlobalScope":true},"28a2e7383fd898c386ffdcacedf0ec0845e5d1a86b5a43f25b86bc315f556b79","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"9cafe917bf667f1027b2bb62e2de454ecd2119c80873ad76fc41d941089753b8",{"version":"3a1e422f919c70fca66e94dc641ad8d9732b3d2533ac047b8a9aaca9eea3aa10","affectsGlobalScope":true},{"version":"bcaa86fe5b4017046d3ea6ccd8f06e4a65f15ebf6d8b5dc320c0efdcaf08a61a","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"jsx":4,"module":99,"noFallthroughCasesInSwitch":true,"noUnusedLocals":true,"outDir":"./esm","removeComments":false,"rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":99},"fileIdsList":[[99],[56,99],[59,99],[60,65,99],[61,71,72,79,88,98,99],[61,62,71,79,99],[63,99],[64,65,72,80,99],[65,88,95,99],[66,68,71,79,99],[67,99],[68,69,99],[70,71,99],[71,99],[71,72,73,88,98,99],[71,72,73,88,99],[74,79,88,98,99],[71,72,74,75,79,88,95,98,99],[74,76,88,95,98,99],[56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105],[71,77,99],[78,98,99],[68,71,79,88,99],[80,99],[81,99],[59,82,99],[83,97,99,103],[84,99],[85,99],[71,86,99],[86,87,99,101],[71,88,89,90,99],[88,90,99],[88,89,99],[91,99],[92,99],[71,93,94,99],[93,94,99],[65,79,88,95,99],[96,99],[79,97,99],[60,74,85,98,99],[65,99],[88,99,100],[99,101],[99,102],[60,65,71,73,82,88,98,99,101,103],[88,99,104],[40,41,42,99],[43,99],[48,49,99],[43,48,99],[41,42,99,109],[44,52,99],[44,45,52,99],[43,44,46,50,99],[43,44,45,99],[44,45,46,51,53,54,99],[44,99]],"referencedMap":[[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[56,2],[57,2],[59,3],[60,4],[61,5],[62,6],[63,7],[64,8],[65,9],[66,10],[67,11],[68,12],[69,12],[70,13],[71,14],[72,15],[73,16],[58,1],[105,1],[74,17],[75,18],[76,19],[106,20],[77,21],[78,22],[79,23],[80,24],[81,25],[82,26],[83,27],[84,28],[85,29],[86,30],[87,31],[88,32],[90,33],[89,34],[91,35],[92,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[41,1],[40,1],[43,49],[44,50],[42,1],[107,1],[50,51],[48,50],[49,52],[47,53],[108,1],[52,1],[53,54],[54,55],[51,56],[46,57],[55,58],[45,59]],"exportedModulesMap":[[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[56,2],[57,2],[59,3],[60,4],[61,5],[62,6],[63,7],[64,8],[65,9],[66,10],[67,11],[68,12],[69,12],[70,13],[71,14],[72,15],[73,16],[58,1],[105,1],[74,17],[75,18],[76,19],[106,20],[77,21],[78,22],[79,23],[80,24],[81,25],[82,26],[83,27],[84,28],[85,29],[86,30],[87,31],[88,32],[90,33],[89,34],[91,35],[92,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[41,1],[40,1],[43,49],[44,50],[42,1],[107,1],[50,51],[48,50],[49,52],[47,53],[108,1],[52,1],[53,54],[54,55],[51,56],[46,57],[55,58],[45,59]],"semanticDiagnosticsPerFile":[8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,38,34,35,36,37,1,39,56,57,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,58,105,74,75,76,106,77,78,79,80,81,82,83,84,85,86,87,88,90,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,41,40,43,44,42,107,50,48,49,47,108,52,53,54,51,46,55,45]},"version":"4.6.3"}
@@ -1,15 +0,0 @@
1
- declare type GroupOnlyProps = {
2
- /** Top offset applied to `<g/>`. */
3
- y?: number;
4
- /** Left offset applied to `<g/>`. */
5
- x?: number;
6
- /** Override `x` and `y` to provide the entire `transform` string. */
7
- transform?: string;
8
- className?: string;
9
- children?: React.ReactNode;
10
- innerRef?: React.Ref<SVGGElement>;
11
- };
12
- declare type GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;
13
- export declare function Group({ y, x, transform, className, children, innerRef, ...restProps }: GroupProps): JSX.Element;
14
- export {};
15
- //# sourceMappingURL=Group.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/components/Group/Group.tsx"],"names":[],"mappings":"AAEA,aAAK,cAAc,GAAG;IACpB,oCAAoC;IACpC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CACnC,CAAC;AAEF,aAAK,UAAU,GAAG,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,cAAc,CAAC,CAAC;AAE3F,wBAAgB,KAAK,CAAC,EACpB,CAAK,EACL,CAAK,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAW1B"}
@@ -1,12 +0,0 @@
1
- import type { AddSVGProps, Point } from '../../types/types';
2
- export declare type LineProps = {
3
- className?: string;
4
- innerRef?: React.Ref<SVGLineElement>;
5
- fill?: string;
6
- /** Starting x,y point of the line. */
7
- from?: Point;
8
- /** Ending x,y point of the line. */
9
- to?: Point;
10
- };
11
- export declare function Line({ from, to, fill, className, innerRef, ...restProps }: AddSVGProps<LineProps, SVGLineElement>): JSX.Element;
12
- //# sourceMappingURL=Line.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/components/Line/Line.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE5D,oBAAY,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,oCAAoC;IACpC,EAAE,CAAC,EAAE,KAAK,CAAC;CACZ,CAAC;AAEF,wBAAgB,IAAI,CAAC,EACnB,IAAqB,EACrB,EAAmB,EACnB,IAAoB,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,GAAG,CAAC,OAAO,CAgBtD"}
@@ -1,15 +0,0 @@
1
- import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
2
- import type { UseParentSizeOptions } from '@cutting/use-get-parent-size';
3
- import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';
4
- declare type Align = 'none' | 'center';
5
- export declare type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {
6
- parentRef: RefObject<E>;
7
- style?: CSSProperties;
8
- align?: Align;
9
- scale?: number;
10
- options?: Partial<UseParentSizeOptions>;
11
- } & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;
12
- export declare const DefaultStyle: CSSProperties;
13
- export declare function ParentsizeSVG<E extends HTMLElement>({ parentRef, children, style, scale, align, options: { debounceDelay, ...optionsRest }, ...rest }: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null;
14
- export {};
15
- //# sourceMappingURL=ParentsizeSVG.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParentsizeSVG.d.ts","sourceRoot":"","sources":["../../../../src/components/ParentsizeSVG/ParentsizeSVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,aAAK,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/B,oBAAY,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IACpE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACzC,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAExE,eAAO,MAAM,YAAY,EAAE,aAOjB,CAAC;AAEX,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,EACnD,SAAS,EACT,QAAQ,EACR,KAAoB,EACpB,KAAS,EACT,KAAc,EACd,OAAO,EAAE,EAAE,aAAkB,EAAE,GAAG,WAAW,EAAO,EACpD,GAAG,IAAI,EACR,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAwB/D"}
@@ -1,18 +0,0 @@
1
- import type { ReactNode, Ref } from 'react';
2
- import type { PreserveAspectRatio } from '../../types/types';
3
- export interface Point {
4
- x: number;
5
- y: number;
6
- }
7
- export interface ResponsiveSVGProps {
8
- width: number;
9
- height: number;
10
- origin?: Point;
11
- preserveAspectRatio?: PreserveAspectRatio;
12
- innerRef?: Ref<SVGSVGElement>;
13
- className?: string;
14
- hide?: boolean;
15
- children: ReactNode;
16
- }
17
- export declare function ResponsiveSVG({ height, width, children, origin, preserveAspectRatio, innerRef, className, }: ResponsiveSVGProps): JSX.Element;
18
- //# sourceMappingURL=ResponsiveSVG.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResponsiveSVG.d.ts","sourceRoot":"","sources":["../../../../src/components/ResponsiveSVG/ResponsiveSVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAuB,EACvB,mBAAqC,EACrC,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAyBlC"}
@@ -1,6 +0,0 @@
1
- export type { Point } from './types/types';
2
- export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG';
3
- export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG';
4
- export { Group } from './components/Group/Group';
5
- export { Line } from './components/Line/Line';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/umd/index.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("@babel/runtime/helpers/objectSpread2"),require("@babel/runtime/helpers/objectWithoutProperties"),require("react"),require("@cutting/use-get-parent-size"),require("classnames")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","@babel/runtime/helpers/objectSpread2","@babel/runtime/helpers/objectWithoutProperties","react","@cutting/use-get-parent-size","classnames"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@cutting/svg"]={},e.jsxRuntime,e._objectSpread,e._objectWithoutProperties,e.React,e.useGetParentSize,e.cx)}(this,(function(e,t,n,r,i,s,a){"use strict";function c(e){return e&&e.__esModule?e:{default:e}}var l=c(n),o=c(r),u=c(a);function f(e){let{height:n,width:r,children:i,origin:s={x:0,y:0},preserveAspectRatio:a="xMaxYMid meet",innerRef:c,className:l}=e;const o=Math.ceil(r/(r/n));return t.jsx("div",{"data-selector":"cutting-svg-container",style:{position:"relative",overflow:"visible",height:"1px"},children:t.jsx("svg",{style:{overflow:"visible"},className:l,preserveAspectRatio:a,viewBox:"".concat(s.x," ").concat(s.y," ").concat(r," ").concat(o),ref:c,children:i})})}const d=["debounceDelay"],p=["parentRef","children","style","scale","align","options"],x={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:"0%",overflow:"hidden"},h=["y","x","transform","className","children","innerRef"],m=["from","to","fill","className","innerRef"];e.Group=function(e){let{y:n=0,x:r=0,transform:i,className:s,children:a,innerRef:c}=e,f=o.default(e,h);return t.jsx("g",l.default(l.default({ref:c,className:u.default("visx-group",s),transform:i||"translate(".concat(r,", ").concat(n,")")},f),{},{children:a}))},e.Line=function(e){let{from:n={x:0,y:0},to:r={x:1,y:1},fill:i="transparent",className:s,innerRef:a}=e,c=o.default(e,m);const f=n.x===r.x||n.y===r.y;return t.jsx("line",l.default({ref:a,className:u.default("visx-line",s),x1:n.x,y1:n.y,x2:r.x,y2:r.y,fill:i,shapeRendering:f?"crispEdges":"auto"},c))},e.ParentsizeSVG=function(e){let{parentRef:n,children:r,style:a=x,scale:c=1,align:u="none",options:{debounceDelay:h=50}={}}=e,m=o.default(e.options,d),y=o.default(e,p);const{width:b,height:g}=s.useParentSize(n,l.default({debounceDelay:h},m));i.useEffect((()=>{if(n.current)for(const[e,t]of Object.entries(a))n.current.style[e]=t}),[n,a]);const j="center"===u?"translate(".concat(b/2,",").concat(g/2-20,") scale(").concat(c,")"):"translate(0,0) scale(".concat(c,")");return t.jsx(f,l.default(l.default({width:b,height:g},y),{},{children:t.jsx("g",{transform:j,children:r})}))},e.ResponsiveSVG=f}));
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../src/components/ResponsiveSVG/ResponsiveSVG.tsx","../../src/components/ParentsizeSVG/ParentsizeSVG.tsx","../../src/components/Group/Group.tsx","../../src/components/Line/Line.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { PreserveAspectRatio } from '../../types/types';\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface ResponsiveSVGProps {\n width: number;\n height: number;\n origin?: Point;\n preserveAspectRatio?: PreserveAspectRatio;\n innerRef?: Ref<SVGSVGElement>;\n className?: string;\n hide?: boolean;\n children: ReactNode;\n}\n\nexport function ResponsiveSVG({\n height,\n width,\n children,\n origin = { x: 0, y: 0 },\n preserveAspectRatio = 'xMaxYMid meet',\n innerRef,\n className,\n}: ResponsiveSVGProps): JSX.Element {\n const aspect = width / height;\n\n const adjustedHeight = Math.ceil(width / aspect);\n\n return (\n <div\n data-selector=\"cutting-svg-container\"\n style={{\n position: 'relative',\n overflow: 'visible',\n height: '1px',\n }}\n >\n <svg\n style={{ overflow: 'visible' }}\n className={className}\n preserveAspectRatio={preserveAspectRatio}\n viewBox={`${origin.x} ${origin.y} ${width} ${adjustedHeight}`}\n ref={innerRef}\n >\n {children}\n </svg>\n </div>\n );\n}\n","import type { CSSProperties, PropsWithChildren, RefObject } from 'react';\nimport { useEffect } from 'react';\nimport type { UseParentSizeOptions } from '@cutting/use-get-parent-size';\nimport { useParentSize } from '@cutting/use-get-parent-size';\nimport type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';\nimport { ResponsiveSVG } from '../ResponsiveSVG/ResponsiveSVG';\n\ntype Align = 'none' | 'center';\n\nexport type ParentsizeSVGProps<E extends HTMLElement = HTMLElement> = {\n parentRef: RefObject<E>;\n style?: CSSProperties;\n align?: Align;\n scale?: number;\n options?: Partial<UseParentSizeOptions>;\n} & Partial<Omit<ResponsiveSVGProps, 'innerRef' | 'height' | 'height'>>;\n\nexport const DefaultStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: '0%',\n overflow: 'hidden',\n} as const;\n\nexport function ParentsizeSVG<E extends HTMLElement>({\n parentRef,\n children,\n style = DefaultStyle,\n scale = 1,\n align = 'none',\n options: { debounceDelay = 50, ...optionsRest } = {},\n ...rest\n}: PropsWithChildren<ParentsizeSVGProps<E>>): JSX.Element | null {\n const { width, height } = useParentSize(parentRef, { debounceDelay, ...optionsRest });\n\n useEffect(() => {\n if (!parentRef.current) {\n return;\n }\n\n for (const [key, value] of Object.entries(style)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parentRef.current.style[key as any] = value;\n }\n }, [parentRef, style]);\n\n const transform =\n align === 'center'\n ? `translate(${width / 2},${height / 2 - 20}) scale(${scale})`\n : `translate(0,0) scale(${scale})`;\n\n return (\n <ResponsiveSVG width={width} height={height} {...rest}>\n <g transform={transform}>{children}</g>\n </ResponsiveSVG>\n );\n}\n","import cx from 'classnames';\n\ntype GroupOnlyProps = {\n /** Top offset applied to `<g/>`. */\n y?: number;\n /** Left offset applied to `<g/>`. */\n x?: number;\n /** Override `x` and `y` to provide the entire `transform` string. */\n transform?: string;\n className?: string;\n children?: React.ReactNode;\n innerRef?: React.Ref<SVGGElement>;\n};\n\ntype GroupProps = GroupOnlyProps & Omit<React.SVGProps<SVGGElement>, keyof GroupOnlyProps>;\n\nexport function Group({\n y = 0,\n x = 0,\n transform,\n className,\n children,\n innerRef,\n ...restProps\n}: GroupProps): JSX.Element {\n return (\n <g\n ref={innerRef}\n className={cx('visx-group', className)}\n transform={transform || `translate(${x}, ${y})`}\n {...restProps}\n >\n {children}\n </g>\n );\n}\n","import cx from 'classnames';\nimport type { AddSVGProps, Point } from '../../types/types';\n\nexport type LineProps = {\n className?: string;\n innerRef?: React.Ref<SVGLineElement>;\n fill?: string;\n /** Starting x,y point of the line. */\n from?: Point;\n /** Ending x,y point of the line. */\n to?: Point;\n};\n\nexport function Line({\n from = { x: 0, y: 0 },\n to = { x: 1, y: 1 },\n fill = 'transparent',\n className,\n innerRef,\n ...restProps\n}: AddSVGProps<LineProps, SVGLineElement>): JSX.Element {\n const isRectilinear = from.x === to.x || from.y === to.y;\n\n return (\n <line\n ref={innerRef}\n className={cx('visx-line', className)}\n x1={from.x}\n y1={from.y}\n x2={to.x}\n y2={to.y}\n fill={fill}\n shapeRendering={isRectilinear ? 'crispEdges' : 'auto'}\n {...restProps}\n />\n );\n}\n"],"names":["ResponsiveSVG","_ref","height","width","children","origin","x","y","preserveAspectRatio","innerRef","className","adjustedHeight","Math","ceil","_jsx","style","position","overflow","viewBox","concat","ref","DefaultStyle","display","flexDirection","flexGrow","flexShrink","flexBasis","transform","restProps","_objectWithoutProperties","_excluded","_objectSpread","cx","from","to","fill","isRectilinear","jsx","x1","y1","x2","y2","shapeRendering","parentRef","scale","align","options","debounceDelay","optionsRest","rest","_excluded2","useParentSize","useEffect","current","key","value","Object","entries"],"mappings":"6xBAmBgB,SAAAA,EA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,IAAM4B,EAAG5B,GAAK2B,EAAK1B,IAAM2B,EAAG3B,EAGrDO,OAAAA,EACEuB,IAAA,OAAAN,UAAA,CAAAX,IAAKX,EACLC,UAAWsB,EAAAA,QAAG,YAAatB,GAC3B4B,GAAIL,EAAK3B,EACTiC,GAAIN,EAAK1B,EACTiC,GAAIN,EAAG5B,EACPmC,GAAIP,EAAG3B,EACP4B,KAAMA,EACNO,eAAgBN,EAAgB,aAAe,QAC3CR,qBFPM,SAQ2B3B,GARU,IAAA0C,UACnDA,EADmDvC,SAEnDA,EAFmDW,MAGnDA,EAAQM,EAH2CuB,MAInDA,EAAQ,EAJ2CC,MAKnDA,EAAQ,OACRC,SAASC,cAAEA,EAAgB,IAAuB,IAET9C,EAFP+C,cAAlCF,QAEyChB,GADtCmB,EACsCpB,EAAA,QAAA5B,EAAAiD,GACnC,MAAA/C,MAAEA,EAAFD,OAASA,GAAWiD,EAAaA,cAACR,EAADZ,UAAA,CAAcgB,cAAAA,GAAkBC,IAEvEI,EAAAA,WAAU,KACR,GAAKT,EAAUU,QAIf,IAAK,MAAOC,EAAKC,KAAUC,OAAOC,QAAQ1C,GAExC4B,EAAUU,QAAQtC,MAAMuC,GAAcC,IAEvC,CAACZ,EAAW5B,IAEf,MAAMY,EACM,WAAVkB,EAAA,aAAA1B,OACiBhB,EAAQ,cAAKD,EAAS,EAAI,sBAAa0C,EADxD,KAAA,wBAAAzB,OAE4ByB,EAH9B,KAME9B,OAAAA,MAACd,uBAAcG,MAAOA,EAAOD,OAAQA,GAAY+C,OAAI7C,SACnDU,EAAGuB,IAAA,IAAA,CAAAV,UAAWA,WAAYvB"}
@@ -1,9 +0,0 @@
1
- export declare type PreserveAspectRatioAlignment = 'xMinYMin' | 'xMidYMin' | 'xMaxYMin' | 'xMinYMid' | 'xMidYMid' | 'xMaxYMid' | 'xMinYMax' | 'xMidYMax' | 'xMaxYMax';
2
- export declare type MeetOrSlice = 'meet' | 'slice';
3
- export declare type PreserveAspectRatio = `${PreserveAspectRatioAlignment} ${MeetOrSlice}`;
4
- export declare type AddSVGProps<Props, Element extends SVGElement> = Props & Omit<React.SVGProps<Element>, keyof Props>;
5
- export interface Point {
6
- x: number;
7
- y: number;
8
- }
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types/types.ts"],"names":[],"mappings":"AAAA,oBAAY,4BAA4B,GACpC,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3C,oBAAY,mBAAmB,GAAG,GAAG,4BAA4B,IAAI,WAAW,EAAE,CAAC;AAEnF,oBAAY,WAAW,CAAC,KAAK,EAAE,OAAO,SAAS,UAAU,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,CAAC,CAAC;AAEhH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX"}