@carlonicora/nextjs-jsonapi 3.15.2 → 3.16.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/{BlockNoteEditor-FLXSBVXM.js → BlockNoteEditor-S43PQJEC.js} +83 -43
- package/dist/BlockNoteEditor-S43PQJEC.js.map +1 -0
- package/dist/{BlockNoteEditor-XQTV2I2E.mjs → BlockNoteEditor-SGISBQD5.mjs} +101 -61
- package/dist/BlockNoteEditor-SGISBQD5.mjs.map +1 -0
- package/dist/billing/index.js +335 -335
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-G2C6UT2Q.mjs → chunk-47CLHN2G.mjs} +16 -5
- package/dist/chunk-47CLHN2G.mjs.map +1 -0
- package/dist/{chunk-2GENOK3L.js → chunk-AOWHVECO.js} +16 -5
- package/dist/chunk-AOWHVECO.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +34 -3
- package/dist/components/index.d.ts +34 -3
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/editors/BlockNoteEditor.tsx +70 -33
- package/src/components/editors/BlockNoteEditorAiActions.tsx +49 -0
- package/src/components/editors/__tests__/BlockNoteEditorAiActions.test.ts +25 -0
- package/src/components/editors/index.ts +2 -1
- package/src/components/forms/FormBlockNote.tsx +8 -0
- package/src/components/forms/FormFieldWrapper.tsx +22 -6
- package/dist/BlockNoteEditor-FLXSBVXM.js.map +0 -1
- package/dist/BlockNoteEditor-XQTV2I2E.mjs.map +0 -1
- package/dist/chunk-2GENOK3L.js.map +0 -1
- package/dist/chunk-G2C6UT2Q.mjs.map +0 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createMentionInlineContentSpec,
|
|
7
7
|
errorToast,
|
|
8
8
|
useCurrentUserContextOptional
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-47CLHN2G.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getPublicApiUrl,
|
|
12
12
|
useI18nLocale
|
|
@@ -52,19 +52,39 @@ import {
|
|
|
52
52
|
import { en as aiEn } from "@blocknote/xl-ai/locales";
|
|
53
53
|
import "@blocknote/xl-ai/style.css";
|
|
54
54
|
import { DefaultChatTransport } from "ai";
|
|
55
|
-
import {
|
|
56
|
-
CheckIcon,
|
|
57
|
-
LanguagesIcon,
|
|
58
|
-
LayoutTemplateIcon,
|
|
59
|
-
SparklesIcon,
|
|
60
|
-
TypeIcon,
|
|
61
|
-
WandSparklesIcon,
|
|
62
|
-
XIcon
|
|
63
|
-
} from "lucide-react";
|
|
55
|
+
import { CheckIcon, LanguagesIcon, SparklesIcon as SparklesIcon2, TypeIcon, WandSparklesIcon, XIcon } from "lucide-react";
|
|
64
56
|
import { useTranslations } from "next-intl";
|
|
65
57
|
import { useTheme } from "next-themes";
|
|
66
58
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
67
59
|
|
|
60
|
+
// src/components/editors/BlockNoteEditorAiActions.tsx
|
|
61
|
+
import { LayoutTemplateIcon, SparklesIcon } from "lucide-react";
|
|
62
|
+
import { jsx } from "react/jsx-runtime";
|
|
63
|
+
var DEFAULT_AI_GENERATE_ACTIONS = ["fill-template"];
|
|
64
|
+
var ITEMS = {
|
|
65
|
+
"fill-template": {
|
|
66
|
+
key: "generate_from_template",
|
|
67
|
+
title: "Generate from Template",
|
|
68
|
+
aliases: ["generate", "template", "fill"],
|
|
69
|
+
icon: /* @__PURE__ */ jsx(LayoutTemplateIcon, { size: 18 }),
|
|
70
|
+
size: "small"
|
|
71
|
+
},
|
|
72
|
+
"draft-impression": {
|
|
73
|
+
key: "suggest_impression",
|
|
74
|
+
title: "Suggest impression",
|
|
75
|
+
aliases: ["suggest", "impression"],
|
|
76
|
+
icon: /* @__PURE__ */ jsx(SparklesIcon, { size: 18 }),
|
|
77
|
+
size: "small"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function generateActionItems(actions, invoke) {
|
|
81
|
+
return (actions ?? DEFAULT_AI_GENERATE_ACTIONS).map((type) => ({
|
|
82
|
+
...ITEMS[type],
|
|
83
|
+
onItemClick: /* @__PURE__ */ __name(() => invoke(type), "onItemClick")
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
__name(generateActionItems, "generateActionItems");
|
|
87
|
+
|
|
68
88
|
// src/components/editors/BlockNoteEditorFormattingToolbar.tsx
|
|
69
89
|
import {
|
|
70
90
|
BasicTextStyleButton,
|
|
@@ -77,24 +97,24 @@ import {
|
|
|
77
97
|
TextAlignButton
|
|
78
98
|
} from "@blocknote/react";
|
|
79
99
|
import { AIToolbarButton } from "@blocknote/xl-ai";
|
|
80
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
100
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
81
101
|
function BlockNoteEditorFormattingToolbar({ showAI = false }) {
|
|
82
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ jsx2(
|
|
83
103
|
FormattingToolbarController,
|
|
84
104
|
{
|
|
85
105
|
formattingToolbar: () => /* @__PURE__ */ jsxs(FormattingToolbar, { children: [
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
showAI ? /* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ jsx2(BlockTypeSelect, {}, "blockTypeSelect"),
|
|
107
|
+
/* @__PURE__ */ jsx2(FileCaptionButton, {}, "fileCaptionButton"),
|
|
108
|
+
/* @__PURE__ */ jsx2(FileReplaceButton, {}, "replaceFileButton"),
|
|
109
|
+
/* @__PURE__ */ jsx2(BasicTextStyleButton, { basicTextStyle: "bold" }, "boldStyleButton"),
|
|
110
|
+
/* @__PURE__ */ jsx2(BasicTextStyleButton, { basicTextStyle: "italic" }, "italicStyleButton"),
|
|
111
|
+
/* @__PURE__ */ jsx2(BasicTextStyleButton, { basicTextStyle: "underline" }, "underlineStyleButton"),
|
|
112
|
+
/* @__PURE__ */ jsx2(BasicTextStyleButton, { basicTextStyle: "strike" }, "strikeStyleButton"),
|
|
113
|
+
/* @__PURE__ */ jsx2(TextAlignButton, { textAlignment: "left" }, "textAlignLeftButton"),
|
|
114
|
+
/* @__PURE__ */ jsx2(TextAlignButton, { textAlignment: "center" }, "textAlignCenterButton"),
|
|
115
|
+
/* @__PURE__ */ jsx2(TextAlignButton, { textAlignment: "right" }, "textAlignRightButton"),
|
|
116
|
+
/* @__PURE__ */ jsx2(CreateLinkButton, {}, "createLinkButton"),
|
|
117
|
+
showAI ? /* @__PURE__ */ jsx2(AIToolbarButton, {}, "aiToolbarButton") : null
|
|
98
118
|
] })
|
|
99
119
|
}
|
|
100
120
|
);
|
|
@@ -102,7 +122,7 @@ function BlockNoteEditorFormattingToolbar({ showAI = false }) {
|
|
|
102
122
|
__name(BlockNoteEditorFormattingToolbar, "BlockNoteEditorFormattingToolbar");
|
|
103
123
|
|
|
104
124
|
// src/components/editors/BlockNoteEditor.tsx
|
|
105
|
-
import { jsx as
|
|
125
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
106
126
|
function isBlockEmpty(block) {
|
|
107
127
|
if (!block || typeof block !== "object") return true;
|
|
108
128
|
if (block.type !== "paragraph") return false;
|
|
@@ -144,7 +164,7 @@ var createDiffActionsInlineContentSpec = /* @__PURE__ */ __name((handleAcceptCha
|
|
|
144
164
|
render: /* @__PURE__ */ __name((props) => {
|
|
145
165
|
const diffIds = props.inlineContent.props.diffIds;
|
|
146
166
|
return /* @__PURE__ */ jsxs2("span", { className: "diff-actions-container mx-2 inline-flex items-center gap-1 align-middle", children: [
|
|
147
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ jsx3(
|
|
148
168
|
Button,
|
|
149
169
|
{
|
|
150
170
|
title: "Accept change",
|
|
@@ -153,10 +173,10 @@ var createDiffActionsInlineContentSpec = /* @__PURE__ */ __name((handleAcceptCha
|
|
|
153
173
|
e.stopPropagation();
|
|
154
174
|
diffIds.split(",").forEach((id) => handleAcceptChange(id.trim()));
|
|
155
175
|
},
|
|
156
|
-
children: /* @__PURE__ */
|
|
176
|
+
children: /* @__PURE__ */ jsx3(CheckIcon, { className: "text-success h-3 w-3" })
|
|
157
177
|
}
|
|
158
178
|
),
|
|
159
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ jsx3(
|
|
160
180
|
Button,
|
|
161
181
|
{
|
|
162
182
|
title: "Reject change",
|
|
@@ -166,7 +186,7 @@ var createDiffActionsInlineContentSpec = /* @__PURE__ */ __name((handleAcceptCha
|
|
|
166
186
|
e.stopPropagation();
|
|
167
187
|
diffIds.split(",").forEach((id) => handleRejectChange(id.trim()));
|
|
168
188
|
},
|
|
169
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ jsx3(XIcon, { className: "text-destructive h-3 w-3" })
|
|
170
190
|
}
|
|
171
191
|
)
|
|
172
192
|
] });
|
|
@@ -174,7 +194,7 @@ var createDiffActionsInlineContentSpec = /* @__PURE__ */ __name((handleAcceptCha
|
|
|
174
194
|
}
|
|
175
195
|
);
|
|
176
196
|
}, "createDiffActionsInlineContentSpec");
|
|
177
|
-
function NarrAIMenu() {
|
|
197
|
+
function NarrAIMenu({ actions }) {
|
|
178
198
|
const editor = useBlockNoteEditor();
|
|
179
199
|
const ai = useExtension(AIExtension);
|
|
180
200
|
const dict = useAIDictionary();
|
|
@@ -210,28 +230,22 @@ function NarrAIMenu() {
|
|
|
210
230
|
const hasSelection = editor.getSelection() !== void 0;
|
|
211
231
|
const hasTyped = prompt.trim().length > 0;
|
|
212
232
|
if (hasTyped) return [];
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
userPrompt: "fill-template",
|
|
222
|
-
useSelection: false,
|
|
223
|
-
chatRequestOptions: { body: { type: "fill-template" } }
|
|
224
|
-
});
|
|
225
|
-
}, "onItemClick")
|
|
226
|
-
};
|
|
233
|
+
const invokeGenerate = /* @__PURE__ */ __name((type) => {
|
|
234
|
+
void ai.invokeAI({
|
|
235
|
+
userPrompt: type,
|
|
236
|
+
useSelection: false,
|
|
237
|
+
chatRequestOptions: { body: { type } }
|
|
238
|
+
});
|
|
239
|
+
}, "invokeGenerate");
|
|
240
|
+
const generateItems = generateActionItems(actions, invokeGenerate);
|
|
227
241
|
if (hasSelection) {
|
|
228
242
|
return [
|
|
229
|
-
|
|
243
|
+
...generateItems,
|
|
230
244
|
{
|
|
231
245
|
key: "improve_writing",
|
|
232
246
|
title: "Improve Writing",
|
|
233
247
|
aliases: ["improve", "rewrite", "polish"],
|
|
234
|
-
icon: /* @__PURE__ */
|
|
248
|
+
icon: /* @__PURE__ */ jsx3(SparklesIcon2, { size: 18 }),
|
|
235
249
|
size: "small",
|
|
236
250
|
onItemClick: /* @__PURE__ */ __name(() => {
|
|
237
251
|
expandSelectionToBlocks();
|
|
@@ -246,7 +260,7 @@ function NarrAIMenu() {
|
|
|
246
260
|
key: "fix_spelling",
|
|
247
261
|
title: "Fix Spelling",
|
|
248
262
|
aliases: ["spelling", "grammar", "typo"],
|
|
249
|
-
icon: /* @__PURE__ */
|
|
263
|
+
icon: /* @__PURE__ */ jsx3(TypeIcon, { size: 18 }),
|
|
250
264
|
size: "small",
|
|
251
265
|
onItemClick: /* @__PURE__ */ __name(() => {
|
|
252
266
|
expandSelectionToBlocks();
|
|
@@ -261,7 +275,7 @@ function NarrAIMenu() {
|
|
|
261
275
|
key: "translate",
|
|
262
276
|
title: "Translate\u2026",
|
|
263
277
|
aliases: ["translate", "language"],
|
|
264
|
-
icon: /* @__PURE__ */
|
|
278
|
+
icon: /* @__PURE__ */ jsx3(LanguagesIcon, { size: 18 }),
|
|
265
279
|
size: "small",
|
|
266
280
|
// Pre-fills the input with a placeholder. User appends/replaces
|
|
267
281
|
// with the target language and submits via Enter. handleSubmit
|
|
@@ -278,7 +292,7 @@ function NarrAIMenu() {
|
|
|
278
292
|
key: "simplify",
|
|
279
293
|
title: "Simplify",
|
|
280
294
|
aliases: ["simplify", "easier", "plain"],
|
|
281
|
-
icon: /* @__PURE__ */
|
|
295
|
+
icon: /* @__PURE__ */ jsx3(WandSparklesIcon, { size: 18 }),
|
|
282
296
|
size: "small",
|
|
283
297
|
onItemClick: /* @__PURE__ */ __name(() => {
|
|
284
298
|
expandSelectionToBlocks();
|
|
@@ -291,8 +305,8 @@ function NarrAIMenu() {
|
|
|
291
305
|
}
|
|
292
306
|
];
|
|
293
307
|
}
|
|
294
|
-
return
|
|
295
|
-
}, [editor, status, prompt, ai, expandSelectionToBlocks]);
|
|
308
|
+
return generateItems;
|
|
309
|
+
}, [editor, status, prompt, ai, expandSelectionToBlocks, actions]);
|
|
296
310
|
const handleSubmit = useCallback(
|
|
297
311
|
async (userPrompt) => {
|
|
298
312
|
if (!userPrompt.trim()) return;
|
|
@@ -309,7 +323,7 @@ function NarrAIMenu() {
|
|
|
309
323
|
);
|
|
310
324
|
const placeholder = status === "thinking" ? dict.ai_menu.status.thinking : status === "ai-writing" ? dict.ai_menu.status.editing : status === "error" ? dict.ai_menu.status.error : dict.ai_menu.input_placeholder;
|
|
311
325
|
const disabled = status === "thinking" || status === "ai-writing";
|
|
312
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ jsx3(
|
|
313
327
|
PromptSuggestionMenu,
|
|
314
328
|
{
|
|
315
329
|
items,
|
|
@@ -318,7 +332,7 @@ function NarrAIMenu() {
|
|
|
318
332
|
onPromptTextChange: setPrompt,
|
|
319
333
|
placeholder,
|
|
320
334
|
disabled,
|
|
321
|
-
icon: /* @__PURE__ */
|
|
335
|
+
icon: /* @__PURE__ */ jsx3("div", { className: "bn-combobox-icon", children: /* @__PURE__ */ jsx3(SparklesIcon2, { size: 16 }) })
|
|
322
336
|
}
|
|
323
337
|
);
|
|
324
338
|
}
|
|
@@ -346,7 +360,8 @@ function BlockNoteEditor({
|
|
|
346
360
|
onWarmMentions,
|
|
347
361
|
aiConfig,
|
|
348
362
|
stretch,
|
|
349
|
-
aiEnabled = true
|
|
363
|
+
aiEnabled = true,
|
|
364
|
+
aiHandleRef
|
|
350
365
|
}) {
|
|
351
366
|
const t = useTranslations();
|
|
352
367
|
const locale = useI18nLocale();
|
|
@@ -552,6 +567,31 @@ function BlockNoteEditor({
|
|
|
552
567
|
[placeholder, t, schema, validatedInitialContent, uploadImage, aiExtension]
|
|
553
568
|
)
|
|
554
569
|
);
|
|
570
|
+
useEffect(() => {
|
|
571
|
+
if (!aiHandleRef) return;
|
|
572
|
+
if (!aiConfig || !aiEnabled) {
|
|
573
|
+
aiHandleRef.current = null;
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
aiHandleRef.current = {
|
|
577
|
+
invokeAi: /* @__PURE__ */ __name((type2) => {
|
|
578
|
+
const ai = editor.getExtension(AIExtension);
|
|
579
|
+
if (!ai) return;
|
|
580
|
+
editor.focus();
|
|
581
|
+
const blocks = editor.document;
|
|
582
|
+
const anchor = blocks?.[blocks.length - 1];
|
|
583
|
+
if (anchor?.id) ai.openAIMenuAtBlock(anchor.id);
|
|
584
|
+
void ai.invokeAI({
|
|
585
|
+
userPrompt: type2,
|
|
586
|
+
useSelection: false,
|
|
587
|
+
chatRequestOptions: { body: { type: type2 } }
|
|
588
|
+
});
|
|
589
|
+
}, "invokeAi")
|
|
590
|
+
};
|
|
591
|
+
return () => {
|
|
592
|
+
aiHandleRef.current = null;
|
|
593
|
+
};
|
|
594
|
+
}, [aiHandleRef, aiConfig, aiEnabled, editor]);
|
|
555
595
|
const lastEmittedHashRef = useRef(null);
|
|
556
596
|
const handleChange = useCallback(async () => {
|
|
557
597
|
if (!onChange) return;
|
|
@@ -676,7 +716,7 @@ function BlockNoteEditor({
|
|
|
676
716
|
},
|
|
677
717
|
[editor]
|
|
678
718
|
);
|
|
679
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ jsx3(
|
|
680
720
|
"div",
|
|
681
721
|
{
|
|
682
722
|
ref: editorRef,
|
|
@@ -712,8 +752,8 @@ function BlockNoteEditor({
|
|
|
712
752
|
size === "sm" && "small"
|
|
713
753
|
),
|
|
714
754
|
children: [
|
|
715
|
-
/* @__PURE__ */
|
|
716
|
-
enableMentions && mentionSearchFn && /* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ jsx3(BlockNoteEditorFormattingToolbar, { showAI: !!aiConfig && aiEnabled }),
|
|
756
|
+
enableMentions && mentionSearchFn && /* @__PURE__ */ jsx3(
|
|
717
757
|
BlockNoteEditorMentionSuggestionMenu,
|
|
718
758
|
{
|
|
719
759
|
editor,
|
|
@@ -723,15 +763,15 @@ function BlockNoteEditor({
|
|
|
723
763
|
}
|
|
724
764
|
),
|
|
725
765
|
renderOverlays?.(editor),
|
|
726
|
-
enableMentions && mentionResolveFn && /* @__PURE__ */
|
|
727
|
-
aiConfig && aiEnabled && /* @__PURE__ */
|
|
766
|
+
enableMentions && mentionResolveFn && /* @__PURE__ */ jsx3(BlockNoteEditorMentionHoverCard, { containerRef: editorRef, mentionResolveFn }),
|
|
767
|
+
aiConfig && aiEnabled && /* @__PURE__ */ jsx3(
|
|
728
768
|
SuggestionMenuController,
|
|
729
769
|
{
|
|
730
770
|
triggerCharacter: "/",
|
|
731
771
|
getItems: async (query) => filterSuggestionItems([...getDefaultReactSlashMenuItems(editor), ...getAISlashMenuItems(editor)], query)
|
|
732
772
|
}
|
|
733
773
|
),
|
|
734
|
-
aiConfig && aiEnabled && /* @__PURE__ */
|
|
774
|
+
aiConfig && aiEnabled && /* @__PURE__ */ jsx3(AIMenuController, { aiMenu: () => /* @__PURE__ */ jsx3(NarrAIMenu, { actions: aiConfig.actions }) })
|
|
735
775
|
]
|
|
736
776
|
}
|
|
737
777
|
)
|
|
@@ -742,4 +782,4 @@ __name(BlockNoteEditor, "BlockNoteEditor");
|
|
|
742
782
|
export {
|
|
743
783
|
BlockNoteEditor as default
|
|
744
784
|
};
|
|
745
|
-
//# sourceMappingURL=BlockNoteEditor-
|
|
785
|
+
//# sourceMappingURL=BlockNoteEditor-SGISBQD5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/editors/BlockNoteEditor.tsx","../src/components/editors/BlockNoteEditorAiActions.tsx","../src/components/editors/BlockNoteEditorFormattingToolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { BlockNoteSchema, defaultInlineContentSpecs, filterSuggestionItems, PartialBlock } from \"@blocknote/core\";\nimport { en as coreEn } from \"@blocknote/core/locales\";\nimport {\n createReactInlineContentSpec,\n DefaultReactSuggestionItem,\n getDefaultReactSlashMenuItems,\n SuggestionMenuController,\n SuggestionMenuProps,\n useBlockNoteEditor,\n useCreateBlockNote,\n useExtension,\n useExtensionState,\n} from \"@blocknote/react\";\nimport { BlockNoteView } from \"@blocknote/shadcn\";\nimport \"@blocknote/shadcn/style.css\";\nimport {\n AIExtension,\n AIMenuController,\n getAISlashMenuItems,\n getDefaultAIMenuItems,\n PromptSuggestionMenu,\n useAIDictionary,\n} from \"@blocknote/xl-ai\";\nimport { en as aiEn } from \"@blocknote/xl-ai/locales\";\nimport \"@blocknote/xl-ai/style.css\";\nimport { DefaultChatTransport } from \"ai\";\nimport { CheckIcon, LanguagesIcon, SparklesIcon, TypeIcon, WandSparklesIcon, XIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useTheme } from \"next-themes\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { getPublicApiUrl } from \"../../client/config\";\nimport { getClientToken } from \"../../client/token\";\nimport { useCurrentUserContextOptional } from \"../../contexts\";\nimport { S3Interface } from \"../../features/s3/data\";\nimport { S3Service } from \"../../features/s3/data/s3.service\";\nimport { UserInterface } from \"../../features/user/data\";\nimport { useI18nLocale } from \"../../i18n/config\";\nimport { Button } from \"../../shadcnui\";\nimport { BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, cn } from \"../../utils\";\nimport { errorToast } from \"../errors\";\nimport { BlockNoteAiGenerateAction, generateActionItems } from \"./BlockNoteEditorAiActions\";\nimport { BlockNoteEditorFormattingToolbar } from \"./BlockNoteEditorFormattingToolbar\";\nimport { BlockNoteEditorMentionHoverCard } from \"./BlockNoteEditorMentionHoverCard\";\nimport {\n createMentionInlineContentSpec,\n type MentionNameResolver,\n type MentionResolveFn,\n} from \"./BlockNoteEditorMentionInlineContent\";\nimport { BlockNoteEditorMentionSuggestionMenu } from \"./BlockNoteEditorSuggestionMenuController\";\n\n/**\n * Lets app code trigger a whole-document AI action from OUTSIDE the editor\n * (a visible button next to the field label, for instance) without owning the\n * BlockNote instance. Delivered through a plain prop, not a React `ref`:\n * `BlockNoteEditorContainer` is a `next/dynamic` import wrapped in\n * `React.memo`, and refs do not pass through that reliably.\n */\nexport type BlockNoteAiHandle = { invokeAi: (type: BlockNoteAiGenerateAction) => void };\n\nexport type BlockNoteAiConfig = {\n endpoint: string;\n entityType: string;\n entityId?: string;\n /** Whole-document actions shown when nothing is selected. Default: [\"fill-template\"]. */\n actions?: BlockNoteAiGenerateAction[];\n};\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 inlineContentSpecs?: Record<string, any>;\n renderOverlays?: (editor: any) => React.ReactNode;\n enableMentions?: boolean;\n disableMentions?: boolean;\n mentionSearchFn?: (\n query: string,\n params?: Record<string, string>,\n ) => Promise<import(\"./BlockNoteEditorSuggestionMenuController\").MentionItem[]>;\n mentionSearchParams?: Record<string, string>;\n mentionResolveFn?: MentionResolveFn;\n suggestionMenuComponent?: React.FC<SuggestionMenuProps<DefaultReactSuggestionItem>>;\n mentionNameResolver?: MentionNameResolver;\n onWarmMentions?: (blocks: PartialBlock[]) => void;\n aiConfig?: BlockNoteAiConfig;\n // When the editor is inside a bounded flex column (parent gives it a real\n // height via flex-1+min-h-0), set this so `.bn-container` shrinks to that\n // height and scrolls internally. Without it the editor grows to fit its\n // content and pushes the surrounding form to scroll instead.\n stretch?: boolean;\n // Gates AI on top of `aiConfig` (credit availability, etc.). Defaults to\n // true so existing callers that only pass `aiConfig` are unaffected. When\n // false, no AI extension is created, the AI toolbar button and AI slash\n // items are hidden, and the editor falls back to the plain slash menu.\n aiEnabled?: boolean;\n // Filled with a {@link BlockNoteAiHandle} while the editor is mounted and AI\n // is on, so a control outside the editor can run a whole-document AI action.\n // Cleared on unmount and whenever AI is unavailable.\n aiHandleRef?: React.MutableRefObject<BlockNoteAiHandle | null>;\n};\n\nfunction isBlockEmpty(block: any): boolean {\n if (!block || typeof block !== \"object\") return true;\n if (block.type !== \"paragraph\") return false;\n if (Array.isArray(block.children) && block.children.length > 0 && !isDocumentEmpty(block.children)) {\n return false;\n }\n if (Array.isArray(block.content)) {\n for (const inline of block.content) {\n if (typeof inline === \"string\") {\n if (inline.trim()) return false;\n } else if (inline && typeof inline === \"object\") {\n if (inline.type !== \"text\") return false;\n if (typeof inline.text === \"string\" && inline.text.trim()) return false;\n }\n }\n } else if (typeof block.content === \"string\" && block.content.trim()) {\n return false;\n }\n return true;\n}\n\nfunction isDocumentEmpty(blocks: any[]): boolean {\n if (!Array.isArray(blocks) || blocks.length === 0) return true;\n return blocks.every(isBlockEmpty);\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=\"text-success h-3 w-3\" />\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=\"text-destructive h-3 w-3\" />\n </Button>\n </span>\n );\n },\n },\n );\n};\n\n/**\n * Custom AI menu wrapper. Surfaces our backend-driven action items\n * (Improve Writing, Fix Spelling) above the free-form prompt input.\n *\n * Why a custom wrapper instead of `<AIMenu items={…}>` with the BlockNote\n * defaults: BlockNote's `PromptSuggestionMenu` hijacks Enter to pick the\n * highlighted item whenever `items.length > 0`. We gate items on\n * - status === \"user-input\"\n * - editor has a selection\n * - prompt input is empty\n * so the moment the user types, items disappear and Enter falls back to\n * free-form submission. Outside `user-input` (review / error states) we\n * keep BlockNote's default review buttons (accept/revert/retry/cancel).\n *\n * Each custom item passes a `type` discriminator on `chatRequestOptions.body`.\n * That field flows through `chat.sendMessage(msg, opts)` to the transport's\n * `prepareSendMessagesRequest({messages, body})` (see types.ts in\n * `@blocknote/xl-ai` — `ChatRequestOptions = Parameters<Chat[\"sendMessage\"]>[1]`).\n * The backend dispatcher reads `body.type` and routes to a per-type handler\n * with its own canonical prompt. NO prompt text lives in this file.\n */\nfunction NarrAIMenu({ actions }: { actions?: BlockNoteAiGenerateAction[] }) {\n const editor = useBlockNoteEditor();\n const ai = useExtension(AIExtension);\n const dict = useAIDictionary();\n const status = useExtensionState(AIExtension, {\n selector: (s) => (s.aiMenuState !== \"closed\" ? s.aiMenuState.status : \"closed\"),\n });\n const [prompt, setPrompt] = useState(\"\");\n // Set by items that pre-fill the input (Translate) so handleSubmit knows\n // which `type` to attach when the user submits the captured text. Cleared\n // after submit or on status change.\n const pendingTypeRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (status === \"ai-writing\" || status === \"user-reviewing\" || status === \"error\" || status === \"closed\") {\n setPrompt(\"\");\n pendingTypeRef.current = null;\n }\n }, [status]);\n\n // Selection-edit ops operate per-block. If the user's selection only\n // covers part of a block (cursor mid-paragraph dragged to mid-next), the\n // rewrite would silently replace the WHOLE containing blocks — beyond\n // what the user highlighted. Expand the selection to whole-block bounds\n // BEFORE invokeAI so the user sees exactly what will be rewritten.\n const expandSelectionToBlocks = useCallback(() => {\n const sel = editor.getSelection?.();\n const blocks = (sel as any)?.blocks;\n if (!Array.isArray(blocks) || blocks.length === 0) return;\n const first = blocks[0];\n const last = blocks[blocks.length - 1];\n try {\n (editor as any).setSelection?.(first, last);\n } catch {\n // If BlockNote's setSelection signature changes, fail silently — the\n // backend still operates per-block, so we just lose the visual hint.\n }\n }, [editor]);\n\n const items = useMemo(() => {\n // Outside user-input (reviewing / error), use BlockNote's default\n // review buttons (accept/revert/retry/cancel). Need to wrap onItemClick\n // because the default items expect a setPrompt argument.\n if (status !== \"user-input\") {\n return getDefaultAIMenuItems(editor, status).map((item) => ({\n ...item,\n onItemClick: () => item.onItemClick(setPrompt),\n }));\n }\n const hasSelection = editor.getSelection() !== undefined;\n const hasTyped = prompt.trim().length > 0;\n // Once the user starts typing, hide all items so Enter submits the\n // free-form (or pending-type) prompt instead of being hijacked.\n if (hasTyped) return [];\n\n const invokeGenerate = (type: BlockNoteAiGenerateAction) => {\n void ai.invokeAI({\n userPrompt: type,\n useSelection: false,\n chatRequestOptions: { body: { type } },\n });\n };\n // Whole-document items are shown in BOTH contexts (with and without\n // selection) because they operate on the whole document — they ignore any\n // active selection. Listed first so the first one is the\n // default-highlighted item.\n const generateItems = generateActionItems(actions, invokeGenerate);\n\n if (hasSelection) {\n // Selection-edit items + the always-available whole-document items.\n // Each selection item invokes ai.invokeAI with chatRequestOptions\n // carrying the `type` body field. The userPrompt is a short tag — the\n // backend ignores it and uses the canonical prompt for the type instead.\n return [\n ...generateItems,\n {\n key: \"improve_writing\",\n title: \"Improve Writing\",\n aliases: [\"improve\", \"rewrite\", \"polish\"],\n icon: <SparklesIcon size={18} />,\n size: \"small\" as const,\n onItemClick: () => {\n expandSelectionToBlocks();\n void ai.invokeAI({\n userPrompt: \"improve-writing\",\n useSelection: true,\n chatRequestOptions: { body: { type: \"improve-writing\" } },\n });\n },\n },\n {\n key: \"fix_spelling\",\n title: \"Fix Spelling\",\n aliases: [\"spelling\", \"grammar\", \"typo\"],\n icon: <TypeIcon size={18} />,\n size: \"small\" as const,\n onItemClick: () => {\n expandSelectionToBlocks();\n void ai.invokeAI({\n userPrompt: \"fix-spelling\",\n useSelection: true,\n chatRequestOptions: { body: { type: \"fix-spelling\" } },\n });\n },\n },\n {\n key: \"translate\",\n title: \"Translate…\",\n aliases: [\"translate\", \"language\"],\n icon: <LanguagesIcon size={18} />,\n size: \"small\" as const,\n // Pre-fills the input with a placeholder. User appends/replaces\n // with the target language and submits via Enter. handleSubmit\n // reads pendingTypeRef and forwards `type: \"translate\"`. We\n // expand the selection now so the user sees the scope before\n // typing the language — handleSubmit doesn't re-expand.\n onItemClick: () => {\n expandSelectionToBlocks();\n pendingTypeRef.current = \"translate\";\n setPrompt(\"Translate to \");\n },\n },\n {\n key: \"simplify\",\n title: \"Simplify\",\n aliases: [\"simplify\", \"easier\", \"plain\"],\n icon: <WandSparklesIcon size={18} />,\n size: \"small\" as const,\n onItemClick: () => {\n expandSelectionToBlocks();\n void ai.invokeAI({\n userPrompt: \"simplify\",\n useSelection: true,\n chatRequestOptions: { body: { type: \"simplify\" } },\n });\n },\n },\n ];\n }\n\n // No selection (the /ai slash menu path): just the whole-document items.\n // Free-form typing still works — once the user types, items hide and\n // Enter submits with no type (backend defaults to fill-template).\n return generateItems;\n }, [editor, status, prompt, ai, expandSelectionToBlocks, actions]);\n\n const handleSubmit = useCallback(\n async (userPrompt: string) => {\n if (!userPrompt.trim()) return;\n const pendingType = pendingTypeRef.current;\n pendingTypeRef.current = null;\n const body = pendingType ? { type: pendingType } : undefined;\n await ai.invokeAI({\n userPrompt,\n useSelection: editor.getSelection() !== undefined,\n ...(body ? { chatRequestOptions: { body } } : {}),\n });\n },\n [ai, editor],\n );\n\n const placeholder =\n status === \"thinking\"\n ? dict.ai_menu.status.thinking\n : status === \"ai-writing\"\n ? dict.ai_menu.status.editing\n : status === \"error\"\n ? dict.ai_menu.status.error\n : dict.ai_menu.input_placeholder;\n\n const disabled = status === \"thinking\" || status === \"ai-writing\";\n\n return (\n <PromptSuggestionMenu\n items={items}\n onManualPromptSubmit={handleSubmit}\n promptText={prompt}\n onPromptTextChange={setPrompt}\n placeholder={placeholder}\n disabled={disabled}\n icon={\n <div className=\"bn-combobox-icon\">\n <SparklesIcon size={16} />\n </div>\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 inlineContentSpecs,\n renderOverlays,\n enableMentions,\n disableMentions,\n mentionSearchFn,\n mentionSearchParams,\n mentionResolveFn,\n suggestionMenuComponent,\n mentionNameResolver,\n onWarmMentions,\n aiConfig,\n stretch,\n aiEnabled = true,\n aiHandleRef,\n}: BlockNoteEditorProps): React.JSX.Element {\n const t = useTranslations();\n const locale = useI18nLocale();\n const { resolvedTheme } = useTheme();\n // Optional on purpose: a host app may mount its own user context instead of\n // this package's, and the editor already degrades without a company — image\n // upload reports it (`uploadImage`) and the AI transport simply omits the\n // company header. Throwing here would take the whole page down instead.\n const company = useCurrentUserContextOptional<UserInterface>()?.company ?? null;\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 // Ensure side menu buttons don't trigger form submission\n useEffect(() => {\n if (!editorRef.current) return;\n const setButtonTypes = () => {\n editorRef.current?.querySelectorAll(\".bn-side-menu button\").forEach((btn) => {\n if (!btn.getAttribute(\"type\")) {\n btn.setAttribute(\"type\", \"button\");\n }\n });\n };\n const observer = new MutationObserver(setButtonTypes);\n observer.observe(editorRef.current, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, []);\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 mentionSpec = useMemo(\n () => createMentionInlineContentSpec(mentionResolveFn, disableMentions, mentionNameResolver),\n [disableMentions, mentionResolveFn, mentionNameResolver],\n );\n\n const schema = useMemo(\n () =>\n BlockNoteSchema.create({\n inlineContentSpecs: {\n ...defaultInlineContentSpecs,\n diffActions: DiffActionsInlineContent,\n mention: mentionSpec,\n ...inlineContentSpecs,\n },\n } as any),\n [DiffActionsInlineContent, mentionSpec, inlineContentSpecs],\n );\n\n const docRef = useRef<{ getDoc: () => any[] }>({ getDoc: () => [] });\n // Selection getter used by the AI transport to attach `selectionBlocks` to\n // the outgoing request metadata. Populated in a useEffect once the editor\n // instance exists; reads the current BlockNote selection on every send.\n const selectionRef = useRef<{ getSelectedBlocks: () => any[] }>({ getSelectedBlocks: () => [] });\n\n const companyId = company?.id;\n const aiExtension = useMemo(() => {\n if (!aiConfig || !aiEnabled) return undefined;\n const base = getPublicApiUrl();\n const url = new URL(aiConfig.endpoint, base.endsWith(\"/\") ? base : base + \"/\").toString();\n return AIExtension({\n transport: new DefaultChatTransport({\n api: url,\n credentials: \"include\",\n headers: async () => {\n const headers: Record<string, string> = { \"x-language\": locale };\n const token = await getClientToken();\n if (token) headers[\"Authorization\"] = `Bearer ${token}`;\n if (companyId) headers[\"x-companyid\"] = companyId;\n return headers;\n },\n prepareSendMessagesRequest: ({ messages, body }: any) => {\n let lastUserIdx = -1;\n for (let i = messages.length - 1; i >= 0; i--) {\n if (messages[i]?.role === \"user\") {\n lastUserIdx = i;\n break;\n }\n }\n const selectedBlocks = selectionRef.current.getSelectedBlocks();\n const augmented = messages.map((m: any, i: number) =>\n i === lastUserIdx\n ? {\n ...m,\n metadata: {\n ...(m.metadata ?? {}),\n entityType: aiConfig.entityType,\n entityId: aiConfig.entityId,\n blocks: docRef.current.getDoc(),\n selectionBlocks: selectedBlocks,\n },\n }\n : m,\n );\n return { body: { ...(body ?? {}), messages: augmented } };\n },\n }),\n });\n }, [aiConfig, aiEnabled, companyId, locale]);\n\n const uploadImage = useCallback(\n async (file: File): Promise<string> => {\n if (!company) {\n errorToast({\n title: t(`common.errors.upload`),\n error: t(`common.errors.upload_description`),\n });\n throw new Error(t(`common.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(`common.blocknote.placeholder`),\n },\n schema,\n initialContent: validatedInitialContent,\n uploadFile: uploadImage,\n extensions: aiExtension ? [aiExtension] : undefined,\n dictionary: aiExtension ? { ...coreEn, ai: aiEn } : undefined,\n }),\n [placeholder, t, schema, validatedInitialContent, uploadImage, aiExtension],\n ),\n );\n\n // Publish the outside-the-editor AI trigger. `editor.getExtension(AIExtension)`\n // is BlockNote 0.54's documented lookup by extension factory (core's\n // `getExtension` resolves a function argument through `extensionFactories`),\n // so the instance is reachable without the `useExtension` hook that only\n // works inside the BlockNote context (NarrAIMenu). The menu MUST be opened\n // first: `invokeAI` routes every status update through `setAIResponseStatus`,\n // which is a no-op while `aiMenuState === \"closed\"` — without the open menu\n // the request runs but the accept / reject UI never appears.\n useEffect(() => {\n if (!aiHandleRef) return;\n if (!aiConfig || !aiEnabled) {\n aiHandleRef.current = null;\n return;\n }\n aiHandleRef.current = {\n invokeAi: (type: BlockNoteAiGenerateAction) => {\n const ai = editor.getExtension(AIExtension);\n if (!ai) return;\n editor.focus();\n const blocks = editor.document;\n const anchor = blocks?.[blocks.length - 1];\n if (anchor?.id) ai.openAIMenuAtBlock(anchor.id);\n void ai.invokeAI({\n userPrompt: type,\n useSelection: false,\n chatRequestOptions: { body: { type } },\n });\n },\n };\n return () => {\n aiHandleRef.current = null;\n };\n }, [aiHandleRef, aiConfig, aiEnabled, editor]);\n\n // Tracks the hash of the document the editor itself just emitted via onChange.\n // The sync effect below uses it to skip replaceBlocks when the parent's\n // initialContent is just an echo of our own emission (form-controlled flow).\n const lastEmittedHashRef = useRef<string | null>(null);\n\n const handleChange = useCallback(async () => {\n if (!onChange) return;\n const newBlocks = editor.document;\n lastEmittedHashRef.current = JSON.stringify(newBlocks);\n const isEmpty = isDocumentEmpty(newBlocks);\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, isEmpty, 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 // Skip replaceBlocks when the new initialContent is just an echo of what\n // the editor itself emitted. Without this, a form-controlled parent\n // (FormBlockNote) round-trips field.value back as initialContent on every\n // keystroke and triggers replaceBlocks, which resets the cursor and can\n // strip just-inserted inline content like mentions.\n if (lastEmittedHashRef.current === hash) {\n previousContentHashRef.current = hash;\n return;\n }\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 useEffect(() => {\n if (!onWarmMentions || !initialContent || !Array.isArray(initialContent) || initialContent.length === 0) return;\n onWarmMentions(initialContent);\n }, [onWarmMentions, initialContent]);\n\n useEffect(() => {\n docRef.current.getDoc = () => editor?.document ?? [];\n selectionRef.current.getSelectedBlocks = () => {\n const sel = editor?.getSelection?.();\n const blocks = (sel as any)?.blocks;\n return Array.isArray(blocks) ? blocks : [];\n };\n }, [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\n ref={editorRef}\n className={cn(\n bordered ? \"rounded-md border border-input bg-input/20 dark:bg-input/30\" : \"\",\n \"flex flex-col w-full\",\n // Pin BlockNote's font-size so it doesn't jump from 14→16px when the\n // xl-ai AIMenu mounts. The shadcn theme sets `.bn-default-styles {\n // font-size: 16px }` explicitly; outside AI mode the form's text-sm\n // wins via cascade, but ForkYDocExtension re-evaluates the style\n // context on AI activation and the explicit 16px takes over.\n \"[&_.bn-default-styles]:!text-sm\",\n className,\n )}\n >\n <BlockNoteView\n editor={editor}\n onChange={handleChange}\n editable={onChange !== undefined}\n formattingToolbar={false}\n slashMenu={!aiConfig || !aiEnabled}\n // Follow the app theme: hardcoding \"light\" leaves dark (light-theme)\n // text on the dark card, which is nearly unreadable in dark mode.\n theme={resolvedTheme === \"dark\" ? \"dark\" : \"light\"}\n // `className` is applied by BlockNote to both the main `.bn-container`\n // AND `editor.portalElement` (the floating-UI portal root). Gate `p-4`\n // on `.bn-container` so it doesn't add padding to the empty portal\n // element and produce a phantom scrollbar on the wrapper.\n className={cn(\n \"BlockNoteView flex-1\",\n onChange && \"[&.bn-container]:p-4\",\n // In stretch mode the parent chain caps our height via flex; without\n // these two classes the `.bn-container` keeps `min-height: auto`\n // (its content's intrinsic height) and pushes the bordered wrapper\n // — and the surrounding EditorSheet form — to scroll instead of\n // scrolling internally.\n onChange && stretch && \"[&.bn-container]:min-h-0 [&.bn-container]:overflow-y-auto\",\n size === \"sm\" && \"small\",\n )}\n >\n <BlockNoteEditorFormattingToolbar showAI={!!aiConfig && aiEnabled} />\n {enableMentions && mentionSearchFn && (\n <BlockNoteEditorMentionSuggestionMenu\n editor={editor}\n mentionSearchFn={mentionSearchFn}\n mentionSearchParams={mentionSearchParams}\n suggestionMenuComponent={suggestionMenuComponent}\n />\n )}\n {renderOverlays?.(editor)}\n {enableMentions && mentionResolveFn && (\n <BlockNoteEditorMentionHoverCard containerRef={editorRef} mentionResolveFn={mentionResolveFn} />\n )}\n {aiConfig && aiEnabled && (\n <SuggestionMenuController\n triggerCharacter=\"/\"\n getItems={async (query: string) =>\n filterSuggestionItems([...getDefaultReactSlashMenuItems(editor), ...getAISlashMenuItems(editor)], query)\n }\n />\n )}\n {aiConfig && aiEnabled && <AIMenuController aiMenu={() => <NarrAIMenu actions={aiConfig.actions} />} />}\n </BlockNoteView>\n </div>\n );\n}\n","import { LayoutTemplateIcon, SparklesIcon } from \"lucide-react\";\nimport React from \"react\";\n\n/**\n * Whole-document AI actions an editor can offer in its AI menu when nothing\n * is selected. Each maps to a backend `type` discriminator; NO prompt text\n * lives here. Selection-edit actions (Improve, Fix spelling, …) are separate\n * and always available.\n */\nexport type BlockNoteAiGenerateAction = \"fill-template\" | \"draft-impression\";\n\nexport const DEFAULT_AI_GENERATE_ACTIONS: BlockNoteAiGenerateAction[] = [\"fill-template\"];\n\nexport type AiGenerateMenuItem = {\n key: string;\n title: string;\n aliases: string[];\n /** BlockNote's DefaultReactSuggestionItem types icon as an element, not ReactNode. */\n icon: React.JSX.Element;\n size: \"small\";\n onItemClick: () => void;\n};\n\nconst ITEMS: Record<BlockNoteAiGenerateAction, Omit<AiGenerateMenuItem, \"onItemClick\">> = {\n \"fill-template\": {\n key: \"generate_from_template\",\n title: \"Generate from Template\",\n aliases: [\"generate\", \"template\", \"fill\"],\n icon: <LayoutTemplateIcon size={18} />,\n size: \"small\",\n },\n \"draft-impression\": {\n key: \"suggest_impression\",\n title: \"Suggest impression\",\n aliases: [\"suggest\", \"impression\"],\n icon: <SparklesIcon size={18} />,\n size: \"small\",\n },\n};\n\nexport function generateActionItems(\n actions: BlockNoteAiGenerateAction[] | undefined,\n invoke: (type: BlockNoteAiGenerateAction) => void,\n): AiGenerateMenuItem[] {\n return (actions ?? DEFAULT_AI_GENERATE_ACTIONS).map((type) => ({\n ...ITEMS[type],\n onItemClick: () => invoke(type),\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\";\nimport { AIToolbarButton } from \"@blocknote/xl-ai\";\n\nexport function BlockNoteEditorFormattingToolbar({ showAI = false }: { showAI?: boolean }) {\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\n {showAI ? <AIToolbarButton key={\"aiToolbarButton\"} /> : null}\n </FormattingToolbar>\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,iBAAiB,2BAA2B,6BAA2C;AAChG,SAAS,MAAM,cAAc;AAC7B;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,OAAO;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SA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