@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 CHANGED
@@ -13659,19 +13659,16 @@ function Boards({
13659
13659
  content: [],
13660
13660
  children: []
13661
13661
  };
13662
- setNavigationStack((stack) => {
13663
- if (stack.length === 0) {
13664
- setBoardItems((prev) => [...prev, newItem]);
13665
- } else {
13666
- const parentId = stack[stack.length - 1];
13667
- const add = (list) => list.map(
13668
- (g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
13669
- );
13670
- setBoardItems((prev) => add(prev));
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
- setBoardItems((prev) => {
13704
- const next = JSON.parse(JSON.stringify(prev));
13705
- const found = findGroupAndParent(next, id);
13706
- if (!found || found.index === 0) return prev;
13707
- const { group, siblings, index } = found;
13708
- const targetParent = siblings[index - 1];
13709
- if (group.type === "folder" && targetParent.type === "text_group") return prev;
13710
- siblings.splice(index, 1);
13711
- targetParent.children.push(group);
13712
- triggerInstantSave(next);
13713
- return next;
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
- setBoardItems((prev) => {
13718
- const next = JSON.parse(JSON.stringify(prev));
13719
- const found = findGroupAndParent(next, id);
13720
- if (!found || found.index === found.siblings.length - 1) return prev;
13721
- const { group, siblings, index } = found;
13722
- const targetParent = siblings[index + 1];
13723
- if (group.type === "folder" && targetParent.type === "text_group") return prev;
13724
- siblings.splice(index, 1);
13725
- targetParent.children.push(group);
13726
- triggerInstantSave(next);
13727
- return next;
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
- setBoardItems((prev) => {
13732
- const next = JSON.parse(JSON.stringify(prev));
13733
- const found = findGroupAndParent(next, id);
13734
- if (!found || !found.parent) return prev;
13735
- const { group, siblings, index, parent } = found;
13736
- siblings.splice(index, 1);
13737
- const parentFound = findGroupAndParent(next, parent.id);
13738
- if (parentFound) {
13739
- parentFound.siblings.splice(parentFound.index + 1, 0, group);
13740
- } else {
13741
- next.push(group);
13742
- }
13743
- triggerInstantSave(next);
13744
- return next;
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
- setBoardItems((prev) => {
13749
- const next = JSON.parse(JSON.stringify(prev));
13750
- const found = findGroupAndParent(next, id);
13751
- if (!found || found.index === 0) return prev;
13752
- const { siblings, index } = found;
13753
- const item = siblings[index];
13754
- siblings.splice(index, 1);
13755
- siblings.splice(index - 1, 0, item);
13756
- triggerInstantSave(next);
13757
- return next;
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
- setBoardItems((prev) => {
13762
- const next = JSON.parse(JSON.stringify(prev));
13763
- const found = findGroupAndParent(next, id);
13764
- if (!found || found.index === found.siblings.length - 1) return prev;
13765
- const { siblings, index } = found;
13766
- const item = siblings[index];
13767
- siblings.splice(index, 1);
13768
- siblings.splice(index + 1, 0, item);
13769
- triggerInstantSave(next);
13770
- return next;
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
- setNavigationStack((stack) => {
13713
- if (stack.length === 0) {
13714
- setBoardItems((prev) => [...prev, newItem]);
13715
- } else {
13716
- const parentId = stack[stack.length - 1];
13717
- const add = (list) => list.map(
13718
- (g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
13719
- );
13720
- setBoardItems((prev) => add(prev));
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
- setBoardItems((prev) => {
13754
- const next = JSON.parse(JSON.stringify(prev));
13755
- const found = findGroupAndParent(next, id);
13756
- if (!found || found.index === 0) return prev;
13757
- const { group, siblings, index } = found;
13758
- const targetParent = siblings[index - 1];
13759
- if (group.type === "folder" && targetParent.type === "text_group") return prev;
13760
- siblings.splice(index, 1);
13761
- targetParent.children.push(group);
13762
- triggerInstantSave(next);
13763
- return next;
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
- setBoardItems((prev) => {
13768
- const next = JSON.parse(JSON.stringify(prev));
13769
- const found = findGroupAndParent(next, id);
13770
- if (!found || found.index === found.siblings.length - 1) return prev;
13771
- const { group, siblings, index } = found;
13772
- const targetParent = siblings[index + 1];
13773
- if (group.type === "folder" && targetParent.type === "text_group") return prev;
13774
- siblings.splice(index, 1);
13775
- targetParent.children.push(group);
13776
- triggerInstantSave(next);
13777
- return next;
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
- setBoardItems((prev) => {
13782
- const next = JSON.parse(JSON.stringify(prev));
13783
- const found = findGroupAndParent(next, id);
13784
- if (!found || !found.parent) return prev;
13785
- const { group, siblings, index, parent } = found;
13786
- siblings.splice(index, 1);
13787
- const parentFound = findGroupAndParent(next, parent.id);
13788
- if (parentFound) {
13789
- parentFound.siblings.splice(parentFound.index + 1, 0, group);
13790
- } else {
13791
- next.push(group);
13792
- }
13793
- triggerInstantSave(next);
13794
- return next;
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
- setBoardItems((prev) => {
13799
- const next = JSON.parse(JSON.stringify(prev));
13800
- const found = findGroupAndParent(next, id);
13801
- if (!found || found.index === 0) return prev;
13802
- const { siblings, index } = found;
13803
- const item = siblings[index];
13804
- siblings.splice(index, 1);
13805
- siblings.splice(index - 1, 0, item);
13806
- triggerInstantSave(next);
13807
- return next;
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
- setBoardItems((prev) => {
13812
- const next = JSON.parse(JSON.stringify(prev));
13813
- const found = findGroupAndParent(next, id);
13814
- if (!found || found.index === found.siblings.length - 1) return prev;
13815
- const { siblings, index } = found;
13816
- const item = siblings[index];
13817
- siblings.splice(index, 1);
13818
- siblings.splice(index + 1, 0, item);
13819
- triggerInstantSave(next);
13820
- return next;
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.32",
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",