@lv-x-software-house/x_view 1.2.2-dev.23 → 1.2.2-dev.24

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.
package/dist/index.js CHANGED
@@ -4368,8 +4368,7 @@ var CodeBlock2 = ({ content, isActive, onClick }) => {
4368
4368
  "button",
4369
4369
  {
4370
4370
  onClick: handleCopy,
4371
- className: "flex items-center gap-1.5 px-2 py-1 rounded hover:bg-white/10 transition-colors text-xs text-slate-400 hover:text-white",
4372
- title: "Copiar c\xF3digo"
4371
+ className: "flex items-center gap-1.5 px-2 py-1 rounded hover:bg-white/10 transition-colors text-xs text-slate-400 hover:text-white"
4373
4372
  },
4374
4373
  copied ? /* @__PURE__ */ import_react7.default.createElement(import_fi5.FiCheck, { size: 12, className: "text-emerald-400" }) : /* @__PURE__ */ import_react7.default.createElement(import_fi5.FiCopy, { size: 12 }),
4375
4374
  copied ? /* @__PURE__ */ import_react7.default.createElement("span", { className: "text-emerald-400" }, "Copiado") : /* @__PURE__ */ import_react7.default.createElement("span", null, "Copiar")
@@ -4398,8 +4397,7 @@ var renderLinks = (text) => {
4398
4397
  target: "_blank",
4399
4398
  rel: "noopener noreferrer",
4400
4399
  className: "inline-flex items-center gap-0.5 text-cyan-400 hover:text-cyan-300 hover:underline decoration-cyan-500/50 underline-offset-2 transition-colors cursor-pointer",
4401
- onClick: (e) => e.stopPropagation(),
4402
- title: `Abrir link externo: ${url}`
4400
+ onClick: (e) => e.stopPropagation()
4403
4401
  },
4404
4402
  part,
4405
4403
  /* @__PURE__ */ import_react7.default.createElement(import_fi5.FiExternalLink, { size: 10, className: "opacity-70 mb-0.5" })
@@ -4428,8 +4426,7 @@ var renderTextWithImages = (text, onImageClick) => {
4428
4426
  e.stopPropagation();
4429
4427
  onImageClick == null ? void 0 : onImageClick(url, name);
4430
4428
  },
4431
- className: "inline-flex items-center gap-1 text-emerald-400 hover:text-emerald-300 hover:underline decoration-emerald-500/50 underline-offset-2 transition-colors cursor-pointer align-baseline mx-0.5",
4432
- title: `Ver imagem: ${name}`
4429
+ className: "inline-flex items-center gap-1 text-emerald-400 hover:text-emerald-300 hover:underline decoration-emerald-500/50 underline-offset-2 transition-colors cursor-pointer align-baseline mx-0.5"
4433
4430
  },
4434
4431
  /* @__PURE__ */ import_react7.default.createElement(import_fi5.FiImage, { size: 11 }),
4435
4432
  /* @__PURE__ */ import_react7.default.createElement("span", null, name)
@@ -4466,8 +4463,7 @@ var renderTextWithMentions = (text, availableNodes, onMentionClick, activeMentio
4466
4463
  className: `
4467
4464
  inline-flex items-center gap-0.5 align-baseline font-medium px-1.5 rounded-md mx-0.5 select-none transition-all cursor-pointer text-[0.95em]
4468
4465
  ${isMentionActive ? "text-white bg-indigo-500 ring-2 ring-yellow-400 shadow-[0_0_10px_rgba(250,204,21,0.5)] z-10 relative" : "text-indigo-200 bg-indigo-600/30 border border-indigo-500/30 hover:bg-indigo-600/50 hover:text-white"}
4469
- `,
4470
- title: `Clique para focar no Node: ${displayName}`
4466
+ `
4471
4467
  },
4472
4468
  /* @__PURE__ */ import_react7.default.createElement("span", { className: "opacity-60 text-[0.8em]" }, "@"),
4473
4469
  displayName
@@ -4541,7 +4537,9 @@ function DescriptionDisplay({
4541
4537
  onHighlightNode,
4542
4538
  initialSectionId,
4543
4539
  currentBranchDirection = null,
4544
- onSaveDescription
4540
+ onSaveDescription,
4541
+ onStepChange
4542
+ // 1. Adicione a nova prop aqui
4545
4543
  }) {
4546
4544
  const [localDescription, setLocalDescription] = (0, import_react7.useState)(description || "");
4547
4545
  (0, import_react7.useEffect)(() => {
@@ -4588,6 +4586,11 @@ function DescriptionDisplay({
4588
4586
  return navItems;
4589
4587
  }, [sections]);
4590
4588
  const [currentStepIndex, setCurrentStepIndex] = (0, import_react7.useState)(0);
4589
+ (0, import_react7.useEffect)(() => {
4590
+ if (onStepChange) {
4591
+ onStepChange(currentStepIndex);
4592
+ }
4593
+ }, [currentStepIndex, onStepChange]);
4591
4594
  const activeRef = (0, import_react7.useRef)(null);
4592
4595
  const lastNotifiedSectionId = (0, import_react7.useRef)(null);
4593
4596
  const isInitialMount = (0, import_react7.useRef)(true);
@@ -4739,8 +4742,7 @@ function DescriptionDisplay({
4739
4742
  if (onOpenReference) {
4740
4743
  onOpenReference({ type: resolved.type, id: resolved.sourceId });
4741
4744
  }
4742
- },
4743
- title: `Ir para ${resolved.type === "node" ? "Node" : "Ancestralidade"}: ${resolved.sourceName}`
4745
+ }
4744
4746
  },
4745
4747
  /* @__PURE__ */ import_react7.default.createElement(import_fi5.FiCornerDownRight, { size: 12, className: "text-indigo-400" }),
4746
4748
  /* @__PURE__ */ import_react7.default.createElement("span", { className: "text-[10px] text-slate-500 uppercase tracking-wide flex items-center gap-1" }, "Importado de ", /* @__PURE__ */ import_react7.default.createElement("span", { className: "font-semibold text-indigo-300 hover:underline" }, resolved.sourceName), /* @__PURE__ */ import_react7.default.createElement(import_fi5.FiExternalLink, { size: 10, className: "text-slate-600" }))
@@ -4875,6 +4877,7 @@ function DescriptionReadModePanel({
4875
4877
  const [showAbstraction, setShowAbstraction] = (0, import_react8.useState)(false);
4876
4878
  const [targetRenderNodeId, setTargetRenderNodeId] = (0, import_react8.useState)(null);
4877
4879
  const [isLinkCopied, setIsLinkCopied] = (0, import_react8.useState)(false);
4880
+ const [isAtStartOfBranch, setIsAtStartOfBranch] = (0, import_react8.useState)(true);
4878
4881
  const handleCopyLink = (e) => {
4879
4882
  e.stopPropagation();
4880
4883
  if (!ancestryId) return;
@@ -4927,7 +4930,7 @@ function DescriptionReadModePanel({
4927
4930
  onClick: () => onBranchNav(activeNodeBranches.nodeId, "open", "left")
4928
4931
  };
4929
4932
  }
4930
- if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "left") {
4933
+ if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "left" && isAtStartOfBranch) {
4931
4934
  return {
4932
4935
  type: "back",
4933
4936
  name: backNavigationInfo.name,
@@ -4935,7 +4938,7 @@ function DescriptionReadModePanel({
4935
4938
  };
4936
4939
  }
4937
4940
  return null;
4938
- }, [activeNodeBranches, backNavigationInfo, onBranchNav]);
4941
+ }, [activeNodeBranches, backNavigationInfo, onBranchNav, isAtStartOfBranch]);
4939
4942
  const rightAction = (0, import_react8.useMemo)(() => {
4940
4943
  if (activeNodeBranches == null ? void 0 : activeNodeBranches.right) {
4941
4944
  return {
@@ -4944,7 +4947,7 @@ function DescriptionReadModePanel({
4944
4947
  onClick: () => onBranchNav(activeNodeBranches.nodeId, "open", "right")
4945
4948
  };
4946
4949
  }
4947
- if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "right") {
4950
+ if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "right" && isAtStartOfBranch) {
4948
4951
  return {
4949
4952
  type: "back",
4950
4953
  name: backNavigationInfo.name,
@@ -4952,7 +4955,7 @@ function DescriptionReadModePanel({
4952
4955
  };
4953
4956
  }
4954
4957
  return null;
4955
- }, [activeNodeBranches, backNavigationInfo, onBranchNav]);
4958
+ }, [activeNodeBranches, backNavigationInfo, onBranchNav, isAtStartOfBranch]);
4956
4959
  return /* @__PURE__ */ import_react8.default.createElement(
4957
4960
  "div",
4958
4961
  {
@@ -5088,7 +5091,8 @@ function DescriptionReadModePanel({
5088
5091
  initialSectionId,
5089
5092
  currentBranchDirection,
5090
5093
  onImageClick,
5091
- onSaveDescription
5094
+ onSaveDescription,
5095
+ onStepChange: (stepIndex) => setIsAtStartOfBranch(stepIndex === 0)
5092
5096
  }
5093
5097
  )),
5094
5098
  leftAction && !showAbstraction && !showProperties && /* @__PURE__ */ import_react8.default.createElement(
@@ -5559,6 +5563,7 @@ function CreateAncestryPanel({
5559
5563
  }, [targetRenderNodeId, ancestryMode.abstraction_tree]);
5560
5564
  const [targetScrollSectionId, setTargetScrollSectionId] = (0, import_react11.useState)(null);
5561
5565
  const [internalHighlightedNodeId, setInternalHighlightedNodeId] = (0, import_react11.useState)(null);
5566
+ const [isAtStartOfBranch, setIsAtStartOfBranch] = (0, import_react11.useState)(true);
5562
5567
  const [ancestryName, setAncestryName] = (0, import_react11.useState)(initialName);
5563
5568
  const [description, setDescription] = (0, import_react11.useState)(initialDescription || "");
5564
5569
  const [existingSections, setExistingSections] = (0, import_react11.useState)(initialSections || []);
@@ -5990,7 +5995,7 @@ function CreateAncestryPanel({
5990
5995
  }
5991
5996
  return actions;
5992
5997
  }
5993
- if (isInBranch) {
5998
+ if (isInBranch && isAtStartOfBranch) {
5994
5999
  const lastStep = branchStack[branchStack.length - 1];
5995
6000
  const entryDir = lastStep.entryDirection || "right";
5996
6001
  const backSide = entryDir === "right" ? "left" : "right";
@@ -6001,7 +6006,7 @@ function CreateAncestryPanel({
6001
6006
  };
6002
6007
  }
6003
6008
  return actions;
6004
- }, [internalHighlightedNodeId, branchStack, activeTree]);
6009
+ }, [internalHighlightedNodeId, branchStack, activeTree, isAtStartOfBranch]);
6005
6010
  const applyDescriptionToTree = (baseTree, descText, descSections) => {
6006
6011
  const rootTreeClone = JSON.parse(JSON.stringify(baseTree));
6007
6012
  let targetTree = rootTreeClone;
@@ -6653,7 +6658,8 @@ function CreateAncestryPanel({
6653
6658
  initialSectionId: targetScrollSectionId,
6654
6659
  currentBranchDirection: currentContext ? currentContext.direction : null,
6655
6660
  onImageClick: handleImageClickFromText,
6656
- onSaveDescription: handleSaveDescriptionInline
6661
+ onSaveDescription: handleSaveDescriptionInline,
6662
+ onStepChange: (stepIndex) => setIsAtStartOfBranch(stepIndex === 0)
6657
6663
  }
6658
6664
  ), /* @__PURE__ */ import_react11.default.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5 z-30" }, /* @__PURE__ */ import_react11.default.createElement(
6659
6665
  "button",
package/dist/index.mjs CHANGED
@@ -4324,8 +4324,7 @@ var CodeBlock2 = ({ content, isActive, onClick }) => {
4324
4324
  "button",
4325
4325
  {
4326
4326
  onClick: handleCopy,
4327
- className: "flex items-center gap-1.5 px-2 py-1 rounded hover:bg-white/10 transition-colors text-xs text-slate-400 hover:text-white",
4328
- title: "Copiar c\xF3digo"
4327
+ className: "flex items-center gap-1.5 px-2 py-1 rounded hover:bg-white/10 transition-colors text-xs text-slate-400 hover:text-white"
4329
4328
  },
4330
4329
  copied ? /* @__PURE__ */ React6.createElement(FiCheck3, { size: 12, className: "text-emerald-400" }) : /* @__PURE__ */ React6.createElement(FiCopy2, { size: 12 }),
4331
4330
  copied ? /* @__PURE__ */ React6.createElement("span", { className: "text-emerald-400" }, "Copiado") : /* @__PURE__ */ React6.createElement("span", null, "Copiar")
@@ -4354,8 +4353,7 @@ var renderLinks = (text) => {
4354
4353
  target: "_blank",
4355
4354
  rel: "noopener noreferrer",
4356
4355
  className: "inline-flex items-center gap-0.5 text-cyan-400 hover:text-cyan-300 hover:underline decoration-cyan-500/50 underline-offset-2 transition-colors cursor-pointer",
4357
- onClick: (e) => e.stopPropagation(),
4358
- title: `Abrir link externo: ${url}`
4356
+ onClick: (e) => e.stopPropagation()
4359
4357
  },
4360
4358
  part,
4361
4359
  /* @__PURE__ */ React6.createElement(FiExternalLink2, { size: 10, className: "opacity-70 mb-0.5" })
@@ -4384,8 +4382,7 @@ var renderTextWithImages = (text, onImageClick) => {
4384
4382
  e.stopPropagation();
4385
4383
  onImageClick == null ? void 0 : onImageClick(url, name);
4386
4384
  },
4387
- className: "inline-flex items-center gap-1 text-emerald-400 hover:text-emerald-300 hover:underline decoration-emerald-500/50 underline-offset-2 transition-colors cursor-pointer align-baseline mx-0.5",
4388
- title: `Ver imagem: ${name}`
4385
+ className: "inline-flex items-center gap-1 text-emerald-400 hover:text-emerald-300 hover:underline decoration-emerald-500/50 underline-offset-2 transition-colors cursor-pointer align-baseline mx-0.5"
4389
4386
  },
4390
4387
  /* @__PURE__ */ React6.createElement(FiImage2, { size: 11 }),
4391
4388
  /* @__PURE__ */ React6.createElement("span", null, name)
@@ -4422,8 +4419,7 @@ var renderTextWithMentions = (text, availableNodes, onMentionClick, activeMentio
4422
4419
  className: `
4423
4420
  inline-flex items-center gap-0.5 align-baseline font-medium px-1.5 rounded-md mx-0.5 select-none transition-all cursor-pointer text-[0.95em]
4424
4421
  ${isMentionActive ? "text-white bg-indigo-500 ring-2 ring-yellow-400 shadow-[0_0_10px_rgba(250,204,21,0.5)] z-10 relative" : "text-indigo-200 bg-indigo-600/30 border border-indigo-500/30 hover:bg-indigo-600/50 hover:text-white"}
4425
- `,
4426
- title: `Clique para focar no Node: ${displayName}`
4422
+ `
4427
4423
  },
4428
4424
  /* @__PURE__ */ React6.createElement("span", { className: "opacity-60 text-[0.8em]" }, "@"),
4429
4425
  displayName
@@ -4497,7 +4493,9 @@ function DescriptionDisplay({
4497
4493
  onHighlightNode,
4498
4494
  initialSectionId,
4499
4495
  currentBranchDirection = null,
4500
- onSaveDescription
4496
+ onSaveDescription,
4497
+ onStepChange
4498
+ // 1. Adicione a nova prop aqui
4501
4499
  }) {
4502
4500
  const [localDescription, setLocalDescription] = useState7(description || "");
4503
4501
  useEffect6(() => {
@@ -4544,6 +4542,11 @@ function DescriptionDisplay({
4544
4542
  return navItems;
4545
4543
  }, [sections]);
4546
4544
  const [currentStepIndex, setCurrentStepIndex] = useState7(0);
4545
+ useEffect6(() => {
4546
+ if (onStepChange) {
4547
+ onStepChange(currentStepIndex);
4548
+ }
4549
+ }, [currentStepIndex, onStepChange]);
4547
4550
  const activeRef = useRef6(null);
4548
4551
  const lastNotifiedSectionId = useRef6(null);
4549
4552
  const isInitialMount = useRef6(true);
@@ -4695,8 +4698,7 @@ function DescriptionDisplay({
4695
4698
  if (onOpenReference) {
4696
4699
  onOpenReference({ type: resolved.type, id: resolved.sourceId });
4697
4700
  }
4698
- },
4699
- title: `Ir para ${resolved.type === "node" ? "Node" : "Ancestralidade"}: ${resolved.sourceName}`
4701
+ }
4700
4702
  },
4701
4703
  /* @__PURE__ */ React6.createElement(FiCornerDownRight, { size: 12, className: "text-indigo-400" }),
4702
4704
  /* @__PURE__ */ React6.createElement("span", { className: "text-[10px] text-slate-500 uppercase tracking-wide flex items-center gap-1" }, "Importado de ", /* @__PURE__ */ React6.createElement("span", { className: "font-semibold text-indigo-300 hover:underline" }, resolved.sourceName), /* @__PURE__ */ React6.createElement(FiExternalLink2, { size: 10, className: "text-slate-600" }))
@@ -4845,6 +4847,7 @@ function DescriptionReadModePanel({
4845
4847
  const [showAbstraction, setShowAbstraction] = useState8(false);
4846
4848
  const [targetRenderNodeId, setTargetRenderNodeId] = useState8(null);
4847
4849
  const [isLinkCopied, setIsLinkCopied] = useState8(false);
4850
+ const [isAtStartOfBranch, setIsAtStartOfBranch] = useState8(true);
4848
4851
  const handleCopyLink = (e) => {
4849
4852
  e.stopPropagation();
4850
4853
  if (!ancestryId) return;
@@ -4897,7 +4900,7 @@ function DescriptionReadModePanel({
4897
4900
  onClick: () => onBranchNav(activeNodeBranches.nodeId, "open", "left")
4898
4901
  };
4899
4902
  }
4900
- if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "left") {
4903
+ if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "left" && isAtStartOfBranch) {
4901
4904
  return {
4902
4905
  type: "back",
4903
4906
  name: backNavigationInfo.name,
@@ -4905,7 +4908,7 @@ function DescriptionReadModePanel({
4905
4908
  };
4906
4909
  }
4907
4910
  return null;
4908
- }, [activeNodeBranches, backNavigationInfo, onBranchNav]);
4911
+ }, [activeNodeBranches, backNavigationInfo, onBranchNav, isAtStartOfBranch]);
4909
4912
  const rightAction = useMemo6(() => {
4910
4913
  if (activeNodeBranches == null ? void 0 : activeNodeBranches.right) {
4911
4914
  return {
@@ -4914,7 +4917,7 @@ function DescriptionReadModePanel({
4914
4917
  onClick: () => onBranchNav(activeNodeBranches.nodeId, "open", "right")
4915
4918
  };
4916
4919
  }
4917
- if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "right") {
4920
+ if ((backNavigationInfo == null ? void 0 : backNavigationInfo.trigger) === "right" && isAtStartOfBranch) {
4918
4921
  return {
4919
4922
  type: "back",
4920
4923
  name: backNavigationInfo.name,
@@ -4922,7 +4925,7 @@ function DescriptionReadModePanel({
4922
4925
  };
4923
4926
  }
4924
4927
  return null;
4925
- }, [activeNodeBranches, backNavigationInfo, onBranchNav]);
4928
+ }, [activeNodeBranches, backNavigationInfo, onBranchNav, isAtStartOfBranch]);
4926
4929
  return /* @__PURE__ */ React7.createElement(
4927
4930
  "div",
4928
4931
  {
@@ -5058,7 +5061,8 @@ function DescriptionReadModePanel({
5058
5061
  initialSectionId,
5059
5062
  currentBranchDirection,
5060
5063
  onImageClick,
5061
- onSaveDescription
5064
+ onSaveDescription,
5065
+ onStepChange: (stepIndex) => setIsAtStartOfBranch(stepIndex === 0)
5062
5066
  }
5063
5067
  )),
5064
5068
  leftAction && !showAbstraction && !showProperties && /* @__PURE__ */ React7.createElement(
@@ -5545,6 +5549,7 @@ function CreateAncestryPanel({
5545
5549
  }, [targetRenderNodeId, ancestryMode.abstraction_tree]);
5546
5550
  const [targetScrollSectionId, setTargetScrollSectionId] = useState11(null);
5547
5551
  const [internalHighlightedNodeId, setInternalHighlightedNodeId] = useState11(null);
5552
+ const [isAtStartOfBranch, setIsAtStartOfBranch] = useState11(true);
5548
5553
  const [ancestryName, setAncestryName] = useState11(initialName);
5549
5554
  const [description, setDescription] = useState11(initialDescription || "");
5550
5555
  const [existingSections, setExistingSections] = useState11(initialSections || []);
@@ -5976,7 +5981,7 @@ function CreateAncestryPanel({
5976
5981
  }
5977
5982
  return actions;
5978
5983
  }
5979
- if (isInBranch) {
5984
+ if (isInBranch && isAtStartOfBranch) {
5980
5985
  const lastStep = branchStack[branchStack.length - 1];
5981
5986
  const entryDir = lastStep.entryDirection || "right";
5982
5987
  const backSide = entryDir === "right" ? "left" : "right";
@@ -5987,7 +5992,7 @@ function CreateAncestryPanel({
5987
5992
  };
5988
5993
  }
5989
5994
  return actions;
5990
- }, [internalHighlightedNodeId, branchStack, activeTree]);
5995
+ }, [internalHighlightedNodeId, branchStack, activeTree, isAtStartOfBranch]);
5991
5996
  const applyDescriptionToTree = (baseTree, descText, descSections) => {
5992
5997
  const rootTreeClone = JSON.parse(JSON.stringify(baseTree));
5993
5998
  let targetTree = rootTreeClone;
@@ -6639,7 +6644,8 @@ function CreateAncestryPanel({
6639
6644
  initialSectionId: targetScrollSectionId,
6640
6645
  currentBranchDirection: currentContext ? currentContext.direction : null,
6641
6646
  onImageClick: handleImageClickFromText,
6642
- onSaveDescription: handleSaveDescriptionInline
6647
+ onSaveDescription: handleSaveDescriptionInline,
6648
+ onStepChange: (stepIndex) => setIsAtStartOfBranch(stepIndex === 0)
6643
6649
  }
6644
6650
  ), /* @__PURE__ */ React10.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5 z-30" }, /* @__PURE__ */ React10.createElement(
6645
6651
  "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.2-dev.23",
3
+ "version": "1.2.2-dev.24",
4
4
  "description": "Pacote privado contendo os componentes e lógica de renderização 3D do X View.",
5
5
  "author": "iv.x - Engenharia de Software - ivxsoftwarehouse@gmail.com",
6
6
  "license": "UNLICENSED",