@himanshu-sorathiya/react-kit 1.0.16 → 1.0.18
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/events.d.ts +32 -0
- package/dist/events.js +2 -0
- package/dist/events2.js +54 -0
- package/dist/index.d.ts +137 -118
- package/dist/index.js +5 -1004
- package/dist/performance.d.ts +29 -0
- package/dist/performance.js +2 -0
- package/dist/performance2.js +77 -0
- package/dist/state.d.ts +235 -0
- package/dist/state.js +2 -0
- package/dist/state2.js +645 -0
- package/dist/ui.d.ts +100 -0
- package/dist/ui.js +2 -0
- package/dist/ui2.js +287 -0
- package/dist/utils.js +8 -0
- package/package.json +18 -2
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import React$1 from 'react';
|
|
4
|
+
import { CSSProperties } from 'react';
|
|
5
|
+
|
|
6
|
+
export interface FuzzyHighlighterProps {
|
|
7
|
+
text: string;
|
|
8
|
+
query: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
caseSensitive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function FuzzyHighlighter({ text, query, className, caseSensitive, }: FuzzyHighlighterProps): React$1.JSX.Element;
|
|
13
|
+
export interface ModalLayoutProps {
|
|
14
|
+
modalId: string;
|
|
15
|
+
children: React$1.ReactNode;
|
|
16
|
+
wrapperClassName?: string;
|
|
17
|
+
wrapperStyle?: React$1.CSSProperties;
|
|
18
|
+
containerClassName?: string;
|
|
19
|
+
containerStyle?: React$1.CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
export declare function ModalLayout({ modalId, children, wrapperClassName, wrapperStyle, containerClassName, containerStyle, }: ModalLayoutProps): import("react").ReactPortal | null;
|
|
22
|
+
export type ExpansionId = string | number;
|
|
23
|
+
export interface UseExpansionReturn<T> {
|
|
24
|
+
expandedIds: ExpansionId[];
|
|
25
|
+
expandedItems: T[];
|
|
26
|
+
isExpanded: (itemOrId: ExpansionId | T) => boolean;
|
|
27
|
+
expand: (itemOrId: ExpansionId | T) => void;
|
|
28
|
+
collapse: (itemOrId: ExpansionId | T) => void;
|
|
29
|
+
toggle: (itemOrId: ExpansionId | T) => void;
|
|
30
|
+
expandAll: () => void;
|
|
31
|
+
collapseAll: () => void;
|
|
32
|
+
resetExpansion: () => void;
|
|
33
|
+
replaceExpansion: (newExpandedItems: ExpansionId[] | T[]) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare function useExpansion<T = unknown>({ items, field, initialExpandedIds, multiple, }?: {
|
|
36
|
+
items?: T[];
|
|
37
|
+
field?: string;
|
|
38
|
+
initialExpandedIds?: ExpansionId[];
|
|
39
|
+
multiple?: boolean;
|
|
40
|
+
}): UseExpansionReturn<T>;
|
|
41
|
+
export interface UseModalStateReturn<TData> {
|
|
42
|
+
isOpen: boolean;
|
|
43
|
+
id: string | null;
|
|
44
|
+
data: TData | undefined;
|
|
45
|
+
}
|
|
46
|
+
export interface UseModalActionsReturn {
|
|
47
|
+
openModal: <T = unknown>(id: string, data?: T) => void;
|
|
48
|
+
closeModal: () => void;
|
|
49
|
+
clearModal: () => void;
|
|
50
|
+
}
|
|
51
|
+
export type UseModalReturn<TData> = UseModalStateReturn<TData> & UseModalActionsReturn;
|
|
52
|
+
export declare function useModalState<TData = unknown>(): UseModalStateReturn<TData>;
|
|
53
|
+
export declare function useModalActions(): UseModalActionsReturn;
|
|
54
|
+
export declare function useModal<TData = unknown>(): UseModalReturn<TData>;
|
|
55
|
+
export type PinId = string | number;
|
|
56
|
+
export interface UsePinReturn<T> {
|
|
57
|
+
pinnedIds: PinId[];
|
|
58
|
+
pinnedItems: T[];
|
|
59
|
+
unpinnedItems: T[];
|
|
60
|
+
pinnedCount: number;
|
|
61
|
+
hasPins: boolean;
|
|
62
|
+
isAtMaxLimit: boolean;
|
|
63
|
+
pin: (itemOrId: PinId | T) => void;
|
|
64
|
+
unpin: (itemOrId: PinId | T) => void;
|
|
65
|
+
togglePin: (itemOrId: PinId | T) => void;
|
|
66
|
+
isPinned: (itemOrId: PinId | T) => boolean;
|
|
67
|
+
clearPins: () => void;
|
|
68
|
+
resetPins: () => void;
|
|
69
|
+
replacePins: (newPinnedItems: PinId[] | T[]) => void;
|
|
70
|
+
pinMultiple: (newItems: PinId[] | T[]) => void;
|
|
71
|
+
unpinMultiple: (itemsToRemove: PinId[] | T[]) => void;
|
|
72
|
+
}
|
|
73
|
+
export declare function usePin<T = unknown>({ items, field, initialPinnedIds, maxPins, }: {
|
|
74
|
+
items: T[];
|
|
75
|
+
field?: string;
|
|
76
|
+
initialPinnedIds?: PinId[];
|
|
77
|
+
maxPins?: number;
|
|
78
|
+
}): UsePinReturn<T>;
|
|
79
|
+
export type VisibilityId = number | string;
|
|
80
|
+
export interface UseVisibilityReturn<T> {
|
|
81
|
+
visibleIds: VisibilityId[];
|
|
82
|
+
visibleItems: T[];
|
|
83
|
+
hiddenItems: T[];
|
|
84
|
+
visibleCount: number;
|
|
85
|
+
isVisible: (itemOrId: VisibilityId | T) => boolean;
|
|
86
|
+
show: (itemOrId: VisibilityId | T) => void;
|
|
87
|
+
hide: (itemOrId: VisibilityId | T) => void;
|
|
88
|
+
toggleVisibility: (itemOrId: VisibilityId | T) => void;
|
|
89
|
+
showAll: (itemsArray?: VisibilityId[] | T[]) => void;
|
|
90
|
+
hideAll: (itemsArray?: VisibilityId[] | T[]) => void;
|
|
91
|
+
resetVisibility: () => void;
|
|
92
|
+
replaceVisibility: (newVisibleItems: VisibilityId[] | T[]) => void;
|
|
93
|
+
}
|
|
94
|
+
export declare function useVisibility<T = unknown>({ items, field, initialVisibleIds, }: {
|
|
95
|
+
items: T[];
|
|
96
|
+
field?: string;
|
|
97
|
+
initialVisibleIds?: VisibilityId[];
|
|
98
|
+
}): UseVisibilityReturn<T>;
|
|
99
|
+
|
|
100
|
+
export {};
|
package/dist/ui.js
ADDED
package/dist/ui2.js
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { t as e } from "./utils.js";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
3
|
+
import { Fragment as c, jsx as l } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as u } from "react-dom";
|
|
5
|
+
//#region src/ui/FuzzyHighlighter/FuzzyHighlighter.tsx
|
|
6
|
+
function d({ text: e, query: t, className: n = "", caseSensitive: r = !1 }) {
|
|
7
|
+
let i = t.trim();
|
|
8
|
+
if (!i || !e) return /* @__PURE__ */ l(c, { children: e });
|
|
9
|
+
let a = i.split(/\s+/).filter((e) => e.length > 0);
|
|
10
|
+
if (a.length === 0) return /* @__PURE__ */ l(c, { children: e });
|
|
11
|
+
let o = `fuzzy-highlight ${n}`.trim(), s = [...a].sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), u = [...s];
|
|
12
|
+
if (s.length > 1) {
|
|
13
|
+
let e = a.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("\\s+");
|
|
14
|
+
u.unshift(e);
|
|
15
|
+
}
|
|
16
|
+
if (i.length > 1 && i === i.toUpperCase() && /^[A-Z]+$/.test(i)) {
|
|
17
|
+
let e = i.split("").map((e) => `\\b${e}`).join("[^a-z0-9]*");
|
|
18
|
+
u.unshift(e);
|
|
19
|
+
}
|
|
20
|
+
let d = `(${u.join("|")})`, f = new RegExp(d, r ? "g" : "gi");
|
|
21
|
+
return /* @__PURE__ */ l(c, { children: e.split(f).map((e, t) => f.test(e) ? /* @__PURE__ */ l("strong", {
|
|
22
|
+
className: o,
|
|
23
|
+
children: e
|
|
24
|
+
}, t) : e) });
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/ui/useModal/ModalContext.tsx
|
|
28
|
+
var f = t(null), p = t(null);
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/ui/useModal/useModal.ts
|
|
31
|
+
function m() {
|
|
32
|
+
let e = r(f);
|
|
33
|
+
if (!e) throw Error("useModalState must be used within a ModalProvider");
|
|
34
|
+
return e;
|
|
35
|
+
}
|
|
36
|
+
function h() {
|
|
37
|
+
let e = r(p);
|
|
38
|
+
if (!e) throw Error("useModalActions must be used within a ModalProvider");
|
|
39
|
+
return e;
|
|
40
|
+
}
|
|
41
|
+
function g() {
|
|
42
|
+
return {
|
|
43
|
+
...m(),
|
|
44
|
+
...h()
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/ui/useModal/ModalLayout.tsx
|
|
49
|
+
function _({ modalId: e, children: t, wrapperClassName: n = "", wrapperStyle: r, containerClassName: a = "", containerStyle: c }) {
|
|
50
|
+
let { isOpen: d, id: f } = m(), { closeModal: p, clearModal: g } = h(), [_, v] = s(!1), y = o(null), b = o(null), x = f === e, S = d && x;
|
|
51
|
+
return i(() => {
|
|
52
|
+
let e = y.current;
|
|
53
|
+
e && (S && !e.open ? (document.activeElement && (b.current = document.activeElement), v(!1), e.showModal()) : !S && e.open && v(!0));
|
|
54
|
+
}, [S]), typeof document > "u" || !x && !_ ? null : u(/* @__PURE__ */ l("dialog", {
|
|
55
|
+
ref: y,
|
|
56
|
+
onCancel: (e) => {
|
|
57
|
+
e.preventDefault(), p();
|
|
58
|
+
},
|
|
59
|
+
onClose: p,
|
|
60
|
+
onClick: (e) => {
|
|
61
|
+
let t = y.current;
|
|
62
|
+
if (!t) return;
|
|
63
|
+
let n = t.getBoundingClientRect();
|
|
64
|
+
(e.clientX < n.x || e.clientX > n.x + n.width || e.clientY < n.y || e.clientY > n.y + n.height) && p();
|
|
65
|
+
},
|
|
66
|
+
onAnimationEnd: () => {
|
|
67
|
+
if (_) {
|
|
68
|
+
let e = y.current;
|
|
69
|
+
e && e.close(), v(!1), x && g(), b.current &&= (b.current.focus(), null);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
className: `universal-modal ${n}`.trim(),
|
|
73
|
+
style: r,
|
|
74
|
+
children: /* @__PURE__ */ l("div", {
|
|
75
|
+
className: `modal-container ${a}`.trim(),
|
|
76
|
+
style: c,
|
|
77
|
+
children: t
|
|
78
|
+
})
|
|
79
|
+
}), document.body);
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/ui/useExpansion/useExpansion.ts
|
|
83
|
+
function v({ items: t = [], field: r, initialExpandedIds: i = [], multiple: c = !1 } = {}) {
|
|
84
|
+
let l = o(i), [u, d] = s(() => new Set(i)), f = n((t) => {
|
|
85
|
+
let n = e(t, r);
|
|
86
|
+
return u.has(n);
|
|
87
|
+
}, [u, r]), p = n((t) => {
|
|
88
|
+
d((n) => {
|
|
89
|
+
let i = e(t, r);
|
|
90
|
+
if (n.has(i)) return n;
|
|
91
|
+
let a = c ? new Set(n) : /* @__PURE__ */ new Set();
|
|
92
|
+
return a.add(i), a;
|
|
93
|
+
});
|
|
94
|
+
}, [r, c]), m = n((t) => {
|
|
95
|
+
d((n) => {
|
|
96
|
+
let i = e(t, r);
|
|
97
|
+
if (!n.has(i)) return n;
|
|
98
|
+
let a = new Set(n);
|
|
99
|
+
return a.delete(i), a;
|
|
100
|
+
});
|
|
101
|
+
}, [r]), h = n((t) => {
|
|
102
|
+
d((n) => {
|
|
103
|
+
let i = e(t, r), a = c ? new Set(n) : /* @__PURE__ */ new Set();
|
|
104
|
+
return n.has(i) ? c && a.delete(i) : a.add(i), a;
|
|
105
|
+
});
|
|
106
|
+
}, [r, c]), g = n(() => {
|
|
107
|
+
if (!c) return;
|
|
108
|
+
let n = t.map((t) => e(t, r));
|
|
109
|
+
d(new Set(n));
|
|
110
|
+
}, [
|
|
111
|
+
t,
|
|
112
|
+
r,
|
|
113
|
+
c
|
|
114
|
+
]), _ = n(() => {
|
|
115
|
+
d(/* @__PURE__ */ new Set());
|
|
116
|
+
}, []), v = n(() => {
|
|
117
|
+
d(new Set(l.current));
|
|
118
|
+
}, []), y = n((t) => {
|
|
119
|
+
let n = t.map((t) => e(t, r));
|
|
120
|
+
d(new Set(n));
|
|
121
|
+
}, [r]), b = a(() => t.filter((t) => u.has(e(t, r))), [
|
|
122
|
+
t,
|
|
123
|
+
r,
|
|
124
|
+
u
|
|
125
|
+
]);
|
|
126
|
+
return {
|
|
127
|
+
expandedIds: [...u],
|
|
128
|
+
expandedItems: b,
|
|
129
|
+
isExpanded: f,
|
|
130
|
+
expand: p,
|
|
131
|
+
collapse: m,
|
|
132
|
+
toggle: h,
|
|
133
|
+
expandAll: g,
|
|
134
|
+
collapseAll: _,
|
|
135
|
+
resetExpansion: v,
|
|
136
|
+
replaceExpansion: y
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/ui/usePin/usePin.ts
|
|
141
|
+
function y({ items: t, field: r, initialPinnedIds: i = [], maxPins: c = 2 ** 53 - 1 }) {
|
|
142
|
+
let l = o(i), [u, d] = s(() => new Set(i)), f = n((t) => {
|
|
143
|
+
d((n) => {
|
|
144
|
+
if (n.size >= c) return n;
|
|
145
|
+
let i = new Set(n), a = e(t, r);
|
|
146
|
+
return i.add(a), i;
|
|
147
|
+
});
|
|
148
|
+
}, [r, c]), p = n((t) => {
|
|
149
|
+
d((n) => {
|
|
150
|
+
let i = new Set(n), a = e(t, r);
|
|
151
|
+
return i.delete(a), i;
|
|
152
|
+
});
|
|
153
|
+
}, [r]), m = n((t) => {
|
|
154
|
+
d((n) => {
|
|
155
|
+
let i = new Set(n), a = e(t, r);
|
|
156
|
+
if (i.has(a)) i.delete(a);
|
|
157
|
+
else {
|
|
158
|
+
if (i.size >= c) return n;
|
|
159
|
+
i.add(a);
|
|
160
|
+
}
|
|
161
|
+
return i;
|
|
162
|
+
});
|
|
163
|
+
}, [r, c]), h = n((t) => {
|
|
164
|
+
let n = e(t, r);
|
|
165
|
+
return u.has(n);
|
|
166
|
+
}, [u, r]), g = n(() => d(/* @__PURE__ */ new Set()), []), _ = n(() => d(new Set(l.current)), [l]), v = n((t) => {
|
|
167
|
+
let n = t.map((t) => e(t, r));
|
|
168
|
+
d(new Set(n.slice(0, c)));
|
|
169
|
+
}, [r, c]), y = n((t) => {
|
|
170
|
+
d((n) => {
|
|
171
|
+
let i = new Set(n), a = t.map((t) => e(t, r));
|
|
172
|
+
for (let e of a) {
|
|
173
|
+
if (i.size >= c && !i.has(e)) break;
|
|
174
|
+
i.add(e);
|
|
175
|
+
}
|
|
176
|
+
return i;
|
|
177
|
+
});
|
|
178
|
+
}, [r, c]), b = n((t) => {
|
|
179
|
+
d((n) => {
|
|
180
|
+
let i = new Set(n);
|
|
181
|
+
return t.map((t) => e(t, r)).forEach((e) => i.delete(e)), i;
|
|
182
|
+
});
|
|
183
|
+
}, [r]), x = a(() => t.filter((t) => {
|
|
184
|
+
let n = e(t, r);
|
|
185
|
+
return u.has(n);
|
|
186
|
+
}), [
|
|
187
|
+
t,
|
|
188
|
+
r,
|
|
189
|
+
u
|
|
190
|
+
]), S = a(() => t.filter((t) => {
|
|
191
|
+
let n = e(t, r);
|
|
192
|
+
return !u.has(n);
|
|
193
|
+
}), [
|
|
194
|
+
t,
|
|
195
|
+
r,
|
|
196
|
+
u
|
|
197
|
+
]);
|
|
198
|
+
return {
|
|
199
|
+
pinnedIds: [...u],
|
|
200
|
+
pinnedItems: x,
|
|
201
|
+
unpinnedItems: S,
|
|
202
|
+
pinnedCount: u.size,
|
|
203
|
+
hasPins: u.size > 0,
|
|
204
|
+
isAtMaxLimit: u.size >= c,
|
|
205
|
+
pin: f,
|
|
206
|
+
unpin: p,
|
|
207
|
+
togglePin: m,
|
|
208
|
+
isPinned: h,
|
|
209
|
+
clearPins: g,
|
|
210
|
+
resetPins: _,
|
|
211
|
+
replacePins: v,
|
|
212
|
+
pinMultiple: y,
|
|
213
|
+
unpinMultiple: b
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/ui/useVisibility/useVisibility.ts
|
|
218
|
+
function b({ items: t, field: r, initialVisibleIds: i = [] }) {
|
|
219
|
+
let c = o(i), [l, u] = s(() => new Set(i)), d = n((t) => {
|
|
220
|
+
let n = e(t, r);
|
|
221
|
+
return l.has(n);
|
|
222
|
+
}, [l, r]), f = n((t) => {
|
|
223
|
+
u((n) => {
|
|
224
|
+
let i = new Set(n), a = e(t, r);
|
|
225
|
+
return i.add(a), i;
|
|
226
|
+
});
|
|
227
|
+
}, [r]), p = n((t) => {
|
|
228
|
+
u((n) => {
|
|
229
|
+
let i = new Set(n), a = e(t, r);
|
|
230
|
+
return i.delete(a), i;
|
|
231
|
+
});
|
|
232
|
+
}, [r]), m = n((t) => {
|
|
233
|
+
u((n) => {
|
|
234
|
+
let i = new Set(n), a = e(t, r);
|
|
235
|
+
return i.has(a) ? i.delete(a) : i.add(a), i;
|
|
236
|
+
});
|
|
237
|
+
}, [r]), h = n((n) => {
|
|
238
|
+
u((i) => {
|
|
239
|
+
let a = new Set(i);
|
|
240
|
+
return (n ?? t).forEach((t) => {
|
|
241
|
+
a.add(e(t, r));
|
|
242
|
+
}), a;
|
|
243
|
+
});
|
|
244
|
+
}, [t, r]), g = n((n) => {
|
|
245
|
+
u((i) => {
|
|
246
|
+
let a = new Set(i);
|
|
247
|
+
return (n ?? t).forEach((t) => {
|
|
248
|
+
a.delete(e(t, r));
|
|
249
|
+
}), a;
|
|
250
|
+
});
|
|
251
|
+
}, [t, r]), _ = n(() => {
|
|
252
|
+
u(() => new Set(c.current));
|
|
253
|
+
}, []), v = n((t) => {
|
|
254
|
+
let n = t.map((t) => e(t, r));
|
|
255
|
+
u(() => new Set(n));
|
|
256
|
+
}, [r]), y = a(() => t.filter((t) => {
|
|
257
|
+
let n = e(t, r);
|
|
258
|
+
return l.has(n);
|
|
259
|
+
}), [
|
|
260
|
+
t,
|
|
261
|
+
r,
|
|
262
|
+
l
|
|
263
|
+
]), b = a(() => t.filter((t) => {
|
|
264
|
+
let n = e(t, r);
|
|
265
|
+
return !l.has(n);
|
|
266
|
+
}), [
|
|
267
|
+
t,
|
|
268
|
+
r,
|
|
269
|
+
l
|
|
270
|
+
]);
|
|
271
|
+
return {
|
|
272
|
+
visibleIds: [...l],
|
|
273
|
+
visibleItems: y,
|
|
274
|
+
hiddenItems: b,
|
|
275
|
+
visibleCount: l.size,
|
|
276
|
+
isVisible: d,
|
|
277
|
+
show: f,
|
|
278
|
+
hide: p,
|
|
279
|
+
toggleVisibility: m,
|
|
280
|
+
showAll: h,
|
|
281
|
+
hideAll: g,
|
|
282
|
+
replaceVisibility: v,
|
|
283
|
+
resetVisibility: _
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
export { g as a, d as c, _ as i, y as n, h as o, v as r, m as s, b as t };
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/shared/utils.ts
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
if (typeof e != "object" || !e) return e;
|
|
4
|
+
let r = t ?? n ?? "";
|
|
5
|
+
return Array.isArray(r) ? r.reduce((e, t) => e?.[t], e) : r.includes(".") ? r.split(".").reduce((e, t) => e?.[t], e) : e?.[r];
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@himanshu-sorathiya/react-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "An opinionated collection of react hooks, and reusable UI components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -13,11 +13,27 @@
|
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"import": "./dist/index.js"
|
|
15
15
|
},
|
|
16
|
+
"./ui": {
|
|
17
|
+
"types": "./dist/ui.d.ts",
|
|
18
|
+
"import": "./dist/ui.js"
|
|
19
|
+
},
|
|
20
|
+
"./state": {
|
|
21
|
+
"types": "./dist/state.d.ts",
|
|
22
|
+
"import": "./dist/state.js"
|
|
23
|
+
},
|
|
24
|
+
"./performance": {
|
|
25
|
+
"types": "./dist/performance.d.ts",
|
|
26
|
+
"import": "./dist/performance.js"
|
|
27
|
+
},
|
|
28
|
+
"./events": {
|
|
29
|
+
"types": "./dist/events.d.ts",
|
|
30
|
+
"import": "./dist/events.js"
|
|
31
|
+
},
|
|
16
32
|
"./styles.css": "./dist/index.css"
|
|
17
33
|
},
|
|
18
34
|
"scripts": {
|
|
19
35
|
"dev": "vite",
|
|
20
|
-
"build": "vite build && dts-bundle-generator --project tsconfig.app.json -o dist/index.d.ts src/index.ts",
|
|
36
|
+
"build": "vite build && dts-bundle-generator --project tsconfig.app.json -o dist/index.d.ts src/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/ui.d.ts src/ui/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/state.d.ts src/state/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/performance.d.ts src/performance/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/events.d.ts src/events/index.ts",
|
|
21
37
|
"lint": "eslint .",
|
|
22
38
|
"preview": "vite preview",
|
|
23
39
|
"format": "prettier . --write"
|