denwa-web-shared 1.0.8 → 1.0.9
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/client/hooks/index.d.ts +3 -0
- package/dist/client/hooks/use-disable-scroll.d.ts +1 -0
- package/dist/client/hooks/use-is-client.d.ts +1 -0
- package/dist/{client.d.ts → client/hooks/use-view-port.d.ts} +24 -48
- package/dist/client/index.d.ts +2 -0
- package/dist/client/ui/index.d.ts +1 -0
- package/dist/client/ui/infinity-list.d.ts +10 -0
- package/dist/denwa-web-shared.cjs.js +39 -1
- package/dist/denwa-web-shared.es.js +5747 -30
- package/dist/denwa-web-shared.umd.js +39 -0
- package/dist/index.d.ts +2 -0
- package/dist/server/constants/index.d.ts +39 -0
- package/dist/server/index.d.ts +5 -0
- package/dist/server/lib/css.d.ts +2 -0
- package/dist/server/lib/images.d.ts +46 -0
- package/dist/server/lib/index.d.ts +3 -0
- package/dist/server/lib/utils.d.ts +116 -0
- package/dist/server/schemas/index.d.ts +13 -0
- package/dist/server/types/index.d.ts +42 -0
- package/dist/server/ui/image.d.ts +20 -0
- package/dist/server/ui/index.d.ts +1 -0
- package/package.json +5 -12
- package/dist/client/denwa-web-shared.client.cjs.js +0 -1
- package/dist/client/denwa-web-shared.client.es.js +0 -12
- package/dist/image-CRxiqKd9.cjs +0 -18
- package/dist/image-CeUbwO13.js +0 -2575
- package/dist/infinity-list-BqhNmBDM.cjs +0 -1
- package/dist/infinity-list-ChtJSexP.js +0 -118
- package/dist/jsx-runtime-BgsXhnJy.js +0 -3065
- package/dist/jsx-runtime-Cgef3_fl.cjs +0 -22
- package/dist/main.d.ts +0 -349
- package/dist/server/denwa-web-shared.server.cjs.js +0 -1
- package/dist/server/denwa-web-shared.server.es.js +0 -22
- package/dist/server.d.ts +0 -304
|
@@ -1 +0,0 @@
|
|
|
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;
|
|
@@ -1,118 +0,0 @@
|
|
|
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
|
-
};
|