@carlonicora/nextjs-jsonapi 1.133.0 → 1.134.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/dist/{BlockNoteEditor-H626BS5Y.js → BlockNoteEditor-2WOKHBLM.js} +19 -19
- package/dist/{BlockNoteEditor-H626BS5Y.js.map → BlockNoteEditor-2WOKHBLM.js.map} +1 -1
- package/dist/{BlockNoteEditor-VXK7INMR.mjs → BlockNoteEditor-3IHMNBZ2.mjs} +4 -4
- package/dist/billing/index.js +357 -357
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-F6KBHC2X.js → chunk-C2LEIBUK.js} +7 -7
- package/dist/{chunk-F6KBHC2X.js.map → chunk-C2LEIBUK.js.map} +1 -1
- package/dist/{chunk-WEDLGKSS.mjs → chunk-DV5YYI3G.mjs} +1990 -1906
- package/dist/chunk-DV5YYI3G.mjs.map +1 -0
- package/dist/{chunk-DZL2G7NB.mjs → chunk-DVOBOFCF.mjs} +38 -11
- package/dist/chunk-DVOBOFCF.mjs.map +1 -0
- package/dist/{chunk-TVJFCWST.js → chunk-LBXHYRZH.js} +813 -729
- package/dist/chunk-LBXHYRZH.js.map +1 -0
- package/dist/{chunk-VSAAVVHY.mjs → chunk-M5IAN7IR.mjs} +2 -2
- package/dist/{chunk-5IE6DZ2D.js → chunk-W73JBOIR.js} +39 -12
- package/dist/{chunk-5IE6DZ2D.js.map → chunk-W73JBOIR.js.map} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.d.mts +42 -2
- package/dist/contexts/index.d.ts +42 -2
- package/dist/contexts/index.js +12 -4
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +11 -3
- package/dist/core/index.d.mts +3 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +5 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/containers/PageContainer.tsx +7 -2
- package/src/components/containers/RoundPageContainer.tsx +16 -4
- package/src/components/navigations/Header.tsx +17 -6
- package/src/components/pages/PageContentContainer.tsx +1 -1
- package/src/contexts/HeaderChildrenContext.tsx +23 -2
- package/src/contexts/HeaderLogoContext.tsx +25 -0
- package/src/contexts/ViewportContext.tsx +46 -0
- package/src/contexts/index.ts +2 -0
- package/src/core/registry/__tests__/viewportStore.test.ts +50 -0
- package/src/core/registry/viewportStore.ts +47 -0
- package/src/utils/__tests__/use-mobile.test.tsx +137 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/use-mobile.tsx +70 -13
- package/dist/chunk-DZL2G7NB.mjs.map +0 -1
- package/dist/chunk-TVJFCWST.js.map +0 -1
- package/dist/chunk-WEDLGKSS.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-VXK7INMR.mjs.map → BlockNoteEditor-3IHMNBZ2.mjs.map} +0 -0
- /package/dist/{chunk-VSAAVVHY.mjs.map → chunk-M5IAN7IR.mjs.map} +0 -0
|
@@ -1181,18 +1181,39 @@ __name(useComposedRefs, "useComposedRefs");
|
|
|
1181
1181
|
// src/utils/use-mobile.tsx
|
|
1182
1182
|
import * as React2 from "react";
|
|
1183
1183
|
var MOBILE_BREAKPOINT = 768;
|
|
1184
|
+
var VIEWPORT_COOKIE_NAME = "viewport_mobile";
|
|
1185
|
+
var VIEWPORT_CONTEXT_KEY = /* @__PURE__ */ Symbol.for("nextjs-jsonapi:viewportContext");
|
|
1186
|
+
var globalStore2 = globalThis;
|
|
1187
|
+
function getViewportContext() {
|
|
1188
|
+
if (globalStore2[VIEWPORT_CONTEXT_KEY] === void 0) {
|
|
1189
|
+
globalStore2[VIEWPORT_CONTEXT_KEY] = React2.createContext(void 0);
|
|
1190
|
+
}
|
|
1191
|
+
return globalStore2[VIEWPORT_CONTEXT_KEY];
|
|
1192
|
+
}
|
|
1193
|
+
__name(getViewportContext, "getViewportContext");
|
|
1194
|
+
function measureViewport() {
|
|
1195
|
+
return window.innerWidth < MOBILE_BREAKPOINT;
|
|
1196
|
+
}
|
|
1197
|
+
__name(measureViewport, "measureViewport");
|
|
1198
|
+
function persistViewport(isMobile) {
|
|
1199
|
+
document.cookie = `${VIEWPORT_COOKIE_NAME}=${isMobile ? "1" : "0"}; path=/; max-age=31536000; samesite=lax`;
|
|
1200
|
+
}
|
|
1201
|
+
__name(persistViewport, "persistViewport");
|
|
1202
|
+
function subscribeViewport(onChange) {
|
|
1203
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
1204
|
+
onChange();
|
|
1205
|
+
mql.addEventListener("change", onChange);
|
|
1206
|
+
return () => mql.removeEventListener("change", onChange);
|
|
1207
|
+
}
|
|
1208
|
+
__name(subscribeViewport, "subscribeViewport");
|
|
1184
1209
|
function useIsMobile() {
|
|
1185
|
-
const
|
|
1210
|
+
const seeded = React2.useContext(getViewportContext());
|
|
1211
|
+
const [legacy, setLegacy] = React2.useState(false);
|
|
1186
1212
|
React2.useEffect(() => {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
mql.addEventListener("change", onChange);
|
|
1192
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
1193
|
-
return () => mql.removeEventListener("change", onChange);
|
|
1194
|
-
}, []);
|
|
1195
|
-
return !!isMobile;
|
|
1213
|
+
if (seeded !== void 0) return;
|
|
1214
|
+
return subscribeViewport(() => setLegacy(measureViewport()));
|
|
1215
|
+
}, [seeded]);
|
|
1216
|
+
return seeded ?? legacy;
|
|
1196
1217
|
}
|
|
1197
1218
|
__name(useIsMobile, "useIsMobile");
|
|
1198
1219
|
|
|
@@ -7767,6 +7788,12 @@ export {
|
|
|
7767
7788
|
cn,
|
|
7768
7789
|
composeRefs,
|
|
7769
7790
|
useComposedRefs,
|
|
7791
|
+
MOBILE_BREAKPOINT,
|
|
7792
|
+
VIEWPORT_COOKIE_NAME,
|
|
7793
|
+
getViewportContext,
|
|
7794
|
+
measureViewport,
|
|
7795
|
+
persistViewport,
|
|
7796
|
+
subscribeViewport,
|
|
7770
7797
|
useIsMobile,
|
|
7771
7798
|
formatLocalDate,
|
|
7772
7799
|
formatDate,
|
|
@@ -7930,4 +7957,4 @@ export {
|
|
|
7930
7957
|
AuditLogService,
|
|
7931
7958
|
AuditLogModule
|
|
7932
7959
|
};
|
|
7933
|
-
//# sourceMappingURL=chunk-
|
|
7960
|
+
//# sourceMappingURL=chunk-DVOBOFCF.mjs.map
|