@cutting/svg 4.46.0 → 4.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -1
- package/.turbo/turbo-build.log +5 -11
- package/CHANGELOG.md +28 -2
- package/demo/{public/index.html → index.html} +2 -1
- package/demo/{App.tsx → src/App.tsx} +4 -3
- package/demo/{global.css.ts → src/global.css.ts} +0 -0
- package/demo/src/index.tsx +21 -0
- package/dist/esm/components/Group/Group.d.ts +14 -14
- package/dist/esm/components/Line/Line.d.ts +11 -11
- package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.d.ts +14 -14
- package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +1 -1
- package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.d.ts +17 -17
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/types.d.ts +8 -8
- package/package.json +29 -31
- package/src/components/ParentsizeSVG/ParentSizeSVG.test.tsx +1 -1
- package/src/components/ParentsizeSVG/ParentsizeSVG.tsx +2 -2
- package/src/components/ResponsiveSVG/ResponsiveSVG.test.tsx +6 -5
- package/src/components/ResponsiveSVG/ResponsiveSVG.tsx +1 -1
- package/src/index.ts +4 -4
- package/vite.config.ts +30 -0
- package/.vscode/launch.json +0 -28
- package/build.config.js +0 -10
- package/demo/index.tsx +0 -16
- package/dist/cjs/components/Group/Group.d.ts +0 -15
- package/dist/cjs/components/Group/Group.d.ts.map +0 -1
- package/dist/cjs/components/Line/Line.d.ts +0 -12
- package/dist/cjs/components/Line/Line.d.ts.map +0 -1
- package/dist/cjs/components/ParentsizeSVG/ParentsizeSVG.d.ts +0 -15
- package/dist/cjs/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +0 -1
- package/dist/cjs/components/ResponsiveSVG/ResponsiveSVG.d.ts +0 -18
- package/dist/cjs/components/ResponsiveSVG/ResponsiveSVG.d.ts.map +0 -1
- package/dist/cjs/index.d.ts +0 -6
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -9
- package/dist/cjs/svg.cjs.development.js +0 -160
- package/dist/cjs/svg.cjs.development.js.map +0 -1
- package/dist/cjs/svg.cjs.production.min.js +0 -2
- package/dist/cjs/svg.cjs.production.min.js.map +0 -1
- package/dist/cjs/types/types.d.ts +0 -9
- package/dist/cjs/types/types.d.ts.map +0 -1
- package/dist/esm/components/Group/Group.js +0 -1
- package/dist/esm/components/Group/Group.js.map +0 -1
- package/dist/esm/components/Line/Line.js +0 -1
- package/dist/esm/components/Line/Line.js.map +0 -1
- package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.js +0 -1
- package/dist/esm/components/ParentsizeSVG/ParentsizeSVG.js.map +0 -1
- package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.js +0 -1
- package/dist/esm/components/ResponsiveSVG/ResponsiveSVG.js.map +0 -1
- package/dist/esm/types/types.js +0 -1
- package/dist/esm/types/types.js.map +0 -1
- package/dist/tsconfig.dist.tsbuildinfo +0 -1
- package/dist/umd/components/Group/Group.d.ts +0 -15
- package/dist/umd/components/Group/Group.d.ts.map +0 -1
- package/dist/umd/components/Line/Line.d.ts +0 -12
- package/dist/umd/components/Line/Line.d.ts.map +0 -1
- package/dist/umd/components/ParentsizeSVG/ParentsizeSVG.d.ts +0 -15
- package/dist/umd/components/ParentsizeSVG/ParentsizeSVG.d.ts.map +0 -1
- package/dist/umd/components/ResponsiveSVG/ResponsiveSVG.d.ts +0 -18
- package/dist/umd/components/ResponsiveSVG/ResponsiveSVG.d.ts.map +0 -1
- package/dist/umd/index.d.ts +0 -6
- package/dist/umd/index.d.ts.map +0 -1
- package/dist/umd/index.js +0 -2
- package/dist/umd/index.js.map +0 -1
- package/dist/umd/types/types.d.ts +0 -9
- package/dist/umd/types/types.d.ts.map +0 -1
package/.eslintrc.json
CHANGED
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
@cutting/svg:build: cache hit, replaying output
|
|
1
|
+
@cutting/svg:build: cache hit, replaying output 7e3e6dc81983bac2
|
|
2
2
|
@cutting/svg:build:
|
|
3
|
-
@cutting/svg:build: > @cutting/svg@4.
|
|
3
|
+
@cutting/svg:build: > @cutting/svg@4.48.0 build /home/runner/work/cuttingedge/cuttingedge/packages/svg
|
|
4
4
|
@cutting/svg:build: > NODE_ENV=production devtools rollup
|
|
5
5
|
@cutting/svg:build:
|
|
6
6
|
@cutting/svg:build: DEBUG using tsconfig.dist.json
|
|
7
|
-
@cutting/svg:build: WARNING emptying dist /home/runner/work/cuttingedge/cuttingedge/packages/svg/dist
|
|
8
7
|
@cutting/svg:build: START using input file index.ts for @cutting/svg
|
|
9
8
|
@cutting/svg:build:
|
|
10
9
|
@cutting/svg:build: INFO Generating @cutting/svg bundle.
|
|
11
|
-
@cutting/svg:build: INFO writing
|
|
12
|
-
@cutting/svg:build: INFO
|
|
10
|
+
@cutting/svg:build: INFO writing index.min.js for @cutting/svg
|
|
11
|
+
@cutting/svg:build: INFO preserveModules is false
|
|
13
12
|
@cutting/svg:build: INFO writing index.js for @cutting/svg
|
|
14
|
-
@cutting/svg:build:
|
|
15
|
-
@cutting/svg:build: No name was provided for external module 'react/jsx-runtime' in output.globals – guessing 'jsxRuntime'
|
|
16
|
-
@cutting/svg:build: No name was provided for external module '@babel/runtime/helpers/objectSpread2' in output.globals – guessing '_objectSpread'
|
|
17
|
-
@cutting/svg:build: No name was provided for external module '@babel/runtime/helpers/objectWithoutProperties' in output.globals – guessing '_objectWithoutProperties'
|
|
18
|
-
@cutting/svg:build: No name was provided for external module '@cutting/use-get-parent-size' in output.globals – guessing 'useGetParentSize'
|
|
19
|
-
@cutting/svg:build: No name was provided for external module 'classnames' in output.globals – guessing 'cx'
|
|
13
|
+
@cutting/svg:build: DEBUG copying assets to /home/runner/work/cuttingedge/cuttingedge/packages/svg/dist
|
|
20
14
|
@cutting/svg:build: DONE finished building
|
|
21
15
|
@cutting/svg:build:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
# @cutting/svg
|
|
2
2
|
|
|
3
|
+
## 4.48.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6d9b0d40: remove @vanilla-extract/babel-plugin
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [6d9b0d40]
|
|
12
|
+
- @cutting/react-abortable-fetch@0.31.0
|
|
13
|
+
- @cutting/use-get-parent-size@1.22.0
|
|
14
|
+
- @cutting/util@4.54.0
|
|
15
|
+
|
|
16
|
+
## 4.47.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- 7100e435: kill webpack
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [7100e435]
|
|
25
|
+
- @cutting/react-abortable-fetch@0.30.0
|
|
26
|
+
- @cutting/use-get-parent-size@1.21.0
|
|
27
|
+
- @cutting/util@4.53.0
|
|
28
|
+
|
|
3
29
|
## 4.46.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
6
32
|
|
|
7
|
-
-
|
|
33
|
+
- d0f474b0: Release new esm versions of packages
|
|
8
34
|
|
|
9
35
|
### Patch Changes
|
|
10
36
|
|
|
11
|
-
- Updated dependencies [
|
|
37
|
+
- Updated dependencies [d0f474b0]
|
|
12
38
|
- @cutting/use-get-parent-size@1.20.0
|
|
13
39
|
- @cutting/util@4.52.0
|
|
14
40
|
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
7
7
|
<meta name="theme-color" content="#000000">
|
|
8
8
|
<link rel="shortcut icon" href="/favicon.ico">
|
|
9
|
-
<title>@cutting/
|
|
9
|
+
<title>@cutting/component-library</title>
|
|
10
10
|
</head>
|
|
11
11
|
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
|
14
|
+
<script type="module" src="src/index.tsx"></script>
|
|
14
15
|
</body>
|
|
15
16
|
|
|
16
17
|
</html>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
|
|
1
2
|
import * as styles from './global.css';
|
|
2
3
|
import '@cutting/component-library/styles.css';
|
|
3
4
|
import { useRef } from 'react';
|
|
4
|
-
import { ApplicationLayout
|
|
5
|
-
import { ParentsizeSVG } from '
|
|
5
|
+
import { ApplicationLayout } from '@cutting/component-library';
|
|
6
|
+
import { ParentsizeSVG } from '../../src/components/ParentsizeSVG/ParentsizeSVG';
|
|
6
7
|
|
|
7
8
|
export function App(): JSX.Element {
|
|
8
9
|
const ref = useRef<HTMLDivElement>(null);
|
|
9
10
|
return (
|
|
10
|
-
<ApplicationLayout heading="@cutting/svg"
|
|
11
|
+
<ApplicationLayout heading="@cutting/svg" theme="salesTheme">
|
|
11
12
|
<div className={styles.container} ref={ref}>
|
|
12
13
|
<ParentsizeSVG parentRef={ref} options={{ debounceDelay: 10 }}>
|
|
13
14
|
<rect
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { App } from './App';
|
|
4
|
+
import { assert } from 'assert-ts';
|
|
5
|
+
|
|
6
|
+
export const container = document.getElementById('root');
|
|
7
|
+
|
|
8
|
+
assert(!!container, `no container found for #root`);
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
const root = createRoot(container);
|
|
12
|
+
|
|
13
|
+
const render = (Component: ComponentType) => {
|
|
14
|
+
root.render(<Component />);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
render(App);
|
|
18
|
+
|
|
19
|
+
if (import.meta.hot) {
|
|
20
|
+
import.meta.hot.accept('./App', () => import('./App').then((m) => render(m.App)));
|
|
21
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
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 {};
|
|
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
15
|
//# sourceMappingURL=Group.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
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;
|
|
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
12
|
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
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 {};
|
|
1
|
+
import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
|
|
2
|
+
import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG.js';
|
|
3
|
+
import type { UseParentSizeOptions } from '@cutting/use-get-parent-size';
|
|
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
15
|
//# sourceMappingURL=ParentsizeSVG.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKzE,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 +1,18 @@
|
|
|
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;
|
|
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
18
|
//# sourceMappingURL=ResponsiveSVG.d.ts.map
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
1
|
+
export type { Point } from './types/types';
|
|
2
|
+
export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG.js';
|
|
3
|
+
export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG.js';
|
|
4
|
+
export { Group } from './components/Group/Group.js';
|
|
5
|
+
export { Line } from './components/Line/Line.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,6CAA6C,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useEffect as t}from"react";import{useParentSize as r}from"@cutting/use-get-parent-size";import n from"classnames";function i(t){let{height:r,width:n,children:i,origin:s={x:0,y:0},preserveAspectRatio:l="xMaxYMid meet",innerRef:o,className:a}=t;const c=Math.ceil(n/(n/r));return e("div",{"data-testid":"cutting-svg-container",style:{position:"relative",overflow:"visible",height:"1px"},children:e("svg",{style:{overflow:"visible"},className:a,preserveAspectRatio:l,viewBox:`${s.x} ${s.y} ${n} ${c}`,ref:o,children:i})})}const s={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:"0%",overflow:"hidden"};function l(n){let{parentRef:l,children:o,style:a=s,scale:c=1,align:f="none",options:{debounceDelay:x=50,...h}={},...d}=n;const{width:m,height:p}=r(l,{debounceDelay:x,...h});return t((()=>{if(l.current)for(const[e,t]of Object.entries(a))l.current.style[e]=t}),[l,a]),e(i,{width:m,height:p,...d,children:e("g",{transform:"center"===f?`translate(${m/2},${p/2-20}) scale(${c})`:`translate(0,0) scale(${c})`,children:o})})}function o(t){let{y:r=0,x:i=0,transform:s,className:l,children:o,innerRef:a,...c}=t;return e("g",{ref:a,className:n("visx-group",l),transform:s||`translate(${i}, ${r})`,...c,children:o})}function a(t){let{from:r={x:0,y:0},to:i={x:1,y:1},fill:s="transparent",className:l,innerRef:o,...a}=t;const c=r.x===i.x||r.y===i.y;return e("line",{ref:o,className:n("visx-line",l),x1:r.x,y1:r.y,x2:i.x,y2:i.y,fill:s,shapeRendering:c?"crispEdges":"auto",...a})}export{o as Group,a as Line,l as ParentsizeSVG,i as ResponsiveSVG};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
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-testid=\"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 type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG.js';\nimport type { UseParentSizeOptions } from '@cutting/use-get-parent-size';\nimport { useEffect } from 'react';\nimport { useParentSize } from '@cutting/use-get-parent-size';\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","ref","DefaultStyle","display","flexDirection","flexGrow","flexShrink","flexBasis","ParentsizeSVG","parentRef","scale","align","options","debounceDelay","optionsRest","rest","useParentSize","useEffect","current","key","value","Object","entries","transform","Group","restProps","cx","Line","from","to","fill","isRectilinear","x1","y1","x2","y2","shapeRendering"],"mappings":"iKAmBgB,SAAAA,EAQKC,GAAA,IARSC,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,IAIvB,OACEY,EAAA,MAAA,CAAA,cACc,wBACZC,MAAO,CACLC,SAAU,WACVC,SAAU,UACVf,OAAQ,OACTE,SAEDU,SACEC,MAAO,CAAEE,SAAU,WACnBP,UAAWA,EACXF,oBAAqBA,EACrBU,QAAS,GAAGb,EAAOC,KAAKD,EAAOE,KAAKJ,KAASQ,IAC7CQ,IAAKV,EAAQL,SAEZA,KAIR,CCnCM,MAAMgB,EAA8B,CACzCC,QAAS,OACTC,cAAe,SACfC,SAAU,EACVC,WAAY,EACZC,UAAW,KACXR,SAAU,UAGI,SAAAS,EAQ2BzB,GAAA,IARU0B,UACnDA,EADmDvB,SAEnDA,EAFmDW,MAGnDA,EAAQK,EAH2CQ,MAInDA,EAAQ,EAJ2CC,MAKnDA,EAAQ,OACRC,SAASC,cAAEA,EAAgB,MAAOC,GAAgB,CANC,KAOhDC,GACsChC,EACzC,MAAME,MAAEA,EAAFD,OAASA,GAAWgC,EAAcP,EAAW,CAAEI,mBAAkBC,IAkBvE,OAhBAG,GAAU,KACR,GAAKR,EAAUS,QAIf,IAAK,MAAOC,EAAKC,KAAUC,OAAOC,QAAQzB,GAExCY,EAAUS,QAAQrB,MAAMsB,GAAcC,CACvC,GACA,CAACX,EAAWZ,IAQbD,EAACd,EAAa,CAACG,MAAOA,EAAOD,OAAQA,KAAY+B,EAAI7B,SACnDU,EAAG,IAAA,CAAA2B,UANK,WAAVZ,EACI,aAAa1B,EAAQ,KAAKD,EAAS,EAAI,aAAa0B,KACpD,wBAAwBA,cAIAxB,KAG/B,CC1CK,SAAUsC,EAQHzC,GAAA,IARSM,EACpBA,EAAI,EADgBD,EAEpBA,EAAI,EAFgBmC,UAGpBA,EAHoB/B,UAIpBA,EAJoBN,SAKpBA,EALoBK,SAMpBA,KACGkC,GACQ1C,EACX,OACEa,EAAA,IAAA,CACEK,IAAKV,EACLC,UAAWkC,EAAG,aAAclC,GAC5B+B,UAAWA,GAA0B,aAAAnC,MAAMC,QACvCoC,EAASvC,SAEZA,GAGN,UCtBeyC,EAOyB5C,GAAA,IAPpB6C,KACnBA,EAAO,CAAExC,EAAG,EAAGC,EAAG,GADCwC,GAEnBA,EAAK,CAAEzC,EAAG,EAAGC,EAAG,GAFGyC,KAGnBA,EAAO,cAHYtC,UAInBA,EAJmBD,SAKnBA,KACGkC,GACoC1C,EACvC,MAAMgD,EAAgBH,EAAKxC,IAAMyC,EAAGzC,GAAKwC,EAAKvC,IAAMwC,EAAGxC,EAEvD,OACEO,EACE,OAAA,CAAAK,IAAKV,EACLC,UAAWkC,EAAG,YAAalC,GAC3BwC,GAAIJ,EAAKxC,EACT6C,GAAIL,EAAKvC,EACT6C,GAAIL,EAAGzC,EACP+C,GAAIN,EAAGxC,EACPyC,KAAMA,EACNM,eAAgBL,EAAgB,aAAe,UAC3CN,GAGT"}
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
}
|
|
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
9
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,44 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cutting/svg",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.48.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dagda1/cuttingedge.git"
|
|
7
7
|
},
|
|
8
8
|
"module": "dist/esm/index.js",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"sideEffects": [
|
|
12
|
-
"**/*.css",
|
|
13
|
-
"**/*.scss"
|
|
14
|
-
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": false,
|
|
15
11
|
"types": "dist/esm/index.d.ts",
|
|
16
12
|
"license": "MIT",
|
|
17
13
|
"dependencies": {
|
|
18
|
-
"@cutting/
|
|
19
|
-
"@cutting/
|
|
20
|
-
"
|
|
14
|
+
"@cutting/react-abortable-fetch": "0.31.0",
|
|
15
|
+
"@cutting/use-get-parent-size": "1.22.0",
|
|
16
|
+
"@cutting/util": "4.54.0",
|
|
17
|
+
"classnames": "^2.3.2",
|
|
21
18
|
"resize-observer-polyfill": "^1.5.1"
|
|
22
19
|
},
|
|
23
20
|
"devDependencies": {
|
|
24
|
-
"@babel/runtime": "7.
|
|
25
|
-
"@cutting/component-library": "5.
|
|
26
|
-
"@cutting/devtools": "4.
|
|
21
|
+
"@babel/runtime": "7.19.0",
|
|
22
|
+
"@cutting/component-library": "5.29.0",
|
|
23
|
+
"@cutting/devtools": "4.59.0",
|
|
27
24
|
"@cutting/eslint-config": "4.41.0",
|
|
28
25
|
"@cutting/tsconfig": "4.38.0",
|
|
29
|
-
"@cutting/useful-types": "4.
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"react-dom": "18.1.0",
|
|
41
|
-
"typescript": "4.7.3"
|
|
26
|
+
"@cutting/useful-types": "4.37.0",
|
|
27
|
+
"@testing-library/react": "^13.4.0",
|
|
28
|
+
"@types/react": "18.0.20",
|
|
29
|
+
"@types/react-dom": "18.0.6",
|
|
30
|
+
"@vanilla-extract/css": "^1.9.0",
|
|
31
|
+
"@vanilla-extract/sprinkles": "1.5.0",
|
|
32
|
+
"assert-ts": "0.3.4",
|
|
33
|
+
"eslint": "8.23.1",
|
|
34
|
+
"react": "18.2.0",
|
|
35
|
+
"react-dom": "18.2.0",
|
|
36
|
+
"typescript": "4.8.3"
|
|
42
37
|
},
|
|
43
38
|
"peerDependencies": {
|
|
44
39
|
"react": ">= 18.x.x",
|
|
@@ -48,9 +43,7 @@
|
|
|
48
43
|
"extends": "../../package.json"
|
|
49
44
|
},
|
|
50
45
|
"exports": {
|
|
51
|
-
"import": "./dist/esm/index.js"
|
|
52
|
-
"require": "./dist/cjs/index.js",
|
|
53
|
-
"browser": "./dist/umd/index.js"
|
|
46
|
+
"import": "./dist/esm/index.js"
|
|
54
47
|
},
|
|
55
48
|
"typesVersions": {
|
|
56
49
|
"*": {
|
|
@@ -59,11 +52,16 @@
|
|
|
59
52
|
]
|
|
60
53
|
}
|
|
61
54
|
},
|
|
55
|
+
"lint-staged": {
|
|
56
|
+
"*.js": "eslint ./src/**/*.{js} --fix",
|
|
57
|
+
"*.ts": "eslint ./src/**/*.{ts} --fix",
|
|
58
|
+
"*.tsx": "eslint ./src/**/*.{tsx} --fix"
|
|
59
|
+
},
|
|
62
60
|
"scripts": {
|
|
63
61
|
"build": "NODE_ENV=production devtools rollup",
|
|
64
62
|
"lint": "eslint ./src/**/*.{ts,tsx} --fix",
|
|
65
|
-
"start": "
|
|
66
|
-
"test": "NODE_ENV=test
|
|
63
|
+
"start": "pnpm vite --host --port 9000 -l=info --clearScreen=false",
|
|
64
|
+
"test": "NODE_ENV=test vitest",
|
|
67
65
|
"test:ci": "CI=true pnpm test"
|
|
68
66
|
}
|
|
69
67
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties, PropsWithChildren, RefObject } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG.js';
|
|
3
3
|
import type { UseParentSizeOptions } from '@cutting/use-get-parent-size';
|
|
4
|
+
import { useEffect } from 'react';
|
|
4
5
|
import { useParentSize } from '@cutting/use-get-parent-size';
|
|
5
|
-
import type { ResponsiveSVGProps } from '../ResponsiveSVG/ResponsiveSVG';
|
|
6
6
|
import { ResponsiveSVG } from '../ResponsiveSVG/ResponsiveSVG';
|
|
7
7
|
|
|
8
8
|
type Align = 'none' | 'center';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { describe, it, expect
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { useParentSize } from '@cutting/use-get-parent-size';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
|
-
import { ResponsiveSVG } from './ResponsiveSVG';
|
|
5
|
+
import { ResponsiveSVG } from './ResponsiveSVG.js';
|
|
6
|
+
import { vi } from 'vitest';
|
|
6
7
|
|
|
7
8
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
vi.mock('resize-observer-polyfill');
|
|
10
11
|
|
|
11
12
|
const resize = (width: number, height: number): void => {
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
14
|
// @ts-ignore
|
|
14
15
|
ResizeObserver.mockImplementation((cb) => {
|
|
15
16
|
cb([{ contentRect: { width, height } }]);
|
|
16
|
-
return { observe:
|
|
17
|
+
return { observe: vi.fn(), disconnect: vi.fn(), unobserve: vi.fn() };
|
|
17
18
|
});
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -32,7 +33,7 @@ function TestEr(): JSX.Element {
|
|
|
32
33
|
|
|
33
34
|
const wrap = () => render(<TestEr />);
|
|
34
35
|
|
|
35
|
-
describe('useParentSize', () => {
|
|
36
|
+
describe.skip('useParentSize', () => {
|
|
36
37
|
it('should set the svg viewBox attribute', () => {
|
|
37
38
|
resize(200, 200);
|
|
38
39
|
wrap();
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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';
|
|
2
|
+
export { ResponsiveSVG } from './components/ResponsiveSVG/ResponsiveSVG.js';
|
|
3
|
+
export { ParentsizeSVG } from './components/ParentsizeSVG/ParentsizeSVG.js';
|
|
4
|
+
export { Group } from './components/Group/Group.js';
|
|
5
|
+
export { Line } from './components/Line/Line.js';
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
/// <reference types="vite/client" />
|
|
3
|
+
|
|
4
|
+
import react from '@vitejs/plugin-react';
|
|
5
|
+
import { defineConfig } from 'vite';
|
|
6
|
+
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
|
7
|
+
|
|
8
|
+
const isTest = process.env.NODE_ENV === 'test';
|
|
9
|
+
|
|
10
|
+
// https://vitejs.dev/config/
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
root: isTest ? '.' : 'demo',
|
|
13
|
+
plugins: [
|
|
14
|
+
vanillaExtractPlugin(),
|
|
15
|
+
react({
|
|
16
|
+
babel: {
|
|
17
|
+
plugins: [],
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
test: {
|
|
22
|
+
globals: true,
|
|
23
|
+
environment: 'jsdom',
|
|
24
|
+
setupFiles: '@cutting/devtools/setuptests.js',
|
|
25
|
+
css: true,
|
|
26
|
+
deps: {
|
|
27
|
+
fallbackCJS: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
package/.vscode/launch.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"type": "node",
|
|
6
|
-
"request": "launch",
|
|
7
|
-
"name": "Jest Tests",
|
|
8
|
-
"program": "${workspaceRoot}/../../node_modules/jest/bin/jest.js",
|
|
9
|
-
"cwd": "${workspaceRoot}",
|
|
10
|
-
"args": [
|
|
11
|
-
"--runInBand",
|
|
12
|
-
"--no-cache",
|
|
13
|
-
"--env=jsdom",
|
|
14
|
-
"--config=${workspaceRoot}/../../jest/jest.config.js",
|
|
15
|
-
"${file}"
|
|
16
|
-
],
|
|
17
|
-
"runtimeArgs": ["--nolazy"],
|
|
18
|
-
"sourceMaps": true,
|
|
19
|
-
"env": {
|
|
20
|
-
"NODE_ENV": "test",
|
|
21
|
-
"BABEL_ENV": "test"
|
|
22
|
-
},
|
|
23
|
-
"console": "integratedTerminal",
|
|
24
|
-
"internalConsoleOptions": "neverOpen",
|
|
25
|
-
"skipFiles": ["${workspaceRoot}/node_modules/**/*.js"]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
package/build.config.js
DELETED
package/demo/index.tsx
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createRoot } from 'react-dom/client';
|
|
2
|
-
import { App } from './App';
|
|
3
|
-
|
|
4
|
-
export const container = document.getElementById('root');
|
|
5
|
-
|
|
6
|
-
const root = createRoot(container);
|
|
7
|
-
|
|
8
|
-
const render = (Component: typeof App) => {
|
|
9
|
-
root.render(<Component />);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
render(App);
|
|
13
|
-
|
|
14
|
-
if (module.hot) {
|
|
15
|
-
module.hot.accept('./App', () => import('./App').then((m) => render(m.App)));
|
|
16
|
-
}
|
|
@@ -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"}
|