@carlonicora/nextjs-jsonapi 1.93.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.
Files changed (33) hide show
  1. package/dist/{BlockNoteEditor-R2QZFXBW.mjs → BlockNoteEditor-G3EMXRKU.mjs} +2 -2
  2. package/dist/{BlockNoteEditor-V3IP55WY.js → BlockNoteEditor-Y37HALIN.js} +9 -9
  3. package/dist/{BlockNoteEditor-V3IP55WY.js.map → BlockNoteEditor-Y37HALIN.js.map} +1 -1
  4. package/dist/billing/index.js +299 -299
  5. package/dist/billing/index.mjs +1 -1
  6. package/dist/{chunk-FELMRARS.mjs → chunk-B742NQJF.mjs} +31 -8
  7. package/dist/chunk-B742NQJF.mjs.map +1 -0
  8. package/dist/{chunk-QR5HL7WP.js → chunk-BFT6GR4C.js} +31 -8
  9. package/dist/chunk-BFT6GR4C.js.map +1 -0
  10. package/dist/client/index.d.mts +1 -1
  11. package/dist/client/index.d.ts +1 -1
  12. package/dist/client/index.js +2 -2
  13. package/dist/client/index.mjs +1 -1
  14. package/dist/components/index.d.mts +3 -1
  15. package/dist/components/index.d.ts +3 -1
  16. package/dist/components/index.js +4 -2
  17. package/dist/components/index.js.map +1 -1
  18. package/dist/components/index.mjs +3 -1
  19. package/dist/{content.fields-Ck5lkQ5d.d.mts → content.fields-hzZvhlBd.d.mts} +2 -0
  20. package/dist/{content.fields-Ck5lkQ5d.d.ts → content.fields-hzZvhlBd.d.ts} +2 -0
  21. package/dist/contexts/index.js +2 -2
  22. package/dist/contexts/index.mjs +1 -1
  23. package/dist/core/index.d.mts +1 -1
  24. package/dist/core/index.d.ts +1 -1
  25. package/dist/index.d.mts +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/package.json +1 -1
  28. package/src/components/editors/BlockNoteEditorSuggestionMenuController.tsx +35 -15
  29. package/src/hooks/useCustomD3Graph.tsx +31 -2
  30. package/src/interfaces/d3.node.interface.ts +2 -0
  31. package/dist/chunk-FELMRARS.mjs.map +0 -1
  32. package/dist/chunk-QR5HL7WP.js.map +0 -1
  33. /package/dist/{BlockNoteEditor-R2QZFXBW.mjs.map → BlockNoteEditor-G3EMXRKU.mjs.map} +0 -0
@@ -47,7 +47,7 @@ import {
47
47
  TabsList,
48
48
  TabsTrigger,
49
49
  useCurrentUserContext
50
- } from "../chunk-FELMRARS.mjs";
50
+ } from "../chunk-B742NQJF.mjs";
51
51
  import {
52
52
  getRoleId,
53
53
  getStripePublishableKey
@@ -6688,7 +6688,7 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, loadingNode
6688
6688
  }
6689
6689
  });
6690
6690
  const link = graphGroup.append("g").attr("stroke", "#999").attr("stroke-opacity", 0.6).selectAll("line").data(visibleLinks).join("line").attr("x1", (d) => d.source.x || 0).attr("y1", (d) => d.source.y || 0).attr("x2", (d) => d.target.x || 0).attr("y2", (d) => d.target.y || 0).attr("stroke-width", 1.5);
6691
- const node = graphGroup.append("g").selectAll("g").data(visibleNodes).join("g").attr("class", "node-group").attr("cursor", "pointer").attr("transform", (d) => `translate(${d.x || 0}, ${d.y || 0})`).call(
6691
+ const node = graphGroup.append("g").selectAll("g").data(visibleNodes).join("g").attr("class", "node-group").attr("data-id", (d) => d.id).attr("cursor", "pointer").attr("transform", (d) => `translate(${d.x || 0}, ${d.y || 0})`).call(
6692
6692
  d3.drag().subject(function(d) {
6693
6693
  return d;
6694
6694
  }).on("start", function(event, d) {
@@ -6749,7 +6749,15 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, loadingNode
6749
6749
  onNodeClick(d.id);
6750
6750
  });
6751
6751
  node.each(function(d) {
6752
- if (d.icon) {
6752
+ if (d.imageUrl) {
6753
+ const clipId = `clip-${d.id}`;
6754
+ const defs = d3.select(this).append("defs");
6755
+ defs.append("clipPath").attr("id", clipId).append("circle").attr("r", nodeRadius);
6756
+ d3.select(this).append("image").attr("href", d.imageUrl).attr("x", -nodeRadius).attr("y", -nodeRadius).attr("width", nodeRadius * 2).attr("height", nodeRadius * 2).attr("preserveAspectRatio", "xMidYMid slice").attr("clip-path", `url(#${clipId})`).style("pointer-events", "all").on("click", (event) => {
6757
+ event.stopPropagation();
6758
+ onNodeClick(d.id);
6759
+ });
6760
+ } else if (d.icon) {
6753
6761
  const Icon = d.icon;
6754
6762
  const iconSvg = renderToStaticMarkup(/* @__PURE__ */ jsx49(Icon, { size: nodeRadius / 2, color: "white" }));
6755
6763
  const _iconGroup = d3.select(this).append("g").html(iconSvg).attr("transform", `translate(${-nodeRadius / 4}, ${-nodeRadius / 4})`).style("pointer-events", "all").on("click", (event) => {
@@ -6777,7 +6785,7 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, loadingNode
6777
6785
  textElement.append("tspan").attr("x", 0).attr("dy", index === 0 ? `${startY}em` : `${lineHeight}em`).text(word);
6778
6786
  });
6779
6787
  } else {
6780
- textElement.attr("dy", -nodeRadius - 5).attr("fill", "currentColor").text(d.name);
6788
+ textElement.attr("dy", -nodeRadius - 5).attr("fill", "currentColor").attr("font-size", d.bold ? 16 : 12).attr("font-weight", d.bold ? 700 : null).text(d.name);
6781
6789
  }
6782
6790
  });
6783
6791
  return () => {
@@ -9214,7 +9222,7 @@ import { useRef as useRef15 } from "react";
9214
9222
  import dynamic from "next/dynamic";
9215
9223
  import React14 from "react";
9216
9224
  import { jsx as jsx73 } from "react/jsx-runtime";
9217
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-R2QZFXBW.mjs"), {
9225
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-G3EMXRKU.mjs"), {
9218
9226
  ssr: false
9219
9227
  });
9220
9228
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -13761,14 +13769,28 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
13761
13769
  // src/components/editors/BlockNoteEditorSuggestionMenuController.tsx
13762
13770
  import { SuggestionMenuController } from "@blocknote/react";
13763
13771
  import { autoUpdate, flip, shift } from "@floating-ui/react";
13764
- import { useCallback as useCallback28 } from "react";
13772
+ import React22, { useCallback as useCallback28 } from "react";
13765
13773
  import { jsx as jsx152 } from "react/jsx-runtime";
13774
+ var MentionInsertContext = React22.createContext(null);
13775
+ var useMentionInsert = /* @__PURE__ */ __name(() => React22.useContext(MentionInsertContext), "useMentionInsert");
13766
13776
  function BlockNoteEditorMentionSuggestionMenu({
13767
13777
  editor,
13768
13778
  mentionSearchFn,
13769
13779
  mentionSearchParams,
13770
13780
  suggestionMenuComponent
13771
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
+ );
13772
13794
  const getItems = useCallback28(
13773
13795
  async (query) => {
13774
13796
  const results = await mentionSearchFn(query, mentionSearchParams);
@@ -13793,7 +13815,7 @@ function BlockNoteEditorMentionSuggestionMenu({
13793
13815
  },
13794
13816
  [editor, mentionSearchFn, mentionSearchParams]
13795
13817
  );
13796
- 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(
13797
13819
  SuggestionMenuController,
13798
13820
  {
13799
13821
  triggerCharacter: "@",
@@ -13808,7 +13830,7 @@ function BlockNoteEditorMentionSuggestionMenu({
13808
13830
  }
13809
13831
  }
13810
13832
  }
13811
- ) });
13833
+ ) }) });
13812
13834
  }
13813
13835
  __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMenu");
13814
13836
 
@@ -21801,6 +21823,7 @@ export {
21801
21823
  BlockNoteEditorMentionHoverCard,
21802
21824
  mentionDataAttrs,
21803
21825
  createMentionInlineContentSpec,
21826
+ useMentionInsert,
21804
21827
  BlockNoteEditorMentionSuggestionMenu,
21805
21828
  BlockNoteEditorContainer,
21806
21829
  CommonAssociationTrigger,
@@ -21977,4 +22000,4 @@ export {
21977
22000
  useOAuthClients,
21978
22001
  useOAuthClient
21979
22002
  };
21980
- //# sourceMappingURL=chunk-FELMRARS.mjs.map
22003
+ //# sourceMappingURL=chunk-B742NQJF.mjs.map