@lv-x-software-house/x_view 1.2.5-dev.7 → 1.2.5-dev.9

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
@@ -5793,7 +5793,6 @@ var NodeItem = ({ nodeData, onSelectParent, onViewSelect, highlightedPathIds = [
5793
5793
  e.stopPropagation();
5794
5794
  if (isEditable) {
5795
5795
  onSelectParent(itemId);
5796
- setHasUnsavedChanges(true);
5797
5796
  } else if (onViewSelect) {
5798
5797
  onViewSelect(itemId);
5799
5798
  }
@@ -5806,11 +5805,9 @@ var NodeItem = ({ nodeData, onSelectParent, onViewSelect, highlightedPathIds = [
5806
5805
  level > 0 && isEditable && /* @__PURE__ */ import_react11.default.createElement("div", { className: "flex items-center gap-1 animate-in fade-in duration-200" }, !nodeData.is_section && /* @__PURE__ */ import_react11.default.createElement("button", { onClick: (e) => {
5807
5806
  e.stopPropagation();
5808
5807
  onEditRelationship(path, nodeData.relationship || {});
5809
- setHasUnsavedChanges(true);
5810
5808
  }, className: "w-6 h-6 grid place-content-center rounded-full hover:bg-cyan-500/20 text-cyan-400 transition-colors flex-shrink-0", title: "Editar detalhes da rela\xE7\xE3o" }, /* @__PURE__ */ import_react11.default.createElement(import_fi9.FiEdit2, { size: 12 })), /* @__PURE__ */ import_react11.default.createElement("button", { onClick: (e) => {
5811
5809
  e.stopPropagation();
5812
5810
  onRemoveNode(path);
5813
- setHasUnsavedChanges(true);
5814
5811
  }, className: "w-6 h-6 grid place-content-center rounded-full hover:bg-red-500/20 text-red-400 text-lg transition-colors flex-shrink-0", title: "Remover Node" }, "\xD7"))
5815
5812
  ), hasChildren && /* @__PURE__ */ import_react11.default.createElement("div", { className: "mt-2 space-y-2 pl-8" }, nodeData.children.map((child, index) => /* @__PURE__ */ import_react11.default.createElement(
5816
5813
  NodeItem,
@@ -5866,7 +5863,7 @@ function CreateAncestryPanel({
5866
5863
  } = ancestryMode;
5867
5864
  const [isSaving, setIsSaving] = (0, import_react11.useState)(false);
5868
5865
  const [isLinkCopied, setIsLinkCopied] = (0, import_react11.useState)(false);
5869
- const [hasUnsavedChanges, setHasUnsavedChanges2] = (0, import_react11.useState)(false);
5866
+ const [hasUnsavedChanges, setHasUnsavedChanges] = (0, import_react11.useState)(false);
5870
5867
  const [showDeleteBranchConfirm, setShowDeleteBranchConfirm] = (0, import_react11.useState)(false);
5871
5868
  const handleCopyLink = (e) => {
5872
5869
  e.stopPropagation();
@@ -5934,14 +5931,14 @@ function CreateAncestryPanel({
5934
5931
  };
5935
5932
  const handleSelectAncestryParent = (nodeId, isAbstraction = false) => {
5936
5933
  setAncestryMode((prev) => isAbstraction ? { ...prev, selectedAbstractionParentId: nodeId } : { ...prev, selectedParentId: nodeId });
5937
- setHasUnsavedChanges2(true);
5934
+ setHasUnsavedChanges(true);
5938
5935
  };
5939
5936
  const handleToggleAddMode = (isAbstraction = false) => {
5940
5937
  if (isAbstraction && !ancestryMode.isAddingAbstractionNodes) {
5941
5938
  setTargetRenderNodeId(null);
5942
5939
  }
5943
5940
  setAncestryMode((prev) => isAbstraction ? { ...prev, isAddingAbstractionNodes: !prev.isAddingAbstractionNodes } : { ...prev, isAddingNodes: !prev.isAddingNodes });
5944
- setHasUnsavedChanges2(true);
5941
+ setHasUnsavedChanges(true);
5945
5942
  };
5946
5943
  const handleRemoveNode = (0, import_react11.useCallback)((pathToRemove, isAbstraction = false) => {
5947
5944
  if (!Array.isArray(pathToRemove) || pathToRemove.length === 0) return;
@@ -5959,7 +5956,7 @@ function CreateAncestryPanel({
5959
5956
  const indexToRemove = pathToRemove[pathToRemove.length - 1];
5960
5957
  if (currentParent.children && currentParent.children.length > indexToRemove) {
5961
5958
  currentParent.children.splice(indexToRemove, 1);
5962
- setHasUnsavedChanges2(true);
5959
+ setHasUnsavedChanges(true);
5963
5960
  }
5964
5961
  return { ...prev, [treeKey]: newTree };
5965
5962
  });
@@ -6018,7 +6015,7 @@ function CreateAncestryPanel({
6018
6015
  updateGlobalTree(rootTreeClone);
6019
6016
  }
6020
6017
  setAncestryMode((prev) => ({ ...prev, [treeKey]: rootTreeClone }));
6021
- setHasUnsavedChanges2(true);
6018
+ setHasUnsavedChanges(true);
6022
6019
  } else {
6023
6020
  alert("N\xE3o \xE9 poss\xEDvel mover um node para dentro de seus pr\xF3prios descendentes.");
6024
6021
  }
@@ -6091,7 +6088,7 @@ function CreateAncestryPanel({
6091
6088
  const handleAddProp = () => {
6092
6089
  const newProp = createNewCustomProperty(customProps);
6093
6090
  setCustomProps((p) => [...p, newProp]);
6094
- setHasUnsavedChanges2(true);
6091
+ setHasUnsavedChanges(true);
6095
6092
  setTimeout(() => {
6096
6093
  var _a;
6097
6094
  (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -6100,13 +6097,13 @@ function CreateAncestryPanel({
6100
6097
  const handleRemoveProp = (i) => {
6101
6098
  const newProps = customProps.filter((_, idx) => idx !== i);
6102
6099
  setCustomProps(newProps);
6103
- setHasUnsavedChanges2(true);
6100
+ setHasUnsavedChanges(true);
6104
6101
  };
6105
6102
  const handleUpdateProp = (index, updatedProp) => {
6106
6103
  const newProps = [...customProps];
6107
6104
  newProps[index] = updatedProp;
6108
6105
  setCustomProps(newProps);
6109
- setHasUnsavedChanges2(true);
6106
+ setHasUnsavedChanges(true);
6110
6107
  };
6111
6108
  const currentUsedTypes = customProps.map((p) => p.type).filter((t) => UNIQUE_PROP_TYPES.includes(t));
6112
6109
  (0, import_react11.useEffect)(() => {
@@ -6216,7 +6213,7 @@ function CreateAncestryPanel({
6216
6213
  updateGlobalTree(rootTreeClone);
6217
6214
  setBranchStack([...branchStack]);
6218
6215
  setIsPickerOpen(false);
6219
- setHasUnsavedChanges2(true);
6216
+ setHasUnsavedChanges(true);
6220
6217
  try {
6221
6218
  setIsSaving(true);
6222
6219
  const rootProps = extractCustomPropsFromNode(ancestryMode);
@@ -6230,7 +6227,7 @@ function CreateAncestryPanel({
6230
6227
  rootExtras
6231
6228
  );
6232
6229
  setLastSavedSnapshot(takeSnapshot(rootTreeClone, ancestryName, description, processedSections, [], isPrivate, ancestryMode.abstraction_tree));
6233
- setHasUnsavedChanges2(false);
6230
+ setHasUnsavedChanges(false);
6234
6231
  if (onRenderFullAncestry) {
6235
6232
  const fullTreePayload = {
6236
6233
  ancestry_id: ancestryMode.currentAncestryId || "temp_root",
@@ -6273,7 +6270,7 @@ function CreateAncestryPanel({
6273
6270
  if (branchIndex !== -1) {
6274
6271
  foundParentPath.node.parallel_branches.splice(branchIndex, 1);
6275
6272
  updateGlobalTree(rootTreeClone);
6276
- setHasUnsavedChanges2(true);
6273
+ setHasUnsavedChanges(true);
6277
6274
  try {
6278
6275
  setIsSaving(true);
6279
6276
  const currentRootProps = extractCustomPropsFromNode(ancestryMode);
@@ -6295,7 +6292,7 @@ function CreateAncestryPanel({
6295
6292
  isPrivate,
6296
6293
  ancestryMode.abstraction_tree
6297
6294
  ));
6298
- setHasUnsavedChanges2(false);
6295
+ setHasUnsavedChanges(false);
6299
6296
  if (onClearAncestryVisuals) {
6300
6297
  onClearAncestryVisuals(currentStep.branchId);
6301
6298
  }
@@ -6328,7 +6325,7 @@ function CreateAncestryPanel({
6328
6325
  if (branchIndex !== -1) {
6329
6326
  foundParentPath.node.parallel_branches.splice(branchIndex, 1);
6330
6327
  updateGlobalTree(rootTreeClone);
6331
- setHasUnsavedChanges2(true);
6328
+ setHasUnsavedChanges(true);
6332
6329
  try {
6333
6330
  setIsSaving(true);
6334
6331
  const currentRootProps = extractCustomPropsFromNode(ancestryMode);
@@ -6350,7 +6347,7 @@ function CreateAncestryPanel({
6350
6347
  isPrivate,
6351
6348
  ancestryMode.abstraction_tree
6352
6349
  ));
6353
- setHasUnsavedChanges2(false);
6350
+ setHasUnsavedChanges(false);
6354
6351
  if (onClearAncestryVisuals) {
6355
6352
  onClearAncestryVisuals(currentStep.branchId);
6356
6353
  }
@@ -6612,7 +6609,7 @@ function CreateAncestryPanel({
6612
6609
  }
6613
6610
  setBranchStack(parentStack);
6614
6611
  setTargetScrollSectionId(targetFocusId);
6615
- setHasUnsavedChanges2(true);
6612
+ setHasUnsavedChanges(true);
6616
6613
  if (onRenderFullAncestry) {
6617
6614
  const parentStack2 = currentStack;
6618
6615
  const rotation = parentStack2.reduce((acc, step) => {
@@ -6695,7 +6692,7 @@ function CreateAncestryPanel({
6695
6692
  savedMaxIndex: parentIndexToSave,
6696
6693
  entryDirection: direction
6697
6694
  }]);
6698
- setHasUnsavedChanges2(true);
6695
+ setHasUnsavedChanges(true);
6699
6696
  if (branch && branch.tree && onRenderFullAncestry) {
6700
6697
  const branchAncestryObj = {
6701
6698
  ancestry_id: branch.id,
@@ -6803,7 +6800,7 @@ function CreateAncestryPanel({
6803
6800
  isPrivate,
6804
6801
  ancestryMode.abstraction_tree
6805
6802
  ));
6806
- setHasUnsavedChanges2(false);
6803
+ setHasUnsavedChanges(false);
6807
6804
  if (onRenderFullAncestry) {
6808
6805
  const rotation = branchStack.reduce((acc, step) => {
6809
6806
  return acc + (step.entryDirection === "left" ? -Math.PI / 2 : Math.PI / 2);
@@ -6855,7 +6852,7 @@ function CreateAncestryPanel({
6855
6852
  updatedRootTree,
6856
6853
  extrasObj
6857
6854
  );
6858
- setHasUnsavedChanges2(false);
6855
+ setHasUnsavedChanges(false);
6859
6856
  setLastSavedSnapshot(takeSnapshot(
6860
6857
  updatedRootTree,
6861
6858
  currentInputName,
@@ -6878,7 +6875,7 @@ function CreateAncestryPanel({
6878
6875
  const newTreeString = JSON.stringify(newRootTree);
6879
6876
  if (currentTreeString !== newTreeString) {
6880
6877
  updateGlobalTree(newRootTree);
6881
- setHasUnsavedChanges2(true);
6878
+ setHasUnsavedChanges(true);
6882
6879
  }
6883
6880
  }, [description, existingSections]);
6884
6881
  const handleTriggerFullRender = () => {
@@ -6901,7 +6898,7 @@ function CreateAncestryPanel({
6901
6898
  };
6902
6899
  const handleSaveDescriptionInline = (newDesc) => {
6903
6900
  setDescription(newDesc);
6904
- setHasUnsavedChanges2(true);
6901
+ setHasUnsavedChanges(true);
6905
6902
  handleLocalSave(true, { description: newDesc });
6906
6903
  };
6907
6904
  const swallow = (e) => e.stopPropagation();
@@ -7033,7 +7030,7 @@ function CreateAncestryPanel({
7033
7030
  value: ancestryName,
7034
7031
  onChange: (e) => {
7035
7032
  setAncestryName(e.target.value);
7036
- setHasUnsavedChanges2(true);
7033
+ setHasUnsavedChanges(true);
7037
7034
  },
7038
7035
  readOnly: isContextLinked,
7039
7036
  placeholder: "Nome da Ancestralidade",
@@ -8406,7 +8403,7 @@ function NodeDetailsPanel({
8406
8403
  return !!(node == null ? void 0 : node.useImageAsTexture);
8407
8404
  });
8408
8405
  const [selectedImageUrl, setSelectedImageUrl] = (0, import_react17.useState)((node == null ? void 0 : node.textureImageUrl) ?? null);
8409
- const [hasUnsavedChanges, setHasUnsavedChanges2] = (0, import_react17.useState)(false);
8406
+ const [hasUnsavedChanges, setHasUnsavedChanges] = (0, import_react17.useState)(false);
8410
8407
  const maxPanelW = typeof window !== "undefined" ? window.innerWidth * 0.92 : 1200;
8411
8408
  const { width: panelWidth, isResizing, handlePointerDown: handleResize, setWidth } = useResizablePanel({
8412
8409
  initialWidth: isReadMode ? 700 : 440,
@@ -8444,7 +8441,7 @@ function NodeDetailsPanel({
8444
8441
  else if ((node == null ? void 0 : node.useImageAsTexture) === "false") setUseImageAsTexture(false);
8445
8442
  else setUseImageAsTexture(!!(node == null ? void 0 : node.useImageAsTexture));
8446
8443
  setSelectedImageUrl((node == null ? void 0 : node.textureImageUrl) ?? null);
8447
- setHasUnsavedChanges2(false);
8444
+ setHasUnsavedChanges(false);
8448
8445
  }
8449
8446
  }, [node]);
8450
8447
  const hasImages = customProps.some((p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value));
@@ -8471,7 +8468,7 @@ function NodeDetailsPanel({
8471
8468
  setIntensity(val);
8472
8469
  onIntensityChange == null ? void 0 : onIntensityChange(node.id, val);
8473
8470
  onDataUpdate == null ? void 0 : onDataUpdate({ ...node, intensity: val });
8474
- setHasUnsavedChanges2(true);
8471
+ setHasUnsavedChanges(true);
8475
8472
  };
8476
8473
  const handleCopyLink = () => {
8477
8474
  if (!(node == null ? void 0 : node.id)) return;
@@ -8489,17 +8486,17 @@ function NodeDetailsPanel({
8489
8486
  const v = e.target.value;
8490
8487
  setName(v);
8491
8488
  onNameChange == null ? void 0 : onNameChange(node.id, v);
8492
- setHasUnsavedChanges2(true);
8489
+ setHasUnsavedChanges(true);
8493
8490
  };
8494
8491
  const handleColorChange = (val) => {
8495
8492
  setColor(val);
8496
8493
  onColorChange == null ? void 0 : onColorChange(node.id, val);
8497
- setHasUnsavedChanges2(true);
8494
+ setHasUnsavedChanges(true);
8498
8495
  };
8499
8496
  const handleSizeChange = (newSize) => {
8500
8497
  setSize(newSize);
8501
8498
  onSizeChange == null ? void 0 : onSizeChange(node.id, newSize);
8502
- setHasUnsavedChanges2(true);
8499
+ setHasUnsavedChanges(true);
8503
8500
  };
8504
8501
  const handleAddType = (newType) => {
8505
8502
  const trimmed = newType.trim();
@@ -8507,12 +8504,12 @@ function NodeDetailsPanel({
8507
8504
  setTypes([...types, trimmed]);
8508
8505
  setTypeInput("");
8509
8506
  setShowTypeSuggestions(false);
8510
- setHasUnsavedChanges2(true);
8507
+ setHasUnsavedChanges(true);
8511
8508
  }
8512
8509
  };
8513
8510
  const handleRemoveType = (indexToRemove) => {
8514
8511
  setTypes(types.filter((_, index) => index !== indexToRemove));
8515
- setHasUnsavedChanges2(true);
8512
+ setHasUnsavedChanges(true);
8516
8513
  };
8517
8514
  const handleTypeInputKeyDown = (e) => {
8518
8515
  if (e.key === "Enter") {
@@ -8525,7 +8522,7 @@ function NodeDetailsPanel({
8525
8522
  const handleAddProp = () => {
8526
8523
  const newProp = createNewCustomProperty(customProps);
8527
8524
  setCustomProps((p) => [...p, newProp]);
8528
- setHasUnsavedChanges2(true);
8525
+ setHasUnsavedChanges(true);
8529
8526
  setTimeout(() => {
8530
8527
  var _a;
8531
8528
  (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -8534,21 +8531,21 @@ function NodeDetailsPanel({
8534
8531
  const handleRemoveProp = (i) => {
8535
8532
  const newProps = customProps.filter((_, idx) => idx !== i);
8536
8533
  setCustomProps(newProps);
8537
- setHasUnsavedChanges2(true);
8534
+ setHasUnsavedChanges(true);
8538
8535
  triggerAutoSave({ customProps: newProps });
8539
8536
  };
8540
8537
  const handleUpdateProp = (index, updatedProp) => {
8541
8538
  const newProps = [...customProps];
8542
8539
  newProps[index] = updatedProp;
8543
8540
  setCustomProps(newProps);
8544
- setHasUnsavedChanges2(true);
8541
+ setHasUnsavedChanges(true);
8545
8542
  if (!updatedProp.isEditing) {
8546
8543
  triggerAutoSave({ customProps: newProps });
8547
8544
  }
8548
8545
  };
8549
8546
  const handleToggleImageMode = () => {
8550
8547
  setUseImageAsTexture(newValue);
8551
- setHasUnsavedChanges2(true);
8548
+ setHasUnsavedChanges(true);
8552
8549
  let activeUrl = null;
8553
8550
  if (newValue) {
8554
8551
  const firstImageProp = customProps.find((p) => p.type === "images");
@@ -8570,7 +8567,7 @@ function NodeDetailsPanel({
8570
8567
  };
8571
8568
  const handleSelectTexture = (url) => {
8572
8569
  setSelectedImageUrl(url);
8573
- setHasUnsavedChanges2(true);
8570
+ setHasUnsavedChanges(true);
8574
8571
  onImageChange == null ? void 0 : onImageChange(true, url, color);
8575
8572
  onDataUpdate == null ? void 0 : onDataUpdate({
8576
8573
  ...node,
@@ -8581,7 +8578,7 @@ function NodeDetailsPanel({
8581
8578
  };
8582
8579
  const handleSaveDescriptionInline = (newDescription) => {
8583
8580
  setDescription(newDescription);
8584
- setHasUnsavedChanges2(true);
8581
+ setHasUnsavedChanges(true);
8585
8582
  onDataUpdate({ ...node, description: newDescription });
8586
8583
  triggerAutoSave({ description: newDescription });
8587
8584
  };
@@ -8620,7 +8617,7 @@ function NodeDetailsPanel({
8620
8617
  };
8621
8618
  await onSave(dataToSave, keepOpen);
8622
8619
  onDataUpdate(dataToSave);
8623
- setHasUnsavedChanges2(false);
8620
+ setHasUnsavedChanges(false);
8624
8621
  if (!keepOpen) {
8625
8622
  onClose();
8626
8623
  }
@@ -8857,7 +8854,7 @@ function NodeDetailsPanel({
8857
8854
  initialValue: description,
8858
8855
  onSave: (newDescription) => {
8859
8856
  setDescription(newDescription);
8860
- setHasUnsavedChanges2(true);
8857
+ setHasUnsavedChanges(true);
8861
8858
  onDataUpdate((prev) => ({ ...prev, description: newDescription }));
8862
8859
  triggerAutoSave({ description: newDescription });
8863
8860
  },
@@ -8917,7 +8914,7 @@ function QuestDetailsPanel({
8917
8914
  const [existingSections, setExistingSections] = (0, import_react18.useState)((node == null ? void 0 : node.description_sections) || []);
8918
8915
  const [isSaving, setIsSaving] = (0, import_react18.useState)(false);
8919
8916
  const [isLinkCopied, setIsLinkCopied] = (0, import_react18.useState)(false);
8920
- const [hasUnsavedChanges, setHasUnsavedChanges2] = (0, import_react18.useState)(false);
8917
+ const [hasUnsavedChanges, setHasUnsavedChanges] = (0, import_react18.useState)(false);
8921
8918
  const maxPanelW = typeof window !== "undefined" ? window.innerWidth * 0.92 : 1200;
8922
8919
  const { width: panelWidth, isResizing, handlePointerDown: handleResize, setWidth } = useResizablePanel({
8923
8920
  initialWidth: isReadMode ? 700 : 440,
@@ -8949,7 +8946,7 @@ function QuestDetailsPanel({
8949
8946
  setIntensity((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
8950
8947
  setExistingSections((node == null ? void 0 : node.description_sections) || []);
8951
8948
  setCustomProps(extractCustomPropsFromNode(node || {}));
8952
- setHasUnsavedChanges2(false);
8949
+ setHasUnsavedChanges(false);
8953
8950
  }
8954
8951
  }, [node]);
8955
8952
  (0, import_react18.useEffect)(() => {
@@ -8981,19 +8978,19 @@ function QuestDetailsPanel({
8981
8978
  setRawTitle(val);
8982
8979
  const newStandardName = questPrefix ? `${questPrefix} - \xBB ${val || "Sem t\xEDtulo"}` : val;
8983
8980
  onNameChange == null ? void 0 : onNameChange(node.id, newStandardName, val);
8984
- setHasUnsavedChanges2(true);
8981
+ setHasUnsavedChanges(true);
8985
8982
  };
8986
8983
  const handleSizeChange = (newSize) => {
8987
8984
  setSize(newSize);
8988
8985
  onSizeChange == null ? void 0 : onSizeChange(node.id, newSize);
8989
- setHasUnsavedChanges2(true);
8986
+ setHasUnsavedChanges(true);
8990
8987
  };
8991
8988
  const handleStatusChange = (newStatus) => {
8992
8989
  setStatus(newStatus);
8993
8990
  const newColor = QUEST_STATUS_COLORS3[newStatus];
8994
8991
  onColorChange == null ? void 0 : onColorChange(node.id, newColor);
8995
8992
  onDataUpdate == null ? void 0 : onDataUpdate({ ...node, status: newStatus, color: newColor });
8996
- setHasUnsavedChanges2(true);
8993
+ setHasUnsavedChanges(true);
8997
8994
  };
8998
8995
  const handleAddType = (newType) => {
8999
8996
  const trimmed = newType.trim();
@@ -9001,13 +8998,13 @@ function QuestDetailsPanel({
9001
8998
  setTypes([...types, trimmed]);
9002
8999
  setTypeInput("");
9003
9000
  setShowTypeSuggestions(false);
9004
- setHasUnsavedChanges2(true);
9001
+ setHasUnsavedChanges(true);
9005
9002
  }
9006
9003
  };
9007
9004
  const handleRemoveType = (indexToRemove) => {
9008
9005
  if (types[indexToRemove] === "quest") return;
9009
9006
  setTypes(types.filter((_, index) => index !== indexToRemove));
9010
- setHasUnsavedChanges2(true);
9007
+ setHasUnsavedChanges(true);
9011
9008
  };
9012
9009
  const handleTypeInputKeyDown = (e) => {
9013
9010
  if (e.key === "Enter") {
@@ -9020,7 +9017,7 @@ function QuestDetailsPanel({
9020
9017
  const handleAddProp = () => {
9021
9018
  const newProp = createNewCustomProperty(customProps);
9022
9019
  setCustomProps((p) => [...p, newProp]);
9023
- setHasUnsavedChanges2(true);
9020
+ setHasUnsavedChanges(true);
9024
9021
  setTimeout(() => {
9025
9022
  var _a2;
9026
9023
  (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -9029,21 +9026,21 @@ function QuestDetailsPanel({
9029
9026
  const handleRemoveProp = (i) => {
9030
9027
  const newProps = customProps.filter((_, idx) => idx !== i);
9031
9028
  setCustomProps(newProps);
9032
- setHasUnsavedChanges2(true);
9029
+ setHasUnsavedChanges(true);
9033
9030
  triggerAutoSave({ customProps: newProps });
9034
9031
  };
9035
9032
  const handleUpdateProp = (index, updatedProp) => {
9036
9033
  const newProps = [...customProps];
9037
9034
  newProps[index] = updatedProp;
9038
9035
  setCustomProps(newProps);
9039
- setHasUnsavedChanges2(true);
9036
+ setHasUnsavedChanges(true);
9040
9037
  if (!updatedProp.isEditing) {
9041
9038
  triggerAutoSave({ customProps: newProps });
9042
9039
  }
9043
9040
  };
9044
9041
  const handleSaveDescriptionInline = (newDescription) => {
9045
9042
  setDescription(newDescription);
9046
- setHasUnsavedChanges2(true);
9043
+ setHasUnsavedChanges(true);
9047
9044
  onDataUpdate({ ...node, description: newDescription });
9048
9045
  triggerAutoSave({ description: newDescription });
9049
9046
  };
@@ -9088,7 +9085,7 @@ function QuestDetailsPanel({
9088
9085
  };
9089
9086
  await onSave(dataToSave, keepOpen);
9090
9087
  onDataUpdate(dataToSave);
9091
- setHasUnsavedChanges2(false);
9088
+ setHasUnsavedChanges(false);
9092
9089
  if (!keepOpen) {
9093
9090
  onClose();
9094
9091
  }
@@ -9325,7 +9322,7 @@ function RelationshipDetailsPanel({
9325
9322
  const [isDescriptionModalOpen, setIsDescriptionModalOpen] = (0, import_react20.useState)(false);
9326
9323
  const [isSaving, setIsSaving] = (0, import_react20.useState)(false);
9327
9324
  const [isReadMode, setIsReadMode] = (0, import_react20.useState)(false);
9328
- const [hasUnsavedChanges, setHasUnsavedChanges2] = (0, import_react20.useState)(false);
9325
+ const [hasUnsavedChanges, setHasUnsavedChanges] = (0, import_react20.useState)(false);
9329
9326
  const propsEndRef = (0, import_react20.useRef)(null);
9330
9327
  const canEdit = (0, import_react20.useMemo)(() => {
9331
9328
  const ability = defineAbilityFor(userRole);
@@ -9338,14 +9335,14 @@ function RelationshipDetailsPanel({
9338
9335
  setCustomProps(extractCustomPropsFromNode(link || {}));
9339
9336
  setSourceLabel((link == null ? void 0 : link.source_label) ?? "");
9340
9337
  setTargetLabel((link == null ? void 0 : link.target_label) ?? "");
9341
- setHasUnsavedChanges2(false);
9338
+ setHasUnsavedChanges(false);
9342
9339
  }, [link]);
9343
9340
  const swallow = (e) => e.stopPropagation();
9344
9341
  const handleAddProp = () => {
9345
9342
  if (!canEdit) return;
9346
9343
  const newProp = createNewCustomProperty(customProps);
9347
9344
  setCustomProps((p) => [...p, newProp]);
9348
- setHasUnsavedChanges2(true);
9345
+ setHasUnsavedChanges(true);
9349
9346
  setTimeout(() => {
9350
9347
  var _a;
9351
9348
  (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -9382,7 +9379,7 @@ function RelationshipDetailsPanel({
9382
9379
  if (currentTargetLabel.trim()) dataToSave.target_label = currentTargetLabel.trim();
9383
9380
  await onSave(dataToSave, keepOpen);
9384
9381
  onDataUpdate(dataToSave);
9385
- setHasUnsavedChanges2(false);
9382
+ setHasUnsavedChanges(false);
9386
9383
  if (!keepOpen) {
9387
9384
  onClose();
9388
9385
  }
@@ -9396,21 +9393,21 @@ function RelationshipDetailsPanel({
9396
9393
  const handleSaveDescriptionInline = (newDescription) => {
9397
9394
  if (!canEdit) return;
9398
9395
  setDescription(newDescription);
9399
- setHasUnsavedChanges2(true);
9396
+ setHasUnsavedChanges(true);
9400
9397
  onDataUpdate((prev) => ({ ...prev, description: newDescription }));
9401
9398
  triggerAutoSave({ description: newDescription });
9402
9399
  };
9403
9400
  const handleRemoveProp = (i) => {
9404
9401
  const newProps = customProps.filter((_, idx) => idx !== i);
9405
9402
  setCustomProps(newProps);
9406
- setHasUnsavedChanges2(true);
9403
+ setHasUnsavedChanges(true);
9407
9404
  triggerAutoSave({ customProps: newProps });
9408
9405
  };
9409
9406
  const handleUpdateProp = (index, updatedProp) => {
9410
9407
  const newProps = [...customProps];
9411
9408
  newProps[index] = updatedProp;
9412
9409
  setCustomProps(newProps);
9413
- setHasUnsavedChanges2(true);
9410
+ setHasUnsavedChanges(true);
9414
9411
  if (!updatedProp.isEditing) {
9415
9412
  triggerAutoSave({ customProps: newProps });
9416
9413
  }
@@ -9465,7 +9462,7 @@ function RelationshipDetailsPanel({
9465
9462
  value: name,
9466
9463
  onChange: (e) => {
9467
9464
  setName(e.target.value);
9468
- setHasUnsavedChanges2(true);
9465
+ setHasUnsavedChanges(true);
9469
9466
  },
9470
9467
  placeholder: "Ex: Controla, Pertence a, Fornece...",
9471
9468
  disabled: !canEdit,
@@ -9480,7 +9477,7 @@ function RelationshipDetailsPanel({
9480
9477
  value: sourceLabel,
9481
9478
  onChange: (e) => {
9482
9479
  setSourceLabel(e.target.value);
9483
- setHasUnsavedChanges2(true);
9480
+ setHasUnsavedChanges(true);
9484
9481
  },
9485
9482
  placeholder: "Ex: Conceitos",
9486
9483
  disabled: !canEdit,
@@ -9495,7 +9492,7 @@ function RelationshipDetailsPanel({
9495
9492
  value: targetLabel,
9496
9493
  onChange: (e) => {
9497
9494
  setTargetLabel(e.target.value);
9498
- setHasUnsavedChanges2(true);
9495
+ setHasUnsavedChanges(true);
9499
9496
  },
9500
9497
  placeholder: "Ex: Refer\xEAncias",
9501
9498
  disabled: !canEdit,
@@ -9573,7 +9570,7 @@ function RelationshipDetailsPanel({
9573
9570
  onSave: (newDescription) => {
9574
9571
  if (!canEdit) return;
9575
9572
  setDescription(newDescription);
9576
- setHasUnsavedChanges2(true);
9573
+ setHasUnsavedChanges(true);
9577
9574
  onDataUpdate((prev) => ({ ...prev, description: newDescription }));
9578
9575
  triggerAutoSave({ description: newDescription });
9579
9576
  },
package/dist/index.mjs CHANGED
@@ -5786,7 +5786,6 @@ var NodeItem = ({ nodeData, onSelectParent, onViewSelect, highlightedPathIds = [
5786
5786
  e.stopPropagation();
5787
5787
  if (isEditable) {
5788
5788
  onSelectParent(itemId);
5789
- setHasUnsavedChanges(true);
5790
5789
  } else if (onViewSelect) {
5791
5790
  onViewSelect(itemId);
5792
5791
  }
@@ -5799,11 +5798,9 @@ var NodeItem = ({ nodeData, onSelectParent, onViewSelect, highlightedPathIds = [
5799
5798
  level > 0 && isEditable && /* @__PURE__ */ React10.createElement("div", { className: "flex items-center gap-1 animate-in fade-in duration-200" }, !nodeData.is_section && /* @__PURE__ */ React10.createElement("button", { onClick: (e) => {
5800
5799
  e.stopPropagation();
5801
5800
  onEditRelationship(path, nodeData.relationship || {});
5802
- setHasUnsavedChanges(true);
5803
5801
  }, className: "w-6 h-6 grid place-content-center rounded-full hover:bg-cyan-500/20 text-cyan-400 transition-colors flex-shrink-0", title: "Editar detalhes da rela\xE7\xE3o" }, /* @__PURE__ */ React10.createElement(FiEdit23, { size: 12 })), /* @__PURE__ */ React10.createElement("button", { onClick: (e) => {
5804
5802
  e.stopPropagation();
5805
5803
  onRemoveNode(path);
5806
- setHasUnsavedChanges(true);
5807
5804
  }, className: "w-6 h-6 grid place-content-center rounded-full hover:bg-red-500/20 text-red-400 text-lg transition-colors flex-shrink-0", title: "Remover Node" }, "\xD7"))
5808
5805
  ), hasChildren && /* @__PURE__ */ React10.createElement("div", { className: "mt-2 space-y-2 pl-8" }, nodeData.children.map((child, index) => /* @__PURE__ */ React10.createElement(
5809
5806
  NodeItem,
@@ -5859,7 +5856,7 @@ function CreateAncestryPanel({
5859
5856
  } = ancestryMode;
5860
5857
  const [isSaving, setIsSaving] = useState11(false);
5861
5858
  const [isLinkCopied, setIsLinkCopied] = useState11(false);
5862
- const [hasUnsavedChanges, setHasUnsavedChanges2] = useState11(false);
5859
+ const [hasUnsavedChanges, setHasUnsavedChanges] = useState11(false);
5863
5860
  const [showDeleteBranchConfirm, setShowDeleteBranchConfirm] = useState11(false);
5864
5861
  const handleCopyLink = (e) => {
5865
5862
  e.stopPropagation();
@@ -5927,14 +5924,14 @@ function CreateAncestryPanel({
5927
5924
  };
5928
5925
  const handleSelectAncestryParent = (nodeId, isAbstraction = false) => {
5929
5926
  setAncestryMode((prev) => isAbstraction ? { ...prev, selectedAbstractionParentId: nodeId } : { ...prev, selectedParentId: nodeId });
5930
- setHasUnsavedChanges2(true);
5927
+ setHasUnsavedChanges(true);
5931
5928
  };
5932
5929
  const handleToggleAddMode = (isAbstraction = false) => {
5933
5930
  if (isAbstraction && !ancestryMode.isAddingAbstractionNodes) {
5934
5931
  setTargetRenderNodeId(null);
5935
5932
  }
5936
5933
  setAncestryMode((prev) => isAbstraction ? { ...prev, isAddingAbstractionNodes: !prev.isAddingAbstractionNodes } : { ...prev, isAddingNodes: !prev.isAddingNodes });
5937
- setHasUnsavedChanges2(true);
5934
+ setHasUnsavedChanges(true);
5938
5935
  };
5939
5936
  const handleRemoveNode = useCallback2((pathToRemove, isAbstraction = false) => {
5940
5937
  if (!Array.isArray(pathToRemove) || pathToRemove.length === 0) return;
@@ -5952,7 +5949,7 @@ function CreateAncestryPanel({
5952
5949
  const indexToRemove = pathToRemove[pathToRemove.length - 1];
5953
5950
  if (currentParent.children && currentParent.children.length > indexToRemove) {
5954
5951
  currentParent.children.splice(indexToRemove, 1);
5955
- setHasUnsavedChanges2(true);
5952
+ setHasUnsavedChanges(true);
5956
5953
  }
5957
5954
  return { ...prev, [treeKey]: newTree };
5958
5955
  });
@@ -6011,7 +6008,7 @@ function CreateAncestryPanel({
6011
6008
  updateGlobalTree(rootTreeClone);
6012
6009
  }
6013
6010
  setAncestryMode((prev) => ({ ...prev, [treeKey]: rootTreeClone }));
6014
- setHasUnsavedChanges2(true);
6011
+ setHasUnsavedChanges(true);
6015
6012
  } else {
6016
6013
  alert("N\xE3o \xE9 poss\xEDvel mover um node para dentro de seus pr\xF3prios descendentes.");
6017
6014
  }
@@ -6084,7 +6081,7 @@ function CreateAncestryPanel({
6084
6081
  const handleAddProp = () => {
6085
6082
  const newProp = createNewCustomProperty(customProps);
6086
6083
  setCustomProps((p) => [...p, newProp]);
6087
- setHasUnsavedChanges2(true);
6084
+ setHasUnsavedChanges(true);
6088
6085
  setTimeout(() => {
6089
6086
  var _a;
6090
6087
  (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -6093,13 +6090,13 @@ function CreateAncestryPanel({
6093
6090
  const handleRemoveProp = (i) => {
6094
6091
  const newProps = customProps.filter((_, idx) => idx !== i);
6095
6092
  setCustomProps(newProps);
6096
- setHasUnsavedChanges2(true);
6093
+ setHasUnsavedChanges(true);
6097
6094
  };
6098
6095
  const handleUpdateProp = (index, updatedProp) => {
6099
6096
  const newProps = [...customProps];
6100
6097
  newProps[index] = updatedProp;
6101
6098
  setCustomProps(newProps);
6102
- setHasUnsavedChanges2(true);
6099
+ setHasUnsavedChanges(true);
6103
6100
  };
6104
6101
  const currentUsedTypes = customProps.map((p) => p.type).filter((t) => UNIQUE_PROP_TYPES.includes(t));
6105
6102
  useEffect10(() => {
@@ -6209,7 +6206,7 @@ function CreateAncestryPanel({
6209
6206
  updateGlobalTree(rootTreeClone);
6210
6207
  setBranchStack([...branchStack]);
6211
6208
  setIsPickerOpen(false);
6212
- setHasUnsavedChanges2(true);
6209
+ setHasUnsavedChanges(true);
6213
6210
  try {
6214
6211
  setIsSaving(true);
6215
6212
  const rootProps = extractCustomPropsFromNode(ancestryMode);
@@ -6223,7 +6220,7 @@ function CreateAncestryPanel({
6223
6220
  rootExtras
6224
6221
  );
6225
6222
  setLastSavedSnapshot(takeSnapshot(rootTreeClone, ancestryName, description, processedSections, [], isPrivate, ancestryMode.abstraction_tree));
6226
- setHasUnsavedChanges2(false);
6223
+ setHasUnsavedChanges(false);
6227
6224
  if (onRenderFullAncestry) {
6228
6225
  const fullTreePayload = {
6229
6226
  ancestry_id: ancestryMode.currentAncestryId || "temp_root",
@@ -6266,7 +6263,7 @@ function CreateAncestryPanel({
6266
6263
  if (branchIndex !== -1) {
6267
6264
  foundParentPath.node.parallel_branches.splice(branchIndex, 1);
6268
6265
  updateGlobalTree(rootTreeClone);
6269
- setHasUnsavedChanges2(true);
6266
+ setHasUnsavedChanges(true);
6270
6267
  try {
6271
6268
  setIsSaving(true);
6272
6269
  const currentRootProps = extractCustomPropsFromNode(ancestryMode);
@@ -6288,7 +6285,7 @@ function CreateAncestryPanel({
6288
6285
  isPrivate,
6289
6286
  ancestryMode.abstraction_tree
6290
6287
  ));
6291
- setHasUnsavedChanges2(false);
6288
+ setHasUnsavedChanges(false);
6292
6289
  if (onClearAncestryVisuals) {
6293
6290
  onClearAncestryVisuals(currentStep.branchId);
6294
6291
  }
@@ -6321,7 +6318,7 @@ function CreateAncestryPanel({
6321
6318
  if (branchIndex !== -1) {
6322
6319
  foundParentPath.node.parallel_branches.splice(branchIndex, 1);
6323
6320
  updateGlobalTree(rootTreeClone);
6324
- setHasUnsavedChanges2(true);
6321
+ setHasUnsavedChanges(true);
6325
6322
  try {
6326
6323
  setIsSaving(true);
6327
6324
  const currentRootProps = extractCustomPropsFromNode(ancestryMode);
@@ -6343,7 +6340,7 @@ function CreateAncestryPanel({
6343
6340
  isPrivate,
6344
6341
  ancestryMode.abstraction_tree
6345
6342
  ));
6346
- setHasUnsavedChanges2(false);
6343
+ setHasUnsavedChanges(false);
6347
6344
  if (onClearAncestryVisuals) {
6348
6345
  onClearAncestryVisuals(currentStep.branchId);
6349
6346
  }
@@ -6605,7 +6602,7 @@ function CreateAncestryPanel({
6605
6602
  }
6606
6603
  setBranchStack(parentStack);
6607
6604
  setTargetScrollSectionId(targetFocusId);
6608
- setHasUnsavedChanges2(true);
6605
+ setHasUnsavedChanges(true);
6609
6606
  if (onRenderFullAncestry) {
6610
6607
  const parentStack2 = currentStack;
6611
6608
  const rotation = parentStack2.reduce((acc, step) => {
@@ -6688,7 +6685,7 @@ function CreateAncestryPanel({
6688
6685
  savedMaxIndex: parentIndexToSave,
6689
6686
  entryDirection: direction
6690
6687
  }]);
6691
- setHasUnsavedChanges2(true);
6688
+ setHasUnsavedChanges(true);
6692
6689
  if (branch && branch.tree && onRenderFullAncestry) {
6693
6690
  const branchAncestryObj = {
6694
6691
  ancestry_id: branch.id,
@@ -6796,7 +6793,7 @@ function CreateAncestryPanel({
6796
6793
  isPrivate,
6797
6794
  ancestryMode.abstraction_tree
6798
6795
  ));
6799
- setHasUnsavedChanges2(false);
6796
+ setHasUnsavedChanges(false);
6800
6797
  if (onRenderFullAncestry) {
6801
6798
  const rotation = branchStack.reduce((acc, step) => {
6802
6799
  return acc + (step.entryDirection === "left" ? -Math.PI / 2 : Math.PI / 2);
@@ -6848,7 +6845,7 @@ function CreateAncestryPanel({
6848
6845
  updatedRootTree,
6849
6846
  extrasObj
6850
6847
  );
6851
- setHasUnsavedChanges2(false);
6848
+ setHasUnsavedChanges(false);
6852
6849
  setLastSavedSnapshot(takeSnapshot(
6853
6850
  updatedRootTree,
6854
6851
  currentInputName,
@@ -6871,7 +6868,7 @@ function CreateAncestryPanel({
6871
6868
  const newTreeString = JSON.stringify(newRootTree);
6872
6869
  if (currentTreeString !== newTreeString) {
6873
6870
  updateGlobalTree(newRootTree);
6874
- setHasUnsavedChanges2(true);
6871
+ setHasUnsavedChanges(true);
6875
6872
  }
6876
6873
  }, [description, existingSections]);
6877
6874
  const handleTriggerFullRender = () => {
@@ -6894,7 +6891,7 @@ function CreateAncestryPanel({
6894
6891
  };
6895
6892
  const handleSaveDescriptionInline = (newDesc) => {
6896
6893
  setDescription(newDesc);
6897
- setHasUnsavedChanges2(true);
6894
+ setHasUnsavedChanges(true);
6898
6895
  handleLocalSave(true, { description: newDesc });
6899
6896
  };
6900
6897
  const swallow = (e) => e.stopPropagation();
@@ -7026,7 +7023,7 @@ function CreateAncestryPanel({
7026
7023
  value: ancestryName,
7027
7024
  onChange: (e) => {
7028
7025
  setAncestryName(e.target.value);
7029
- setHasUnsavedChanges2(true);
7026
+ setHasUnsavedChanges(true);
7030
7027
  },
7031
7028
  readOnly: isContextLinked,
7032
7029
  placeholder: "Nome da Ancestralidade",
@@ -8399,7 +8396,7 @@ function NodeDetailsPanel({
8399
8396
  return !!(node == null ? void 0 : node.useImageAsTexture);
8400
8397
  });
8401
8398
  const [selectedImageUrl, setSelectedImageUrl] = useState17((node == null ? void 0 : node.textureImageUrl) ?? null);
8402
- const [hasUnsavedChanges, setHasUnsavedChanges2] = useState17(false);
8399
+ const [hasUnsavedChanges, setHasUnsavedChanges] = useState17(false);
8403
8400
  const maxPanelW = typeof window !== "undefined" ? window.innerWidth * 0.92 : 1200;
8404
8401
  const { width: panelWidth, isResizing, handlePointerDown: handleResize, setWidth } = useResizablePanel({
8405
8402
  initialWidth: isReadMode ? 700 : 440,
@@ -8437,7 +8434,7 @@ function NodeDetailsPanel({
8437
8434
  else if ((node == null ? void 0 : node.useImageAsTexture) === "false") setUseImageAsTexture(false);
8438
8435
  else setUseImageAsTexture(!!(node == null ? void 0 : node.useImageAsTexture));
8439
8436
  setSelectedImageUrl((node == null ? void 0 : node.textureImageUrl) ?? null);
8440
- setHasUnsavedChanges2(false);
8437
+ setHasUnsavedChanges(false);
8441
8438
  }
8442
8439
  }, [node]);
8443
8440
  const hasImages = customProps.some((p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value));
@@ -8464,7 +8461,7 @@ function NodeDetailsPanel({
8464
8461
  setIntensity(val);
8465
8462
  onIntensityChange == null ? void 0 : onIntensityChange(node.id, val);
8466
8463
  onDataUpdate == null ? void 0 : onDataUpdate({ ...node, intensity: val });
8467
- setHasUnsavedChanges2(true);
8464
+ setHasUnsavedChanges(true);
8468
8465
  };
8469
8466
  const handleCopyLink = () => {
8470
8467
  if (!(node == null ? void 0 : node.id)) return;
@@ -8482,17 +8479,17 @@ function NodeDetailsPanel({
8482
8479
  const v = e.target.value;
8483
8480
  setName(v);
8484
8481
  onNameChange == null ? void 0 : onNameChange(node.id, v);
8485
- setHasUnsavedChanges2(true);
8482
+ setHasUnsavedChanges(true);
8486
8483
  };
8487
8484
  const handleColorChange = (val) => {
8488
8485
  setColor(val);
8489
8486
  onColorChange == null ? void 0 : onColorChange(node.id, val);
8490
- setHasUnsavedChanges2(true);
8487
+ setHasUnsavedChanges(true);
8491
8488
  };
8492
8489
  const handleSizeChange = (newSize) => {
8493
8490
  setSize(newSize);
8494
8491
  onSizeChange == null ? void 0 : onSizeChange(node.id, newSize);
8495
- setHasUnsavedChanges2(true);
8492
+ setHasUnsavedChanges(true);
8496
8493
  };
8497
8494
  const handleAddType = (newType) => {
8498
8495
  const trimmed = newType.trim();
@@ -8500,12 +8497,12 @@ function NodeDetailsPanel({
8500
8497
  setTypes([...types, trimmed]);
8501
8498
  setTypeInput("");
8502
8499
  setShowTypeSuggestions(false);
8503
- setHasUnsavedChanges2(true);
8500
+ setHasUnsavedChanges(true);
8504
8501
  }
8505
8502
  };
8506
8503
  const handleRemoveType = (indexToRemove) => {
8507
8504
  setTypes(types.filter((_, index) => index !== indexToRemove));
8508
- setHasUnsavedChanges2(true);
8505
+ setHasUnsavedChanges(true);
8509
8506
  };
8510
8507
  const handleTypeInputKeyDown = (e) => {
8511
8508
  if (e.key === "Enter") {
@@ -8518,7 +8515,7 @@ function NodeDetailsPanel({
8518
8515
  const handleAddProp = () => {
8519
8516
  const newProp = createNewCustomProperty(customProps);
8520
8517
  setCustomProps((p) => [...p, newProp]);
8521
- setHasUnsavedChanges2(true);
8518
+ setHasUnsavedChanges(true);
8522
8519
  setTimeout(() => {
8523
8520
  var _a;
8524
8521
  (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -8527,21 +8524,21 @@ function NodeDetailsPanel({
8527
8524
  const handleRemoveProp = (i) => {
8528
8525
  const newProps = customProps.filter((_, idx) => idx !== i);
8529
8526
  setCustomProps(newProps);
8530
- setHasUnsavedChanges2(true);
8527
+ setHasUnsavedChanges(true);
8531
8528
  triggerAutoSave({ customProps: newProps });
8532
8529
  };
8533
8530
  const handleUpdateProp = (index, updatedProp) => {
8534
8531
  const newProps = [...customProps];
8535
8532
  newProps[index] = updatedProp;
8536
8533
  setCustomProps(newProps);
8537
- setHasUnsavedChanges2(true);
8534
+ setHasUnsavedChanges(true);
8538
8535
  if (!updatedProp.isEditing) {
8539
8536
  triggerAutoSave({ customProps: newProps });
8540
8537
  }
8541
8538
  };
8542
8539
  const handleToggleImageMode = () => {
8543
8540
  setUseImageAsTexture(newValue);
8544
- setHasUnsavedChanges2(true);
8541
+ setHasUnsavedChanges(true);
8545
8542
  let activeUrl = null;
8546
8543
  if (newValue) {
8547
8544
  const firstImageProp = customProps.find((p) => p.type === "images");
@@ -8563,7 +8560,7 @@ function NodeDetailsPanel({
8563
8560
  };
8564
8561
  const handleSelectTexture = (url) => {
8565
8562
  setSelectedImageUrl(url);
8566
- setHasUnsavedChanges2(true);
8563
+ setHasUnsavedChanges(true);
8567
8564
  onImageChange == null ? void 0 : onImageChange(true, url, color);
8568
8565
  onDataUpdate == null ? void 0 : onDataUpdate({
8569
8566
  ...node,
@@ -8574,7 +8571,7 @@ function NodeDetailsPanel({
8574
8571
  };
8575
8572
  const handleSaveDescriptionInline = (newDescription) => {
8576
8573
  setDescription(newDescription);
8577
- setHasUnsavedChanges2(true);
8574
+ setHasUnsavedChanges(true);
8578
8575
  onDataUpdate({ ...node, description: newDescription });
8579
8576
  triggerAutoSave({ description: newDescription });
8580
8577
  };
@@ -8613,7 +8610,7 @@ function NodeDetailsPanel({
8613
8610
  };
8614
8611
  await onSave(dataToSave, keepOpen);
8615
8612
  onDataUpdate(dataToSave);
8616
- setHasUnsavedChanges2(false);
8613
+ setHasUnsavedChanges(false);
8617
8614
  if (!keepOpen) {
8618
8615
  onClose();
8619
8616
  }
@@ -8850,7 +8847,7 @@ function NodeDetailsPanel({
8850
8847
  initialValue: description,
8851
8848
  onSave: (newDescription) => {
8852
8849
  setDescription(newDescription);
8853
- setHasUnsavedChanges2(true);
8850
+ setHasUnsavedChanges(true);
8854
8851
  onDataUpdate((prev) => ({ ...prev, description: newDescription }));
8855
8852
  triggerAutoSave({ description: newDescription });
8856
8853
  },
@@ -8910,7 +8907,7 @@ function QuestDetailsPanel({
8910
8907
  const [existingSections, setExistingSections] = useState18((node == null ? void 0 : node.description_sections) || []);
8911
8908
  const [isSaving, setIsSaving] = useState18(false);
8912
8909
  const [isLinkCopied, setIsLinkCopied] = useState18(false);
8913
- const [hasUnsavedChanges, setHasUnsavedChanges2] = useState18(false);
8910
+ const [hasUnsavedChanges, setHasUnsavedChanges] = useState18(false);
8914
8911
  const maxPanelW = typeof window !== "undefined" ? window.innerWidth * 0.92 : 1200;
8915
8912
  const { width: panelWidth, isResizing, handlePointerDown: handleResize, setWidth } = useResizablePanel({
8916
8913
  initialWidth: isReadMode ? 700 : 440,
@@ -8942,7 +8939,7 @@ function QuestDetailsPanel({
8942
8939
  setIntensity((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
8943
8940
  setExistingSections((node == null ? void 0 : node.description_sections) || []);
8944
8941
  setCustomProps(extractCustomPropsFromNode(node || {}));
8945
- setHasUnsavedChanges2(false);
8942
+ setHasUnsavedChanges(false);
8946
8943
  }
8947
8944
  }, [node]);
8948
8945
  useEffect16(() => {
@@ -8974,19 +8971,19 @@ function QuestDetailsPanel({
8974
8971
  setRawTitle(val);
8975
8972
  const newStandardName = questPrefix ? `${questPrefix} - \xBB ${val || "Sem t\xEDtulo"}` : val;
8976
8973
  onNameChange == null ? void 0 : onNameChange(node.id, newStandardName, val);
8977
- setHasUnsavedChanges2(true);
8974
+ setHasUnsavedChanges(true);
8978
8975
  };
8979
8976
  const handleSizeChange = (newSize) => {
8980
8977
  setSize(newSize);
8981
8978
  onSizeChange == null ? void 0 : onSizeChange(node.id, newSize);
8982
- setHasUnsavedChanges2(true);
8979
+ setHasUnsavedChanges(true);
8983
8980
  };
8984
8981
  const handleStatusChange = (newStatus) => {
8985
8982
  setStatus(newStatus);
8986
8983
  const newColor = QUEST_STATUS_COLORS3[newStatus];
8987
8984
  onColorChange == null ? void 0 : onColorChange(node.id, newColor);
8988
8985
  onDataUpdate == null ? void 0 : onDataUpdate({ ...node, status: newStatus, color: newColor });
8989
- setHasUnsavedChanges2(true);
8986
+ setHasUnsavedChanges(true);
8990
8987
  };
8991
8988
  const handleAddType = (newType) => {
8992
8989
  const trimmed = newType.trim();
@@ -8994,13 +8991,13 @@ function QuestDetailsPanel({
8994
8991
  setTypes([...types, trimmed]);
8995
8992
  setTypeInput("");
8996
8993
  setShowTypeSuggestions(false);
8997
- setHasUnsavedChanges2(true);
8994
+ setHasUnsavedChanges(true);
8998
8995
  }
8999
8996
  };
9000
8997
  const handleRemoveType = (indexToRemove) => {
9001
8998
  if (types[indexToRemove] === "quest") return;
9002
8999
  setTypes(types.filter((_, index) => index !== indexToRemove));
9003
- setHasUnsavedChanges2(true);
9000
+ setHasUnsavedChanges(true);
9004
9001
  };
9005
9002
  const handleTypeInputKeyDown = (e) => {
9006
9003
  if (e.key === "Enter") {
@@ -9013,7 +9010,7 @@ function QuestDetailsPanel({
9013
9010
  const handleAddProp = () => {
9014
9011
  const newProp = createNewCustomProperty(customProps);
9015
9012
  setCustomProps((p) => [...p, newProp]);
9016
- setHasUnsavedChanges2(true);
9013
+ setHasUnsavedChanges(true);
9017
9014
  setTimeout(() => {
9018
9015
  var _a2;
9019
9016
  (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -9022,21 +9019,21 @@ function QuestDetailsPanel({
9022
9019
  const handleRemoveProp = (i) => {
9023
9020
  const newProps = customProps.filter((_, idx) => idx !== i);
9024
9021
  setCustomProps(newProps);
9025
- setHasUnsavedChanges2(true);
9022
+ setHasUnsavedChanges(true);
9026
9023
  triggerAutoSave({ customProps: newProps });
9027
9024
  };
9028
9025
  const handleUpdateProp = (index, updatedProp) => {
9029
9026
  const newProps = [...customProps];
9030
9027
  newProps[index] = updatedProp;
9031
9028
  setCustomProps(newProps);
9032
- setHasUnsavedChanges2(true);
9029
+ setHasUnsavedChanges(true);
9033
9030
  if (!updatedProp.isEditing) {
9034
9031
  triggerAutoSave({ customProps: newProps });
9035
9032
  }
9036
9033
  };
9037
9034
  const handleSaveDescriptionInline = (newDescription) => {
9038
9035
  setDescription(newDescription);
9039
- setHasUnsavedChanges2(true);
9036
+ setHasUnsavedChanges(true);
9040
9037
  onDataUpdate({ ...node, description: newDescription });
9041
9038
  triggerAutoSave({ description: newDescription });
9042
9039
  };
@@ -9081,7 +9078,7 @@ function QuestDetailsPanel({
9081
9078
  };
9082
9079
  await onSave(dataToSave, keepOpen);
9083
9080
  onDataUpdate(dataToSave);
9084
- setHasUnsavedChanges2(false);
9081
+ setHasUnsavedChanges(false);
9085
9082
  if (!keepOpen) {
9086
9083
  onClose();
9087
9084
  }
@@ -9318,7 +9315,7 @@ function RelationshipDetailsPanel({
9318
9315
  const [isDescriptionModalOpen, setIsDescriptionModalOpen] = useState20(false);
9319
9316
  const [isSaving, setIsSaving] = useState20(false);
9320
9317
  const [isReadMode, setIsReadMode] = useState20(false);
9321
- const [hasUnsavedChanges, setHasUnsavedChanges2] = useState20(false);
9318
+ const [hasUnsavedChanges, setHasUnsavedChanges] = useState20(false);
9322
9319
  const propsEndRef = useRef16(null);
9323
9320
  const canEdit = useMemo9(() => {
9324
9321
  const ability = defineAbilityFor(userRole);
@@ -9331,14 +9328,14 @@ function RelationshipDetailsPanel({
9331
9328
  setCustomProps(extractCustomPropsFromNode(link || {}));
9332
9329
  setSourceLabel((link == null ? void 0 : link.source_label) ?? "");
9333
9330
  setTargetLabel((link == null ? void 0 : link.target_label) ?? "");
9334
- setHasUnsavedChanges2(false);
9331
+ setHasUnsavedChanges(false);
9335
9332
  }, [link]);
9336
9333
  const swallow = (e) => e.stopPropagation();
9337
9334
  const handleAddProp = () => {
9338
9335
  if (!canEdit) return;
9339
9336
  const newProp = createNewCustomProperty(customProps);
9340
9337
  setCustomProps((p) => [...p, newProp]);
9341
- setHasUnsavedChanges2(true);
9338
+ setHasUnsavedChanges(true);
9342
9339
  setTimeout(() => {
9343
9340
  var _a;
9344
9341
  (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
@@ -9375,7 +9372,7 @@ function RelationshipDetailsPanel({
9375
9372
  if (currentTargetLabel.trim()) dataToSave.target_label = currentTargetLabel.trim();
9376
9373
  await onSave(dataToSave, keepOpen);
9377
9374
  onDataUpdate(dataToSave);
9378
- setHasUnsavedChanges2(false);
9375
+ setHasUnsavedChanges(false);
9379
9376
  if (!keepOpen) {
9380
9377
  onClose();
9381
9378
  }
@@ -9389,21 +9386,21 @@ function RelationshipDetailsPanel({
9389
9386
  const handleSaveDescriptionInline = (newDescription) => {
9390
9387
  if (!canEdit) return;
9391
9388
  setDescription(newDescription);
9392
- setHasUnsavedChanges2(true);
9389
+ setHasUnsavedChanges(true);
9393
9390
  onDataUpdate((prev) => ({ ...prev, description: newDescription }));
9394
9391
  triggerAutoSave({ description: newDescription });
9395
9392
  };
9396
9393
  const handleRemoveProp = (i) => {
9397
9394
  const newProps = customProps.filter((_, idx) => idx !== i);
9398
9395
  setCustomProps(newProps);
9399
- setHasUnsavedChanges2(true);
9396
+ setHasUnsavedChanges(true);
9400
9397
  triggerAutoSave({ customProps: newProps });
9401
9398
  };
9402
9399
  const handleUpdateProp = (index, updatedProp) => {
9403
9400
  const newProps = [...customProps];
9404
9401
  newProps[index] = updatedProp;
9405
9402
  setCustomProps(newProps);
9406
- setHasUnsavedChanges2(true);
9403
+ setHasUnsavedChanges(true);
9407
9404
  if (!updatedProp.isEditing) {
9408
9405
  triggerAutoSave({ customProps: newProps });
9409
9406
  }
@@ -9458,7 +9455,7 @@ function RelationshipDetailsPanel({
9458
9455
  value: name,
9459
9456
  onChange: (e) => {
9460
9457
  setName(e.target.value);
9461
- setHasUnsavedChanges2(true);
9458
+ setHasUnsavedChanges(true);
9462
9459
  },
9463
9460
  placeholder: "Ex: Controla, Pertence a, Fornece...",
9464
9461
  disabled: !canEdit,
@@ -9473,7 +9470,7 @@ function RelationshipDetailsPanel({
9473
9470
  value: sourceLabel,
9474
9471
  onChange: (e) => {
9475
9472
  setSourceLabel(e.target.value);
9476
- setHasUnsavedChanges2(true);
9473
+ setHasUnsavedChanges(true);
9477
9474
  },
9478
9475
  placeholder: "Ex: Conceitos",
9479
9476
  disabled: !canEdit,
@@ -9488,7 +9485,7 @@ function RelationshipDetailsPanel({
9488
9485
  value: targetLabel,
9489
9486
  onChange: (e) => {
9490
9487
  setTargetLabel(e.target.value);
9491
- setHasUnsavedChanges2(true);
9488
+ setHasUnsavedChanges(true);
9492
9489
  },
9493
9490
  placeholder: "Ex: Refer\xEAncias",
9494
9491
  disabled: !canEdit,
@@ -9566,7 +9563,7 @@ function RelationshipDetailsPanel({
9566
9563
  onSave: (newDescription) => {
9567
9564
  if (!canEdit) return;
9568
9565
  setDescription(newDescription);
9569
- setHasUnsavedChanges2(true);
9566
+ setHasUnsavedChanges(true);
9570
9567
  onDataUpdate((prev) => ({ ...prev, description: newDescription }));
9571
9568
  triggerAutoSave({ description: newDescription });
9572
9569
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.5-dev.7",
3
+ "version": "1.2.5-dev.9",
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",