@carlonicora/nextjs-jsonapi 1.109.0 → 1.110.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/{AssistantMessageInterface-Cs1yb-gF.d.ts → AssistantMessageInterface-BNzf1etU.d.ts} +14 -1
- package/dist/{AssistantMessageInterface-DQ3mH5L8.d.mts → AssistantMessageInterface-DrgHDjZ5.d.mts} +14 -1
- package/dist/{BlockNoteEditor-3XYBZLWO.js → BlockNoteEditor-7OKW6HHN.js} +19 -20
- package/dist/BlockNoteEditor-7OKW6HHN.js.map +1 -0
- package/dist/{BlockNoteEditor-EBFZG7AL.mjs → BlockNoteEditor-K7IIWM3S.mjs} +4 -5
- package/dist/{BlockNoteEditor-EBFZG7AL.mjs.map → BlockNoteEditor-K7IIWM3S.mjs.map} +1 -1
- package/dist/BlockNoteViewer-OPSCTHKJ.mjs +31 -0
- package/dist/BlockNoteViewer-OPSCTHKJ.mjs.map +1 -0
- package/dist/BlockNoteViewer-UW5VZ5UF.js +31 -0
- package/dist/BlockNoteViewer-UW5VZ5UF.js.map +1 -0
- package/dist/billing/index.d.mts +41 -41
- package/dist/billing/index.d.ts +41 -41
- package/dist/billing/index.js +346 -347
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +3 -4
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-7E3O52U5.js → chunk-6XWW67F2.js} +25 -12
- package/dist/chunk-6XWW67F2.js.map +1 -0
- package/dist/{chunk-UHO3KUUH.js → chunk-AKXUNE3A.js} +977 -850
- package/dist/chunk-AKXUNE3A.js.map +1 -0
- package/dist/{chunk-UOYIWJEJ.mjs → chunk-CWVYU4YZ.mjs} +18 -5
- package/dist/{chunk-UOYIWJEJ.mjs.map → chunk-CWVYU4YZ.mjs.map} +1 -1
- package/dist/{chunk-CRTVAQEK.mjs → chunk-TXVVZLUQ.mjs} +1388 -1261
- package/dist/chunk-TXVVZLUQ.mjs.map +1 -0
- package/dist/{chunk-CFI4WZ5R.js → chunk-U2HR57MY.js} +111 -5
- package/dist/chunk-U2HR57MY.js.map +1 -0
- package/dist/chunk-WPAQRB5Q.mjs +7 -0
- package/dist/chunk-WPAQRB5Q.mjs.map +1 -0
- package/dist/chunk-YBZVWLPH.js +7 -0
- package/dist/chunk-YBZVWLPH.js.map +1 -0
- package/dist/{chunk-MSNNAHDB.mjs → chunk-ZYPNVEHB.mjs} +112 -6
- package/dist/{chunk-MSNNAHDB.mjs.map → chunk-ZYPNVEHB.mjs.map} +1 -1
- package/dist/client/index.d.mts +3 -4
- package/dist/client/index.d.ts +3 -4
- package/dist/client/index.js +4 -5
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +3 -4
- package/dist/components/index.d.mts +418 -415
- package/dist/components/index.d.ts +418 -415
- package/dist/components/index.js +6 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -4
- package/dist/{config-CN23v3eJ.d.ts → config-BrkU_Ynz.d.ts} +2 -2
- package/dist/{config-gh88Qn4h.d.mts → config-snd2ToEB.d.mts} +2 -2
- package/dist/contexts/index.d.mts +15 -15
- package/dist/contexts/index.d.ts +15 -15
- package/dist/contexts/index.js +4 -5
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +3 -4
- package/dist/core/index.d.mts +35 -4
- package/dist/core/index.d.ts +35 -4
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/help/index.d.mts +25 -66
- package/dist/features/help/index.d.ts +25 -66
- package/dist/features/help/index.js +114 -124
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +95 -105
- package/dist/features/help/index.mjs.map +1 -1
- package/dist/features/help/server.d.mts +27 -65
- package/dist/features/help/server.d.ts +27 -65
- package/dist/features/help/server.js +4 -119
- package/dist/features/help/server.js.map +1 -1
- package/dist/features/help/server.mjs +4 -119
- package/dist/features/help/server.mjs.map +1 -1
- package/dist/help-content-config.interface-C5ESIod9.d.mts +13 -0
- package/dist/help-content-config.interface-C5ESIod9.d.ts +13 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -3
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/testing/index.d.mts +1 -2
- package/dist/testing/index.d.ts +1 -2
- package/package.json +1 -6
- package/src/client/config.ts +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/viewers/BlockNoteViewer.tsx +27 -0
- package/src/components/viewers/BlockNoteViewerContainer.tsx +10 -0
- package/src/core/registry/helpStore.ts +2 -19
- package/src/features/assistant-message/components/parts/MessageSourcesContainer.tsx +4 -0
- package/src/features/assistant-message/components/parts/tabs/ContentsTab.tsx +5 -5
- package/src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx +3 -2
- package/src/features/help/components/HelpArticleBody.tsx +27 -19
- package/src/features/help/components/HelpHint.tsx +20 -11
- package/src/features/help/components/HelpSearchResultRow.tsx +16 -6
- package/src/features/help/components/HelpSideNav.tsx +54 -19
- package/src/features/help/components/__tests__/HelpAskAi.spec.tsx +1 -1
- package/src/features/help/components/__tests__/HelpHint.spec.tsx +17 -17
- package/src/features/help/components/__tests__/HelpSearchResultRow.spec.tsx +18 -19
- package/src/features/help/components/__tests__/HelpSideNav.spec.tsx +20 -22
- package/src/features/help/contexts/HelpContext.spec.tsx +1 -3
- package/src/features/help/index.ts +3 -6
- package/src/features/help/interfaces/help-content-config.interface.ts +0 -5
- package/src/features/help/server-entry.ts +6 -15
- package/src/features/help/types/help-article.types.ts +2 -4
- package/src/features/how-to/HowToModule.ts +14 -1
- package/src/features/how-to/components/forms/HowToEditor.tsx +108 -4
- package/src/features/how-to/data/HowTo.spec.ts +43 -0
- package/src/features/how-to/data/HowTo.ts +47 -4
- package/src/features/how-to/data/HowToInterface.ts +14 -1
- package/src/features/how-to/data/HowToService.ts +61 -0
- package/dist/BlockNoteEditor-3XYBZLWO.js.map +0 -1
- package/dist/chunk-3J7RQBF3.js +0 -123
- package/dist/chunk-3J7RQBF3.js.map +0 -1
- package/dist/chunk-7E3O52U5.js.map +0 -1
- package/dist/chunk-CFI4WZ5R.js.map +0 -1
- package/dist/chunk-CQID6RCF.mjs +0 -38
- package/dist/chunk-CQID6RCF.mjs.map +0 -1
- package/dist/chunk-CRTVAQEK.mjs.map +0 -1
- package/dist/chunk-MZTKPPET.mjs +0 -123
- package/dist/chunk-MZTKPPET.mjs.map +0 -1
- package/dist/chunk-UHO3KUUH.js.map +0 -1
- package/dist/chunk-YQQHAFBS.js +0 -38
- package/dist/chunk-YQQHAFBS.js.map +0 -1
- package/dist/features/help/server/createHelpAssetRouteHandler.d.mts +0 -11
- package/dist/features/help/server/createHelpAssetRouteHandler.d.ts +0 -11
- package/dist/features/help/server/createHelpAssetRouteHandler.js +0 -43
- package/dist/features/help/server/createHelpAssetRouteHandler.js.map +0 -1
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs +0 -43
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs.map +0 -1
- package/dist/help-content-config.interface-B9L02u9i.d.mts +0 -50
- package/dist/help-content-config.interface-B9L02u9i.d.ts +0 -50
- package/src/features/help/components/mdx/Callout.tsx +0 -21
- package/src/features/help/components/mdx/EntityRef.tsx +0 -18
- package/src/features/help/components/mdx/KeyBinding.tsx +0 -6
- package/src/features/help/components/mdx/Related.tsx +0 -33
- package/src/features/help/components/mdx/Screenshot.tsx +0 -9
- package/src/features/help/components/mdx/Steps.tsx +0 -21
- package/src/features/help/components/mdx/Video.tsx +0 -8
- package/src/features/help/components/mdx/mdx-server-components.ts +0 -23
- package/src/features/help/components/mdx/mdxComponents.ts +0 -9
- package/src/features/help/hooks/useHelpArticle.ts +0 -7
- package/src/features/help/hooks/useHelpManifest.ts +0 -5
- package/src/features/help/server/__tests__/createHelpAssetRouteHandler.spec.ts +0 -43
- package/src/features/help/server/createHelpAssetRouteHandler.ts +0 -35
- package/src/features/help/server/generateHelpArticleMetadata.ts +0 -18
- package/src/features/help/server/generateHelpArticleStaticParams.ts +0 -7
- package/src/features/help/server/generateHelpModeStaticParams.ts +0 -5
- package/src/features/help/server/getHelpContent.ts +0 -17
- package/src/features/help/server/index.ts +0 -8
- package/src/features/help/server/serializeHelpArticle.tsx +0 -46
- package/src/features/help/utils/__tests__/helpNavigation.spec.ts +0 -70
- package/src/features/help/utils/helpNavigation.ts +0 -29
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { buildHelpNav, findHelpArticle, prevNextWithinMode } from "../helpNavigation";
|
|
3
|
-
|
|
4
|
-
const base = {
|
|
5
|
-
tags: [],
|
|
6
|
-
contextualKeys: [],
|
|
7
|
-
aiIndexed: true,
|
|
8
|
-
draft: false,
|
|
9
|
-
contentHash: "h",
|
|
10
|
-
headings: [],
|
|
11
|
-
relatedSlugs: [],
|
|
12
|
-
lastUpdated: "",
|
|
13
|
-
};
|
|
14
|
-
const manifest = [
|
|
15
|
-
{
|
|
16
|
-
...base,
|
|
17
|
-
id: "a",
|
|
18
|
-
slug: "a",
|
|
19
|
-
mode: "how-to" as const,
|
|
20
|
-
title: "Alpha",
|
|
21
|
-
summary: "s",
|
|
22
|
-
order: 1,
|
|
23
|
-
path: "how-to/a.mdx",
|
|
24
|
-
},
|
|
25
|
-
{ ...base, id: "b", slug: "b", mode: "how-to" as const, title: "Beta", summary: "s", order: 2, path: "how-to/b.mdx" },
|
|
26
|
-
{
|
|
27
|
-
...base,
|
|
28
|
-
id: "c",
|
|
29
|
-
slug: "c",
|
|
30
|
-
mode: "tutorial" as const,
|
|
31
|
-
title: "Gamma",
|
|
32
|
-
summary: "s",
|
|
33
|
-
order: 1,
|
|
34
|
-
path: "tutorial/c.mdx",
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
describe("helpNavigation", () => {
|
|
39
|
-
it("buildHelpNav groups articles by mode, sorted by order", () => {
|
|
40
|
-
const groups = buildHelpNav(manifest);
|
|
41
|
-
const howTo = groups.find((g) => g.mode === "how-to")!;
|
|
42
|
-
expect(howTo.articles.map((a) => a.slug)).toEqual(["a", "b"]);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("findHelpArticle locates by mode + slug", () => {
|
|
46
|
-
expect(findHelpArticle(manifest, "how-to", "b")?.title).toBe("Beta");
|
|
47
|
-
expect(findHelpArticle(manifest, "how-to", "missing")).toBeUndefined();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it("prevNextWithinMode returns siblings within the same mode", () => {
|
|
51
|
-
const current = manifest[0]; // Alpha (how-to, order 1)
|
|
52
|
-
const { prev, next } = prevNextWithinMode(manifest, current);
|
|
53
|
-
expect(prev).toBeNull();
|
|
54
|
-
expect(next?.slug).toBe("b");
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("prevNextWithinMode returns null at the boundaries", () => {
|
|
58
|
-
const current = manifest[1]; // Beta (how-to, order 2)
|
|
59
|
-
const { prev, next } = prevNextWithinMode(manifest, current);
|
|
60
|
-
expect(prev?.slug).toBe("a");
|
|
61
|
-
expect(next).toBeNull();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("prevNextWithinMode does not cross modes", () => {
|
|
65
|
-
const current = manifest[2]; // Gamma (tutorial)
|
|
66
|
-
const { prev, next } = prevNextWithinMode(manifest, current);
|
|
67
|
-
expect(prev).toBeNull();
|
|
68
|
-
expect(next).toBeNull();
|
|
69
|
-
});
|
|
70
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { HELP_MODES, type HelpArticle, type HelpMode } from "../types/help-article.types";
|
|
2
|
-
|
|
3
|
-
export interface HelpNavGroup {
|
|
4
|
-
mode: HelpMode;
|
|
5
|
-
articles: HelpArticle[];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function buildHelpNav(manifest: readonly HelpArticle[]): HelpNavGroup[] {
|
|
9
|
-
return HELP_MODES.map((mode) => ({
|
|
10
|
-
mode,
|
|
11
|
-
articles: manifest.filter((a) => a.mode === mode && !a.draft).sort((a, b) => a.order - b.order),
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function findHelpArticle(manifest: readonly HelpArticle[], mode: string, slug: string): HelpArticle | undefined {
|
|
16
|
-
return manifest.find((a) => a.mode === mode && a.slug === slug);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function prevNextWithinMode(
|
|
20
|
-
manifest: readonly HelpArticle[],
|
|
21
|
-
current: HelpArticle,
|
|
22
|
-
): { prev: HelpArticle | null; next: HelpArticle | null } {
|
|
23
|
-
const siblings = manifest.filter((a) => a.mode === current.mode && !a.draft).sort((a, b) => a.order - b.order);
|
|
24
|
-
const idx = siblings.findIndex((a) => a.slug === current.slug);
|
|
25
|
-
return {
|
|
26
|
-
prev: idx > 0 ? siblings[idx - 1] : null,
|
|
27
|
-
next: idx >= 0 && idx < siblings.length - 1 ? siblings[idx + 1] : null,
|
|
28
|
-
};
|
|
29
|
-
}
|