@carlonicora/nextjs-jsonapi 3.15.2 → 3.16.1

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 (36) hide show
  1. package/dist/{BlockNoteEditor-XQTV2I2E.mjs → BlockNoteEditor-6SQR7WNA.mjs} +101 -61
  2. package/dist/BlockNoteEditor-6SQR7WNA.mjs.map +1 -0
  3. package/dist/{BlockNoteEditor-FLXSBVXM.js → BlockNoteEditor-BQ46E6YI.js} +83 -43
  4. package/dist/BlockNoteEditor-BQ46E6YI.js.map +1 -0
  5. package/dist/billing/index.js +335 -335
  6. package/dist/billing/index.mjs +1 -1
  7. package/dist/{chunk-2GENOK3L.js → chunk-2HZCW4ML.js} +26 -15
  8. package/dist/chunk-2HZCW4ML.js.map +1 -0
  9. package/dist/{chunk-G2C6UT2Q.mjs → chunk-YRWZGH66.mjs} +26 -15
  10. package/dist/chunk-YRWZGH66.mjs.map +1 -0
  11. package/dist/client/index.js +2 -2
  12. package/dist/client/index.mjs +1 -1
  13. package/dist/components/index.d.mts +37 -5
  14. package/dist/components/index.d.ts +37 -5
  15. package/dist/components/index.js +2 -2
  16. package/dist/components/index.mjs +1 -1
  17. package/dist/contexts/index.js +2 -2
  18. package/dist/contexts/index.mjs +1 -1
  19. package/dist/features/help/index.js +31 -31
  20. package/dist/features/help/index.mjs +1 -1
  21. package/dist/features/tokenusage/index.js +75 -75
  22. package/dist/features/tokenusage/index.mjs +1 -1
  23. package/package.json +1 -1
  24. package/src/components/editors/BlockNoteEditor.tsx +70 -33
  25. package/src/components/editors/BlockNoteEditorAiActions.tsx +49 -0
  26. package/src/components/editors/__tests__/BlockNoteEditorAiActions.test.ts +25 -0
  27. package/src/components/editors/index.ts +2 -1
  28. package/src/components/forms/FormBlockNote.tsx +8 -0
  29. package/src/components/forms/FormFieldWrapper.tsx +22 -6
  30. package/src/features/assistant/components/parts/AssistantThread.tsx +6 -3
  31. package/src/features/assistant/components/parts/__tests__/AssistantThread.spec.tsx +36 -5
  32. package/src/features/assistant-message/components/MessageList.tsx +14 -10
  33. package/dist/BlockNoteEditor-FLXSBVXM.js.map +0 -1
  34. package/dist/BlockNoteEditor-XQTV2I2E.mjs.map +0 -1
  35. package/dist/chunk-2GENOK3L.js.map +0 -1
  36. package/dist/chunk-G2C6UT2Q.mjs.map +0 -1
@@ -8367,6 +8367,7 @@ function FormFieldWrapper({
8367
8367
  form,
8368
8368
  name,
8369
8369
  label,
8370
+ labelAction,
8370
8371
  description,
8371
8372
  isRequired,
8372
8373
  orientation = "vertical",
@@ -8380,10 +8381,16 @@ function FormFieldWrapper({
8380
8381
  control: form.control,
8381
8382
  name,
8382
8383
  render: ({ field, fieldState }) => /* @__PURE__ */ jsxs32(Field, { orientation, className, "data-invalid": !!fieldState.error, "data-testid": testId, children: [
8383
- label && /* @__PURE__ */ jsxs32(FieldLabel, { children: [
8384
+ label && (labelAction ? /* @__PURE__ */ jsxs32("div", { className: "flex w-full items-center justify-between gap-2", children: [
8385
+ /* @__PURE__ */ jsxs32(FieldLabel, { children: [
8386
+ label,
8387
+ isRequired && /* @__PURE__ */ jsx67("span", { className: "ms-1 text-destructive", children: "*" })
8388
+ ] }),
8389
+ labelAction
8390
+ ] }) : /* @__PURE__ */ jsxs32(FieldLabel, { children: [
8384
8391
  label,
8385
8392
  isRequired && /* @__PURE__ */ jsx67("span", { className: "ms-1 text-destructive", children: "*" })
8386
- ] }),
8393
+ ] })),
8387
8394
  children(field, fieldState),
8388
8395
  description && /* @__PURE__ */ jsx67(FieldDescription, { children: description }),
8389
8396
  fieldState.error && /* @__PURE__ */ jsx67(FieldError, { children: fieldState.error.message })
@@ -10385,7 +10392,7 @@ import { useRef as useRef17 } from "react";
10385
10392
  import dynamic from "next/dynamic";
10386
10393
  import React18 from "react";
10387
10394
  import { jsx as jsx90 } from "react/jsx-runtime";
10388
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-XQTV2I2E.mjs"), {
10395
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-6SQR7WNA.mjs"), {
10389
10396
  ssr: false
10390
10397
  });
10391
10398
  var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -10415,7 +10422,9 @@ function FormBlockNote({
10415
10422
  suggestionMenuComponent,
10416
10423
  mentionNameResolver,
10417
10424
  onWarmMentions,
10418
- aiConfig
10425
+ aiConfig,
10426
+ aiHandleRef,
10427
+ headerAction
10419
10428
  }) {
10420
10429
  const initialContentRef = useRef17(null);
10421
10430
  const lastEditorContentRef = useRef17(void 0);
@@ -10433,6 +10442,7 @@ function FormBlockNote({
10433
10442
  form,
10434
10443
  name: id,
10435
10444
  label: name,
10445
+ labelAction: headerAction,
10436
10446
  isRequired,
10437
10447
  description,
10438
10448
  testId,
@@ -10464,6 +10474,7 @@ function FormBlockNote({
10464
10474
  mentionNameResolver,
10465
10475
  onWarmMentions,
10466
10476
  aiConfig,
10477
+ aiHandleRef,
10467
10478
  stretch,
10468
10479
  className: cn(stretch && "min-h-0 flex-1")
10469
10480
  }
@@ -22073,7 +22084,8 @@ function MessageList({
22073
22084
  failedMessageIds,
22074
22085
  onRetry,
22075
22086
  renderApprovalAction,
22076
- renderMention
22087
+ renderMention,
22088
+ lastMessageRef
22077
22089
  }) {
22078
22090
  const ordered = [...messages].sort((a, b) => a.position - b.position);
22079
22091
  let lastAssistantIndex = -1;
@@ -22083,7 +22095,7 @@ function MessageList({
22083
22095
  break;
22084
22096
  }
22085
22097
  }
22086
- return /* @__PURE__ */ jsx251("div", { className: "flex min-w-0 flex-col gap-y-3", children: ordered.map((m, i) => /* @__PURE__ */ jsx251(
22098
+ return /* @__PURE__ */ jsx251("div", { className: "flex min-w-0 flex-col gap-y-3", children: ordered.map((m, i) => /* @__PURE__ */ jsx251("div", { ref: i === ordered.length - 1 ? lastMessageRef : void 0, className: "flex min-w-0 flex-col", children: /* @__PURE__ */ jsx251(
22087
22099
  MessageItem,
22088
22100
  {
22089
22101
  message: m,
@@ -22093,9 +22105,8 @@ function MessageList({
22093
22105
  onRetry,
22094
22106
  renderApprovalAction,
22095
22107
  renderMention
22096
- },
22097
- m.id
22098
- )) });
22108
+ }
22109
+ ) }, m.id)) });
22099
22110
  }
22100
22111
  __name(MessageList, "MessageList");
22101
22112
 
@@ -22125,9 +22136,9 @@ function AssistantThread({
22125
22136
  renderApprovalAction,
22126
22137
  renderMention
22127
22138
  }) {
22128
- const endRef = useRef37(null);
22139
+ const lastMessageRef = useRef37(null);
22129
22140
  useEffect69(() => {
22130
- endRef.current?.scrollIntoView({ behavior: "smooth" });
22141
+ lastMessageRef.current?.scrollIntoView({ block: "start", behavior: "smooth" });
22131
22142
  }, [messages.length, sending]);
22132
22143
  return /* @__PURE__ */ jsxs146("div", { className: "flex-1 min-w-0 overflow-x-hidden overflow-y-auto px-6 py-5", children: [
22133
22144
  /* @__PURE__ */ jsx253(
@@ -22138,11 +22149,11 @@ function AssistantThread({
22138
22149
  failedMessageIds,
22139
22150
  onRetry,
22140
22151
  renderApprovalAction,
22141
- renderMention
22152
+ renderMention,
22153
+ lastMessageRef
22142
22154
  }
22143
22155
  ),
22144
- sending && /* @__PURE__ */ jsx253(AssistantStatusLine, { status }),
22145
- /* @__PURE__ */ jsx253("div", { ref: endRef })
22156
+ sending && /* @__PURE__ */ jsx253(AssistantStatusLine, { status })
22146
22157
  ] });
22147
22158
  }
22148
22159
  __name(AssistantThread, "AssistantThread");
@@ -27015,4 +27026,4 @@ export {
27015
27026
  useOAuthClients,
27016
27027
  useOAuthClient
27017
27028
  };
27018
- //# sourceMappingURL=chunk-G2C6UT2Q.mjs.map
27029
+ //# sourceMappingURL=chunk-YRWZGH66.mjs.map