@carlonicora/nextjs-jsonapi 1.100.0 → 1.100.2

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-S34H33HJ.mjs";
50
+ } from "../chunk-FHFTTNKE.mjs";
51
51
  import {
52
52
  getRoleId,
53
53
  getStripePublishableKey
@@ -6586,6 +6586,21 @@ __name(fitLayeredLayoutToAspectRatio, "fitLayeredLayoutToAspectRatio");
6586
6586
 
6587
6587
  // src/hooks/useCustomD3Graph.tsx
6588
6588
  import { jsx as jsx49 } from "react/jsx-runtime";
6589
+ var TITLE_PX_PER_CHAR_162 = 8;
6590
+ var NAME_PX_PER_CHAR_122 = 6.5;
6591
+ var NAME_PX_PER_CHAR_16_BOLD2 = 8;
6592
+ var SUBTITLE_PX_PER_CHAR_112 = 6;
6593
+ var LABEL_PADDING_PX2 = 16;
6594
+ function estimateLabelWidth2(node) {
6595
+ if (node.subtitle) {
6596
+ const titleWidth = (node.name?.length ?? 0) * TITLE_PX_PER_CHAR_162;
6597
+ const subtitleWidth = node.subtitle.length * SUBTITLE_PX_PER_CHAR_112;
6598
+ return Math.max(titleWidth, subtitleWidth) + LABEL_PADDING_PX2;
6599
+ }
6600
+ const perChar = node.bold ? NAME_PX_PER_CHAR_16_BOLD2 : NAME_PX_PER_CHAR_122;
6601
+ return (node.name?.length ?? 0) * perChar + LABEL_PADDING_PX2;
6602
+ }
6603
+ __name(estimateLabelWidth2, "estimateLabelWidth");
6589
6604
  function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, options, loadingNodeIds, containerKey) {
6590
6605
  const svgRef = useRef8(null);
6591
6606
  const zoomRef = useRef8(null);
@@ -6872,9 +6887,12 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, options, lo
6872
6887
  simulation = d3.forceSimulation(visibleNodes).force(
6873
6888
  "link",
6874
6889
  d3.forceLink(visibleLinks).id((d) => d.id).distance(nodeRadius * 3).strength(0.1)
6875
- ).force("charge", d3.forceManyBody().strength(-500).distanceMax(300)).force("collision", d3.forceCollide().radius(nodeRadius * 1.2)).force("center", d3.forceCenter(width / 2, height / 2).strength(0.1));
6890
+ ).force("charge", d3.forceManyBody().strength(-2500).distanceMax(800)).force(
6891
+ "collision",
6892
+ d3.forceCollide().radius((d) => Math.max(nodeRadius * 1.1, estimateLabelWidth2(d) / 2 + 8))
6893
+ ).force("center", d3.forceCenter(width / 2, height / 2).strength(0.1));
6876
6894
  simulation.stop();
6877
- for (let i = 0; i < 100; i++) {
6895
+ for (let i = 0; i < 300; i++) {
6878
6896
  simulation.tick();
6879
6897
  }
6880
6898
  visibleNodes.forEach((node2) => {
@@ -9475,7 +9493,7 @@ import { useRef as useRef15 } from "react";
9475
9493
  import dynamic from "next/dynamic";
9476
9494
  import React14 from "react";
9477
9495
  import { jsx as jsx73 } from "react/jsx-runtime";
9478
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-QH3NPFYN.mjs"), {
9496
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-6AX7G6MY.mjs"), {
9479
9497
  ssr: false
9480
9498
  });
9481
9499
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -13705,7 +13723,7 @@ function RoundPageContainerTitle({
13705
13723
  ] }),
13706
13724
  /* @__PURE__ */ jsx146("div", { className: cn("text-primary w-full text-xl font-semibold"), children: title.element })
13707
13725
  ] }),
13708
- (title.functions || details) && /* @__PURE__ */ jsxs86("div", { className: "flex gap-x-2", children: [
13726
+ (title.functions || details) && /* @__PURE__ */ jsxs86("div", { className: "flex items-center gap-x-2", children: [
13709
13727
  title.functions,
13710
13728
  details && /* @__PURE__ */ jsxs86(Tooltip2, { children: [
13711
13729
  /* @__PURE__ */ jsx146(TooltipTrigger, { children: /* @__PURE__ */ jsx146(
@@ -22390,4 +22408,4 @@ export {
22390
22408
  useOAuthClients,
22391
22409
  useOAuthClient
22392
22410
  };
22393
- //# sourceMappingURL=chunk-S34H33HJ.mjs.map
22411
+ //# sourceMappingURL=chunk-FHFTTNKE.mjs.map