@cher1shrxd/webview-stack-kit 1.0.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 (34) hide show
  1. package/dist/components/NavigationStack.d.ts +3 -0
  2. package/dist/components/NavigationStack.d.ts.map +1 -0
  3. package/dist/components/NavigationStack.js +22 -0
  4. package/dist/components/NavigationStackView.d.ts +2 -0
  5. package/dist/components/NavigationStackView.d.ts.map +1 -0
  6. package/dist/components/NavigationStackView.js +84 -0
  7. package/dist/components/Stack.d.ts +3 -0
  8. package/dist/components/Stack.d.ts.map +1 -0
  9. package/dist/components/Stack.js +5 -0
  10. package/dist/components/StackScreen.d.ts +11 -0
  11. package/dist/components/StackScreen.d.ts.map +1 -0
  12. package/dist/components/StackScreen.js +79 -0
  13. package/dist/context/stack-provider.d.ts +7 -0
  14. package/dist/context/stack-provider.d.ts.map +1 -0
  15. package/dist/context/stack-provider.js +14 -0
  16. package/dist/context/stack-reducer.d.ts +3 -0
  17. package/dist/context/stack-reducer.d.ts.map +1 -0
  18. package/dist/context/stack-reducer.js +22 -0
  19. package/dist/hooks/useStack.d.ts +2 -0
  20. package/dist/hooks/useStack.d.ts.map +1 -0
  21. package/dist/hooks/useStack.js +9 -0
  22. package/dist/index.d.ts +4 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +3 -0
  25. package/dist/types.d.ts +26 -0
  26. package/dist/types.d.ts.map +1 -0
  27. package/dist/types.js +1 -0
  28. package/dist/utils/create-stack-actions.d.ts +7 -0
  29. package/dist/utils/create-stack-actions.d.ts.map +1 -0
  30. package/dist/utils/create-stack-actions.js +21 -0
  31. package/dist/utils/get-search-params.d.ts +2 -0
  32. package/dist/utils/get-search-params.d.ts.map +1 -0
  33. package/dist/utils/get-search-params.js +11 -0
  34. package/package.json +33 -0
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from "react";
2
+ export declare const NavigationStack: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=NavigationStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationStack.d.ts","sourceRoot":"","sources":["../../src/components/NavigationStack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAK/D,eAAO,MAAM,eAAe,GAAI,cAAc,iBAAiB,4CAyB9D,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { StackProvider } from "../context/stack-provider";
5
+ import { NavigationStackView } from "./NavigationStackView";
6
+ import { getSearchParams } from "../utils/get-search-params";
7
+ export const NavigationStack = ({ children }) => {
8
+ const [dynamicPadding, setDynamicPadding] = useState({
9
+ paddingTop: 0,
10
+ paddingBottom: 0,
11
+ });
12
+ useEffect(() => {
13
+ const searchParams = getSearchParams();
14
+ const topPadding = Number(searchParams["top"] || 0);
15
+ const bottomPadding = Number(searchParams["bottom"] || 0);
16
+ setDynamicPadding({ paddingTop: topPadding, paddingBottom: bottomPadding });
17
+ }, []);
18
+ return (_jsxs(StackProvider, { children: [_jsx(NavigationStackView, {}), _jsx("div", { style: {
19
+ paddingTop: dynamicPadding.paddingTop,
20
+ paddingBottom: dynamicPadding.paddingBottom,
21
+ }, children: children })] }));
22
+ };
@@ -0,0 +1,2 @@
1
+ export declare const NavigationStackView: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=NavigationStackView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationStackView.d.ts","sourceRoot":"","sources":["../../src/components/NavigationStackView.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,+CAoG/B,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { StackScreen } from "./StackScreen";
4
+ import { useStack } from "../hooks/useStack";
5
+ import { useRef, useCallback, useEffect } from "react";
6
+ export const NavigationStackView = () => {
7
+ const { stack, pop, remove } = useStack();
8
+ const topScreenRef = useRef(null);
9
+ const dragInfo = useRef(null);
10
+ const handleDragEnd = useCallback(() => {
11
+ if (!dragInfo.current?.isDragging)
12
+ return;
13
+ const { startX, lastX, startTime } = dragInfo.current;
14
+ const distance = lastX - startX;
15
+ const time = Date.now() - startTime;
16
+ const velocity = distance / time;
17
+ const screenWidth = window.innerWidth;
18
+ const isClosed = distance > screenWidth * 0.35 || velocity > 0.5;
19
+ if (topScreenRef.current) {
20
+ topScreenRef.current.style.transition = 'transform 0.5s cubic-bezier(0.32, 0.72, 0, 1)';
21
+ topScreenRef.current.style.transform = isClosed ? 'translateX(100%)' : '';
22
+ if (isClosed) {
23
+ pop();
24
+ }
25
+ }
26
+ dragInfo.current = null;
27
+ }, [pop]);
28
+ const handleDragMove = useCallback((e) => {
29
+ if (!dragInfo.current?.isDragging)
30
+ return;
31
+ let clientX;
32
+ if (e.type === 'touchmove') {
33
+ clientX = e.touches[0].clientX;
34
+ }
35
+ else {
36
+ clientX = e.clientX;
37
+ }
38
+ dragInfo.current.lastX = clientX;
39
+ if (topScreenRef.current) {
40
+ topScreenRef.current.style.transform = `translateX(${clientX - dragInfo.current.startX}px)`;
41
+ }
42
+ }, []);
43
+ const handleDragStart = useCallback((e, index) => {
44
+ if (index !== stack.length - 1)
45
+ return;
46
+ if (stack[index].transition === 'pop')
47
+ return;
48
+ let clientX;
49
+ if ('touches' in e) {
50
+ clientX = e.touches[0].clientX;
51
+ }
52
+ else {
53
+ clientX = e.clientX;
54
+ }
55
+ dragInfo.current = {
56
+ isDragging: true,
57
+ startX: clientX,
58
+ lastX: clientX,
59
+ startTime: Date.now(),
60
+ index,
61
+ };
62
+ if (topScreenRef.current) {
63
+ topScreenRef.current.style.transition = 'none';
64
+ }
65
+ window.addEventListener('mousemove', handleDragMove);
66
+ window.addEventListener('mouseup', handleDragEnd, { once: true });
67
+ window.addEventListener('touchmove', handleDragMove);
68
+ window.addEventListener('touchend', handleDragEnd, { once: true });
69
+ }, [stack, handleDragMove, handleDragEnd]);
70
+ useEffect(() => {
71
+ return () => {
72
+ window.removeEventListener('mousemove', handleDragMove);
73
+ window.removeEventListener('mouseup', handleDragEnd);
74
+ window.removeEventListener('touchmove', handleDragMove);
75
+ window.removeEventListener('touchend', handleDragEnd);
76
+ };
77
+ }, [handleDragMove, handleDragEnd]);
78
+ return (_jsx("div", { style: {
79
+ position: 'fixed',
80
+ inset: 0,
81
+ zIndex: 9999,
82
+ pointerEvents: 'none',
83
+ }, children: stack.map((item, index) => (_jsx(StackScreen, { ref: index === stack.length - 1 ? topScreenRef : null, item: item, index: index, totalCount: stack.length, onExitComplete: remove, onDragStart: handleDragStart }, item.id))) }));
84
+ };
@@ -0,0 +1,3 @@
1
+ import { ComponentProps } from "react";
2
+ export declare const Stack: (props: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=Stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/components/Stack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,eAAO,MAAM,KAAK,GAAI,OAAO,cAAc,CAAC,KAAK,CAAC,4CASjD,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export const Stack = (props) => {
4
+ return (_jsx("div", { ...props, className: `stack-view ${props.className || ""}`, style: { ...props.style, width: "100%", height: "100%" }, children: props.children }));
5
+ };
@@ -0,0 +1,11 @@
1
+ import { MouseEvent, TouchEvent } from "react";
2
+ import { StackItem } from "../types";
3
+ export declare const StackScreen: import("react").ForwardRefExoticComponent<Omit<{
4
+ [key: string]: any;
5
+ item: StackItem;
6
+ index: number;
7
+ totalCount: number;
8
+ onExitComplete: (id: string) => void;
9
+ onDragStart: (e: TouchEvent | MouseEvent, index: number) => void;
10
+ }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
11
+ //# sourceMappingURL=StackScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackScreen.d.ts","sourceRoot":"","sources":["../../src/components/StackScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EACV,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAiBrC,eAAO,MAAM,WAAW;;UAGd,SAAS;WACR,MAAM;gBACD,MAAM;oBACF,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;iBACvB,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI;0DA8ElE,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect, forwardRef, useRef, useLayoutEffect, } from "react";
3
+ import { getSearchParams } from "../utils/get-search-params";
4
+ const stackScreenStyle = {
5
+ position: "absolute",
6
+ top: 0,
7
+ left: 0,
8
+ width: "100%",
9
+ height: "100svh",
10
+ background: "#fff",
11
+ boxSizing: "border-box",
12
+ boxShadow: "0 2px 8px rgba(0,0,0,0.08)",
13
+ willChange: "transform, opacity",
14
+ overflow: "hidden",
15
+ transition: `transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), filter 0.5s cubic-bezier(0.32, 0.72, 0, 1)`,
16
+ };
17
+ export const StackScreen = forwardRef(({ item, index, totalCount, onExitComplete, onDragStart, ...rest }, ref) => {
18
+ const [isMounted, setIsMounted] = useState(false);
19
+ const [dynamicPadding, setDynamicPadding] = useState({
20
+ paddingTop: 0,
21
+ paddingBottom: 0,
22
+ });
23
+ const isExiting = item.transition === "pop";
24
+ const containerRef = useRef(null);
25
+ useLayoutEffect(() => {
26
+ const elList = containerRef.current?.querySelectorAll(".stack-view");
27
+ if (!elList)
28
+ return;
29
+ elList.forEach((el) => {
30
+ el.style.paddingTop = `${dynamicPadding.paddingTop}px`;
31
+ el.style.paddingBottom = `${dynamicPadding.paddingBottom}px`;
32
+ });
33
+ }, [dynamicPadding.paddingTop, dynamicPadding.paddingBottom]);
34
+ useEffect(() => {
35
+ const frame = requestAnimationFrame(() => {
36
+ setIsMounted(true);
37
+ });
38
+ return () => cancelAnimationFrame(frame);
39
+ }, []);
40
+ useEffect(() => {
41
+ if (isExiting) {
42
+ const timer = setTimeout(() => {
43
+ onExitComplete(item.id);
44
+ }, 500);
45
+ return () => clearTimeout(timer);
46
+ }
47
+ }, [isExiting, item.id, onExitComplete]);
48
+ useEffect(() => {
49
+ const searchParams = getSearchParams();
50
+ setDynamicPadding({
51
+ paddingTop: Number(searchParams["top"] || 0),
52
+ paddingBottom: Number(searchParams["bottom"] || 0),
53
+ });
54
+ }, []);
55
+ const isTop = index === totalCount - 1;
56
+ const style = {
57
+ ...stackScreenStyle,
58
+ display: "block",
59
+ zIndex: index,
60
+ pointerEvents: isTop ? "auto" : "none",
61
+ };
62
+ if (isExiting) {
63
+ style.transform = `translateX(100%)`;
64
+ }
65
+ else if (isTop) {
66
+ style.transform = isMounted ? "translateX(0)" : "translateX(100%)";
67
+ }
68
+ else {
69
+ style.transform = `translateX(0)`;
70
+ style.filter = `none`;
71
+ }
72
+ return (_jsx("div", { ref: (node) => {
73
+ if (typeof ref === "function")
74
+ ref(node);
75
+ else if (ref)
76
+ ref.current = node;
77
+ containerRef.current = node;
78
+ }, style: style, onTouchStart: (e) => onDragStart(e, index), onMouseDown: (e) => onDragStart(e, index), ...rest, children: _jsx(item.Component, { ...item.props, isTop: isTop }) }));
79
+ });
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ import { StackApi } from "../types";
3
+ export declare const StackContext: import("react").Context<StackApi | null>;
4
+ export declare const StackProvider: ({ children }: {
5
+ children: ReactNode;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=stack-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-provider.d.ts","sourceRoot":"","sources":["../../src/context/stack-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAA;AAGrE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,eAAO,MAAM,YAAY,0CAAuC,CAAA;AAEhE,eAAO,MAAM,aAAa,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAC/D,4CAkBD,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useMemo, useReducer } from "react";
3
+ import { stackReducer } from "./stack-reducer";
4
+ import { createStackActions } from "../utils/create-stack-actions";
5
+ export const StackContext = createContext(null);
6
+ export const StackProvider = ({ children }) => {
7
+ const [state, dispatch] = useReducer(stackReducer, { stack: [] });
8
+ const actions = useMemo(() => createStackActions(dispatch), [dispatch]);
9
+ const api = {
10
+ stack: state.stack,
11
+ ...actions,
12
+ };
13
+ return (_jsx(StackContext.Provider, { value: api, children: children }));
14
+ };
@@ -0,0 +1,3 @@
1
+ import { StackAction, StackState } from "../types";
2
+ export declare const stackReducer: (state: StackState, action: StackAction) => StackState;
3
+ //# sourceMappingURL=stack-reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-reducer.d.ts","sourceRoot":"","sources":["../../src/context/stack-reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAElD,eAAO,MAAM,YAAY,GAAI,OAAO,UAAU,EAAE,QAAQ,WAAW,KAAG,UAqBrE,CAAA"}
@@ -0,0 +1,22 @@
1
+ export const stackReducer = (state, action) => {
2
+ switch (action.type) {
3
+ case 'PUSH':
4
+ return { stack: [...state.stack, { ...action.item, transition: 'push' }] };
5
+ case 'POP':
6
+ return {
7
+ ...state,
8
+ stack: state.stack.map((item, index) => {
9
+ if (index === state.stack.length - 1) {
10
+ return { ...item, transition: 'pop' };
11
+ }
12
+ return item;
13
+ }),
14
+ };
15
+ case 'REMOVE':
16
+ return {
17
+ ...state,
18
+ stack: state.stack.filter(item => item.id !== action.id),
19
+ };
20
+ }
21
+ return state;
22
+ };
@@ -0,0 +1,2 @@
1
+ export declare const useStack: () => import("../types").StackApi;
2
+ //# sourceMappingURL=useStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStack.d.ts","sourceRoot":"","sources":["../../src/hooks/useStack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,mCAMpB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { useContext } from "react";
2
+ import { StackContext } from "../context/stack-provider";
3
+ export const useStack = () => {
4
+ const ctx = useContext(StackContext);
5
+ if (!ctx) {
6
+ throw new Error('useStack must be used inside StackProvider');
7
+ }
8
+ return ctx;
9
+ };
@@ -0,0 +1,4 @@
1
+ export { NavigationStack } from "./components/NavigationStack";
2
+ export { useStack } from "./hooks/useStack";
3
+ export { Stack } from "./components/Stack";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { NavigationStack } from "./components/NavigationStack";
2
+ export { useStack } from "./hooks/useStack";
3
+ export { Stack } from "./components/Stack";
@@ -0,0 +1,26 @@
1
+ import type { ComponentType } from "react";
2
+ export interface StackItem<P = any> {
3
+ id: string;
4
+ Component: ComponentType<P>;
5
+ props: P;
6
+ transition?: "push" | "pop";
7
+ }
8
+ export interface StackState {
9
+ stack: StackItem[];
10
+ }
11
+ export type StackAction = {
12
+ type: "PUSH";
13
+ item: StackItem;
14
+ } | {
15
+ type: "POP";
16
+ } | {
17
+ type: "REMOVE";
18
+ id: string;
19
+ };
20
+ export interface StackApi {
21
+ stack: StackItem[];
22
+ push<P>(component: ComponentType<P>, props: P): void;
23
+ pop(): void;
24
+ remove(id: string): void;
25
+ }
26
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC;IACT,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,SAAS,EAAE,CAAC;IAEnB,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAErD,GAAG,IAAI,IAAI,CAAC;IAEZ,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { StackAction } from "../types";
2
+ export declare const createStackActions: (dispatch: React.Dispatch<StackAction>) => {
3
+ push<P>(Component: React.ComponentType<P>, props: P): void;
4
+ pop(): void;
5
+ remove(id: string): void;
6
+ };
7
+ //# sourceMappingURL=create-stack-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-stack-actions.d.ts","sourceRoot":"","sources":["../../src/utils/create-stack-actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,kBAAkB,GAAI,UAAU,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;SAE/D,CAAC,aAAa,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;;eAexC,MAAM;CAIpB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { nanoid } from "nanoid";
2
+ export const createStackActions = (dispatch) => {
3
+ return {
4
+ push(Component, props) {
5
+ dispatch({
6
+ type: "PUSH",
7
+ item: {
8
+ id: nanoid(),
9
+ Component,
10
+ props,
11
+ },
12
+ });
13
+ },
14
+ pop() {
15
+ dispatch({ type: "POP" });
16
+ },
17
+ remove(id) {
18
+ dispatch({ type: "REMOVE", id });
19
+ },
20
+ };
21
+ };
@@ -0,0 +1,2 @@
1
+ export declare const getSearchParams: () => Record<string, string>;
2
+ //# sourceMappingURL=get-search-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-search-params.d.ts","sourceRoot":"","sources":["../../src/utils/get-search-params.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,QAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAWvD,CAAC"}
@@ -0,0 +1,11 @@
1
+ export const getSearchParams = () => {
2
+ if (typeof window === 'undefined') {
3
+ return {};
4
+ }
5
+ const searchParams = new URLSearchParams(window.location.search);
6
+ const params = {};
7
+ for (const [key, value] of searchParams.entries()) {
8
+ params[key] = value;
9
+ }
10
+ return params;
11
+ };
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@cher1shrxd/webview-stack-kit",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "sideEffects": false,
18
+ "scripts": {
19
+ "build": "tsc -p tsconfig.build.json",
20
+ "prepack": "pnpm run build",
21
+ "typecheck": "tsc -b"
22
+ },
23
+ "peerDependencies": {
24
+ "react": ">=19",
25
+ "react-dom": ">=19",
26
+ "nanoid": ">=3"
27
+ },
28
+ "devDependencies": {
29
+ "@types/react": "^19.2.10",
30
+ "@types/react-dom": "^19.2.3",
31
+ "typescript": "^5.9.3"
32
+ }
33
+ }