@spacecorexdev/core 0.0.5 → 0.2.0

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 (414) hide show
  1. package/dist/api/index.js +1 -0
  2. package/dist/contract.js +1 -0
  3. package/dist/hooks/index.js +1 -0
  4. package/dist/index.js +7 -0
  5. package/{src → dist}/styles/ant-table.css +5 -26
  6. package/{src → dist}/styles/index.css +8 -8
  7. package/dist/types/index.js +1 -0
  8. package/dist/ui/index.js +1 -0
  9. package/dist/utils/index.js +7 -0
  10. package/package.json +67 -70
  11. package/types/api/project.d.ts +10 -1
  12. package/types/index.d.ts +4 -4
  13. package/types/types/index.d.ts +1 -3
  14. package/types/types/project/base.d.ts +6 -1
  15. package/types/types/project/index.d.ts +1 -0
  16. package/types/types/project/member.d.ts +1 -1
  17. package/types/types/{projectRole.d.ts → project/projectRole.d.ts} +2 -2
  18. package/types/ui/ResizableTable/index.d.ts +7 -0
  19. package/types/ui/RoleSelector/index.d.ts +7 -1
  20. package/types/ui/UIFileUpload.d.ts +2 -2
  21. package/types/ui/index.d.ts +1 -10
  22. package/types/ui/upload/index.d.ts +6 -0
  23. package/types/utils/CacheIndexedDB.d.ts +9 -0
  24. package/types/utils/index.d.ts +2 -2
  25. package/types/utils/mailto.d.ts +12 -0
  26. package/public/cmaps/78-EUC-H.bcmap +0 -0
  27. package/public/cmaps/78-EUC-V.bcmap +0 -0
  28. package/public/cmaps/78-H.bcmap +0 -0
  29. package/public/cmaps/78-RKSJ-H.bcmap +0 -0
  30. package/public/cmaps/78-RKSJ-V.bcmap +0 -0
  31. package/public/cmaps/78-V.bcmap +0 -0
  32. package/public/cmaps/78ms-RKSJ-H.bcmap +0 -0
  33. package/public/cmaps/78ms-RKSJ-V.bcmap +0 -0
  34. package/public/cmaps/83pv-RKSJ-H.bcmap +0 -0
  35. package/public/cmaps/90ms-RKSJ-H.bcmap +0 -0
  36. package/public/cmaps/90ms-RKSJ-V.bcmap +0 -0
  37. package/public/cmaps/90msp-RKSJ-H.bcmap +0 -0
  38. package/public/cmaps/90msp-RKSJ-V.bcmap +0 -0
  39. package/public/cmaps/90pv-RKSJ-H.bcmap +0 -0
  40. package/public/cmaps/90pv-RKSJ-V.bcmap +0 -0
  41. package/public/cmaps/Add-H.bcmap +0 -0
  42. package/public/cmaps/Add-RKSJ-H.bcmap +0 -0
  43. package/public/cmaps/Add-RKSJ-V.bcmap +0 -0
  44. package/public/cmaps/Add-V.bcmap +0 -0
  45. package/public/cmaps/Adobe-CNS1-0.bcmap +0 -0
  46. package/public/cmaps/Adobe-CNS1-1.bcmap +0 -0
  47. package/public/cmaps/Adobe-CNS1-2.bcmap +0 -0
  48. package/public/cmaps/Adobe-CNS1-3.bcmap +0 -0
  49. package/public/cmaps/Adobe-CNS1-4.bcmap +0 -0
  50. package/public/cmaps/Adobe-CNS1-5.bcmap +0 -0
  51. package/public/cmaps/Adobe-CNS1-6.bcmap +0 -0
  52. package/public/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  53. package/public/cmaps/Adobe-GB1-0.bcmap +0 -0
  54. package/public/cmaps/Adobe-GB1-1.bcmap +0 -0
  55. package/public/cmaps/Adobe-GB1-2.bcmap +0 -0
  56. package/public/cmaps/Adobe-GB1-3.bcmap +0 -0
  57. package/public/cmaps/Adobe-GB1-4.bcmap +0 -0
  58. package/public/cmaps/Adobe-GB1-5.bcmap +0 -0
  59. package/public/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  60. package/public/cmaps/Adobe-Japan1-0.bcmap +0 -0
  61. package/public/cmaps/Adobe-Japan1-1.bcmap +0 -0
  62. package/public/cmaps/Adobe-Japan1-2.bcmap +0 -0
  63. package/public/cmaps/Adobe-Japan1-3.bcmap +0 -0
  64. package/public/cmaps/Adobe-Japan1-4.bcmap +0 -0
  65. package/public/cmaps/Adobe-Japan1-5.bcmap +0 -0
  66. package/public/cmaps/Adobe-Japan1-6.bcmap +0 -0
  67. package/public/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  68. package/public/cmaps/Adobe-Korea1-0.bcmap +0 -0
  69. package/public/cmaps/Adobe-Korea1-1.bcmap +0 -0
  70. package/public/cmaps/Adobe-Korea1-2.bcmap +0 -0
  71. package/public/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  72. package/public/cmaps/B5-H.bcmap +0 -0
  73. package/public/cmaps/B5-V.bcmap +0 -0
  74. package/public/cmaps/B5pc-H.bcmap +0 -0
  75. package/public/cmaps/B5pc-V.bcmap +0 -0
  76. package/public/cmaps/CNS-EUC-H.bcmap +0 -0
  77. package/public/cmaps/CNS-EUC-V.bcmap +0 -0
  78. package/public/cmaps/CNS1-H.bcmap +0 -0
  79. package/public/cmaps/CNS1-V.bcmap +0 -0
  80. package/public/cmaps/CNS2-H.bcmap +0 -0
  81. package/public/cmaps/CNS2-V.bcmap +0 -3
  82. package/public/cmaps/ETHK-B5-H.bcmap +0 -0
  83. package/public/cmaps/ETHK-B5-V.bcmap +0 -0
  84. package/public/cmaps/ETen-B5-H.bcmap +0 -0
  85. package/public/cmaps/ETen-B5-V.bcmap +0 -0
  86. package/public/cmaps/ETenms-B5-H.bcmap +0 -3
  87. package/public/cmaps/ETenms-B5-V.bcmap +0 -0
  88. package/public/cmaps/EUC-H.bcmap +0 -0
  89. package/public/cmaps/EUC-V.bcmap +0 -0
  90. package/public/cmaps/Ext-H.bcmap +0 -0
  91. package/public/cmaps/Ext-RKSJ-H.bcmap +0 -0
  92. package/public/cmaps/Ext-RKSJ-V.bcmap +0 -0
  93. package/public/cmaps/Ext-V.bcmap +0 -0
  94. package/public/cmaps/GB-EUC-H.bcmap +0 -0
  95. package/public/cmaps/GB-EUC-V.bcmap +0 -0
  96. package/public/cmaps/GB-H.bcmap +0 -4
  97. package/public/cmaps/GB-V.bcmap +0 -0
  98. package/public/cmaps/GBK-EUC-H.bcmap +0 -0
  99. package/public/cmaps/GBK-EUC-V.bcmap +0 -0
  100. package/public/cmaps/GBK2K-H.bcmap +0 -0
  101. package/public/cmaps/GBK2K-V.bcmap +0 -0
  102. package/public/cmaps/GBKp-EUC-H.bcmap +0 -0
  103. package/public/cmaps/GBKp-EUC-V.bcmap +0 -0
  104. package/public/cmaps/GBT-EUC-H.bcmap +0 -0
  105. package/public/cmaps/GBT-EUC-V.bcmap +0 -0
  106. package/public/cmaps/GBT-H.bcmap +0 -0
  107. package/public/cmaps/GBT-V.bcmap +0 -0
  108. package/public/cmaps/GBTpc-EUC-H.bcmap +0 -0
  109. package/public/cmaps/GBTpc-EUC-V.bcmap +0 -0
  110. package/public/cmaps/GBpc-EUC-H.bcmap +0 -0
  111. package/public/cmaps/GBpc-EUC-V.bcmap +0 -0
  112. package/public/cmaps/H.bcmap +0 -0
  113. package/public/cmaps/HKdla-B5-H.bcmap +0 -0
  114. package/public/cmaps/HKdla-B5-V.bcmap +0 -0
  115. package/public/cmaps/HKdlb-B5-H.bcmap +0 -0
  116. package/public/cmaps/HKdlb-B5-V.bcmap +0 -0
  117. package/public/cmaps/HKgccs-B5-H.bcmap +0 -0
  118. package/public/cmaps/HKgccs-B5-V.bcmap +0 -0
  119. package/public/cmaps/HKm314-B5-H.bcmap +0 -0
  120. package/public/cmaps/HKm314-B5-V.bcmap +0 -0
  121. package/public/cmaps/HKm471-B5-H.bcmap +0 -0
  122. package/public/cmaps/HKm471-B5-V.bcmap +0 -0
  123. package/public/cmaps/HKscs-B5-H.bcmap +0 -0
  124. package/public/cmaps/HKscs-B5-V.bcmap +0 -0
  125. package/public/cmaps/Hankaku.bcmap +0 -0
  126. package/public/cmaps/Hiragana.bcmap +0 -0
  127. package/public/cmaps/KSC-EUC-H.bcmap +0 -0
  128. package/public/cmaps/KSC-EUC-V.bcmap +0 -0
  129. package/public/cmaps/KSC-H.bcmap +0 -0
  130. package/public/cmaps/KSC-Johab-H.bcmap +0 -0
  131. package/public/cmaps/KSC-Johab-V.bcmap +0 -0
  132. package/public/cmaps/KSC-V.bcmap +0 -0
  133. package/public/cmaps/KSCms-UHC-H.bcmap +0 -0
  134. package/public/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  135. package/public/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  136. package/public/cmaps/KSCms-UHC-V.bcmap +0 -0
  137. package/public/cmaps/KSCpc-EUC-H.bcmap +0 -0
  138. package/public/cmaps/KSCpc-EUC-V.bcmap +0 -0
  139. package/public/cmaps/Katakana.bcmap +0 -0
  140. package/public/cmaps/LICENSE +0 -36
  141. package/public/cmaps/NWP-H.bcmap +0 -0
  142. package/public/cmaps/NWP-V.bcmap +0 -0
  143. package/public/cmaps/RKSJ-H.bcmap +0 -0
  144. package/public/cmaps/RKSJ-V.bcmap +0 -0
  145. package/public/cmaps/Roman.bcmap +0 -0
  146. package/public/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  147. package/public/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  148. package/public/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  149. package/public/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  150. package/public/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  151. package/public/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  152. package/public/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  153. package/public/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  154. package/public/cmaps/UniGB-UCS2-H.bcmap +0 -0
  155. package/public/cmaps/UniGB-UCS2-V.bcmap +0 -0
  156. package/public/cmaps/UniGB-UTF16-H.bcmap +0 -0
  157. package/public/cmaps/UniGB-UTF16-V.bcmap +0 -0
  158. package/public/cmaps/UniGB-UTF32-H.bcmap +0 -0
  159. package/public/cmaps/UniGB-UTF32-V.bcmap +0 -0
  160. package/public/cmaps/UniGB-UTF8-H.bcmap +0 -0
  161. package/public/cmaps/UniGB-UTF8-V.bcmap +0 -0
  162. package/public/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  163. package/public/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  164. package/public/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  165. package/public/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  166. package/public/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  167. package/public/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  168. package/public/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  169. package/public/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  170. package/public/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  171. package/public/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  172. package/public/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  173. package/public/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  174. package/public/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  175. package/public/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  176. package/public/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  177. package/public/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  178. package/public/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  179. package/public/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  180. package/public/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  181. package/public/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  182. package/public/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  183. package/public/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  184. package/public/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  185. package/public/cmaps/UniKS-UCS2-H.bcmap +0 -0
  186. package/public/cmaps/UniKS-UCS2-V.bcmap +0 -0
  187. package/public/cmaps/UniKS-UTF16-H.bcmap +0 -0
  188. package/public/cmaps/UniKS-UTF16-V.bcmap +0 -0
  189. package/public/cmaps/UniKS-UTF32-H.bcmap +0 -0
  190. package/public/cmaps/UniKS-UTF32-V.bcmap +0 -0
  191. package/public/cmaps/UniKS-UTF8-H.bcmap +0 -0
  192. package/public/cmaps/UniKS-UTF8-V.bcmap +0 -0
  193. package/public/cmaps/V.bcmap +0 -0
  194. package/public/cmaps/WP-Symbol.bcmap +0 -0
  195. package/public/polyfills/polyfills.js +0 -802
  196. package/public/vendor/docx/docx.worker.js +0 -5
  197. package/public/vendor/docx/jszip.min.js +0 -13
  198. package/public/vendor/libarchive/libarchive.wasm +0 -0
  199. package/public/vendor/libarchive/worker-bundle.js +0 -6
  200. package/public/vendor/pptx/pptx.worker.js +0 -26
  201. package/public/wasm/cad/0.8.2/dwfv-render.wasm +0 -0
  202. package/public/wasm/cad/0.8.2/dwg-worker.js +0 -24
  203. package/public/wasm/cad/0.8.2/dwg-worker.js.map +0 -1
  204. package/public/wasm/cad/0.8.2/libredwg-web.js +0 -2
  205. package/public/wasm/cad/0.8.2/libredwg-web.wasm +0 -0
  206. package/public/wasm/cad/dwfv-render.wasm +0 -0
  207. package/public/wasm/cad/dwg-worker.js +0 -24
  208. package/public/wasm/cad/dwg-worker.js.map +0 -1
  209. package/public/wasm/cad/libredwg-web.js +0 -2
  210. package/public/wasm/cad/libredwg-web.wasm +0 -0
  211. package/public/wasm/data/sql-wasm.wasm +0 -0
  212. package/public/wasm/hdiff.wasm +0 -0
  213. package/public/wasm/model/LICENSE.occt-import-js.txt +0 -504
  214. package/public/wasm/model/LICENSE.occt.txt +0 -502
  215. package/public/wasm/model/occt-import-js.js +0 -19
  216. package/public/wasm/model/occt-import-js.wasm +0 -0
  217. package/public/wasm/model/occt-worker.js +0 -83
  218. package/public/wasm/typst/fonts/DejaVuSansMono-Bold.ttf +0 -0
  219. package/public/wasm/typst/fonts/DejaVuSansMono-BoldOblique.ttf +0 -0
  220. package/public/wasm/typst/fonts/DejaVuSansMono-Oblique.ttf +0 -0
  221. package/public/wasm/typst/fonts/DejaVuSansMono.ttf +0 -0
  222. package/public/wasm/typst/fonts/LibertinusSerif-Bold.otf +0 -0
  223. package/public/wasm/typst/fonts/LibertinusSerif-BoldItalic.otf +0 -0
  224. package/public/wasm/typst/fonts/LibertinusSerif-Italic.otf +0 -0
  225. package/public/wasm/typst/fonts/LibertinusSerif-Regular.otf +0 -0
  226. package/public/wasm/typst/fonts/LibertinusSerif-Semibold.otf +0 -0
  227. package/public/wasm/typst/fonts/LibertinusSerif-SemiboldItalic.otf +0 -0
  228. package/public/wasm/typst/fonts/NewCM10-Bold.otf +0 -0
  229. package/public/wasm/typst/fonts/NewCM10-BoldItalic.otf +0 -0
  230. package/public/wasm/typst/fonts/NewCM10-Italic.otf +0 -0
  231. package/public/wasm/typst/fonts/NewCM10-Regular.otf +0 -0
  232. package/public/wasm/typst/fonts/NewCMMath-Bold.otf +0 -0
  233. package/public/wasm/typst/fonts/NewCMMath-Book.otf +0 -0
  234. package/public/wasm/typst/fonts/NewCMMath-Regular.otf +0 -0
  235. package/public/wasm/typst/fonts/README.md +0 -7
  236. package/public/wasm/typst/typst_ts_renderer_bg.wasm +0 -0
  237. package/public/wasm/typst/typst_ts_web_compiler_bg.wasm +0 -0
  238. package/scripts/patch-docx-grid.cjs +0 -412
  239. package/src/api/_base.ts +0 -243
  240. package/src/api/index.ts +0 -17
  241. package/src/api/project.ts +0 -1345
  242. package/src/api/user.ts +0 -1174
  243. package/src/contract.ts +0 -50
  244. package/src/hooks/index.ts +0 -2
  245. package/src/hooks/useLongPress.ts +0 -137
  246. package/src/hooks/useOnlineStatus.ts +0 -22
  247. package/src/index.ts +0 -14
  248. package/src/types/id.ts +0 -2
  249. package/src/types/index.ts +0 -5
  250. package/src/types/project/base.ts +0 -63
  251. package/src/types/project/contract.ts +0 -79
  252. package/src/types/project/contractStatus.tsx +0 -15
  253. package/src/types/project/index.ts +0 -5
  254. package/src/types/project/member.ts +0 -46
  255. package/src/types/project/progress.ts +0 -43
  256. package/src/types/projectRole.ts +0 -17
  257. package/src/types/theme.ts +0 -1
  258. package/src/types/user/index.ts +0 -1
  259. package/src/types/user/role.ts +0 -7
  260. package/src/ui/CommentTimeline/index.tsx +0 -330
  261. package/src/ui/FileManager/FileContextMenu.tsx +0 -628
  262. package/src/ui/FileManager/FileGridView.tsx +0 -529
  263. package/src/ui/FileManager/FileTableView.tsx +0 -405
  264. package/src/ui/FileManager/FileToolbar.tsx +0 -119
  265. package/src/ui/FileManager/FileVersionHistoryModal.tsx +0 -175
  266. package/src/ui/FileManager/MoveCopyToProjectModal.tsx +0 -119
  267. package/src/ui/FileManager/ShareToWechatModal.tsx +0 -419
  268. package/src/ui/FileManager/hooks/useFileManagerActions.ts +0 -2532
  269. package/src/ui/FileManager/hooks/useFileManagerState.ts +0 -419
  270. package/src/ui/FileManager/index.tsx +0 -580
  271. package/src/ui/FileManager/projectFileManagerApi.ts +0 -57
  272. package/src/ui/FileManager/types.ts +0 -184
  273. package/src/ui/FileManager/utils/fileDeltaWorker.ts +0 -193
  274. package/src/ui/FileManager/utils/fileTree.ts +0 -178
  275. package/src/ui/FileManager/utils/fileUpload.ts +0 -714
  276. package/src/ui/FileManager/utils/fileUtils.ts +0 -65
  277. package/src/ui/InvoiceRecordsList/index.tsx +0 -813
  278. package/src/ui/MyFileSelectorModal.tsx +0 -261
  279. package/src/ui/ProjectSelector/index.tsx +0 -472
  280. package/src/ui/ProjectSelector/projectCache.ts +0 -40
  281. package/src/ui/RoleSelector/index.tsx +0 -473
  282. package/src/ui/RoleSelector/roleCache.ts +0 -40
  283. package/src/ui/UIAlert.tsx +0 -399
  284. package/src/ui/UIAlertExample.tsx +0 -129
  285. package/src/ui/UIConfirm.tsx +0 -335
  286. package/src/ui/UIConfirmExample.tsx +0 -165
  287. package/src/ui/UIDatePicker.tsx +0 -146
  288. package/src/ui/UIDateRangePicker.tsx +0 -38
  289. package/src/ui/UIFilePreview/ExcelEditor/index.tsx +0 -617
  290. package/src/ui/UIFilePreview/ExcelEditor/types.ts +0 -24
  291. package/src/ui/UIFilePreview/ExportDropdown.css +0 -85
  292. package/src/ui/UIFilePreview/ExportDropdown.tsx +0 -109
  293. package/src/ui/UIFilePreview/IndexedDBUtils.ts +0 -564
  294. package/src/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.ts +0 -576
  295. package/src/ui/UIFilePreview/MarkdownEditor/index.tsx +0 -677
  296. package/src/ui/UIFilePreview/MarkdownEditor/markdownEditor.css +0 -1005
  297. package/src/ui/UIFilePreview/MarkdownEditor/types.ts +0 -15
  298. package/src/ui/UIFilePreview/PPTXEditor/index.tsx +0 -602
  299. package/src/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.ts +0 -77
  300. package/src/ui/UIFilePreview/RichDocEditor/exportRDocPdf.ts +0 -374
  301. package/src/ui/UIFilePreview/RichDocEditor/index.tsx +0 -730
  302. package/src/ui/UIFilePreview/RichDocEditor/richdoc-editor.css +0 -59
  303. package/src/ui/UIFilePreview/UIFilePreview.tsx +0 -611
  304. package/src/ui/UIFilePreview/WordEditor/index.tsx +0 -3933
  305. package/src/ui/UIFilePreview/WordEditor/style.ts +0 -1213
  306. package/src/ui/UIFilePreview/WordEditor/word-editor.css +0 -999
  307. package/src/ui/UIFilePreview/filePreview.css +0 -193
  308. package/src/ui/UIFilePreview/filetypes/archive.tsx +0 -66
  309. package/src/ui/UIFilePreview/filetypes/cad.tsx +0 -287
  310. package/src/ui/UIFilePreview/filetypes/excel.tsx +0 -355
  311. package/src/ui/UIFilePreview/filetypes/image.tsx +0 -20
  312. package/src/ui/UIFilePreview/filetypes/imageLoader.ts +0 -63
  313. package/src/ui/UIFilePreview/filetypes/pdf.tsx +0 -156
  314. package/src/ui/UIFilePreview/filetypes/ppt.tsx +0 -535
  315. package/src/ui/UIFilePreview/filetypes/pptExportPdf.ts +0 -523
  316. package/src/ui/UIFilePreview/filetypes/video.tsx +0 -482
  317. package/src/ui/UIFilePreview/filetypes/word.tsx +0 -245
  318. package/src/ui/UIFilePreview/filetypes/wordExportMarkdown.ts +0 -86
  319. package/src/ui/UIFilePreview/filetypes/wordExportPdf.tsx +0 -427
  320. package/src/ui/UIFilePreview/index.ts +0 -35
  321. package/src/ui/UIFilePreview/pdfPagination.ts +0 -143
  322. package/src/ui/UIFilePreview/previewUtils.tsx +0 -531
  323. package/src/ui/UIFileUpload.tsx +0 -382
  324. package/src/ui/UIImageUpload.tsx +0 -195
  325. package/src/ui/UILoading.tsx +0 -255
  326. package/src/ui/UILoadingExample.tsx +0 -139
  327. package/src/ui/UISelect.tsx +0 -105
  328. package/src/ui/UIToast.tsx +0 -381
  329. package/src/ui/UIToastExample.tsx +0 -69
  330. package/src/ui/UIToastSingle.tsx +0 -279
  331. package/src/ui/UIViewToggle.tsx +0 -64
  332. package/src/ui/UserSelector/index.tsx +0 -583
  333. package/src/ui/index.ts +0 -84
  334. package/src/ui/upload/image.ts +0 -135
  335. package/src/ui/upload/index.ts +0 -73
  336. package/src/ui/upload/submitFile.ts +0 -106
  337. package/src/ui/upload/submitForm.ts +0 -124
  338. package/src/ui/upload/upload.err.ts +0 -15
  339. package/src/ui/upload/upload.ts +0 -250
  340. package/src/utils/CacheDepartmentInfo.ts +0 -372
  341. package/src/utils/CacheFileContent.ts +0 -315
  342. package/src/utils/CachePermissionInfo.ts +0 -235
  343. package/src/utils/CacheRoleInfo.ts +0 -303
  344. package/src/utils/CacheUserInfo.ts +0 -818
  345. package/src/utils/CacheViewToggleInfo.ts +0 -182
  346. package/src/utils/MessageContentUtils.ts +0 -268
  347. package/src/utils/clipboard.ts +0 -70
  348. package/src/utils/companyEmail.ts +0 -19
  349. package/src/utils/forbidDebugger.ts +0 -59
  350. package/src/utils/formatters.ts +0 -94
  351. package/src/utils/htmlUtils.tsx +0 -59
  352. package/src/utils/index.ts +0 -18
  353. package/src/utils/keyboard.ts +0 -114
  354. package/src/utils/mammothApi.ts +0 -16
  355. package/src/utils/polyfills.ts +0 -928
  356. package/src/utils/regex.ts +0 -14
  357. package/src/utils/storage.ts +0 -95
  358. package/src/utils/workerBootstrap.ts +0 -87
  359. package/types/hooks.d.ts +0 -5
  360. package/types/types/user/index.d.ts +0 -1
  361. package/types/types/user/role.d.ts +0 -7
  362. package/types/ui/FileManager/FileContextMenu.d.ts +0 -50
  363. package/types/ui/FileManager/FileGridView.d.ts +0 -51
  364. package/types/ui/FileManager/FileTableView.d.ts +0 -49
  365. package/types/ui/FileManager/FileToolbar.d.ts +0 -16
  366. package/types/ui/FileManager/FileVersionHistoryModal.d.ts +0 -9
  367. package/types/ui/FileManager/MoveCopyToProjectModal.d.ts +0 -17
  368. package/types/ui/FileManager/ShareToWechatModal.d.ts +0 -10
  369. package/types/ui/FileManager/hooks/useFileManagerActions.d.ts +0 -143
  370. package/types/ui/FileManager/hooks/useFileManagerState.d.ts +0 -146
  371. package/types/ui/FileManager/index.d.ts +0 -16
  372. package/types/ui/FileManager/projectFileManagerApi.d.ts +0 -6
  373. package/types/ui/FileManager/types.d.ts +0 -178
  374. package/types/ui/FileManager/utils/fileDeltaWorker.d.ts +0 -14
  375. package/types/ui/FileManager/utils/fileTree.d.ts +0 -7
  376. package/types/ui/FileManager/utils/fileUpload.d.ts +0 -60
  377. package/types/ui/FileManager/utils/fileUtils.d.ts +0 -26
  378. package/types/ui/InvoiceRecordsList/index.d.ts +0 -43
  379. package/types/ui/MyFileSelectorModal.d.ts +0 -16
  380. package/types/ui/UIFilePreview/ExcelEditor/index.d.ts +0 -20
  381. package/types/ui/UIFilePreview/ExcelEditor/types.d.ts +0 -29
  382. package/types/ui/UIFilePreview/ExportDropdown.d.ts +0 -26
  383. package/types/ui/UIFilePreview/IndexedDBUtils.d.ts +0 -109
  384. package/types/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.d.ts +0 -27
  385. package/types/ui/UIFilePreview/MarkdownEditor/index.d.ts +0 -34
  386. package/types/ui/UIFilePreview/MarkdownEditor/types.d.ts +0 -14
  387. package/types/ui/UIFilePreview/PPTXEditor/index.d.ts +0 -19
  388. package/types/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.d.ts +0 -23
  389. package/types/ui/UIFilePreview/RichDocEditor/exportRDocPdf.d.ts +0 -22
  390. package/types/ui/UIFilePreview/RichDocEditor/index.d.ts +0 -39
  391. package/types/ui/UIFilePreview/UIFilePreview.d.ts +0 -34
  392. package/types/ui/UIFilePreview/WordEditor/index.d.ts +0 -20
  393. package/types/ui/UIFilePreview/WordEditor/style.d.ts +0 -81
  394. package/types/ui/UIFilePreview/filetypes/archive.d.ts +0 -6
  395. package/types/ui/UIFilePreview/filetypes/cad.d.ts +0 -5
  396. package/types/ui/UIFilePreview/filetypes/excel.d.ts +0 -6
  397. package/types/ui/UIFilePreview/filetypes/image.d.ts +0 -6
  398. package/types/ui/UIFilePreview/filetypes/imageLoader.d.ts +0 -7
  399. package/types/ui/UIFilePreview/filetypes/pdf.d.ts +0 -7
  400. package/types/ui/UIFilePreview/filetypes/ppt.d.ts +0 -5
  401. package/types/ui/UIFilePreview/filetypes/pptExportPdf.d.ts +0 -28
  402. package/types/ui/UIFilePreview/filetypes/video.d.ts +0 -6
  403. package/types/ui/UIFilePreview/filetypes/word.d.ts +0 -5
  404. package/types/ui/UIFilePreview/filetypes/wordExportMarkdown.d.ts +0 -19
  405. package/types/ui/UIFilePreview/filetypes/wordExportPdf.d.ts +0 -32
  406. package/types/ui/UIFilePreview/index.d.ts +0 -46
  407. package/types/ui/UIFilePreview/pdfPagination.d.ts +0 -25
  408. package/types/ui/UIFilePreview/previewUtils.d.ts +0 -62
  409. package/types/ui.d.ts +0 -5
  410. package/types/utils/CacheFileContent.d.ts +0 -31
  411. package/types/utils/mammothApi.d.ts +0 -14
  412. package/types/utils.d.ts +0 -5
  413. /package/{src → dist}/styles/ant-modal.css +0 -0
  414. /package/{src → dist}/styles/ant-spin.css +0 -0
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Copyright (c) 2025 SPACECORE Co.,Ltd. All Rights Reserved.
5
- * Author: brian.li
6
- * Date: 2025-04-10 16:59
7
- * Desc:
8
- */
9
-
10
-
11
- /**
12
- * 货币正则式
13
- */
14
- export const regexCurrency = /^(0|[1-9](\d+)?(\.\d\d?)?)$/;
@@ -1,95 +0,0 @@
1
- import * as febs from 'febs-browser'
2
- import store, { StoreAPI } from 'store2'
3
-
4
- class Store {
5
- s: StoreAPI
6
-
7
- constructor(s: StoreAPI) {
8
- this.s = s
9
- }
10
-
11
- /**
12
- * @descs: 数据条数.
13
- */
14
- get length() {
15
- return this.s.size()
16
- }
17
-
18
- /**
19
- * @descs: 所有的key.
20
- */
21
- keys() {
22
- return this.s.keys()
23
- }
24
-
25
- /**
26
- * @descs: 设置信息.
27
- */
28
- set(key: string, data: any) {
29
- if (!data) {
30
- return this.remove(key)
31
- }
32
-
33
- data = JSON.stringify(data);
34
- data = febs.crypt.base64_encode(data)
35
-
36
- this.s.set(key, data, true)
37
- return this
38
- }
39
-
40
- /**
41
- * @descs: 获取信息.
42
- * @param alt: 如果获取不到信息, 使用此数据返回.
43
- */
44
- get(key: string, alt: any = null) {
45
- // let r = this.s.get(key, alt)
46
- if (!this.s.has(key)) {
47
- return alt
48
- }
49
- let r = this.s.get(key)
50
- if (r) {
51
- r = febs.crypt.base64_decode(r)
52
- r = febs.string.bytesToUtf8(r || [])
53
-
54
- try {
55
- return JSON.parse(r);
56
- } catch (e) {
57
- this.remove(key);
58
- return null;
59
- }
60
- }
61
- return r
62
- }
63
-
64
- /**
65
- * @descs: 移除信息.
66
- */
67
- remove(key: any) {
68
- this.s.remove(key)
69
- return this
70
- }
71
-
72
- /**
73
- * @descs: 清空.
74
- */
75
- clear() {
76
- this.s.clearAll()
77
- return this
78
- }
79
- }
80
-
81
- export const storage = {
82
- /**
83
- * @descs: 通用命名空间获取一个新的store.
84
- */
85
- namespace: function(nm?: string) {
86
- return new Store(store.namespace(nm||"default"))
87
- },
88
-
89
- /**
90
- * @descs: 使用session方式存储.
91
- */
92
- namespace_session: function(nm?: string) {
93
- return new Store(store.session.namespace(nm||"default"))
94
- },
95
- }
@@ -1,87 +0,0 @@
1
- /**
2
- * 为 FileViewer 等模块使用的第三方 Worker 注入 polyfill 前置 bootstrap。
3
- * 约束:不修改 vite.config.ts,不直接修改 public/wasm|vendor 下的静态 worker 文件(它们由构建产物或第三方库直接产出)。
4
- *
5
- * 原理:
6
- * 经典脚本 Worker 支持 `importScripts()` 同步加载;
7
- * 这里用 Blob + URL.createObjectURL 生成一个“bootstrap worker URL”,
8
- * 其内先执行 `importScripts('/polyfills/polyfills.js')` 为旧 Safari / 旧 WebView
9
- * 补齐 Promise.allSettled / ReadableByteStreamController / Web Streams 等缺失能力,
10
- * 然后再 importScripts 真实 worker 脚本,从而保证 worker 全局代码(如 dwg-worker.js 顶部的 Vt 辅助函数)
11
- * 调用这些 API 时,polyfill 已经安装在 worker 独立的 self 作用域上。
12
- */
13
-
14
- // 使用页面 origin 的绝对 URL,避免 blob worker 内 importScripts 对根相对路径解析失败
15
- const POLYFILLS_URL = (typeof window !== 'undefined' ? window.location.origin : '') + '/polyfills/polyfills.js';
16
-
17
- /** 对每一个真实 worker URL 生成的 bootstrap object URL 缓存;模块生命周期内复用,避免重复 Blob。 */
18
- const wrappedUrlCache = new Map<string, string>();
19
-
20
- /** module worker 版本的 bootstrap object URL 缓存。 */
21
- const wrappedModuleUrlCache = new Map<string, string>();
22
-
23
- /**
24
- * 生成包装过的 worker 启动 URL:先加载 polyfills,再加载目标 worker。
25
- * 同一 realWorkerUrl 多次调用会返回同一个 object URL(可安全地放在 useMemo 依赖为空的闭包中使用)。
26
- */
27
- /** 将根相对或相对路径解析为基于页面 origin 的绝对 URL,供 blob worker 内 importScripts 使用 */
28
- function resolveAbsoluteUrl(url: string): string {
29
- if (/^https?:\/\//i.test(url) || url.startsWith('blob:')) {
30
- return url;
31
- }
32
- const origin = typeof window !== 'undefined' ? window.location.origin : '';
33
- if (url.startsWith('/')) {
34
- return origin + url;
35
- }
36
- return origin + '/' + url;
37
- }
38
-
39
- export function withPolyfillWorkerBootstrap(realWorkerUrl: string): string {
40
- const cached = wrappedUrlCache.get(realWorkerUrl);
41
- if (cached) return cached;
42
-
43
- const absoluteRealWorkerUrl = resolveAbsoluteUrl(realWorkerUrl);
44
-
45
- // 仅使用经典脚本语法;内容分两段:1) polyfills 2) 真实 worker
46
- // importScripts 失败时(例如 http 错误)浏览器会抛出 NetworkError,这里不额外捕获,让浏览器保持原错误语义。
47
- const bootstrapSource =
48
- `/* auto-generated bootstrap: polyfills first, then real worker (${absoluteRealWorkerUrl}) */\n` +
49
- `try { self.importScripts(${JSON.stringify(POLYFILLS_URL)}); } catch (e) { console.error('[worker-bootstrap] polyfills load failed:', e); }\n` +
50
- `self.importScripts(${JSON.stringify(absoluteRealWorkerUrl)});\n`;
51
-
52
- const blob = new Blob([bootstrapSource], { type: 'text/javascript' });
53
- const objectUrl = URL.createObjectURL(blob);
54
- wrappedUrlCache.set(realWorkerUrl, objectUrl);
55
- return objectUrl;
56
- }
57
-
58
- /**
59
- * 生成【module worker】版本的启动 URL。
60
- *
61
- * 部分第三方库固定以 new Worker(url, { type: 'module' }) 启动 worker(如新版
62
- * @flyfish-dev/cad-viewer 的 DWG 解析 worker),模块 worker 中不存在 importScripts,
63
- * classic 版 bootstrap 会直接抛 “Module scripts don't support importScripts()”。
64
- *
65
- * 这里改用 ESM 静态 import:ES 模块按 import 声明顺序求值,polyfills 先于真实 worker 执行。
66
- * 适用前提(DWG worker 均满足):
67
- * 1) 真实 worker 脚本不含 import/export 语法、且只通过 self 挂消息钩子——
68
- * 作为无导出的 side-effect 模块求值时,行为与 classic 脚本一致;
69
- * 2) polyfills.js 是显式写 self/globalThis 的 IIFE,side-effect import 同样完成安装。
70
- * blob module worker 以页面为 origin,可正常 import 同源绝对 URL 的脚本。
71
- */
72
- export function withPolyfillModuleWorkerBootstrap(realWorkerUrl: string): string {
73
- const cached = wrappedModuleUrlCache.get(realWorkerUrl);
74
- if (cached) return cached;
75
-
76
- const absoluteRealWorkerUrl = resolveAbsoluteUrl(realWorkerUrl);
77
-
78
- const bootstrapSource =
79
- `/* auto-generated module bootstrap: polyfills first, then real worker (${absoluteRealWorkerUrl}) */\n` +
80
- `import ${JSON.stringify(POLYFILLS_URL)};\n` +
81
- `import ${JSON.stringify(absoluteRealWorkerUrl)};\n`;
82
-
83
- const blob = new Blob([bootstrapSource], { type: 'text/javascript' });
84
- const objectUrl = URL.createObjectURL(blob);
85
- wrappedModuleUrlCache.set(realWorkerUrl, objectUrl);
86
- return objectUrl;
87
- }
package/types/hooks.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * @spacecorex/core/hooks 的对外类型声明入口。
3
- * 具体声明由 `tsc -p tsconfig.decl.json` 从 src 生成,产物位于 ./hooks 目录。
4
- */
5
- export * from './hooks/index';
@@ -1 +0,0 @@
1
- export * from './role';
@@ -1,7 +0,0 @@
1
- /** 系统角色。 */
2
- export interface Role {
3
- /** 角色唯一标识。 */
4
- id: string;
5
- /** 角色名称。 */
6
- name: string;
7
- }
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import { ProjectFile } from './types';
3
- interface FileContextMenuProps {
4
- record: ProjectFile;
5
- onPreview: (file: ProjectFile) => void;
6
- onDownload: (file: ProjectFile) => void;
7
- /** 下载文件夹回调(仅管理员/负责人提供;不提供时隐藏「下载文件夹」) */
8
- onDownloadFolder?: (file: ProjectFile) => void;
9
- /** 复制链接回调(未提供时不显示「复制链接」) */
10
- onCopyLink?: (file: ProjectFile) => void;
11
- onRename: (file: ProjectFile) => void;
12
- onEditDescs: (file: ProjectFile) => void;
13
- onDelete: (fileId: string) => void;
14
- onEdit?: (file: ProjectFile) => void;
15
- /** 生成临时访问链接回调 */
16
- onGenerateTempLink?: (file: ProjectFile) => void;
17
- /** 移动到其他项目回调 */
18
- onMoveToProject?: (file: ProjectFile) => void;
19
- /** 复制到其他项目回调 */
20
- onCopyToProject?: (file: ProjectFile) => void;
21
- /** 复制副本回调 */
22
- onCopyToSelf?: (file: ProjectFile) => void;
23
- /** 查看文件历史版本回调 */
24
- onViewVersionHistory?: (file: ProjectFile) => void;
25
- /** 分享到微信回调 */
26
- onShareToWechat?: (file: ProjectFile) => void;
27
- /** 清理缓存回调 */
28
- onClearCache?: (file: ProjectFile) => void;
29
- /** 在新窗口打开回调 */
30
- onOpenInNewWindow?: (file: ProjectFile) => void;
31
- /** 跳转至合同回调 */
32
- onJumpToContract?: (file: ProjectFile) => void;
33
- /** 创建合同回调(仅合同根文件夹显示) */
34
- onCreateContract?: (file: ProjectFile) => void;
35
- /** 是否为管理员或负责人 */
36
- isAdminOrOwner?: boolean;
37
- trigger?: 'click' | 'hover' | 'contextMenu';
38
- placement?: 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
39
- /** 手动控制显示状态(用于右键菜单) */
40
- open?: boolean;
41
- /** 菜单位置(用于右键菜单) */
42
- position?: {
43
- x: number;
44
- y: number;
45
- };
46
- /** 自定义样式类名 */
47
- className?: string;
48
- }
49
- export declare const FileContextMenu: React.NamedExoticComponent<FileContextMenuProps>;
50
- export {};
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import { ProjectFile, FileSortBy } from './types';
3
- interface FileGridViewProps {
4
- dataSource: ProjectFile[];
5
- selectedFolderId: string | null;
6
- dragOverId: string | null;
7
- dragSourceId: string | null;
8
- isFolderExpanded: (folderId: string) => boolean;
9
- smallView: boolean;
10
- onPreview: (file: ProjectFile) => void;
11
- onDownload: (file: ProjectFile) => void;
12
- /** 下载文件夹回调(仅管理员/负责人提供) */
13
- onDownloadFolder?: (file: ProjectFile) => void;
14
- /** 复制链接回调(未提供时不显示「复制链接」) */
15
- onCopyLink?: (file: ProjectFile) => void;
16
- onRename: (file: ProjectFile) => void;
17
- onEditDescs: (file: ProjectFile) => void;
18
- onDelete: (fileId: string) => void;
19
- onEdit?: (file: ProjectFile) => void;
20
- /** 生成临时文件链接回调 */
21
- onGenerateTempLink?: (file: ProjectFile) => void;
22
- /** 切换当前目录(传入文件夹 ID,null 表示根目录) */
23
- onFolderChange: (folderId: string | null) => void;
24
- onMove: (sourceId: string, targetId: string) => void;
25
- onDragStart: (fileId: string) => void;
26
- onDragEnd: () => void;
27
- onDragOver: (fileId: string) => void;
28
- onDragLeave: (fileId: string) => void;
29
- onDrop: (sourceId: string, targetId: string) => void;
30
- onRowContextMenu: (event: React.MouseEvent, record: ProjectFile) => void;
31
- /** 移动到其他项目回调 */
32
- onMoveToProject?: (file: ProjectFile) => void;
33
- /** 复制到其他项目回调 */
34
- onCopyToProject?: (file: ProjectFile) => void;
35
- /** 复制副本回调 */
36
- onCopyToSelf?: (file: ProjectFile) => void;
37
- /** 查看文件历史版本回调 */
38
- onViewVersionHistory?: (file: ProjectFile) => void;
39
- /** 跳转至合同回调 */
40
- onJumpToContract?: (file: ProjectFile) => void;
41
- /** 排序字段 */
42
- sortBy: FileSortBy;
43
- /** 排序顺序 */
44
- sortOrder: 'asc' | 'desc';
45
- /** 切换排序字段回调(如果是相同字段则切换顺序) */
46
- onSortByChange: (by: FileSortBy) => void;
47
- /** 切换排序顺序回调 */
48
- onSortOrderToggle: () => void;
49
- }
50
- export declare const FileGridView: React.NamedExoticComponent<FileGridViewProps>;
51
- export {};
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import { ProjectFile, FileSortBy } from './types';
3
- interface FileTableViewProps {
4
- dataSource: ProjectFile[];
5
- expandedRowKeys: string[];
6
- selectedFolderId: string | null;
7
- dragOverId: string | null;
8
- dragSourceId: string | null;
9
- smallView: boolean;
10
- isFolderExpanded: (folderId: string) => boolean;
11
- onExpand: (expanded: boolean, record: ProjectFile) => void;
12
- onPreview: (file: ProjectFile) => void;
13
- onDownload: (file: ProjectFile) => void;
14
- /** 下载文件夹回调(仅管理员/负责人提供,表格行右键菜单复用该回调) */
15
- onDownloadFolder?: (file: ProjectFile) => void;
16
- /** 复制链接回调(未提供时不显示「复制链接」) */
17
- onCopyLink?: (file: ProjectFile) => void;
18
- onRename: (file: ProjectFile) => void;
19
- onEditDescs: (file: ProjectFile) => void;
20
- onDelete: (fileId: string) => void;
21
- onEdit?: (file: ProjectFile) => void;
22
- /** 生成临时文件链接回调 */
23
- onGenerateTempLink?: (file: ProjectFile) => void;
24
- onMove: (sourceId: string, targetId: string | null) => void;
25
- onDragStart: (fileId: string) => void;
26
- onDragEnd: () => void;
27
- onDragOver: (fileId: string) => void;
28
- onDragLeave: (fileId: string) => void;
29
- onDrop: (sourceId: string, targetId: string) => void;
30
- onRowContextMenu: (event: React.MouseEvent, record: ProjectFile) => void;
31
- /** 移动到其他项目回调 */
32
- onMoveToProject?: (file: ProjectFile) => void;
33
- /** 复制到其他项目回调 */
34
- onCopyToProject?: (file: ProjectFile) => void;
35
- /** 复制副本回调 */
36
- onCopyToSelf?: (file: ProjectFile) => void;
37
- /** 查看文件历史版本回调 */
38
- onViewVersionHistory?: (file: ProjectFile) => void;
39
- /** 跳转至合同回调 */
40
- onJumpToContract?: (file: ProjectFile) => void;
41
- /** 排序字段 */
42
- sortBy: FileSortBy;
43
- /** 排序顺序 */
44
- sortOrder: 'asc' | 'desc';
45
- /** 切换排序字段回调(如果是相同字段则切换顺序) */
46
- onSortByChange: (by: FileSortBy) => void;
47
- }
48
- export declare const FileTableView: React.NamedExoticComponent<FileTableViewProps>;
49
- export {};
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { UploadFile } from 'antd';
3
- import { ProjectRole } from './types';
4
- interface FileToolbarProps {
5
- currentUserRole: ProjectRole | null;
6
- viewMode: 'table' | 'grid';
7
- onToggleViewMode: (mode: 'table' | 'grid') => void;
8
- onCreateFolder: () => void;
9
- onCreateMarkdown: () => void;
10
- onCreateRdoc: () => void;
11
- onCreateExcel: () => void;
12
- onCreateWord: () => void;
13
- onUploadFiles: (fileList: UploadFile[], serverData: any) => Promise<void> | void;
14
- }
15
- export declare const FileToolbar: React.NamedExoticComponent<FileToolbarProps>;
16
- export {};
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { ProjectFile } from './types';
3
- interface FileVersionHistoryModalProps {
4
- visible: boolean;
5
- file: ProjectFile | null;
6
- onClose: () => void;
7
- }
8
- export declare const FileVersionHistoryModal: React.FC<FileVersionHistoryModalProps>;
9
- export default FileVersionHistoryModal;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- interface MoveCopyFileInfo {
3
- fileName: string;
4
- fileType: string;
5
- }
6
- interface MoveCopyToProjectModalProps {
7
- visible: boolean;
8
- fileIds: string[];
9
- /** 当前操作的文件/文件夹信息(用于文件夹场景的文案展示) */
10
- files?: MoveCopyFileInfo[];
11
- currentProjectId: string;
12
- mode: 'move' | 'copy';
13
- onCancel: () => void;
14
- onSuccess: () => void;
15
- }
16
- export declare const MoveCopyToProjectModal: React.FC<MoveCopyToProjectModalProps>;
17
- export {};
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { ProjectFile } from './types';
3
- interface ShareToWechatModalProps {
4
- visible: boolean;
5
- file: ProjectFile | null;
6
- onClose: () => void;
7
- onFileCached?: (fileId: string) => void;
8
- }
9
- export declare const ShareToWechatModal: React.FC<ShareToWechatModalProps>;
10
- export {};
@@ -1,143 +0,0 @@
1
- import React from 'react';
2
- import { ProjectFile, ProjectRole, FileManagerApi, FileManagerFeatures, FileSortBy } from '../types';
3
- type ViewMode = 'table' | 'grid';
4
- type CreatingFileType = 'pptx' | 'md' | 'xlsx' | 'docx' | 'rdoc' | null;
5
- interface FileManagerState {
6
- files: ProjectFile[];
7
- expandedRowKeys: string[];
8
- selectedFolderId: string | null;
9
- dragOverId: string | null;
10
- /** 排序字段(与 useFileManagerState 中定义保持一致) */
11
- sortBy: FileSortBy;
12
- /** 当前用户是否具备项目管理权限(文件夹下载等入口) */
13
- isManager: boolean;
14
- }
15
- interface FileManagerStateActions {
16
- setFiles: (files: ProjectFile[]) => void;
17
- setFileTreeData: (data: ProjectFile[]) => void;
18
- setLoading: (loading: boolean) => void;
19
- setExpandedRowKeys: (keys: string[]) => void;
20
- setViewMode: (mode: ViewMode) => void;
21
- setSelectedFolderId: (id: string | null) => void;
22
- setUploadPercent: (percent: number | undefined) => void;
23
- setUploadSuccess: (success: boolean | undefined) => void;
24
- setDragUploadPercent: (percent: number | undefined) => void;
25
- setDragUploadSuccess: (success: boolean | undefined) => void;
26
- setDragUploadingFileName: (name: string) => void;
27
- setIsExternalDragOver: (over: boolean) => void;
28
- setNewFolderName: (name: string) => void;
29
- setIsManager: (manager: boolean) => void;
30
- setEditingFile: (file: ProjectFile | null) => void;
31
- setEditorVisible: (visible: boolean) => void;
32
- setPreviewFileName: (name: string | null) => void;
33
- setPreviewUrl: (url: string | null) => void;
34
- setPreviewVisible: (visible: boolean) => void;
35
- setPreviewingFile: (file: ProjectFile | null) => void;
36
- setPreviewCrc32: (crc32: number | undefined) => void;
37
- setShareToWechatFile: (file: ProjectFile | null) => void;
38
- setShareToWechatVisible: (visible: boolean) => void;
39
- setRenameFileId: (id: string | null) => void;
40
- setRenameFileName: (name: string) => void;
41
- setRenameVisible: (visible: boolean) => void;
42
- setDescsFileId: (id: string | null) => void;
43
- setDescsValue: (value: string) => void;
44
- setDescsVisible: (visible: boolean) => void;
45
- setIsEncryptedFolder: (encrypted: boolean) => void;
46
- setCreateFolderVisible: (visible: boolean) => void;
47
- setNewFolderDescs: (descs: string) => void;
48
- setCreatingFileName: (name: string) => void;
49
- setCreatingFileType: (type: CreatingFileType) => void;
50
- setCreatorVisible: (visible: boolean) => void;
51
- setContextMenuVisible: (visible: boolean) => void;
52
- setContextMenuRecord: (record: ProjectFile | null) => void;
53
- setContextMenuPosition: (pos: {
54
- x: number;
55
- y: number;
56
- }) => void;
57
- setMoveCopyFiles: (files: ProjectFile[]) => void;
58
- setMoveCopyMode: (mode: 'move' | 'copy') => void;
59
- setMoveCopyModalVisible: (visible: boolean) => void;
60
- setVersionHistoryFile: (file: ProjectFile | null) => void;
61
- setVersionHistoryModalVisible: (visible: boolean) => void;
62
- setDragSourceId: (id: string | null) => void;
63
- setDragOverId: (id: string | null) => void;
64
- setRootDragOver: (over: boolean) => void;
65
- setIsOnline: (online: boolean) => void;
66
- setPreviewLocalId: (localId: string | null) => void;
67
- setPreviewIsLocalOnly: (isLocalOnly: boolean) => void;
68
- setPreviewHasUnsyncedChanges: (has: boolean) => void;
69
- setCreateFileVisible: (visible: boolean) => void;
70
- setNewFileName: (name: string) => void;
71
- setPendingFileType: (type: CreatingFileType) => void;
72
- }
73
- interface FileManagerActions {
74
- loadFiles: () => Promise<void>;
75
- uploadFiles: (fileList: any[]) => Promise<void>;
76
- handlePreview: (file: ProjectFile) => void;
77
- handleDownload: (file: ProjectFile) => void;
78
- /** 发起文件夹异步打包下载(仅管理员/负责人可用) */
79
- handleDownloadFolder: (file: ProjectFile) => void;
80
- handleShareToWechat: (file: ProjectFile) => void;
81
- handleCopyLink: (file: ProjectFile) => void;
82
- handleJumpToContract: (file: ProjectFile) => void;
83
- /** 在合同根文件夹右键菜单中点击"创建合同":切换到合同页签并打开新建合同弹窗 */
84
- handleCreateContract: (file: ProjectFile) => void;
85
- handleGenerateTempLink: (file: ProjectFile) => void;
86
- handleDelete: (fileId: string) => void;
87
- isFolderExpanded: (folderId: string) => boolean;
88
- handleMove: (fileId: string, targetFolderId: string | null) => void;
89
- handleRename: (file: ProjectFile) => void;
90
- handleEditDescs: (file: ProjectFile) => void;
91
- handleDescsConfirm: (descsFileId: string | null, descsValue: string) => void;
92
- handleRenameConfirm: (renameFileId: string | null, renameFileName: string) => void;
93
- handleCreateFolder: () => void;
94
- openCreator: (fileName: string, fileType: CreatingFileType) => void;
95
- handleCreatePptx: () => void;
96
- handleCreateMarkdown: () => void;
97
- handleCreateRdoc: () => void;
98
- handleCreateExcel: () => void;
99
- handleCreateWord: () => void;
100
- handleCreateFileConfirm: (fileName: string, fileType: CreatingFileType) => void;
101
- handleCreateFolderConfirm: (newFolderName: string, newFolderDescs: string, isEncryptedFolder: boolean) => void;
102
- handleEditFile: (file: ProjectFile) => void;
103
- handleUploadBlob: (editingFile: ProjectFile | null, initialBlob: Blob | undefined, blob: Blob, fileName: string) => void;
104
- handleUploadMarkdown: (editingFile: ProjectFile | null, oldContent: string, content: string, fileName: string) => void;
105
- handleCreateUploadBlob: (initialBlob: Blob | undefined, blob: Blob, fileName: string) => void;
106
- handleCreateUploadMarkdown: (oldContent: string, content: string, fileName: string) => void;
107
- /** 编辑器点击"保存本地缓存"时调用:同步更新 localFiles store 内容,使 hasUnsyncedChanges 标记生效 */
108
- handleSaveLocalBlob: (localId: string | null | undefined, blob: Blob, fileName: string, markUnsynced?: boolean) => Promise<void>;
109
- /** Markdown 编辑器点击"保存本地缓存"时调用 */
110
- handleSaveLocalMarkdown: (localId: string | null | undefined, content: string, fileName: string, markUnsynced?: boolean) => Promise<void>;
111
- handleExpand: (expanded: boolean, record: ProjectFile) => void;
112
- toggleFolderExpand: (record: ProjectFile, tableView: boolean) => void;
113
- handleDragStart: (fileId: string) => void;
114
- handleDragEnd: () => void;
115
- handleDragOver: (fileId: string) => void;
116
- handleDragLeave: (fileId: string) => void;
117
- handleDrop: (sourceId: string, targetId: string) => void;
118
- handleExternalDragEnter: (e: React.DragEvent) => void;
119
- handleExternalDragOver: (e: React.DragEvent) => void;
120
- handleExternalDragLeave: (e: React.DragEvent) => void;
121
- handleExternalDrop: (e: React.DragEvent) => void;
122
- handleContextMenu: (event: React.MouseEvent, record: ProjectFile) => void;
123
- handleMoveToProject: (file: ProjectFile) => void;
124
- handleCopyToProject: (file: ProjectFile) => void;
125
- handleCopyToSelf: (file: ProjectFile) => void;
126
- handleMoveCopySuccess: () => void;
127
- handleViewVersionHistory: (file: ProjectFile) => void;
128
- handleClearCache: (file: ProjectFile) => void;
129
- handleCacheSaved: (fileId: string) => void;
130
- handleOpenInNewWindow: (file: ProjectFile) => void;
131
- handleRootDragOver: (e: React.DragEvent) => void;
132
- handleRootDragLeave: () => void;
133
- handleRootDrop: (e: React.DragEvent) => void;
134
- initUserRole: () => void;
135
- initViewMode: () => void;
136
- }
137
- export declare const useFileManagerActions: (projectId: string, currentUserRole: ProjectRole | null, state: FileManagerState, actions: FileManagerStateActions, options?: {
138
- /** 数据接口适配器,缺省为项目文件 API */
139
- api?: FileManagerApi;
140
- /** 功能开关,缺省全部开启 */
141
- features?: FileManagerFeatures;
142
- }) => FileManagerActions;
143
- export {};