denwa-web-shared 1.0.5 → 1.0.7

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 (32) hide show
  1. package/dist/client/index.d.ts +2 -0
  2. package/dist/{shared → client}/ui/index.d.ts +0 -1
  3. package/dist/denwa-web-shared.cjs.js +1 -39
  4. package/dist/denwa-web-shared.cjs2.js +1 -0
  5. package/dist/denwa-web-shared.cjs3.js +1 -0
  6. package/dist/denwa-web-shared.es.js +30 -5747
  7. package/dist/denwa-web-shared.es2.js +12 -0
  8. package/dist/denwa-web-shared.es3.js +22 -0
  9. package/dist/image-CRxiqKd9.cjs +18 -0
  10. package/dist/image-CeUbwO13.js +2575 -0
  11. package/dist/index.d.ts +2 -6
  12. package/dist/infinity-list-BqhNmBDM.cjs +1 -0
  13. package/dist/infinity-list-ChtJSexP.js +118 -0
  14. package/dist/jsx-runtime-BgsXhnJy.js +3065 -0
  15. package/dist/jsx-runtime-Cgef3_fl.cjs +22 -0
  16. package/dist/server/index.d.ts +5 -0
  17. package/dist/server/ui/index.d.ts +1 -0
  18. package/package.json +16 -10
  19. package/dist/denwa-web-shared.umd.js +0 -39
  20. /package/dist/{shared → client}/hooks/index.d.ts +0 -0
  21. /package/dist/{shared → client}/hooks/use-disable-scroll.d.ts +0 -0
  22. /package/dist/{shared → client}/hooks/use-is-client.d.ts +0 -0
  23. /package/dist/{shared → client}/hooks/use-view-port.d.ts +0 -0
  24. /package/dist/{shared → client}/ui/infinity-list.d.ts +0 -0
  25. /package/dist/{shared → server}/constants/index.d.ts +0 -0
  26. /package/dist/{shared → server}/lib/css.d.ts +0 -0
  27. /package/dist/{shared → server}/lib/images.d.ts +0 -0
  28. /package/dist/{shared → server}/lib/index.d.ts +0 -0
  29. /package/dist/{shared → server}/lib/utils.d.ts +0 -0
  30. /package/dist/{shared → server}/schemas/index.d.ts +0 -0
  31. /package/dist/{shared → server}/types/index.d.ts +0 -0
  32. /package/dist/{shared → server}/ui/image.d.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,6 +1,2 @@
1
- export * from './shared/constants';
2
- export * from './shared/hooks';
3
- export * from './shared/lib';
4
- export * from './shared/schemas';
5
- export * from './shared/types';
6
- export * from './shared/ui';
1
+ export * from './server';
2
+ export * from './client';
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react"),i=require("./jsx-runtime-Cgef3_fl.cjs"),E=t=>{r.useEffect(()=>{if(!t)return;const e=window.scrollY;return()=>{window.scrollTo(0,e)}},[])},l=()=>{const[t,e]=r.useState(!1);return r.useEffect(()=>{e(!0)},[]),t};var M=typeof window<"u",h=function(t,e){var o=r.useState(null),c=o[0],a=o[1];return r.useEffect(function(){if(t.current&&typeof IntersectionObserver=="function"){var u=function(d){a(d[0])},n=new IntersectionObserver(u,e);return n.observe(t.current),function(){a(null),n.disconnect()}}return function(){}},[t.current,e.threshold,e.root,e.rootMargin]),c},f=function(t,e){return M?window.matchMedia(t).matches:(process.env.NODE_ENV!=="production"&&console.warn("`useMedia` When server side rendering, defaultState should be defined to prevent a hydration mismatches."),!1)},s=function(t,e){var o=r.useState(f(t)),c=o[0],a=o[1];return r.useEffect(function(){var u=!0,n=window.matchMedia(t),d=function(){u&&a(!!n.matches)};return n.addEventListener("change",d),a(n.matches),function(){u=!1,n.removeEventListener("change",d)}},[t]),c};const x=()=>{const t=s(`(min-width: ${i.THEME.VIEW_PORT.LAPTOP_BIG}px)`),e=s(`(max-width: ${i.THEME.VIEW_PORT.LAPTOP_BIG}px)`);return{isLaptopBigMinWidth:t,isLaptopBigMaxWidth:e}},T=()=>{const t=s(`(min-width: ${i.THEME.VIEW_PORT.LAPTOP}px)`),e=s(`(max-width: ${i.THEME.VIEW_PORT.LAPTOP}px)`);return{isLaptopMinWidth:t,isLaptopMaxWidth:e}},w=()=>{const t=s(`(min-width: ${i.THEME.VIEW_PORT.TABLET}px)`),e=s(`(max-width: ${i.THEME.VIEW_PORT.TABLET}px)`);return{isTabletMinWidth:t,isTabletMaxWidth:e}},m=()=>{const t=s(`(min-width: ${i.THEME.VIEW_PORT.EXTRA_MEDIUM}px)`),e=s(`(max-width: ${i.THEME.VIEW_PORT.EXTRA_MEDIUM}px)`);return{isExtraMediumMinWidth:t,isExtraMediumMaxWidth:e}},p=()=>{const t=s(`(min-width: ${i.THEME.VIEW_PORT.MOBILE}px)`),e=s(`(max-width: ${i.THEME.VIEW_PORT.MOBILE}px)`);return{isMobileMinWidth:t,isMobileMaxWidth:e}},P=()=>{const t=s(`(min-width: ${i.THEME.VIEW_PORT.SMALL}px)`),e=s(`(max-width: ${i.THEME.VIEW_PORT.SMALL}px)`);return{isSmallMinWidth:t,isSmallMaxWidth:e}},I=({children:t,intersectionElementClassName:e,isNext:o,intersectionElement:c,onIntersection:a})=>{const u=r.useRef({}),n=h(u,{root:null,rootMargin:"0px",threshold:1});return r.useEffect(()=>{n!=null&&n.isIntersecting&&a()},[n==null?void 0:n.isIntersecting]),i.jsxRuntimeExports.jsxs("div",{children:[i.jsxRuntimeExports.jsx("div",{children:t}),i.jsxRuntimeExports.jsx("div",{className:i.cn(e,{hidden:!o}),ref:u,children:c()})]})};exports.InfinityList=I;exports.useDisableScroll=E;exports.useExtraMediumViewPort=m;exports.useIsClient=l;exports.useLaptopBigViewPort=x;exports.useLaptopViewPort=T;exports.useMobileViewPort=p;exports.useSmallViewPort=P;exports.useTabletViewPort=w;
@@ -0,0 +1,118 @@
1
+ import { useEffect as d, useState as h, useRef as f } from "react";
2
+ import { a as i, j as l, c as m } from "./jsx-runtime-BgsXhnJy.js";
3
+ const I = (t) => {
4
+ d(() => {
5
+ if (!t) return;
6
+ const e = window.scrollY;
7
+ return () => {
8
+ window.scrollTo(0, e);
9
+ };
10
+ }, []);
11
+ }, P = () => {
12
+ const [t, e] = h(!1);
13
+ return d(() => {
14
+ e(!0);
15
+ }, []), t;
16
+ };
17
+ var x = typeof window < "u", E = function(t, e) {
18
+ var r = h(null), c = r[0], o = r[1];
19
+ return d(function() {
20
+ if (t.current && typeof IntersectionObserver == "function") {
21
+ var a = function(u) {
22
+ o(u[0]);
23
+ }, n = new IntersectionObserver(a, e);
24
+ return n.observe(t.current), function() {
25
+ o(null), n.disconnect();
26
+ };
27
+ }
28
+ return function() {
29
+ };
30
+ }, [t.current, e.threshold, e.root, e.rootMargin]), c;
31
+ }, M = function(t, e) {
32
+ return x ? window.matchMedia(t).matches : (process.env.NODE_ENV !== "production" && console.warn("`useMedia` When server side rendering, defaultState should be defined to prevent a hydration mismatches."), !1);
33
+ }, s = function(t, e) {
34
+ var r = h(M(t)), c = r[0], o = r[1];
35
+ return d(function() {
36
+ var a = !0, n = window.matchMedia(t), u = function() {
37
+ a && o(!!n.matches);
38
+ };
39
+ return n.addEventListener("change", u), o(n.matches), function() {
40
+ a = !1, n.removeEventListener("change", u);
41
+ };
42
+ }, [t]), c;
43
+ };
44
+ const T = () => {
45
+ const t = s(`(min-width: ${i.VIEW_PORT.LAPTOP_BIG}px)`), e = s(`(max-width: ${i.VIEW_PORT.LAPTOP_BIG}px)`);
46
+ return {
47
+ isLaptopBigMinWidth: t,
48
+ isLaptopBigMaxWidth: e
49
+ };
50
+ }, W = () => {
51
+ const t = s(`(min-width: ${i.VIEW_PORT.LAPTOP}px)`), e = s(`(max-width: ${i.VIEW_PORT.LAPTOP}px)`);
52
+ return {
53
+ isLaptopMinWidth: t,
54
+ isLaptopMaxWidth: e
55
+ };
56
+ }, v = () => {
57
+ const t = s(`(min-width: ${i.VIEW_PORT.TABLET}px)`), e = s(`(max-width: ${i.VIEW_PORT.TABLET}px)`);
58
+ return {
59
+ isTabletMinWidth: t,
60
+ isTabletMaxWidth: e
61
+ };
62
+ }, O = () => {
63
+ const t = s(`(min-width: ${i.VIEW_PORT.EXTRA_MEDIUM}px)`), e = s(`(max-width: ${i.VIEW_PORT.EXTRA_MEDIUM}px)`);
64
+ return {
65
+ isExtraMediumMinWidth: t,
66
+ isExtraMediumMaxWidth: e
67
+ };
68
+ }, L = () => {
69
+ const t = s(`(min-width: ${i.VIEW_PORT.MOBILE}px)`), e = s(`(max-width: ${i.VIEW_PORT.MOBILE}px)`);
70
+ return {
71
+ isMobileMinWidth: t,
72
+ isMobileMaxWidth: e
73
+ };
74
+ }, V = () => {
75
+ const t = s(`(min-width: ${i.VIEW_PORT.SMALL}px)`), e = s(`(max-width: ${i.VIEW_PORT.SMALL}px)`);
76
+ return {
77
+ isSmallMinWidth: t,
78
+ isSmallMaxWidth: e
79
+ };
80
+ }, _ = ({
81
+ children: t,
82
+ intersectionElementClassName: e,
83
+ isNext: r,
84
+ intersectionElement: c,
85
+ onIntersection: o
86
+ }) => {
87
+ const a = f({}), n = E(a, {
88
+ root: null,
89
+ rootMargin: "0px",
90
+ threshold: 1
91
+ });
92
+ return d(() => {
93
+ n != null && n.isIntersecting && o();
94
+ }, [n == null ? void 0 : n.isIntersecting]), /* @__PURE__ */ l.jsxs("div", { children: [
95
+ /* @__PURE__ */ l.jsx("div", { children: t }),
96
+ /* @__PURE__ */ l.jsx(
97
+ "div",
98
+ {
99
+ className: m(e, {
100
+ hidden: !r
101
+ }),
102
+ ref: a,
103
+ children: c()
104
+ }
105
+ )
106
+ ] });
107
+ };
108
+ export {
109
+ _ as I,
110
+ P as a,
111
+ T as b,
112
+ W as c,
113
+ v as d,
114
+ O as e,
115
+ L as f,
116
+ V as g,
117
+ I as u
118
+ };