@lv-x-software-house/x_view 1.2.2-dev.3 → 1.2.2-dev.5

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
@@ -3766,6 +3766,7 @@ function DescriptionEditModal({
3766
3766
  e.preventDefault();
3767
3767
  e.stopPropagation();
3768
3768
  e.stopImmediatePropagation();
3769
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3769
3770
  setIsMentionModalOpen(false);
3770
3771
  setMentionTriggerIndex(null);
3771
3772
  setTooltipData(null);
@@ -3859,6 +3860,7 @@ function DescriptionEditModal({
3859
3860
  setIsImportModalOpen(false);
3860
3861
  };
3861
3862
  const handleMentionSelect = (node) => {
3863
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3862
3864
  const tag = `[[MENTION:node:${node.id}]]`;
3863
3865
  const el = textareaRef.current;
3864
3866
  if (mentionTriggerIndex !== null && el) {
@@ -5255,6 +5257,7 @@ function CreateAncestryPanel({
5255
5257
  const branchProgressMapRef = (0, import_react10.useRef)({});
5256
5258
  const [lastSavedSnapshot, setLastSavedSnapshot] = (0, import_react10.useState)(null);
5257
5259
  const [isPrivate, setIsPrivate] = (0, import_react10.useState)(ancestryMode.is_private || false);
5260
+ const initializedContextIdRef = (0, import_react10.useRef)(null);
5258
5261
  const availableImages = customProps.filter((p) => p.type === "images").flatMap((p) => Array.isArray(p.value) ? p.value : []).filter((img) => img.value && img.value.trim() !== "");
5259
5262
  const handleImageClickFromText = (url, name) => {
5260
5263
  if (onOpenImageViewer) {
@@ -5453,6 +5456,11 @@ function CreateAncestryPanel({
5453
5456
  }, [isContextLinked, branchStack]);
5454
5457
  (0, import_react10.useEffect)(() => {
5455
5458
  const ctx = getCurrentContext();
5459
+ const currentContextId = branchStack.length > 0 ? branchStack[branchStack.length - 1].branchId : ancestryMode.currentAncestryId || `new_${ancestryMode.ancestral_node}`;
5460
+ if (initializedContextIdRef.current === currentContextId) {
5461
+ return;
5462
+ }
5463
+ initializedContextIdRef.current = currentContextId;
5456
5464
  let sourceObject = {};
5457
5465
  if (ctx) {
5458
5466
  sourceObject = ctx;
@@ -5803,7 +5811,7 @@ function CreateAncestryPanel({
5803
5811
  const currentAbsTreeStr = JSON.stringify(ancestryMode.abstraction_tree);
5804
5812
  abstractionTreeChanged = currentAbsTreeStr !== lastSavedSnapshot.abstractionTree;
5805
5813
  }
5806
- return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged;
5814
+ return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged || abstractionTreeChanged;
5807
5815
  }, [
5808
5816
  ancestryName,
5809
5817
  description,
package/dist/index.mjs CHANGED
@@ -3722,6 +3722,7 @@ function DescriptionEditModal({
3722
3722
  e.preventDefault();
3723
3723
  e.stopPropagation();
3724
3724
  e.stopImmediatePropagation();
3725
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3725
3726
  setIsMentionModalOpen(false);
3726
3727
  setMentionTriggerIndex(null);
3727
3728
  setTooltipData(null);
@@ -3815,6 +3816,7 @@ function DescriptionEditModal({
3815
3816
  setIsImportModalOpen(false);
3816
3817
  };
3817
3818
  const handleMentionSelect = (node) => {
3819
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3818
3820
  const tag = `[[MENTION:node:${node.id}]]`;
3819
3821
  const el = textareaRef.current;
3820
3822
  if (mentionTriggerIndex !== null && el) {
@@ -5241,6 +5243,7 @@ function CreateAncestryPanel({
5241
5243
  const branchProgressMapRef = useRef8({});
5242
5244
  const [lastSavedSnapshot, setLastSavedSnapshot] = useState10(null);
5243
5245
  const [isPrivate, setIsPrivate] = useState10(ancestryMode.is_private || false);
5246
+ const initializedContextIdRef = useRef8(null);
5244
5247
  const availableImages = customProps.filter((p) => p.type === "images").flatMap((p) => Array.isArray(p.value) ? p.value : []).filter((img) => img.value && img.value.trim() !== "");
5245
5248
  const handleImageClickFromText = (url, name) => {
5246
5249
  if (onOpenImageViewer) {
@@ -5439,6 +5442,11 @@ function CreateAncestryPanel({
5439
5442
  }, [isContextLinked, branchStack]);
5440
5443
  useEffect10(() => {
5441
5444
  const ctx = getCurrentContext();
5445
+ const currentContextId = branchStack.length > 0 ? branchStack[branchStack.length - 1].branchId : ancestryMode.currentAncestryId || `new_${ancestryMode.ancestral_node}`;
5446
+ if (initializedContextIdRef.current === currentContextId) {
5447
+ return;
5448
+ }
5449
+ initializedContextIdRef.current = currentContextId;
5442
5450
  let sourceObject = {};
5443
5451
  if (ctx) {
5444
5452
  sourceObject = ctx;
@@ -5789,7 +5797,7 @@ function CreateAncestryPanel({
5789
5797
  const currentAbsTreeStr = JSON.stringify(ancestryMode.abstraction_tree);
5790
5798
  abstractionTreeChanged = currentAbsTreeStr !== lastSavedSnapshot.abstractionTree;
5791
5799
  }
5792
- return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged;
5800
+ return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged || abstractionTreeChanged;
5793
5801
  }, [
5794
5802
  ancestryName,
5795
5803
  description,
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.3",
3
+ "version": "1.2.2-dev.5",
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",