@spacecorexdev/core 0.0.5 → 0.1.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 (368) 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 +9 -1
  12. package/types/hooks.d.ts +1 -1
  13. package/types/index.d.ts +4 -4
  14. package/types/types/index.d.ts +1 -3
  15. package/types/types/project/base.d.ts +3 -1
  16. package/types/types/project/index.d.ts +1 -0
  17. package/types/types/project/member.d.ts +1 -1
  18. package/types/types/project/projectRole.d.ts +17 -0
  19. package/types/types/projectRole.d.ts +2 -2
  20. package/types/ui/FileManager/types.d.ts +1 -5
  21. package/types/ui/FileManager/utils/fileUtils.d.ts +0 -16
  22. package/types/ui/ResizableTable/index.d.ts +7 -0
  23. package/types/ui/RoleSelector/index.d.ts +7 -1
  24. package/types/ui/UIFilePreview/RichDocEditor/index.d.ts +0 -13
  25. package/types/ui/UIFilePreview/WordEditor/style.d.ts +0 -6
  26. package/types/ui/UIFileUpload.d.ts +2 -2
  27. package/types/ui/index.d.ts +1 -10
  28. package/types/ui/upload/index.d.ts +6 -0
  29. package/types/ui.d.ts +1 -1
  30. package/types/utils/CacheIndexedDB.d.ts +9 -0
  31. package/types/utils/index.d.ts +2 -2
  32. package/types/utils/mailto.d.ts +12 -0
  33. package/types/utils.d.ts +1 -1
  34. package/public/cmaps/78-EUC-H.bcmap +0 -0
  35. package/public/cmaps/78-EUC-V.bcmap +0 -0
  36. package/public/cmaps/78-H.bcmap +0 -0
  37. package/public/cmaps/78-RKSJ-H.bcmap +0 -0
  38. package/public/cmaps/78-RKSJ-V.bcmap +0 -0
  39. package/public/cmaps/78-V.bcmap +0 -0
  40. package/public/cmaps/78ms-RKSJ-H.bcmap +0 -0
  41. package/public/cmaps/78ms-RKSJ-V.bcmap +0 -0
  42. package/public/cmaps/83pv-RKSJ-H.bcmap +0 -0
  43. package/public/cmaps/90ms-RKSJ-H.bcmap +0 -0
  44. package/public/cmaps/90ms-RKSJ-V.bcmap +0 -0
  45. package/public/cmaps/90msp-RKSJ-H.bcmap +0 -0
  46. package/public/cmaps/90msp-RKSJ-V.bcmap +0 -0
  47. package/public/cmaps/90pv-RKSJ-H.bcmap +0 -0
  48. package/public/cmaps/90pv-RKSJ-V.bcmap +0 -0
  49. package/public/cmaps/Add-H.bcmap +0 -0
  50. package/public/cmaps/Add-RKSJ-H.bcmap +0 -0
  51. package/public/cmaps/Add-RKSJ-V.bcmap +0 -0
  52. package/public/cmaps/Add-V.bcmap +0 -0
  53. package/public/cmaps/Adobe-CNS1-0.bcmap +0 -0
  54. package/public/cmaps/Adobe-CNS1-1.bcmap +0 -0
  55. package/public/cmaps/Adobe-CNS1-2.bcmap +0 -0
  56. package/public/cmaps/Adobe-CNS1-3.bcmap +0 -0
  57. package/public/cmaps/Adobe-CNS1-4.bcmap +0 -0
  58. package/public/cmaps/Adobe-CNS1-5.bcmap +0 -0
  59. package/public/cmaps/Adobe-CNS1-6.bcmap +0 -0
  60. package/public/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  61. package/public/cmaps/Adobe-GB1-0.bcmap +0 -0
  62. package/public/cmaps/Adobe-GB1-1.bcmap +0 -0
  63. package/public/cmaps/Adobe-GB1-2.bcmap +0 -0
  64. package/public/cmaps/Adobe-GB1-3.bcmap +0 -0
  65. package/public/cmaps/Adobe-GB1-4.bcmap +0 -0
  66. package/public/cmaps/Adobe-GB1-5.bcmap +0 -0
  67. package/public/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  68. package/public/cmaps/Adobe-Japan1-0.bcmap +0 -0
  69. package/public/cmaps/Adobe-Japan1-1.bcmap +0 -0
  70. package/public/cmaps/Adobe-Japan1-2.bcmap +0 -0
  71. package/public/cmaps/Adobe-Japan1-3.bcmap +0 -0
  72. package/public/cmaps/Adobe-Japan1-4.bcmap +0 -0
  73. package/public/cmaps/Adobe-Japan1-5.bcmap +0 -0
  74. package/public/cmaps/Adobe-Japan1-6.bcmap +0 -0
  75. package/public/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  76. package/public/cmaps/Adobe-Korea1-0.bcmap +0 -0
  77. package/public/cmaps/Adobe-Korea1-1.bcmap +0 -0
  78. package/public/cmaps/Adobe-Korea1-2.bcmap +0 -0
  79. package/public/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  80. package/public/cmaps/B5-H.bcmap +0 -0
  81. package/public/cmaps/B5-V.bcmap +0 -0
  82. package/public/cmaps/B5pc-H.bcmap +0 -0
  83. package/public/cmaps/B5pc-V.bcmap +0 -0
  84. package/public/cmaps/CNS-EUC-H.bcmap +0 -0
  85. package/public/cmaps/CNS-EUC-V.bcmap +0 -0
  86. package/public/cmaps/CNS1-H.bcmap +0 -0
  87. package/public/cmaps/CNS1-V.bcmap +0 -0
  88. package/public/cmaps/CNS2-H.bcmap +0 -0
  89. package/public/cmaps/CNS2-V.bcmap +0 -3
  90. package/public/cmaps/ETHK-B5-H.bcmap +0 -0
  91. package/public/cmaps/ETHK-B5-V.bcmap +0 -0
  92. package/public/cmaps/ETen-B5-H.bcmap +0 -0
  93. package/public/cmaps/ETen-B5-V.bcmap +0 -0
  94. package/public/cmaps/ETenms-B5-H.bcmap +0 -3
  95. package/public/cmaps/ETenms-B5-V.bcmap +0 -0
  96. package/public/cmaps/EUC-H.bcmap +0 -0
  97. package/public/cmaps/EUC-V.bcmap +0 -0
  98. package/public/cmaps/Ext-H.bcmap +0 -0
  99. package/public/cmaps/Ext-RKSJ-H.bcmap +0 -0
  100. package/public/cmaps/Ext-RKSJ-V.bcmap +0 -0
  101. package/public/cmaps/Ext-V.bcmap +0 -0
  102. package/public/cmaps/GB-EUC-H.bcmap +0 -0
  103. package/public/cmaps/GB-EUC-V.bcmap +0 -0
  104. package/public/cmaps/GB-H.bcmap +0 -4
  105. package/public/cmaps/GB-V.bcmap +0 -0
  106. package/public/cmaps/GBK-EUC-H.bcmap +0 -0
  107. package/public/cmaps/GBK-EUC-V.bcmap +0 -0
  108. package/public/cmaps/GBK2K-H.bcmap +0 -0
  109. package/public/cmaps/GBK2K-V.bcmap +0 -0
  110. package/public/cmaps/GBKp-EUC-H.bcmap +0 -0
  111. package/public/cmaps/GBKp-EUC-V.bcmap +0 -0
  112. package/public/cmaps/GBT-EUC-H.bcmap +0 -0
  113. package/public/cmaps/GBT-EUC-V.bcmap +0 -0
  114. package/public/cmaps/GBT-H.bcmap +0 -0
  115. package/public/cmaps/GBT-V.bcmap +0 -0
  116. package/public/cmaps/GBTpc-EUC-H.bcmap +0 -0
  117. package/public/cmaps/GBTpc-EUC-V.bcmap +0 -0
  118. package/public/cmaps/GBpc-EUC-H.bcmap +0 -0
  119. package/public/cmaps/GBpc-EUC-V.bcmap +0 -0
  120. package/public/cmaps/H.bcmap +0 -0
  121. package/public/cmaps/HKdla-B5-H.bcmap +0 -0
  122. package/public/cmaps/HKdla-B5-V.bcmap +0 -0
  123. package/public/cmaps/HKdlb-B5-H.bcmap +0 -0
  124. package/public/cmaps/HKdlb-B5-V.bcmap +0 -0
  125. package/public/cmaps/HKgccs-B5-H.bcmap +0 -0
  126. package/public/cmaps/HKgccs-B5-V.bcmap +0 -0
  127. package/public/cmaps/HKm314-B5-H.bcmap +0 -0
  128. package/public/cmaps/HKm314-B5-V.bcmap +0 -0
  129. package/public/cmaps/HKm471-B5-H.bcmap +0 -0
  130. package/public/cmaps/HKm471-B5-V.bcmap +0 -0
  131. package/public/cmaps/HKscs-B5-H.bcmap +0 -0
  132. package/public/cmaps/HKscs-B5-V.bcmap +0 -0
  133. package/public/cmaps/Hankaku.bcmap +0 -0
  134. package/public/cmaps/Hiragana.bcmap +0 -0
  135. package/public/cmaps/KSC-EUC-H.bcmap +0 -0
  136. package/public/cmaps/KSC-EUC-V.bcmap +0 -0
  137. package/public/cmaps/KSC-H.bcmap +0 -0
  138. package/public/cmaps/KSC-Johab-H.bcmap +0 -0
  139. package/public/cmaps/KSC-Johab-V.bcmap +0 -0
  140. package/public/cmaps/KSC-V.bcmap +0 -0
  141. package/public/cmaps/KSCms-UHC-H.bcmap +0 -0
  142. package/public/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  143. package/public/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  144. package/public/cmaps/KSCms-UHC-V.bcmap +0 -0
  145. package/public/cmaps/KSCpc-EUC-H.bcmap +0 -0
  146. package/public/cmaps/KSCpc-EUC-V.bcmap +0 -0
  147. package/public/cmaps/Katakana.bcmap +0 -0
  148. package/public/cmaps/LICENSE +0 -36
  149. package/public/cmaps/NWP-H.bcmap +0 -0
  150. package/public/cmaps/NWP-V.bcmap +0 -0
  151. package/public/cmaps/RKSJ-H.bcmap +0 -0
  152. package/public/cmaps/RKSJ-V.bcmap +0 -0
  153. package/public/cmaps/Roman.bcmap +0 -0
  154. package/public/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  155. package/public/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  156. package/public/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  157. package/public/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  158. package/public/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  159. package/public/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  160. package/public/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  161. package/public/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  162. package/public/cmaps/UniGB-UCS2-H.bcmap +0 -0
  163. package/public/cmaps/UniGB-UCS2-V.bcmap +0 -0
  164. package/public/cmaps/UniGB-UTF16-H.bcmap +0 -0
  165. package/public/cmaps/UniGB-UTF16-V.bcmap +0 -0
  166. package/public/cmaps/UniGB-UTF32-H.bcmap +0 -0
  167. package/public/cmaps/UniGB-UTF32-V.bcmap +0 -0
  168. package/public/cmaps/UniGB-UTF8-H.bcmap +0 -0
  169. package/public/cmaps/UniGB-UTF8-V.bcmap +0 -0
  170. package/public/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  171. package/public/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  172. package/public/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  173. package/public/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  174. package/public/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  175. package/public/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  176. package/public/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  177. package/public/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  178. package/public/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  179. package/public/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  180. package/public/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  181. package/public/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  182. package/public/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  183. package/public/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  184. package/public/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  185. package/public/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  186. package/public/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  187. package/public/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  188. package/public/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  189. package/public/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  190. package/public/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  191. package/public/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  192. package/public/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  193. package/public/cmaps/UniKS-UCS2-H.bcmap +0 -0
  194. package/public/cmaps/UniKS-UCS2-V.bcmap +0 -0
  195. package/public/cmaps/UniKS-UTF16-H.bcmap +0 -0
  196. package/public/cmaps/UniKS-UTF16-V.bcmap +0 -0
  197. package/public/cmaps/UniKS-UTF32-H.bcmap +0 -0
  198. package/public/cmaps/UniKS-UTF32-V.bcmap +0 -0
  199. package/public/cmaps/UniKS-UTF8-H.bcmap +0 -0
  200. package/public/cmaps/UniKS-UTF8-V.bcmap +0 -0
  201. package/public/cmaps/V.bcmap +0 -0
  202. package/public/cmaps/WP-Symbol.bcmap +0 -0
  203. package/public/polyfills/polyfills.js +0 -802
  204. package/public/vendor/docx/docx.worker.js +0 -5
  205. package/public/vendor/docx/jszip.min.js +0 -13
  206. package/public/vendor/libarchive/libarchive.wasm +0 -0
  207. package/public/vendor/libarchive/worker-bundle.js +0 -6
  208. package/public/vendor/pptx/pptx.worker.js +0 -26
  209. package/public/wasm/cad/0.8.2/dwfv-render.wasm +0 -0
  210. package/public/wasm/cad/0.8.2/dwg-worker.js +0 -24
  211. package/public/wasm/cad/0.8.2/dwg-worker.js.map +0 -1
  212. package/public/wasm/cad/0.8.2/libredwg-web.js +0 -2
  213. package/public/wasm/cad/0.8.2/libredwg-web.wasm +0 -0
  214. package/public/wasm/cad/dwfv-render.wasm +0 -0
  215. package/public/wasm/cad/dwg-worker.js +0 -24
  216. package/public/wasm/cad/dwg-worker.js.map +0 -1
  217. package/public/wasm/cad/libredwg-web.js +0 -2
  218. package/public/wasm/cad/libredwg-web.wasm +0 -0
  219. package/public/wasm/data/sql-wasm.wasm +0 -0
  220. package/public/wasm/hdiff.wasm +0 -0
  221. package/public/wasm/model/LICENSE.occt-import-js.txt +0 -504
  222. package/public/wasm/model/LICENSE.occt.txt +0 -502
  223. package/public/wasm/model/occt-import-js.js +0 -19
  224. package/public/wasm/model/occt-import-js.wasm +0 -0
  225. package/public/wasm/model/occt-worker.js +0 -83
  226. package/public/wasm/typst/fonts/DejaVuSansMono-Bold.ttf +0 -0
  227. package/public/wasm/typst/fonts/DejaVuSansMono-BoldOblique.ttf +0 -0
  228. package/public/wasm/typst/fonts/DejaVuSansMono-Oblique.ttf +0 -0
  229. package/public/wasm/typst/fonts/DejaVuSansMono.ttf +0 -0
  230. package/public/wasm/typst/fonts/LibertinusSerif-Bold.otf +0 -0
  231. package/public/wasm/typst/fonts/LibertinusSerif-BoldItalic.otf +0 -0
  232. package/public/wasm/typst/fonts/LibertinusSerif-Italic.otf +0 -0
  233. package/public/wasm/typst/fonts/LibertinusSerif-Regular.otf +0 -0
  234. package/public/wasm/typst/fonts/LibertinusSerif-Semibold.otf +0 -0
  235. package/public/wasm/typst/fonts/LibertinusSerif-SemiboldItalic.otf +0 -0
  236. package/public/wasm/typst/fonts/NewCM10-Bold.otf +0 -0
  237. package/public/wasm/typst/fonts/NewCM10-BoldItalic.otf +0 -0
  238. package/public/wasm/typst/fonts/NewCM10-Italic.otf +0 -0
  239. package/public/wasm/typst/fonts/NewCM10-Regular.otf +0 -0
  240. package/public/wasm/typst/fonts/NewCMMath-Bold.otf +0 -0
  241. package/public/wasm/typst/fonts/NewCMMath-Book.otf +0 -0
  242. package/public/wasm/typst/fonts/NewCMMath-Regular.otf +0 -0
  243. package/public/wasm/typst/fonts/README.md +0 -7
  244. package/public/wasm/typst/typst_ts_renderer_bg.wasm +0 -0
  245. package/public/wasm/typst/typst_ts_web_compiler_bg.wasm +0 -0
  246. package/scripts/patch-docx-grid.cjs +0 -412
  247. package/src/api/_base.ts +0 -243
  248. package/src/api/index.ts +0 -17
  249. package/src/api/project.ts +0 -1345
  250. package/src/api/user.ts +0 -1174
  251. package/src/contract.ts +0 -50
  252. package/src/hooks/index.ts +0 -2
  253. package/src/hooks/useLongPress.ts +0 -137
  254. package/src/hooks/useOnlineStatus.ts +0 -22
  255. package/src/index.ts +0 -14
  256. package/src/types/id.ts +0 -2
  257. package/src/types/index.ts +0 -5
  258. package/src/types/project/base.ts +0 -63
  259. package/src/types/project/contract.ts +0 -79
  260. package/src/types/project/contractStatus.tsx +0 -15
  261. package/src/types/project/index.ts +0 -5
  262. package/src/types/project/member.ts +0 -46
  263. package/src/types/project/progress.ts +0 -43
  264. package/src/types/projectRole.ts +0 -17
  265. package/src/types/theme.ts +0 -1
  266. package/src/types/user/index.ts +0 -1
  267. package/src/types/user/role.ts +0 -7
  268. package/src/ui/CommentTimeline/index.tsx +0 -330
  269. package/src/ui/FileManager/FileContextMenu.tsx +0 -628
  270. package/src/ui/FileManager/FileGridView.tsx +0 -529
  271. package/src/ui/FileManager/FileTableView.tsx +0 -405
  272. package/src/ui/FileManager/FileToolbar.tsx +0 -119
  273. package/src/ui/FileManager/FileVersionHistoryModal.tsx +0 -175
  274. package/src/ui/FileManager/MoveCopyToProjectModal.tsx +0 -119
  275. package/src/ui/FileManager/ShareToWechatModal.tsx +0 -419
  276. package/src/ui/FileManager/hooks/useFileManagerActions.ts +0 -2532
  277. package/src/ui/FileManager/hooks/useFileManagerState.ts +0 -419
  278. package/src/ui/FileManager/index.tsx +0 -580
  279. package/src/ui/FileManager/projectFileManagerApi.ts +0 -57
  280. package/src/ui/FileManager/types.ts +0 -184
  281. package/src/ui/FileManager/utils/fileDeltaWorker.ts +0 -193
  282. package/src/ui/FileManager/utils/fileTree.ts +0 -178
  283. package/src/ui/FileManager/utils/fileUpload.ts +0 -714
  284. package/src/ui/FileManager/utils/fileUtils.ts +0 -65
  285. package/src/ui/InvoiceRecordsList/index.tsx +0 -813
  286. package/src/ui/MyFileSelectorModal.tsx +0 -261
  287. package/src/ui/ProjectSelector/index.tsx +0 -472
  288. package/src/ui/ProjectSelector/projectCache.ts +0 -40
  289. package/src/ui/RoleSelector/index.tsx +0 -473
  290. package/src/ui/RoleSelector/roleCache.ts +0 -40
  291. package/src/ui/UIAlert.tsx +0 -399
  292. package/src/ui/UIAlertExample.tsx +0 -129
  293. package/src/ui/UIConfirm.tsx +0 -335
  294. package/src/ui/UIConfirmExample.tsx +0 -165
  295. package/src/ui/UIDatePicker.tsx +0 -146
  296. package/src/ui/UIDateRangePicker.tsx +0 -38
  297. package/src/ui/UIFilePreview/ExcelEditor/index.tsx +0 -617
  298. package/src/ui/UIFilePreview/ExcelEditor/types.ts +0 -24
  299. package/src/ui/UIFilePreview/ExportDropdown.css +0 -85
  300. package/src/ui/UIFilePreview/ExportDropdown.tsx +0 -109
  301. package/src/ui/UIFilePreview/IndexedDBUtils.ts +0 -564
  302. package/src/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.ts +0 -576
  303. package/src/ui/UIFilePreview/MarkdownEditor/index.tsx +0 -677
  304. package/src/ui/UIFilePreview/MarkdownEditor/markdownEditor.css +0 -1005
  305. package/src/ui/UIFilePreview/MarkdownEditor/types.ts +0 -15
  306. package/src/ui/UIFilePreview/PPTXEditor/index.tsx +0 -602
  307. package/src/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.ts +0 -77
  308. package/src/ui/UIFilePreview/RichDocEditor/exportRDocPdf.ts +0 -374
  309. package/src/ui/UIFilePreview/RichDocEditor/index.tsx +0 -730
  310. package/src/ui/UIFilePreview/RichDocEditor/richdoc-editor.css +0 -59
  311. package/src/ui/UIFilePreview/UIFilePreview.tsx +0 -611
  312. package/src/ui/UIFilePreview/WordEditor/index.tsx +0 -3933
  313. package/src/ui/UIFilePreview/WordEditor/style.ts +0 -1213
  314. package/src/ui/UIFilePreview/WordEditor/word-editor.css +0 -999
  315. package/src/ui/UIFilePreview/filePreview.css +0 -193
  316. package/src/ui/UIFilePreview/filetypes/archive.tsx +0 -66
  317. package/src/ui/UIFilePreview/filetypes/cad.tsx +0 -287
  318. package/src/ui/UIFilePreview/filetypes/excel.tsx +0 -355
  319. package/src/ui/UIFilePreview/filetypes/image.tsx +0 -20
  320. package/src/ui/UIFilePreview/filetypes/imageLoader.ts +0 -63
  321. package/src/ui/UIFilePreview/filetypes/pdf.tsx +0 -156
  322. package/src/ui/UIFilePreview/filetypes/ppt.tsx +0 -535
  323. package/src/ui/UIFilePreview/filetypes/pptExportPdf.ts +0 -523
  324. package/src/ui/UIFilePreview/filetypes/video.tsx +0 -482
  325. package/src/ui/UIFilePreview/filetypes/word.tsx +0 -245
  326. package/src/ui/UIFilePreview/filetypes/wordExportMarkdown.ts +0 -86
  327. package/src/ui/UIFilePreview/filetypes/wordExportPdf.tsx +0 -427
  328. package/src/ui/UIFilePreview/index.ts +0 -35
  329. package/src/ui/UIFilePreview/pdfPagination.ts +0 -143
  330. package/src/ui/UIFilePreview/previewUtils.tsx +0 -531
  331. package/src/ui/UIFileUpload.tsx +0 -382
  332. package/src/ui/UIImageUpload.tsx +0 -195
  333. package/src/ui/UILoading.tsx +0 -255
  334. package/src/ui/UILoadingExample.tsx +0 -139
  335. package/src/ui/UISelect.tsx +0 -105
  336. package/src/ui/UIToast.tsx +0 -381
  337. package/src/ui/UIToastExample.tsx +0 -69
  338. package/src/ui/UIToastSingle.tsx +0 -279
  339. package/src/ui/UIViewToggle.tsx +0 -64
  340. package/src/ui/UserSelector/index.tsx +0 -583
  341. package/src/ui/index.ts +0 -84
  342. package/src/ui/upload/image.ts +0 -135
  343. package/src/ui/upload/index.ts +0 -73
  344. package/src/ui/upload/submitFile.ts +0 -106
  345. package/src/ui/upload/submitForm.ts +0 -124
  346. package/src/ui/upload/upload.err.ts +0 -15
  347. package/src/ui/upload/upload.ts +0 -250
  348. package/src/utils/CacheDepartmentInfo.ts +0 -372
  349. package/src/utils/CacheFileContent.ts +0 -315
  350. package/src/utils/CachePermissionInfo.ts +0 -235
  351. package/src/utils/CacheRoleInfo.ts +0 -303
  352. package/src/utils/CacheUserInfo.ts +0 -818
  353. package/src/utils/CacheViewToggleInfo.ts +0 -182
  354. package/src/utils/MessageContentUtils.ts +0 -268
  355. package/src/utils/clipboard.ts +0 -70
  356. package/src/utils/companyEmail.ts +0 -19
  357. package/src/utils/forbidDebugger.ts +0 -59
  358. package/src/utils/formatters.ts +0 -94
  359. package/src/utils/htmlUtils.tsx +0 -59
  360. package/src/utils/index.ts +0 -18
  361. package/src/utils/keyboard.ts +0 -114
  362. package/src/utils/mammothApi.ts +0 -16
  363. package/src/utils/polyfills.ts +0 -928
  364. package/src/utils/regex.ts +0 -14
  365. package/src/utils/storage.ts +0 -95
  366. package/src/utils/workerBootstrap.ts +0 -87
  367. /package/{src → dist}/styles/ant-modal.css +0 -0
  368. /package/{src → dist}/styles/ant-spin.css +0 -0
@@ -1,193 +0,0 @@
1
- .pptx-preview-wrapper .pptx-preview-slide-wrapper {
2
- border-bottom: 1px solid rgb(var(--color-border));
3
- margin: 0 !important;
4
- /* padding-top: 10px !important;
5
- padding-bottom: 10px !important; */
6
- }
7
-
8
- .pptx-preview-wrapper .pptx-preview-slide-wrapper .slide-master-wrapper,
9
- .pptx-preview-wrapper .pptx-preview-slide-wrapper .slide-layout-wrapper,
10
- .pptx-preview-wrapper .pptx-preview-slide-wrapper .slide-wrapper {
11
- right: 0;
12
- }
13
-
14
- .pptx-preview-wrapper .pptx-preview-slide-wrapper table {
15
- width: 100%;
16
- }
17
-
18
- .ant-modal-root .ant-modal-wrap .ant-modal.ant-modal-fullscreen.ant-modal-ppt .ant-modal-content {
19
- min-height: 100vh !important;
20
- margin-bottom: 0 !important;
21
- padding-top: 0 !important;
22
- padding-left: 0 !important;
23
- padding-right: 0 !important;
24
- padding-bottom: 0 !important;
25
- }
26
-
27
- .ant-modal-root .ant-modal-wrap .ant-modal.ant-modal-fullscreen.ant-modal-ppt .ant-modal-content .ant-modal-body {
28
- min-height: 100vh !important;
29
- background: rgb(var(--color-black));
30
- }
31
-
32
- .ant-modal-root .ant-modal-wrap .ant-modal.ant-modal-fullscreen.ant-modal-ppt .ant-modal-content .ant-modal-body>div {
33
- background: rgb(var(--color-black)) !important;
34
- }
35
-
36
- .ant-modal-root .ant-modal-wrap .ant-modal.ant-modal-fullscreen.ant-modal-ppt .ant-modal-content .ant-modal-close {
37
- color: rgb(var(--color-gray-300));
38
- }
39
-
40
- .ant-modal-root .ant-modal-wrap .ant-modal.ant-modal-fullscreen.ant-modal-ppt .ant-modal-content .ant-modal-close:hover {
41
- color: rgb(var(--color-white));
42
- }
43
-
44
- .ant-modal-root .ant-modal-wrap .ant-modal.ant-modal-fullscreen .ant-modal-content .ant-modal-close {
45
- position: fixed;
46
- }
47
-
48
- .docx-preview {
49
- justify-self: center;
50
- }
51
-
52
- .ui-file-preview-archive {
53
- width: 100%;
54
- height: 100dvh;
55
- min-height: 0;
56
- background: rgb(var(--color-surface));
57
- }
58
-
59
- .ui-file-preview-pdf {
60
- width: 100%;
61
- height: 100dvh;
62
- min-height: 0;
63
- background: rgb(var(--color-surface));
64
- }
65
-
66
-
67
- /* ==========================================================================
68
- PDF 预览文本选择修复
69
- PDF.js 默认禁用了文本选择高亮,且 .enablePermissions 模式下完全禁用,
70
- 这里用最高优先级的覆盖确保文本可以被选择并看到选中高亮。
71
- ========================================================================== */
72
-
73
- /* 1) 文本层提升到画布之上,确保鼠标事件落在文本层而非 canvas 上 */
74
- .ui-file-preview-pdf .pdfViewer .page .textLayer {
75
- z-index: 2 !important;
76
- pointer-events: auto !important;
77
- }
78
-
79
- /* 2) 强制文本层内的所有 span 均可选择,覆盖权限禁用规则 */
80
- .ui-file-preview-pdf .pdfViewer .textLayer span,
81
- .ui-file-preview-pdf .pdfViewer .textLayer br,
82
- .ui-file-preview-pdf .pdfViewer.enablePermissions .textLayer span {
83
- -webkit-user-select: text !important;
84
- -moz-user-select: text !important;
85
- user-select: text !important;
86
- cursor: text !important;
87
- pointer-events: auto !important;
88
- }
89
-
90
- /* 3) 恢复选择高亮的默认颜色,否则 ::selection 背景透明看不到选中内容 */
91
- .ui-file-preview-pdf .pdfViewer .textLayer ::selection,
92
- .ui-file-preview-pdf .pdfViewer .textLayer span::selection,
93
- .ui-file-preview-pdf .pdfViewer .textLayer br::selection {
94
- background: AccentColor !important;
95
- background: highlight !important;
96
- }
97
- .ui-file-preview-pdf .pdfViewer .textLayer ::-moz-selection,
98
- .ui-file-preview-pdf .pdfViewer .textLayer span::-moz-selection,
99
- .ui-file-preview-pdf .pdfViewer .textLayer br::-moz-selection {
100
- background: highlight !important;
101
- }
102
-
103
- /* 4) 文本层本身也要允许选择,防止父级 user-select 级联覆盖 */
104
- .ui-file-preview-pdf .pdfViewer,
105
- .ui-file-preview-pdf .pdfViewer .page,
106
- .ui-file-preview-pdf .pdfViewer .textLayer {
107
- -webkit-user-select: text !important;
108
- -moz-user-select: text !important;
109
- user-select: text !important;
110
- }
111
-
112
-
113
- .ui-file-preview-word {
114
- width: 100%;
115
- height: 100vh;
116
- min-height: 0;
117
- background: rgb(var(--color-surface));
118
- }
119
-
120
- .ui-file-preview-excel {
121
- width: 100%;
122
- height: 100vh;
123
- min-height: 0;
124
- background: #ffffff;
125
- }
126
-
127
- .ui-file-preview-excel .e-virt-table-canvas {
128
- background: #ffffff;
129
- }
130
-
131
- .ui-file-preview-cad .cad-toolbar {
132
- padding-right: 50px;
133
- }
134
-
135
- .ui-file-preview-ebook {
136
- width: 100%;
137
- height: 100dvh;
138
- min-height: 0;
139
- /* 纸张色背景:暖白偏黄,模拟实体书纸张观感 */
140
- background: #f5ecd9;
141
- }
142
-
143
- @media (min-width: 720px) {
144
- .ui-file-preview-ebook .epub-actions {
145
- margin-right: 35px;
146
- }
147
- }
148
-
149
- .ui-file-preview-ebook .file-viewer,
150
- .ui-file-preview-ebook .file-viewer * {
151
- max-width: none;
152
- }
153
-
154
- .ui-file-preview-ebook .epub-viewer {
155
- width: 100% !important;
156
- height: 100% !important;
157
- }
158
-
159
- .ui-file-preview-ebook .epub-container {
160
- max-width: 100% !important;
161
- width: 100% !important;
162
- }
163
-
164
- .ui-file-preview-ebook .epub-stage-wrap {
165
- padding-left: 0;
166
- padding-right: 0;
167
- padding-bottom: 0;
168
- padding-top: 0;
169
- }
170
-
171
- /* ==========================================================================
172
- 电子书阅读区样式
173
- epubjs 使用 flow:scrolled + manager:continuous 模式,自行管理 iframe
174
- 高度与内部滚动。不要覆盖 iframe/epub-container 的 height,否则会破坏
175
- epubjs 的翻页(next/prev)与视图计算。
176
- ========================================================================== */
177
- .ui-file-preview-ebook .epub-toolbar,
178
- .ui-file-preview-ebook .epub-icon-button,
179
- .ui-file-preview-ebook .epub-button {
180
- background: #f5ecd9 !important;
181
- }
182
-
183
- .ui-file-preview-ebook .epub-toc {
184
- background: #f2deb4 !important;
185
- }
186
-
187
- .ui-file-preview-ebook .epub-stage {
188
- /* 内容区用纸张色,与外层背景一致 */
189
- background: #f5ecd9 !important;
190
- box-shadow: none !important;
191
- /* 允许触摸惯性滚动(移动端) */
192
- touch-action: pan-y;
193
- }
@@ -1,66 +0,0 @@
1
- import React, { useMemo } from 'react';
2
- import { FileViewer } from '@file-viewer/react';
3
- import { archiveRenderer } from '@file-viewer/renderer-archive';
4
- import { pdfRenderer } from '@file-viewer/renderer-pdf';
5
- import { wordRenderer } from '@file-viewer/renderer-word';
6
- import { spreadsheetRenderer } from '@file-viewer/renderer-spreadsheet';
7
- import { textRenderer } from '@file-viewer/renderer-text';
8
- import { withPolyfillWorkerBootstrap } from '../../../utils/workerBootstrap';
9
-
10
- interface ArchivePreviewProps {
11
- file: File | null;
12
- }
13
-
14
- export const ArchivePreview: React.FC<ArchivePreviewProps> = ({ file }) => {
15
- const renderers = [
16
- archiveRenderer,
17
- spreadsheetRenderer,
18
- wordRenderer,
19
- pdfRenderer,
20
- textRenderer,
21
- ];
22
-
23
- const options = useMemo(() => ({
24
- locale: 'zh-CN',
25
- rendererMode: 'extend' as const,
26
- renderers: renderers as any,
27
- theme: 'light' as const,
28
- toolbar: {
29
- position: 'bottom-right' as const,
30
- download: false,
31
- print: false,
32
- exportHtml: false,
33
- },
34
- archive: {
35
- workerUrl: withPolyfillWorkerBootstrap('/vendor/libarchive/worker-bundle.js'),
36
- cache: true,
37
- workerTimeoutMs: 30000,
38
- maxArchiveSize: 320 * 1024 * 1024,
39
- maxEntryPreviewSize: 64 * 1024 * 1024,
40
- },
41
- spreadsheet: {
42
- worker: false,
43
- },
44
- }), []);
45
-
46
- return (
47
- <div className="ui-file-preview-archive" style={{ position: 'relative', minHeight: '100vh' }}>
48
- <style>
49
- {`.ui-file-preview-archive .archive-head .archive-sidebar-toggle {
50
- display: none !important;
51
- }
52
- .ui-file-preview-archive .fv-root,
53
- .ui-file-preview-archive .fv-container {
54
- padding-right: 50px !important;
55
- }`}
56
- </style>
57
- {file ? (
58
- <FileViewer
59
- file={file}
60
- name={file.name}
61
- options={options}
62
- />
63
- ) : null}
64
- </div>
65
- );
66
- };
@@ -1,287 +0,0 @@
1
- import React, { useEffect, useMemo, useState, useRef } from 'react';
2
- import { FileViewer, type FileViewerHandle } from '@file-viewer/react';
3
- import type { FileViewerZoomState } from '@file-viewer/core';
4
- import { engineeringRenderers } from '@file-viewer/preset-engineering';
5
- import { withPolyfillModuleWorkerBootstrap } from '../../../utils/workerBootstrap';
6
-
7
- export interface CadPreviewProps {
8
- file: File | null;
9
- }
10
-
11
- export const CadPreview: React.FC<CadPreviewProps> = ({ file }) => {
12
- const [buffer, setBuffer] = useState<ArrayBuffer | null>(null);
13
- const [cssScale, setCssScale] = useState(1);
14
- const containerRef = useRef<HTMLDivElement>(null);
15
- const viewerRef = useRef<FileViewerHandle | null>(null);
16
- const initialDistanceRef = useRef(0);
17
- const baseZoomRef = useRef(1);
18
- const rafIdRef = useRef<number | null>(null);
19
- const pendingScaleRef = useRef(1);
20
- const isPinchingRef = useRef(false);
21
- const lastTouchCountRef = useRef(0);
22
-
23
- useEffect(() => {
24
- if (file) {
25
- const reader = new FileReader();
26
- reader.onload = (e) => {
27
- setBuffer(e.target?.result as ArrayBuffer);
28
- };
29
- reader.readAsArrayBuffer(file);
30
- } else {
31
- setBuffer(null);
32
- }
33
- }, [file]);
34
-
35
- useEffect(() => {
36
- // 保存原始 viewport 设置
37
- const viewportMeta = document.querySelector('meta[name="viewport"]');
38
- const originalContent = viewportMeta?.getAttribute('content') || '';
39
-
40
- // 禁用页面缩放
41
- if (viewportMeta) {
42
- viewportMeta.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no');
43
- }
44
-
45
- // 全局阻止双指缩放到整个页面
46
- const handleGlobalTouchStart = (e: TouchEvent) => {
47
- if (e.touches.length === 2) {
48
- e.preventDefault();
49
- }
50
- };
51
-
52
- const handleGlobalGestureStart = (e: Event) => {
53
- e.preventDefault();
54
- };
55
-
56
- const handleGlobalGestureChange = (e: Event) => {
57
- e.preventDefault();
58
- };
59
-
60
- document.addEventListener('touchstart', handleGlobalTouchStart, { passive: false, capture: true });
61
- document.addEventListener('gesturestart', handleGlobalGestureStart);
62
- document.addEventListener('gesturechange', handleGlobalGestureChange);
63
-
64
- return () => {
65
- // 恢复原始 viewport 设置
66
- if (viewportMeta) {
67
- viewportMeta.setAttribute('content', originalContent);
68
- }
69
-
70
- document.removeEventListener('touchstart', handleGlobalTouchStart, { capture: true });
71
- document.removeEventListener('gesturestart', handleGlobalGestureStart);
72
- document.removeEventListener('gesturechange', handleGlobalGestureChange);
73
- };
74
- }, []);
75
-
76
- useEffect(() => {
77
- const container = containerRef.current;
78
- if (!container) return;
79
-
80
- const restoreTouchAction = () => {
81
- container.style.touchAction = 'pan-x pan-y';
82
- };
83
-
84
- const syncZoomToCad = () => {
85
- const finalScale = pendingScaleRef.current;
86
- const baseScale = baseZoomRef.current;
87
- const ratio = finalScale / baseScale;
88
-
89
- if (Math.abs(ratio - 1) < 0.05) return;
90
-
91
- const steps = Math.round(Math.log(ratio) / Math.log(1.15));
92
- const absSteps = Math.min(Math.abs(steps), 10);
93
-
94
- if (steps > 0) {
95
- for (let i = 0; i < absSteps; i++) {
96
- viewerRef.current?.zoomIn?.();
97
- }
98
- } else if (steps < 0) {
99
- for (let i = 0; i < absSteps; i++) {
100
- viewerRef.current?.zoomOut?.();
101
- }
102
- }
103
- };
104
-
105
- const handleTouchStart = (e: TouchEvent) => {
106
- const touchCount = e.touches.length;
107
-
108
- if (touchCount === 2 && !isPinchingRef.current) {
109
- const dx = e.touches[0].clientX - e.touches[1].clientX;
110
- const dy = e.touches[0].clientY - e.touches[1].clientY;
111
- initialDistanceRef.current = Math.sqrt(dx * dx + dy * dy);
112
-
113
- const zoomState = viewerRef.current?.getZoomState?.();
114
- baseZoomRef.current = zoomState?.scale || 1;
115
- pendingScaleRef.current = baseZoomRef.current;
116
- setCssScale(1);
117
- isPinchingRef.current = true;
118
-
119
- container.style.touchAction = 'none';
120
- e.preventDefault();
121
- e.stopPropagation();
122
- }
123
-
124
- lastTouchCountRef.current = touchCount;
125
- };
126
-
127
- const handleTouchMove = (e: TouchEvent) => {
128
- const touchCount = e.touches.length;
129
-
130
- if (touchCount === 2 && isPinchingRef.current) {
131
- const dx = e.touches[0].clientX - e.touches[1].clientX;
132
- const dy = e.touches[0].clientY - e.touches[1].clientY;
133
- const distance = Math.sqrt(dx * dx + dy * dy);
134
-
135
- if (initialDistanceRef.current > 0) {
136
- const targetScale = baseZoomRef.current * (distance / initialDistanceRef.current);
137
- pendingScaleRef.current = targetScale;
138
-
139
- if (rafIdRef.current === null) {
140
- rafIdRef.current = requestAnimationFrame(() => {
141
- rafIdRef.current = null;
142
- setCssScale(pendingScaleRef.current / baseZoomRef.current);
143
- });
144
- }
145
- }
146
-
147
- e.preventDefault();
148
- e.stopPropagation();
149
- } else if (touchCount < 2 && isPinchingRef.current) {
150
- isPinchingRef.current = false;
151
- syncZoomToCad();
152
-
153
- if (rafIdRef.current !== null) {
154
- cancelAnimationFrame(rafIdRef.current);
155
- rafIdRef.current = null;
156
- }
157
-
158
- setTimeout(() => {
159
- setCssScale(1);
160
- restoreTouchAction();
161
- }, 100);
162
- }
163
-
164
- lastTouchCountRef.current = touchCount;
165
- };
166
-
167
- const handleTouchEnd = (e: TouchEvent) => {
168
- const touchCount = e.touches.length;
169
-
170
- if (isPinchingRef.current && touchCount < 2) {
171
- isPinchingRef.current = false;
172
- syncZoomToCad();
173
-
174
- if (rafIdRef.current !== null) {
175
- cancelAnimationFrame(rafIdRef.current);
176
- rafIdRef.current = null;
177
- }
178
-
179
- setTimeout(() => {
180
- setCssScale(1);
181
- restoreTouchAction();
182
- }, 100);
183
- }
184
-
185
- if (touchCount === 0) {
186
- initialDistanceRef.current = 0;
187
- }
188
-
189
- lastTouchCountRef.current = touchCount;
190
- };
191
-
192
- const handleTouchCancel = () => {
193
- isPinchingRef.current = false;
194
- initialDistanceRef.current = 0;
195
- if (rafIdRef.current !== null) {
196
- cancelAnimationFrame(rafIdRef.current);
197
- rafIdRef.current = null;
198
- }
199
- setCssScale(1);
200
- restoreTouchAction();
201
- lastTouchCountRef.current = 0;
202
- };
203
-
204
- container.addEventListener('touchstart', handleTouchStart, { passive: false, capture: true });
205
- container.addEventListener('touchmove', handleTouchMove, { passive: false, capture: true });
206
- container.addEventListener('touchend', handleTouchEnd, { passive: false, capture: true });
207
- container.addEventListener('touchcancel', handleTouchCancel, { passive: false, capture: true });
208
-
209
- return () => {
210
- container.removeEventListener('touchstart', handleTouchStart, { capture: true });
211
- container.removeEventListener('touchmove', handleTouchMove, { capture: true });
212
- container.removeEventListener('touchend', handleTouchEnd, { capture: true });
213
- container.removeEventListener('touchcancel', handleTouchCancel, { capture: true });
214
-
215
- if (rafIdRef.current !== null) {
216
- cancelAnimationFrame(rafIdRef.current);
217
- }
218
- };
219
- }, [buffer]);
220
-
221
- const options = useMemo(() => ({
222
- locale: 'zh-CN',
223
- rendererMode: 'replace' as const,
224
- renderers: engineeringRenderers,
225
- theme: 'dark' as const,
226
- toolbar: {
227
- position: 'bottom-right' as const,
228
- download: false,
229
- print: false,
230
- exportHtml: false,
231
- },
232
- cad: {
233
- // @flyfish-dev/cad-viewer 固定以 { type: 'module' } 启动 worker,必须用 module 版引导(ESM import 注入 polyfills)
234
- workerUrl: withPolyfillModuleWorkerBootstrap('/wasm/cad/dwg-worker.js'),
235
- wasmPath: '/wasm/cad/',
236
- dwfWasmUrl: '/wasm/cad/dwfv-render.wasm',
237
- // 黑色画布(类 AutoCAD 模型空间);foreground 配合 adaptive 对比度保证图元/文字在黑底上可读
238
- canvasOptions: {
239
- background: '#000000',
240
- foreground: '#ffffff',
241
- },
242
- dwfBackground: '#000000',
243
- },
244
- }), []);
245
-
246
- return (
247
- <div
248
- ref={containerRef}
249
- className="ui-file-preview-cad"
250
- style={{
251
- width: '100%',
252
- height: '100vh',
253
- minHeight: '600px',
254
- touchAction: 'pan-x pan-y',
255
- overflow: 'hidden',
256
- userSelect: 'none',
257
- WebkitUserSelect: 'none'
258
- }}
259
- >
260
- {buffer && file ? (
261
- <div
262
- style={{
263
- width: '100%',
264
- height: '100%',
265
- transform: `scale(${cssScale})`,
266
- transformOrigin: 'center center',
267
- transition: cssScale === 1 ? 'transform 0.1s ease-out' : 'none',
268
- willChange: 'transform'
269
- }}
270
- >
271
- <FileViewer
272
- ref={(handleRef) => {
273
- viewerRef.current = handleRef;
274
- }}
275
- buffer={buffer}
276
- filename={file.name}
277
- name={file.name}
278
- type="dwg"
279
- size={file.size}
280
- options={options}
281
- style={{ width: '100%', height: '100%' }}
282
- />
283
- </div>
284
- ) : null}
285
- </div>
286
- );
287
- };