@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.
Files changed (146) hide show
  1. package/dist/{AssistantMessageInterface-Cs1yb-gF.d.ts → AssistantMessageInterface-BNzf1etU.d.ts} +14 -1
  2. package/dist/{AssistantMessageInterface-DQ3mH5L8.d.mts → AssistantMessageInterface-DrgHDjZ5.d.mts} +14 -1
  3. package/dist/{BlockNoteEditor-3XYBZLWO.js → BlockNoteEditor-7OKW6HHN.js} +19 -20
  4. package/dist/BlockNoteEditor-7OKW6HHN.js.map +1 -0
  5. package/dist/{BlockNoteEditor-EBFZG7AL.mjs → BlockNoteEditor-K7IIWM3S.mjs} +4 -5
  6. package/dist/{BlockNoteEditor-EBFZG7AL.mjs.map → BlockNoteEditor-K7IIWM3S.mjs.map} +1 -1
  7. package/dist/BlockNoteViewer-OPSCTHKJ.mjs +31 -0
  8. package/dist/BlockNoteViewer-OPSCTHKJ.mjs.map +1 -0
  9. package/dist/BlockNoteViewer-UW5VZ5UF.js +31 -0
  10. package/dist/BlockNoteViewer-UW5VZ5UF.js.map +1 -0
  11. package/dist/billing/index.d.mts +41 -41
  12. package/dist/billing/index.d.ts +41 -41
  13. package/dist/billing/index.js +346 -347
  14. package/dist/billing/index.js.map +1 -1
  15. package/dist/billing/index.mjs +3 -4
  16. package/dist/billing/index.mjs.map +1 -1
  17. package/dist/{chunk-7E3O52U5.js → chunk-6XWW67F2.js} +25 -12
  18. package/dist/chunk-6XWW67F2.js.map +1 -0
  19. package/dist/{chunk-UHO3KUUH.js → chunk-AKXUNE3A.js} +977 -850
  20. package/dist/chunk-AKXUNE3A.js.map +1 -0
  21. package/dist/{chunk-UOYIWJEJ.mjs → chunk-CWVYU4YZ.mjs} +18 -5
  22. package/dist/{chunk-UOYIWJEJ.mjs.map → chunk-CWVYU4YZ.mjs.map} +1 -1
  23. package/dist/{chunk-CRTVAQEK.mjs → chunk-TXVVZLUQ.mjs} +1388 -1261
  24. package/dist/chunk-TXVVZLUQ.mjs.map +1 -0
  25. package/dist/{chunk-CFI4WZ5R.js → chunk-U2HR57MY.js} +111 -5
  26. package/dist/chunk-U2HR57MY.js.map +1 -0
  27. package/dist/chunk-WPAQRB5Q.mjs +7 -0
  28. package/dist/chunk-WPAQRB5Q.mjs.map +1 -0
  29. package/dist/chunk-YBZVWLPH.js +7 -0
  30. package/dist/chunk-YBZVWLPH.js.map +1 -0
  31. package/dist/{chunk-MSNNAHDB.mjs → chunk-ZYPNVEHB.mjs} +112 -6
  32. package/dist/{chunk-MSNNAHDB.mjs.map → chunk-ZYPNVEHB.mjs.map} +1 -1
  33. package/dist/client/index.d.mts +3 -4
  34. package/dist/client/index.d.ts +3 -4
  35. package/dist/client/index.js +4 -5
  36. package/dist/client/index.js.map +1 -1
  37. package/dist/client/index.mjs +3 -4
  38. package/dist/components/index.d.mts +418 -415
  39. package/dist/components/index.d.ts +418 -415
  40. package/dist/components/index.js +6 -5
  41. package/dist/components/index.js.map +1 -1
  42. package/dist/components/index.mjs +5 -4
  43. package/dist/{config-CN23v3eJ.d.ts → config-BrkU_Ynz.d.ts} +2 -2
  44. package/dist/{config-gh88Qn4h.d.mts → config-snd2ToEB.d.mts} +2 -2
  45. package/dist/contexts/index.d.mts +15 -15
  46. package/dist/contexts/index.d.ts +15 -15
  47. package/dist/contexts/index.js +4 -5
  48. package/dist/contexts/index.js.map +1 -1
  49. package/dist/contexts/index.mjs +3 -4
  50. package/dist/core/index.d.mts +35 -4
  51. package/dist/core/index.d.ts +35 -4
  52. package/dist/core/index.js +2 -2
  53. package/dist/core/index.mjs +1 -1
  54. package/dist/features/help/index.d.mts +25 -66
  55. package/dist/features/help/index.d.ts +25 -66
  56. package/dist/features/help/index.js +114 -124
  57. package/dist/features/help/index.js.map +1 -1
  58. package/dist/features/help/index.mjs +95 -105
  59. package/dist/features/help/index.mjs.map +1 -1
  60. package/dist/features/help/server.d.mts +27 -65
  61. package/dist/features/help/server.d.ts +27 -65
  62. package/dist/features/help/server.js +4 -119
  63. package/dist/features/help/server.js.map +1 -1
  64. package/dist/features/help/server.mjs +4 -119
  65. package/dist/features/help/server.mjs.map +1 -1
  66. package/dist/help-content-config.interface-C5ESIod9.d.mts +13 -0
  67. package/dist/help-content-config.interface-C5ESIod9.d.ts +13 -0
  68. package/dist/index.d.mts +3 -3
  69. package/dist/index.d.ts +3 -3
  70. package/dist/index.js +3 -4
  71. package/dist/index.js.map +1 -1
  72. package/dist/index.mjs +2 -3
  73. package/dist/server/index.js +3 -3
  74. package/dist/server/index.mjs +1 -1
  75. package/dist/testing/index.d.mts +1 -2
  76. package/dist/testing/index.d.ts +1 -2
  77. package/package.json +1 -6
  78. package/src/client/config.ts +1 -1
  79. package/src/components/index.ts +1 -0
  80. package/src/components/viewers/BlockNoteViewer.tsx +27 -0
  81. package/src/components/viewers/BlockNoteViewerContainer.tsx +10 -0
  82. package/src/core/registry/helpStore.ts +2 -19
  83. package/src/features/assistant-message/components/parts/MessageSourcesContainer.tsx +4 -0
  84. package/src/features/assistant-message/components/parts/tabs/ContentsTab.tsx +5 -5
  85. package/src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx +3 -2
  86. package/src/features/help/components/HelpArticleBody.tsx +27 -19
  87. package/src/features/help/components/HelpHint.tsx +20 -11
  88. package/src/features/help/components/HelpSearchResultRow.tsx +16 -6
  89. package/src/features/help/components/HelpSideNav.tsx +54 -19
  90. package/src/features/help/components/__tests__/HelpAskAi.spec.tsx +1 -1
  91. package/src/features/help/components/__tests__/HelpHint.spec.tsx +17 -17
  92. package/src/features/help/components/__tests__/HelpSearchResultRow.spec.tsx +18 -19
  93. package/src/features/help/components/__tests__/HelpSideNav.spec.tsx +20 -22
  94. package/src/features/help/contexts/HelpContext.spec.tsx +1 -3
  95. package/src/features/help/index.ts +3 -6
  96. package/src/features/help/interfaces/help-content-config.interface.ts +0 -5
  97. package/src/features/help/server-entry.ts +6 -15
  98. package/src/features/help/types/help-article.types.ts +2 -4
  99. package/src/features/how-to/HowToModule.ts +14 -1
  100. package/src/features/how-to/components/forms/HowToEditor.tsx +108 -4
  101. package/src/features/how-to/data/HowTo.spec.ts +43 -0
  102. package/src/features/how-to/data/HowTo.ts +47 -4
  103. package/src/features/how-to/data/HowToInterface.ts +14 -1
  104. package/src/features/how-to/data/HowToService.ts +61 -0
  105. package/dist/BlockNoteEditor-3XYBZLWO.js.map +0 -1
  106. package/dist/chunk-3J7RQBF3.js +0 -123
  107. package/dist/chunk-3J7RQBF3.js.map +0 -1
  108. package/dist/chunk-7E3O52U5.js.map +0 -1
  109. package/dist/chunk-CFI4WZ5R.js.map +0 -1
  110. package/dist/chunk-CQID6RCF.mjs +0 -38
  111. package/dist/chunk-CQID6RCF.mjs.map +0 -1
  112. package/dist/chunk-CRTVAQEK.mjs.map +0 -1
  113. package/dist/chunk-MZTKPPET.mjs +0 -123
  114. package/dist/chunk-MZTKPPET.mjs.map +0 -1
  115. package/dist/chunk-UHO3KUUH.js.map +0 -1
  116. package/dist/chunk-YQQHAFBS.js +0 -38
  117. package/dist/chunk-YQQHAFBS.js.map +0 -1
  118. package/dist/features/help/server/createHelpAssetRouteHandler.d.mts +0 -11
  119. package/dist/features/help/server/createHelpAssetRouteHandler.d.ts +0 -11
  120. package/dist/features/help/server/createHelpAssetRouteHandler.js +0 -43
  121. package/dist/features/help/server/createHelpAssetRouteHandler.js.map +0 -1
  122. package/dist/features/help/server/createHelpAssetRouteHandler.mjs +0 -43
  123. package/dist/features/help/server/createHelpAssetRouteHandler.mjs.map +0 -1
  124. package/dist/help-content-config.interface-B9L02u9i.d.mts +0 -50
  125. package/dist/help-content-config.interface-B9L02u9i.d.ts +0 -50
  126. package/src/features/help/components/mdx/Callout.tsx +0 -21
  127. package/src/features/help/components/mdx/EntityRef.tsx +0 -18
  128. package/src/features/help/components/mdx/KeyBinding.tsx +0 -6
  129. package/src/features/help/components/mdx/Related.tsx +0 -33
  130. package/src/features/help/components/mdx/Screenshot.tsx +0 -9
  131. package/src/features/help/components/mdx/Steps.tsx +0 -21
  132. package/src/features/help/components/mdx/Video.tsx +0 -8
  133. package/src/features/help/components/mdx/mdx-server-components.ts +0 -23
  134. package/src/features/help/components/mdx/mdxComponents.ts +0 -9
  135. package/src/features/help/hooks/useHelpArticle.ts +0 -7
  136. package/src/features/help/hooks/useHelpManifest.ts +0 -5
  137. package/src/features/help/server/__tests__/createHelpAssetRouteHandler.spec.ts +0 -43
  138. package/src/features/help/server/createHelpAssetRouteHandler.ts +0 -35
  139. package/src/features/help/server/generateHelpArticleMetadata.ts +0 -18
  140. package/src/features/help/server/generateHelpArticleStaticParams.ts +0 -7
  141. package/src/features/help/server/generateHelpModeStaticParams.ts +0 -5
  142. package/src/features/help/server/getHelpContent.ts +0 -17
  143. package/src/features/help/server/index.ts +0 -8
  144. package/src/features/help/server/serializeHelpArticle.tsx +0 -46
  145. package/src/features/help/utils/__tests__/helpNavigation.spec.ts +0 -70
  146. 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
- }