@lv-x-software-house/x_view 1.2.6-dev.32 → 1.2.6-dev.33
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 +66 -79
- package/dist/index.mjs +66 -79
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13659,19 +13659,16 @@ function Boards({
|
|
|
13659
13659
|
content: [],
|
|
13660
13660
|
children: []
|
|
13661
13661
|
};
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
return stack;
|
|
13673
|
-
});
|
|
13674
|
-
}, []);
|
|
13662
|
+
if (navigationStack.length === 0) {
|
|
13663
|
+
setBoardItems((prev) => [...prev, newItem]);
|
|
13664
|
+
} else {
|
|
13665
|
+
const parentId = navigationStack[navigationStack.length - 1];
|
|
13666
|
+
const add = (list) => list.map(
|
|
13667
|
+
(g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
|
|
13668
|
+
);
|
|
13669
|
+
setBoardItems((prev) => add(prev));
|
|
13670
|
+
}
|
|
13671
|
+
}, [navigationStack]);
|
|
13675
13672
|
const handleAddSubgroup = (0, import_react29.useCallback)((parentId, type = "text_group") => {
|
|
13676
13673
|
const add = (list) => list.map((g) => {
|
|
13677
13674
|
if (g.id === parentId) {
|
|
@@ -13700,76 +13697,66 @@ function Boards({
|
|
|
13700
13697
|
setBoardItems((prev) => del(prev));
|
|
13701
13698
|
}, []);
|
|
13702
13699
|
const handleIndent = (0, import_react29.useCallback)((id) => {
|
|
13703
|
-
|
|
13704
|
-
|
|
13705
|
-
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
});
|
|
13715
|
-
}, [triggerInstantSave]);
|
|
13700
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13701
|
+
const found = findGroupAndParent(next, id);
|
|
13702
|
+
if (!found || found.index === 0) return;
|
|
13703
|
+
const { group, siblings, index } = found;
|
|
13704
|
+
const targetParent = siblings[index - 1];
|
|
13705
|
+
if (group.type === "folder" && targetParent.type === "text_group") return;
|
|
13706
|
+
siblings.splice(index, 1);
|
|
13707
|
+
targetParent.children.push(group);
|
|
13708
|
+
setBoardItems(next);
|
|
13709
|
+
triggerInstantSave(next);
|
|
13710
|
+
}, [boardItems, triggerInstantSave]);
|
|
13716
13711
|
const handleIndentDown = (0, import_react29.useCallback)((id) => {
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
});
|
|
13729
|
-
}, [triggerInstantSave]);
|
|
13712
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13713
|
+
const found = findGroupAndParent(next, id);
|
|
13714
|
+
if (!found || found.index === found.siblings.length - 1) return;
|
|
13715
|
+
const { group, siblings, index } = found;
|
|
13716
|
+
const targetParent = siblings[index + 1];
|
|
13717
|
+
if (group.type === "folder" && targetParent.type === "text_group") return;
|
|
13718
|
+
siblings.splice(index, 1);
|
|
13719
|
+
targetParent.children.push(group);
|
|
13720
|
+
setBoardItems(next);
|
|
13721
|
+
triggerInstantSave(next);
|
|
13722
|
+
}, [boardItems, triggerInstantSave]);
|
|
13730
13723
|
const handleOutdent = (0, import_react29.useCallback)((id) => {
|
|
13731
|
-
|
|
13732
|
-
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
|
|
13745
|
-
});
|
|
13746
|
-
}, [triggerInstantSave]);
|
|
13724
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13725
|
+
const found = findGroupAndParent(next, id);
|
|
13726
|
+
if (!found || !found.parent) return;
|
|
13727
|
+
const { group, siblings, index, parent } = found;
|
|
13728
|
+
siblings.splice(index, 1);
|
|
13729
|
+
const parentFound = findGroupAndParent(next, parent.id);
|
|
13730
|
+
if (parentFound) {
|
|
13731
|
+
parentFound.siblings.splice(parentFound.index + 1, 0, group);
|
|
13732
|
+
} else {
|
|
13733
|
+
next.push(group);
|
|
13734
|
+
}
|
|
13735
|
+
setBoardItems(next);
|
|
13736
|
+
triggerInstantSave(next);
|
|
13737
|
+
}, [boardItems, triggerInstantSave]);
|
|
13747
13738
|
const handleMoveUp = (0, import_react29.useCallback)((id) => {
|
|
13748
|
-
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
|
|
13756
|
-
|
|
13757
|
-
|
|
13758
|
-
});
|
|
13759
|
-
}, [triggerInstantSave]);
|
|
13739
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13740
|
+
const found = findGroupAndParent(next, id);
|
|
13741
|
+
if (!found || found.index === 0) return;
|
|
13742
|
+
const { siblings, index } = found;
|
|
13743
|
+
const item = siblings[index];
|
|
13744
|
+
siblings.splice(index, 1);
|
|
13745
|
+
siblings.splice(index - 1, 0, item);
|
|
13746
|
+
setBoardItems(next);
|
|
13747
|
+
triggerInstantSave(next);
|
|
13748
|
+
}, [boardItems, triggerInstantSave]);
|
|
13760
13749
|
const handleMoveDown = (0, import_react29.useCallback)((id) => {
|
|
13761
|
-
|
|
13762
|
-
|
|
13763
|
-
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
});
|
|
13772
|
-
}, [triggerInstantSave]);
|
|
13750
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13751
|
+
const found = findGroupAndParent(next, id);
|
|
13752
|
+
if (!found || found.index === found.siblings.length - 1) return;
|
|
13753
|
+
const { siblings, index } = found;
|
|
13754
|
+
const item = siblings[index];
|
|
13755
|
+
siblings.splice(index, 1);
|
|
13756
|
+
siblings.splice(index + 1, 0, item);
|
|
13757
|
+
setBoardItems(next);
|
|
13758
|
+
triggerInstantSave(next);
|
|
13759
|
+
}, [boardItems, triggerInstantSave]);
|
|
13773
13760
|
const handleMentionClick = (0, import_react29.useCallback)((item) => {
|
|
13774
13761
|
if (onSelect) onSelect(item);
|
|
13775
13762
|
}, [onSelect]);
|
package/dist/index.mjs
CHANGED
|
@@ -13709,19 +13709,16 @@ function Boards({
|
|
|
13709
13709
|
content: [],
|
|
13710
13710
|
children: []
|
|
13711
13711
|
};
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
return stack;
|
|
13723
|
-
});
|
|
13724
|
-
}, []);
|
|
13712
|
+
if (navigationStack.length === 0) {
|
|
13713
|
+
setBoardItems((prev) => [...prev, newItem]);
|
|
13714
|
+
} else {
|
|
13715
|
+
const parentId = navigationStack[navigationStack.length - 1];
|
|
13716
|
+
const add = (list) => list.map(
|
|
13717
|
+
(g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
|
|
13718
|
+
);
|
|
13719
|
+
setBoardItems((prev) => add(prev));
|
|
13720
|
+
}
|
|
13721
|
+
}, [navigationStack]);
|
|
13725
13722
|
const handleAddSubgroup = useCallback5((parentId, type = "text_group") => {
|
|
13726
13723
|
const add = (list) => list.map((g) => {
|
|
13727
13724
|
if (g.id === parentId) {
|
|
@@ -13750,76 +13747,66 @@ function Boards({
|
|
|
13750
13747
|
setBoardItems((prev) => del(prev));
|
|
13751
13748
|
}, []);
|
|
13752
13749
|
const handleIndent = useCallback5((id) => {
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
|
|
13756
|
-
|
|
13757
|
-
|
|
13758
|
-
|
|
13759
|
-
|
|
13760
|
-
|
|
13761
|
-
|
|
13762
|
-
|
|
13763
|
-
|
|
13764
|
-
});
|
|
13765
|
-
}, [triggerInstantSave]);
|
|
13750
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13751
|
+
const found = findGroupAndParent(next, id);
|
|
13752
|
+
if (!found || found.index === 0) return;
|
|
13753
|
+
const { group, siblings, index } = found;
|
|
13754
|
+
const targetParent = siblings[index - 1];
|
|
13755
|
+
if (group.type === "folder" && targetParent.type === "text_group") return;
|
|
13756
|
+
siblings.splice(index, 1);
|
|
13757
|
+
targetParent.children.push(group);
|
|
13758
|
+
setBoardItems(next);
|
|
13759
|
+
triggerInstantSave(next);
|
|
13760
|
+
}, [boardItems, triggerInstantSave]);
|
|
13766
13761
|
const handleIndentDown = useCallback5((id) => {
|
|
13767
|
-
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
|
|
13775
|
-
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
});
|
|
13779
|
-
}, [triggerInstantSave]);
|
|
13762
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13763
|
+
const found = findGroupAndParent(next, id);
|
|
13764
|
+
if (!found || found.index === found.siblings.length - 1) return;
|
|
13765
|
+
const { group, siblings, index } = found;
|
|
13766
|
+
const targetParent = siblings[index + 1];
|
|
13767
|
+
if (group.type === "folder" && targetParent.type === "text_group") return;
|
|
13768
|
+
siblings.splice(index, 1);
|
|
13769
|
+
targetParent.children.push(group);
|
|
13770
|
+
setBoardItems(next);
|
|
13771
|
+
triggerInstantSave(next);
|
|
13772
|
+
}, [boardItems, triggerInstantSave]);
|
|
13780
13773
|
const handleOutdent = useCallback5((id) => {
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
|
|
13790
|
-
|
|
13791
|
-
|
|
13792
|
-
|
|
13793
|
-
|
|
13794
|
-
|
|
13795
|
-
});
|
|
13796
|
-
}, [triggerInstantSave]);
|
|
13774
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13775
|
+
const found = findGroupAndParent(next, id);
|
|
13776
|
+
if (!found || !found.parent) return;
|
|
13777
|
+
const { group, siblings, index, parent } = found;
|
|
13778
|
+
siblings.splice(index, 1);
|
|
13779
|
+
const parentFound = findGroupAndParent(next, parent.id);
|
|
13780
|
+
if (parentFound) {
|
|
13781
|
+
parentFound.siblings.splice(parentFound.index + 1, 0, group);
|
|
13782
|
+
} else {
|
|
13783
|
+
next.push(group);
|
|
13784
|
+
}
|
|
13785
|
+
setBoardItems(next);
|
|
13786
|
+
triggerInstantSave(next);
|
|
13787
|
+
}, [boardItems, triggerInstantSave]);
|
|
13797
13788
|
const handleMoveUp = useCallback5((id) => {
|
|
13798
|
-
|
|
13799
|
-
|
|
13800
|
-
|
|
13801
|
-
|
|
13802
|
-
|
|
13803
|
-
|
|
13804
|
-
|
|
13805
|
-
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
});
|
|
13809
|
-
}, [triggerInstantSave]);
|
|
13789
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13790
|
+
const found = findGroupAndParent(next, id);
|
|
13791
|
+
if (!found || found.index === 0) return;
|
|
13792
|
+
const { siblings, index } = found;
|
|
13793
|
+
const item = siblings[index];
|
|
13794
|
+
siblings.splice(index, 1);
|
|
13795
|
+
siblings.splice(index - 1, 0, item);
|
|
13796
|
+
setBoardItems(next);
|
|
13797
|
+
triggerInstantSave(next);
|
|
13798
|
+
}, [boardItems, triggerInstantSave]);
|
|
13810
13799
|
const handleMoveDown = useCallback5((id) => {
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
});
|
|
13822
|
-
}, [triggerInstantSave]);
|
|
13800
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13801
|
+
const found = findGroupAndParent(next, id);
|
|
13802
|
+
if (!found || found.index === found.siblings.length - 1) return;
|
|
13803
|
+
const { siblings, index } = found;
|
|
13804
|
+
const item = siblings[index];
|
|
13805
|
+
siblings.splice(index, 1);
|
|
13806
|
+
siblings.splice(index + 1, 0, item);
|
|
13807
|
+
setBoardItems(next);
|
|
13808
|
+
triggerInstantSave(next);
|
|
13809
|
+
}, [boardItems, triggerInstantSave]);
|
|
13823
13810
|
const handleMentionClick = useCallback5((item) => {
|
|
13824
13811
|
if (onSelect) onSelect(item);
|
|
13825
13812
|
}, [onSelect]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lv-x-software-house/x_view",
|
|
3
|
-
"version": "1.2.6-dev.
|
|
3
|
+
"version": "1.2.6-dev.33",
|
|
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",
|