@carlonicora/nextjs-jsonapi 1.94.0 → 1.95.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.
@@ -47,7 +47,7 @@ import {
47
47
  TabsList,
48
48
  TabsTrigger,
49
49
  useCurrentUserContext
50
- } from "../chunk-PNQDUCEN.mjs";
50
+ } from "../chunk-B742NQJF.mjs";
51
51
  import {
52
52
  getRoleId,
53
53
  getStripePublishableKey
@@ -9222,7 +9222,7 @@ import { useRef as useRef15 } from "react";
9222
9222
  import dynamic from "next/dynamic";
9223
9223
  import React14 from "react";
9224
9224
  import { jsx as jsx73 } from "react/jsx-runtime";
9225
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-S62X5HSE.mjs"), {
9225
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-G3EMXRKU.mjs"), {
9226
9226
  ssr: false
9227
9227
  });
9228
9228
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -13769,14 +13769,28 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
13769
13769
  // src/components/editors/BlockNoteEditorSuggestionMenuController.tsx
13770
13770
  import { SuggestionMenuController } from "@blocknote/react";
13771
13771
  import { autoUpdate, flip, shift } from "@floating-ui/react";
13772
- import { useCallback as useCallback28 } from "react";
13772
+ import React22, { useCallback as useCallback28 } from "react";
13773
13773
  import { jsx as jsx152 } from "react/jsx-runtime";
13774
+ var MentionInsertContext = React22.createContext(null);
13775
+ var useMentionInsert = /* @__PURE__ */ __name(() => React22.useContext(MentionInsertContext), "useMentionInsert");
13774
13776
  function BlockNoteEditorMentionSuggestionMenu({
13775
13777
  editor,
13776
13778
  mentionSearchFn,
13777
13779
  mentionSearchParams,
13778
13780
  suggestionMenuComponent
13779
13781
  }) {
13782
+ const onMentionInsert = useCallback28(
13783
+ (id, name, entityType) => {
13784
+ editor.insertInlineContent([
13785
+ {
13786
+ type: "mention",
13787
+ props: { alias: name, id, entityType }
13788
+ },
13789
+ " "
13790
+ ]);
13791
+ },
13792
+ [editor]
13793
+ );
13780
13794
  const getItems = useCallback28(
13781
13795
  async (query) => {
13782
13796
  const results = await mentionSearchFn(query, mentionSearchParams);
@@ -13801,7 +13815,7 @@ function BlockNoteEditorMentionSuggestionMenu({
13801
13815
  },
13802
13816
  [editor, mentionSearchFn, mentionSearchParams]
13803
13817
  );
13804
- return /* @__PURE__ */ jsx152("div", { className: "blocknote-suggestion-container", style: { position: "static" }, children: /* @__PURE__ */ jsx152(
13818
+ return /* @__PURE__ */ jsx152(MentionInsertContext.Provider, { value: onMentionInsert, children: /* @__PURE__ */ jsx152("div", { className: "blocknote-suggestion-container", style: { position: "static" }, children: /* @__PURE__ */ jsx152(
13805
13819
  SuggestionMenuController,
13806
13820
  {
13807
13821
  triggerCharacter: "@",
@@ -13816,7 +13830,7 @@ function BlockNoteEditorMentionSuggestionMenu({
13816
13830
  }
13817
13831
  }
13818
13832
  }
13819
- ) });
13833
+ ) }) });
13820
13834
  }
13821
13835
  __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMenu");
13822
13836
 
@@ -21809,6 +21823,7 @@ export {
21809
21823
  BlockNoteEditorMentionHoverCard,
21810
21824
  mentionDataAttrs,
21811
21825
  createMentionInlineContentSpec,
21826
+ useMentionInsert,
21812
21827
  BlockNoteEditorMentionSuggestionMenu,
21813
21828
  BlockNoteEditorContainer,
21814
21829
  CommonAssociationTrigger,
@@ -21985,4 +22000,4 @@ export {
21985
22000
  useOAuthClients,
21986
22001
  useOAuthClient
21987
22002
  };
21988
- //# sourceMappingURL=chunk-PNQDUCEN.mjs.map
22003
+ //# sourceMappingURL=chunk-B742NQJF.mjs.map