@oj-module/cli 0.2.63 → 0.2.66

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 (206) hide show
  1. package/devkit/README.md +9 -3
  2. package/devkit/SKILL.md +5 -2
  3. package/devkit/framework-dev.md +12 -7
  4. package/devkit/manual.md +123 -56
  5. package/devkit/menu-rules.md +4 -1
  6. package/package.json +3 -2
  7. package/shell-dist/assets/ahooks.2l850ymmh0.js +18 -0
  8. package/shell-dist/assets/antd-es-locale-zh_CN.1gjjsvxbf0.js +1 -0
  9. package/shell-dist/assets/antd-img-crop.196rkty480.js +99 -0
  10. package/shell-dist/assets/antd-locale-en_US.561tozx860.js +1 -0
  11. package/shell-dist/assets/antd-locale-zh_CN.1cmpmgzh70.js +1 -0
  12. package/shell-dist/assets/antd.uw1coq15l0.js +348 -0
  13. package/shell-dist/assets/clsx.jotilrt2e0.js +1 -0
  14. package/shell-dist/assets/contract-errors.2o17vz9u50.js +1 -0
  15. package/shell-dist/assets/contract.3h327o3mj0.js +57 -0
  16. package/shell-dist/assets/cssinjs.atgmhan7m0.js +3 -0
  17. package/shell-dist/assets/dayjs-plugin-advancedFormat.3vsyd2eis0.js +1 -0
  18. package/shell-dist/assets/dayjs-plugin-customParseFormat.13xhghv1d0.js +1 -0
  19. package/shell-dist/assets/dayjs-plugin-isoWeek.1fn1tw82p0.js +1 -0
  20. package/shell-dist/assets/dayjs-plugin-localeData.2rwbjp9nk0.js +1 -0
  21. package/shell-dist/assets/dayjs-plugin-quarterOfYear.2oqo1lcx80.js +1 -0
  22. package/shell-dist/assets/dayjs-plugin-relativeTime.2pqs3et4y0.js +1 -0
  23. package/shell-dist/assets/dayjs-plugin-weekOfYear.gvn9iph080.js +1 -0
  24. package/shell-dist/assets/dayjs-plugin-weekYear.2u78l3ex10.js +1 -0
  25. package/shell-dist/assets/dayjs-plugin-weekday.2d56a4tml0.js +1 -0
  26. package/shell-dist/assets/dayjs.pa60l6wjo0.js +1 -0
  27. package/shell-dist/assets/dnd-kit-core.1xyreig6r0.js +5 -0
  28. package/shell-dist/assets/dnd-kit-sortable.s94qciuft0.js +1 -0
  29. package/shell-dist/assets/dnd-kit-utilities.1umw4xphb0.js +1 -0
  30. package/shell-dist/assets/i18next.33zqofapj0.js +1 -0
  31. package/shell-dist/assets/icons-es-components-Context.365qmflwg0.js +1 -0
  32. package/shell-dist/assets/icons.159wjwals0.js +57 -0
  33. package/shell-dist/assets/{index-BKtXxIXz.js → index.i0kqbxp050.js} +11 -6
  34. package/shell-dist/assets/jsx-dev-runtime.3uibuc82f0.js +14 -0
  35. package/shell-dist/assets/jsx-runtime.h40xu4o5b0.js +14 -0
  36. package/shell-dist/assets/keepalive-for-react.xenu5vam70.js +1 -0
  37. package/shell-dist/assets/kit.37kr8ui390.js +1 -0
  38. package/shell-dist/assets/ky.1cgch7gu60.js +6 -0
  39. package/shell-dist/assets/motion-react.pjsxytvjs0.js +12 -0
  40. package/shell-dist/assets/motion.21tciqutg0.js +4 -0
  41. package/shell-dist/assets/nprogress.2nz76n9ny0.js +7 -0
  42. package/shell-dist/assets/ojm-dayjs-locale-zh-cn.3vr3beiyp0.js +9 -0
  43. package/shell-dist/assets/pinyin-pro.3v0mnxczn0.js +1 -0
  44. package/shell-dist/assets/pro-components.2kyot1vcl0.js +83 -0
  45. package/shell-dist/assets/react-countup.2x8idnr8y0.js +10 -0
  46. package/shell-dist/assets/react-dom-client.ick0v05ob0.js +43 -0
  47. package/shell-dist/assets/react-dom.2so9uxg3f0.js +22 -0
  48. package/shell-dist/assets/react-error-boundary.2dncdfj3b0.js +1 -0
  49. package/shell-dist/assets/react-i18next.auhvjhqv00.js +1 -0
  50. package/shell-dist/assets/react-jss.1ei6dr9e00.js +29 -0
  51. package/shell-dist/assets/react-query.3rln45ow00.js +1 -0
  52. package/shell-dist/assets/react-router-dom.3c6zld8h40.js +44 -0
  53. package/shell-dist/assets/react-router.2h9rebcv50.js +56 -0
  54. package/shell-dist/assets/react.1ew63mwts0.js +14 -0
  55. package/shell-dist/assets/runtime.1xfsxcajj0.js +21702 -0
  56. package/shell-dist/assets/simplebar-react.2g739uvai0.js +1 -0
  57. package/shell-dist/assets/spin-delay.yjeyj6iwp0.js +9 -0
  58. package/shell-dist/assets/tailwind-merge.125ehiqjw0.js +1 -0
  59. package/shell-dist/assets/use-sync-external-store-shim.1nz1pi9bb0.js +22 -0
  60. package/shell-dist/assets/zustand-middleware.1xaxjueme0.js +6 -0
  61. package/shell-dist/assets/zustand-react-shallow.pybayv1hx0.js +1 -0
  62. package/shell-dist/assets/zustand-react.9fsl9brxy0.js +1 -0
  63. package/shell-dist/assets/zustand-shallow.6cz0yyv9x0.js +1 -0
  64. package/shell-dist/assets/zustand-vanilla-shallow.3424monv50.js +1 -0
  65. package/shell-dist/assets/zustand-vanilla.1mo3ka3g30.js +1 -0
  66. package/shell-dist/assets/zustand.3gjgzlnqo0.js +1 -0
  67. package/shell-dist/index.html +67 -118
  68. package/shell-dist/versions.json +3 -3
  69. package/src/build/module-def.ts +1 -0
  70. package/src/esm-exports.ts +152 -70
  71. package/src/market/__tests__/bootstrap.test.ts +36 -1
  72. package/src/shared-deps.ts +69 -19
  73. package/src/site-base.ts +4 -0
  74. package/templates/src/app/web/home/pages/components/bar-chart.tsx +5 -3
  75. package/templates/src/app/web/home/pages/components/echarts-setup.ts +30 -0
  76. package/templates/src/app/web/home/pages/components/line-chart.tsx +5 -3
  77. package/templates/src/app/web/home/pages/components/pie-chart.tsx +6 -3
  78. package/templates/src/app/web/home/pages/index.tsx +3 -2
  79. package/templates/src/app/web/home/routes.ts +3 -2
  80. package/templates/src/app/web/personal-center/locales/en-US.json +15 -0
  81. package/templates/src/app/web/personal-center/locales/zh-CN.json +15 -0
  82. package/templates/src/app/web/personal-center/pages/my-profile/index.tsx +15 -13
  83. package/templates/src/app/web/system/locales/en-US.json +24 -3
  84. package/templates/src/app/web/system/locales/zh-CN.json +24 -3
  85. package/templates/src/app/web/system/pages/roles/index.tsx +13 -6
  86. package/templates/src/app/web/system/pages/settings/index.tsx +1 -1
  87. package/templates/src/app/web/system/pages/users/index.tsx +3 -3
  88. package/templates/src/app/web/system/pages/users/roles.tsx +1 -1
  89. package/templates/src/oj-market/web/locales/en-US.json +14 -1
  90. package/templates/src/oj-market/web/locales/zh-CN.json +14 -1
  91. package/vendor/host-versions.json +3 -3
  92. package/shell-dist/assets/ahooks.js +0 -6909
  93. package/shell-dist/assets/antd-es-locale-zh_CN.js +0 -257
  94. package/shell-dist/assets/antd-img-crop.js +0 -1495
  95. package/shell-dist/assets/antd-locale-en_US.js +0 -374
  96. package/shell-dist/assets/antd-locale-zh_CN.js +0 -379
  97. package/shell-dist/assets/antd.js +0 -106874
  98. package/shell-dist/assets/clsx.js +0 -33
  99. package/shell-dist/assets/contract-errors.js +0 -30
  100. package/shell-dist/assets/contract.js +0 -18900
  101. package/shell-dist/assets/cssinjs.js +0 -2595
  102. package/shell-dist/assets/dayjs-plugin-advancedFormat.js +0 -98
  103. package/shell-dist/assets/dayjs-plugin-customParseFormat.js +0 -173
  104. package/shell-dist/assets/dayjs-plugin-isoWeek.js +0 -77
  105. package/shell-dist/assets/dayjs-plugin-localeData.js +0 -126
  106. package/shell-dist/assets/dayjs-plugin-quarterOfYear.js +0 -77
  107. package/shell-dist/assets/dayjs-plugin-relativeTime.js +0 -92
  108. package/shell-dist/assets/dayjs-plugin-weekOfYear.js +0 -73
  109. package/shell-dist/assets/dayjs-plugin-weekYear.js +0 -63
  110. package/shell-dist/assets/dayjs-plugin-weekday.js +0 -63
  111. package/shell-dist/assets/dayjs.js +0 -326
  112. package/shell-dist/assets/dnd-kit-core.js +0 -3601
  113. package/shell-dist/assets/dnd-kit-sortable.js +0 -717
  114. package/shell-dist/assets/dnd-kit-utilities.js +0 -340
  115. package/shell-dist/assets/i18next.js +0 -2321
  116. package/shell-dist/assets/icons-es-components-Context.js +0 -20
  117. package/shell-dist/assets/icons.js +0 -34961
  118. package/shell-dist/assets/jsx-dev-runtime.js +0 -75
  119. package/shell-dist/assets/jsx-runtime.js +0 -97
  120. package/shell-dist/assets/keepalive-for-react.js +0 -283
  121. package/shell-dist/assets/kit.js +0 -151
  122. package/shell-dist/assets/ky.js +0 -1427
  123. package/shell-dist/assets/motion-react.js +0 -13589
  124. package/shell-dist/assets/motion.js +0 -9959
  125. package/shell-dist/assets/nprogress.js +0 -314
  126. package/shell-dist/assets/ojm--ant-design-icons-es-icons-BarsOutlined.js +0 -7
  127. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CalendarOutlined.js +0 -7
  128. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownFilled.js +0 -7
  129. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownOutlined.js +0 -7
  130. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretUpOutlined.js +0 -7
  131. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckCircleFilled.js +0 -7
  132. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckOutlined.js +0 -7
  133. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ClockCircleOutlined.js +0 -7
  134. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseCircleFilled.js +0 -7
  135. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseOutlined.js +0 -7
  136. package/shell-dist/assets/ojm--ant-design-icons-es-icons-CopyOutlined.js +0 -7
  137. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DeleteOutlined.js +0 -7
  138. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleLeftOutlined.js +0 -7
  139. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleRightOutlined.js +0 -7
  140. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownOutlined.js +0 -7
  141. package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownloadOutlined.js +0 -7
  142. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EditOutlined.js +0 -7
  143. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EllipsisOutlined.js +0 -7
  144. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EnterOutlined.js +0 -7
  145. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ExclamationCircleFilled.js +0 -7
  146. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeInvisibleOutlined.js +0 -7
  147. package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeOutlined.js +0 -7
  148. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileOutlined.js +0 -7
  149. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileTextOutlined.js +0 -7
  150. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FilterFilled.js +0 -7
  151. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOpenOutlined.js +0 -7
  152. package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOutlined.js +0 -7
  153. package/shell-dist/assets/ojm--ant-design-icons-es-icons-HolderOutlined.js +0 -7
  154. package/shell-dist/assets/ojm--ant-design-icons-es-icons-InfoCircleFilled.js +0 -7
  155. package/shell-dist/assets/ojm--ant-design-icons-es-icons-LeftOutlined.js +0 -7
  156. package/shell-dist/assets/ojm--ant-design-icons-es-icons-LoadingOutlined.js +0 -7
  157. package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusOutlined.js +0 -7
  158. package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusSquareOutlined.js +0 -7
  159. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PaperClipOutlined.js +0 -7
  160. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PictureOutlined.js +0 -7
  161. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusOutlined.js +0 -7
  162. package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusSquareOutlined.js +0 -7
  163. package/shell-dist/assets/ojm--ant-design-icons-es-icons-QuestionCircleOutlined.js +0 -7
  164. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ReloadOutlined.js +0 -7
  165. package/shell-dist/assets/ojm--ant-design-icons-es-icons-RightOutlined.js +0 -7
  166. package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateLeftOutlined.js +0 -7
  167. package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateRightOutlined.js +0 -7
  168. package/shell-dist/assets/ojm--ant-design-icons-es-icons-SearchOutlined.js +0 -7
  169. package/shell-dist/assets/ojm--ant-design-icons-es-icons-StarFilled.js +0 -7
  170. package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapOutlined.js +0 -7
  171. package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapRightOutlined.js +0 -7
  172. package/shell-dist/assets/ojm--ant-design-icons-es-icons-UpOutlined.js +0 -7
  173. package/shell-dist/assets/ojm--ant-design-icons-es-icons-VerticalAlignTopOutlined.js +0 -7
  174. package/shell-dist/assets/ojm--ant-design-icons-es-icons-WarningFilled.js +0 -7
  175. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomInOutlined.js +0 -7
  176. package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomOutOutlined.js +0 -7
  177. package/shell-dist/assets/ojm-dayjs-locale-zh-cn.js +0 -81
  178. package/shell-dist/assets/pinyin-pro.js +0 -25175
  179. package/shell-dist/assets/pro-components.js +0 -44627
  180. package/shell-dist/assets/react-countup.js +0 -525
  181. package/shell-dist/assets/react-dom-client.js +0 -12134
  182. package/shell-dist/assets/react-dom.js +0 -266
  183. package/shell-dist/assets/react-error-boundary.js +0 -141
  184. package/shell-dist/assets/react-i18next.js +0 -1773
  185. package/shell-dist/assets/react-jss.js +0 -4089
  186. package/shell-dist/assets/react-query.js +0 -3072
  187. package/shell-dist/assets/react-router-dom.js +0 -9927
  188. package/shell-dist/assets/react-router.js +0 -14584
  189. package/shell-dist/assets/react.js +0 -590
  190. package/shell-dist/assets/runtime.js +0 -28294
  191. package/shell-dist/assets/simplebar-react.js +0 -1119
  192. package/shell-dist/assets/spin-delay.js +0 -111
  193. package/shell-dist/assets/tailwind-merge.js +0 -3364
  194. package/shell-dist/assets/use-sync-external-store-shim.js +0 -130
  195. package/shell-dist/assets/zustand-middleware.js +0 -513
  196. package/shell-dist/assets/zustand-react-shallow.js +0 -27
  197. package/shell-dist/assets/zustand-react.js +0 -39
  198. package/shell-dist/assets/zustand-shallow.js +0 -22
  199. package/shell-dist/assets/zustand-vanilla-shallow.js +0 -71
  200. package/shell-dist/assets/zustand-vanilla.js +0 -40
  201. package/shell-dist/assets/zustand.js +0 -32
  202. /package/shell-dist/assets/{nprogress-css.js → nprogress-css.1cq2pzkre0.js} +0 -0
  203. /package/shell-dist/assets/{ojm-antd-es-button.js → ojm-antd-es-button.2uriphio50.js} +0 -0
  204. /package/shell-dist/assets/{ojm-antd-es-modal.js → ojm-antd-es-modal.bf3tgdh8v0.js} +0 -0
  205. /package/shell-dist/assets/{ojm-antd-es-slider.js → ojm-antd-es-slider.xyvptuhid0.js} +0 -0
  206. /package/shell-dist/assets/{ojm-antd-es-upload.js → ojm-antd-es-upload.13gx45e0g0.js} +0 -0
@@ -1,717 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- // ../../node_modules/.pnpm/@dnd-kit+sortable@10.0.0_@dnd-kit+core@6.3.1_react-dom@19.2.8_react@19.2.8__react@19.2.8__react@19.2.8/node_modules/@dnd-kit/sortable/dist/sortable.esm.js
8
- var sortable_esm_exports = {};
9
- __export(sortable_esm_exports, {
10
- SortableContext: () => SortableContext,
11
- arrayMove: () => arrayMove,
12
- arraySwap: () => arraySwap,
13
- defaultAnimateLayoutChanges: () => defaultAnimateLayoutChanges,
14
- defaultNewIndexGetter: () => defaultNewIndexGetter,
15
- hasSortableData: () => hasSortableData,
16
- horizontalListSortingStrategy: () => horizontalListSortingStrategy,
17
- rectSortingStrategy: () => rectSortingStrategy,
18
- rectSwappingStrategy: () => rectSwappingStrategy,
19
- sortableKeyboardCoordinates: () => sortableKeyboardCoordinates,
20
- useSortable: () => useSortable,
21
- verticalListSortingStrategy: () => verticalListSortingStrategy
22
- });
23
- import React, { useMemo, useRef, useEffect, useState, useContext } from "react";
24
- import { useDndContext, getClientRect, useDroppable, useDraggable, closestCorners, getFirstCollision, getScrollableAncestors, KeyboardCode } from "@dnd-kit/core";
25
- import { useUniqueId, useIsomorphicLayoutEffect, CSS, useCombinedRefs, isKeyboardEvent, subtract } from "@dnd-kit/utilities";
26
- function arrayMove(array, from, to) {
27
- const newArray = array.slice();
28
- newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
29
- return newArray;
30
- }
31
- function arraySwap(array, from, to) {
32
- const newArray = array.slice();
33
- newArray[from] = array[to];
34
- newArray[to] = array[from];
35
- return newArray;
36
- }
37
- function getSortedRects(items, rects) {
38
- return items.reduce((accumulator, id, index) => {
39
- const rect = rects.get(id);
40
- if (rect) {
41
- accumulator[index] = rect;
42
- }
43
- return accumulator;
44
- }, Array(items.length));
45
- }
46
- function isValidIndex(index) {
47
- return index !== null && index >= 0;
48
- }
49
- function itemsEqual(a, b) {
50
- if (a === b) {
51
- return true;
52
- }
53
- if (a.length !== b.length) {
54
- return false;
55
- }
56
- for (let i = 0; i < a.length; i++) {
57
- if (a[i] !== b[i]) {
58
- return false;
59
- }
60
- }
61
- return true;
62
- }
63
- function normalizeDisabled(disabled) {
64
- if (typeof disabled === "boolean") {
65
- return {
66
- draggable: disabled,
67
- droppable: disabled
68
- };
69
- }
70
- return disabled;
71
- }
72
- var defaultScale = {
73
- scaleX: 1,
74
- scaleY: 1
75
- };
76
- var horizontalListSortingStrategy = (_ref) => {
77
- var _rects$activeIndex;
78
- let {
79
- rects,
80
- activeNodeRect: fallbackActiveRect,
81
- activeIndex,
82
- overIndex,
83
- index
84
- } = _ref;
85
- const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
86
- if (!activeNodeRect) {
87
- return null;
88
- }
89
- const itemGap = getItemGap(rects, index, activeIndex);
90
- if (index === activeIndex) {
91
- const newIndexRect = rects[overIndex];
92
- if (!newIndexRect) {
93
- return null;
94
- }
95
- return {
96
- x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
97
- y: 0,
98
- ...defaultScale
99
- };
100
- }
101
- if (index > activeIndex && index <= overIndex) {
102
- return {
103
- x: -activeNodeRect.width - itemGap,
104
- y: 0,
105
- ...defaultScale
106
- };
107
- }
108
- if (index < activeIndex && index >= overIndex) {
109
- return {
110
- x: activeNodeRect.width + itemGap,
111
- y: 0,
112
- ...defaultScale
113
- };
114
- }
115
- return {
116
- x: 0,
117
- y: 0,
118
- ...defaultScale
119
- };
120
- };
121
- function getItemGap(rects, index, activeIndex) {
122
- const currentRect = rects[index];
123
- const previousRect = rects[index - 1];
124
- const nextRect = rects[index + 1];
125
- if (!currentRect || !previousRect && !nextRect) {
126
- return 0;
127
- }
128
- if (activeIndex < index) {
129
- return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
130
- }
131
- return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
132
- }
133
- var rectSortingStrategy = (_ref) => {
134
- let {
135
- rects,
136
- activeIndex,
137
- overIndex,
138
- index
139
- } = _ref;
140
- const newRects = arrayMove(rects, overIndex, activeIndex);
141
- const oldRect = rects[index];
142
- const newRect = newRects[index];
143
- if (!newRect || !oldRect) {
144
- return null;
145
- }
146
- return {
147
- x: newRect.left - oldRect.left,
148
- y: newRect.top - oldRect.top,
149
- scaleX: newRect.width / oldRect.width,
150
- scaleY: newRect.height / oldRect.height
151
- };
152
- };
153
- var rectSwappingStrategy = (_ref) => {
154
- let {
155
- activeIndex,
156
- index,
157
- rects,
158
- overIndex
159
- } = _ref;
160
- let oldRect;
161
- let newRect;
162
- if (index === activeIndex) {
163
- oldRect = rects[index];
164
- newRect = rects[overIndex];
165
- }
166
- if (index === overIndex) {
167
- oldRect = rects[index];
168
- newRect = rects[activeIndex];
169
- }
170
- if (!newRect || !oldRect) {
171
- return null;
172
- }
173
- return {
174
- x: newRect.left - oldRect.left,
175
- y: newRect.top - oldRect.top,
176
- scaleX: newRect.width / oldRect.width,
177
- scaleY: newRect.height / oldRect.height
178
- };
179
- };
180
- var defaultScale$1 = {
181
- scaleX: 1,
182
- scaleY: 1
183
- };
184
- var verticalListSortingStrategy = (_ref) => {
185
- var _rects$activeIndex;
186
- let {
187
- activeIndex,
188
- activeNodeRect: fallbackActiveRect,
189
- index,
190
- rects,
191
- overIndex
192
- } = _ref;
193
- const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
194
- if (!activeNodeRect) {
195
- return null;
196
- }
197
- if (index === activeIndex) {
198
- const overIndexRect = rects[overIndex];
199
- if (!overIndexRect) {
200
- return null;
201
- }
202
- return {
203
- x: 0,
204
- y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
205
- ...defaultScale$1
206
- };
207
- }
208
- const itemGap = getItemGap$1(rects, index, activeIndex);
209
- if (index > activeIndex && index <= overIndex) {
210
- return {
211
- x: 0,
212
- y: -activeNodeRect.height - itemGap,
213
- ...defaultScale$1
214
- };
215
- }
216
- if (index < activeIndex && index >= overIndex) {
217
- return {
218
- x: 0,
219
- y: activeNodeRect.height + itemGap,
220
- ...defaultScale$1
221
- };
222
- }
223
- return {
224
- x: 0,
225
- y: 0,
226
- ...defaultScale$1
227
- };
228
- };
229
- function getItemGap$1(clientRects, index, activeIndex) {
230
- const currentRect = clientRects[index];
231
- const previousRect = clientRects[index - 1];
232
- const nextRect = clientRects[index + 1];
233
- if (!currentRect) {
234
- return 0;
235
- }
236
- if (activeIndex < index) {
237
- return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
238
- }
239
- return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
240
- }
241
- var ID_PREFIX = "Sortable";
242
- var Context = /* @__PURE__ */ React.createContext({
243
- activeIndex: -1,
244
- containerId: ID_PREFIX,
245
- disableTransforms: false,
246
- items: [],
247
- overIndex: -1,
248
- useDragOverlay: false,
249
- sortedRects: [],
250
- strategy: rectSortingStrategy,
251
- disabled: {
252
- draggable: false,
253
- droppable: false
254
- }
255
- });
256
- function SortableContext(_ref) {
257
- let {
258
- children,
259
- id,
260
- items: userDefinedItems,
261
- strategy = rectSortingStrategy,
262
- disabled: disabledProp = false
263
- } = _ref;
264
- const {
265
- active,
266
- dragOverlay,
267
- droppableRects,
268
- over,
269
- measureDroppableContainers
270
- } = useDndContext();
271
- const containerId = useUniqueId(ID_PREFIX, id);
272
- const useDragOverlay = Boolean(dragOverlay.rect !== null);
273
- const items = useMemo(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]);
274
- const isDragging = active != null;
275
- const activeIndex = active ? items.indexOf(active.id) : -1;
276
- const overIndex = over ? items.indexOf(over.id) : -1;
277
- const previousItemsRef = useRef(items);
278
- const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
279
- const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
280
- const disabled = normalizeDisabled(disabledProp);
281
- useIsomorphicLayoutEffect(() => {
282
- if (itemsHaveChanged && isDragging) {
283
- measureDroppableContainers(items);
284
- }
285
- }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
286
- useEffect(() => {
287
- previousItemsRef.current = items;
288
- }, [items]);
289
- const contextValue = useMemo(
290
- () => ({
291
- activeIndex,
292
- containerId,
293
- disabled,
294
- disableTransforms,
295
- items,
296
- overIndex,
297
- useDragOverlay,
298
- sortedRects: getSortedRects(items, droppableRects),
299
- strategy
300
- }),
301
- // eslint-disable-next-line react-hooks/exhaustive-deps
302
- [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]
303
- );
304
- return React.createElement(Context.Provider, {
305
- value: contextValue
306
- }, children);
307
- }
308
- var defaultNewIndexGetter = (_ref) => {
309
- let {
310
- id,
311
- items,
312
- activeIndex,
313
- overIndex
314
- } = _ref;
315
- return arrayMove(items, activeIndex, overIndex).indexOf(id);
316
- };
317
- var defaultAnimateLayoutChanges = (_ref2) => {
318
- let {
319
- containerId,
320
- isSorting,
321
- wasDragging,
322
- index,
323
- items,
324
- newIndex,
325
- previousItems,
326
- previousContainerId,
327
- transition
328
- } = _ref2;
329
- if (!transition || !wasDragging) {
330
- return false;
331
- }
332
- if (previousItems !== items && index === newIndex) {
333
- return false;
334
- }
335
- if (isSorting) {
336
- return true;
337
- }
338
- return newIndex !== index && containerId === previousContainerId;
339
- };
340
- var defaultTransition = {
341
- duration: 200,
342
- easing: "ease"
343
- };
344
- var transitionProperty = "transform";
345
- var disabledTransition = /* @__PURE__ */ CSS.Transition.toString({
346
- property: transitionProperty,
347
- duration: 0,
348
- easing: "linear"
349
- });
350
- var defaultAttributes = {
351
- roleDescription: "sortable"
352
- };
353
- function useDerivedTransform(_ref) {
354
- let {
355
- disabled,
356
- index,
357
- node,
358
- rect
359
- } = _ref;
360
- const [derivedTransform, setDerivedtransform] = useState(null);
361
- const previousIndex = useRef(index);
362
- useIsomorphicLayoutEffect(() => {
363
- if (!disabled && index !== previousIndex.current && node.current) {
364
- const initial = rect.current;
365
- if (initial) {
366
- const current = getClientRect(node.current, {
367
- ignoreTransform: true
368
- });
369
- const delta = {
370
- x: initial.left - current.left,
371
- y: initial.top - current.top,
372
- scaleX: initial.width / current.width,
373
- scaleY: initial.height / current.height
374
- };
375
- if (delta.x || delta.y) {
376
- setDerivedtransform(delta);
377
- }
378
- }
379
- }
380
- if (index !== previousIndex.current) {
381
- previousIndex.current = index;
382
- }
383
- }, [disabled, index, node, rect]);
384
- useEffect(() => {
385
- if (derivedTransform) {
386
- setDerivedtransform(null);
387
- }
388
- }, [derivedTransform]);
389
- return derivedTransform;
390
- }
391
- function useSortable(_ref) {
392
- let {
393
- animateLayoutChanges = defaultAnimateLayoutChanges,
394
- attributes: userDefinedAttributes,
395
- disabled: localDisabled,
396
- data: customData,
397
- getNewIndex = defaultNewIndexGetter,
398
- id,
399
- strategy: localStrategy,
400
- resizeObserverConfig,
401
- transition = defaultTransition
402
- } = _ref;
403
- const {
404
- items,
405
- containerId,
406
- activeIndex,
407
- disabled: globalDisabled,
408
- disableTransforms,
409
- sortedRects,
410
- overIndex,
411
- useDragOverlay,
412
- strategy: globalStrategy
413
- } = useContext(Context);
414
- const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
415
- const index = items.indexOf(id);
416
- const data = useMemo(() => ({
417
- sortable: {
418
- containerId,
419
- index,
420
- items
421
- },
422
- ...customData
423
- }), [containerId, customData, index, items]);
424
- const itemsAfterCurrentSortable = useMemo(() => items.slice(items.indexOf(id)), [items, id]);
425
- const {
426
- rect,
427
- node,
428
- isOver,
429
- setNodeRef: setDroppableNodeRef
430
- } = useDroppable({
431
- id,
432
- data,
433
- disabled: disabled.droppable,
434
- resizeObserverConfig: {
435
- updateMeasurementsFor: itemsAfterCurrentSortable,
436
- ...resizeObserverConfig
437
- }
438
- });
439
- const {
440
- active,
441
- activatorEvent,
442
- activeNodeRect,
443
- attributes,
444
- setNodeRef: setDraggableNodeRef,
445
- listeners,
446
- isDragging,
447
- over,
448
- setActivatorNodeRef,
449
- transform
450
- } = useDraggable({
451
- id,
452
- data,
453
- attributes: {
454
- ...defaultAttributes,
455
- ...userDefinedAttributes
456
- },
457
- disabled: disabled.draggable
458
- });
459
- const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
460
- const isSorting = Boolean(active);
461
- const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
462
- const shouldDisplaceDragSource = !useDragOverlay && isDragging;
463
- const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
464
- const strategy = localStrategy != null ? localStrategy : globalStrategy;
465
- const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
466
- rects: sortedRects,
467
- activeNodeRect,
468
- activeIndex,
469
- overIndex,
470
- index
471
- }) : null;
472
- const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
473
- id,
474
- items,
475
- activeIndex,
476
- overIndex
477
- }) : index;
478
- const activeId = active == null ? void 0 : active.id;
479
- const previous = useRef({
480
- activeId,
481
- items,
482
- newIndex,
483
- containerId
484
- });
485
- const itemsHaveChanged = items !== previous.current.items;
486
- const shouldAnimateLayoutChanges = animateLayoutChanges({
487
- active,
488
- containerId,
489
- isDragging,
490
- isSorting,
491
- id,
492
- index,
493
- items,
494
- newIndex: previous.current.newIndex,
495
- previousItems: previous.current.items,
496
- previousContainerId: previous.current.containerId,
497
- transition,
498
- wasDragging: previous.current.activeId != null
499
- });
500
- const derivedTransform = useDerivedTransform({
501
- disabled: !shouldAnimateLayoutChanges,
502
- index,
503
- node,
504
- rect
505
- });
506
- useEffect(() => {
507
- if (isSorting && previous.current.newIndex !== newIndex) {
508
- previous.current.newIndex = newIndex;
509
- }
510
- if (containerId !== previous.current.containerId) {
511
- previous.current.containerId = containerId;
512
- }
513
- if (items !== previous.current.items) {
514
- previous.current.items = items;
515
- }
516
- }, [isSorting, newIndex, containerId, items]);
517
- useEffect(() => {
518
- if (activeId === previous.current.activeId) {
519
- return;
520
- }
521
- if (activeId != null && previous.current.activeId == null) {
522
- previous.current.activeId = activeId;
523
- return;
524
- }
525
- const timeoutId = setTimeout(() => {
526
- previous.current.activeId = activeId;
527
- }, 50);
528
- return () => clearTimeout(timeoutId);
529
- }, [activeId]);
530
- return {
531
- active,
532
- activeIndex,
533
- attributes,
534
- data,
535
- rect,
536
- index,
537
- newIndex,
538
- items,
539
- isOver,
540
- isSorting,
541
- isDragging,
542
- listeners,
543
- node,
544
- overIndex,
545
- over,
546
- setNodeRef,
547
- setActivatorNodeRef,
548
- setDroppableNodeRef,
549
- setDraggableNodeRef,
550
- transform: derivedTransform != null ? derivedTransform : finalTransform,
551
- transition: getTransition()
552
- };
553
- function getTransition() {
554
- if (
555
- // Temporarily disable transitions for a single frame to set up derived transforms
556
- derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
557
- itemsHaveChanged && previous.current.newIndex === index
558
- ) {
559
- return disabledTransition;
560
- }
561
- if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {
562
- return void 0;
563
- }
564
- if (isSorting || shouldAnimateLayoutChanges) {
565
- return CSS.Transition.toString({
566
- ...transition,
567
- property: transitionProperty
568
- });
569
- }
570
- return void 0;
571
- }
572
- }
573
- function normalizeLocalDisabled(localDisabled, globalDisabled) {
574
- var _localDisabled$dragga, _localDisabled$droppa;
575
- if (typeof localDisabled === "boolean") {
576
- return {
577
- draggable: localDisabled,
578
- // Backwards compatibility
579
- droppable: false
580
- };
581
- }
582
- return {
583
- draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
584
- droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
585
- };
586
- }
587
- function hasSortableData(entry) {
588
- if (!entry) {
589
- return false;
590
- }
591
- const data = entry.data.current;
592
- if (data && "sortable" in data && typeof data.sortable === "object" && "containerId" in data.sortable && "items" in data.sortable && "index" in data.sortable) {
593
- return true;
594
- }
595
- return false;
596
- }
597
- var directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
598
- var sortableKeyboardCoordinates = (event, _ref) => {
599
- let {
600
- context: {
601
- active,
602
- collisionRect,
603
- droppableRects,
604
- droppableContainers,
605
- over,
606
- scrollableAncestors
607
- }
608
- } = _ref;
609
- if (directions.includes(event.code)) {
610
- event.preventDefault();
611
- if (!active || !collisionRect) {
612
- return;
613
- }
614
- const filteredContainers = [];
615
- droppableContainers.getEnabled().forEach((entry) => {
616
- if (!entry || entry != null && entry.disabled) {
617
- return;
618
- }
619
- const rect = droppableRects.get(entry.id);
620
- if (!rect) {
621
- return;
622
- }
623
- switch (event.code) {
624
- case KeyboardCode.Down:
625
- if (collisionRect.top < rect.top) {
626
- filteredContainers.push(entry);
627
- }
628
- break;
629
- case KeyboardCode.Up:
630
- if (collisionRect.top > rect.top) {
631
- filteredContainers.push(entry);
632
- }
633
- break;
634
- case KeyboardCode.Left:
635
- if (collisionRect.left > rect.left) {
636
- filteredContainers.push(entry);
637
- }
638
- break;
639
- case KeyboardCode.Right:
640
- if (collisionRect.left < rect.left) {
641
- filteredContainers.push(entry);
642
- }
643
- break;
644
- }
645
- });
646
- const collisions = closestCorners({
647
- active,
648
- collisionRect,
649
- droppableRects,
650
- droppableContainers: filteredContainers,
651
- pointerCoordinates: null
652
- });
653
- let closestId = getFirstCollision(collisions, "id");
654
- if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {
655
- closestId = collisions[1].id;
656
- }
657
- if (closestId != null) {
658
- const activeDroppable = droppableContainers.get(active.id);
659
- const newDroppable = droppableContainers.get(closestId);
660
- const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
661
- const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
662
- if (newNode && newRect && activeDroppable && newDroppable) {
663
- const newScrollAncestors = getScrollableAncestors(newNode);
664
- const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);
665
- const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
666
- const isAfterActive = isAfter(activeDroppable, newDroppable);
667
- const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
668
- x: 0,
669
- y: 0
670
- } : {
671
- x: isAfterActive ? collisionRect.width - newRect.width : 0,
672
- y: isAfterActive ? collisionRect.height - newRect.height : 0
673
- };
674
- const rectCoordinates = {
675
- x: newRect.left,
676
- y: newRect.top
677
- };
678
- const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);
679
- return newCoordinates;
680
- }
681
- }
682
- }
683
- return void 0;
684
- };
685
- function isSameContainer(a, b) {
686
- if (!hasSortableData(a) || !hasSortableData(b)) {
687
- return false;
688
- }
689
- return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
690
- }
691
- function isAfter(a, b) {
692
- if (!hasSortableData(a) || !hasSortableData(b)) {
693
- return false;
694
- }
695
- if (!isSameContainer(a, b)) {
696
- return false;
697
- }
698
- return a.data.current.sortable.index < b.data.current.sortable.index;
699
- }
700
-
701
- // shell/.ojm-shim-dnd-kit-sortable.mjs
702
- var ojm_shim_dnd_kit_sortable_default = void 0 ?? sortable_esm_exports;
703
- export {
704
- SortableContext,
705
- arrayMove,
706
- arraySwap,
707
- ojm_shim_dnd_kit_sortable_default as default,
708
- defaultAnimateLayoutChanges,
709
- defaultNewIndexGetter,
710
- hasSortableData,
711
- horizontalListSortingStrategy,
712
- rectSortingStrategy,
713
- rectSwappingStrategy,
714
- sortableKeyboardCoordinates,
715
- useSortable,
716
- verticalListSortingStrategy
717
- };