@lv-x-software-house/x_view 1.1.9-dev.7 → 1.1.9-dev.8

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
@@ -4557,7 +4557,7 @@ function DescriptionReadModePanel({
4557
4557
  const [targetRenderNodeId, setTargetRenderNodeId] = (0, import_react7.useState)(null);
4558
4558
  const swallow = (e) => e.stopPropagation();
4559
4559
  const hasCustomProps = customProperties && customProperties.length > 0;
4560
- const hasAbstraction = abstractionTree && abstractionTree.node;
4560
+ const hasAbstraction = Boolean(abstractionTree && (abstractionTree.node || abstractionTree.children && abstractionTree.children.length > 0));
4561
4561
  const ability = (0, import_react7.useMemo)(() => defineAbilityFor(userRole), [userRole]);
4562
4562
  const canEditAncestry = ability.can("update", "Ancestry");
4563
4563
  const highlightedPathIds = (0, import_react7.useMemo)(() => {
@@ -11305,6 +11305,18 @@ function XViewScene({
11305
11305
  // <--- ADICIONADO
11306
11306
  };
11307
11307
  }, [readingMode, buildFullAncestryTree, ancestryDataRef.current]);
11308
+ const readModeAbstractionTree = (0, import_react23.useMemo)(() => {
11309
+ if (!readingMode.isActive || !readingMode.ancestry || !readingMode.ancestry.abstraction_tree) {
11310
+ return null;
11311
+ }
11312
+ const allNodes = Object.values(parentDataRef.current || {}).flatMap((f) => f.nodes || []);
11313
+ const allAncestries = ancestryDataRef.current || [];
11314
+ return buildFullAncestryTree(
11315
+ readingMode.ancestry.abstraction_tree,
11316
+ allNodes,
11317
+ allAncestries
11318
+ );
11319
+ }, [readingMode.isActive, readingMode.ancestry, buildFullAncestryTree, sceneVersion]);
11308
11320
  const handleStartReadingAncestry = (0, import_react23.useCallback)(
11309
11321
  async (ancestryObject) => {
11310
11322
  setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
@@ -12014,7 +12026,7 @@ function XViewScene({
12014
12026
  backNavigationInfo,
12015
12027
  onImageClick: (url, name) => handleOpenImageViewer([{ name: name || "Imagem", value: url }], 0),
12016
12028
  userRole: userPermissionRole,
12017
- abstractionTree: readingMode.ancestry.abstraction_tree,
12029
+ abstractionTree: readModeAbstractionTree,
12018
12030
  onRenderAbstractionTree: (targetId) => handleRenderAbstractionTree(readingMode.ancestry, targetId)
12019
12031
  }
12020
12032
  )
package/dist/index.mjs CHANGED
@@ -4525,7 +4525,7 @@ function DescriptionReadModePanel({
4525
4525
  const [targetRenderNodeId, setTargetRenderNodeId] = useState7(null);
4526
4526
  const swallow = (e) => e.stopPropagation();
4527
4527
  const hasCustomProps = customProperties && customProperties.length > 0;
4528
- const hasAbstraction = abstractionTree && abstractionTree.node;
4528
+ const hasAbstraction = Boolean(abstractionTree && (abstractionTree.node || abstractionTree.children && abstractionTree.children.length > 0));
4529
4529
  const ability = useMemo6(() => defineAbilityFor(userRole), [userRole]);
4530
4530
  const canEditAncestry = ability.can("update", "Ancestry");
4531
4531
  const highlightedPathIds = useMemo6(() => {
@@ -11301,6 +11301,18 @@ function XViewScene({
11301
11301
  // <--- ADICIONADO
11302
11302
  };
11303
11303
  }, [readingMode, buildFullAncestryTree, ancestryDataRef.current]);
11304
+ const readModeAbstractionTree = useMemo12(() => {
11305
+ if (!readingMode.isActive || !readingMode.ancestry || !readingMode.ancestry.abstraction_tree) {
11306
+ return null;
11307
+ }
11308
+ const allNodes = Object.values(parentDataRef.current || {}).flatMap((f) => f.nodes || []);
11309
+ const allAncestries = ancestryDataRef.current || [];
11310
+ return buildFullAncestryTree(
11311
+ readingMode.ancestry.abstraction_tree,
11312
+ allNodes,
11313
+ allAncestries
11314
+ );
11315
+ }, [readingMode.isActive, readingMode.ancestry, buildFullAncestryTree, sceneVersion]);
11304
11316
  const handleStartReadingAncestry = useCallback3(
11305
11317
  async (ancestryObject) => {
11306
11318
  setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
@@ -12010,7 +12022,7 @@ function XViewScene({
12010
12022
  backNavigationInfo,
12011
12023
  onImageClick: (url, name) => handleOpenImageViewer([{ name: name || "Imagem", value: url }], 0),
12012
12024
  userRole: userPermissionRole,
12013
- abstractionTree: readingMode.ancestry.abstraction_tree,
12025
+ abstractionTree: readModeAbstractionTree,
12014
12026
  onRenderAbstractionTree: (targetId) => handleRenderAbstractionTree(readingMode.ancestry, targetId)
12015
12027
  }
12016
12028
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.1.9-dev.7",
3
+ "version": "1.1.9-dev.8",
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",