@carlonicora/nextjs-jsonapi 1.107.1 → 1.109.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/{AssistantInterface-BYgI5z1-.d.mts → AssistantInterface-B1c8FhGA.d.mts} +2 -0
- package/dist/{AssistantInterface-DfDcz0gJ.d.ts → AssistantInterface-BBUHxOCd.d.ts} +2 -0
- package/dist/{AssistantMessageInterface-BpEhx2pC.d.ts → AssistantMessageInterface-Cs1yb-gF.d.ts} +3 -1
- package/dist/{AssistantMessageInterface-DJ3Me16Y.d.mts → AssistantMessageInterface-DQ3mH5L8.d.mts} +3 -1
- package/dist/{AuthComponent-B6DIk8Vf.d.ts → AuthComponent-Cd7lcYif.d.ts} +1 -1
- package/dist/{AuthComponent-BKI0ZbtD.d.mts → AuthComponent-DdxCFgUZ.d.mts} +1 -1
- package/dist/{BlockNoteEditor-RWRVIEZC.js → BlockNoteEditor-3XYBZLWO.js} +20 -19
- package/dist/BlockNoteEditor-3XYBZLWO.js.map +1 -0
- package/dist/{BlockNoteEditor-7TSK7PNG.mjs → BlockNoteEditor-EBFZG7AL.mjs} +5 -4
- package/dist/{BlockNoteEditor-7TSK7PNG.mjs.map → BlockNoteEditor-EBFZG7AL.mjs.map} +1 -1
- package/dist/{auth.interface-BBUgMZzs.d.ts → auth.interface-8b601idJ.d.ts} +1 -1
- package/dist/{auth.interface-XYEREOD6.d.mts → auth.interface-CXBF8Mhi.d.mts} +1 -1
- package/dist/billing/index.js +347 -346
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +4 -3
- package/dist/billing/index.mjs.map +1 -1
- package/dist/chunk-3J7RQBF3.js +123 -0
- package/dist/chunk-3J7RQBF3.js.map +1 -0
- package/dist/{chunk-VLDLERJN.js → chunk-7E3O52U5.js} +15 -8
- package/dist/chunk-7E3O52U5.js.map +1 -0
- package/dist/{chunk-RXXZGPC3.js → chunk-CFI4WZ5R.js} +159 -113
- package/dist/chunk-CFI4WZ5R.js.map +1 -0
- package/dist/chunk-CQID6RCF.mjs +38 -0
- package/dist/chunk-CQID6RCF.mjs.map +1 -0
- package/dist/{chunk-WSOPEIRP.mjs → chunk-CRTVAQEK.mjs} +46 -27
- package/dist/chunk-CRTVAQEK.mjs.map +1 -0
- package/dist/{chunk-N3NVIPSU.mjs → chunk-MSNNAHDB.mjs} +129 -83
- package/dist/{chunk-N3NVIPSU.mjs.map → chunk-MSNNAHDB.mjs.map} +1 -1
- package/dist/chunk-MZTKPPET.mjs +123 -0
- package/dist/chunk-MZTKPPET.mjs.map +1 -0
- package/dist/{chunk-2IRWQVG4.js → chunk-UHO3KUUH.js} +842 -823
- package/dist/chunk-UHO3KUUH.js.map +1 -0
- package/dist/{chunk-CFECWLHH.mjs → chunk-UOYIWJEJ.mjs} +10 -3
- package/dist/chunk-UOYIWJEJ.mjs.map +1 -0
- package/dist/chunk-YQQHAFBS.js +38 -0
- package/dist/chunk-YQQHAFBS.js.map +1 -0
- package/dist/client/index.d.mts +8 -16
- package/dist/client/index.d.ts +8 -16
- package/dist/client/index.js +5 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +4 -3
- package/dist/components/index.d.mts +8 -7
- package/dist/components/index.d.ts +8 -7
- package/dist/components/index.js +5 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -3
- package/dist/{config-CLQynoaa.d.ts → config-CN23v3eJ.d.ts} +4 -1
- package/dist/{config-k61pe_o2.d.mts → config-gh88Qn4h.d.mts} +4 -1
- package/dist/contexts/index.d.mts +18 -7
- package/dist/contexts/index.d.ts +18 -7
- package/dist/contexts/index.js +5 -4
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +4 -3
- package/dist/core/index.d.mts +44 -11
- package/dist/core/index.d.ts +44 -11
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/help/index.css +29 -0
- package/dist/features/help/index.css.map +1 -0
- package/dist/features/help/index.d.mts +115 -0
- package/dist/features/help/index.d.ts +115 -0
- package/dist/features/help/index.js +532 -0
- package/dist/features/help/index.js.map +1 -0
- package/dist/features/help/index.mjs +532 -0
- package/dist/features/help/index.mjs.map +1 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.d.mts +11 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.d.ts +11 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.js +43 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.js.map +1 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs +43 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs.map +1 -0
- package/dist/features/help/server.d.mts +71 -0
- package/dist/features/help/server.d.ts +71 -0
- package/dist/features/help/server.js +123 -0
- package/dist/features/help/server.js.map +1 -0
- package/dist/features/help/server.mjs +123 -0
- package/dist/features/help/server.mjs.map +1 -0
- package/dist/help-content-config.interface-B9L02u9i.d.mts +50 -0
- package/dist/help-content-config.interface-B9L02u9i.d.ts +50 -0
- package/dist/index.d.mts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/{notification.interface-aLEJbA_g.d.ts → notification.interface-C1T1C2ee.d.ts} +1 -100
- package/dist/{notification.interface-DLZGtV7Z.d.mts → notification.interface-DIxR23eS.d.mts} +1 -100
- package/dist/{s3.service-CVgLWaDc.d.mts → s3.service-0BTClOYO.d.mts} +2 -2
- package/dist/{s3.service-SLlX0Zbz.d.ts → s3.service-CT27Fm1s.d.ts} +2 -2
- package/dist/server/index.d.mts +4 -3
- package/dist/server/index.d.ts +4 -3
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/types-CQSjy7et.d.mts +101 -0
- package/dist/types-DHOxe8rc.d.ts +101 -0
- package/dist/usePageUrlGenerator-tjq2mlDV.d.ts +14 -0
- package/dist/usePageUrlGenerator-uOnyJ6j2.d.mts +14 -0
- package/dist/{useSocket-BkxHHujj.d.mts → useSocket-B1fMIr17.d.mts} +1 -1
- package/dist/{useSocket-CMDjWFYm.d.ts → useSocket-BdJTBXKv.d.ts} +1 -1
- package/package.json +20 -1
- package/src/client/config.ts +9 -1
- package/src/core/registry/helpStore.ts +45 -0
- package/src/features/assistant/contexts/AssistantContext.tsx +35 -19
- package/src/features/assistant/contexts/__tests__/AssistantContext.spec.tsx +66 -6
- package/src/features/assistant/data/Assistant.ts +2 -0
- package/src/features/assistant/data/AssistantInterface.ts +2 -0
- package/src/features/assistant/data/AssistantService.ts +18 -8
- package/src/features/assistant-message/components/parts/MessageSourcesPanel.tsx +6 -4
- package/src/features/assistant-message/components/parts/tabs/ContentsTab.tsx +5 -1
- package/src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx +2 -1
- package/src/features/assistant-message/data/AssistantMessage.ts +27 -1
- package/src/features/assistant-message/data/AssistantMessageInterface.ts +1 -0
- package/src/features/assistant-message/data/__tests__/AssistantMessage.spec.ts +7 -3
- package/src/features/help/components/HelpArticleBody.tsx +54 -0
- package/src/features/help/components/HelpAskAi.tsx +36 -0
- package/src/features/help/components/HelpAssistantSheet.tsx +53 -0
- package/src/features/help/components/HelpHeader.tsx +40 -0
- package/src/features/help/components/HelpHint.tsx +77 -0
- package/src/features/help/components/HelpSearchResultRow.tsx +51 -0
- package/src/features/help/components/HelpSideNav.tsx +84 -0
- package/src/features/help/components/HelpTOC.tsx +49 -0
- package/src/features/help/components/__tests__/HelpAskAi.spec.tsx +68 -0
- package/src/features/help/components/__tests__/HelpAssistantSheet.spec.tsx +36 -0
- package/src/features/help/components/__tests__/HelpHint.spec.tsx +50 -0
- package/src/features/help/components/__tests__/HelpSearchResultRow.spec.tsx +59 -0
- package/src/features/help/components/__tests__/HelpSideNav.spec.tsx +52 -0
- package/src/features/help/components/mdx/Callout.tsx +21 -0
- package/src/features/help/components/mdx/EntityRef.tsx +18 -0
- package/src/features/help/components/mdx/KeyBinding.tsx +6 -0
- package/src/features/help/components/mdx/Related.tsx +33 -0
- package/src/features/help/components/mdx/Screenshot.tsx +9 -0
- package/src/features/help/components/mdx/Steps.tsx +21 -0
- package/src/features/help/components/mdx/Video.tsx +8 -0
- package/src/features/help/components/mdx/mdx-server-components.ts +23 -0
- package/src/features/help/components/mdx/mdxComponents.ts +9 -0
- package/src/features/help/contexts/HelpContext.spec.tsx +28 -0
- package/src/features/help/contexts/HelpContext.tsx +24 -0
- package/src/features/help/hooks/useHelp.ts +1 -0
- package/src/features/help/hooks/useHelpArticle.ts +7 -0
- package/src/features/help/hooks/useHelpFilter.ts +27 -0
- package/src/features/help/hooks/useHelpManifest.ts +5 -0
- package/src/features/help/i18n-keys.ts +34 -0
- package/src/features/help/index.ts +27 -0
- package/src/features/help/interfaces/help-content-config.interface.ts +17 -0
- package/src/features/help/server/__tests__/createHelpAssetRouteHandler.spec.ts +43 -0
- package/src/features/help/server/createHelpAssetRouteHandler.ts +35 -0
- package/src/features/help/server/generateHelpArticleMetadata.ts +18 -0
- package/src/features/help/server/generateHelpArticleStaticParams.ts +7 -0
- package/src/features/help/server/generateHelpModeStaticParams.ts +5 -0
- package/src/features/help/server/getHelpContent.ts +17 -0
- package/src/features/help/server/index.ts +8 -0
- package/src/features/help/server/serializeHelpArticle.tsx +46 -0
- package/src/features/help/server-entry.ts +20 -0
- package/src/features/help/types/help-article.types.ts +37 -0
- package/src/features/help/utils/__tests__/helpNavigation.spec.ts +70 -0
- package/src/features/help/utils/articleUrl.ts +13 -0
- package/src/features/help/utils/helpNavigation.ts +29 -0
- package/src/features/how-to/HowToModule.ts +1 -1
- package/src/features/how-to/data/HowTo.ts +21 -3
- package/src/features/how-to/data/HowToInterface.ts +1 -0
- package/src/index.ts +4 -0
- package/src/shadcnui/ui/context-menu.tsx +3 -1
- package/src/shadcnui/ui/popover.tsx +3 -1
- package/dist/BlockNoteEditor-RWRVIEZC.js.map +0 -1
- package/dist/chunk-2IRWQVG4.js.map +0 -1
- package/dist/chunk-CFECWLHH.mjs.map +0 -1
- package/dist/chunk-RXXZGPC3.js.map +0 -1
- package/dist/chunk-VLDLERJN.js.map +0 -1
- package/dist/chunk-WSOPEIRP.mjs.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunk7QVYU63Ejs = require('../../../chunk-7QVYU63E.js');
|
|
4
|
+
|
|
5
|
+
// src/features/help/server/createHelpAssetRouteHandler.ts
|
|
6
|
+
var _server = require('next/server');
|
|
7
|
+
var _promises = require('fs/promises');
|
|
8
|
+
var _path = require('path');
|
|
9
|
+
var MIME = {
|
|
10
|
+
".png": "image/png",
|
|
11
|
+
".jpg": "image/jpeg",
|
|
12
|
+
".jpeg": "image/jpeg",
|
|
13
|
+
".webp": "image/webp",
|
|
14
|
+
".gif": "image/gif",
|
|
15
|
+
".svg": "image/svg+xml",
|
|
16
|
+
".mp4": "video/mp4",
|
|
17
|
+
".webm": "video/webm"
|
|
18
|
+
};
|
|
19
|
+
function createHelpAssetRouteHandler({ srcRoot }) {
|
|
20
|
+
return /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async function GET(_req, { params }) {
|
|
21
|
+
const { path } = await params;
|
|
22
|
+
const safe = path.filter((p) => p !== ".." && !p.includes("/")).join("/");
|
|
23
|
+
const filePath = _path.join.call(void 0, srcRoot, safe);
|
|
24
|
+
try {
|
|
25
|
+
const s = await _promises.stat.call(void 0, filePath);
|
|
26
|
+
if (!s.isFile()) return new (0, _server.NextResponse)("Not found", { status: 404 });
|
|
27
|
+
const ext = filePath.toLowerCase().slice(filePath.lastIndexOf("."));
|
|
28
|
+
const mime = _nullishCoalesce(MIME[ext], () => ( "application/octet-stream"));
|
|
29
|
+
const data = await _promises.readFile.call(void 0, filePath);
|
|
30
|
+
return new (0, _server.NextResponse)(data, {
|
|
31
|
+
status: 200,
|
|
32
|
+
headers: { "Content-Type": mime, "Cache-Control": "public, max-age=3600" }
|
|
33
|
+
});
|
|
34
|
+
} catch (e) {
|
|
35
|
+
return new (0, _server.NextResponse)("Not found", { status: 404 });
|
|
36
|
+
}
|
|
37
|
+
}, "GET");
|
|
38
|
+
}
|
|
39
|
+
_chunk7QVYU63Ejs.__name.call(void 0, createHelpAssetRouteHandler, "createHelpAssetRouteHandler");
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.createHelpAssetRouteHandler = createHelpAssetRouteHandler;
|
|
43
|
+
//# sourceMappingURL=createHelpAssetRouteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/features/help/server/createHelpAssetRouteHandler.js","../../../../src/features/help/server/createHelpAssetRouteHandler.ts"],"names":[],"mappings":"AAAA;AACE;AACF,6DAAmC;AACnC;AACA;ACJA,qCAA6B;AAC7B,uCAA+B;AAC/B,4BAAqB;AAErB,IAAM,KAAA,EAA+B;AAAA,EACnC,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ,YAAA;AAAA,EACR,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS,YAAA;AAAA,EACT,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ,eAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX,CAAA;AAEO,SAAS,2BAAA,CAA4B,EAAE,QAAQ,CAAA,EAAwB;AAC5E,EAAA,uBAAO,qCAAA,MAAA,SAAe,GAAA,CAAI,IAAA,EAAe,EAAE,OAAO,CAAA,EAA4C;AAC5F,IAAA,MAAM,EAAE,KAAK,EAAA,EAAI,MAAM,MAAA;AACvB,IAAA,MAAM,KAAA,EAAO,IAAA,CAAK,MAAA,CAAO,CAAC,CAAA,EAAA,GAAM,EAAA,IAAM,KAAA,GAAQ,CAAC,CAAA,CAAE,QAAA,CAAS,GAAG,CAAC,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AACxE,IAAA,MAAM,SAAA,EAAW,wBAAA,OAAK,EAAS,IAAI,CAAA;AACnC,IAAA,IAAI;AACF,MAAA,MAAM,EAAA,EAAI,MAAM,4BAAA,QAAa,CAAA;AAC7B,MAAA,GAAA,CAAI,CAAC,CAAA,CAAE,MAAA,CAAO,CAAA,EAAG,OAAO,IAAI,yBAAA,CAAa,WAAA,EAAa,EAAE,MAAA,EAAQ,IAAI,CAAC,CAAA;AACrE,MAAA,MAAM,IAAA,EAAM,QAAA,CAAS,WAAA,CAAY,CAAA,CAAE,KAAA,CAAM,QAAA,CAAS,WAAA,CAAY,GAAG,CAAC,CAAA;AAClE,MAAA,MAAM,KAAA,mBAAO,IAAA,CAAK,GAAG,CAAA,UAAK,4BAAA;AAC1B,MAAA,MAAM,KAAA,EAAO,MAAM,gCAAA,QAAiB,CAAA;AACpC,MAAA,OAAO,IAAI,yBAAA,CAAa,IAAA,EAAM;AAAA,QAC5B,MAAA,EAAQ,GAAA;AAAA,QACR,OAAA,EAAS,EAAE,cAAA,EAAgB,IAAA,EAAM,eAAA,EAAiB,uBAAuB;AAAA,MAC3E,CAAC,CAAA;AAAA,IACH,EAAA,UAAQ;AACN,MAAA,OAAO,IAAI,yBAAA,CAAa,WAAA,EAAa,EAAE,MAAA,EAAQ,IAAI,CAAC,CAAA;AAAA,IACtD;AAAA,EACF,CAAA,EAjBO,KAAA,CAAA;AAkBT;AAnBgB,qCAAA,2BAAA,EAAA,6BAAA,CAAA;ADwBhB;AACE;AACF,kEAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/features/help/server/createHelpAssetRouteHandler.js","sourcesContent":[null,"import { NextResponse } from \"next/server\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nconst MIME: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".webp\": \"image/webp\",\n \".gif\": \"image/gif\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n};\n\nexport function createHelpAssetRouteHandler({ srcRoot }: { srcRoot: string }) {\n return async function GET(_req: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const { path } = await params;\n const safe = path.filter((p) => p !== \"..\" && !p.includes(\"/\")).join(\"/\");\n const filePath = join(srcRoot, safe);\n try {\n const s = await stat(filePath);\n if (!s.isFile()) return new NextResponse(\"Not found\", { status: 404 });\n const ext = filePath.toLowerCase().slice(filePath.lastIndexOf(\".\"));\n const mime = MIME[ext] ?? \"application/octet-stream\";\n const data = await readFile(filePath);\n return new NextResponse(data, {\n status: 200,\n headers: { \"Content-Type\": mime, \"Cache-Control\": \"public, max-age=3600\" },\n });\n } catch {\n return new NextResponse(\"Not found\", { status: 404 });\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "../../../chunk-PAWJFY3S.mjs";
|
|
4
|
+
|
|
5
|
+
// src/features/help/server/createHelpAssetRouteHandler.ts
|
|
6
|
+
import { NextResponse } from "next/server";
|
|
7
|
+
import { readFile, stat } from "fs/promises";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
var MIME = {
|
|
10
|
+
".png": "image/png",
|
|
11
|
+
".jpg": "image/jpeg",
|
|
12
|
+
".jpeg": "image/jpeg",
|
|
13
|
+
".webp": "image/webp",
|
|
14
|
+
".gif": "image/gif",
|
|
15
|
+
".svg": "image/svg+xml",
|
|
16
|
+
".mp4": "video/mp4",
|
|
17
|
+
".webm": "video/webm"
|
|
18
|
+
};
|
|
19
|
+
function createHelpAssetRouteHandler({ srcRoot }) {
|
|
20
|
+
return /* @__PURE__ */ __name(async function GET(_req, { params }) {
|
|
21
|
+
const { path } = await params;
|
|
22
|
+
const safe = path.filter((p) => p !== ".." && !p.includes("/")).join("/");
|
|
23
|
+
const filePath = join(srcRoot, safe);
|
|
24
|
+
try {
|
|
25
|
+
const s = await stat(filePath);
|
|
26
|
+
if (!s.isFile()) return new NextResponse("Not found", { status: 404 });
|
|
27
|
+
const ext = filePath.toLowerCase().slice(filePath.lastIndexOf("."));
|
|
28
|
+
const mime = MIME[ext] ?? "application/octet-stream";
|
|
29
|
+
const data = await readFile(filePath);
|
|
30
|
+
return new NextResponse(data, {
|
|
31
|
+
status: 200,
|
|
32
|
+
headers: { "Content-Type": mime, "Cache-Control": "public, max-age=3600" }
|
|
33
|
+
});
|
|
34
|
+
} catch {
|
|
35
|
+
return new NextResponse("Not found", { status: 404 });
|
|
36
|
+
}
|
|
37
|
+
}, "GET");
|
|
38
|
+
}
|
|
39
|
+
__name(createHelpAssetRouteHandler, "createHelpAssetRouteHandler");
|
|
40
|
+
export {
|
|
41
|
+
createHelpAssetRouteHandler
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=createHelpAssetRouteHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/features/help/server/createHelpAssetRouteHandler.ts"],"sourcesContent":["import { NextResponse } from \"next/server\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nconst MIME: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".webp\": \"image/webp\",\n \".gif\": \"image/gif\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n};\n\nexport function createHelpAssetRouteHandler({ srcRoot }: { srcRoot: string }) {\n return async function GET(_req: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const { path } = await params;\n const safe = path.filter((p) => p !== \"..\" && !p.includes(\"/\")).join(\"/\");\n const filePath = join(srcRoot, safe);\n try {\n const s = await stat(filePath);\n if (!s.isFile()) return new NextResponse(\"Not found\", { status: 404 });\n const ext = filePath.toLowerCase().slice(filePath.lastIndexOf(\".\"));\n const mime = MIME[ext] ?? \"application/octet-stream\";\n const data = await readFile(filePath);\n return new NextResponse(data, {\n status: 200,\n headers: { \"Content-Type\": mime, \"Cache-Control\": \"public, max-age=3600\" },\n });\n } catch {\n return new NextResponse(\"Not found\", { status: 404 });\n }\n };\n}\n"],"mappings":";;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,UAAU,YAAY;AAC/B,SAAS,YAAY;AAErB,IAAM,OAA+B;AAAA,EACnC,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX;AAEO,SAAS,4BAA4B,EAAE,QAAQ,GAAwB;AAC5E,SAAO,sCAAe,IAAI,MAAe,EAAE,OAAO,GAA4C;AAC5F,UAAM,EAAE,KAAK,IAAI,MAAM;AACvB,UAAM,OAAO,KAAK,OAAO,CAAC,MAAM,MAAM,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,GAAG;AACxE,UAAM,WAAW,KAAK,SAAS,IAAI;AACnC,QAAI;AACF,YAAM,IAAI,MAAM,KAAK,QAAQ;AAC7B,UAAI,CAAC,EAAE,OAAO,EAAG,QAAO,IAAI,aAAa,aAAa,EAAE,QAAQ,IAAI,CAAC;AACrE,YAAM,MAAM,SAAS,YAAY,EAAE,MAAM,SAAS,YAAY,GAAG,CAAC;AAClE,YAAM,OAAO,KAAK,GAAG,KAAK;AAC1B,YAAM,OAAO,MAAM,SAAS,QAAQ;AACpC,aAAO,IAAI,aAAa,MAAM;AAAA,QAC5B,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,MAAM,iBAAiB,uBAAuB;AAAA,MAC3E,CAAC;AAAA,IACH,QAAQ;AACN,aAAO,IAAI,aAAa,aAAa,EAAE,QAAQ,IAAI,CAAC;AAAA,IACtD;AAAA,EACF,GAjBO;AAkBT;AAnBgB;","names":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { H as HelpContentConfig, a as HelpArticle, b as HelpMode } from '../../help-content-config.interface-B9L02u9i.mjs';
|
|
2
|
+
export { d as HELP_MODES, c as HelpBrandConfig, e as HelpHeading, f as HelpRedirect } from '../../help-content-config.interface-B9L02u9i.mjs';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
import { Metadata } from 'next';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Server-side accessor for the help-content config set via configureJsonApi().
|
|
8
|
+
* Returns the same value <HelpProvider> exposes via React Context to client components.
|
|
9
|
+
* Throws with a setup error if helpContent was never configured.
|
|
10
|
+
*/
|
|
11
|
+
declare function getHelpContent(): HelpContentConfig;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Server-side: read the article's raw markdown via the registered help reader
|
|
15
|
+
* and render it through `next-mdx-remote/rsc`'s server-side MDXRemote, using
|
|
16
|
+
* the server-safe MDX components (Callout, Steps, Screenshot, EntityRef,
|
|
17
|
+
* KeyBinding, Video). The returned React element can be embedded inside a
|
|
18
|
+
* server component (e.g. as `children` of `<HelpArticleBody>`).
|
|
19
|
+
*
|
|
20
|
+
* Note: `<Related>` is intentionally not part of the server map — it's a client
|
|
21
|
+
* component that reads HelpContext. Articles that reference `<Related>` would
|
|
22
|
+
* need a separate render path that injects the manifest by prop.
|
|
23
|
+
*/
|
|
24
|
+
declare function renderHelpArticle(article: HelpArticle): Promise<ReactElement>;
|
|
25
|
+
/** @deprecated Use `renderHelpArticle` instead — the legacy serialize + client
|
|
26
|
+
* MDXRemote pattern is incompatible with App Router RSC. */
|
|
27
|
+
declare const serializeHelpArticle: typeof renderHelpArticle;
|
|
28
|
+
|
|
29
|
+
declare function generateHelpArticleStaticParams(): {
|
|
30
|
+
mode: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
}[];
|
|
33
|
+
|
|
34
|
+
declare function generateHelpArticleMetadata({ params, }: {
|
|
35
|
+
params: Promise<{
|
|
36
|
+
mode: string;
|
|
37
|
+
slug: string;
|
|
38
|
+
}>;
|
|
39
|
+
}): Promise<Metadata>;
|
|
40
|
+
|
|
41
|
+
declare function generateHelpModeStaticParams(): {
|
|
42
|
+
mode: string;
|
|
43
|
+
}[];
|
|
44
|
+
|
|
45
|
+
interface HelpNavGroup {
|
|
46
|
+
mode: HelpMode;
|
|
47
|
+
articles: HelpArticle[];
|
|
48
|
+
}
|
|
49
|
+
declare function buildHelpNav(manifest: readonly HelpArticle[]): HelpNavGroup[];
|
|
50
|
+
declare function findHelpArticle(manifest: readonly HelpArticle[], mode: string, slug: string): HelpArticle | undefined;
|
|
51
|
+
declare function prevNextWithinMode(manifest: readonly HelpArticle[], current: HelpArticle): {
|
|
52
|
+
prev: HelpArticle | null;
|
|
53
|
+
next: HelpArticle | null;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Centralized help-content store accessible from client and server contexts.
|
|
58
|
+
* Uses globalThis Symbol keys to persist across HMR/Turbopack reloads and to
|
|
59
|
+
* bridge between the client-side `configureJsonApi` (in `client/config.ts`)
|
|
60
|
+
* and server-side consumers (HelpProvider, getHelpContent, serializeHelpArticle).
|
|
61
|
+
*
|
|
62
|
+
* NO external dependencies to avoid circular imports.
|
|
63
|
+
*
|
|
64
|
+
* Pattern mirrors `bootstrapStore.ts`.
|
|
65
|
+
*/
|
|
66
|
+
type HelpReader = (article: {
|
|
67
|
+
path: string;
|
|
68
|
+
}) => Promise<string>;
|
|
69
|
+
declare function setHelpReader(reader: HelpReader): void;
|
|
70
|
+
|
|
71
|
+
export { HelpArticle, HelpContentConfig, HelpMode, buildHelpNav, findHelpArticle, generateHelpArticleMetadata, generateHelpArticleStaticParams, generateHelpModeStaticParams, getHelpContent, prevNextWithinMode, renderHelpArticle, serializeHelpArticle, setHelpReader };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { H as HelpContentConfig, a as HelpArticle, b as HelpMode } from '../../help-content-config.interface-B9L02u9i.js';
|
|
2
|
+
export { d as HELP_MODES, c as HelpBrandConfig, e as HelpHeading, f as HelpRedirect } from '../../help-content-config.interface-B9L02u9i.js';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
import { Metadata } from 'next';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Server-side accessor for the help-content config set via configureJsonApi().
|
|
8
|
+
* Returns the same value <HelpProvider> exposes via React Context to client components.
|
|
9
|
+
* Throws with a setup error if helpContent was never configured.
|
|
10
|
+
*/
|
|
11
|
+
declare function getHelpContent(): HelpContentConfig;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Server-side: read the article's raw markdown via the registered help reader
|
|
15
|
+
* and render it through `next-mdx-remote/rsc`'s server-side MDXRemote, using
|
|
16
|
+
* the server-safe MDX components (Callout, Steps, Screenshot, EntityRef,
|
|
17
|
+
* KeyBinding, Video). The returned React element can be embedded inside a
|
|
18
|
+
* server component (e.g. as `children` of `<HelpArticleBody>`).
|
|
19
|
+
*
|
|
20
|
+
* Note: `<Related>` is intentionally not part of the server map — it's a client
|
|
21
|
+
* component that reads HelpContext. Articles that reference `<Related>` would
|
|
22
|
+
* need a separate render path that injects the manifest by prop.
|
|
23
|
+
*/
|
|
24
|
+
declare function renderHelpArticle(article: HelpArticle): Promise<ReactElement>;
|
|
25
|
+
/** @deprecated Use `renderHelpArticle` instead — the legacy serialize + client
|
|
26
|
+
* MDXRemote pattern is incompatible with App Router RSC. */
|
|
27
|
+
declare const serializeHelpArticle: typeof renderHelpArticle;
|
|
28
|
+
|
|
29
|
+
declare function generateHelpArticleStaticParams(): {
|
|
30
|
+
mode: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
}[];
|
|
33
|
+
|
|
34
|
+
declare function generateHelpArticleMetadata({ params, }: {
|
|
35
|
+
params: Promise<{
|
|
36
|
+
mode: string;
|
|
37
|
+
slug: string;
|
|
38
|
+
}>;
|
|
39
|
+
}): Promise<Metadata>;
|
|
40
|
+
|
|
41
|
+
declare function generateHelpModeStaticParams(): {
|
|
42
|
+
mode: string;
|
|
43
|
+
}[];
|
|
44
|
+
|
|
45
|
+
interface HelpNavGroup {
|
|
46
|
+
mode: HelpMode;
|
|
47
|
+
articles: HelpArticle[];
|
|
48
|
+
}
|
|
49
|
+
declare function buildHelpNav(manifest: readonly HelpArticle[]): HelpNavGroup[];
|
|
50
|
+
declare function findHelpArticle(manifest: readonly HelpArticle[], mode: string, slug: string): HelpArticle | undefined;
|
|
51
|
+
declare function prevNextWithinMode(manifest: readonly HelpArticle[], current: HelpArticle): {
|
|
52
|
+
prev: HelpArticle | null;
|
|
53
|
+
next: HelpArticle | null;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Centralized help-content store accessible from client and server contexts.
|
|
58
|
+
* Uses globalThis Symbol keys to persist across HMR/Turbopack reloads and to
|
|
59
|
+
* bridge between the client-side `configureJsonApi` (in `client/config.ts`)
|
|
60
|
+
* and server-side consumers (HelpProvider, getHelpContent, serializeHelpArticle).
|
|
61
|
+
*
|
|
62
|
+
* NO external dependencies to avoid circular imports.
|
|
63
|
+
*
|
|
64
|
+
* Pattern mirrors `bootstrapStore.ts`.
|
|
65
|
+
*/
|
|
66
|
+
type HelpReader = (article: {
|
|
67
|
+
path: string;
|
|
68
|
+
}) => Promise<string>;
|
|
69
|
+
declare function setHelpReader(reader: HelpReader): void;
|
|
70
|
+
|
|
71
|
+
export { HelpArticle, HelpContentConfig, HelpMode, buildHelpNav, findHelpArticle, generateHelpArticleMetadata, generateHelpArticleStaticParams, generateHelpModeStaticParams, getHelpContent, prevNextWithinMode, renderHelpArticle, serializeHelpArticle, setHelpReader };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunk3J7RQBF3js = require('../../chunk-3J7RQBF3.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunkYQQHAFBSjs = require('../../chunk-YQQHAFBS.js');
|
|
19
|
+
require('../../chunk-CFI4WZ5R.js');
|
|
20
|
+
require('../../chunk-LXKSUWAV.js');
|
|
21
|
+
require('../../chunk-IBS6NI7D.js');
|
|
22
|
+
require('../../chunk-J5LROFGL.js');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunk7QVYU63Ejs = require('../../chunk-7QVYU63E.js');
|
|
26
|
+
|
|
27
|
+
// src/features/help/server/getHelpContent.ts
|
|
28
|
+
function getHelpContent() {
|
|
29
|
+
const cfg = _chunkYQQHAFBSjs._getStaticHelpContent.call(void 0, );
|
|
30
|
+
if (!cfg) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
"Help content not configured \u2014 call configureJsonApi({ helpContent: {...} }) before importing help pages."
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return cfg;
|
|
36
|
+
}
|
|
37
|
+
_chunk7QVYU63Ejs.__name.call(void 0, getHelpContent, "getHelpContent");
|
|
38
|
+
|
|
39
|
+
// src/features/help/server/serializeHelpArticle.tsx
|
|
40
|
+
var _rsc = require('next-mdx-remote/rsc');
|
|
41
|
+
var _remarkgfm = require('remark-gfm'); var _remarkgfm2 = _interopRequireDefault(_remarkgfm);
|
|
42
|
+
var _rehypeslug = require('rehype-slug'); var _rehypeslug2 = _interopRequireDefault(_rehypeslug);
|
|
43
|
+
var _rehypeautolinkheadings = require('rehype-autolink-headings'); var _rehypeautolinkheadings2 = _interopRequireDefault(_rehypeautolinkheadings);
|
|
44
|
+
|
|
45
|
+
// src/features/help/components/mdx/mdx-server-components.ts
|
|
46
|
+
var MDX_SERVER_COMPONENTS = {
|
|
47
|
+
Callout: _chunk3J7RQBF3js.Callout,
|
|
48
|
+
Steps: _chunk3J7RQBF3js.Steps,
|
|
49
|
+
Step: _chunk3J7RQBF3js.Step,
|
|
50
|
+
Screenshot: _chunk3J7RQBF3js.Screenshot,
|
|
51
|
+
EntityRef: _chunk3J7RQBF3js.EntityRef,
|
|
52
|
+
KeyBinding: _chunk3J7RQBF3js.KeyBinding,
|
|
53
|
+
Video: _chunk3J7RQBF3js.Video
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// src/features/help/server/serializeHelpArticle.tsx
|
|
57
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
58
|
+
async function renderHelpArticle(article) {
|
|
59
|
+
const readRawMarkdown = _chunkYQQHAFBSjs._getStaticHelpReader.call(void 0, );
|
|
60
|
+
if (!readRawMarkdown) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
"Help reader not configured. Call setHelpReader(fn) from a server-only entrypoint (e.g. Next.js instrumentation register()) before rendering help articles."
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
const source = await readRawMarkdown(article);
|
|
66
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
67
|
+
_rsc.MDXRemote,
|
|
68
|
+
{
|
|
69
|
+
source,
|
|
70
|
+
components: MDX_SERVER_COMPONENTS,
|
|
71
|
+
options: {
|
|
72
|
+
parseFrontmatter: true,
|
|
73
|
+
mdxOptions: {
|
|
74
|
+
remarkPlugins: [_remarkgfm2.default],
|
|
75
|
+
rehypePlugins: [_rehypeslug2.default, [_rehypeautolinkheadings2.default, { behavior: "wrap" }]]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
_chunk7QVYU63Ejs.__name.call(void 0, renderHelpArticle, "renderHelpArticle");
|
|
82
|
+
var serializeHelpArticle = renderHelpArticle;
|
|
83
|
+
|
|
84
|
+
// src/features/help/server/generateHelpArticleStaticParams.ts
|
|
85
|
+
function generateHelpArticleStaticParams() {
|
|
86
|
+
return getHelpContent().manifest.filter((a) => !a.draft).map((a) => ({ mode: a.mode, slug: a.slug }));
|
|
87
|
+
}
|
|
88
|
+
_chunk7QVYU63Ejs.__name.call(void 0, generateHelpArticleStaticParams, "generateHelpArticleStaticParams");
|
|
89
|
+
|
|
90
|
+
// src/features/help/server/generateHelpArticleMetadata.ts
|
|
91
|
+
async function generateHelpArticleMetadata({
|
|
92
|
+
params
|
|
93
|
+
}) {
|
|
94
|
+
const { mode, slug } = await params;
|
|
95
|
+
const article = _chunk3J7RQBF3js.findHelpArticle.call(void 0, getHelpContent().manifest, mode, slug);
|
|
96
|
+
if (!article) return {};
|
|
97
|
+
return {
|
|
98
|
+
title: article.title,
|
|
99
|
+
description: article.summary,
|
|
100
|
+
openGraph: { title: article.title, description: article.summary }
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
_chunk7QVYU63Ejs.__name.call(void 0, generateHelpArticleMetadata, "generateHelpArticleMetadata");
|
|
104
|
+
|
|
105
|
+
// src/features/help/server/generateHelpModeStaticParams.ts
|
|
106
|
+
function generateHelpModeStaticParams() {
|
|
107
|
+
return _chunk3J7RQBF3js.HELP_MODES.map((mode) => ({ mode }));
|
|
108
|
+
}
|
|
109
|
+
_chunk7QVYU63Ejs.__name.call(void 0, generateHelpModeStaticParams, "generateHelpModeStaticParams");
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
exports.HELP_MODES = _chunk3J7RQBF3js.HELP_MODES; exports.buildHelpNav = _chunk3J7RQBF3js.buildHelpNav; exports.findHelpArticle = _chunk3J7RQBF3js.findHelpArticle; exports.generateHelpArticleMetadata = generateHelpArticleMetadata; exports.generateHelpArticleStaticParams = generateHelpArticleStaticParams; exports.generateHelpModeStaticParams = generateHelpModeStaticParams; exports.getHelpContent = getHelpContent; exports.prevNextWithinMode = _chunk3J7RQBF3js.prevNextWithinMode; exports.renderHelpArticle = renderHelpArticle; exports.serializeHelpArticle = serializeHelpArticle; exports.setHelpReader = _chunkYQQHAFBSjs.setHelpReader;
|
|
123
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/features/help/server.js","../../../src/features/help/server/getHelpContent.ts","../../../src/features/help/server/serializeHelpArticle.tsx","../../../src/features/help/components/mdx/mdx-server-components.ts","../../../src/features/help/server/generateHelpArticleStaticParams.ts","../../../src/features/help/server/generateHelpArticleMetadata.ts","../../../src/features/help/server/generateHelpModeStaticParams.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,0DAAgC;AAChC;AACE;AACA;AACA;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;AClBO,SAAS,cAAA,CAAA,EAAoC;AAClD,EAAA,MAAM,IAAA,EAAM,oDAAA,CAAyC;AACrD,EAAA,GAAA,CAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,IACF,CAAA;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT;AARgB,qCAAA,cAAA,EAAA,gBAAA,CAAA;AD6BhB;AACA;AEtCA,0CAA0B;AAC1B,6FAAsB;AACtB,iGAAuB;AACvB,kJAAmC;AFwCnC;AACA;AG9BO,IAAM,sBAAA,EAAwB;AAAA,EACnC,iCAAA;AAAA,EACA,6BAAA;AAAA,EACA,2BAAA;AAAA,EACA,uCAAA;AAAA,EACA,qCAAA;AAAA,EACA,uCAAA;AAAA,EACA;AACF,CAAA;AHgCA;AACA;AE1BI,+CAAA;AATJ,MAAA,SAAsB,iBAAA,CAAkB,OAAA,EAA6C;AACnF,EAAA,MAAM,gBAAA,EAAkB,mDAAA,CAAqB;AAC7C,EAAA,GAAA,CAAI,CAAC,eAAA,EAAiB;AACpB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,IACF,CAAA;AAAA,EACF;AACA,EAAA,MAAM,OAAA,EAAS,MAAM,eAAA,CAAgB,OAAO,CAAA;AAC5C,EAAA,uBACE,6BAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,UAAA,EAAY,qBAAA;AAAA,MACZ,OAAA,EAAS;AAAA,QACP,gBAAA,EAAkB,IAAA;AAAA,QAClB,UAAA,EAAY;AAAA,UACV,aAAA,EAAe,CAAC,mBAAS,CAAA;AAAA,UACzB,aAAA,EAAe,CAAC,oBAAA,EAAY,CAAC,gCAAA,EAAwB,EAAE,QAAA,EAAU,OAAO,CAAC,CAAC;AAAA,QAC5E;AAAA,MACF;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ;AArBsB,qCAAA,iBAAA,EAAA,mBAAA,CAAA;AAyBf,IAAM,qBAAA,EAAuB,iBAAA;AFqCpC;AACA;AIjFO,SAAS,+BAAA,CAAA,EAAoE;AAClF,EAAA,OAAO,cAAA,CAAe,CAAA,CACnB,QAAA,CAAS,MAAA,CAAO,CAAC,CAAA,EAAA,GAAM,CAAC,CAAA,CAAE,KAAK,CAAA,CAC/B,GAAA,CAAI,CAAC,CAAA,EAAA,GAAA,CAAO,EAAE,IAAA,EAAM,CAAA,CAAE,IAAA,EAAM,IAAA,EAAM,CAAA,CAAE,KAAK,CAAA,CAAE,CAAA;AAChD;AAJgB,qCAAA,+BAAA,EAAA,iCAAA,CAAA;AJsFhB;AACA;AKrFA,MAAA,SAAsB,2BAAA,CAA4B;AAAA,EAChD;AACF,CAAA,EAEsB;AACpB,EAAA,MAAM,EAAE,IAAA,EAAM,KAAK,EAAA,EAAI,MAAM,MAAA;AAC7B,EAAA,MAAM,QAAA,EAAU,8CAAA,cAAgB,CAAe,CAAA,CAAE,QAAA,EAAU,IAAA,EAAM,IAAI,CAAA;AACrE,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,OAAO,CAAC,CAAA;AACtB,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,OAAA,CAAQ,KAAA;AAAA,IACf,WAAA,EAAa,OAAA,CAAQ,OAAA;AAAA,IACrB,SAAA,EAAW,EAAE,KAAA,EAAO,OAAA,CAAQ,KAAA,EAAO,WAAA,EAAa,OAAA,CAAQ,QAAQ;AAAA,EAClE,CAAA;AACF;AAbsB,qCAAA,2BAAA,EAAA,6BAAA,CAAA;ALmGtB;AACA;AMtGO,SAAS,4BAAA,CAAA,EAAmD;AACjE,EAAA,OAAO,2BAAA,CAAW,GAAA,CAAI,CAAC,IAAA,EAAA,GAAA,CAAU,EAAE,KAAK,CAAA,CAAE,CAAA;AAC5C;AAFgB,qCAAA,4BAAA,EAAA,8BAAA,CAAA;AN2GhB;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6nBAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/features/help/server.js","sourcesContent":[null,"import { _getStaticHelpContent } from \"../../../core/registry/helpStore\";\nimport type { HelpContentConfig } from \"../interfaces/help-content-config.interface\";\n\n/**\n * Server-side accessor for the help-content config set via configureJsonApi().\n * Returns the same value <HelpProvider> exposes via React Context to client components.\n * Throws with a setup error if helpContent was never configured.\n */\nexport function getHelpContent(): HelpContentConfig {\n const cfg = _getStaticHelpContent<HelpContentConfig>();\n if (!cfg) {\n throw new Error(\n \"Help content not configured — call configureJsonApi({ helpContent: {...} }) before importing help pages.\",\n );\n }\n return cfg;\n}\n","import { MDXRemote } from \"next-mdx-remote/rsc\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypeSlug from \"rehype-slug\";\nimport rehypeAutolinkHeadings from \"rehype-autolink-headings\";\nimport type { ReactElement } from \"react\";\nimport type { HelpArticle } from \"../types/help-article.types\";\nimport { _getStaticHelpReader } from \"../../../core/registry/helpStore\";\nimport { MDX_SERVER_COMPONENTS } from \"../components/mdx/mdx-server-components\";\n\n/**\n * Server-side: read the article's raw markdown via the registered help reader\n * and render it through `next-mdx-remote/rsc`'s server-side MDXRemote, using\n * the server-safe MDX components (Callout, Steps, Screenshot, EntityRef,\n * KeyBinding, Video). The returned React element can be embedded inside a\n * server component (e.g. as `children` of `<HelpArticleBody>`).\n *\n * Note: `<Related>` is intentionally not part of the server map — it's a client\n * component that reads HelpContext. Articles that reference `<Related>` would\n * need a separate render path that injects the manifest by prop.\n */\nexport async function renderHelpArticle(article: HelpArticle): Promise<ReactElement> {\n const readRawMarkdown = _getStaticHelpReader();\n if (!readRawMarkdown) {\n throw new Error(\n \"Help reader not configured. Call setHelpReader(fn) from a server-only entrypoint (e.g. Next.js instrumentation register()) before rendering help articles.\",\n );\n }\n const source = await readRawMarkdown(article);\n return (\n <MDXRemote\n source={source}\n components={MDX_SERVER_COMPONENTS}\n options={{\n parseFrontmatter: true,\n mdxOptions: {\n remarkPlugins: [remarkGfm],\n rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, { behavior: \"wrap\" }]],\n },\n }}\n />\n );\n}\n\n/** @deprecated Use `renderHelpArticle` instead — the legacy serialize + client\n * MDXRemote pattern is incompatible with App Router RSC. */\nexport const serializeHelpArticle = renderHelpArticle;\n","// Server-safe subset of MDX_COMPONENTS used by `renderHelpArticle`.\n// Mirrors `mdxComponents.ts` but EXCLUDES `Related` (which is a client\n// component that uses `useHelp` + `usePageUrlGenerator`). Server-side rendering\n// of `<Related>` would require passing the manifest by prop, which the standard\n// MDX components map cannot do — articles that need related links should be\n// extended via a server-side render hook rather than the MDX shortcode.\n\nimport { Callout } from \"./Callout\";\nimport { Steps, Step } from \"./Steps\";\nimport { Screenshot } from \"./Screenshot\";\nimport { EntityRef } from \"./EntityRef\";\nimport { KeyBinding } from \"./KeyBinding\";\nimport { Video } from \"./Video\";\n\nexport const MDX_SERVER_COMPONENTS = {\n Callout,\n Steps,\n Step,\n Screenshot,\n EntityRef,\n KeyBinding,\n Video,\n} as const;\n","import { getHelpContent } from \"./getHelpContent\";\n\nexport function generateHelpArticleStaticParams(): { mode: string; slug: string }[] {\n return getHelpContent()\n .manifest.filter((a) => !a.draft)\n .map((a) => ({ mode: a.mode, slug: a.slug }));\n}\n","import type { Metadata } from \"next\";\nimport { findHelpArticle } from \"../utils/helpNavigation\";\nimport { getHelpContent } from \"./getHelpContent\";\n\nexport async function generateHelpArticleMetadata({\n params,\n}: {\n params: Promise<{ mode: string; slug: string }>;\n}): Promise<Metadata> {\n const { mode, slug } = await params;\n const article = findHelpArticle(getHelpContent().manifest, mode, slug);\n if (!article) return {};\n return {\n title: article.title,\n description: article.summary,\n openGraph: { title: article.title, description: article.summary },\n };\n}\n","import { HELP_MODES } from \"../types/help-article.types\";\n\nexport function generateHelpModeStaticParams(): { mode: string }[] {\n return HELP_MODES.map((mode) => ({ mode }));\n}\n"]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Callout,
|
|
3
|
+
EntityRef,
|
|
4
|
+
HELP_MODES,
|
|
5
|
+
KeyBinding,
|
|
6
|
+
Screenshot,
|
|
7
|
+
Step,
|
|
8
|
+
Steps,
|
|
9
|
+
Video,
|
|
10
|
+
buildHelpNav,
|
|
11
|
+
findHelpArticle,
|
|
12
|
+
prevNextWithinMode
|
|
13
|
+
} from "../../chunk-MZTKPPET.mjs";
|
|
14
|
+
import {
|
|
15
|
+
_getStaticHelpContent,
|
|
16
|
+
_getStaticHelpReader,
|
|
17
|
+
setHelpReader
|
|
18
|
+
} from "../../chunk-CQID6RCF.mjs";
|
|
19
|
+
import "../../chunk-MSNNAHDB.mjs";
|
|
20
|
+
import "../../chunk-AUXK7QSA.mjs";
|
|
21
|
+
import "../../chunk-C7C7VY4F.mjs";
|
|
22
|
+
import "../../chunk-KK7PYKVI.mjs";
|
|
23
|
+
import {
|
|
24
|
+
__name
|
|
25
|
+
} from "../../chunk-PAWJFY3S.mjs";
|
|
26
|
+
|
|
27
|
+
// src/features/help/server/getHelpContent.ts
|
|
28
|
+
function getHelpContent() {
|
|
29
|
+
const cfg = _getStaticHelpContent();
|
|
30
|
+
if (!cfg) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
"Help content not configured \u2014 call configureJsonApi({ helpContent: {...} }) before importing help pages."
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return cfg;
|
|
36
|
+
}
|
|
37
|
+
__name(getHelpContent, "getHelpContent");
|
|
38
|
+
|
|
39
|
+
// src/features/help/server/serializeHelpArticle.tsx
|
|
40
|
+
import { MDXRemote } from "next-mdx-remote/rsc";
|
|
41
|
+
import remarkGfm from "remark-gfm";
|
|
42
|
+
import rehypeSlug from "rehype-slug";
|
|
43
|
+
import rehypeAutolinkHeadings from "rehype-autolink-headings";
|
|
44
|
+
|
|
45
|
+
// src/features/help/components/mdx/mdx-server-components.ts
|
|
46
|
+
var MDX_SERVER_COMPONENTS = {
|
|
47
|
+
Callout,
|
|
48
|
+
Steps,
|
|
49
|
+
Step,
|
|
50
|
+
Screenshot,
|
|
51
|
+
EntityRef,
|
|
52
|
+
KeyBinding,
|
|
53
|
+
Video
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// src/features/help/server/serializeHelpArticle.tsx
|
|
57
|
+
import { jsx } from "react/jsx-runtime";
|
|
58
|
+
async function renderHelpArticle(article) {
|
|
59
|
+
const readRawMarkdown = _getStaticHelpReader();
|
|
60
|
+
if (!readRawMarkdown) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
"Help reader not configured. Call setHelpReader(fn) from a server-only entrypoint (e.g. Next.js instrumentation register()) before rendering help articles."
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
const source = await readRawMarkdown(article);
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
MDXRemote,
|
|
68
|
+
{
|
|
69
|
+
source,
|
|
70
|
+
components: MDX_SERVER_COMPONENTS,
|
|
71
|
+
options: {
|
|
72
|
+
parseFrontmatter: true,
|
|
73
|
+
mdxOptions: {
|
|
74
|
+
remarkPlugins: [remarkGfm],
|
|
75
|
+
rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, { behavior: "wrap" }]]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
__name(renderHelpArticle, "renderHelpArticle");
|
|
82
|
+
var serializeHelpArticle = renderHelpArticle;
|
|
83
|
+
|
|
84
|
+
// src/features/help/server/generateHelpArticleStaticParams.ts
|
|
85
|
+
function generateHelpArticleStaticParams() {
|
|
86
|
+
return getHelpContent().manifest.filter((a) => !a.draft).map((a) => ({ mode: a.mode, slug: a.slug }));
|
|
87
|
+
}
|
|
88
|
+
__name(generateHelpArticleStaticParams, "generateHelpArticleStaticParams");
|
|
89
|
+
|
|
90
|
+
// src/features/help/server/generateHelpArticleMetadata.ts
|
|
91
|
+
async function generateHelpArticleMetadata({
|
|
92
|
+
params
|
|
93
|
+
}) {
|
|
94
|
+
const { mode, slug } = await params;
|
|
95
|
+
const article = findHelpArticle(getHelpContent().manifest, mode, slug);
|
|
96
|
+
if (!article) return {};
|
|
97
|
+
return {
|
|
98
|
+
title: article.title,
|
|
99
|
+
description: article.summary,
|
|
100
|
+
openGraph: { title: article.title, description: article.summary }
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
__name(generateHelpArticleMetadata, "generateHelpArticleMetadata");
|
|
104
|
+
|
|
105
|
+
// src/features/help/server/generateHelpModeStaticParams.ts
|
|
106
|
+
function generateHelpModeStaticParams() {
|
|
107
|
+
return HELP_MODES.map((mode) => ({ mode }));
|
|
108
|
+
}
|
|
109
|
+
__name(generateHelpModeStaticParams, "generateHelpModeStaticParams");
|
|
110
|
+
export {
|
|
111
|
+
HELP_MODES,
|
|
112
|
+
buildHelpNav,
|
|
113
|
+
findHelpArticle,
|
|
114
|
+
generateHelpArticleMetadata,
|
|
115
|
+
generateHelpArticleStaticParams,
|
|
116
|
+
generateHelpModeStaticParams,
|
|
117
|
+
getHelpContent,
|
|
118
|
+
prevNextWithinMode,
|
|
119
|
+
renderHelpArticle,
|
|
120
|
+
serializeHelpArticle,
|
|
121
|
+
setHelpReader
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/features/help/server/getHelpContent.ts","../../../src/features/help/server/serializeHelpArticle.tsx","../../../src/features/help/components/mdx/mdx-server-components.ts","../../../src/features/help/server/generateHelpArticleStaticParams.ts","../../../src/features/help/server/generateHelpArticleMetadata.ts","../../../src/features/help/server/generateHelpModeStaticParams.ts"],"sourcesContent":["import { _getStaticHelpContent } from \"../../../core/registry/helpStore\";\nimport type { HelpContentConfig } from \"../interfaces/help-content-config.interface\";\n\n/**\n * Server-side accessor for the help-content config set via configureJsonApi().\n * Returns the same value <HelpProvider> exposes via React Context to client components.\n * Throws with a setup error if helpContent was never configured.\n */\nexport function getHelpContent(): HelpContentConfig {\n const cfg = _getStaticHelpContent<HelpContentConfig>();\n if (!cfg) {\n throw new Error(\n \"Help content not configured — call configureJsonApi({ helpContent: {...} }) before importing help pages.\",\n );\n }\n return cfg;\n}\n","import { MDXRemote } from \"next-mdx-remote/rsc\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypeSlug from \"rehype-slug\";\nimport rehypeAutolinkHeadings from \"rehype-autolink-headings\";\nimport type { ReactElement } from \"react\";\nimport type { HelpArticle } from \"../types/help-article.types\";\nimport { _getStaticHelpReader } from \"../../../core/registry/helpStore\";\nimport { MDX_SERVER_COMPONENTS } from \"../components/mdx/mdx-server-components\";\n\n/**\n * Server-side: read the article's raw markdown via the registered help reader\n * and render it through `next-mdx-remote/rsc`'s server-side MDXRemote, using\n * the server-safe MDX components (Callout, Steps, Screenshot, EntityRef,\n * KeyBinding, Video). The returned React element can be embedded inside a\n * server component (e.g. as `children` of `<HelpArticleBody>`).\n *\n * Note: `<Related>` is intentionally not part of the server map — it's a client\n * component that reads HelpContext. Articles that reference `<Related>` would\n * need a separate render path that injects the manifest by prop.\n */\nexport async function renderHelpArticle(article: HelpArticle): Promise<ReactElement> {\n const readRawMarkdown = _getStaticHelpReader();\n if (!readRawMarkdown) {\n throw new Error(\n \"Help reader not configured. Call setHelpReader(fn) from a server-only entrypoint (e.g. Next.js instrumentation register()) before rendering help articles.\",\n );\n }\n const source = await readRawMarkdown(article);\n return (\n <MDXRemote\n source={source}\n components={MDX_SERVER_COMPONENTS}\n options={{\n parseFrontmatter: true,\n mdxOptions: {\n remarkPlugins: [remarkGfm],\n rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, { behavior: \"wrap\" }]],\n },\n }}\n />\n );\n}\n\n/** @deprecated Use `renderHelpArticle` instead — the legacy serialize + client\n * MDXRemote pattern is incompatible with App Router RSC. */\nexport const serializeHelpArticle = renderHelpArticle;\n","// Server-safe subset of MDX_COMPONENTS used by `renderHelpArticle`.\n// Mirrors `mdxComponents.ts` but EXCLUDES `Related` (which is a client\n// component that uses `useHelp` + `usePageUrlGenerator`). Server-side rendering\n// of `<Related>` would require passing the manifest by prop, which the standard\n// MDX components map cannot do — articles that need related links should be\n// extended via a server-side render hook rather than the MDX shortcode.\n\nimport { Callout } from \"./Callout\";\nimport { Steps, Step } from \"./Steps\";\nimport { Screenshot } from \"./Screenshot\";\nimport { EntityRef } from \"./EntityRef\";\nimport { KeyBinding } from \"./KeyBinding\";\nimport { Video } from \"./Video\";\n\nexport const MDX_SERVER_COMPONENTS = {\n Callout,\n Steps,\n Step,\n Screenshot,\n EntityRef,\n KeyBinding,\n Video,\n} as const;\n","import { getHelpContent } from \"./getHelpContent\";\n\nexport function generateHelpArticleStaticParams(): { mode: string; slug: string }[] {\n return getHelpContent()\n .manifest.filter((a) => !a.draft)\n .map((a) => ({ mode: a.mode, slug: a.slug }));\n}\n","import type { Metadata } from \"next\";\nimport { findHelpArticle } from \"../utils/helpNavigation\";\nimport { getHelpContent } from \"./getHelpContent\";\n\nexport async function generateHelpArticleMetadata({\n params,\n}: {\n params: Promise<{ mode: string; slug: string }>;\n}): Promise<Metadata> {\n const { mode, slug } = await params;\n const article = findHelpArticle(getHelpContent().manifest, mode, slug);\n if (!article) return {};\n return {\n title: article.title,\n description: article.summary,\n openGraph: { title: article.title, description: article.summary },\n };\n}\n","import { HELP_MODES } from \"../types/help-article.types\";\n\nexport function generateHelpModeStaticParams(): { mode: string }[] {\n return HELP_MODES.map((mode) => ({ mode }));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,SAAS,iBAAoC;AAClD,QAAM,MAAM,sBAAyC;AACrD,MAAI,CAAC,KAAK;AACR,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AARgB;;;ACRhB,SAAS,iBAAiB;AAC1B,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,4BAA4B;;;ACW5B,IAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ADOI;AATJ,eAAsB,kBAAkB,SAA6C;AACnF,QAAM,kBAAkB,qBAAqB;AAC7C,MAAI,CAAC,iBAAiB;AACpB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,QAAM,SAAS,MAAM,gBAAgB,OAAO;AAC5C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,kBAAkB;AAAA,QAClB,YAAY;AAAA,UACV,eAAe,CAAC,SAAS;AAAA,UACzB,eAAe,CAAC,YAAY,CAAC,wBAAwB,EAAE,UAAU,OAAO,CAAC,CAAC;AAAA,QAC5E;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AArBsB;AAyBf,IAAM,uBAAuB;;;AE3C7B,SAAS,kCAAoE;AAClF,SAAO,eAAe,EACnB,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAC/B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,EAAE,KAAK,EAAE;AAChD;AAJgB;;;ACEhB,eAAsB,4BAA4B;AAAA,EAChD;AACF,GAEsB;AACpB,QAAM,EAAE,MAAM,KAAK,IAAI,MAAM;AAC7B,QAAM,UAAU,gBAAgB,eAAe,EAAE,UAAU,MAAM,IAAI;AACrE,MAAI,CAAC,QAAS,QAAO,CAAC;AACtB,SAAO;AAAA,IACL,OAAO,QAAQ;AAAA,IACf,aAAa,QAAQ;AAAA,IACrB,WAAW,EAAE,OAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ;AAAA,EAClE;AACF;AAbsB;;;ACFf,SAAS,+BAAmD;AACjE,SAAO,WAAW,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE;AAC5C;AAFgB;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local copy of the help-article types to keep this published frontend library
|
|
3
|
+
* decoupled from `@carlonicora/nestjs-neo4jsonapi`. Must stay in sync with
|
|
4
|
+
* `packages/nestjs-neo4jsonapi/src/foundations/help-content-sync/interfaces/help-article.interface.ts`.
|
|
5
|
+
*/
|
|
6
|
+
declare const HELP_MODES: readonly ["tutorial", "how-to", "reference", "explanation"];
|
|
7
|
+
type HelpMode = (typeof HELP_MODES)[number];
|
|
8
|
+
interface HelpHeading {
|
|
9
|
+
depth: 2 | 3;
|
|
10
|
+
slug: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
interface HelpArticle {
|
|
14
|
+
id: string;
|
|
15
|
+
slug: string;
|
|
16
|
+
mode: HelpMode;
|
|
17
|
+
title: string;
|
|
18
|
+
summary: string;
|
|
19
|
+
order: number;
|
|
20
|
+
tags: readonly string[];
|
|
21
|
+
contextualKeys: readonly string[];
|
|
22
|
+
aiIndexed: boolean;
|
|
23
|
+
draft: boolean;
|
|
24
|
+
contentHash: string;
|
|
25
|
+
path: string;
|
|
26
|
+
headings: readonly HelpHeading[];
|
|
27
|
+
relatedSlugs: readonly string[];
|
|
28
|
+
lastUpdated: string;
|
|
29
|
+
}
|
|
30
|
+
interface HelpRedirect {
|
|
31
|
+
from: string;
|
|
32
|
+
to: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface HelpBrandConfig {
|
|
36
|
+
/** URL of the brand logo image (served by the consuming app). */
|
|
37
|
+
logo?: string;
|
|
38
|
+
/** Brand label shown in the help header. */
|
|
39
|
+
label?: string;
|
|
40
|
+
/** Where the "Open app" button navigates for logged-in users. Defaults to "/". */
|
|
41
|
+
appHref?: string;
|
|
42
|
+
}
|
|
43
|
+
interface HelpContentConfig {
|
|
44
|
+
manifest: readonly HelpArticle[];
|
|
45
|
+
namespaceUuid: string;
|
|
46
|
+
redirects?: readonly HelpRedirect[];
|
|
47
|
+
brand?: HelpBrandConfig;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { type HelpContentConfig as H, type HelpArticle as a, type HelpMode as b, type HelpBrandConfig as c, HELP_MODES as d, type HelpHeading as e, type HelpRedirect as f };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local copy of the help-article types to keep this published frontend library
|
|
3
|
+
* decoupled from `@carlonicora/nestjs-neo4jsonapi`. Must stay in sync with
|
|
4
|
+
* `packages/nestjs-neo4jsonapi/src/foundations/help-content-sync/interfaces/help-article.interface.ts`.
|
|
5
|
+
*/
|
|
6
|
+
declare const HELP_MODES: readonly ["tutorial", "how-to", "reference", "explanation"];
|
|
7
|
+
type HelpMode = (typeof HELP_MODES)[number];
|
|
8
|
+
interface HelpHeading {
|
|
9
|
+
depth: 2 | 3;
|
|
10
|
+
slug: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
interface HelpArticle {
|
|
14
|
+
id: string;
|
|
15
|
+
slug: string;
|
|
16
|
+
mode: HelpMode;
|
|
17
|
+
title: string;
|
|
18
|
+
summary: string;
|
|
19
|
+
order: number;
|
|
20
|
+
tags: readonly string[];
|
|
21
|
+
contextualKeys: readonly string[];
|
|
22
|
+
aiIndexed: boolean;
|
|
23
|
+
draft: boolean;
|
|
24
|
+
contentHash: string;
|
|
25
|
+
path: string;
|
|
26
|
+
headings: readonly HelpHeading[];
|
|
27
|
+
relatedSlugs: readonly string[];
|
|
28
|
+
lastUpdated: string;
|
|
29
|
+
}
|
|
30
|
+
interface HelpRedirect {
|
|
31
|
+
from: string;
|
|
32
|
+
to: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface HelpBrandConfig {
|
|
36
|
+
/** URL of the brand logo image (served by the consuming app). */
|
|
37
|
+
logo?: string;
|
|
38
|
+
/** Brand label shown in the help header. */
|
|
39
|
+
label?: string;
|
|
40
|
+
/** Where the "Open app" button navigates for logged-in users. Defaults to "/". */
|
|
41
|
+
appHref?: string;
|
|
42
|
+
}
|
|
43
|
+
interface HelpContentConfig {
|
|
44
|
+
manifest: readonly HelpArticle[];
|
|
45
|
+
namespaceUuid: string;
|
|
46
|
+
redirects?: readonly HelpRedirect[];
|
|
47
|
+
brand?: HelpBrandConfig;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { type HelpContentConfig as H, type HelpArticle as a, type HelpMode as b, type HelpBrandConfig as c, HELP_MODES as d, type HelpHeading as e, type HelpRedirect as f };
|