@carlonicora/nextjs-jsonapi 6.27.0 → 6.29.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 (51) hide show
  1. package/dist/{BlockNoteEditor-D2DXVXTJ.mjs → BlockNoteEditor-BHCNJ2JA.mjs} +8 -60
  2. package/dist/BlockNoteEditor-BHCNJ2JA.mjs.map +1 -0
  3. package/dist/{BlockNoteEditor-NQB75M47.js → BlockNoteEditor-KGCHQQVY.js} +21 -73
  4. package/dist/BlockNoteEditor-KGCHQQVY.js.map +1 -0
  5. package/dist/billing/index.js +378 -378
  6. package/dist/billing/index.mjs +1 -1
  7. package/dist/{chunk-HU3AGUFI.mjs → chunk-UQFDOZVF.mjs} +91 -8
  8. package/dist/chunk-UQFDOZVF.mjs.map +1 -0
  9. package/dist/{chunk-YGV27OAW.js → chunk-WXTEAATG.js} +92 -9
  10. package/dist/chunk-WXTEAATG.js.map +1 -0
  11. package/dist/client/index.js +2 -2
  12. package/dist/client/index.mjs +1 -1
  13. package/dist/components/containers/RoundPageContainer.d.ts +3 -1
  14. package/dist/components/containers/RoundPageContainer.d.ts.map +1 -1
  15. package/dist/components/editors/BlockNoteEditorMentionHoverCard.d.ts.map +1 -1
  16. package/dist/components/editors/BlockNoteEditorMentionInlineContent.d.ts +2 -0
  17. package/dist/components/editors/BlockNoteEditorMentionInlineContent.d.ts.map +1 -1
  18. package/dist/components/editors/index.d.ts +1 -0
  19. package/dist/components/editors/index.d.ts.map +1 -1
  20. package/dist/components/index.js +4 -2
  21. package/dist/components/index.js.map +1 -1
  22. package/dist/components/index.mjs +3 -1
  23. package/dist/components/typography/DetailField.d.ts +3 -1
  24. package/dist/components/typography/DetailField.d.ts.map +1 -1
  25. package/dist/contexts/index.js +2 -2
  26. package/dist/contexts/index.mjs +1 -1
  27. package/dist/email-automations/index.js +78 -78
  28. package/dist/email-automations/index.mjs +1 -1
  29. package/dist/features/analytics/index.js +107 -107
  30. package/dist/features/analytics/index.mjs +1 -1
  31. package/dist/features/blog/index.js +93 -93
  32. package/dist/features/blog/index.mjs +1 -1
  33. package/dist/features/help/index.js +31 -31
  34. package/dist/features/help/index.mjs +1 -1
  35. package/dist/features/tokenusage/index.js +102 -102
  36. package/dist/features/tokenusage/index.mjs +1 -1
  37. package/package.json +1 -1
  38. package/src/components/containers/RoundPageContainer.tsx +21 -2
  39. package/src/components/containers/__tests__/RoundPageContainer.detailsSurface.spec.tsx +82 -0
  40. package/src/components/editors/BlockNoteEditorMentionHoverCard.tsx +8 -1
  41. package/src/components/editors/BlockNoteEditorMentionInlineContent.tsx +3 -1
  42. package/src/components/editors/__tests__/BlockNoteEditorMentionHoverCard.spec.tsx +42 -0
  43. package/src/components/editors/__tests__/BlockNoteEditorMentionInlineContent.spec.ts +30 -2
  44. package/src/components/editors/__tests__/blocknote-editor-options.spec.ts +8 -0
  45. package/src/components/editors/index.ts +1 -0
  46. package/src/components/typography/DetailField.tsx +4 -1
  47. package/src/components/typography/__tests__/DetailField.spec.tsx +13 -0
  48. package/dist/BlockNoteEditor-D2DXVXTJ.mjs.map +0 -1
  49. package/dist/BlockNoteEditor-NQB75M47.js.map +0 -1
  50. package/dist/chunk-HU3AGUFI.mjs.map +0 -1
  51. package/dist/chunk-YGV27OAW.js.map +0 -1
@@ -81,7 +81,7 @@ import {
81
81
  useCurrentUserContext,
82
82
  useDataListRetriever,
83
83
  usePageUrlGenerator
84
- } from "../chunk-HU3AGUFI.mjs";
84
+ } from "../chunk-UQFDOZVF.mjs";
85
85
  import "../chunk-5T2AQMQ2.mjs";
86
86
  import "../chunk-VOXD3ZLY.mjs";
87
87
  import {
@@ -9253,6 +9253,7 @@ function DetailField({
9253
9253
  value,
9254
9254
  horizontal = false,
9255
9255
  labelWidth,
9256
+ valueClassName,
9256
9257
  className,
9257
9258
  children,
9258
9259
  ...props
@@ -9265,7 +9266,7 @@ function DetailField({
9265
9266
  ...props,
9266
9267
  children: [
9267
9268
  /* @__PURE__ */ jsx75("span", { className: cn("text-muted-foreground text-xs", horizontal && labelWidth && cn("shrink-0", labelWidth)), children: label }),
9268
- /* @__PURE__ */ jsx75("div", { className: "text-sm", children: value ?? children })
9269
+ /* @__PURE__ */ jsx75("div", { className: cn("text-sm", valueClassName), children: value ?? children })
9269
9270
  ]
9270
9271
  }
9271
9272
  );
@@ -10875,7 +10876,7 @@ import { useRef as useRef18 } from "react";
10875
10876
  import dynamic from "next/dynamic";
10876
10877
  import React18 from "react";
10877
10878
  import { jsx as jsx91 } from "react/jsx-runtime";
10878
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-D2DXVXTJ.mjs"), {
10879
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-BHCNJ2JA.mjs"), {
10879
10880
  ssr: false
10880
10881
  });
10881
10882
  var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -16506,6 +16507,7 @@ function RoundPageContainer({
16506
16507
  defaultDetailsOpen = false,
16507
16508
  detailsTitle,
16508
16509
  detailsIcon,
16510
+ detailsSurface = "default",
16509
16511
  scroll = "fixed"
16510
16512
  }) {
16511
16513
  const t = useTranslations63();
@@ -16860,7 +16862,17 @@ function RoundPageContainer({
16860
16862
  className: "data-[side=left]:w-full data-[side=right]:w-full data-[side=left]:sm:max-w-none data-[side=right]:sm:max-w-none",
16861
16863
  children: [
16862
16864
  /* @__PURE__ */ jsx172(SheetHeader, { children: /* @__PURE__ */ jsx172(SheetTitle, { children: detailsTitle ?? t("ui.labels.details") }) }),
16863
- /* @__PURE__ */ jsx172("div", { className: "overflow-y-auto p-6 pt-0", children: details })
16865
+ /* @__PURE__ */ jsx172(
16866
+ "div",
16867
+ {
16868
+ "data-slot": "details-body",
16869
+ className: cn(
16870
+ "overflow-y-auto",
16871
+ detailsSurface === "muted" ? "bg-muted dark:bg-background p-3" : "p-6 pt-0"
16872
+ ),
16873
+ children: details
16874
+ }
16875
+ )
16864
16876
  ]
16865
16877
  }
16866
16878
  ) }) : /* @__PURE__ */ jsxs96(
@@ -16892,7 +16904,17 @@ function RoundPageContainer({
16892
16904
  // inside the measured row instead leaves this header 1px short of
16893
16905
  // the page title bar, since `box-sizing: border-box` absorbs it.
16894
16906
  /* @__PURE__ */ jsx172("div", { className: "shrink-0 border-b", children: /* @__PURE__ */ jsx172("div", { className: cn("flex items-center p-4", HEADER_ROW_MIN_H), children: /* @__PURE__ */ jsx172("span", { className: "text-primary truncate text-sm font-semibold", children: detailsTitle }) }) }),
16895
- /* @__PURE__ */ jsx172("div", { className: "min-h-0 flex-1 overflow-y-auto p-4", children: details })
16907
+ /* @__PURE__ */ jsx172(
16908
+ "div",
16909
+ {
16910
+ "data-slot": "details-body",
16911
+ className: cn(
16912
+ "min-h-0 flex-1 overflow-y-auto",
16913
+ detailsSurface === "muted" ? "bg-muted dark:bg-background p-3" : "p-4"
16914
+ ),
16915
+ children: details
16916
+ }
16917
+ )
16896
16918
  ]
16897
16919
  }
16898
16920
  ))
@@ -17033,9 +17055,10 @@ function BlockNoteEditorMentionHoverCard({
17033
17055
  top: rect.bottom + 4,
17034
17056
  // rtl-ok: viewport-anchored floating position
17035
17057
  left: rect.left,
17036
- zIndex: 50
17058
+ zIndex: 50,
17059
+ ...resolved.hoverFrameless ? { maxHeight: Math.max(240, window.innerHeight - rect.bottom - 12), overflowY: "auto" } : {}
17037
17060
  },
17038
- className: "bg-popover text-popover-foreground rounded-lg border p-2.5 text-xs shadow-md animate-in fade-in-0 zoom-in-95 duration-100",
17061
+ className: resolved.hoverFrameless ? "animate-in fade-in-0 zoom-in-95 duration-100" : "bg-popover text-popover-foreground rounded-lg border p-2.5 text-xs shadow-md animate-in fade-in-0 zoom-in-95 duration-100",
17039
17062
  children: /* @__PURE__ */ jsx175(ContentComponent, { id: hovered.id, entityType: hovered.entityType, alias: hovered.alias })
17040
17063
  }
17041
17064
  ),
@@ -17073,7 +17096,7 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
17073
17096
  const displayName = nameResolver?.(props.id, props.entityType, props.alias) ?? props.alias;
17074
17097
  if (disableMention) {
17075
17098
  const resolved2 = resolveFn?.(props.id, props.entityType, displayName);
17076
- return /* @__PURE__ */ jsxs99(Link3, { href: resolved2?.url ?? "#", className: "text-primary", children: [
17099
+ return /* @__PURE__ */ jsxs99(Link3, { href: resolved2?.url ?? "#", className: "text-primary", "data-mention-link": "", children: [
17077
17100
  "@",
17078
17101
  displayName
17079
17102
  ] });
@@ -17227,6 +17250,62 @@ function BlockNoteEditorMentionSuggestionMenu({
17227
17250
  }
17228
17251
  __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMenu");
17229
17252
 
17253
+ // src/components/editors/blockNoteEditorOptions.ts
17254
+ import * as coreLocales from "@blocknote/core/locales";
17255
+ import { withCollaboration } from "@blocknote/core/yjs";
17256
+ function buildBlockNoteEditorOptions(params) {
17257
+ const { aiExtension, coreDictionary, aiDictionary, collaboration } = params;
17258
+ const options = {
17259
+ placeholders: {
17260
+ emptyDocument: params.placeholder
17261
+ },
17262
+ schema: params.schema,
17263
+ uploadFile: params.disableUploads ? void 0 : params.uploadFile,
17264
+ extensions: aiExtension ? [aiExtension] : void 0,
17265
+ dictionary: aiExtension ? { ...coreDictionary, ai: aiDictionary } : coreDictionary === coreLocales.en ? void 0 : coreDictionary
17266
+ };
17267
+ if (collaboration) return withCollaboration({ ...options, collaboration });
17268
+ return { ...options, initialContent: params.initialContent };
17269
+ }
17270
+ __name(buildBlockNoteEditorOptions, "buildBlockNoteEditorOptions");
17271
+ function resolveEditable(params) {
17272
+ return params.editable !== void 0 ? params.editable : params.onChange !== void 0;
17273
+ }
17274
+ __name(resolveEditable, "resolveEditable");
17275
+ function isBlockEmpty(block) {
17276
+ if (!block || typeof block !== "object") return true;
17277
+ if (block.type !== "paragraph") return false;
17278
+ if (Array.isArray(block.children) && block.children.length > 0 && !isDocumentEmpty(block.children)) {
17279
+ return false;
17280
+ }
17281
+ if (Array.isArray(block.content)) {
17282
+ for (const inline of block.content) {
17283
+ if (typeof inline === "string") {
17284
+ if (inline.trim()) return false;
17285
+ } else if (inline && typeof inline === "object") {
17286
+ if (inline.type !== "text") return false;
17287
+ if (typeof inline.text === "string" && inline.text.trim()) return false;
17288
+ }
17289
+ }
17290
+ } else if (typeof block.content === "string" && block.content.trim()) {
17291
+ return false;
17292
+ }
17293
+ return true;
17294
+ }
17295
+ __name(isBlockEmpty, "isBlockEmpty");
17296
+ function isDocumentEmpty(blocks) {
17297
+ if (!Array.isArray(blocks) || blocks.length === 0) return true;
17298
+ return blocks.every(isBlockEmpty);
17299
+ }
17300
+ __name(isDocumentEmpty, "isDocumentEmpty");
17301
+ function removeTrailingEmptyBlocks(blocks) {
17302
+ if (!blocks || blocks.length === 0) return blocks;
17303
+ const result = [...blocks];
17304
+ while (result.length > 1 && isBlockEmpty(result[result.length - 1])) result.pop();
17305
+ return result;
17306
+ }
17307
+ __name(removeTrailingEmptyBlocks, "removeTrailingEmptyBlocks");
17308
+
17230
17309
  // src/components/viewers/BlockNoteViewerContainer.tsx
17231
17310
  import dynamic2 from "next/dynamic";
17232
17311
  import React29 from "react";
@@ -30693,6 +30772,10 @@ export {
30693
30772
  UsersListByContentIds,
30694
30773
  AllowedUsersDetails,
30695
30774
  ErrorDetails,
30775
+ buildBlockNoteEditorOptions,
30776
+ resolveEditable,
30777
+ isDocumentEmpty,
30778
+ removeTrailingEmptyBlocks,
30696
30779
  BlockNoteEditorMentionHoverCard,
30697
30780
  mentionDataAttrs,
30698
30781
  parseMentionElement,
@@ -30979,4 +31062,4 @@ export {
30979
31062
  useOAuthClients,
30980
31063
  useOAuthClient
30981
31064
  };
30982
- //# sourceMappingURL=chunk-HU3AGUFI.mjs.map
31065
+ //# sourceMappingURL=chunk-UQFDOZVF.mjs.map