@farming-labs/next 0.0.55 → 0.0.57
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-callbacks.d.mts +6 -2
- package/dist/client-callbacks.mjs +13 -2
- package/dist/config.mjs +7 -17
- package/dist/layout.d.mts +5 -4
- package/dist/layout.mjs +10 -7
- package/package.json +3 -3
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/client-callbacks.d.ts
|
|
4
|
+
declare function DocsClientCallbacks(): react_jsx_runtime0.JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { DocsClientCallbacks as default };
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import docsConfig from "@/docs.config";
|
|
5
|
+
import { DocsClientHooks } from "@farming-labs/theme/client-hooks";
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
//#region src/client-callbacks.tsx
|
|
8
|
+
function DocsClientCallbacks() {
|
|
9
|
+
return /* @__PURE__ */ jsx(DocsClientHooks, {
|
|
10
|
+
onCopyClick: docsConfig.onCopyClick,
|
|
11
|
+
onFeedback: docsConfig.feedback && typeof docsConfig.feedback === "object" ? docsConfig.feedback.onFeedback : void 0
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DocsClientCallbacks as default };
|
package/dist/config.mjs
CHANGED
|
@@ -52,24 +52,15 @@ export function useMDXComponents(components?: MDXComponents): MDXComponents {
|
|
|
52
52
|
`;
|
|
53
53
|
const DOCS_LAYOUT_TEMPLATE = `\
|
|
54
54
|
${GENERATED_BANNER}
|
|
55
|
-
export { metadata, default } from "@farming-labs/next/layout";
|
|
56
|
-
`;
|
|
57
|
-
const DOCS_CLIENT_CALLBACKS_TEMPLATE = `\
|
|
58
|
-
${GENERATED_BANNER}
|
|
59
|
-
"use client";
|
|
60
|
-
|
|
61
55
|
import docsConfig from "@/docs.config";
|
|
62
|
-
import {
|
|
56
|
+
import { createNextDocsLayout, createNextDocsMetadata } from "@farming-labs/next/layout";
|
|
63
57
|
|
|
64
|
-
export
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
58
|
+
export const metadata = createNextDocsMetadata(docsConfig);
|
|
59
|
+
|
|
60
|
+
const DocsLayout = createNextDocsLayout(docsConfig);
|
|
61
|
+
|
|
62
|
+
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
63
|
+
return <DocsLayout>{children}</DocsLayout>;
|
|
73
64
|
}
|
|
74
65
|
`;
|
|
75
66
|
const DOCS_API_ROUTE_TEMPLATE = `\
|
|
@@ -183,7 +174,6 @@ function extractObjectLiteral(content, key) {
|
|
|
183
174
|
function withDocs(nextConfig = {}) {
|
|
184
175
|
const root = process.cwd();
|
|
185
176
|
if (!hasFile(root, "mdx-components")) writeFileSync(join(root, "mdx-components.tsx"), MDX_COMPONENTS_TEMPLATE);
|
|
186
|
-
if (!hasFile(root, "docs-client-callbacks")) writeFileSync(join(root, "docs-client-callbacks.tsx"), DOCS_CLIENT_CALLBACKS_TEMPLATE);
|
|
187
177
|
const entry = readDocsEntry(root);
|
|
188
178
|
const appDir = getNextAppDir(root);
|
|
189
179
|
const layoutDir = join(root, appDir, entry);
|
package/dist/layout.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { DocsConfig } from "@farming-labs/docs";
|
|
2
3
|
|
|
3
4
|
//#region src/layout.d.ts
|
|
4
|
-
declare
|
|
5
|
-
declare function
|
|
5
|
+
declare function createNextDocsMetadata(config: DocsConfig): Record<string, unknown>;
|
|
6
|
+
declare function createNextDocsLayout(config: DocsConfig): ({
|
|
6
7
|
children
|
|
7
8
|
}: {
|
|
8
9
|
children: React.ReactNode;
|
|
9
|
-
})
|
|
10
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
10
11
|
//#endregion
|
|
11
|
-
export {
|
|
12
|
+
export { createNextDocsLayout, createNextDocsMetadata };
|
package/dist/layout.mjs
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { withNextApiReferenceBanner } from "./api-reference.mjs";
|
|
2
|
+
import DocsClientCallbacks from "./client-callbacks.mjs";
|
|
2
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import DocsClientCallbacks from "@/docs-client-callbacks";
|
|
4
|
-
import docsConfig from "@/docs.config";
|
|
5
4
|
import { createDocsLayout, createDocsMetadata } from "@farming-labs/theme";
|
|
6
5
|
|
|
7
6
|
//#region src/layout.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
function createNextDocsMetadata(config) {
|
|
8
|
+
return createDocsMetadata(config);
|
|
9
|
+
}
|
|
10
|
+
function createNextDocsLayout(config) {
|
|
11
|
+
const DocsLayout = createDocsLayout(withNextApiReferenceBanner(config));
|
|
12
|
+
return function NextDocsLayout({ children }) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DocsClientCallbacks, {}), /* @__PURE__ */ jsx(DocsLayout, { children })] });
|
|
14
|
+
};
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
//#endregion
|
|
15
|
-
export {
|
|
18
|
+
export { createNextDocsLayout, createNextDocsMetadata };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"description": "Next.js adapter for @farming-labs/docs — MDX config wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"tsdown": "^0.20.3",
|
|
80
80
|
"typescript": "^5.9.3",
|
|
81
81
|
"vitest": "^3.2.4",
|
|
82
|
-
"@farming-labs/docs": "0.0.
|
|
83
|
-
"@farming-labs/theme": "0.0.
|
|
82
|
+
"@farming-labs/docs": "0.0.57",
|
|
83
|
+
"@farming-labs/theme": "0.0.57"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@farming-labs/docs": ">=0.0.1",
|