react-ink-scripter 0.0.14 → 0.0.17
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/dist/cjs/index.js +76 -15
- package/dist/esm/IFrame.d.ts +1 -1
- package/dist/esm/InkScripter.d.ts +5 -5
- package/dist/esm/PrinterFrame.d.ts +1 -1
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.js +56 -16
- package/dist/esm/usePagePrint.d.ts +19 -0
- package/package.json +47 -16
package/dist/cjs/index.js
CHANGED
|
@@ -1,11 +1,69 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
3
4
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var reactDom = require('react-dom');
|
|
6
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
var clsx = require('clsx');
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
var getPageHeight = function getPageHeight(height, page) {
|
|
11
|
+
var _page$marginTop = page.marginTop,
|
|
12
|
+
marginTop = _page$marginTop === void 0 ? 0 : _page$marginTop,
|
|
13
|
+
_page$marginBottom = page.marginBottom,
|
|
14
|
+
marginBottom = _page$marginBottom === void 0 ? 0 : _page$marginBottom;
|
|
15
|
+
return height + marginTop + marginBottom;
|
|
16
|
+
};
|
|
17
|
+
var pix2mm = function pix2mm(pix) {
|
|
18
|
+
return Math.round(pix * 0.2645833333);
|
|
19
|
+
};
|
|
20
|
+
var usePagePrint = function usePagePrint(_ref) {
|
|
21
|
+
var open = _ref.open,
|
|
22
|
+
pageConfig = _ref.pageConfig;
|
|
23
|
+
var _useState = react.useState({
|
|
24
|
+
width: pageConfig.width || 0,
|
|
25
|
+
height: pageConfig.height || 0,
|
|
26
|
+
marginLeft: 0,
|
|
27
|
+
marginRight: 0,
|
|
28
|
+
marginTop: 0,
|
|
29
|
+
marginBottom: 0
|
|
30
|
+
}),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
page = _useState2[0],
|
|
33
|
+
setPage = _useState2[1];
|
|
34
|
+
var _useState3 = react.useState(),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
pageNode = _useState4[0],
|
|
37
|
+
setPageNode = _useState4[1];
|
|
38
|
+
var setNodeRef = react.useCallback(function (node) {
|
|
39
|
+
setPageNode(node);
|
|
40
|
+
}, []);
|
|
41
|
+
react.useLayoutEffect(function () {
|
|
42
|
+
if (!open) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
var rect = pageNode === null || pageNode === void 0 ? void 0 : pageNode.getBoundingClientRect();
|
|
46
|
+
if (!rect) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
var width = pageConfig.width,
|
|
50
|
+
height = pageConfig.height;
|
|
51
|
+
var elmHeight = rect.height,
|
|
52
|
+
elmWidth = rect.width;
|
|
53
|
+
var pageWidth = width || pix2mm(elmWidth);
|
|
54
|
+
var pageHeight = height ? height : getPageHeight(pix2mm(elmHeight), pageConfig);
|
|
55
|
+
setPage(function (old) {
|
|
56
|
+
return _extends({}, old, {
|
|
57
|
+
width: pageWidth,
|
|
58
|
+
height: pageHeight
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}, [pageNode, open, pageConfig]);
|
|
62
|
+
return {
|
|
63
|
+
setNodeRef: setNodeRef,
|
|
64
|
+
page: page
|
|
65
|
+
};
|
|
66
|
+
};
|
|
9
67
|
|
|
10
68
|
var IFrame = react.forwardRef(function (props, ref) {
|
|
11
69
|
var _iframeRef$current, _iframeRef$current$co, _iframeRef$current$co2, _iframeRef$current2, _iframeRef$current2$c, _iframeRef$current2$c2;
|
|
@@ -68,7 +126,7 @@ var PrinterFrame = react.forwardRef(function (props, ref) {
|
|
|
68
126
|
var attachStyle = iframeRef === null || iframeRef === void 0 ? void 0 : (_iframeRef$current4 = iframeRef.current) === null || _iframeRef$current4 === void 0 ? void 0 : (_iframeRef$current4$c = _iframeRef$current4.contentWindow) === null || _iframeRef$current4$c === void 0 ? void 0 : (_iframeRef$current4$c2 = _iframeRef$current4$c.document) === null || _iframeRef$current4$c2 === void 0 ? void 0 : _iframeRef$current4$c2.head;
|
|
69
127
|
return jsxRuntime.jsxs("iframe", {
|
|
70
128
|
ref: iframeRef,
|
|
71
|
-
className: clsx(
|
|
129
|
+
className: clsx('inks-iframe-root', !!open && 'inks-iframe-root-open', className),
|
|
72
130
|
src: src,
|
|
73
131
|
width: width,
|
|
74
132
|
height: height,
|
|
@@ -85,16 +143,16 @@ var Container = function Container(_ref) {
|
|
|
85
143
|
className = _ref.className;
|
|
86
144
|
return jsxRuntime.jsx("div", {
|
|
87
145
|
id: id,
|
|
88
|
-
className: clsx(
|
|
146
|
+
className: clsx('inks-grid', className),
|
|
89
147
|
children: content.map(function (item, idx) {
|
|
90
148
|
switch (item.type) {
|
|
91
|
-
case
|
|
149
|
+
case 'pair':
|
|
92
150
|
return jsxRuntime.jsx(Pair, _extends({}, item, {
|
|
93
|
-
className: clsx(
|
|
151
|
+
className: clsx('inks-grid-item', item.className)
|
|
94
152
|
}), idx);
|
|
95
|
-
case
|
|
153
|
+
case 'text':
|
|
96
154
|
return jsxRuntime.jsx(Text, _extends({}, item, {
|
|
97
|
-
className: clsx(
|
|
155
|
+
className: clsx('inks-grid-item', item.className)
|
|
98
156
|
}), idx);
|
|
99
157
|
}
|
|
100
158
|
})
|
|
@@ -105,7 +163,7 @@ var Grid = function Grid(props) {
|
|
|
105
163
|
};
|
|
106
164
|
var TableCell = function TableCell(_ref2) {
|
|
107
165
|
var item = _ref2.item;
|
|
108
|
-
if (typeof item ===
|
|
166
|
+
if (typeof item === 'string') {
|
|
109
167
|
return jsxRuntime.jsx("td", {
|
|
110
168
|
className: "inks-cell",
|
|
111
169
|
children: item
|
|
@@ -216,7 +274,7 @@ var Text = function Text(_ref4) {
|
|
|
216
274
|
className = _ref4.className;
|
|
217
275
|
return jsxRuntime.jsx("div", {
|
|
218
276
|
id: id,
|
|
219
|
-
className: clsx(
|
|
277
|
+
className: clsx('inks-text', span && "inks-span-".concat(span), className),
|
|
220
278
|
children: value
|
|
221
279
|
});
|
|
222
280
|
};
|
|
@@ -228,7 +286,7 @@ var Pair = function Pair(_ref5) {
|
|
|
228
286
|
className = _ref5.className;
|
|
229
287
|
return jsxRuntime.jsxs("div", {
|
|
230
288
|
id: id,
|
|
231
|
-
className: clsx(
|
|
289
|
+
className: clsx('inks-pair', span && "inks-span-".concat(span), className),
|
|
232
290
|
children: [jsxRuntime.jsxs("label", {
|
|
233
291
|
className: "inks-pair-label",
|
|
234
292
|
children: [label, ":"]
|
|
@@ -243,17 +301,17 @@ var InkScripter = react.forwardRef(function (props, ref) {
|
|
|
243
301
|
value = _props$value === void 0 ? [] : _props$value,
|
|
244
302
|
className = props.className;
|
|
245
303
|
return jsxRuntime.jsx("div", {
|
|
246
|
-
className: clsx(
|
|
304
|
+
className: clsx('inks-root', className),
|
|
247
305
|
ref: ref,
|
|
248
306
|
children: value.map(function (item, index) {
|
|
249
307
|
switch (item.type) {
|
|
250
|
-
case
|
|
308
|
+
case 'grid':
|
|
251
309
|
return jsxRuntime.jsx(Grid, _extends({}, item), index);
|
|
252
|
-
case
|
|
310
|
+
case 'table':
|
|
253
311
|
return jsxRuntime.jsx(Table, _extends({}, item), index);
|
|
254
|
-
case
|
|
312
|
+
case 'text':
|
|
255
313
|
return jsxRuntime.jsx(Text, _extends({}, item), index);
|
|
256
|
-
case
|
|
314
|
+
case 'pair':
|
|
257
315
|
return jsxRuntime.jsx(Pair, _extends({}, item), index);
|
|
258
316
|
}
|
|
259
317
|
})
|
|
@@ -263,3 +321,6 @@ var InkScripter = react.forwardRef(function (props, ref) {
|
|
|
263
321
|
exports.IFrame = IFrame;
|
|
264
322
|
exports.InkScripter = InkScripter;
|
|
265
323
|
exports.PrinterFrame = PrinterFrame;
|
|
324
|
+
exports.getPageHeight = getPageHeight;
|
|
325
|
+
exports.pix2mm = pix2mm;
|
|
326
|
+
exports.usePagePrint = usePagePrint;
|
package/dist/esm/IFrame.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { ForwardRefExoticComponent, RefAttributes } from
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
export type ContentTextItem = {
|
|
3
3
|
id?: string;
|
|
4
4
|
className?: string;
|
|
5
|
-
type:
|
|
5
|
+
type: 'text';
|
|
6
6
|
value: string;
|
|
7
7
|
span?: number;
|
|
8
8
|
};
|
|
9
9
|
export type ContentPairItem = {
|
|
10
10
|
id?: string;
|
|
11
11
|
className?: string;
|
|
12
|
-
type:
|
|
12
|
+
type: 'pair';
|
|
13
13
|
label: string;
|
|
14
14
|
value: string;
|
|
15
15
|
span?: number;
|
|
16
16
|
};
|
|
17
17
|
export type ContentGridItem = {
|
|
18
18
|
id?: string;
|
|
19
|
-
type:
|
|
19
|
+
type: 'grid';
|
|
20
20
|
content: (ContentPairItem | ContentTextItem)[];
|
|
21
21
|
};
|
|
22
22
|
export type ContentTableCellItem = {
|
|
@@ -29,7 +29,7 @@ export type ContentTableCellItem = {
|
|
|
29
29
|
} | string;
|
|
30
30
|
export type ContentTableItem = {
|
|
31
31
|
id?: string;
|
|
32
|
-
type:
|
|
32
|
+
type: 'table';
|
|
33
33
|
head?: ContentTableCellItem[][];
|
|
34
34
|
body?: ContentTableCellItem[][];
|
|
35
35
|
foot?: ContentTableCellItem[][];
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from './usePagePrint';
|
|
2
|
+
export * from './IFrame';
|
|
3
|
+
export * from './PrinterFrame';
|
|
4
|
+
export * from './InkScripter';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,48 @@
|
|
|
1
|
+
import { useState, useCallback, useLayoutEffect, forwardRef, useRef, useMemo, useImperativeHandle } from 'react';
|
|
1
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef, useRef, useMemo, useImperativeHandle } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
+
const getPageHeight = (height, page) => {
|
|
7
|
+
const { marginTop = 0, marginBottom = 0 } = page;
|
|
8
|
+
return height + marginTop + marginBottom;
|
|
9
|
+
};
|
|
10
|
+
const pix2mm = (pix) => Math.round(pix * 0.2645833333);
|
|
11
|
+
const usePagePrint = ({ open, pageConfig, }) => {
|
|
12
|
+
const [page, setPage] = useState({
|
|
13
|
+
width: pageConfig.width || 0,
|
|
14
|
+
height: pageConfig.height || 0,
|
|
15
|
+
marginLeft: 0,
|
|
16
|
+
marginRight: 0,
|
|
17
|
+
marginTop: 0,
|
|
18
|
+
marginBottom: 0,
|
|
19
|
+
});
|
|
20
|
+
const [pageNode, setPageNode] = useState();
|
|
21
|
+
const setNodeRef = useCallback((node) => {
|
|
22
|
+
setPageNode(node);
|
|
23
|
+
}, []);
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
if (!open) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const rect = pageNode?.getBoundingClientRect();
|
|
29
|
+
if (!rect) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// height === 0 means auto
|
|
33
|
+
const { width, height } = pageConfig;
|
|
34
|
+
const { height: elmHeight, width: elmWidth } = rect;
|
|
35
|
+
const pageWidth = width || pix2mm(elmWidth);
|
|
36
|
+
const pageHeight = height ? height : getPageHeight(pix2mm(elmHeight), pageConfig);
|
|
37
|
+
setPage((old) => ({
|
|
38
|
+
...old,
|
|
39
|
+
width: pageWidth,
|
|
40
|
+
height: pageHeight,
|
|
41
|
+
}));
|
|
42
|
+
}, [pageNode, open, pageConfig]);
|
|
43
|
+
return { setNodeRef, page };
|
|
44
|
+
};
|
|
45
|
+
|
|
6
46
|
const IFrame = forwardRef((props, ref) => {
|
|
7
47
|
const { styleCss, className, children, width, height } = props;
|
|
8
48
|
const iframeRef = useRef(null);
|
|
@@ -38,7 +78,7 @@ const PrinterFrame = forwardRef((props, ref) => {
|
|
|
38
78
|
? iframeRef?.current?.contentWindow?.document?.getElementById(containerId)
|
|
39
79
|
: iframeRef?.current?.contentWindow?.document?.body;
|
|
40
80
|
const attachStyle = iframeRef?.current?.contentWindow?.document?.head;
|
|
41
|
-
return (jsxs("iframe", { ref: iframeRef, className: clsx(
|
|
81
|
+
return (jsxs("iframe", { ref: iframeRef, className: clsx('inks-iframe-root', !!open && 'inks-iframe-root-open', className), src: src, width: width, height: height, children: [!!attachStyle &&
|
|
42
82
|
createPortal(jsxs("style", { children: [`
|
|
43
83
|
@media print {
|
|
44
84
|
.hidden-print {
|
|
@@ -49,12 +89,12 @@ const PrinterFrame = forwardRef((props, ref) => {
|
|
|
49
89
|
});
|
|
50
90
|
|
|
51
91
|
const Container = ({ id, content = [], className, }) => {
|
|
52
|
-
return (jsx("div", { id: id, className: clsx(
|
|
92
|
+
return (jsx("div", { id: id, className: clsx('inks-grid', className), children: content.map((item, idx) => {
|
|
53
93
|
switch (item.type) {
|
|
54
|
-
case
|
|
55
|
-
return (jsx(Pair, { ...item, className: clsx(
|
|
56
|
-
case
|
|
57
|
-
return (jsx(Text, { ...item, className: clsx(
|
|
94
|
+
case 'pair':
|
|
95
|
+
return (jsx(Pair, { ...item, className: clsx('inks-grid-item', item.className) }, idx));
|
|
96
|
+
case 'text':
|
|
97
|
+
return (jsx(Text, { ...item, className: clsx('inks-grid-item', item.className) }, idx));
|
|
58
98
|
}
|
|
59
99
|
}) }));
|
|
60
100
|
};
|
|
@@ -62,7 +102,7 @@ const Grid = (props) => {
|
|
|
62
102
|
return jsx(Container, { ...props });
|
|
63
103
|
};
|
|
64
104
|
const TableCell = ({ item }) => {
|
|
65
|
-
if (typeof item ===
|
|
105
|
+
if (typeof item === 'string') {
|
|
66
106
|
return jsx("td", { className: "inks-cell", children: item });
|
|
67
107
|
}
|
|
68
108
|
const { id, header, colSpan, rowSpan, value } = item;
|
|
@@ -106,25 +146,25 @@ const Table = (props) => {
|
|
|
106
146
|
return (jsxs("table", { id: id, className: "inks-table", children: [jsx(TableHead, { rows: head }), jsx(TableBody, { rows: body }), jsx(TableFoot, { rows: foot })] }));
|
|
107
147
|
};
|
|
108
148
|
const Text = ({ id, value, span, className }) => {
|
|
109
|
-
return (jsx("div", { id: id, className: clsx(
|
|
149
|
+
return (jsx("div", { id: id, className: clsx('inks-text', span && `inks-span-${span}`, className), children: value }));
|
|
110
150
|
};
|
|
111
151
|
const Pair = ({ id, value, label, span, className }) => {
|
|
112
|
-
return (jsxs("div", { id: id, className: clsx(
|
|
152
|
+
return (jsxs("div", { id: id, className: clsx('inks-pair', span && `inks-span-${span}`, className), children: [jsxs("label", { className: "inks-pair-label", children: [label, ":"] }), jsx("div", { className: "inks-pair-value", children: value })] }));
|
|
113
153
|
};
|
|
114
154
|
const InkScripter = forwardRef((props, ref) => {
|
|
115
155
|
const { value = [], className } = props;
|
|
116
|
-
return (jsx("div", { className: clsx(
|
|
156
|
+
return (jsx("div", { className: clsx('inks-root', className), ref: ref, children: value.map((item, index) => {
|
|
117
157
|
switch (item.type) {
|
|
118
|
-
case
|
|
158
|
+
case 'grid':
|
|
119
159
|
return jsx(Grid, { ...item }, index);
|
|
120
|
-
case
|
|
160
|
+
case 'table':
|
|
121
161
|
return jsx(Table, { ...item }, index);
|
|
122
|
-
case
|
|
162
|
+
case 'text':
|
|
123
163
|
return jsx(Text, { ...item }, index);
|
|
124
|
-
case
|
|
164
|
+
case 'pair':
|
|
125
165
|
return jsx(Pair, { ...item }, index);
|
|
126
166
|
}
|
|
127
167
|
}) }));
|
|
128
168
|
});
|
|
129
169
|
|
|
130
|
-
export { IFrame, InkScripter, PrinterFrame };
|
|
170
|
+
export { IFrame, InkScripter, PrinterFrame, getPageHeight, pix2mm, usePagePrint };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type PageConfig = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
marginLeft: number;
|
|
5
|
+
marginRight: number;
|
|
6
|
+
marginTop: number;
|
|
7
|
+
marginBottom: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const getPageHeight: (height: number, page: Partial<PageConfig>) => number;
|
|
10
|
+
export declare const pix2mm: (pix: number) => number;
|
|
11
|
+
export type usePagePrintProps = {
|
|
12
|
+
open?: boolean;
|
|
13
|
+
pageConfig: Partial<PageConfig>;
|
|
14
|
+
};
|
|
15
|
+
export declare const usePagePrint: <T extends Element>({ open, pageConfig, }: usePagePrintProps) => {
|
|
16
|
+
setNodeRef: (node: T) => void;
|
|
17
|
+
page: PageConfig;
|
|
18
|
+
};
|
|
19
|
+
export default usePagePrint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-ink-scripter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "a react component for generate page to print",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -9,28 +9,63 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/lawrsp/react-ink-scripter.git"
|
|
11
11
|
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"react",
|
|
14
|
-
"component",
|
|
15
|
-
"print",
|
|
16
|
-
"printer",
|
|
17
|
-
"iframe"
|
|
18
|
-
],
|
|
12
|
+
"keywords": ["react", "component", "print", "printer", "iframe"],
|
|
19
13
|
"author": "lawrsp",
|
|
20
14
|
"license": "MIT",
|
|
21
15
|
"bugs": {
|
|
22
16
|
"url": "https://github.com/lawrsp/react-ink-scripter/issues"
|
|
23
17
|
},
|
|
24
18
|
"homepage": "https://github.com/lawrsp/react-ink-scripter#readme",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "start-storybook -p 6016",
|
|
21
|
+
"prepack": "json -f package.json -I -e \"delete this.devDependencies;delete this.scripts;\"",
|
|
22
|
+
"build": "rimraf dist && rollup -c && yarn copy-styles",
|
|
23
|
+
"copy-styles": "node ./copy-styles.mjs",
|
|
24
|
+
"preview": "vite preview",
|
|
25
|
+
"storybook": "start-storybook -p 6006",
|
|
26
|
+
"build-storybook": "build-storybook"
|
|
27
|
+
},
|
|
25
28
|
"dependencies": {
|
|
26
29
|
"clsx": "^1.2.1"
|
|
27
30
|
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@babel/runtime": "^7.21.0",
|
|
33
|
+
"react": "^18.2.0",
|
|
34
|
+
"react-dom": "^18.2.0",
|
|
35
|
+
"@babel/core": "^7.21.0",
|
|
36
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
37
|
+
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
38
|
+
"@babel/preset-env": "^7.20.2",
|
|
39
|
+
"@babel/preset-react": "^7.18.6",
|
|
40
|
+
"@babel/preset-typescript": "^7.21.0",
|
|
41
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
42
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
|
43
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
44
|
+
"@rollup/plugin-strip": "^3.0.2",
|
|
45
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
46
|
+
"@storybook/addon-actions": "^6.5.16",
|
|
47
|
+
"@storybook/addon-essentials": "^6.5.16",
|
|
48
|
+
"@storybook/addon-interactions": "^6.5.16",
|
|
49
|
+
"@storybook/addon-links": "^6.5.16",
|
|
50
|
+
"@storybook/builder-vite": "^0.4.2",
|
|
51
|
+
"@storybook/react": "^6.5.16",
|
|
52
|
+
"@storybook/testing-library": "^0.0.13",
|
|
53
|
+
"@types/react": "^18.0.27",
|
|
54
|
+
"@types/react-dom": "^18.0.10",
|
|
55
|
+
"@vitejs/plugin-react": "^3.1.0",
|
|
56
|
+
"babel-loader": "^8.3.0",
|
|
57
|
+
"json": "^11.0.0",
|
|
58
|
+
"rimraf": "^4.1.3",
|
|
59
|
+
"rollup": "^3.18.0",
|
|
60
|
+
"rollup-plugin-sizes": "^1.0.5",
|
|
61
|
+
"typescript": "^4.9.3",
|
|
62
|
+
"vite": "^4.1.0"
|
|
63
|
+
},
|
|
28
64
|
"peerDependencies": {
|
|
29
65
|
"@types/react": "^17.0.0 || ^18.0.0",
|
|
30
66
|
"@types/react-dom": "^17.0.0 || ^18.0.0",
|
|
31
67
|
"react": "^17.0.0 || ^18.0.0",
|
|
32
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
33
|
-
"@babel/runtime": "^7.21.0"
|
|
68
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
34
69
|
},
|
|
35
70
|
"peerDependenciesMeta": {
|
|
36
71
|
"@types/react": {
|
|
@@ -40,10 +75,6 @@
|
|
|
40
75
|
"optional": true
|
|
41
76
|
}
|
|
42
77
|
},
|
|
43
|
-
"sideEffects": [
|
|
44
|
-
|
|
45
|
-
],
|
|
46
|
-
"files": [
|
|
47
|
-
"dist"
|
|
48
|
-
]
|
|
78
|
+
"sideEffects": ["*.css"],
|
|
79
|
+
"files": ["dist"]
|
|
49
80
|
}
|