nexus-shared 1.0.7 → 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/USER-GUIDE.md +11 -2
- package/dist/index.cjs +2 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/USER-GUIDE.md
CHANGED
|
@@ -96,13 +96,22 @@ await HideLoader();
|
|
|
96
96
|
|
|
97
97
|
### Global layout (Next.js)
|
|
98
98
|
|
|
99
|
+
`next/font` must run in your app (not inside the pre-built package). Define the font in `app/layout.tsx` and pass `className` to `GlobalLayout`:
|
|
100
|
+
|
|
99
101
|
```tsx
|
|
100
|
-
import {
|
|
102
|
+
import { Inter } from "next/font/google";
|
|
103
|
+
import { DEFAULT_FONT_WEIGHTS, GlobalLayout, GetGlobalLayout } from "nexus.core";
|
|
104
|
+
|
|
105
|
+
const inter = Inter({ weight: DEFAULT_FONT_WEIGHTS, subsets: ["latin"] });
|
|
101
106
|
|
|
102
107
|
const globalLayout = GetGlobalLayout(/* … */);
|
|
103
108
|
|
|
104
109
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
105
|
-
return
|
|
110
|
+
return (
|
|
111
|
+
<GlobalLayout globalLayout={globalLayout} bodyClassName={inter.className}>
|
|
112
|
+
{children}
|
|
113
|
+
</GlobalLayout>
|
|
114
|
+
);
|
|
106
115
|
}
|
|
107
116
|
```
|
|
108
117
|
|
package/dist/index.cjs
CHANGED
|
@@ -4,7 +4,6 @@ var dotenv = require('dotenv');
|
|
|
4
4
|
var Link = require('next/link');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var google = require('next/font/google');
|
|
8
7
|
var Script = require('next/script');
|
|
9
8
|
|
|
10
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -2609,8 +2608,7 @@ var LayoutHelpers = ({ globalLayout }) => {
|
|
|
2609
2608
|
}, []);
|
|
2610
2609
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-popup-container" });
|
|
2611
2610
|
};
|
|
2612
|
-
var
|
|
2613
|
-
var GlobalLayout = async ({ children, globalLayout }) => {
|
|
2611
|
+
var GlobalLayout = async ({ children, globalLayout, bodyClassName }) => {
|
|
2614
2612
|
return /* @__PURE__ */ jsxRuntime.jsxs("html", { lang: "en", children: [
|
|
2615
2613
|
/* @__PURE__ */ jsxRuntime.jsxs("head", { children: [
|
|
2616
2614
|
/* @__PURE__ */ jsxRuntime.jsx("title", { children: globalLayout.defaultDocumentTitle }),
|
|
@@ -2620,7 +2618,7 @@ var GlobalLayout = async ({ children, globalLayout }) => {
|
|
|
2620
2618
|
/* @__PURE__ */ jsxRuntime.jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }),
|
|
2621
2619
|
/* @__PURE__ */ jsxRuntime.jsx("style", { id: "nexus-styles" })
|
|
2622
2620
|
] }),
|
|
2623
|
-
/* @__PURE__ */ jsxRuntime.jsxs("body", { className:
|
|
2621
|
+
/* @__PURE__ */ jsxRuntime.jsxs("body", { className: bodyClassName, children: [
|
|
2624
2622
|
/* @__PURE__ */ jsxRuntime.jsx(LayoutHelpers, { globalLayout }),
|
|
2625
2623
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2626
2624
|
"div",
|
|
@@ -2960,7 +2958,6 @@ exports.GlobalDialogbox = GlobalDialogbox;
|
|
|
2960
2958
|
exports.GlobalLayout = GlobalLayout;
|
|
2961
2959
|
exports.HasFlag = HasFlag;
|
|
2962
2960
|
exports.HideLoader = HideLoader;
|
|
2963
|
-
exports.INTER_FONT = INTER_FONT;
|
|
2964
2961
|
exports.Icon = Icon;
|
|
2965
2962
|
exports.Iconbox = Iconbox;
|
|
2966
2963
|
exports.InitializeDialogbox = InitializeDialogbox;
|