@carlonicora/nextjs-jsonapi 1.106.2 → 1.107.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 (30) hide show
  1. package/dist/{BlockNoteEditor-54ZSYWYM.js → BlockNoteEditor-EAIEASEE.js} +285 -22
  2. package/dist/BlockNoteEditor-EAIEASEE.js.map +1 -0
  3. package/dist/{BlockNoteEditor-Z3LF4LFQ.mjs → BlockNoteEditor-U4MWBUCU.mjs} +278 -15
  4. package/dist/BlockNoteEditor-U4MWBUCU.mjs.map +1 -0
  5. package/dist/billing/index.js +299 -299
  6. package/dist/billing/index.mjs +1 -1
  7. package/dist/{chunk-THZ4W7TG.mjs → chunk-3ER4NXVY.mjs} +31 -4
  8. package/dist/chunk-3ER4NXVY.mjs.map +1 -0
  9. package/dist/{chunk-UB7VGH2D.js → chunk-YC2JK36B.js} +131 -104
  10. package/dist/chunk-YC2JK36B.js.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 +15 -2
  14. package/dist/components/index.d.ts +15 -2
  15. package/dist/components/index.js +4 -2
  16. package/dist/components/index.js.map +1 -1
  17. package/dist/components/index.mjs +3 -1
  18. package/dist/contexts/index.js +2 -2
  19. package/dist/contexts/index.mjs +1 -1
  20. package/package.json +3 -1
  21. package/src/components/editors/BlockNoteEditor.tsx +361 -5
  22. package/src/components/editors/BlockNoteEditorFormattingToolbar.tsx +4 -1
  23. package/src/components/editors/BlockNoteEditorMentionInlineContent.tsx +27 -0
  24. package/src/components/editors/__tests__/BlockNoteEditorMentionInlineContent.test.ts +97 -0
  25. package/src/components/editors/index.ts +1 -0
  26. package/src/components/forms/FormBlockNote.tsx +4 -0
  27. package/dist/BlockNoteEditor-54ZSYWYM.js.map +0 -1
  28. package/dist/BlockNoteEditor-Z3LF4LFQ.mjs.map +0 -1
  29. package/dist/chunk-THZ4W7TG.mjs.map +0 -1
  30. package/dist/chunk-UB7VGH2D.js.map +0 -1
@@ -47,7 +47,7 @@ import {
47
47
  TabsList,
48
48
  TabsTrigger,
49
49
  useCurrentUserContext
50
- } from "../chunk-THZ4W7TG.mjs";
50
+ } from "../chunk-3ER4NXVY.mjs";
51
51
  import {
52
52
  getRoleId,
53
53
  getStripePublishableKey
@@ -9588,7 +9588,7 @@ import { useRef as useRef15 } from "react";
9588
9588
  import dynamic from "next/dynamic";
9589
9589
  import React15 from "react";
9590
9590
  import { jsx as jsx74 } from "react/jsx-runtime";
9591
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-Z3LF4LFQ.mjs"), {
9591
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-U4MWBUCU.mjs"), {
9592
9592
  ssr: false
9593
9593
  });
9594
9594
  var BlockNoteEditorContainer = React15.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -9617,7 +9617,8 @@ function FormBlockNote({
9617
9617
  mentionResolveFn,
9618
9618
  suggestionMenuComponent,
9619
9619
  mentionNameResolver,
9620
- onWarmMentions
9620
+ onWarmMentions,
9621
+ aiConfig
9621
9622
  }) {
9622
9623
  const initialContentRef = useRef15(null);
9623
9624
  const lastEditorContentRef = useRef15(void 0);
@@ -9665,6 +9666,8 @@ function FormBlockNote({
9665
9666
  suggestionMenuComponent,
9666
9667
  mentionNameResolver,
9667
9668
  onWarmMentions,
9669
+ aiConfig,
9670
+ stretch,
9668
9671
  className: cn(stretch && "min-h-0 flex-1")
9669
9672
  }
9670
9673
  );
@@ -14147,7 +14150,21 @@ var mentionDataAttrs = /* @__PURE__ */ __name((p) => ({
14147
14150
  "data-mention-type": p.entityType,
14148
14151
  "data-mention-alias": p.alias
14149
14152
  }), "mentionDataAttrs");
14153
+ var parseMentionElement = /* @__PURE__ */ __name((element) => {
14154
+ const id = element.getAttribute("data-mention-id");
14155
+ const entityType = element.getAttribute("data-mention-type");
14156
+ const alias = element.getAttribute("data-mention-alias");
14157
+ if (!id || !entityType || !alias) return void 0;
14158
+ return { id, entityType, alias };
14159
+ }, "parseMentionElement");
14150
14160
  var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableMention, nameResolver) => {
14161
+ const MentionExternalHTML = /* @__PURE__ */ __name((props) => {
14162
+ const displayName = nameResolver?.(props.id, props.entityType, props.alias) ?? props.alias;
14163
+ return /* @__PURE__ */ jsxs91("span", { "data-mention-id": props.id, "data-mention-type": props.entityType, "data-mention-alias": props.alias, children: [
14164
+ "@",
14165
+ displayName
14166
+ ] });
14167
+ }, "MentionExternalHTML");
14151
14168
  const Mention = React22.memo(/* @__PURE__ */ __name(function Mention2(props) {
14152
14169
  const displayName = nameResolver?.(props.id, props.entityType, props.alias) ?? props.alias;
14153
14170
  if (disableMention) {
@@ -14196,7 +14213,16 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
14196
14213
  entityType: props.inlineContent.props.entityType,
14197
14214
  alias: props.inlineContent.props.alias
14198
14215
  }
14199
- ), "render")
14216
+ ), "render"),
14217
+ toExternalHTML: /* @__PURE__ */ __name((props) => /* @__PURE__ */ jsx152(
14218
+ MentionExternalHTML,
14219
+ {
14220
+ id: props.inlineContent.props.id,
14221
+ entityType: props.inlineContent.props.entityType,
14222
+ alias: props.inlineContent.props.alias
14223
+ }
14224
+ ), "toExternalHTML"),
14225
+ parse: /* @__PURE__ */ __name((element) => parseMentionElement(element), "parse")
14200
14226
  }
14201
14227
  );
14202
14228
  }, "createMentionInlineContentSpec");
@@ -22329,6 +22355,7 @@ export {
22329
22355
  ErrorDetails,
22330
22356
  BlockNoteEditorMentionHoverCard,
22331
22357
  mentionDataAttrs,
22358
+ parseMentionElement,
22332
22359
  createMentionInlineContentSpec,
22333
22360
  useMentionInsert,
22334
22361
  BlockNoteEditorMentionSuggestionMenu,
@@ -22508,4 +22535,4 @@ export {
22508
22535
  useOAuthClients,
22509
22536
  useOAuthClient
22510
22537
  };
22511
- //# sourceMappingURL=chunk-THZ4W7TG.mjs.map
22538
+ //# sourceMappingURL=chunk-3ER4NXVY.mjs.map