@carlonicora/nextjs-jsonapi 1.13.0 → 1.15.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 (65) hide show
  1. package/dist/{ApiResponseInterface-DMwITHYP.d.mts → ApiResponseInterface-B4QdWh-y.d.mts} +1 -1
  2. package/dist/{ApiResponseInterface-DWgIAXI-.d.ts → ApiResponseInterface-QLDnxLA9.d.ts} +1 -1
  3. package/dist/{BlockNoteEditor-SOXPYXYV.js → BlockNoteEditor-FGXYUAWI.js} +13 -13
  4. package/dist/{BlockNoteEditor-SOXPYXYV.js.map → BlockNoteEditor-FGXYUAWI.js.map} +1 -1
  5. package/dist/{BlockNoteEditor-E54Q6MNP.mjs → BlockNoteEditor-ITJLAOXC.mjs} +3 -3
  6. package/dist/{chunk-VFSRIKWY.js → chunk-C6QXZGL7.js} +100 -45
  7. package/dist/chunk-C6QXZGL7.js.map +1 -0
  8. package/dist/{chunk-4EQEWIAE.mjs → chunk-JGVXZS7M.mjs} +65 -10
  9. package/dist/chunk-JGVXZS7M.mjs.map +1 -0
  10. package/dist/{chunk-YQFUWWNJ.js → chunk-PK5DRSUD.js} +380 -366
  11. package/dist/chunk-PK5DRSUD.js.map +1 -0
  12. package/dist/{chunk-OLRRVGHQ.mjs → chunk-WAFOKMKT.mjs} +20 -6
  13. package/dist/chunk-WAFOKMKT.mjs.map +1 -0
  14. package/dist/client/index.d.mts +5 -5
  15. package/dist/client/index.d.ts +5 -5
  16. package/dist/client/index.js +3 -3
  17. package/dist/client/index.mjs +2 -2
  18. package/dist/components/index.d.mts +2 -2
  19. package/dist/components/index.d.ts +2 -2
  20. package/dist/components/index.js +3 -3
  21. package/dist/components/index.mjs +2 -2
  22. package/dist/{config-BdCV25CE.d.mts → config-C5tGGrYf.d.mts} +1 -1
  23. package/dist/{config-C9dt1QiR.d.ts → config-eceYM5kN.d.ts} +1 -1
  24. package/dist/{content.interface-B6qP_ABq.d.mts → content.interface-CxBBC7ec.d.mts} +1 -1
  25. package/dist/{content.interface-DHAFLasV.d.ts → content.interface-TB2MfJGs.d.ts} +1 -1
  26. package/dist/contexts/index.d.mts +2 -2
  27. package/dist/contexts/index.d.ts +2 -2
  28. package/dist/contexts/index.js +3 -3
  29. package/dist/contexts/index.mjs +2 -2
  30. package/dist/core/index.d.mts +17 -10
  31. package/dist/core/index.d.ts +17 -10
  32. package/dist/core/index.js +2 -2
  33. package/dist/core/index.mjs +1 -1
  34. package/dist/index.d.mts +5 -5
  35. package/dist/index.d.ts +5 -5
  36. package/dist/index.js +2 -2
  37. package/dist/index.mjs +1 -1
  38. package/dist/{notification.interface-agcMYCkg.d.mts → notification.interface-lG6UpTpt.d.mts} +2 -0
  39. package/dist/{notification.interface-agcMYCkg.d.ts → notification.interface-lG6UpTpt.d.ts} +2 -0
  40. package/dist/{s3.service-DYnmymEd.d.mts → s3.service-DP_hsssD.d.mts} +2 -2
  41. package/dist/{s3.service-DyXjKTqr.d.ts → s3.service-Dq-PTUNa.d.ts} +2 -2
  42. package/dist/scripts/generate-web-module/templates/data/interface.template.js +8 -1
  43. package/dist/scripts/generate-web-module/templates/data/interface.template.js.map +1 -1
  44. package/dist/scripts/generate-web-module/templates/data/model.template.js +26 -3
  45. package/dist/scripts/generate-web-module/templates/data/model.template.js.map +1 -1
  46. package/dist/server/index.d.mts +4 -4
  47. package/dist/server/index.d.ts +4 -4
  48. package/dist/server/index.js +3 -3
  49. package/dist/server/index.mjs +1 -1
  50. package/dist/{useSocket-91s8M4Xd.d.mts → useSocket-Bua6MwLi.d.mts} +1 -1
  51. package/dist/{useSocket-DSR7vaXj.d.ts → useSocket-D5dhUp4m.d.ts} +1 -1
  52. package/package.json +1 -1
  53. package/scripts/generate-web-module/templates/data/interface.template.ts +7 -1
  54. package/scripts/generate-web-module/templates/data/model.template.ts +28 -5
  55. package/src/core/abstracts/AbstractApiData.ts +79 -16
  56. package/src/features/company/components/forms/CompanyLicense.tsx +4 -4
  57. package/src/features/notification/components/modals/NotificationModal.tsx +13 -0
  58. package/src/features/notification/components/notifications/Notification.tsx +7 -0
  59. package/src/features/notification/data/notification.interface.ts +2 -0
  60. package/src/features/notification/data/notification.ts +12 -0
  61. package/dist/chunk-4EQEWIAE.mjs.map +0 -1
  62. package/dist/chunk-OLRRVGHQ.mjs.map +0 -1
  63. package/dist/chunk-VFSRIKWY.js.map +0 -1
  64. package/dist/chunk-YQFUWWNJ.js.map +0 -1
  65. /package/dist/{BlockNoteEditor-E54Q6MNP.mjs.map → BlockNoteEditor-ITJLAOXC.mjs.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { A as ApiDataInterface } from './notification.interface-agcMYCkg.mjs';
1
+ import { A as ApiDataInterface } from './notification.interface-lG6UpTpt.mjs';
2
2
 
3
3
  type ApiData = {
4
4
  data: any;
@@ -1,4 +1,4 @@
1
- import { A as ApiDataInterface } from './notification.interface-agcMYCkg.js';
1
+ import { A as ApiDataInterface } from './notification.interface-lG6UpTpt.js';
2
2
 
3
3
  type ApiData = {
4
4
  data: any;
@@ -3,14 +3,14 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkYQFUWWNJjs = require('./chunk-YQFUWWNJ.js');
6
+ var _chunkPK5DRSUDjs = require('./chunk-PK5DRSUD.js');
7
7
  require('./chunk-6YD42BP6.js');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
- var _chunkVFSRIKWYjs = require('./chunk-VFSRIKWY.js');
13
+ var _chunkC6QXZGL7js = require('./chunk-C6QXZGL7.js');
14
14
  require('./chunk-IBS6NI7D.js');
15
15
  require('./chunk-FPZPD4JI.js');
16
16
  require('./chunk-LXKSUWAV.js');
@@ -79,7 +79,7 @@ var createDiffActionsInlineContentSpec = /* @__PURE__ */ _chunk7QVYU63Ejs.__name
79
79
  const diffIds = props.inlineContent.props.diffIds;
80
80
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "diff-actions-container mx-2 inline-flex items-center gap-1 align-middle", children: [
81
81
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
82
- _chunkYQFUWWNJjs.Button,
82
+ _chunkPK5DRSUDjs.Button,
83
83
  {
84
84
  title: "Accept change",
85
85
  onClick: (e) => {
@@ -91,7 +91,7 @@ var createDiffActionsInlineContentSpec = /* @__PURE__ */ _chunk7QVYU63Ejs.__name
91
91
  }
92
92
  ),
93
93
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
94
- _chunkYQFUWWNJjs.Button,
94
+ _chunkPK5DRSUDjs.Button,
95
95
  {
96
96
  title: "Reject change",
97
97
  className: "mx-2 p-0",
@@ -121,7 +121,7 @@ function BlockNoteEditor({
121
121
  bordered
122
122
  }) {
123
123
  const t = _nextintl.useTranslations.call(void 0, );
124
- const { company } = _chunkYQFUWWNJjs.useCurrentUserContext.call(void 0, );
124
+ const { company } = _chunkPK5DRSUDjs.useCurrentUserContext.call(void 0, );
125
125
  const [acceptedChanges, setAcceptedChanges] = _react3.useState.call(void 0, /* @__PURE__ */ new Set());
126
126
  const [rejectedChanges, setRejectedChanges] = _react3.useState.call(void 0, /* @__PURE__ */ new Set());
127
127
  const editorRef = _react3.useRef.call(void 0, null);
@@ -157,7 +157,7 @@ function BlockNoteEditor({
157
157
  const uploadImage = _react3.useCallback.call(void 0,
158
158
  async (file) => {
159
159
  if (!company) {
160
- _chunkYQFUWWNJjs.errorToast.call(void 0, {
160
+ _chunkPK5DRSUDjs.errorToast.call(void 0, {
161
161
  title: t(`generic.errors.upload`),
162
162
  error: t(`generic.errors.upload_description`)
163
163
  });
@@ -165,7 +165,7 @@ function BlockNoteEditor({
165
165
  }
166
166
  const fileType = file.type;
167
167
  const key = `companies/${company.id}/${type}/${id}/${file.name}`;
168
- const s3 = await _chunkVFSRIKWYjs.S3Service.getPreSignedUrl({
168
+ const s3 = await _chunkC6QXZGL7js.S3Service.getPreSignedUrl({
169
169
  key,
170
170
  contentType: fileType,
171
171
  isPublic: true
@@ -175,7 +175,7 @@ function BlockNoteEditor({
175
175
  headers: s3.headers,
176
176
  body: file
177
177
  });
178
- const signedImage = await _chunkVFSRIKWYjs.S3Service.getSignedUrl({
178
+ const signedImage = await _chunkC6QXZGL7js.S3Service.getSignedUrl({
179
179
  key,
180
180
  isPublic: true
181
181
  });
@@ -204,8 +204,8 @@ function BlockNoteEditor({
204
204
  const processedContent = _react3.useMemo.call(void 0, () => {
205
205
  if (diffContent && initialContent) {
206
206
  try {
207
- const diffResult = _chunkVFSRIKWYjs.BlockNoteDiffUtil.diff(initialContent, diffContent);
208
- const renderedDiff = _chunkVFSRIKWYjs.BlockNoteWordDiffRendererUtil.renderWordDiffs(
207
+ const diffResult = _chunkC6QXZGL7js.BlockNoteDiffUtil.diff(initialContent, diffContent);
208
+ const renderedDiff = _chunkC6QXZGL7js.BlockNoteWordDiffRendererUtil.renderWordDiffs(
209
209
  diffResult.blocks,
210
210
  handleAcceptChange,
211
211
  handleRejectChange,
@@ -363,7 +363,7 @@ function BlockNoteEditor({
363
363
  },
364
364
  [editor]
365
365
  );
366
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: editorRef, className: _chunkVFSRIKWYjs.cn.call(void 0, bordered ? "rounded-md border" : "", "w-full"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
366
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: editorRef, className: _chunkC6QXZGL7js.cn.call(void 0, bordered ? "rounded-md border" : "", "w-full"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
367
367
  _shadcn.BlockNoteView,
368
368
  {
369
369
  editor,
@@ -371,7 +371,7 @@ function BlockNoteEditor({
371
371
  editable: onChange !== void 0,
372
372
  formattingToolbar: false,
373
373
  theme: "light",
374
- className: _chunkVFSRIKWYjs.cn.call(void 0, `BlockNoteView ${onChange ? "min-h-96 p-4" : ""}`, className, size === "sm" && "small"),
374
+ className: _chunkC6QXZGL7js.cn.call(void 0, `BlockNoteView ${onChange ? "min-h-96 p-4" : ""}`, className, size === "sm" && "small"),
375
375
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlockNoteEditorFormattingToolbar, {})
376
376
  }
377
377
  ) });
@@ -380,4 +380,4 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlockNoteEditor, "BlockNoteEditor");
380
380
 
381
381
 
382
382
  exports.default = BlockNoteEditor;
383
- //# sourceMappingURL=BlockNoteEditor-SOXPYXYV.js.map
383
+ //# sourceMappingURL=BlockNoteEditor-FGXYUAWI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/BlockNoteEditor-SOXPYXYV.js","../src/components/editors/BlockNoteEditor.tsx","../src/components/editors/BlockNoteEditorFormattingToolbar.tsx"],"names":["jsxs","jsx"],"mappings":"AAAA,ylBAAY;AACZ;AACE;AACA;AACA;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;AClBA,uCAAyE;AACzE,yCAAiE;AACjE,2CAA8B;AAC9B,uCAAO;AACP,2CAAiC;AACjC,qCAAgC;AAChC,+BAAyE;ADoBzE;AACA;AE3BA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAOM,+CAAA;AAJD,SAAS,gCAAA,CAAA,EAAmC;AACjD,EAAA,uBACE,6BAAA;AAAA,IAAC,kCAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,CAAA,EAAA,mBACjB,8BAAA,wBAAC,EAAA,EACC,QAAA,EAAA;AAAA,wBAAA,6BAAA,sBAAC,EAAA,CAAA,CAAA,EAAqB,iBAAmB,CAAA;AAAA,wBAEzC,6BAAA,wBAAC,EAAA,CAAA,CAAA,EAAuB,mBAAqB,CAAA;AAAA,wBAC7C,6BAAA,wBAAC,EAAA,CAAA,CAAA,EAAuB,mBAAqB,CAAA;AAA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runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/BlockNoteEditor-SOXPYXYV.js","sourcesContent":[null,"\"use client\";\n\nimport { BlockNoteSchema, defaultInlineContentSpecs, PartialBlock } from \"@blocknote/core\";\nimport { createReactInlineContentSpec, useCreateBlockNote } from \"@blocknote/react\";\nimport { BlockNoteView } from \"@blocknote/shadcn\";\nimport \"@blocknote/shadcn/style.css\";\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useCurrentUserContext } from \"../../contexts\";\nimport { S3Interface } from \"../../features/s3/data\";\nimport { UserInterface } from \"../../features/user/data\";\nimport { S3Service } from \"../../features/s3/data/s3.service\";\nimport { Button } from \"../../shadcnui\";\nimport { BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, cn } from \"../../utils\";\nimport { errorToast } from \"../errors\";\nimport { BlockNoteEditorFormattingToolbar } from \"./BlockNoteEditorFormattingToolbar\";\n\nexport type BlockNoteEditorProps = {\n id: string;\n type: string;\n initialContent?: PartialBlock[];\n onChange?: (content: any, isEmpty: boolean, hasUnresolvedDiff: boolean) => void;\n size?: \"sm\" | \"md\";\n className?: string;\n markdownContent?: string;\n diffContent?: PartialBlock[];\n placeholder?: string;\n bordered?: boolean;\n};\n\nconst createDiffActionsInlineContentSpec = (\n handleAcceptChange: (diffId: string) => void,\n handleRejectChange: (diffId: string) => void,\n) => {\n return createReactInlineContentSpec(\n {\n type: \"diffActions\",\n propSchema: {\n diffIds: {\n default: \"\",\n },\n },\n content: \"none\",\n },\n {\n render: (props) => {\n const diffIds = props.inlineContent.props.diffIds;\n\n return (\n <span className=\"diff-actions-container mx-2 inline-flex items-center gap-1 align-middle\">\n <Button\n title=\"Accept change\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n diffIds.split(\",\").forEach((id: string) => handleAcceptChange(id.trim()));\n }}\n >\n <CheckIcon className=\"h-3 w-3 text-green-600\" />\n </Button>\n <Button\n title=\"Reject change\"\n className=\"mx-2 p-0\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n diffIds.split(\",\").forEach((id: string) => handleRejectChange(id.trim()));\n }}\n >\n <XIcon className=\"h-3 w-3 text-red-600\" />\n </Button>\n </span>\n );\n },\n },\n );\n};\n\nexport default function BlockNoteEditor({\n id,\n type,\n initialContent,\n onChange,\n size,\n className,\n markdownContent,\n diffContent,\n placeholder,\n bordered,\n}: BlockNoteEditorProps): React.JSX.Element {\n const t = useTranslations();\n const { company } = useCurrentUserContext<UserInterface>();\n\n const [acceptedChanges, setAcceptedChanges] = useState<Set<string>>(new Set());\n const [rejectedChanges, setRejectedChanges] = useState<Set<string>>(new Set());\n\n const editorRef = useRef<HTMLDivElement>(null);\n\n const handleAcceptChange = useCallback((diffId: string) => {\n setAcceptedChanges((prev) => new Set([...prev, diffId]));\n setRejectedChanges((prev) => {\n const newSet = new Set(prev);\n newSet.delete(diffId);\n return newSet;\n });\n }, []);\n\n const handleRejectChange = useCallback((diffId: string) => {\n setRejectedChanges((prev) => new Set([...prev, diffId]));\n setAcceptedChanges((prev) => {\n const newSet = new Set(prev);\n newSet.delete(diffId);\n return newSet;\n });\n }, []);\n\n const DiffActionsInlineContent = useMemo(\n () => createDiffActionsInlineContentSpec(handleAcceptChange, handleRejectChange),\n [handleAcceptChange, handleRejectChange],\n );\n\n const schema = useMemo(\n () =>\n BlockNoteSchema.create({\n inlineContentSpecs: {\n ...defaultInlineContentSpecs,\n diffActions: DiffActionsInlineContent,\n },\n } as any),\n [DiffActionsInlineContent],\n );\n\n const uploadImage = useCallback(\n async (file: File): Promise<string> => {\n if (!company) {\n errorToast({\n title: t(`generic.errors.upload`),\n error: t(`generic.errors.upload_description`),\n });\n throw new Error(t(`generic.errors.upload`));\n }\n\n const fileType = file.type;\n const key = `companies/${company.id}/${type}/${id}/${file.name}`;\n\n const s3: S3Interface = await S3Service.getPreSignedUrl({\n key: key,\n contentType: fileType,\n isPublic: true,\n });\n\n await fetch(s3.url, {\n method: \"PUT\",\n headers: s3.headers,\n body: file,\n });\n\n const signedImage: S3Interface = await S3Service.getSignedUrl({\n key: key,\n isPublic: true,\n });\n\n return signedImage.url;\n },\n [company, id, t],\n );\n\n // Utility: Remove trailing empty blocks for read-only display\n const removeTrailingEmptyBlocks = useCallback(\n (blocks: PartialBlock[]): PartialBlock[] => {\n if (!blocks || blocks.length === 0) return blocks;\n\n // Only remove trailing empty blocks in read-only mode\n if (onChange !== undefined) return blocks;\n\n const result = [...blocks];\n\n // Remove trailing empty paragraph blocks, but keep at least one block\n while (result.length > 1) {\n const lastBlock = result[result.length - 1];\n\n // Check if it's an empty paragraph\n const isEmptyParagraph =\n lastBlock.type === \"paragraph\" &&\n (!lastBlock.content ||\n lastBlock.content.length === 0 ||\n (Array.isArray(lastBlock.content) && lastBlock.content.every((c: any) => !c.text || c.text.trim() === \"\")));\n\n if (isEmptyParagraph) {\n result.pop();\n } else {\n break;\n }\n }\n\n return result;\n },\n [onChange],\n );\n\n const processedContent = useMemo(() => {\n if (diffContent && initialContent) {\n try {\n const diffResult = BlockNoteDiffUtil.diff(initialContent, diffContent);\n const renderedDiff = BlockNoteWordDiffRendererUtil.renderWordDiffs(\n diffResult.blocks,\n handleAcceptChange,\n handleRejectChange,\n acceptedChanges,\n rejectedChanges,\n );\n return removeTrailingEmptyBlocks(renderedDiff);\n } catch (error) {\n return initialContent && Array.isArray(initialContent) && initialContent.length > 0\n ? removeTrailingEmptyBlocks(initialContent)\n : [];\n }\n }\n\n if (!initialContent) {\n return [];\n }\n\n if (!Array.isArray(initialContent)) {\n return [];\n }\n\n return initialContent.length > 0 ? removeTrailingEmptyBlocks(initialContent) : [];\n }, [\n initialContent,\n diffContent,\n handleAcceptChange,\n handleRejectChange,\n acceptedChanges,\n rejectedChanges,\n removeTrailingEmptyBlocks,\n ]);\n\n const validatedInitialContent = useMemo(() => {\n if (processedContent && Array.isArray(processedContent) && processedContent.length > 0) {\n const validatedContent = processedContent.filter((block) => {\n if (!block || typeof block !== \"object\") return false;\n if (!(block as any).type) return false;\n return true;\n });\n return validatedContent.length > 0 ? (validatedContent as PartialBlock[]) : undefined;\n }\n return undefined;\n }, [processedContent]);\n\n const editor = useCreateBlockNote(\n useMemo(\n () => ({\n placeholders: {\n emptyDocument: placeholder || t(`generic.blocknote.placeholder`),\n },\n schema,\n initialContent: validatedInitialContent,\n uploadFile: uploadImage,\n }),\n [placeholder, t, schema, validatedInitialContent, uploadImage],\n ),\n );\n\n const handleChange = useCallback(async () => {\n if (!onChange) return;\n const newBlocks = editor.document;\n\n const markdownFromBlocks = (await editor.blocksToMarkdownLossy(editor.document)).trim();\n\n function hasUnresolvedDiffsRecursive(block: any): boolean {\n if (!block || typeof block !== \"object\") return false;\n let diffId = undefined;\n if (block.props && block.props.diffId) diffId = block.props.diffId;\n if (!diffId && block.attrs && block.attrs.diffId) diffId = block.attrs.diffId;\n if (diffId && !acceptedChanges.has(diffId) && !rejectedChanges.has(diffId)) {\n return true;\n }\n\n if (block.content) {\n const contentArr = Array.isArray(block.content) ? block.content : [block.content];\n for (const inline of contentArr) {\n if (inline && typeof inline === \"object\") {\n if (inline.type === \"diffActions\" && inline.props && inline.props.diffIds) {\n const ids =\n typeof inline.props.diffIds === \"string\" ? inline.props.diffIds.split(\",\") : inline.props.diffIds;\n for (const id of ids) {\n const trimmed = (id || \"\").toString().trim();\n if (trimmed && !acceptedChanges.has(trimmed) && !rejectedChanges.has(trimmed)) {\n return true;\n }\n }\n }\n if (inline.props && inline.props.diffId) {\n const diffIdInline = inline.props.diffId;\n if (diffIdInline && !acceptedChanges.has(diffIdInline) && !rejectedChanges.has(diffIdInline)) {\n return true;\n }\n }\n if (inline.children && Array.isArray(inline.children)) {\n for (const child of inline.children) {\n if (hasUnresolvedDiffsRecursive(child)) return true;\n }\n }\n }\n }\n }\n if (Array.isArray(block.children)) {\n for (const child of block.children) {\n if (hasUnresolvedDiffsRecursive(child)) return true;\n }\n }\n return false;\n }\n\n let hasUnresolvedDiff = false;\n if (Array.isArray(newBlocks)) {\n hasUnresolvedDiff = newBlocks.some((block: any) => hasUnresolvedDiffsRecursive(block));\n }\n\n onChange(newBlocks, !markdownFromBlocks.length, hasUnresolvedDiff);\n }, [editor, onChange, id, acceptedChanges, rejectedChanges]);\n\n // Utility: deep equality for arrays of blocks\n const areBlocksEqual = (a: any[], b: any[]): boolean => {\n return JSON.stringify(a) === JSON.stringify(b);\n };\n\n // Only initialize from markdownContent once per value, and only if different\n const hasInitializedFromMarkdown = useRef<string | null>(null);\n useEffect(() => {\n const updateContent = async (markdown: string) => {\n const blocks = await editor.tryParseMarkdownToBlocks(markdown);\n if (!areBlocksEqual(blocks, editor.document)) {\n editor.replaceBlocks(editor.document, blocks);\n }\n };\n\n if (markdownContent && hasInitializedFromMarkdown.current !== markdownContent) {\n hasInitializedFromMarkdown.current = markdownContent;\n updateContent(markdownContent).then(() => handleChange());\n }\n }, [markdownContent, editor]);\n\n // Update editor content when diff content changes, but only if different\n // Prevent unnecessary replaceBlocks calls that reset scroll/cursor.\n const previousContentHashRef = useRef<string | null>(null);\n useEffect(() => {\n if (!processedContent || !editor) return;\n const hash = JSON.stringify(processedContent);\n if (previousContentHashRef.current === hash) return; // no changes\n const currentHash = JSON.stringify(editor.document);\n if (currentHash === hash) {\n previousContentHashRef.current = hash;\n return; // already in sync\n }\n editor.replaceBlocks(editor.document, processedContent as PartialBlock[]);\n previousContentHashRef.current = hash;\n }, [processedContent, editor]);\n\n // Handle audio received from whisper transcription\n const handleAudioReceived = useCallback(\n (message: string) => {\n try {\n // Ensure the editor has focus\n const editorElement = editorRef.current?.querySelector('[contenteditable=\"true\"]') as HTMLElement;\n if (editorElement && document.activeElement !== editorElement) {\n editorElement.focus();\n }\n\n // Insert the transcribed text at the current cursor position\n editor.insertInlineContent(message);\n } catch (error) {\n console.error(\"Error inserting transcribed text:\", error);\n // Fallback: try to insert at the end of the document\n try {\n const blocks = editor.document;\n if (blocks.length > 0) {\n const lastBlock = blocks[blocks.length - 1];\n editor.setTextCursorPosition(lastBlock.id, \"end\");\n editor.insertInlineContent(message);\n }\n } catch (fallbackError) {\n console.error(\"Fallback insertion also failed:\", fallbackError);\n }\n }\n },\n [editor],\n );\n\n return (\n <div ref={editorRef} className={cn(bordered ? \"rounded-md border\" : \"\", \"w-full\")}>\n <BlockNoteView\n editor={editor}\n onChange={handleChange}\n editable={onChange !== undefined}\n formattingToolbar={false}\n theme=\"light\"\n className={cn(`BlockNoteView ${onChange ? \"min-h-96 p-4\" : \"\"}`, className, size === \"sm\" && \"small\")}\n >\n <BlockNoteEditorFormattingToolbar />\n </BlockNoteView>\n </div>\n );\n}\n","\"use client\";\n\nimport {\n BasicTextStyleButton,\n BlockTypeSelect,\n CreateLinkButton,\n FileCaptionButton,\n FileReplaceButton,\n FormattingToolbar,\n FormattingToolbarController,\n TextAlignButton,\n} from \"@blocknote/react\";\n\nexport function BlockNoteEditorFormattingToolbar() {\n return (\n <FormattingToolbarController\n formattingToolbar={() => (\n <FormattingToolbar>\n <BlockTypeSelect key={\"blockTypeSelect\"} />\n\n <FileCaptionButton key={\"fileCaptionButton\"} />\n <FileReplaceButton key={\"replaceFileButton\"} />\n\n <BasicTextStyleButton basicTextStyle={\"bold\"} key={\"boldStyleButton\"} />\n <BasicTextStyleButton basicTextStyle={\"italic\"} key={\"italicStyleButton\"} />\n <BasicTextStyleButton basicTextStyle={\"underline\"} key={\"underlineStyleButton\"} />\n <BasicTextStyleButton basicTextStyle={\"strike\"} key={\"strikeStyleButton\"} />\n\n <TextAlignButton textAlignment={\"left\"} key={\"textAlignLeftButton\"} />\n <TextAlignButton textAlignment={\"center\"} key={\"textAlignCenterButton\"} />\n <TextAlignButton textAlignment={\"right\"} key={\"textAlignRightButton\"} />\n\n <CreateLinkButton key={\"createLinkButton\"} />\n </FormattingToolbar>\n )}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/BlockNoteEditor-FGXYUAWI.js","../src/components/editors/BlockNoteEditor.tsx","../src/components/editors/BlockNoteEditorFormattingToolbar.tsx"],"names":["jsxs","jsx"],"mappings":"AAAA,ylBAAY;AACZ;AACE;AACA;AACA;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;AClBA,uCAAyE;AACzE,yCAAiE;AACjE,2CAA8B;AAC9B,uCAAO;AACP,2CAAiC;AACjC,qCAAgC;AAChC,+BAAyE;ADoBzE;AACA;AE3BA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAOM,+CAAA;AAJD,SAAS,gCAAA,CAAA,EAAmC;AACjD,EAAA,uBACE,6BAAA;AAAA,IAAC,kCAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,CAAA,EAAA,mBACjB,8BAAA,wBAAC,EAAA,EACC,QAAA,EAAA;AAAA,wBAAA,6BAAA,sBAAC,EAAA,CAAA,CAAA,EAAqB,iBAAmB,CAAA;AAAA,wBAEzC,6BAAA,wBAAC,EAAA,CAAA,CAAA,EAAuB,mBAAqB,CAAA;AAAA,wBAC7C,6BAAA,wBAAC,EAAA,CAAA,CAAA,EAAuB,mBAAqB,CAAA;AAAA,wBAE7C,6BAAA,2BAAC,EAAA,EAAqB,cAAA,EAAgB,OAAA,CAAA,EAAa,iBAAmB,CAAA;AAAA,wBACtE,6BAAA,2BAAC,EAAA,EAAqB,cAAA,EAAgB,SAAA,CAAA,EAAe,mBAAqB,CAAA;AAAA,wBAC1E,6BAAA,2BAAC,EAAA,EAAqB,cAAA,EAAgB,YAAA,CAAA,EAAkB,sBAAwB,CAAA;AAAA,wBAChF,6BAAA,2BAAC,EAAA,EAAqB,cAAA,EAAgB,SAAA,CAAA,EAAe,mBAAqB,CAAA;AAAA,wBAE1E,6BAAA,sB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uB,MAAA;AACrD,IAAA;AAEiE,IAAA;AACR,EAAA;AAGH,EAAA;AACT,IAAA;AADxB,EAAA;AAKsC,EAAA;AAC7C,EAAA;AACoC,IAAA;AACa,MAAA;AACf,MAAA;AACA,QAAA;AAC9C,MAAA;AAJoB,IAAA;AAOwC,IAAA;AACvB,MAAA;AACmB,MAAA;AAC1D,IAAA;AAC0B,EAAA;AAI6B,EAAA;AACzC,EAAA;AACoB,IAAA;AACU,IAAA;AACC,IAAA;AACK,IAAA;AACxB,IAAA;AACS,MAAA;AACjC,MAAA;AACF,IAAA;AACwE,IAAA;AACvC,IAAA;AACN,EAAA;AAGD,EAAA;AACL,IAAA;AACf,MAAA;AAEqD,QAAA;AACP,QAAA;AAC1B,UAAA;AACtB,QAAA;AAGkC,QAAA;AACpB,MAAA;AAC0C,QAAA;AAEpD,QAAA;AACoB,UAAA;AACC,UAAA;AACqB,YAAA;AACM,YAAA;AACd,YAAA;AACpC,UAAA;AACsB,QAAA;AAC2B,UAAA;AACnD,QAAA;AACF,MAAA;AACF,IAAA;AACO,IAAA;AACT,EAAA;AAGqC,EAAA;AAChC,IAAA;AAAA,IAAA;AACC,MAAA;AACU,MAAA;AACa,MAAA;AACJ,MAAA;AACb,MAAA;AACuD,MAAA;AAE5D,MAAA;AAAiC,IAAA;AAEtC,EAAA;AAEJ;AAtUwB;AD4S6C;AACA;AACA","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/BlockNoteEditor-FGXYUAWI.js","sourcesContent":[null,"\"use client\";\n\nimport { BlockNoteSchema, defaultInlineContentSpecs, PartialBlock } from \"@blocknote/core\";\nimport { createReactInlineContentSpec, useCreateBlockNote } from \"@blocknote/react\";\nimport { BlockNoteView } from \"@blocknote/shadcn\";\nimport \"@blocknote/shadcn/style.css\";\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useCurrentUserContext } from \"../../contexts\";\nimport { S3Interface } from \"../../features/s3/data\";\nimport { UserInterface } from \"../../features/user/data\";\nimport { S3Service } from \"../../features/s3/data/s3.service\";\nimport { Button } from \"../../shadcnui\";\nimport { BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, cn } from \"../../utils\";\nimport { errorToast } from \"../errors\";\nimport { BlockNoteEditorFormattingToolbar } from \"./BlockNoteEditorFormattingToolbar\";\n\nexport type BlockNoteEditorProps = {\n id: string;\n type: string;\n initialContent?: PartialBlock[];\n onChange?: (content: any, isEmpty: boolean, hasUnresolvedDiff: boolean) => void;\n size?: \"sm\" | \"md\";\n className?: string;\n markdownContent?: string;\n diffContent?: PartialBlock[];\n placeholder?: string;\n bordered?: boolean;\n};\n\nconst createDiffActionsInlineContentSpec = (\n handleAcceptChange: (diffId: string) => void,\n handleRejectChange: (diffId: string) => void,\n) => {\n return createReactInlineContentSpec(\n {\n type: \"diffActions\",\n propSchema: {\n diffIds: {\n default: \"\",\n },\n },\n content: \"none\",\n },\n {\n render: (props) => {\n const diffIds = props.inlineContent.props.diffIds;\n\n return (\n <span className=\"diff-actions-container mx-2 inline-flex items-center gap-1 align-middle\">\n <Button\n title=\"Accept change\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n diffIds.split(\",\").forEach((id: string) => handleAcceptChange(id.trim()));\n }}\n >\n <CheckIcon className=\"h-3 w-3 text-green-600\" />\n </Button>\n <Button\n title=\"Reject change\"\n className=\"mx-2 p-0\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n diffIds.split(\",\").forEach((id: string) => handleRejectChange(id.trim()));\n }}\n >\n <XIcon className=\"h-3 w-3 text-red-600\" />\n </Button>\n </span>\n );\n },\n },\n );\n};\n\nexport default function BlockNoteEditor({\n id,\n type,\n initialContent,\n onChange,\n size,\n className,\n markdownContent,\n diffContent,\n placeholder,\n bordered,\n}: BlockNoteEditorProps): React.JSX.Element {\n const t = useTranslations();\n const { company } = useCurrentUserContext<UserInterface>();\n\n const [acceptedChanges, setAcceptedChanges] = useState<Set<string>>(new Set());\n const [rejectedChanges, setRejectedChanges] = useState<Set<string>>(new Set());\n\n const editorRef = useRef<HTMLDivElement>(null);\n\n const handleAcceptChange = useCallback((diffId: string) => {\n setAcceptedChanges((prev) => new Set([...prev, diffId]));\n setRejectedChanges((prev) => {\n const newSet = new Set(prev);\n newSet.delete(diffId);\n return newSet;\n });\n }, []);\n\n const handleRejectChange = useCallback((diffId: string) => {\n setRejectedChanges((prev) => new Set([...prev, diffId]));\n setAcceptedChanges((prev) => {\n const newSet = new Set(prev);\n newSet.delete(diffId);\n return newSet;\n });\n }, []);\n\n const DiffActionsInlineContent = useMemo(\n () => createDiffActionsInlineContentSpec(handleAcceptChange, handleRejectChange),\n [handleAcceptChange, handleRejectChange],\n );\n\n const schema = useMemo(\n () =>\n BlockNoteSchema.create({\n inlineContentSpecs: {\n ...defaultInlineContentSpecs,\n diffActions: DiffActionsInlineContent,\n },\n } as any),\n [DiffActionsInlineContent],\n );\n\n const uploadImage = useCallback(\n async (file: File): Promise<string> => {\n if (!company) {\n errorToast({\n title: t(`generic.errors.upload`),\n error: t(`generic.errors.upload_description`),\n });\n throw new Error(t(`generic.errors.upload`));\n }\n\n const fileType = file.type;\n const key = `companies/${company.id}/${type}/${id}/${file.name}`;\n\n const s3: S3Interface = await S3Service.getPreSignedUrl({\n key: key,\n contentType: fileType,\n isPublic: true,\n });\n\n await fetch(s3.url, {\n method: \"PUT\",\n headers: s3.headers,\n body: file,\n });\n\n const signedImage: S3Interface = await S3Service.getSignedUrl({\n key: key,\n isPublic: true,\n });\n\n return signedImage.url;\n },\n [company, id, t],\n );\n\n // Utility: Remove trailing empty blocks for read-only display\n const removeTrailingEmptyBlocks = useCallback(\n (blocks: PartialBlock[]): PartialBlock[] => {\n if (!blocks || blocks.length === 0) return blocks;\n\n // Only remove trailing empty blocks in read-only mode\n if (onChange !== undefined) return blocks;\n\n const result = [...blocks];\n\n // Remove trailing empty paragraph blocks, but keep at least one block\n while (result.length > 1) {\n const lastBlock = result[result.length - 1];\n\n // Check if it's an empty paragraph\n const isEmptyParagraph =\n lastBlock.type === \"paragraph\" &&\n (!lastBlock.content ||\n lastBlock.content.length === 0 ||\n (Array.isArray(lastBlock.content) && lastBlock.content.every((c: any) => !c.text || c.text.trim() === \"\")));\n\n if (isEmptyParagraph) {\n result.pop();\n } else {\n break;\n }\n }\n\n return result;\n },\n [onChange],\n );\n\n const processedContent = useMemo(() => {\n if (diffContent && initialContent) {\n try {\n const diffResult = BlockNoteDiffUtil.diff(initialContent, diffContent);\n const renderedDiff = BlockNoteWordDiffRendererUtil.renderWordDiffs(\n diffResult.blocks,\n handleAcceptChange,\n handleRejectChange,\n acceptedChanges,\n rejectedChanges,\n );\n return removeTrailingEmptyBlocks(renderedDiff);\n } catch (error) {\n return initialContent && Array.isArray(initialContent) && initialContent.length > 0\n ? removeTrailingEmptyBlocks(initialContent)\n : [];\n }\n }\n\n if (!initialContent) {\n return [];\n }\n\n if (!Array.isArray(initialContent)) {\n return [];\n }\n\n return initialContent.length > 0 ? removeTrailingEmptyBlocks(initialContent) : [];\n }, [\n initialContent,\n diffContent,\n handleAcceptChange,\n handleRejectChange,\n acceptedChanges,\n rejectedChanges,\n removeTrailingEmptyBlocks,\n ]);\n\n const validatedInitialContent = useMemo(() => {\n if (processedContent && Array.isArray(processedContent) && processedContent.length > 0) {\n const validatedContent = processedContent.filter((block) => {\n if (!block || typeof block !== \"object\") return false;\n if (!(block as any).type) return false;\n return true;\n });\n return validatedContent.length > 0 ? (validatedContent as PartialBlock[]) : undefined;\n }\n return undefined;\n }, [processedContent]);\n\n const editor = useCreateBlockNote(\n useMemo(\n () => ({\n placeholders: {\n emptyDocument: placeholder || t(`generic.blocknote.placeholder`),\n },\n schema,\n initialContent: validatedInitialContent,\n uploadFile: uploadImage,\n }),\n [placeholder, t, schema, validatedInitialContent, uploadImage],\n ),\n );\n\n const handleChange = useCallback(async () => {\n if (!onChange) return;\n const newBlocks = editor.document;\n\n const markdownFromBlocks = (await editor.blocksToMarkdownLossy(editor.document)).trim();\n\n function hasUnresolvedDiffsRecursive(block: any): boolean {\n if (!block || typeof block !== \"object\") return false;\n let diffId = undefined;\n if (block.props && block.props.diffId) diffId = block.props.diffId;\n if (!diffId && block.attrs && block.attrs.diffId) diffId = block.attrs.diffId;\n if (diffId && !acceptedChanges.has(diffId) && !rejectedChanges.has(diffId)) {\n return true;\n }\n\n if (block.content) {\n const contentArr = Array.isArray(block.content) ? block.content : [block.content];\n for (const inline of contentArr) {\n if (inline && typeof inline === \"object\") {\n if (inline.type === \"diffActions\" && inline.props && inline.props.diffIds) {\n const ids =\n typeof inline.props.diffIds === \"string\" ? inline.props.diffIds.split(\",\") : inline.props.diffIds;\n for (const id of ids) {\n const trimmed = (id || \"\").toString().trim();\n if (trimmed && !acceptedChanges.has(trimmed) && !rejectedChanges.has(trimmed)) {\n return true;\n }\n }\n }\n if (inline.props && inline.props.diffId) {\n const diffIdInline = inline.props.diffId;\n if (diffIdInline && !acceptedChanges.has(diffIdInline) && !rejectedChanges.has(diffIdInline)) {\n return true;\n }\n }\n if (inline.children && Array.isArray(inline.children)) {\n for (const child of inline.children) {\n if (hasUnresolvedDiffsRecursive(child)) return true;\n }\n }\n }\n }\n }\n if (Array.isArray(block.children)) {\n for (const child of block.children) {\n if (hasUnresolvedDiffsRecursive(child)) return true;\n }\n }\n return false;\n }\n\n let hasUnresolvedDiff = false;\n if (Array.isArray(newBlocks)) {\n hasUnresolvedDiff = newBlocks.some((block: any) => hasUnresolvedDiffsRecursive(block));\n }\n\n onChange(newBlocks, !markdownFromBlocks.length, hasUnresolvedDiff);\n }, [editor, onChange, id, acceptedChanges, rejectedChanges]);\n\n // Utility: deep equality for arrays of blocks\n const areBlocksEqual = (a: any[], b: any[]): boolean => {\n return JSON.stringify(a) === JSON.stringify(b);\n };\n\n // Only initialize from markdownContent once per value, and only if different\n const hasInitializedFromMarkdown = useRef<string | null>(null);\n useEffect(() => {\n const updateContent = async (markdown: string) => {\n const blocks = await editor.tryParseMarkdownToBlocks(markdown);\n if (!areBlocksEqual(blocks, editor.document)) {\n editor.replaceBlocks(editor.document, blocks);\n }\n };\n\n if (markdownContent && hasInitializedFromMarkdown.current !== markdownContent) {\n hasInitializedFromMarkdown.current = markdownContent;\n updateContent(markdownContent).then(() => handleChange());\n }\n }, [markdownContent, editor]);\n\n // Update editor content when diff content changes, but only if different\n // Prevent unnecessary replaceBlocks calls that reset scroll/cursor.\n const previousContentHashRef = useRef<string | null>(null);\n useEffect(() => {\n if (!processedContent || !editor) return;\n const hash = JSON.stringify(processedContent);\n if (previousContentHashRef.current === hash) return; // no changes\n const currentHash = JSON.stringify(editor.document);\n if (currentHash === hash) {\n previousContentHashRef.current = hash;\n return; // already in sync\n }\n editor.replaceBlocks(editor.document, processedContent as PartialBlock[]);\n previousContentHashRef.current = hash;\n }, [processedContent, editor]);\n\n // Handle audio received from whisper transcription\n const handleAudioReceived = useCallback(\n (message: string) => {\n try {\n // Ensure the editor has focus\n const editorElement = editorRef.current?.querySelector('[contenteditable=\"true\"]') as HTMLElement;\n if (editorElement && document.activeElement !== editorElement) {\n editorElement.focus();\n }\n\n // Insert the transcribed text at the current cursor position\n editor.insertInlineContent(message);\n } catch (error) {\n console.error(\"Error inserting transcribed text:\", error);\n // Fallback: try to insert at the end of the document\n try {\n const blocks = editor.document;\n if (blocks.length > 0) {\n const lastBlock = blocks[blocks.length - 1];\n editor.setTextCursorPosition(lastBlock.id, \"end\");\n editor.insertInlineContent(message);\n }\n } catch (fallbackError) {\n console.error(\"Fallback insertion also failed:\", fallbackError);\n }\n }\n },\n [editor],\n );\n\n return (\n <div ref={editorRef} className={cn(bordered ? \"rounded-md border\" : \"\", \"w-full\")}>\n <BlockNoteView\n editor={editor}\n onChange={handleChange}\n editable={onChange !== undefined}\n formattingToolbar={false}\n theme=\"light\"\n className={cn(`BlockNoteView ${onChange ? \"min-h-96 p-4\" : \"\"}`, className, size === \"sm\" && \"small\")}\n >\n <BlockNoteEditorFormattingToolbar />\n </BlockNoteView>\n </div>\n );\n}\n","\"use client\";\n\nimport {\n BasicTextStyleButton,\n BlockTypeSelect,\n CreateLinkButton,\n FileCaptionButton,\n FileReplaceButton,\n FormattingToolbar,\n FormattingToolbarController,\n TextAlignButton,\n} from \"@blocknote/react\";\n\nexport function BlockNoteEditorFormattingToolbar() {\n return (\n <FormattingToolbarController\n formattingToolbar={() => (\n <FormattingToolbar>\n <BlockTypeSelect key={\"blockTypeSelect\"} />\n\n <FileCaptionButton key={\"fileCaptionButton\"} />\n <FileReplaceButton key={\"replaceFileButton\"} />\n\n <BasicTextStyleButton basicTextStyle={\"bold\"} key={\"boldStyleButton\"} />\n <BasicTextStyleButton basicTextStyle={\"italic\"} key={\"italicStyleButton\"} />\n <BasicTextStyleButton basicTextStyle={\"underline\"} key={\"underlineStyleButton\"} />\n <BasicTextStyleButton basicTextStyle={\"strike\"} key={\"strikeStyleButton\"} />\n\n <TextAlignButton textAlignment={\"left\"} key={\"textAlignLeftButton\"} />\n <TextAlignButton textAlignment={\"center\"} key={\"textAlignCenterButton\"} />\n <TextAlignButton textAlignment={\"right\"} key={\"textAlignRightButton\"} />\n\n <CreateLinkButton key={\"createLinkButton\"} />\n </FormattingToolbar>\n )}\n />\n );\n}\n"]}
@@ -3,14 +3,14 @@ import {
3
3
  Button,
4
4
  errorToast,
5
5
  useCurrentUserContext
6
- } from "./chunk-OLRRVGHQ.mjs";
6
+ } from "./chunk-WAFOKMKT.mjs";
7
7
  import "./chunk-SJIVGCNM.mjs";
8
8
  import {
9
9
  BlockNoteDiffUtil,
10
10
  BlockNoteWordDiffRendererUtil,
11
11
  S3Service,
12
12
  cn
13
- } from "./chunk-4EQEWIAE.mjs";
13
+ } from "./chunk-JGVXZS7M.mjs";
14
14
  import "./chunk-C7C7VY4F.mjs";
15
15
  import "./chunk-TGBXBUWM.mjs";
16
16
  import "./chunk-AUXK7QSA.mjs";
@@ -380,4 +380,4 @@ __name(BlockNoteEditor, "BlockNoteEditor");
380
380
  export {
381
381
  BlockNoteEditor as default
382
382
  };
383
- //# sourceMappingURL=BlockNoteEditor-E54Q6MNP.mjs.map
383
+ //# sourceMappingURL=BlockNoteEditor-ITJLAOXC.mjs.map
@@ -121,23 +121,68 @@ var AbstractApiData = class {
121
121
  }
122
122
  /**
123
123
  * Read included relationship data and augment with relationship meta properties.
124
- * Used for single relationships (one-to-one) that have edge properties.
124
+ * Handles both single relationships (one-to-one) and array relationships (one-to-many).
125
+ *
126
+ * For single relationships: meta is read from `relationships[type].meta`
127
+ * For array relationships: per-item meta is read from `relationships[type].data[].meta`
125
128
  *
126
129
  * @param data - Hydrated JSON:API data
127
- * @param type - Relationship type key (e.g., "guide")
130
+ * @param type - Relationship type key (e.g., "guide", "persons")
128
131
  * @param dataType - Module reference for rehydration
129
- * @returns Related object augmented with meta properties, or undefined
132
+ * @returns Related object(s) augmented with meta properties, or undefined
130
133
  */
131
134
  _readIncludedWithMeta(data, type, dataType) {
132
- const related = this._readIncluded(data, type, dataType);
133
- if (!related || Array.isArray(related)) {
135
+ if (data.included === void 0 || data.included.length === 0 || data.jsonApi.relationships === void 0 || data.jsonApi.relationships[type] === void 0 || data.jsonApi.relationships[type].data === void 0) {
136
+ return void 0;
137
+ }
138
+ const relationshipData = data.jsonApi.relationships[type].data;
139
+ if (Array.isArray(relationshipData)) {
140
+ const result = [];
141
+ for (const item of relationshipData) {
142
+ const includedData2 = data.included.find((inc) => inc.id === item.id && inc.type === item.type);
143
+ if (!includedData2) continue;
144
+ const entity2 = RehydrationFactory.rehydrate(dataType, {
145
+ jsonApi: includedData2,
146
+ included: data.included
147
+ });
148
+ if (item.meta) {
149
+ Object.assign(entity2, item.meta);
150
+ }
151
+ result.push(entity2);
152
+ }
153
+ return result;
154
+ }
155
+ const includedData = data.included.find(
156
+ (inc) => inc.id === relationshipData.id && inc.type === relationshipData.type
157
+ );
158
+ if (!includedData) {
159
+ if (data.allData !== void 0) {
160
+ const fallbackData = data.allData.find(
161
+ (inc) => inc.id === relationshipData.id && inc.type === relationshipData.type
162
+ );
163
+ if (fallbackData) {
164
+ const entity2 = RehydrationFactory.rehydrate(dataType, {
165
+ jsonApi: fallbackData,
166
+ included: data.included
167
+ });
168
+ const relationshipMeta2 = data.jsonApi.relationships[type].meta;
169
+ if (relationshipMeta2) {
170
+ Object.assign(entity2, relationshipMeta2);
171
+ }
172
+ return entity2;
173
+ }
174
+ }
134
175
  return void 0;
135
176
  }
136
- const relationshipMeta = _optionalChain([data, 'access', _2 => _2.jsonApi, 'access', _3 => _3.relationships, 'optionalAccess', _4 => _4[type], 'optionalAccess', _5 => _5.meta]);
137
- if (!relationshipMeta) {
138
- return related;
177
+ const entity = RehydrationFactory.rehydrate(dataType, {
178
+ jsonApi: includedData,
179
+ included: data.included
180
+ });
181
+ const relationshipMeta = data.jsonApi.relationships[type].meta;
182
+ if (relationshipMeta) {
183
+ Object.assign(entity, relationshipMeta);
139
184
  }
140
- return Object.assign(related, relationshipMeta);
185
+ return entity;
141
186
  }
142
187
  dehydrate() {
143
188
  return {
@@ -150,9 +195,9 @@ var AbstractApiData = class {
150
195
  this._included = data.included;
151
196
  this._type = this._jsonApi.type;
152
197
  this._id = this._jsonApi.id;
153
- this._createdAt = _optionalChain([this, 'access', _6 => _6._jsonApi, 'access', _7 => _7.meta, 'optionalAccess', _8 => _8.createdAt]) !== void 0 ? new Date(this._jsonApi.meta.createdAt) : void 0;
154
- this._updatedAt = _optionalChain([this, 'access', _9 => _9._jsonApi, 'access', _10 => _10.meta, 'optionalAccess', _11 => _11.updatedAt]) !== void 0 ? new Date(this._jsonApi.meta.updatedAt) : void 0;
155
- this._self = _nullishCoalesce(_optionalChain([this, 'access', _12 => _12._jsonApi, 'access', _13 => _13.links, 'optionalAccess', _14 => _14.self]), () => ( void 0));
198
+ this._createdAt = _optionalChain([this, 'access', _2 => _2._jsonApi, 'access', _3 => _3.meta, 'optionalAccess', _4 => _4.createdAt]) !== void 0 ? new Date(this._jsonApi.meta.createdAt) : void 0;
199
+ this._updatedAt = _optionalChain([this, 'access', _5 => _5._jsonApi, 'access', _6 => _6.meta, 'optionalAccess', _7 => _7.updatedAt]) !== void 0 ? new Date(this._jsonApi.meta.updatedAt) : void 0;
200
+ this._self = _nullishCoalesce(_optionalChain([this, 'access', _8 => _8._jsonApi, 'access', _9 => _9.links, 'optionalAccess', _10 => _10.self]), () => ( void 0));
156
201
  return this;
157
202
  }
158
203
  };
@@ -352,7 +397,7 @@ function configureClientJsonApi(config) {
352
397
  }
353
398
  _chunk7QVYU63Ejs.__name.call(void 0, configureClientJsonApi, "configureClientJsonApi");
354
399
  function getClientApiUrl() {
355
- if (_optionalChain([_clientConfig, 'optionalAccess', _15 => _15.apiUrl])) {
400
+ if (_optionalChain([_clientConfig, 'optionalAccess', _11 => _11.apiUrl])) {
356
401
  return _clientConfig.apiUrl;
357
402
  }
358
403
  const envUrl = process.env.NEXT_PUBLIC_API_URL;
@@ -365,7 +410,7 @@ function getClientApiUrl() {
365
410
  }
366
411
  _chunk7QVYU63Ejs.__name.call(void 0, getClientApiUrl, "getClientApiUrl");
367
412
  function getClientAppUrl() {
368
- if (_optionalChain([_clientConfig, 'optionalAccess', _16 => _16.appUrl])) {
413
+ if (_optionalChain([_clientConfig, 'optionalAccess', _12 => _12.appUrl])) {
369
414
  return _clientConfig.appUrl;
370
415
  }
371
416
  const envUrl = process.env.NEXT_PUBLIC_ADDRESS;
@@ -378,11 +423,11 @@ function getClientAppUrl() {
378
423
  }
379
424
  _chunk7QVYU63Ejs.__name.call(void 0, getClientAppUrl, "getClientAppUrl");
380
425
  function getClientTrackablePages() {
381
- return _nullishCoalesce(_optionalChain([_clientConfig, 'optionalAccess', _17 => _17.trackablePages]), () => ( []));
426
+ return _nullishCoalesce(_optionalChain([_clientConfig, 'optionalAccess', _13 => _13.trackablePages]), () => ( []));
382
427
  }
383
428
  _chunk7QVYU63Ejs.__name.call(void 0, getClientTrackablePages, "getClientTrackablePages");
384
429
  function runClientBootstrapper() {
385
- if (_optionalChain([_clientConfig, 'optionalAccess', _18 => _18.bootstrapper])) {
430
+ if (_optionalChain([_clientConfig, 'optionalAccess', _14 => _14.bootstrapper])) {
386
431
  _clientConfig.bootstrapper();
387
432
  }
388
433
  }
@@ -401,7 +446,7 @@ async function ClientJsonApiGet(params) {
401
446
  token,
402
447
  companyId: params.companyId,
403
448
  language: params.language,
404
- additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _19 => _19.additionalHeaders])
449
+ additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _15 => _15.additionalHeaders])
405
450
  });
406
451
  return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
407
452
  classKey: params.classKey,
@@ -434,7 +479,7 @@ async function ClientJsonApiPost(params) {
434
479
  files: params.files,
435
480
  companyId: params.companyId,
436
481
  language: params.language,
437
- additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _20 => _20.additionalHeaders])
482
+ additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _16 => _16.additionalHeaders])
438
483
  });
439
484
  return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
440
485
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
@@ -461,7 +506,7 @@ async function ClientJsonApiPut(params) {
461
506
  files: params.files,
462
507
  companyId: params.companyId,
463
508
  language: params.language,
464
- additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _21 => _21.additionalHeaders])
509
+ additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _17 => _17.additionalHeaders])
465
510
  });
466
511
  return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
467
512
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
@@ -488,7 +533,7 @@ async function ClientJsonApiPatch(params) {
488
533
  files: params.files,
489
534
  companyId: params.companyId,
490
535
  language: params.language,
491
- additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _22 => _22.additionalHeaders])
536
+ additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _18 => _18.additionalHeaders])
492
537
  });
493
538
  return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
494
539
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
@@ -507,7 +552,7 @@ async function ClientJsonApiDelete(params) {
507
552
  token,
508
553
  companyId: params.companyId,
509
554
  language: params.language,
510
- additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _23 => _23.additionalHeaders])
555
+ additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _19 => _19.additionalHeaders])
511
556
  });
512
557
  return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
513
558
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
@@ -1641,14 +1686,14 @@ var BlockNoteWordDiffRendererUtil = class {
1641
1686
  return diffBlocks.map((block) => {
1642
1687
  const updatedBlock = { ...block };
1643
1688
  if (updatedBlock.diffId) {
1644
- updatedBlock.accepted = _optionalChain([acceptedChanges, 'optionalAccess', _24 => _24.has, 'call', _25 => _25(updatedBlock.diffId)]) || false;
1645
- updatedBlock.rejected = _optionalChain([rejectedChanges, 'optionalAccess', _26 => _26.has, 'call', _27 => _27(updatedBlock.diffId)]) || false;
1689
+ updatedBlock.accepted = _optionalChain([acceptedChanges, 'optionalAccess', _20 => _20.has, 'call', _21 => _21(updatedBlock.diffId)]) || false;
1690
+ updatedBlock.rejected = _optionalChain([rejectedChanges, 'optionalAccess', _22 => _22.has, 'call', _23 => _23(updatedBlock.diffId)]) || false;
1646
1691
  }
1647
1692
  if (updatedBlock.wordDiffs) {
1648
1693
  updatedBlock.wordDiffs = updatedBlock.wordDiffs.map((wordDiff) => ({
1649
1694
  ...wordDiff,
1650
- accepted: _optionalChain([acceptedChanges, 'optionalAccess', _28 => _28.has, 'call', _29 => _29(wordDiff.diffId)]) || false,
1651
- rejected: _optionalChain([rejectedChanges, 'optionalAccess', _30 => _30.has, 'call', _31 => _31(wordDiff.diffId)]) || false
1695
+ accepted: _optionalChain([acceptedChanges, 'optionalAccess', _24 => _24.has, 'call', _25 => _25(wordDiff.diffId)]) || false,
1696
+ rejected: _optionalChain([rejectedChanges, 'optionalAccess', _26 => _26.has, 'call', _27 => _27(wordDiff.diffId)]) || false
1652
1697
  }));
1653
1698
  }
1654
1699
  if (updatedBlock.children) {
@@ -1673,7 +1718,7 @@ var BlockNoteWordDiffRendererUtil = class {
1673
1718
  type: block.type || "paragraph",
1674
1719
  props: this.getBlockProps(block),
1675
1720
  content: Array.isArray(block.content) ? block.content : [],
1676
- children: _optionalChain([block, 'access', _32 => _32.children, 'optionalAccess', _33 => _33.map, 'call', _34 => _34(
1721
+ children: _optionalChain([block, 'access', _28 => _28.children, 'optionalAccess', _29 => _29.map, 'call', _30 => _30(
1677
1722
  (child) => this.renderDiffBlock(child, onAcceptChange, onRejectChange)
1678
1723
  )])
1679
1724
  };
@@ -1686,7 +1731,7 @@ var BlockNoteWordDiffRendererUtil = class {
1686
1731
  type: block.type || "paragraph",
1687
1732
  props: block.props || {},
1688
1733
  content: Array.isArray(block.content) ? block.content : [],
1689
- children: _optionalChain([block, 'access', _35 => _35.children, 'optionalAccess', _36 => _36.map, 'call', _37 => _37(
1734
+ children: _optionalChain([block, 'access', _31 => _31.children, 'optionalAccess', _32 => _32.map, 'call', _33 => _33(
1690
1735
  (child) => this.renderDiffBlock(child, onAcceptChange, onRejectChange)
1691
1736
  )])
1692
1737
  };
@@ -1738,7 +1783,7 @@ var BlockNoteWordDiffRendererUtil = class {
1738
1783
  type: block.type || "paragraph",
1739
1784
  props: this.getBlockProps(block),
1740
1785
  content,
1741
- children: _optionalChain([block, 'access', _38 => _38.children, 'optionalAccess', _39 => _39.map, 'call', _40 => _40(
1786
+ children: _optionalChain([block, 'access', _34 => _34.children, 'optionalAccess', _35 => _35.map, 'call', _36 => _36(
1742
1787
  (child) => this.renderDiffBlock(child, onAcceptChange, onRejectChange)
1743
1788
  )])
1744
1789
  };
@@ -1760,7 +1805,7 @@ var BlockNoteWordDiffRendererUtil = class {
1760
1805
  type: block.type || "paragraph",
1761
1806
  props: block.props || {},
1762
1807
  content: Array.isArray(content) ? content : [],
1763
- children: _optionalChain([block, 'access', _41 => _41.children, 'optionalAccess', _42 => _42.map, 'call', _43 => _43((child) => this.renderDiffBlock(child, onAcceptChange, onRejectChange))]) || []
1808
+ children: _optionalChain([block, 'access', _37 => _37.children, 'optionalAccess', _38 => _38.map, 'call', _39 => _39((child) => this.renderDiffBlock(child, onAcceptChange, onRejectChange))]) || []
1764
1809
  };
1765
1810
  }
1766
1811
  static groupAndRenderWordDiffs(wordDiffs) {
@@ -2143,10 +2188,10 @@ var AuthService = class extends AbstractService {
2143
2188
  token: auth.token,
2144
2189
  refreshToken: auth.refreshToken,
2145
2190
  userId: auth.user.id,
2146
- companyId: _optionalChain([auth, 'access', _44 => _44.user, 'access', _45 => _45.company, 'optionalAccess', _46 => _46.id]),
2147
- licenseExpirationDate: _optionalChain([auth, 'access', _47 => _47.user, 'access', _48 => _48.company, 'optionalAccess', _49 => _49.licenseExpirationDate]),
2191
+ companyId: _optionalChain([auth, 'access', _40 => _40.user, 'access', _41 => _41.company, 'optionalAccess', _42 => _42.id]),
2192
+ licenseExpirationDate: _optionalChain([auth, 'access', _43 => _43.user, 'access', _44 => _44.company, 'optionalAccess', _45 => _45.licenseExpirationDate]),
2148
2193
  roles: auth.user.roles.map((role) => role.id),
2149
- features: _nullishCoalesce(_optionalChain([auth, 'access', _50 => _50.user, 'access', _51 => _51.company, 'optionalAccess', _52 => _52.features, 'optionalAccess', _53 => _53.map, 'call', _54 => _54((feature) => feature.id)]), () => ( [])),
2194
+ features: _nullishCoalesce(_optionalChain([auth, 'access', _46 => _46.user, 'access', _47 => _47.company, 'optionalAccess', _48 => _48.features, 'optionalAccess', _49 => _49.map, 'call', _50 => _50((feature) => feature.id)]), () => ( [])),
2150
2195
  modules: auth.user.modules.map((module) => ({
2151
2196
  id: module.id,
2152
2197
  permissions: module.permissions
@@ -2156,7 +2201,7 @@ var AuthService = class extends AbstractService {
2156
2201
  return auth.user;
2157
2202
  }
2158
2203
  static async logout(params) {
2159
- const language = _optionalChain([params, 'optionalAccess', _55 => _55.language]) || "en-US";
2204
+ const language = _optionalChain([params, 'optionalAccess', _51 => _51.language]) || "en-US";
2160
2205
  await _chunkFPZPD4JIjs.JsonApiDelete.call(void 0, {
2161
2206
  classKey: Modules.Auth,
2162
2207
  endpoint: new EndpointCreator({ endpoint: Modules.Auth }).generate(),
@@ -2230,10 +2275,10 @@ var AuthService = class extends AbstractService {
2230
2275
  token: auth.token,
2231
2276
  refreshToken: auth.refreshToken,
2232
2277
  userId: auth.user.id,
2233
- companyId: _optionalChain([auth, 'access', _56 => _56.user, 'access', _57 => _57.company, 'optionalAccess', _58 => _58.id]),
2234
- licenseExpirationDate: _optionalChain([auth, 'access', _59 => _59.user, 'access', _60 => _60.company, 'optionalAccess', _61 => _61.licenseExpirationDate]),
2278
+ companyId: _optionalChain([auth, 'access', _52 => _52.user, 'access', _53 => _53.company, 'optionalAccess', _54 => _54.id]),
2279
+ licenseExpirationDate: _optionalChain([auth, 'access', _55 => _55.user, 'access', _56 => _56.company, 'optionalAccess', _57 => _57.licenseExpirationDate]),
2235
2280
  roles: auth.user.roles.map((role) => role.id),
2236
- features: _nullishCoalesce(_optionalChain([auth, 'access', _62 => _62.user, 'access', _63 => _63.company, 'optionalAccess', _64 => _64.features, 'optionalAccess', _65 => _65.map, 'call', _66 => _66((feature) => feature.id)]), () => ( [])),
2281
+ features: _nullishCoalesce(_optionalChain([auth, 'access', _58 => _58.user, 'access', _59 => _59.company, 'optionalAccess', _60 => _60.features, 'optionalAccess', _61 => _61.map, 'call', _62 => _62((feature) => feature.id)]), () => ( [])),
2237
2282
  modules: auth.user.modules.map((module) => ({
2238
2283
  id: module.id,
2239
2284
  permissions: module.permissions
@@ -2519,8 +2564,8 @@ var ContentService = class extends AbstractService {
2519
2564
  if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
2520
2565
  if (params.search) endpoint.addAdditionalParam("search", params.search);
2521
2566
  }
2522
- if (_optionalChain([Modules, 'access', _67 => _67.Content, 'access', _68 => _68.inclusions, 'optionalAccess', _69 => _69.lists, 'optionalAccess', _70 => _70.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2523
- if (_optionalChain([Modules, 'access', _71 => _71.Content, 'access', _72 => _72.inclusions, 'optionalAccess', _73 => _73.lists, 'optionalAccess', _74 => _74.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2567
+ if (_optionalChain([Modules, 'access', _63 => _63.Content, 'access', _64 => _64.inclusions, 'optionalAccess', _65 => _65.lists, 'optionalAccess', _66 => _66.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2568
+ if (_optionalChain([Modules, 'access', _67 => _67.Content, 'access', _68 => _68.inclusions, 'optionalAccess', _69 => _69.lists, 'optionalAccess', _70 => _70.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2524
2569
  return this.callApi({
2525
2570
  type: Modules.Content,
2526
2571
  method: "GET" /* GET */,
@@ -2534,8 +2579,8 @@ var ContentService = class extends AbstractService {
2534
2579
  id: params.id,
2535
2580
  childEndpoint: "relevance"
2536
2581
  });
2537
- if (_optionalChain([Modules, 'access', _75 => _75.Content, 'access', _76 => _76.inclusions, 'optionalAccess', _77 => _77.lists, 'optionalAccess', _78 => _78.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2538
- if (_optionalChain([Modules, 'access', _79 => _79.Content, 'access', _80 => _80.inclusions, 'optionalAccess', _81 => _81.lists, 'optionalAccess', _82 => _82.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2582
+ if (_optionalChain([Modules, 'access', _71 => _71.Content, 'access', _72 => _72.inclusions, 'optionalAccess', _73 => _73.lists, 'optionalAccess', _74 => _74.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2583
+ if (_optionalChain([Modules, 'access', _75 => _75.Content, 'access', _76 => _76.inclusions, 'optionalAccess', _77 => _77.lists, 'optionalAccess', _78 => _78.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2539
2584
  return this.callApi({
2540
2585
  type: Modules.Content,
2541
2586
  method: "GET" /* GET */,
@@ -2551,8 +2596,8 @@ var ContentService = class extends AbstractService {
2551
2596
  });
2552
2597
  if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
2553
2598
  if (params.search) endpoint.addAdditionalParam("search", params.search);
2554
- if (_optionalChain([Modules, 'access', _83 => _83.Content, 'access', _84 => _84.inclusions, 'optionalAccess', _85 => _85.lists, 'optionalAccess', _86 => _86.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2555
- if (_optionalChain([Modules, 'access', _87 => _87.Content, 'access', _88 => _88.inclusions, 'optionalAccess', _89 => _89.lists, 'optionalAccess', _90 => _90.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2599
+ if (_optionalChain([Modules, 'access', _79 => _79.Content, 'access', _80 => _80.inclusions, 'optionalAccess', _81 => _81.lists, 'optionalAccess', _82 => _82.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2600
+ if (_optionalChain([Modules, 'access', _83 => _83.Content, 'access', _84 => _84.inclusions, 'optionalAccess', _85 => _85.lists, 'optionalAccess', _86 => _86.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2556
2601
  return this.callApi({
2557
2602
  type: Modules.Content,
2558
2603
  method: "GET" /* GET */,
@@ -2675,6 +2720,8 @@ var Notification = class extends AbstractApiData {
2675
2720
 
2676
2721
 
2677
2722
 
2723
+
2724
+
2678
2725
  get notificationType() {
2679
2726
  if (this._notificationType === void 0) throw new Error("notificationType is not set");
2680
2727
  return this._notificationType;
@@ -2682,6 +2729,12 @@ var Notification = class extends AbstractApiData {
2682
2729
  get isRead() {
2683
2730
  return this._isRead === void 0 ? false : this._isRead;
2684
2731
  }
2732
+ get message() {
2733
+ return this._message;
2734
+ }
2735
+ get actionUrl() {
2736
+ return this._actionUrl;
2737
+ }
2685
2738
  get actor() {
2686
2739
  return this._actor;
2687
2740
  }
@@ -2689,6 +2742,8 @@ var Notification = class extends AbstractApiData {
2689
2742
  super.rehydrate(data);
2690
2743
  this._notificationType = data.jsonApi.attributes.notificationType;
2691
2744
  this._isRead = data.jsonApi.attributes.isRead;
2745
+ this._message = data.jsonApi.attributes.message;
2746
+ this._actionUrl = data.jsonApi.attributes.actionUrl;
2692
2747
  this._actor = this._readIncluded(data, "actor", Modules.User);
2693
2748
  return this;
2694
2749
  }
@@ -3244,8 +3299,8 @@ var UserService = class extends AbstractService {
3244
3299
  id: params.id,
3245
3300
  childEndpoint: "user-relevance"
3246
3301
  });
3247
- if (_optionalChain([Modules, 'access', _91 => _91.User, 'access', _92 => _92.inclusions, 'optionalAccess', _93 => _93.lists, 'optionalAccess', _94 => _94.fields])) endpoint.limitToFields(Modules.User.inclusions.lists.fields);
3248
- if (_optionalChain([Modules, 'access', _95 => _95.User, 'access', _96 => _96.inclusions, 'optionalAccess', _97 => _97.lists, 'optionalAccess', _98 => _98.types])) endpoint.limitToType(Modules.User.inclusions.lists.types);
3302
+ if (_optionalChain([Modules, 'access', _87 => _87.User, 'access', _88 => _88.inclusions, 'optionalAccess', _89 => _89.lists, 'optionalAccess', _90 => _90.fields])) endpoint.limitToFields(Modules.User.inclusions.lists.fields);
3303
+ if (_optionalChain([Modules, 'access', _91 => _91.User, 'access', _92 => _92.inclusions, 'optionalAccess', _93 => _93.lists, 'optionalAccess', _94 => _94.types])) endpoint.limitToType(Modules.User.inclusions.lists.types);
3249
3304
  return this.callApi({
3250
3305
  type: Modules.User,
3251
3306
  method: "GET" /* GET */,
@@ -3482,4 +3537,4 @@ var AuthorModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory
3482
3537
 
3483
3538
 
3484
3539
  exports.RehydrationFactory = RehydrationFactory; exports.AbstractApiData = AbstractApiData; exports.HttpMethod = HttpMethod; exports.setGlobalErrorHandler = setGlobalErrorHandler; exports.getGlobalErrorHandler = getGlobalErrorHandler; exports.AbstractService = AbstractService; exports.configureClientJsonApi = configureClientJsonApi; exports.getClientApiUrl = getClientApiUrl; exports.getClientAppUrl = getClientAppUrl; exports.getClientTrackablePages = getClientTrackablePages; exports.ClientJsonApiGet = ClientJsonApiGet; exports.ClientJsonApiPost = ClientJsonApiPost; exports.ClientJsonApiPut = ClientJsonApiPut; exports.ClientJsonApiPatch = ClientJsonApiPatch; exports.ClientJsonApiDelete = ClientJsonApiDelete; exports.ClientHttpMethod = ClientHttpMethod; exports.setClientGlobalErrorHandler = setClientGlobalErrorHandler; exports.getClientGlobalErrorHandler = getClientGlobalErrorHandler; exports.ClientAbstractService = ClientAbstractService; exports.ModuleRegistrar = ModuleRegistrar; exports.ModuleRegistry = ModuleRegistry; exports.Modules = Modules; exports.EndpointCreator = EndpointCreator; exports.createJsonApiInclusion = createJsonApiInclusion; exports.rehydrate = rehydrate; exports.rehydrateList = rehydrateList; exports.cn = cn; exports.composeRefs = composeRefs; exports.useComposedRefs = useComposedRefs; exports.useIsMobile = useIsMobile; exports.formatDate = formatDate; exports.exists = exists; exports.TableOptions = TableOptions; exports.getTableOptions = getTableOptions; exports.getTableComponents = getTableComponents; exports.userObjectSchema = userObjectSchema; exports.entityObjectSchema = entityObjectSchema; exports.BlockNoteDiffUtil = BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = BlockNoteWordDiffRendererUtil; exports.getIconByModule = getIconByModule; exports.getIcon = getIcon; exports.getIconByModuleName = getIconByModuleName; exports.getLucideIcon = getLucideIcon; exports.getLucideIconByModule = getLucideIconByModule; exports.getLucideIconByModuleName = getLucideIconByModuleName; exports.Action = Action; exports.checkPermissions = checkPermissions; exports.checkPermissionsFromServer = checkPermissionsFromServer; exports.getValueFromPath = getValueFromPath; exports.Auth = Auth; exports.configureAuth = configureAuth; exports.getTokenHandler = getTokenHandler; exports.AuthService = AuthService; exports.AuthComponent = AuthComponent; exports.AuthModule = AuthModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.CompanyModule = CompanyModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.ContentModule = ContentModule; exports.Feature = Feature; exports.FeatureService = FeatureService; exports.FeatureModule = FeatureModule; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.Notification = Notification; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushService = PushService; exports.PushModule = PushModule; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.UserModule = UserModule; exports.AuthorModule = AuthorModule;
3485
- //# sourceMappingURL=chunk-VFSRIKWY.js.map
3540
+ //# sourceMappingURL=chunk-C6QXZGL7.js.map