@superrb/react-addons 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.
- package/components/back-to-top.d.ts +3 -0
- package/components/back-to-top.d.ts.map +1 -0
- package/components/back-to-top.js +5 -0
- package/components/button.d.ts +14 -0
- package/components/button.d.ts.map +1 -0
- package/components/button.js +31 -0
- package/components/context-wrapper.d.ts +4 -0
- package/components/context-wrapper.d.ts.map +1 -0
- package/components/context-wrapper.js +4 -0
- package/components/image.d.ts +11 -0
- package/components/image.d.ts.map +1 -0
- package/components/image.js +7 -0
- package/components/link.d.ts +49 -0
- package/components/link.d.ts.map +1 -0
- package/components/link.js +11 -0
- package/components/menu-toggle.d.ts +11 -0
- package/components/menu-toggle.d.ts.map +1 -0
- package/components/menu-toggle.js +28 -0
- package/components/modal.d.ts +10 -0
- package/components/modal.d.ts.map +1 -0
- package/components/modal.js +33 -0
- package/components/skip-to.d.ts +3 -0
- package/components/skip-to.d.ts.map +1 -0
- package/components/skip-to.js +5 -0
- package/components.d.ts +11 -0
- package/components.d.ts.map +1 -0
- package/components.js +10 -0
- package/context/modal-context-provider.d.ts +13 -0
- package/context/modal-context-provider.d.ts.map +1 -0
- package/context/modal-context-provider.js +31 -0
- package/context/nav-context-provider.d.ts +10 -0
- package/context/nav-context-provider.d.ts.map +1 -0
- package/context/nav-context-provider.js +26 -0
- package/context.d.ts +7 -0
- package/context.d.ts.map +1 -0
- package/context.js +6 -0
- package/hooks/use-async.d.ts +10 -0
- package/hooks/use-async.d.ts.map +1 -0
- package/hooks/use-async.js +42 -0
- package/hooks/use-draggable-scroll.d.ts +11 -0
- package/hooks/use-draggable-scroll.d.ts.map +1 -0
- package/hooks/use-draggable-scroll.js +56 -0
- package/hooks/use-event-listener.d.ts +7 -0
- package/hooks/use-event-listener.d.ts.map +1 -0
- package/hooks/use-event-listener.js +46 -0
- package/hooks/use-hide-on-scroll.d.ts +3 -0
- package/hooks/use-hide-on-scroll.d.ts.map +1 -0
- package/hooks/use-hide-on-scroll.js +35 -0
- package/hooks/use-id.d.ts +3 -0
- package/hooks/use-id.d.ts.map +1 -0
- package/hooks/use-id.js +9 -0
- package/hooks/use-is-in-viewport.d.ts +6 -0
- package/hooks/use-is-in-viewport.d.ts.map +1 -0
- package/hooks/use-is-in-viewport.js +64 -0
- package/hooks/use-is-mobile.d.ts +3 -0
- package/hooks/use-is-mobile.d.ts.map +1 -0
- package/hooks/use-is-mobile.js +16 -0
- package/hooks/use-lock-body-scroll.d.ts +3 -0
- package/hooks/use-lock-body-scroll.d.ts.map +1 -0
- package/hooks/use-lock-body-scroll.js +10 -0
- package/hooks/use-modal.d.ts +7 -0
- package/hooks/use-modal.d.ts.map +1 -0
- package/hooks/use-modal.js +15 -0
- package/hooks/use-motion-allowed.d.ts +3 -0
- package/hooks/use-motion-allowed.d.ts.map +1 -0
- package/hooks/use-motion-allowed.js +9 -0
- package/hooks/use-parallax.d.ts +3 -0
- package/hooks/use-parallax.d.ts.map +1 -0
- package/hooks/use-parallax.js +18 -0
- package/hooks.d.ts +16 -0
- package/hooks.d.ts.map +1 -0
- package/hooks.js +15 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +7 -0
- package/package.json +33 -0
- package/storage.d.ts +3 -0
- package/storage.d.ts.map +1 -0
- package/storage.js +3 -0
- package/tsconfig.json +43 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/utils/animate.d.ts +4 -0
- package/utils/animate.d.ts.map +1 -0
- package/utils/animate.js +27 -0
- package/utils/animator.d.ts +3 -0
- package/utils/animator.d.ts.map +1 -0
- package/utils/animator.js +24 -0
- package/utils/easing-functions.d.ts +20 -0
- package/utils/easing-functions.d.ts.map +1 -0
- package/utils/easing-functions.js +28 -0
- package/utils/extend-class.d.ts +3 -0
- package/utils/extend-class.d.ts.map +1 -0
- package/utils/extend-class.js +7 -0
- package/utils/get-y-pos.d.ts +3 -0
- package/utils/get-y-pos.d.ts.map +1 -0
- package/utils/get-y-pos.js +9 -0
- package/utils/get.d.ts +7 -0
- package/utils/get.d.ts.map +1 -0
- package/utils/get.js +8 -0
- package/utils/is-external-link.d.ts +3 -0
- package/utils/is-external-link.d.ts.map +1 -0
- package/utils/is-external-link.js +22 -0
- package/utils/scroll-to-hash.d.ts +3 -0
- package/utils/scroll-to-hash.d.ts.map +1 -0
- package/utils/scroll-to-hash.js +10 -0
- package/utils/storage-factory.d.ts +2 -0
- package/utils/storage-factory.d.ts.map +1 -0
- package/utils/storage-factory.js +73 -0
- package/utils.d.ts +9 -0
- package/utils.d.ts.map +1 -0
- package/utils.js +8 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEventListener } from "../hooks";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
const useHideOnScroll = (hiddenOnLoad = false) => {
|
|
4
|
+
const [hidden, setHidden] = useState(hiddenOnLoad);
|
|
5
|
+
const handleScroll = useCallback(() => {
|
|
6
|
+
const previousY = window.scrollY;
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
const y = window.scrollY;
|
|
9
|
+
if (y <= 50) {
|
|
10
|
+
setHidden(false);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (y > previousY + 10) {
|
|
14
|
+
setHidden(true);
|
|
15
|
+
}
|
|
16
|
+
if (y < previousY - 10) {
|
|
17
|
+
setHidden(false);
|
|
18
|
+
}
|
|
19
|
+
}, 100);
|
|
20
|
+
}, [setHidden]);
|
|
21
|
+
const handleLoad = useCallback(() => {
|
|
22
|
+
if (window.scrollY > 0) {
|
|
23
|
+
setHidden(true);
|
|
24
|
+
}
|
|
25
|
+
}, [setHidden]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
handleScroll();
|
|
28
|
+
}, []);
|
|
29
|
+
useEventListener("scroll", handleScroll, { passive: true }, typeof window !== "undefined" ? window : undefined);
|
|
30
|
+
useEventListener("resize", handleLoad, { passive: true }, typeof window !== "undefined" ? window : undefined);
|
|
31
|
+
useEventListener("popstate", handleLoad, { passive: true }, typeof window !== "undefined" ? window : undefined);
|
|
32
|
+
useEventListener("pageshow", handleLoad, { passive: true }, typeof window !== "undefined" ? window : undefined);
|
|
33
|
+
return hidden;
|
|
34
|
+
};
|
|
35
|
+
export default useHideOnScroll;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-id.d.ts","sourceRoot":"","sources":["../src/hooks/use-id.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,KAAK,WAAY,MAAM,WAU5B,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/hooks/use-id.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
const useId = (prefix) => {
|
|
3
|
+
const [id, setId] = useState(`${prefix}-${Math.random().toString(36).substring(2, 9)}`);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
setId(`${prefix}-${Math.random().toString(36).substring(2, 9)}`);
|
|
6
|
+
}, [prefix]);
|
|
7
|
+
return id;
|
|
8
|
+
};
|
|
9
|
+
export default useId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-is-in-viewport.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-in-viewport.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,eAAe;;kBAgEQ,WAAW,GAAG,IAAI;CAe9C,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
const useIsInViewport = (initial = false, rootMargin = '0px 0px', threshold = [0, 0.25, 0.5, 0.75, 1]) => {
|
|
3
|
+
const [isInViewport, setIsInViewport] = useState(initial);
|
|
4
|
+
const element = useRef();
|
|
5
|
+
const observer = useRef();
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (!observer.current) {
|
|
8
|
+
observer.current = new IntersectionObserver(entries => {
|
|
9
|
+
entries.forEach(entry => {
|
|
10
|
+
setIsInViewport(entry.isIntersecting && entry.intersectionRatio > 0);
|
|
11
|
+
});
|
|
12
|
+
}, {
|
|
13
|
+
rootMargin,
|
|
14
|
+
threshold,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return () => {
|
|
18
|
+
if (observer.current) {
|
|
19
|
+
observer.current.disconnect();
|
|
20
|
+
observer.current = null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
const waitForObserver = () => {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
if (observer.current) {
|
|
27
|
+
resolve(observer.current);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let waitTimer;
|
|
31
|
+
const rejectionTimer = setTimeout(() => {
|
|
32
|
+
clearTimeout(waitTimer);
|
|
33
|
+
reject(new Error('Timeout waiting for observer'));
|
|
34
|
+
}, 5000);
|
|
35
|
+
const wait = () => {
|
|
36
|
+
if (observer.current) {
|
|
37
|
+
clearTimeout(rejectionTimer);
|
|
38
|
+
clearTimeout(waitTimer);
|
|
39
|
+
resolve(observer.current);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
waitTimer = setTimeout(wait, 1000);
|
|
43
|
+
return;
|
|
44
|
+
};
|
|
45
|
+
wait();
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const setRef = async (ref) => {
|
|
49
|
+
element.current = ref;
|
|
50
|
+
if (ref) {
|
|
51
|
+
try {
|
|
52
|
+
const observer = await waitForObserver();
|
|
53
|
+
observer.observe(ref);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// If IntersectionObserver fails, just set isInViewport to true
|
|
57
|
+
console.error(error);
|
|
58
|
+
setIsInViewport(true);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return { isInViewport, setRef };
|
|
63
|
+
};
|
|
64
|
+
export default useIsInViewport;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-is-mobile.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-mobile.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,+CAiBhB,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
const useIsMobile = (initial = true, size = '63.75em') => {
|
|
3
|
+
const [isMobile, setIsMobile] = useState(initial);
|
|
4
|
+
const setScreenSize = useCallback(() => {
|
|
5
|
+
setIsMobile(!window.matchMedia(`(min-width: ${size})`).matches);
|
|
6
|
+
}, [setIsMobile]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setScreenSize();
|
|
9
|
+
window.addEventListener('resize', setScreenSize);
|
|
10
|
+
return () => {
|
|
11
|
+
window.removeEventListener('resize', setScreenSize);
|
|
12
|
+
};
|
|
13
|
+
}, [setScreenSize]);
|
|
14
|
+
return isMobile;
|
|
15
|
+
};
|
|
16
|
+
export default useIsMobile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-lock-body-scroll.d.ts","sourceRoot":"","sources":["../src/hooks/use-lock-body-scroll.ts"],"names":[],"mappings":"AAEA,iBAAS,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAOhD;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
function useLockBodyScroll(toggle) {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
document.body.style.overflow = toggle ? 'hidden' : 'unset';
|
|
5
|
+
return () => {
|
|
6
|
+
document.body.style.overflow = 'unset';
|
|
7
|
+
};
|
|
8
|
+
}, [toggle]);
|
|
9
|
+
}
|
|
10
|
+
export default useLockBodyScroll;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-modal.d.ts","sourceRoot":"","sources":["../src/hooks/use-modal.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,QAAQ,SAAU,MAAM;;;;CAa7B,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useContext, useEffect, useState } from "react";
|
|
2
|
+
import { ModalContext } from "../context";
|
|
3
|
+
const useModal = (name) => {
|
|
4
|
+
const [open, setOpen] = useState(false);
|
|
5
|
+
const { openState, openModal, closeModal } = useContext(ModalContext);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
setOpen(openState[name]);
|
|
8
|
+
}, [openState[name]]);
|
|
9
|
+
return {
|
|
10
|
+
isOpen: open,
|
|
11
|
+
openModal: () => openModal(name),
|
|
12
|
+
closeModal: () => closeModal(name),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default useModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-motion-allowed.d.ts","sourceRoot":"","sources":["../src/hooks/use-motion-allowed.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB,eAUrB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
const useMotionAllowed = () => {
|
|
3
|
+
const [motionAllowed, setMotionAllowed] = useState(true);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
setMotionAllowed(!window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
6
|
+
}, [setMotionAllowed]);
|
|
7
|
+
return motionAllowed;
|
|
8
|
+
};
|
|
9
|
+
export default useMotionAllowed;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-parallax.d.ts","sourceRoot":"","sources":["../src/hooks/use-parallax.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,WAAW,UAAW,WAAW,EAAE,SAAQ,OAAO,SA6BvD,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEventListener, useMotionAllowed } from "../hooks";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
const useParallax = (items, flag = true) => {
|
|
4
|
+
const isMotionAllowed = useMotionAllowed();
|
|
5
|
+
const onScroll = useCallback((event) => {
|
|
6
|
+
items.forEach((item, index) => {
|
|
7
|
+
if (!item) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const box = item.getBoundingClientRect();
|
|
11
|
+
requestAnimationFrame(() => {
|
|
12
|
+
item.style.transform = `translate3d(0, ${(box.top / window.innerHeight) * 100 * (1 + index / 500)}%, 0)`;
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}, [items]);
|
|
16
|
+
useEventListener("scroll", onScroll, { passive: true }, undefined, flag && isMotionAllowed);
|
|
17
|
+
};
|
|
18
|
+
export default useParallax;
|
package/hooks.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks
|
|
3
|
+
*/
|
|
4
|
+
import useAsync from "./hooks/use-async";
|
|
5
|
+
import useDraggableScroll from "./hooks/use-draggable-scroll";
|
|
6
|
+
import useEventListener from "./hooks/use-event-listener";
|
|
7
|
+
import useHideOnScroll from "./hooks/use-hide-on-scroll";
|
|
8
|
+
import useId from "./hooks/use-id";
|
|
9
|
+
import useIsInViewport from "./hooks/use-is-in-viewport";
|
|
10
|
+
import useIsMobile from "./hooks/use-is-mobile";
|
|
11
|
+
import useLockBodyScroll from "./hooks/use-lock-body-scroll";
|
|
12
|
+
import useModal from "./hooks/use-modal";
|
|
13
|
+
import useMotionAllowed from "./hooks/use-motion-allowed";
|
|
14
|
+
import useParallax from "./hooks/use-parallax";
|
|
15
|
+
export { useAsync, useDraggableScroll, useEventListener, useHideOnScroll, useId, useIsInViewport, useIsMobile, useLockBodyScroll, useModal, useMotionAllowed, useParallax, };
|
|
16
|
+
//# sourceMappingURL=hooks.d.ts.map
|
package/hooks.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["src/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,WAAW,MAAM,uBAAuB,CAAA;AAC/C,OAAO,iBAAiB,MAAM,8BAA8B,CAAA;AAC5D,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAE9C,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,KAAK,EACL,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,WAAW,GACZ,CAAA"}
|
package/hooks.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks
|
|
3
|
+
*/
|
|
4
|
+
import useAsync from "./hooks/use-async";
|
|
5
|
+
import useDraggableScroll from "./hooks/use-draggable-scroll";
|
|
6
|
+
import useEventListener from "./hooks/use-event-listener";
|
|
7
|
+
import useHideOnScroll from "./hooks/use-hide-on-scroll";
|
|
8
|
+
import useId from "./hooks/use-id";
|
|
9
|
+
import useIsInViewport from "./hooks/use-is-in-viewport";
|
|
10
|
+
import useIsMobile from "./hooks/use-is-mobile";
|
|
11
|
+
import useLockBodyScroll from "./hooks/use-lock-body-scroll";
|
|
12
|
+
import useModal from "./hooks/use-modal";
|
|
13
|
+
import useMotionAllowed from "./hooks/use-motion-allowed";
|
|
14
|
+
import useParallax from "./hooks/use-parallax";
|
|
15
|
+
export { useAsync, useDraggableScroll, useEventListener, useHideOnScroll, useId, useIsInViewport, useIsMobile, useLockBodyScroll, useModal, useMotionAllowed, useParallax, };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Components from "./components";
|
|
2
|
+
import * as Context from "./context";
|
|
3
|
+
import * as Hooks from "./hooks";
|
|
4
|
+
import * as Storage from "./storage";
|
|
5
|
+
import * as Utils from "./utils";
|
|
6
|
+
export { Components, Context, Hooks, Storage, Utils };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Components from "./components";
|
|
2
|
+
import * as Context from "./context";
|
|
3
|
+
import * as Hooks from "./hooks";
|
|
4
|
+
import * as Storage from "./storage";
|
|
5
|
+
// import * as Types from './types'
|
|
6
|
+
import * as Utils from "./utils";
|
|
7
|
+
export { Components, Context, Hooks, Storage, Utils };
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@superrb/react-addons",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"repository": "https://github.com/superrbstudio/react-addons",
|
|
7
|
+
"author": "@molovo",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"private": false,
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"install-peers-cli": "^2.2.0",
|
|
12
|
+
"react-use-draggable-scroll": "^0.4.7"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@prismicio/client": "^7.2.0",
|
|
16
|
+
"@prismicio/next": "^1.3.4",
|
|
17
|
+
"@superrb/react-addons": "^1.0.0",
|
|
18
|
+
"@types/node": "^20.5.7",
|
|
19
|
+
"@types/react": "^18.2.21",
|
|
20
|
+
"next": "^13.4.19",
|
|
21
|
+
"react": "^18.2.0",
|
|
22
|
+
"typescript": "^5.2.2"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"prepublishOnly": "yarn build",
|
|
27
|
+
"prepare": "install-peers",
|
|
28
|
+
"dev": "watch 'yarn build' ./src"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"watch": "^1.0.2"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/storage.d.ts
ADDED
package/storage.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["src/storage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,SAAqC,CAAA;AACvD,eAAO,MAAM,OAAO,SAAuC,CAAA"}
|
package/storage.js
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2021",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"ES2021"
|
|
8
|
+
],
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap": true,
|
|
11
|
+
"allowJs": false,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"noEmit": false,
|
|
15
|
+
"allowSyntheticDefaultImports": true,
|
|
16
|
+
"esModuleInterop": false,
|
|
17
|
+
"module": "ESNext",
|
|
18
|
+
"moduleResolution": "Bundler",
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
"isolatedModules": true,
|
|
22
|
+
"jsx": "react-jsx",
|
|
23
|
+
"incremental": true,
|
|
24
|
+
"outDir": ".",
|
|
25
|
+
"plugins": [
|
|
26
|
+
{
|
|
27
|
+
"name": "next"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"paths": {
|
|
31
|
+
"@/*": [
|
|
32
|
+
"./src/*"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"include": [
|
|
37
|
+
"src/**/*"
|
|
38
|
+
],
|
|
39
|
+
"exclude": [
|
|
40
|
+
"node_modules",
|
|
41
|
+
"!src/**/*"
|
|
42
|
+
]
|
|
43
|
+
}
|