@elliemae/ds-shuttle-v2 3.14.1 → 3.14.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.
Files changed (121) hide show
  1. package/dist/cjs/config/DSShuttleV2Definitions.js +2 -1
  2. package/dist/cjs/config/DSShuttleV2Definitions.js.map +2 -2
  3. package/dist/cjs/config/itemMovementHelpers.js +29 -52
  4. package/dist/cjs/config/itemMovementHelpers.js.map +2 -2
  5. package/dist/cjs/config/useAutoCalculated/useDataStructure.js +25 -6
  6. package/dist/cjs/config/useAutoCalculated/useDataStructure.js.map +2 -2
  7. package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js +10 -13
  8. package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js.map +2 -2
  9. package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js +16 -49
  10. package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js.map +2 -2
  11. package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js +1 -5
  12. package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js.map +2 -2
  13. package/dist/cjs/config/useStore/focusAndTabIndexManager.js +73 -0
  14. package/dist/cjs/config/useStore/focusAndTabIndexManager.js.map +7 -0
  15. package/dist/cjs/config/useStore/useStore.js +13 -0
  16. package/dist/cjs/config/useStore/useStore.js.map +3 -3
  17. package/dist/cjs/constants/index.js +1 -3
  18. package/dist/cjs/constants/index.js.map +2 -2
  19. package/dist/cjs/parts/Dnd/DndHandle.js +5 -1
  20. package/dist/cjs/parts/Dnd/DndHandle.js.map +2 -2
  21. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +14 -12
  22. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  23. package/dist/cjs/parts/Item/Item.js +44 -39
  24. package/dist/cjs/parts/Item/Item.js.map +2 -2
  25. package/dist/cjs/parts/Item/ItemActions/ItemActions.js +6 -6
  26. package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +2 -2
  27. package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js +8 -23
  28. package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js.map +2 -2
  29. package/dist/cjs/parts/Item/ItemOverlay.js +2 -1
  30. package/dist/cjs/parts/Item/ItemOverlay.js.map +2 -2
  31. package/dist/cjs/parts/Item/useItemArrowNavigation.js +7 -22
  32. package/dist/cjs/parts/Item/useItemArrowNavigation.js.map +2 -2
  33. package/dist/cjs/parts/Item/useSelectionLogic.js +1 -1
  34. package/dist/cjs/parts/Item/useSelectionLogic.js.map +2 -2
  35. package/dist/cjs/parts/MainContent.js +2 -2
  36. package/dist/cjs/parts/MainContent.js.map +2 -2
  37. package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +2 -8
  38. package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
  39. package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js +7 -12
  40. package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js.map +2 -2
  41. package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js +3 -12
  42. package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
  43. package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js +3 -4
  44. package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +2 -2
  45. package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +3 -7
  46. package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
  47. package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +21 -19
  48. package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
  49. package/dist/cjs/parts/Panel/top/SelectionHeader.js +3 -3
  50. package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +2 -2
  51. package/dist/cjs/react-desc-prop-types.js +52 -2
  52. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  53. package/dist/esm/config/DSShuttleV2Definitions.js +2 -1
  54. package/dist/esm/config/DSShuttleV2Definitions.js.map +2 -2
  55. package/dist/esm/config/itemMovementHelpers.js +30 -53
  56. package/dist/esm/config/itemMovementHelpers.js.map +2 -2
  57. package/dist/esm/config/useAutoCalculated/useDataStructure.js +25 -6
  58. package/dist/esm/config/useAutoCalculated/useDataStructure.js.map +2 -2
  59. package/dist/esm/config/useFocusTracker/useFocusActionTrackers.js +10 -13
  60. package/dist/esm/config/useFocusTracker/useFocusActionTrackers.js.map +2 -2
  61. package/dist/esm/config/useFocusTracker/useFocusItemTracker.js +16 -49
  62. package/dist/esm/config/useFocusTracker/useFocusItemTracker.js.map +2 -2
  63. package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js +1 -5
  64. package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js.map +2 -2
  65. package/dist/esm/config/useStore/focusAndTabIndexManager.js +47 -0
  66. package/dist/esm/config/useStore/focusAndTabIndexManager.js.map +7 -0
  67. package/dist/esm/config/useStore/useStore.js +13 -0
  68. package/dist/esm/config/useStore/useStore.js.map +2 -2
  69. package/dist/esm/constants/index.js +1 -3
  70. package/dist/esm/constants/index.js.map +2 -2
  71. package/dist/esm/parts/Dnd/DndHandle.js +5 -1
  72. package/dist/esm/parts/Dnd/DndHandle.js.map +2 -2
  73. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +14 -12
  74. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  75. package/dist/esm/parts/Item/Item.js +44 -39
  76. package/dist/esm/parts/Item/Item.js.map +2 -2
  77. package/dist/esm/parts/Item/ItemActions/ItemActions.js +6 -6
  78. package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +2 -2
  79. package/dist/esm/parts/Item/ItemActions/useInnerRefHandlers.js +8 -23
  80. package/dist/esm/parts/Item/ItemActions/useInnerRefHandlers.js.map +2 -2
  81. package/dist/esm/parts/Item/ItemOverlay.js +2 -1
  82. package/dist/esm/parts/Item/ItemOverlay.js.map +2 -2
  83. package/dist/esm/parts/Item/useItemArrowNavigation.js +7 -22
  84. package/dist/esm/parts/Item/useItemArrowNavigation.js.map +2 -2
  85. package/dist/esm/parts/Item/useSelectionLogic.js +1 -1
  86. package/dist/esm/parts/Item/useSelectionLogic.js.map +2 -2
  87. package/dist/esm/parts/MainContent.js +3 -3
  88. package/dist/esm/parts/MainContent.js.map +2 -2
  89. package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js +2 -8
  90. package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
  91. package/dist/esm/parts/Panel/bottom/useInnerRefHandlers.js +7 -12
  92. package/dist/esm/parts/Panel/bottom/useInnerRefHandlers.js.map +2 -2
  93. package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js +4 -13
  94. package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
  95. package/dist/esm/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js +3 -4
  96. package/dist/esm/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +2 -2
  97. package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +3 -7
  98. package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
  99. package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js +21 -19
  100. package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
  101. package/dist/esm/parts/Panel/top/SelectionHeader.js +4 -4
  102. package/dist/esm/parts/Panel/top/SelectionHeader.js.map +2 -2
  103. package/dist/esm/react-desc-prop-types.js +52 -2
  104. package/dist/esm/react-desc-prop-types.js.map +2 -2
  105. package/dist/types/config/DSShuttleV2Definitions.d.ts +1 -0
  106. package/dist/types/config/useFocusTracker/useFocusActionTrackers.d.ts +2 -4
  107. package/dist/types/config/useFocusTracker/useFocusItemTracker.d.ts +2 -6
  108. package/dist/types/config/useFocusTracker/useFocusRegionTrackers.d.ts +0 -2
  109. package/dist/types/config/useFocusTracker/useFocusTracker.d.ts +4 -10
  110. package/dist/types/config/useStore/focusAndTabIndexManager.d.ts +10 -0
  111. package/dist/types/config/useStore/useStore.d.ts +35 -60
  112. package/dist/types/constants/index.d.ts +1 -3
  113. package/dist/types/parts/Dnd/DndHandle.d.ts +3 -3
  114. package/dist/types/parts/Item/ItemActions/useActionsHandlers.d.ts +2 -2
  115. package/dist/types/parts/Item/ItemActions/useInnerRefHandlers.d.ts +0 -2
  116. package/dist/types/parts/Panel/bottom/useInnerRefHandlers.d.ts +0 -1
  117. package/dist/types/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.d.ts +1 -1
  118. package/dist/types/react-desc-prop-types.d.ts +35 -4
  119. package/package.json +17 -17
  120. package/dist/cjs/config/useStore/createAtomInStore.bak +0 -18
  121. package/dist/esm/config/useStore/createAtomInStore.bak +0 -18
@@ -62,7 +62,8 @@ const DSShuttleV2Slots = {
62
62
  AREA_SEARCH_WRAPPER: "area-search-wrapper",
63
63
  AREA_SEARCH_BAR: "area-search-bar",
64
64
  AREA_SELECTION_HEADER: "area-selection-header",
65
- AREA_SELECTION_HEADER_COUNT_LABEL: "area-selection-header-count-label"
65
+ AREA_SELECTION_HEADER_COUNT_LABEL: "area-selection-header-count-label",
66
+ DRAG_AND_DROP_HANDLE: "drag-and-drop-handle"
66
67
  };
67
68
  const DSShuttleV2DataTestIds = (0, import_ds_system.slotObjectToDataTestIds)(DSShuttleV2Name, DSShuttleV2Slots);
68
69
  //# sourceMappingURL=DSShuttleV2Definitions.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/DSShuttleV2Definitions.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSShuttleV2Name = 'DSShuttleV2' as const;\n\nexport const DSShuttleV2Slots = {\n HEADER_SEARCH_ICON: 'header-search-icon',\n WRAPPER: 'wrapper',\n PANEL_WRAPPER: 'panel-wrapper',\n LIST_WRAPPER: 'list-wrapper',\n ITEM_WRAPPER: 'item-wrapper',\n ITEM_ICON_WRAPPER: 'item-icon-wrapper',\n ITEM_LABEL_WRAPPER: 'item-label-wrapper',\n ITEM_MIDSECTION_WRAPPER: 'item-midsection-wrapper',\n ITEM_SELECTION: 'item-selection',\n ITEM_ACTIONS_WRAPPER: 'item-actions-wrapper',\n ITEM_ACTION_WRAPPER: 'item-action-wrapper',\n ITEM_ACTION_BTN: 'item-action-btn',\n ITEM_ACTION_BTN_DRILLDOWN_ICON: 'item-action-btn-drilldown-icon',\n ITEM_ACTION_BTN_TO_SOURCE_ICON: 'item-action-btn-to-source-icon',\n ITEM_ACTION_BTN_TO_DESTINATION_ICON: 'item-action-btn-to-destination-icon',\n LIST_BOTTOM_LOADING_MORE: 'list-bottom-loading-more',\n LIST_BOTTOM_LOAD_MORE_BTN: 'list-bottom-load-more-btn',\n LIST_WRAPPER_BOTTOM: 'list-wrapper-bottom',\n EMPTY_LIST_WRAPPER: 'empty-list-wrapper',\n ITEMS_WRAPPER: 'items-wrapper',\n LOADING_LIST_WRAPPER: 'loading-list-wrapper',\n MOVE_MULTIPLE_WRAPPER: 'move-multiple-wrapper',\n MOVE_MULTIPLE_BTN: 'move-multiple-btn',\n LIST_WRAPPER_MID: 'list-wrapper-mid',\n LIST_WRAPPER_MID_SCROLLER: 'list-wrapper-mid-scroller',\n LIST_WRAPPER_TOP: 'list-wrapper-top',\n AREA_SEARCH_WRAPPER: 'area-search-wrapper',\n AREA_SEARCH_BAR: 'area-search-bar',\n AREA_SELECTION_HEADER: 'area-selection-header',\n AREA_SELECTION_HEADER_COUNT_LABEL: 'area-selection-header-count-label',\n} as const;\n\nexport const DSShuttleV2DataTestIds = slotObjectToDataTestIds(DSShuttleV2Name, DSShuttleV2Slots) as const;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,kBAAkB;AAExB,MAAM,mBAAmB;AAAA,EAC9B,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,qCAAqC;AAAA,EACrC,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,mCAAmC;AACrC;AAEO,MAAM,6BAAyB,0CAAwB,iBAAiB,gBAAgB;",
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSShuttleV2Name = 'DSShuttleV2' as const;\n\nexport const DSShuttleV2Slots = {\n HEADER_SEARCH_ICON: 'header-search-icon',\n WRAPPER: 'wrapper',\n PANEL_WRAPPER: 'panel-wrapper',\n LIST_WRAPPER: 'list-wrapper',\n ITEM_WRAPPER: 'item-wrapper',\n ITEM_ICON_WRAPPER: 'item-icon-wrapper',\n ITEM_LABEL_WRAPPER: 'item-label-wrapper',\n ITEM_MIDSECTION_WRAPPER: 'item-midsection-wrapper',\n ITEM_SELECTION: 'item-selection',\n ITEM_ACTIONS_WRAPPER: 'item-actions-wrapper',\n ITEM_ACTION_WRAPPER: 'item-action-wrapper',\n ITEM_ACTION_BTN: 'item-action-btn',\n ITEM_ACTION_BTN_DRILLDOWN_ICON: 'item-action-btn-drilldown-icon',\n ITEM_ACTION_BTN_TO_SOURCE_ICON: 'item-action-btn-to-source-icon',\n ITEM_ACTION_BTN_TO_DESTINATION_ICON: 'item-action-btn-to-destination-icon',\n LIST_BOTTOM_LOADING_MORE: 'list-bottom-loading-more',\n LIST_BOTTOM_LOAD_MORE_BTN: 'list-bottom-load-more-btn',\n LIST_WRAPPER_BOTTOM: 'list-wrapper-bottom',\n EMPTY_LIST_WRAPPER: 'empty-list-wrapper',\n ITEMS_WRAPPER: 'items-wrapper',\n LOADING_LIST_WRAPPER: 'loading-list-wrapper',\n MOVE_MULTIPLE_WRAPPER: 'move-multiple-wrapper',\n MOVE_MULTIPLE_BTN: 'move-multiple-btn',\n LIST_WRAPPER_MID: 'list-wrapper-mid',\n LIST_WRAPPER_MID_SCROLLER: 'list-wrapper-mid-scroller',\n LIST_WRAPPER_TOP: 'list-wrapper-top',\n AREA_SEARCH_WRAPPER: 'area-search-wrapper',\n AREA_SEARCH_BAR: 'area-search-bar',\n AREA_SELECTION_HEADER: 'area-selection-header',\n AREA_SELECTION_HEADER_COUNT_LABEL: 'area-selection-header-count-label',\n DRAG_AND_DROP_HANDLE: 'drag-and-drop-handle',\n} as const;\n\nexport const DSShuttleV2DataTestIds = slotObjectToDataTestIds(DSShuttleV2Name, DSShuttleV2Slots);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,kBAAkB;AAExB,MAAM,mBAAmB;AAAA,EAC9B,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,qCAAqC;AAAA,EACrC,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,mCAAmC;AAAA,EACnC,sBAAsB;AACxB;AAEO,MAAM,6BAAyB,0CAAwB,iBAAiB,gBAAgB;",
6
6
  "names": []
7
7
  }
@@ -30,7 +30,6 @@ __export(itemMovementHelpers_exports, {
30
30
  module.exports = __toCommonJS(itemMovementHelpers_exports);
31
31
  var React = __toESM(require("react"));
32
32
  var import_react = __toESM(require("react"));
33
- var import_ds_utilities = require("@elliemae/ds-utilities");
34
33
  var import_useStore = require("./useStore");
35
34
  const useHandleMoveSelection = ({ isDestinationPanel }) => {
36
35
  const currOnRemove = (0, import_useStore.usePropsStore)(
@@ -48,55 +47,45 @@ const useHandleMoveSelection = ({ isDestinationPanel }) => {
48
47
  const otherOnSoftDelete = (0, import_useStore.usePropsStore)(
49
48
  (state) => isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete
50
49
  );
51
- const currSelectionMap = (0, import_useStore.useInternalStore)(
50
+ const currSelectionMap = (0, import_useStore.usePropsStore)(
52
51
  (store) => isDestinationPanel ? store.destinationSelectionArray : store.sourceSelectionArray
53
52
  );
54
53
  const currOnSelectionChange = (0, import_useStore.usePropsStore)(
55
54
  (state) => isDestinationPanel ? state.onDestinationSelectionChange : state.onSourceSelectionChange
56
55
  );
57
56
  const otherPanelOnAdd = (0, import_useStore.usePropsStore)((state) => isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd);
58
- const destinationSelectionArray = (0, import_useStore.useInternalStore)((store) => store.destinationSelectionItemArray);
59
- const sourceSelectionArray = (0, import_useStore.useInternalStore)((store) => store.sourceSelectionItemArray);
57
+ const destinationSelectionArray = (0, import_useStore.usePropsStore)((store) => store.destinationSelectionItemArray);
58
+ const sourceSelectionArray = (0, import_useStore.usePropsStore)((store) => store.sourceSelectionItemArray);
60
59
  const selectedItems = isDestinationPanel ? destinationSelectionArray : sourceSelectionArray;
61
- const mutableSelectedItems = (0, import_ds_utilities.useMakeMutable)(selectedItems);
62
- const mutableCurrSelectionMap = (0, import_ds_utilities.useMakeMutable)(currSelectionMap);
63
- const mutableCurrOnSelectionChange = (0, import_ds_utilities.useMakeMutable)(currOnSelectionChange);
64
- const mutableCurrOnRemove = (0, import_ds_utilities.useMakeMutable)(currOnRemove);
65
- const mutableOtherOnAdd = (0, import_ds_utilities.useMakeMutable)(otherPanelOnAdd);
66
- const mutableCurrOnSoftDelete = (0, import_ds_utilities.useMakeMutable)(currOnSoftDelete);
67
- const mutableOtherOnSoftDelete = (0, import_ds_utilities.useMakeMutable)(otherOnSoftDelete);
68
- const mutableCurrSoftDeletedItems = (0, import_ds_utilities.useMakeMutable)(currSoftDeletedItems);
69
- const mutableOtherSoftDeletedItems = (0, import_ds_utilities.useMakeMutable)(otherSoftDeletedItems);
70
60
  const moveSelection = import_react.default.useCallback(
71
61
  (event) => {
72
62
  event.preventDefault();
73
63
  event.stopPropagation();
74
- mutableCurrOnRemove.current(mutableSelectedItems.current, { event });
75
- mutableOtherOnAdd.current(mutableSelectedItems.current, { event });
64
+ currOnRemove(selectedItems, { event });
65
+ otherPanelOnAdd(selectedItems, { event });
76
66
  const currSoftDeletedMap = {};
77
67
  const otherSoftDeletedMap = {};
78
- mutableCurrSelectionMap.current.forEach((id) => {
68
+ currSelectionMap.forEach((id) => {
79
69
  currSoftDeletedMap[id] = true;
80
70
  otherSoftDeletedMap[id] = false;
81
71
  });
82
- mutableCurrOnSoftDelete.current({ ...mutableCurrSoftDeletedItems.current, ...currSoftDeletedMap }, { event });
83
- mutableOtherOnSoftDelete.current({ ...mutableOtherSoftDeletedItems.current, ...otherSoftDeletedMap }, { event });
84
- mutableCurrOnSelectionChange.current({}, { event });
72
+ currOnSoftDelete({ ...currSoftDeletedItems, ...currSoftDeletedMap }, { event });
73
+ otherOnSoftDelete({ ...otherSoftDeletedItems, ...otherSoftDeletedMap }, { event });
74
+ currOnSelectionChange({}, { event });
85
75
  },
86
76
  [
87
- mutableCurrSelectionMap,
88
- mutableCurrOnRemove,
89
- mutableCurrOnSelectionChange,
90
- mutableCurrOnSoftDelete,
91
- mutableCurrSoftDeletedItems,
92
- mutableOtherOnAdd,
93
- mutableOtherOnSoftDelete,
94
- mutableOtherSoftDeletedItems,
95
- mutableSelectedItems
77
+ currOnRemove,
78
+ selectedItems,
79
+ otherPanelOnAdd,
80
+ currSelectionMap,
81
+ currOnSoftDelete,
82
+ currSoftDeletedItems,
83
+ otherOnSoftDelete,
84
+ otherSoftDeletedItems,
85
+ currOnSelectionChange
96
86
  ]
97
87
  );
98
- const mutableMoveSelection = (0, import_ds_utilities.useMakeMutable)(moveSelection);
99
- return import_react.default.useMemo(() => ({ moveSelection: mutableMoveSelection.current }), [mutableMoveSelection]);
88
+ return import_react.default.useMemo(() => ({ moveSelection }), [moveSelection]);
100
89
  };
101
90
  const useHandleMoveItem = ({ datum, datumInternalMeta, isDestinationPanel }) => {
102
91
  const currSoftDeletedItems = (0, import_useStore.usePropsStore)(
@@ -115,36 +104,24 @@ const useHandleMoveItem = ({ datum, datumInternalMeta, isDestinationPanel }) =>
115
104
  (state) => isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove
116
105
  );
117
106
  const otherPanelOnAdd = (0, import_useStore.usePropsStore)((state) => isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd);
118
- const mutableCurrOnRemove = (0, import_ds_utilities.useMakeMutable)(currOnRemove);
119
- const mutableOtherOnAdd = (0, import_ds_utilities.useMakeMutable)(otherPanelOnAdd);
120
- const mutableCurrOnSoftDelete = (0, import_ds_utilities.useMakeMutable)(currOnSoftDelete);
121
- const mutableOtherOnSoftDelete = (0, import_ds_utilities.useMakeMutable)(otherOnSoftDelete);
122
- const mutableCurrSoftDeletedItems = (0, import_ds_utilities.useMakeMutable)(currSoftDeletedItems);
123
- const mutableOtherSoftDeletedItems = (0, import_ds_utilities.useMakeMutable)(otherSoftDeletedItems);
124
107
  const moveItem = import_react.default.useCallback(
125
108
  (event) => {
126
109
  event.preventDefault();
127
110
  event.stopPropagation();
128
- mutableCurrOnRemove.current([datum], { event });
129
- mutableOtherOnAdd.current([datum], { event });
130
- mutableCurrOnSoftDelete.current(
131
- { ...mutableCurrSoftDeletedItems.current, [datumInternalMeta.hydratedId]: true },
132
- { event }
133
- );
134
- mutableOtherOnSoftDelete.current(
135
- { ...mutableOtherSoftDeletedItems.current, [datumInternalMeta.hydratedId]: false },
136
- { event }
137
- );
111
+ currOnRemove([datum], { event });
112
+ otherPanelOnAdd([datum], { event });
113
+ currOnSoftDelete({ ...currSoftDeletedItems, [datumInternalMeta.hydratedId]: true }, { event });
114
+ otherOnSoftDelete({ ...otherSoftDeletedItems, [datumInternalMeta.hydratedId]: false }, { event });
138
115
  },
139
116
  [
117
+ currOnRemove,
118
+ currOnSoftDelete,
119
+ currSoftDeletedItems,
140
120
  datum,
141
121
  datumInternalMeta.hydratedId,
142
- mutableCurrOnRemove,
143
- mutableCurrOnSoftDelete,
144
- mutableCurrSoftDeletedItems,
145
- mutableOtherOnAdd,
146
- mutableOtherOnSoftDelete,
147
- mutableOtherSoftDeletedItems
122
+ otherOnSoftDelete,
123
+ otherPanelOnAdd,
124
+ otherSoftDeletedItems
148
125
  ]
149
126
  );
150
127
  return moveItem;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/itemMovementHelpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport React from 'react';\nimport { useMakeMutable } from '@elliemae/ds-utilities';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type DSShuttleV2T } from '../react-desc-prop-types';\nimport { usePropsStore, useInternalStore } from './useStore';\n\nexport const useHandleMoveSelection = ({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => {\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n const currSelectionMap = useInternalStore((store) =>\n isDestinationPanel ? store.destinationSelectionArray : store.sourceSelectionArray,\n );\n const currOnSelectionChange = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSelectionChange : state.onSourceSelectionChange,\n );\n\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const destinationSelectionArray = useInternalStore((store) => store.destinationSelectionItemArray);\n const sourceSelectionArray = useInternalStore((store) => store.sourceSelectionItemArray);\n const selectedItems = isDestinationPanel ? destinationSelectionArray : sourceSelectionArray;\n\n const mutableSelectedItems = useMakeMutable(selectedItems);\n const mutableCurrSelectionMap = useMakeMutable(currSelectionMap);\n const mutableCurrOnSelectionChange = useMakeMutable(currOnSelectionChange);\n const mutableCurrOnRemove = useMakeMutable(currOnRemove);\n const mutableOtherOnAdd = useMakeMutable(otherPanelOnAdd);\n const mutableCurrOnSoftDelete = useMakeMutable(currOnSoftDelete);\n const mutableOtherOnSoftDelete = useMakeMutable(otherOnSoftDelete);\n const mutableCurrSoftDeletedItems = useMakeMutable(currSoftDeletedItems);\n const mutableOtherSoftDeletedItems = useMakeMutable(otherSoftDeletedItems);\n\n const moveSelection = React.useCallback(\n (event: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => {\n event.preventDefault();\n event.stopPropagation();\n // movement\n mutableCurrOnRemove.current(mutableSelectedItems.current, { event });\n mutableOtherOnAdd.current(mutableSelectedItems.current, { event });\n // soft delete\n const currSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n const otherSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n mutableCurrSelectionMap.current.forEach((id) => {\n currSoftDeletedMap[id] = true;\n otherSoftDeletedMap[id] = false;\n });\n mutableCurrOnSoftDelete.current({ ...mutableCurrSoftDeletedItems.current, ...currSoftDeletedMap }, { event });\n mutableOtherOnSoftDelete.current({ ...mutableOtherSoftDeletedItems.current, ...otherSoftDeletedMap }, { event });\n // cleanup\n mutableCurrOnSelectionChange.current({}, { event });\n },\n [\n mutableCurrSelectionMap,\n mutableCurrOnRemove,\n mutableCurrOnSelectionChange,\n mutableCurrOnSoftDelete,\n mutableCurrSoftDeletedItems,\n mutableOtherOnAdd,\n mutableOtherOnSoftDelete,\n mutableOtherSoftDeletedItems,\n mutableSelectedItems,\n ],\n );\n // optimization ...\n const mutableMoveSelection = useMakeMutable(moveSelection);\n return React.useMemo(() => ({ moveSelection: mutableMoveSelection.current }), [mutableMoveSelection]);\n};\n\nexport const useHandleMoveItem = ({ datum, datumInternalMeta, isDestinationPanel }: DSShuttleV2T.ItemMeta) => {\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const mutableCurrOnRemove = useMakeMutable(currOnRemove);\n const mutableOtherOnAdd = useMakeMutable(otherPanelOnAdd);\n const mutableCurrOnSoftDelete = useMakeMutable(currOnSoftDelete);\n const mutableOtherOnSoftDelete = useMakeMutable(otherOnSoftDelete);\n const mutableCurrSoftDeletedItems = useMakeMutable(currSoftDeletedItems);\n const mutableOtherSoftDeletedItems = useMakeMutable(otherSoftDeletedItems);\n\n const moveItem = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n mutableCurrOnRemove.current([datum], { event });\n mutableOtherOnAdd.current([datum], { event });\n mutableCurrOnSoftDelete.current(\n { ...mutableCurrSoftDeletedItems.current, [datumInternalMeta.hydratedId]: true },\n { event },\n );\n mutableOtherOnSoftDelete.current(\n { ...mutableOtherSoftDeletedItems.current, [datumInternalMeta.hydratedId]: false },\n { event },\n );\n },\n [\n datum,\n datumInternalMeta.hydratedId,\n mutableCurrOnRemove,\n mutableCurrOnSoftDelete,\n mutableCurrSoftDeletedItems,\n mutableOtherOnAdd,\n mutableOtherOnSoftDelete,\n mutableOtherSoftDeletedItems,\n ],\n );\n return moveItem;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAkB;AAClB,0BAA+B;AAG/B,sBAAgD;AAEzC,MAAM,yBAAyB,CAAC,EAAE,mBAAmB,MAAkC;AAC5F,QAAM,mB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AsB,MAAM;AAAA,EACzD;AACA,QAAM,sBAAkB,+BAAc,CAAC,UAAW,qBAAqB,MAAM,cAAc,MAAM,gBAAiB;AAElH,QAAM,0BAAsB,oCAAe,YAAY;AACvD,QAAM,wBAAoB,oCAAe,eAAe;AACxD,QAAM,8BAA0B,oCAAe,gBAAgB;AAC/D,QAAM,+BAA2B,oCAAe,iBAAiB;AACjE,QAAM,kCAA8B,oCAAe,oBAAoB;AACvE,QAAM,mCAA+B,oCAAe,qBAAqB;AAEzE,QAAM,WAAW,aAAAA,QAAM;AAAA,IACrB,CAAC,UAAwF;AACvF,YAAM,eAAe;AACrB,YAAM,gBAAgB;AACtB,0BAAoB,QAAQ,CAAC,KAAK,GAAG,EAAE,MAAM,CAAC;AAC9C,wBAAkB,QAAQ,CAAC,KAAK,GAAG,EAAE,MAAM,CAAC;AAC5C,8BAAwB;AAAA,QACtB,EAAE,GAAG,4BAA4B,SAAS,CAAC,kBAAkB,aAAa,KAAK;AAAA,QAC/E,EAAE,MAAM;AAAA,MACV;AACA,+BAAyB;AAAA,QACvB,EAAE,GAAG,6BAA6B,SAAS,CAAC,kBAAkB,aAAa,MAAM;AAAA,QACjF,EAAE,MAAM;AAAA,MACV;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport React from 'react';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type DSShuttleV2T } from '../react-desc-prop-types';\nimport { usePropsStore } from './useStore';\n\nexport const useHandleMoveSelection = ({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => {\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n const currSelectionMap = usePropsStore((store) =>\n isDestinationPanel ? store.destinationSelectionArray : store.sourceSelectionArray,\n );\n const currOnSelectionChange = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSelectionChange : state.onSourceSelectionChange,\n );\n\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const destinationSelectionArray = usePropsStore((store) => store.destinationSelectionItemArray);\n const sourceSelectionArray = usePropsStore((store) => store.sourceSelectionItemArray);\n const selectedItems = isDestinationPanel ? destinationSelectionArray : sourceSelectionArray;\n\n const moveSelection = React.useCallback(\n (event: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => {\n event.preventDefault();\n event.stopPropagation();\n // movement\n currOnRemove(selectedItems, { event });\n otherPanelOnAdd(selectedItems, { event });\n // soft delete\n const currSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n const otherSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n currSelectionMap.forEach((id) => {\n currSoftDeletedMap[id] = true;\n otherSoftDeletedMap[id] = false;\n });\n currOnSoftDelete({ ...currSoftDeletedItems, ...currSoftDeletedMap }, { event });\n otherOnSoftDelete({ ...otherSoftDeletedItems, ...otherSoftDeletedMap }, { event });\n // cleanup\n currOnSelectionChange({}, { event });\n },\n [\n currOnRemove,\n selectedItems,\n otherPanelOnAdd,\n currSelectionMap,\n currOnSoftDelete,\n currSoftDeletedItems,\n otherOnSoftDelete,\n otherSoftDeletedItems,\n currOnSelectionChange,\n ],\n );\n return React.useMemo(() => ({ moveSelection: moveSelection }), [moveSelection]);\n};\n\nexport const useHandleMoveItem = ({ datum, datumInternalMeta, isDestinationPanel }: DSShuttleV2T.ItemMeta) => {\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const moveItem = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n currOnRemove([datum], { event });\n otherPanelOnAdd([datum], { event });\n currOnSoftDelete({ ...currSoftDeletedItems, [datumInternalMeta.hydratedId]: true }, { event });\n otherOnSoftDelete({ ...otherSoftDeletedItems, [datumInternalMeta.hydratedId]: false }, { event });\n },\n [\n currOnRemove,\n currOnSoftDelete,\n currSoftDeletedItems,\n datum,\n datumInternalMeta.hydratedId,\n otherOnSoftDelete,\n otherPanelOnAdd,\n otherSoftDeletedItems,\n ],\n );\n return moveItem;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAkB;AAGlB,sBAA8B;AAEvB,MAAM,yBAAyB,CAAC,EAAE,mBAAmB,MAAkC;AAC5F,QAAM,mBAAe;AAAA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AAC;AAAA,IAClG;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
6
6
  "names": ["React"]
7
7
  }
@@ -33,7 +33,8 @@ const configureDestination = ({
33
33
  destinationData,
34
34
  destinationSelectedItems,
35
35
  destinationSoftDeletedItems,
36
- getId
36
+ getId,
37
+ getPreventMove
37
38
  }) => {
38
39
  const destinationSelectedItemsMap = {};
39
40
  const destinationSelectionArray = [];
@@ -43,6 +44,7 @@ const configureDestination = ({
43
44
  const destinationSelectionableData = [];
44
45
  destinationData.forEach((datum, i) => {
45
46
  const hydratedId = getId(datum);
47
+ const hydratedPreventMove = getPreventMove?.(datum) ?? false;
46
48
  let isSelected = false;
47
49
  if (destinationSelectedItems[hydratedId] === true) {
48
50
  destinationSelectionItemArray.push(datum);
@@ -56,6 +58,7 @@ const configureDestination = ({
56
58
  destinationSelectedItemsMap[hydratedId] = { datum, index: i };
57
59
  const configuredItem = {
58
60
  hydratedId,
61
+ hydratedPreventMove,
59
62
  isSelected,
60
63
  softDeleted,
61
64
  original: datum,
@@ -64,7 +67,7 @@ const configureDestination = ({
64
67
  isLast: i === destinationData.length - 1
65
68
  };
66
69
  destinationConfiguredData.push(configuredItem);
67
- if (!datum.preventMove) {
70
+ if (!hydratedPreventMove && !softDeleted) {
68
71
  destinationSelectionableData.push(configuredItem);
69
72
  destinationSelectionableDataIds.push(`${hydratedId}`);
70
73
  }
@@ -82,7 +85,13 @@ const configureDestination = ({
82
85
  destinationSelectionableIds
83
86
  };
84
87
  };
85
- const configureSource = ({ sourceData, sourceSelectedItems, sourceSoftDeletedItems, getId }) => {
88
+ const configureSource = ({
89
+ sourceData,
90
+ sourceSelectedItems,
91
+ sourceSoftDeletedItems,
92
+ getId,
93
+ getPreventMove
94
+ }) => {
86
95
  const sourceSelectedItemsMap = {};
87
96
  const sourceSelectionArray = [];
88
97
  const sourceSelectionableDataIds = [];
@@ -91,6 +100,7 @@ const configureSource = ({ sourceData, sourceSelectedItems, sourceSoftDeletedIte
91
100
  const sourceSelectionableData = [];
92
101
  sourceData.forEach((datum, i) => {
93
102
  const hydratedId = getId(datum);
103
+ const hydratedPreventMove = getPreventMove?.(datum) ?? false;
94
104
  let isSelected = false;
95
105
  if (sourceSelectedItems[hydratedId] === true) {
96
106
  sourceSelectionItemArray.push(datum);
@@ -104,6 +114,7 @@ const configureSource = ({ sourceData, sourceSelectedItems, sourceSoftDeletedIte
104
114
  sourceSelectedItemsMap[hydratedId] = { datum, index: i };
105
115
  const configuredItem = {
106
116
  hydratedId,
117
+ hydratedPreventMove,
107
118
  isSelected,
108
119
  softDeleted,
109
120
  original: datum,
@@ -112,7 +123,7 @@ const configureSource = ({ sourceData, sourceSelectedItems, sourceSoftDeletedIte
112
123
  isLast: i === sourceData.length - 1
113
124
  };
114
125
  sourceConfiguredData.push(configuredItem);
115
- if (!datum.preventMove) {
126
+ if (!hydratedPreventMove && !softDeleted) {
116
127
  sourceSelectionableData.push(configuredItem);
117
128
  sourceSelectionableDataIds.push(`${hydratedId}`);
118
129
  }
@@ -137,19 +148,27 @@ const useDataStructure = (propsFromUser) => {
137
148
  destinationData,
138
149
  destinationSelectedItems,
139
150
  getId,
151
+ getPreventMove,
140
152
  sourceSoftDeletedItems,
141
153
  destinationSoftDeletedItems
142
154
  } = propsFromUser;
143
155
  return (0, import_react.useMemo)(
144
156
  () => ({
145
- ...configureSource({ sourceData, sourceSelectedItems, sourceSoftDeletedItems, getId }),
146
- ...configureDestination({ destinationData, destinationSelectedItems, destinationSoftDeletedItems, getId })
157
+ ...configureSource({ sourceData, sourceSelectedItems, sourceSoftDeletedItems, getId, getPreventMove }),
158
+ ...configureDestination({
159
+ destinationData,
160
+ destinationSelectedItems,
161
+ destinationSoftDeletedItems,
162
+ getId,
163
+ getPreventMove
164
+ })
147
165
  }),
148
166
  [
149
167
  sourceData,
150
168
  sourceSelectedItems,
151
169
  sourceSoftDeletedItems,
152
170
  getId,
171
+ getPreventMove,
153
172
  destinationData,
154
173
  destinationSelectedItems,
155
174
  destinationSoftDeletedItems
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/config/useAutoCalculated/useDataStructure.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["// import { useRef } from 'react';\n// import { useVirtual } from 'react-virtual';\nimport { useMemo } from 'react';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types';\n\ntype ConfigureDestinationConfig = {\n destinationData: DSShuttleV2T.Datum[];\n destinationSelectedItems: DSShuttleV2T.SelectionMap;\n destinationSoftDeletedItems: DSShuttleV2T.SoftDeletedMap;\n getId: DSShuttleV2T.PrimaryKeyHydraters['getId'];\n};\nconst configureDestination = ({\n destinationData,\n destinationSelectedItems,\n destinationSoftDeletedItems,\n getId,\n}: ConfigureDestinationConfig) => {\n const destinationSelectedItemsMap: Record<string, { datum: DSShuttleV2T.Datum; index: number }> = {};\n const destinationSelectionArray: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n const destinationSelectionableDataIds: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n\n const destinationSelectionItemArray: DSShuttleV2T.Datum[] = [];\n const destinationConfiguredData: DSShuttleV2T.ConfiguredDatum[] = [];\n const destinationSelectionableData: DSShuttleV2T.ConfiguredDatum[] = [];\n\n destinationData.forEach((datum, i) => {\n const hydratedId = getId(datum);\n let isSelected = false;\n if (destinationSelectedItems[hydratedId] === true) {\n destinationSelectionItemArray.push(datum);\n destinationSelectionArray.push(hydratedId);\n isSelected = true;\n }\n let softDeleted = false;\n if (destinationSoftDeletedItems[hydratedId] === true) {\n softDeleted = true;\n }\n destinationSelectedItemsMap[hydratedId] = { datum, index: i };\n const configuredItem = {\n hydratedId,\n isSelected,\n softDeleted,\n original: datum,\n localIndex: i,\n isFirst: i === 0,\n isLast: i === destinationData.length - 1,\n } as const;\n destinationConfiguredData.push(configuredItem);\n if (!datum.preventMove) {\n destinationSelectionableData.push(configuredItem);\n destinationSelectionableDataIds.push(`${hydratedId}`);\n }\n });\n const destinationHasMultipleSelectedItems = destinationSelectionArray.length >= 1;\n const destinationSelectionableIds = destinationSelectionableDataIds.join(' ');\n\n return {\n destinationSelectedItemsMap,\n destinationSelectionItemArray,\n destinationSelectionArray,\n destinationHasMultipleSelectedItems,\n destinationConfiguredData,\n destinationSelectionableData,\n destinationSelectionableDataIds,\n destinationSelectionableIds,\n };\n};\ntype ConfigureSourceConfig = {\n sourceData: DSShuttleV2T.Datum[];\n sourceSelectedItems: DSShuttleV2T.SelectionMap;\n sourceSoftDeletedItems: DSShuttleV2T.SoftDeletedMap;\n getId: DSShuttleV2T.PrimaryKeyHydraters['getId'];\n};\n\nconst configureSource = ({ sourceData, sourceSelectedItems, sourceSoftDeletedItems, getId }: ConfigureSourceConfig) => {\n const sourceSelectedItemsMap: Record<string, { datum: DSShuttleV2T.Datum; index: number }> = {};\n const sourceSelectionArray: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n const sourceSelectionableDataIds: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n\n const sourceSelectionItemArray: DSShuttleV2T.Datum[] = [];\n const sourceConfiguredData: DSShuttleV2T.ConfiguredDatum[] = [];\n const sourceSelectionableData: DSShuttleV2T.ConfiguredDatum[] = [];\n sourceData.forEach((datum, i) => {\n const hydratedId = getId(datum);\n let isSelected = false;\n if (sourceSelectedItems[hydratedId] === true) {\n sourceSelectionItemArray.push(datum);\n sourceSelectionArray.push(hydratedId);\n isSelected = true;\n }\n let softDeleted = false;\n if (sourceSoftDeletedItems[hydratedId] === true) {\n softDeleted = true;\n }\n\n sourceSelectedItemsMap[hydratedId] = { datum, index: i };\n const configuredItem = {\n hydratedId,\n isSelected,\n softDeleted,\n original: datum,\n localIndex: i,\n isFirst: i === 0,\n isLast: i === sourceData.length - 1,\n } as const;\n sourceConfiguredData.push(configuredItem);\n if (!datum.preventMove) {\n sourceSelectionableData.push(configuredItem);\n sourceSelectionableDataIds.push(`${hydratedId}`);\n }\n });\n const sourceHasMultipleSelectedItems = sourceSelectionArray.length >= 1;\n const sourceSelectionableIds = sourceSelectionableDataIds.join(' ');\n return {\n sourceConfiguredData,\n sourceSelectedItemsMap,\n sourceSelectionItemArray,\n sourceSelectionArray,\n sourceHasMultipleSelectedItems,\n sourceSelectionableData,\n sourceSelectionableDataIds,\n sourceSelectionableIds,\n };\n};\n\nexport const useDataStructure = (propsFromUser: DSShuttleV2T.InternalProps) => {\n const {\n sourceData,\n sourceSelectedItems,\n destinationData,\n destinationSelectedItems,\n getId,\n sourceSoftDeletedItems,\n destinationSoftDeletedItems,\n } = propsFromUser;\n return useMemo(\n () => ({\n ...configureSource({ sourceData, sourceSelectedItems, sourceSoftDeletedItems, getId }),\n ...configureDestination({ destinationData, destinationSelectedItems, destinationSoftDeletedItems, getId }),\n }),\n [\n sourceData,\n sourceSelectedItems,\n sourceSoftDeletedItems,\n getId,\n destinationData,\n destinationSelectedItems,\n destinationSoftDeletedItems,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAwB;AASxB,MAAM,uBAAuB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAkC;AAChC,QAAM,8BAA4F,CAAC;AACnG,QAAM,4BAAwE,CAAC;AAC/E,QAAM,kCAA8E,CAAC;AAErF,QAAM,gCAAsD,CAAC;AAC7D,QAAM,4BAA4D,CAAC;AACnE,QAAM,+BAA+D,CAAC;AAEtE,kBAAgB,QAAQ,CAAC,OAAO,MAAM;AACpC,UAAM,aAAa,MAAM,KAAK;AAC9B,QAAI,aAAa;AACjB,QAAI,yBAAyB,gBAAgB,MAAM;AACjD,oCAA8B,KAAK,KAAK;AAC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M,iBAAiB;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS,MAAM;AAAA,MACf,QAAQ,MAAM,WAAW,SAAS;AAAA,IACpC;AACA,yBAAqB,KAAK,cAAc;AACxC,QAAI,CAAC,MAAM,aAAa;AACtB,8BAAwB,KAAK,cAAc;AAC3C,iCAA2B,KAAK,GAAG,YAAY;AAAA,IACjD;AAAA,EACF,CAAC;AACD,QAAM,iCAAiC,qBAAqB,UAAU;AACtE,QAAM,yBAAyB,2BAA2B,KAAK,GAAG;AAClE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,mBAAmB,CAAC,kBAA8C;AAC7E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,aAAO;AAAA,IACL,OAAO;AAAA,MACL,GAAG,gBAAgB,EAAE,YAAY,qBAAqB,wBAAwB,MAAM,CAAC;AAAA,MACrF,GAAG,qBAAqB,EAAE,iBAAiB,0BAA0B,6BAA6B,MAAM,CAAC;AAAA,IAC3G;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["// import { useRef } from 'react';\n// import { useVirtual } from 'react-virtual';\nimport { useMemo } from 'react';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types';\n\ntype ConfigureDestinationConfig = {\n destinationData: DSShuttleV2T.Datum[];\n destinationSelectedItems: DSShuttleV2T.SelectionMap;\n destinationSoftDeletedItems: DSShuttleV2T.SoftDeletedMap;\n getId: DSShuttleV2T.PrimaryKeyHydraters['getId'];\n getPreventMove: DSShuttleV2T.FunctionalHydraters['getPreventMove'];\n};\nconst configureDestination = ({\n destinationData,\n destinationSelectedItems,\n destinationSoftDeletedItems,\n getId,\n getPreventMove,\n}: ConfigureDestinationConfig) => {\n const destinationSelectedItemsMap: Record<string, { datum: DSShuttleV2T.Datum; index: number }> = {};\n const destinationSelectionArray: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n const destinationSelectionableDataIds: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n\n const destinationSelectionItemArray: DSShuttleV2T.Datum[] = [];\n const destinationConfiguredData: DSShuttleV2T.ConfiguredDatum[] = [];\n const destinationSelectionableData: DSShuttleV2T.ConfiguredDatum[] = [];\n\n destinationData.forEach((datum, i) => {\n const hydratedId = getId(datum);\n const hydratedPreventMove = getPreventMove?.(datum) ?? false;\n let isSelected = false;\n if (destinationSelectedItems[hydratedId] === true) {\n destinationSelectionItemArray.push(datum);\n destinationSelectionArray.push(hydratedId);\n isSelected = true;\n }\n let softDeleted = false;\n if (destinationSoftDeletedItems[hydratedId] === true) {\n softDeleted = true;\n }\n destinationSelectedItemsMap[hydratedId] = { datum, index: i };\n const configuredItem = {\n hydratedId,\n hydratedPreventMove,\n isSelected,\n softDeleted,\n original: datum,\n localIndex: i,\n isFirst: i === 0,\n isLast: i === destinationData.length - 1,\n } as const;\n destinationConfiguredData.push(configuredItem);\n if (!hydratedPreventMove && !softDeleted) {\n destinationSelectionableData.push(configuredItem);\n destinationSelectionableDataIds.push(`${hydratedId}`);\n }\n });\n const destinationHasMultipleSelectedItems = destinationSelectionArray.length >= 1;\n const destinationSelectionableIds = destinationSelectionableDataIds.join(' ');\n\n return {\n destinationSelectedItemsMap,\n destinationSelectionItemArray,\n destinationSelectionArray,\n destinationHasMultipleSelectedItems,\n destinationConfiguredData,\n destinationSelectionableData,\n destinationSelectionableDataIds,\n destinationSelectionableIds,\n };\n};\ntype ConfigureSourceConfig = {\n sourceData: DSShuttleV2T.Datum[];\n sourceSelectedItems: DSShuttleV2T.SelectionMap;\n sourceSoftDeletedItems: DSShuttleV2T.SoftDeletedMap;\n getId: DSShuttleV2T.PrimaryKeyHydraters['getId'];\n getPreventMove: DSShuttleV2T.FunctionalHydraters['getPreventMove'];\n};\n\nconst configureSource = ({\n sourceData,\n sourceSelectedItems,\n sourceSoftDeletedItems,\n getId,\n getPreventMove,\n}: ConfigureSourceConfig) => {\n const sourceSelectedItemsMap: Record<string, { datum: DSShuttleV2T.Datum; index: number }> = {};\n const sourceSelectionArray: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n const sourceSelectionableDataIds: DSShuttleV2T.PrimaryKeyHydratables['id'][] = [];\n\n const sourceSelectionItemArray: DSShuttleV2T.Datum[] = [];\n const sourceConfiguredData: DSShuttleV2T.ConfiguredDatum[] = [];\n const sourceSelectionableData: DSShuttleV2T.ConfiguredDatum[] = [];\n sourceData.forEach((datum, i) => {\n const hydratedId = getId(datum);\n const hydratedPreventMove = getPreventMove?.(datum) ?? false;\n let isSelected = false;\n if (sourceSelectedItems[hydratedId] === true) {\n sourceSelectionItemArray.push(datum);\n sourceSelectionArray.push(hydratedId);\n isSelected = true;\n }\n let softDeleted = false;\n if (sourceSoftDeletedItems[hydratedId] === true) {\n softDeleted = true;\n }\n\n sourceSelectedItemsMap[hydratedId] = { datum, index: i };\n const configuredItem = {\n hydratedId,\n hydratedPreventMove,\n isSelected,\n softDeleted,\n original: datum,\n localIndex: i,\n isFirst: i === 0,\n isLast: i === sourceData.length - 1,\n } as const;\n sourceConfiguredData.push(configuredItem);\n if (!hydratedPreventMove && !softDeleted) {\n sourceSelectionableData.push(configuredItem);\n sourceSelectionableDataIds.push(`${hydratedId}`);\n }\n });\n const sourceHasMultipleSelectedItems = sourceSelectionArray.length >= 1;\n const sourceSelectionableIds = sourceSelectionableDataIds.join(' ');\n return {\n sourceConfiguredData,\n sourceSelectedItemsMap,\n sourceSelectionItemArray,\n sourceSelectionArray,\n sourceHasMultipleSelectedItems,\n sourceSelectionableData,\n sourceSelectionableDataIds,\n sourceSelectionableIds,\n };\n};\n\nexport const useDataStructure = (propsFromUser: DSShuttleV2T.InternalProps) => {\n const {\n sourceData,\n sourceSelectedItems,\n destinationData,\n destinationSelectedItems,\n getId,\n getPreventMove,\n sourceSoftDeletedItems,\n destinationSoftDeletedItems,\n } = propsFromUser;\n return useMemo(\n () => ({\n ...configureSource({ sourceData, sourceSelectedItems, sourceSoftDeletedItems, getId, getPreventMove }),\n ...configureDestination({\n destinationData,\n destinationSelectedItems,\n destinationSoftDeletedItems,\n getId,\n getPreventMove,\n }),\n }),\n [\n sourceData,\n sourceSelectedItems,\n sourceSoftDeletedItems,\n getId,\n getPreventMove,\n destinationData,\n destinationSelectedItems,\n destinationSoftDeletedItems,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAwB;AAUxB,MAAM,uBAAuB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAkC;AAChC,QAAM,8BAA4F,CAAC;AACnG,QAAM,4BAAwE,CAAC;AAC/E,QAAM,kCAA8E,CAAC;AAErF,QAAM,gCAAsD,CAAC;AAC7D,QAAM,4BAA4D,CAAC;AACnE,QAAM,+BAA+D,CAAC;AAEtE,kBAAgB,QAAQ,CAAC,OAAO,MAAM;AACpC,UAAM,aAAa,MAAM,KAAK;AAC9B,UAAM,sBAAsB,iBAAiB,KAAK,KAAK;AACvD,QAAI,aAAa;AACjB,QAAI,yBAAyB,gBAAgB,MAAM;AACjD,oCAA8B,KAAK,KAAK;AACxC,gCAA0B,KAAK,UAAU;AACzC,mBAAa;AAAA,IACf;AACA,QAAI,cAAc;AAClB,QAAI,4BAA4B,gBAAgB,MAAM;AACpD,oBAAc;AAAA,IAChB;AACA,gCAA4B,cAAc,EAAE,OAAO,OAAO,EAAE;AAC5D,UAAM,iBAAiB;AAAA,MACrB;A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,MACf,QAAQ,MAAM,WAAW,SAAS;AAAA,IACpC;AACA,yBAAqB,KAAK,cAAc;AACxC,QAAI,CAAC,uBAAuB,CAAC,aAAa;AACxC,8BAAwB,KAAK,cAAc;AAC3C,iCAA2B,KAAK,GAAG,YAAY;AAAA,IACjD;AAAA,EACF,CAAC;AACD,QAAM,iCAAiC,qBAAqB,UAAU;AACtE,QAAM,yBAAyB,2BAA2B,KAAK,GAAG;AAClE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,mBAAmB,CAAC,kBAA8C;AAC7E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,aAAO;AAAA,IACL,OAAO;AAAA,MACL,GAAG,gBAAgB,EAAE,YAAY,qBAAqB,wBAAwB,OAAO,eAAe,CAAC;AAAA,MACrG,GAAG,qBAAqB;AAAA,QACtB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -29,7 +29,6 @@ __export(useFocusActionTrackers_exports, {
29
29
  module.exports = __toCommonJS(useFocusActionTrackers_exports);
30
30
  var React = __toESM(require("react"));
31
31
  var import_react = require("react");
32
- var import_ds_utilities = require("@elliemae/ds-utilities");
33
32
  var import_constants = require("../../constants");
34
33
  var import_useStore = require("../useStore");
35
34
  const getMoveBtnActionByProxymity = (flags) => {
@@ -100,40 +99,38 @@ const getActionByProxymity = ({ flags, currentAction }) => {
100
99
  return getParenBtnActionByProxymity(flags);
101
100
  };
102
101
  const useFocusActionTrackers = () => {
103
- const focusItemAction = (0, import_useStore.useInternalStore)((state) => state.focusItemAction);
104
- const mutableFocusItemAction = (0, import_ds_utilities.useMakeMutable)(focusItemAction);
102
+ const getFocusItemAction = (0, import_useStore.useInternalStore)((state) => state.getFocusItemAction);
105
103
  const setFocusItemAction = (0, import_useStore.useInternalStore)((state) => state.setFocusItemAction);
106
104
  const removeDragAndDropFromDestination = (0, import_useStore.usePropsStore)((state) => state.removeDragAndDropFromDestination);
107
105
  const addDragAndDropFromSource = (0, import_useStore.usePropsStore)((state) => state.addDragAndDropFromSource);
108
106
  const trackFocusPrevAction = (0, import_react.useCallback)(
109
- ({ isDestinationPanel, datumHydratables }) => {
110
- const preventMove = Boolean(datumHydratables.preventMove);
107
+ ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }) => {
108
+ const preventMove = Boolean(hydratedPreventMove);
111
109
  const preventDrilldown = Boolean(datumHydratables.preventDrilldown);
112
110
  const withDragAndDrop = isDestinationPanel && !removeDragAndDropFromDestination || !isDestinationPanel && addDragAndDropFromSource;
113
111
  const { prevAction } = getActionByProxymity({
114
112
  flags: { preventMove, preventDrilldown, withDragAndDrop },
115
- currentAction: mutableFocusItemAction.current
113
+ currentAction: getFocusItemAction()
116
114
  });
117
115
  setFocusItemAction(prevAction);
118
116
  },
119
- [addDragAndDropFromSource, mutableFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction]
117
+ [addDragAndDropFromSource, getFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction]
120
118
  );
121
119
  const trackFocusNextAction = (0, import_react.useCallback)(
122
- ({ isDestinationPanel, datumHydratables }) => {
123
- const preventMove = Boolean(datumHydratables.preventMove);
120
+ ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }) => {
121
+ const preventMove = Boolean(hydratedPreventMove);
124
122
  const preventDrilldown = Boolean(datumHydratables.preventDrilldown);
125
123
  const withDragAndDrop = isDestinationPanel && !removeDragAndDropFromDestination || !isDestinationPanel && addDragAndDropFromSource;
126
124
  const { nextAction } = getActionByProxymity({
127
125
  flags: { preventMove, preventDrilldown, withDragAndDrop },
128
- currentAction: mutableFocusItemAction.current
126
+ currentAction: getFocusItemAction()
129
127
  });
130
128
  setFocusItemAction(nextAction);
131
129
  },
132
- [addDragAndDropFromSource, mutableFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction]
130
+ [addDragAndDropFromSource, getFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction]
133
131
  );
134
132
  return (0, import_react.useMemo)(
135
133
  () => ({
136
- mutableFocusItemAction,
137
134
  trackFocusActionMove: () => setFocusItemAction("move-btn"),
138
135
  trackFocusActionDrilldown: () => setFocusItemAction("drilldown-btn"),
139
136
  trackFocusActionDragAndDrop: () => setFocusItemAction("drag-n-drop"),
@@ -142,7 +139,7 @@ const useFocusActionTrackers = () => {
142
139
  trackFocusPrevAction,
143
140
  trackFocusNextAction
144
141
  }),
145
- [mutableFocusItemAction, setFocusItemAction, trackFocusNextAction, trackFocusPrevAction]
142
+ [setFocusItemAction, trackFocusNextAction, trackFocusPrevAction]
146
143
  );
147
144
  };
148
145
  //# sourceMappingURL=useFocusActionTrackers.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/config/useFocusTracker/useFocusActionTrackers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useMemo, useCallback } from 'react';\nimport { useMakeMutable } from '@elliemae/ds-utilities';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types';\nimport { ACTIONS_FOCUSES } from '../../constants';\nimport { useInternalStore, usePropsStore } from '../useStore';\n\ntype ActionFlags = {\n preventDrilldown: boolean;\n withDragAndDrop: boolean;\n preventMove: boolean;\n};\ntype ActionByProxymity = {\n prevAction: (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n nextAction: (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n};\nconst getMoveBtnActionByProxymity = (flags: ActionFlags) => {\n // move button\n const { preventDrilldown, withDragAndDrop } = flags;\n const actionMap = { prevAction: '', nextAction: '' } as ActionByProxymity;\n // prev\n // drilldown if it exist\n // else drag n drop if it exist\n // else parent\n if (!preventDrilldown) actionMap.prevAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else if (withDragAndDrop) actionMap.prevAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.prevAction = ACTIONS_FOCUSES.PARENT;\n // next\n // drag n drop if it exist\n // else parent\n if (withDragAndDrop) actionMap.nextAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.nextAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getDragAndDropBtnActionByProxymity = (flags: ActionFlags) => {\n // Drag and drop handler\n const { preventMove, preventDrilldown } = flags;\n // next\n // always parent\n const actionMap = { prevAction: '', nextAction: ACTIONS_FOCUSES.PARENT } as ActionByProxymity;\n // prev\n // move if it exist\n // else drilldown if it exist\n // else parent\n if (!preventMove) actionMap.prevAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (!preventDrilldown) actionMap.prevAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else actionMap.prevAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getDrilldownBtnActionByProxymity = (flags: ActionFlags) => {\n // Drilldown handler\n const { withDragAndDrop, preventMove } = flags;\n // prev\n // always parent\n const actionMap = { prevAction: ACTIONS_FOCUSES.PARENT, nextAction: '' } as ActionByProxymity;\n // next\n // move if it exist\n // else drag n drop if it exist\n // else parent\n if (!preventMove) actionMap.nextAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (withDragAndDrop) actionMap.nextAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.nextAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getParenBtnActionByProxymity = (flags: ActionFlags) => {\n // Parent handler\n const { preventDrilldown, withDragAndDrop, preventMove } = flags;\n const actionMap = { prevAction: '', nextAction: '' } as ActionByProxymity;\n // prev\n // drag n drop if it exist\n // else move if it exist\n // else drilldown if it exist\n // else parent\n if (withDragAndDrop) actionMap.prevAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else if (!preventMove) actionMap.prevAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (!preventDrilldown) actionMap.prevAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else actionMap.prevAction = ACTIONS_FOCUSES.PARENT;\n // next\n // drilldown if it exist\n // else move if it exist\n // else drag n drop if it exist\n // else parent\n if (!preventDrilldown) actionMap.nextAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else if (!preventMove) actionMap.nextAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (withDragAndDrop) actionMap.nextAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.nextAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getActionByProxymity = ({ flags, currentAction }: { flags: ActionFlags; currentAction: string }) => {\n if (currentAction === ACTIONS_FOCUSES.MOVE_BTN) return getMoveBtnActionByProxymity(flags);\n if (currentAction === ACTIONS_FOCUSES.DRAG_N_DROP) return getDragAndDropBtnActionByProxymity(flags);\n if (currentAction === ACTIONS_FOCUSES.DRILLDOWN_BTN) return getDrilldownBtnActionByProxymity(flags);\n return getParenBtnActionByProxymity(flags);\n};\nexport const useFocusActionTrackers = () => {\n const focusItemAction = useInternalStore((state) => state.focusItemAction);\n // tracking actions are always triggered as user action callbacks\n // this means it should always be invoked after all the useEffect execute\n // since this is the case, we can avoid re-declaring the function with mutable pattern\n // this way we avoid useless re-renders\n const mutableFocusItemAction = useMakeMutable(focusItemAction);\n const setFocusItemAction = useInternalStore((state) => state.setFocusItemAction);\n const removeDragAndDropFromDestination = usePropsStore((state) => state.removeDragAndDropFromDestination);\n const addDragAndDropFromSource = usePropsStore((state) => state.addDragAndDropFromSource);\n const trackFocusPrevAction = useCallback(\n ({ isDestinationPanel, datumHydratables }: DSShuttleV2T.ItemMeta) => {\n const preventMove = Boolean(datumHydratables.preventMove);\n const preventDrilldown = Boolean(datumHydratables.preventDrilldown);\n const withDragAndDrop =\n (isDestinationPanel && !removeDragAndDropFromDestination) || (!isDestinationPanel && addDragAndDropFromSource);\n const { prevAction } = getActionByProxymity({\n flags: { preventMove, preventDrilldown, withDragAndDrop },\n currentAction: mutableFocusItemAction.current,\n });\n setFocusItemAction(prevAction);\n },\n [addDragAndDropFromSource, mutableFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction],\n );\n const trackFocusNextAction = useCallback(\n ({ isDestinationPanel, datumHydratables }: DSShuttleV2T.ItemMeta) => {\n const preventMove = Boolean(datumHydratables.preventMove);\n const preventDrilldown = Boolean(datumHydratables.preventDrilldown);\n const withDragAndDrop =\n (isDestinationPanel && !removeDragAndDropFromDestination) || (!isDestinationPanel && addDragAndDropFromSource);\n const { nextAction } = getActionByProxymity({\n flags: { preventMove, preventDrilldown, withDragAndDrop },\n currentAction: mutableFocusItemAction.current,\n });\n setFocusItemAction(nextAction);\n },\n [addDragAndDropFromSource, mutableFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction],\n );\n return useMemo(\n () => ({\n mutableFocusItemAction,\n trackFocusActionMove: () => setFocusItemAction('move-btn'),\n trackFocusActionDrilldown: () => setFocusItemAction('drilldown-btn'),\n trackFocusActionDragAndDrop: () => setFocusItemAction('drag-n-drop'),\n trackFocusActionParent: () => setFocusItemAction('parent'),\n trackFocusActionReset: () => setFocusItemAction(''),\n trackFocusPrevAction,\n trackFocusNextAction,\n }),\n [mutableFocusItemAction, setFocusItemAction, trackFocusNextAction, trackFocusPrevAction],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAqC;AACrC,0BAA+B;AAE/B,uBAAgC;AAChC,sBAAgD;AAWhD,M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gB;AAClE,YAAM,kBACH,sBAAsB,CAAC,oCAAsC,CAAC,sBAAsB;AACvF,YAAM,EAAE,WAAW,IAAI,qBAAqB;AAAA,QAC1C,OAAO,EAAE,aAAa,kBAAkB,gBAAgB;AAAA,QACxD,eAAe,uBAAuB;AAAA,MACxC,CAAC;AACD,yBAAmB,UAAU;AAAA,IAC/B;AAAA,IACA,CAAC,0BAA0B,wBAAwB,kCAAkC,kBAAkB;AAAA,EACzG;AACA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA,sBAAsB,MAAM,mBAAmB,UAAU;AAAA,MACzD,2BAA2B,MAAM,mBAAmB,eAAe;AAAA,MACnE,6BAA6B,MAAM,mBAAmB,aAAa;AAAA,MACnE,wBAAwB,MAAM,mBAAmB,QAAQ;AAAA,MACzD,uBAAuB,MAAM,mBAAmB,EAAE;AAAA,MAClD;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,wBAAwB,oBAAoB,sBAAsB,oBAAoB;AAAA,EACzF;AACF;",
4
+ "sourcesContent": ["import { useMemo, useCallback } from 'react';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types';\nimport { ACTIONS_FOCUSES } from '../../constants';\nimport { useInternalStore, usePropsStore } from '../useStore';\n\ntype ActionFlags = {\n preventDrilldown: boolean;\n withDragAndDrop: boolean;\n preventMove: boolean;\n};\ntype ActionByProxymity = {\n prevAction: (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n nextAction: (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n};\nconst getMoveBtnActionByProxymity = (flags: ActionFlags) => {\n // move button\n const { preventDrilldown, withDragAndDrop } = flags;\n const actionMap = { prevAction: '', nextAction: '' } as ActionByProxymity;\n // prev\n // drilldown if it exist\n // else drag n drop if it exist\n // else parent\n if (!preventDrilldown) actionMap.prevAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else if (withDragAndDrop) actionMap.prevAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.prevAction = ACTIONS_FOCUSES.PARENT;\n // next\n // drag n drop if it exist\n // else parent\n if (withDragAndDrop) actionMap.nextAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.nextAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getDragAndDropBtnActionByProxymity = (flags: ActionFlags) => {\n // Drag and drop handler\n const { preventMove, preventDrilldown } = flags;\n // next\n // always parent\n const actionMap = { prevAction: '', nextAction: ACTIONS_FOCUSES.PARENT } as ActionByProxymity;\n // prev\n // move if it exist\n // else drilldown if it exist\n // else parent\n if (!preventMove) actionMap.prevAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (!preventDrilldown) actionMap.prevAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else actionMap.prevAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getDrilldownBtnActionByProxymity = (flags: ActionFlags) => {\n // Drilldown handler\n const { withDragAndDrop, preventMove } = flags;\n // prev\n // always parent\n const actionMap = { prevAction: ACTIONS_FOCUSES.PARENT, nextAction: '' } as ActionByProxymity;\n // next\n // move if it exist\n // else drag n drop if it exist\n // else parent\n if (!preventMove) actionMap.nextAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (withDragAndDrop) actionMap.nextAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.nextAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getParenBtnActionByProxymity = (flags: ActionFlags) => {\n // Parent handler\n const { preventDrilldown, withDragAndDrop, preventMove } = flags;\n const actionMap = { prevAction: '', nextAction: '' } as ActionByProxymity;\n // prev\n // drag n drop if it exist\n // else move if it exist\n // else drilldown if it exist\n // else parent\n if (withDragAndDrop) actionMap.prevAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else if (!preventMove) actionMap.prevAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (!preventDrilldown) actionMap.prevAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else actionMap.prevAction = ACTIONS_FOCUSES.PARENT;\n // next\n // drilldown if it exist\n // else move if it exist\n // else drag n drop if it exist\n // else parent\n if (!preventDrilldown) actionMap.nextAction = ACTIONS_FOCUSES.DRILLDOWN_BTN;\n else if (!preventMove) actionMap.nextAction = ACTIONS_FOCUSES.MOVE_BTN;\n else if (withDragAndDrop) actionMap.nextAction = ACTIONS_FOCUSES.DRAG_N_DROP;\n else actionMap.nextAction = ACTIONS_FOCUSES.PARENT;\n return actionMap;\n};\nconst getActionByProxymity = ({ flags, currentAction }: { flags: ActionFlags; currentAction: string }) => {\n if (currentAction === ACTIONS_FOCUSES.MOVE_BTN) return getMoveBtnActionByProxymity(flags);\n if (currentAction === ACTIONS_FOCUSES.DRAG_N_DROP) return getDragAndDropBtnActionByProxymity(flags);\n if (currentAction === ACTIONS_FOCUSES.DRILLDOWN_BTN) return getDrilldownBtnActionByProxymity(flags);\n return getParenBtnActionByProxymity(flags);\n};\nexport const useFocusActionTrackers = () => {\n const getFocusItemAction = useInternalStore((state) => state.getFocusItemAction);\n const setFocusItemAction = useInternalStore((state) => state.setFocusItemAction);\n const removeDragAndDropFromDestination = usePropsStore((state) => state.removeDragAndDropFromDestination);\n const addDragAndDropFromSource = usePropsStore((state) => state.addDragAndDropFromSource);\n const trackFocusPrevAction = useCallback(\n ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }: DSShuttleV2T.ItemMeta) => {\n const preventMove = Boolean(hydratedPreventMove);\n const preventDrilldown = Boolean(datumHydratables.preventDrilldown);\n const withDragAndDrop =\n (isDestinationPanel && !removeDragAndDropFromDestination) || (!isDestinationPanel && addDragAndDropFromSource);\n const { prevAction } = getActionByProxymity({\n flags: { preventMove, preventDrilldown, withDragAndDrop },\n currentAction: getFocusItemAction(),\n });\n setFocusItemAction(prevAction);\n },\n [addDragAndDropFromSource, getFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction],\n );\n const trackFocusNextAction = useCallback(\n ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }: DSShuttleV2T.ItemMeta) => {\n const preventMove = Boolean(hydratedPreventMove);\n const preventDrilldown = Boolean(datumHydratables.preventDrilldown);\n const withDragAndDrop =\n (isDestinationPanel && !removeDragAndDropFromDestination) || (!isDestinationPanel && addDragAndDropFromSource);\n const { nextAction } = getActionByProxymity({\n flags: { preventMove, preventDrilldown, withDragAndDrop },\n currentAction: getFocusItemAction(),\n });\n setFocusItemAction(nextAction);\n },\n [addDragAndDropFromSource, getFocusItemAction, removeDragAndDropFromDestination, setFocusItemAction],\n );\n return useMemo(\n () => ({\n trackFocusActionMove: () => setFocusItemAction('move-btn'),\n trackFocusActionDrilldown: () => setFocusItemAction('drilldown-btn'),\n trackFocusActionDragAndDrop: () => setFocusItemAction('drag-n-drop'),\n trackFocusActionParent: () => setFocusItemAction('parent'),\n trackFocusActionReset: () => setFocusItemAction(''),\n trackFocusPrevAction,\n trackFocusNextAction,\n }),\n [setFocusItemAction, trackFocusNextAction, trackFocusPrevAction],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAqC;AAErC,uBAAgC;AAChC,sBAAgD;AAWhD,MAAM,8BAA8B,CAAC,UAAuB;AAE1D,QAAM,EAAE,kBAAkB,gBAAgB,IAAI;AAC9C,QAAM,YAAY,EAAE,YAAY,IAAI,YAAY,GAAG;AAKnD,MAAI,CAAC;AAAkB,cAAU,aAAa,iCAAgB;AAAA,WACrD;AAAiB,cAAU,aAAa,iCAAgB;AAAA;AAC5D,cAAU,aAAa,iCAAgB;AAI5C,MAAI;AAAiB,cAAU,aAAa,iCAAgB;AAAA;AACvD,cAAU,aAAa,iCAAgB;AAC5C,SAAO;AACT;AACA,MAAM,qCAAqC,CAAC,UAAuB;AAEjE,QAAM,EAAE,aAAa,iBAAiB,IAAI;AA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,eAAe;AAAA,MACnE,6BAA6B,MAAM,mBAAmB,aAAa;AAAA,MACnE,wBAAwB,MAAM,mBAAmB,QAAQ;AAAA,MACzD,uBAAuB,MAAM,mBAAmB,EAAE;AAAA,MAClD;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,oBAAoB,sBAAsB,oBAAoB;AAAA,EACjE;AACF;",
6
6
  "names": []
7
7
  }
@@ -29,40 +29,21 @@ __export(useFocusItemTracker_exports, {
29
29
  module.exports = __toCommonJS(useFocusItemTracker_exports);
30
30
  var React = __toESM(require("react"));
31
31
  var import_react = require("react");
32
- var import_ds_utilities = require("@elliemae/ds-utilities");
33
32
  var import_useStore = require("../useStore");
34
33
  var import_constants = require("../../constants/index");
35
34
  const useFocusItemTracker = () => {
36
- const focusItem = (0, import_useStore.useInternalStore)((state) => state.focusItem);
37
- const mutableFocusItem = (0, import_ds_utilities.useMakeMutable)(focusItem);
35
+ const getFocusItem = (0, import_useStore.useInternalStore)((state) => state.getFocusItem);
38
36
  const setFocusItem = (0, import_useStore.useInternalStore)((state) => state.setFocusItem);
39
- const sourceData = (0, import_useStore.useInternalStore)((state) => state.sourceConfiguredData);
40
- const destinationData = (0, import_useStore.useInternalStore)((state) => state.destinationConfiguredData);
37
+ const sourceData = (0, import_useStore.usePropsStore)((state) => state.sourceConfiguredData);
38
+ const destinationData = (0, import_useStore.usePropsStore)((state) => state.destinationConfiguredData);
41
39
  const sourceWithLoadMore = (0, import_useStore.usePropsStore)((state) => state.sourceWithLoadMore);
42
40
  const destinationWithLoadMore = (0, import_useStore.usePropsStore)((state) => state.destinationWithLoadMore);
43
41
  const trackFocusPrevItem = (0, import_react.useCallback)(
44
42
  ({ isDestinationPanel }) => {
43
+ const focusItem = getFocusItem();
45
44
  const referenceData = isDestinationPanel ? destinationData : sourceData;
46
45
  const withLoadMore = isDestinationPanel ? destinationWithLoadMore : sourceWithLoadMore;
47
- if (mutableFocusItem.current === import_constants.ITEMS_FOCUSES.FIRST) {
48
- if (withLoadMore)
49
- setFocusItem(
50
- isDestinationPanel ? import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_DESTINATION : import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_SOURCE
51
- );
52
- else {
53
- const prevItemIndex = referenceData.length > 1 ? referenceData.length - 1 : 0;
54
- const prevItem = referenceData[prevItemIndex];
55
- setFocusItem(import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(prevItem));
56
- }
57
- return;
58
- }
59
- if (mutableFocusItem.current === import_constants.ITEMS_FOCUSES.LAST) {
60
- const prevItemIndex = referenceData.length > 2 ? referenceData.length - 2 : 0;
61
- const prevItem = referenceData[prevItemIndex];
62
- setFocusItem(import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(prevItem));
63
- return;
64
- }
65
- const currentItemIndex = referenceData.findIndex((currItem) => currItem.hydratedId === mutableFocusItem.current);
46
+ const currentItemIndex = referenceData.findIndex((currItem) => currItem.hydratedId === focusItem);
66
47
  if (currentItemIndex === 0 && withLoadMore)
67
48
  setFocusItem(isDestinationPanel ? import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_DESTINATION : import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_SOURCE);
68
49
  else if (currentItemIndex !== -1) {
@@ -75,31 +56,14 @@ const useFocusItemTracker = () => {
75
56
  setFocusItem(import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(prevItem));
76
57
  }
77
58
  },
78
- [destinationData, destinationWithLoadMore, mutableFocusItem, setFocusItem, sourceData, sourceWithLoadMore]
59
+ [destinationData, destinationWithLoadMore, getFocusItem, setFocusItem, sourceData, sourceWithLoadMore]
79
60
  );
80
61
  const trackFocusNextItem = (0, import_react.useCallback)(
81
62
  ({ isDestinationPanel }) => {
63
+ const focusItem = getFocusItem();
82
64
  const referenceData = isDestinationPanel ? destinationData : sourceData;
83
65
  const withLoadMore = isDestinationPanel ? destinationWithLoadMore : sourceWithLoadMore;
84
- if (mutableFocusItem.current === import_constants.ITEMS_FOCUSES.FIRST) {
85
- const nextItemIndex = referenceData.length > 1 ? 1 : 0;
86
- const nextItem = referenceData[nextItemIndex];
87
- setFocusItem(import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(nextItem));
88
- return;
89
- }
90
- if (mutableFocusItem.current === import_constants.ITEMS_FOCUSES.LAST) {
91
- if (withLoadMore)
92
- setFocusItem(
93
- isDestinationPanel ? import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_DESTINATION : import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_SOURCE
94
- );
95
- else {
96
- const nextItemIndex = 0;
97
- const nextItem = referenceData[nextItemIndex];
98
- setFocusItem(import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(nextItem));
99
- }
100
- return;
101
- }
102
- const currentItemIndex = referenceData.findIndex((currItem) => currItem.hydratedId === mutableFocusItem.current);
66
+ const currentItemIndex = referenceData.findIndex((currItem) => currItem.hydratedId === focusItem);
103
67
  if (currentItemIndex === referenceData.length - 1 && withLoadMore)
104
68
  setFocusItem(isDestinationPanel ? import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_DESTINATION : import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_SOURCE);
105
69
  else if (currentItemIndex !== -1) {
@@ -112,21 +76,24 @@ const useFocusItemTracker = () => {
112
76
  setFocusItem(import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(nextItem));
113
77
  }
114
78
  },
115
- [destinationData, destinationWithLoadMore, mutableFocusItem, setFocusItem, sourceData, sourceWithLoadMore]
79
+ [destinationData, destinationWithLoadMore, getFocusItem, setFocusItem, sourceData, sourceWithLoadMore]
116
80
  );
117
81
  return (0, import_react.useMemo)(
118
82
  () => ({
119
- mutableFocusItem,
120
83
  trackFocusItem: (item) => setFocusItem(item.hydratedId),
121
84
  trackFocusItemReset: () => setFocusItem(import_constants.ITEMS_FOCUSES.RESET),
122
- trackFocusItemFirst: () => setFocusItem(import_constants.ITEMS_FOCUSES.FIRST),
123
- trackFocusItemLast: () => setFocusItem(import_constants.ITEMS_FOCUSES.LAST),
85
+ trackFocusItemFirst: ({ isDestinationPanel }) => setFocusItem(import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(isDestinationPanel ? destinationData[0] : sourceData[0])),
86
+ trackFocusItemLast: ({ isDestinationPanel }) => setFocusItem(
87
+ import_constants.ITEMS_FOCUSES.GET_SPECIFIC_ITEM(
88
+ isDestinationPanel ? destinationData[destinationData.length - 1] : sourceData[sourceData.length - 1]
89
+ )
90
+ ),
124
91
  trackFocusLoadMoreBtnDestination: () => setFocusItem(import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_DESTINATION),
125
92
  trackFocusLoadMoreBtn: () => setFocusItem(import_constants.ITEMS_FOCUSES.LOAD_MORE_BTN_SOURCE),
126
93
  trackFocusPrevItem,
127
94
  trackFocusNextItem
128
95
  }),
129
- [mutableFocusItem, setFocusItem, trackFocusNextItem, trackFocusPrevItem]
96
+ [destinationData, setFocusItem, sourceData, trackFocusNextItem, trackFocusPrevItem]
130
97
  );
131
98
  };
132
99
  //# sourceMappingURL=useFocusItemTracker.js.map