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

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
@@ -2698,7 +2698,10 @@ var IGNORED_KEYS = [
2698
2698
  "isAddingNodes",
2699
2699
  "ancestryDescriptionSections",
2700
2700
  "direction",
2701
- "is_private"
2701
+ "is_private",
2702
+ "abstraction_tree",
2703
+ "selectedAbstractionParentId",
2704
+ "isAddingAbstractionNodes"
2702
2705
  ];
2703
2706
  function extractCustomPropsFromNode(node) {
2704
2707
  const customPropTypes = node._customPropTypes || {};
@@ -5163,14 +5166,15 @@ function CreateAncestryPanel({
5163
5166
  }
5164
5167
  }
5165
5168
  };
5166
- const takeSnapshot = (tree, name, desc, sections, customProps2, isPrivateVal) => {
5169
+ const takeSnapshot = (tree, name, desc, sections, customProps2, isPrivateVal, abstractionTree = null) => {
5167
5170
  return {
5168
5171
  tree: JSON.stringify(tree),
5169
5172
  name,
5170
5173
  description: desc || "",
5171
5174
  sections: JSON.stringify(sections || []),
5172
5175
  customProps: JSON.stringify(customProps2 || []),
5173
- isPrivate: isPrivateVal
5176
+ isPrivate: isPrivateVal,
5177
+ abstractionTree: JSON.stringify(abstractionTree)
5174
5178
  };
5175
5179
  };
5176
5180
  const getCurrentContext = () => {
@@ -5304,7 +5308,8 @@ function CreateAncestryPanel({
5304
5308
  ancestryMode.ancestryDescription,
5305
5309
  ancestryMode.ancestryDescriptionSections,
5306
5310
  extractedProps,
5307
- ancestryMode.is_private
5311
+ ancestryMode.is_private,
5312
+ ancestryMode.abstraction_tree
5308
5313
  ));
5309
5314
  } else if (ctx) {
5310
5315
  setLastSavedSnapshot(takeSnapshot(
@@ -5313,7 +5318,8 @@ function CreateAncestryPanel({
5313
5318
  ctx.description,
5314
5319
  ctx.sections,
5315
5320
  extractedProps,
5316
- isPrivate
5321
+ isPrivate,
5322
+ ancestryMode.abstraction_tree
5317
5323
  ));
5318
5324
  }
5319
5325
  }, [branchStack, ancestryMode]);
@@ -5356,7 +5362,7 @@ function CreateAncestryPanel({
5356
5362
  rootTreeClone,
5357
5363
  rootExtras
5358
5364
  );
5359
- setLastSavedSnapshot(takeSnapshot(rootTreeClone, ancestryName, description, processedSections, [], isPrivate));
5365
+ setLastSavedSnapshot(takeSnapshot(rootTreeClone, ancestryName, description, processedSections, [], isPrivate, ancestryMode.abstraction_tree));
5360
5366
  if (onRenderFullAncestry) {
5361
5367
  const fullTreePayload = {
5362
5368
  ancestry_id: ancestryMode.currentAncestryId || "temp_root",
@@ -5417,7 +5423,8 @@ function CreateAncestryPanel({
5417
5423
  ancestryMode.ancestryDescription,
5418
5424
  ancestryMode.ancestryDescriptionSections,
5419
5425
  currentRootProps,
5420
- isPrivate
5426
+ isPrivate,
5427
+ ancestryMode.abstraction_tree
5421
5428
  ));
5422
5429
  if (onClearAncestryVisuals) {
5423
5430
  onClearAncestryVisuals(currentStep.branchId);
@@ -5606,6 +5613,11 @@ function CreateAncestryPanel({
5606
5613
  const sectionsChanged = JSON.stringify(existingSections) !== lastSavedSnapshot.sections;
5607
5614
  const propsChanged = JSON.stringify(customProps) !== lastSavedSnapshot.customProps;
5608
5615
  const privateChanged = isPrivate !== lastSavedSnapshot.isPrivate;
5616
+ let abstractionTreeChanged = false;
5617
+ if (branchStack.length === 0) {
5618
+ const currentAbsTreeStr = JSON.stringify(ancestryMode.abstraction_tree);
5619
+ abstractionTreeChanged = currentAbsTreeStr !== lastSavedSnapshot.abstractionTree;
5620
+ }
5609
5621
  return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged;
5610
5622
  }, [
5611
5623
  ancestryName,
@@ -5615,6 +5627,7 @@ function CreateAncestryPanel({
5615
5627
  branchStack,
5616
5628
  lastSavedSnapshot,
5617
5629
  ancestryMode.tree,
5630
+ ancestryMode.abstraction_tree,
5618
5631
  customProps,
5619
5632
  isPrivate
5620
5633
  ]);
@@ -5857,7 +5870,8 @@ function CreateAncestryPanel({
5857
5870
  currentInputDesc,
5858
5871
  processedSections,
5859
5872
  customProps,
5860
- isPrivate
5873
+ isPrivate,
5874
+ ancestryMode.abstraction_tree
5861
5875
  ));
5862
5876
  if (onRenderFullAncestry) {
5863
5877
  const rotation = branchStack.reduce((acc, step) => {
@@ -5916,7 +5930,8 @@ function CreateAncestryPanel({
5916
5930
  currentInputDesc,
5917
5931
  processedSections,
5918
5932
  customProps,
5919
- isPrivate
5933
+ isPrivate,
5934
+ ancestryMode.abstraction_tree
5920
5935
  ));
5921
5936
  if (!keepOpen) onClose();
5922
5937
  } finally {
@@ -5969,7 +5984,9 @@ function CreateAncestryPanel({
5969
5984
  const node = findNode(activeTree, selectedParentId);
5970
5985
  return node ? node.name : "Nenhum";
5971
5986
  };
5972
- const hasChildren = activeTree && activeTree.children && activeTree.children.length > 0;
5987
+ const hasMainChildren = activeTree && activeTree.children && activeTree.children.length > 0;
5988
+ const hasAbstractionChildren = branchStack.length === 0 && ancestryMode.abstraction_tree && ancestryMode.abstraction_tree.children && ancestryMode.abstraction_tree.children.length > 0;
5989
+ const canSave = hasMainChildren || hasAbstractionChildren;
5973
5990
  const handleSectionChangeWrapper = (sectionId) => {
5974
5991
  const ctx = getCurrentContext();
5975
5992
  const currentDesc = ctx ? ctx.description : description;
@@ -6248,7 +6265,7 @@ function CreateAncestryPanel({
6248
6265
  onChange: (e) => setIsPrivate(e.target.checked),
6249
6266
  className: "hidden"
6250
6267
  }
6251
- ), /* @__PURE__ */ import_react10.default.createElement("span", { className: `text-xs flex items-center gap-1 transition-colors ${isPrivate ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}` }, /* @__PURE__ */ import_react10.default.createElement(import_fi9.FiLock, { size: 10 }), " N\xE3o Export\xE1vel"))))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "px-6 pt-2 pb-5 flex-shrink-0" }, hasChildren && /* @__PURE__ */ import_react10.default.createElement(
6268
+ ), /* @__PURE__ */ import_react10.default.createElement("span", { className: `text-xs flex items-center gap-1 transition-colors ${isPrivate ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}` }, /* @__PURE__ */ import_react10.default.createElement(import_fi9.FiLock, { size: 10 }), " N\xE3o Export\xE1vel"))))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "px-6 pt-2 pb-5 flex-shrink-0" }, canSave && /* @__PURE__ */ import_react10.default.createElement(
6252
6269
  "button",
6253
6270
  {
6254
6271
  onClick: () => handleLocalSave(false),
@@ -11834,6 +11851,7 @@ function XViewScene({
11834
11851
  CreateAncestryPanel,
11835
11852
  {
11836
11853
  ancestryMode,
11854
+ setAncestryMode,
11837
11855
  onSelectParent: handleSelectAncestryParent,
11838
11856
  onRemoveNode: handleRemoveFromAncestry,
11839
11857
  onSave: handleSaveAncestry,
package/dist/index.mjs CHANGED
@@ -2654,7 +2654,10 @@ var IGNORED_KEYS = [
2654
2654
  "isAddingNodes",
2655
2655
  "ancestryDescriptionSections",
2656
2656
  "direction",
2657
- "is_private"
2657
+ "is_private",
2658
+ "abstraction_tree",
2659
+ "selectedAbstractionParentId",
2660
+ "isAddingAbstractionNodes"
2658
2661
  ];
2659
2662
  function extractCustomPropsFromNode(node) {
2660
2663
  const customPropTypes = node._customPropTypes || {};
@@ -5144,14 +5147,15 @@ function CreateAncestryPanel({
5144
5147
  }
5145
5148
  }
5146
5149
  };
5147
- const takeSnapshot = (tree, name, desc, sections, customProps2, isPrivateVal) => {
5150
+ const takeSnapshot = (tree, name, desc, sections, customProps2, isPrivateVal, abstractionTree = null) => {
5148
5151
  return {
5149
5152
  tree: JSON.stringify(tree),
5150
5153
  name,
5151
5154
  description: desc || "",
5152
5155
  sections: JSON.stringify(sections || []),
5153
5156
  customProps: JSON.stringify(customProps2 || []),
5154
- isPrivate: isPrivateVal
5157
+ isPrivate: isPrivateVal,
5158
+ abstractionTree: JSON.stringify(abstractionTree)
5155
5159
  };
5156
5160
  };
5157
5161
  const getCurrentContext = () => {
@@ -5285,7 +5289,8 @@ function CreateAncestryPanel({
5285
5289
  ancestryMode.ancestryDescription,
5286
5290
  ancestryMode.ancestryDescriptionSections,
5287
5291
  extractedProps,
5288
- ancestryMode.is_private
5292
+ ancestryMode.is_private,
5293
+ ancestryMode.abstraction_tree
5289
5294
  ));
5290
5295
  } else if (ctx) {
5291
5296
  setLastSavedSnapshot(takeSnapshot(
@@ -5294,7 +5299,8 @@ function CreateAncestryPanel({
5294
5299
  ctx.description,
5295
5300
  ctx.sections,
5296
5301
  extractedProps,
5297
- isPrivate
5302
+ isPrivate,
5303
+ ancestryMode.abstraction_tree
5298
5304
  ));
5299
5305
  }
5300
5306
  }, [branchStack, ancestryMode]);
@@ -5337,7 +5343,7 @@ function CreateAncestryPanel({
5337
5343
  rootTreeClone,
5338
5344
  rootExtras
5339
5345
  );
5340
- setLastSavedSnapshot(takeSnapshot(rootTreeClone, ancestryName, description, processedSections, [], isPrivate));
5346
+ setLastSavedSnapshot(takeSnapshot(rootTreeClone, ancestryName, description, processedSections, [], isPrivate, ancestryMode.abstraction_tree));
5341
5347
  if (onRenderFullAncestry) {
5342
5348
  const fullTreePayload = {
5343
5349
  ancestry_id: ancestryMode.currentAncestryId || "temp_root",
@@ -5398,7 +5404,8 @@ function CreateAncestryPanel({
5398
5404
  ancestryMode.ancestryDescription,
5399
5405
  ancestryMode.ancestryDescriptionSections,
5400
5406
  currentRootProps,
5401
- isPrivate
5407
+ isPrivate,
5408
+ ancestryMode.abstraction_tree
5402
5409
  ));
5403
5410
  if (onClearAncestryVisuals) {
5404
5411
  onClearAncestryVisuals(currentStep.branchId);
@@ -5587,6 +5594,11 @@ function CreateAncestryPanel({
5587
5594
  const sectionsChanged = JSON.stringify(existingSections) !== lastSavedSnapshot.sections;
5588
5595
  const propsChanged = JSON.stringify(customProps) !== lastSavedSnapshot.customProps;
5589
5596
  const privateChanged = isPrivate !== lastSavedSnapshot.isPrivate;
5597
+ let abstractionTreeChanged = false;
5598
+ if (branchStack.length === 0) {
5599
+ const currentAbsTreeStr = JSON.stringify(ancestryMode.abstraction_tree);
5600
+ abstractionTreeChanged = currentAbsTreeStr !== lastSavedSnapshot.abstractionTree;
5601
+ }
5590
5602
  return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged;
5591
5603
  }, [
5592
5604
  ancestryName,
@@ -5596,6 +5608,7 @@ function CreateAncestryPanel({
5596
5608
  branchStack,
5597
5609
  lastSavedSnapshot,
5598
5610
  ancestryMode.tree,
5611
+ ancestryMode.abstraction_tree,
5599
5612
  customProps,
5600
5613
  isPrivate
5601
5614
  ]);
@@ -5838,7 +5851,8 @@ function CreateAncestryPanel({
5838
5851
  currentInputDesc,
5839
5852
  processedSections,
5840
5853
  customProps,
5841
- isPrivate
5854
+ isPrivate,
5855
+ ancestryMode.abstraction_tree
5842
5856
  ));
5843
5857
  if (onRenderFullAncestry) {
5844
5858
  const rotation = branchStack.reduce((acc, step) => {
@@ -5897,7 +5911,8 @@ function CreateAncestryPanel({
5897
5911
  currentInputDesc,
5898
5912
  processedSections,
5899
5913
  customProps,
5900
- isPrivate
5914
+ isPrivate,
5915
+ ancestryMode.abstraction_tree
5901
5916
  ));
5902
5917
  if (!keepOpen) onClose();
5903
5918
  } finally {
@@ -5950,7 +5965,9 @@ function CreateAncestryPanel({
5950
5965
  const node = findNode(activeTree, selectedParentId);
5951
5966
  return node ? node.name : "Nenhum";
5952
5967
  };
5953
- const hasChildren = activeTree && activeTree.children && activeTree.children.length > 0;
5968
+ const hasMainChildren = activeTree && activeTree.children && activeTree.children.length > 0;
5969
+ const hasAbstractionChildren = branchStack.length === 0 && ancestryMode.abstraction_tree && ancestryMode.abstraction_tree.children && ancestryMode.abstraction_tree.children.length > 0;
5970
+ const canSave = hasMainChildren || hasAbstractionChildren;
5954
5971
  const handleSectionChangeWrapper = (sectionId) => {
5955
5972
  const ctx = getCurrentContext();
5956
5973
  const currentDesc = ctx ? ctx.description : description;
@@ -6229,7 +6246,7 @@ function CreateAncestryPanel({
6229
6246
  onChange: (e) => setIsPrivate(e.target.checked),
6230
6247
  className: "hidden"
6231
6248
  }
6232
- ), /* @__PURE__ */ React10.createElement("span", { className: `text-xs flex items-center gap-1 transition-colors ${isPrivate ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}` }, /* @__PURE__ */ React10.createElement(FiLock, { size: 10 }), " N\xE3o Export\xE1vel"))))), /* @__PURE__ */ React10.createElement("div", { className: "px-6 pt-2 pb-5 flex-shrink-0" }, hasChildren && /* @__PURE__ */ React10.createElement(
6249
+ ), /* @__PURE__ */ React10.createElement("span", { className: `text-xs flex items-center gap-1 transition-colors ${isPrivate ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}` }, /* @__PURE__ */ React10.createElement(FiLock, { size: 10 }), " N\xE3o Export\xE1vel"))))), /* @__PURE__ */ React10.createElement("div", { className: "px-6 pt-2 pb-5 flex-shrink-0" }, canSave && /* @__PURE__ */ React10.createElement(
6233
6250
  "button",
6234
6251
  {
6235
6252
  onClick: () => handleLocalSave(false),
@@ -11828,6 +11845,7 @@ function XViewScene({
11828
11845
  CreateAncestryPanel,
11829
11846
  {
11830
11847
  ancestryMode,
11848
+ setAncestryMode,
11831
11849
  onSelectParent: handleSelectAncestryParent,
11832
11850
  onRemoveNode: handleRemoveFromAncestry,
11833
11851
  onSave: handleSaveAncestry,
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.1",
3
+ "version": "1.1.9-dev.3",
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",