@lv-x-software-house/x_view 1.1.9 → 1.2.1-dev.1

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
@@ -4552,13 +4552,20 @@ function DescriptionReadModePanel({
4552
4552
  customProperties = [],
4553
4553
  onImageClick,
4554
4554
  userRole,
4555
- // --- NOVAS PROPS PARA ABSTRAÇÃO ---
4556
4555
  abstractionTree = null,
4557
- onRenderAbstractionTree = null
4556
+ onRenderAbstractionTree = null,
4557
+ initialShowAbstraction = false
4558
+ // <--- NOVA PROP RECEBIDA
4558
4559
  }) {
4559
4560
  const [showProperties, setShowProperties] = (0, import_react7.useState)(false);
4560
4561
  const [showAbstraction, setShowAbstraction] = (0, import_react7.useState)(false);
4561
4562
  const [targetRenderNodeId, setTargetRenderNodeId] = (0, import_react7.useState)(null);
4563
+ import_react7.default.useEffect(() => {
4564
+ setShowAbstraction(initialShowAbstraction);
4565
+ if (initialShowAbstraction) {
4566
+ setShowProperties(false);
4567
+ }
4568
+ }, [initialShowAbstraction]);
4562
4569
  const swallow = (e) => e.stopPropagation();
4563
4570
  const hasCustomProps = customProperties && customProperties.length > 0;
4564
4571
  const hasAbstraction = Boolean(abstractionTree && (abstractionTree.node || abstractionTree.children && abstractionTree.children.length > 0));
@@ -9038,7 +9045,8 @@ function XViewScene({
9038
9045
  const [readingMode, setReadingMode] = (0, import_react23.useState)({
9039
9046
  isActive: false,
9040
9047
  ancestry: null,
9041
- branchStack: []
9048
+ branchStack: [],
9049
+ autoAbstraction: false
9042
9050
  });
9043
9051
  const [formPosition, setFormPosition] = (0, import_react23.useState)({ left: 16, top: 16, opacity: 0 });
9044
9052
  const [detailsNode, setDetailsNode] = (0, import_react23.useState)(null);
@@ -11341,19 +11349,30 @@ function XViewScene({
11341
11349
  currentMaxIndex: 0,
11342
11350
  progressMap: {}
11343
11351
  };
11352
+ const hasDescription = ancestryObject.description && ancestryObject.description.trim() !== "";
11353
+ const hasMainTreeNodes = ancestryObject.tree.children && ancestryObject.tree.children.length > 0;
11354
+ const hasAbstractionNodes = ancestryObject.abstraction_tree && ancestryObject.abstraction_tree.children && ancestryObject.abstraction_tree.children.length > 0;
11355
+ const shouldAutoRenderAbstraction = !hasDescription && !hasMainTreeNodes && hasAbstractionNodes;
11344
11356
  setReadingMode({
11345
11357
  isActive: true,
11346
11358
  ancestry: ancestryObject,
11347
- branchStack: []
11359
+ branchStack: [],
11360
+ autoAbstraction: shouldAutoRenderAbstraction
11361
+ // <--- FLAG ENVIADA PARA A UI
11348
11362
  });
11349
- const initialSections = /* @__PURE__ */ new Set(["preamble", 0, "0"]);
11350
- const ancestryWithForceUpdate = {
11351
- ...ancestryObject,
11352
- _forceUpdate: true
11353
- };
11354
- await handleRenderAncestry(ancestryWithForceUpdate, initialSections);
11363
+ if (shouldAutoRenderAbstraction) {
11364
+ handleRenderAbstractionTree(ancestryObject, null);
11365
+ } else {
11366
+ const initialSections = /* @__PURE__ */ new Set(["preamble", 0, "0"]);
11367
+ const ancestryWithForceUpdate = {
11368
+ ...ancestryObject,
11369
+ _forceUpdate: true
11370
+ };
11371
+ await handleRenderAncestry(ancestryWithForceUpdate, initialSections);
11372
+ }
11355
11373
  },
11356
- [handleRenderAncestry]
11374
+ [handleRenderAncestry, handleRenderAbstractionTree]
11375
+ // <--- DEPENDÊNCIA ADICIONADA
11357
11376
  );
11358
11377
  const handleReadModeSectionChange = (0, import_react23.useCallback)((activeSectionId) => {
11359
11378
  const { ancestry, branchStack } = readingMode;
@@ -12026,6 +12045,7 @@ function XViewScene({
12026
12045
  description: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description,
12027
12046
  savedSections: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description_sections,
12028
12047
  customProperties: (getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.customProperties) || [],
12048
+ initialShowAbstraction: readingMode.autoAbstraction,
12029
12049
  onBack: null,
12030
12050
  onEdit: () => {
12031
12051
  handleCloseReadMode();
package/dist/index.mjs CHANGED
@@ -4520,13 +4520,20 @@ function DescriptionReadModePanel({
4520
4520
  customProperties = [],
4521
4521
  onImageClick,
4522
4522
  userRole,
4523
- // --- NOVAS PROPS PARA ABSTRAÇÃO ---
4524
4523
  abstractionTree = null,
4525
- onRenderAbstractionTree = null
4524
+ onRenderAbstractionTree = null,
4525
+ initialShowAbstraction = false
4526
+ // <--- NOVA PROP RECEBIDA
4526
4527
  }) {
4527
4528
  const [showProperties, setShowProperties] = useState7(false);
4528
4529
  const [showAbstraction, setShowAbstraction] = useState7(false);
4529
4530
  const [targetRenderNodeId, setTargetRenderNodeId] = useState7(null);
4531
+ React7.useEffect(() => {
4532
+ setShowAbstraction(initialShowAbstraction);
4533
+ if (initialShowAbstraction) {
4534
+ setShowProperties(false);
4535
+ }
4536
+ }, [initialShowAbstraction]);
4530
4537
  const swallow = (e) => e.stopPropagation();
4531
4538
  const hasCustomProps = customProperties && customProperties.length > 0;
4532
4539
  const hasAbstraction = Boolean(abstractionTree && (abstractionTree.node || abstractionTree.children && abstractionTree.children.length > 0));
@@ -9034,7 +9041,8 @@ function XViewScene({
9034
9041
  const [readingMode, setReadingMode] = useState22({
9035
9042
  isActive: false,
9036
9043
  ancestry: null,
9037
- branchStack: []
9044
+ branchStack: [],
9045
+ autoAbstraction: false
9038
9046
  });
9039
9047
  const [formPosition, setFormPosition] = useState22({ left: 16, top: 16, opacity: 0 });
9040
9048
  const [detailsNode, setDetailsNode] = useState22(null);
@@ -11337,19 +11345,30 @@ function XViewScene({
11337
11345
  currentMaxIndex: 0,
11338
11346
  progressMap: {}
11339
11347
  };
11348
+ const hasDescription = ancestryObject.description && ancestryObject.description.trim() !== "";
11349
+ const hasMainTreeNodes = ancestryObject.tree.children && ancestryObject.tree.children.length > 0;
11350
+ const hasAbstractionNodes = ancestryObject.abstraction_tree && ancestryObject.abstraction_tree.children && ancestryObject.abstraction_tree.children.length > 0;
11351
+ const shouldAutoRenderAbstraction = !hasDescription && !hasMainTreeNodes && hasAbstractionNodes;
11340
11352
  setReadingMode({
11341
11353
  isActive: true,
11342
11354
  ancestry: ancestryObject,
11343
- branchStack: []
11355
+ branchStack: [],
11356
+ autoAbstraction: shouldAutoRenderAbstraction
11357
+ // <--- FLAG ENVIADA PARA A UI
11344
11358
  });
11345
- const initialSections = /* @__PURE__ */ new Set(["preamble", 0, "0"]);
11346
- const ancestryWithForceUpdate = {
11347
- ...ancestryObject,
11348
- _forceUpdate: true
11349
- };
11350
- await handleRenderAncestry(ancestryWithForceUpdate, initialSections);
11359
+ if (shouldAutoRenderAbstraction) {
11360
+ handleRenderAbstractionTree(ancestryObject, null);
11361
+ } else {
11362
+ const initialSections = /* @__PURE__ */ new Set(["preamble", 0, "0"]);
11363
+ const ancestryWithForceUpdate = {
11364
+ ...ancestryObject,
11365
+ _forceUpdate: true
11366
+ };
11367
+ await handleRenderAncestry(ancestryWithForceUpdate, initialSections);
11368
+ }
11351
11369
  },
11352
- [handleRenderAncestry]
11370
+ [handleRenderAncestry, handleRenderAbstractionTree]
11371
+ // <--- DEPENDÊNCIA ADICIONADA
11353
11372
  );
11354
11373
  const handleReadModeSectionChange = useCallback3((activeSectionId) => {
11355
11374
  const { ancestry, branchStack } = readingMode;
@@ -12022,6 +12041,7 @@ function XViewScene({
12022
12041
  description: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description,
12023
12042
  savedSections: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description_sections,
12024
12043
  customProperties: (getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.customProperties) || [],
12044
+ initialShowAbstraction: readingMode.autoAbstraction,
12025
12045
  onBack: null,
12026
12046
  onEdit: () => {
12027
12047
  handleCloseReadMode();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.1.9",
3
+ "version": "1.2.1-dev.1",
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",