@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.
- package/dist/api/index.js +1 -0
- package/dist/contract.js +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/index.js +7 -0
- package/{src → dist}/styles/ant-table.css +5 -26
- package/{src → dist}/styles/index.css +8 -8
- package/dist/types/index.js +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/utils/index.js +7 -0
- package/package.json +67 -70
- package/types/api/project.d.ts +10 -1
- package/types/index.d.ts +4 -4
- package/types/types/index.d.ts +1 -3
- package/types/types/project/base.d.ts +6 -1
- package/types/types/project/index.d.ts +1 -0
- package/types/types/project/member.d.ts +1 -1
- package/types/types/{projectRole.d.ts → project/projectRole.d.ts} +2 -2
- package/types/ui/ResizableTable/index.d.ts +7 -0
- package/types/ui/RoleSelector/index.d.ts +7 -1
- package/types/ui/UIFileUpload.d.ts +2 -2
- package/types/ui/index.d.ts +1 -10
- package/types/ui/upload/index.d.ts +6 -0
- package/types/utils/CacheIndexedDB.d.ts +9 -0
- package/types/utils/index.d.ts +2 -2
- package/types/utils/mailto.d.ts +12 -0
- package/public/cmaps/78-EUC-H.bcmap +0 -0
- package/public/cmaps/78-EUC-V.bcmap +0 -0
- package/public/cmaps/78-H.bcmap +0 -0
- package/public/cmaps/78-RKSJ-H.bcmap +0 -0
- package/public/cmaps/78-RKSJ-V.bcmap +0 -0
- package/public/cmaps/78-V.bcmap +0 -0
- package/public/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/public/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/public/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/public/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/public/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/public/cmaps/Add-H.bcmap +0 -0
- package/public/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/public/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/public/cmaps/Add-V.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/public/cmaps/B5-H.bcmap +0 -0
- package/public/cmaps/B5-V.bcmap +0 -0
- package/public/cmaps/B5pc-H.bcmap +0 -0
- package/public/cmaps/B5pc-V.bcmap +0 -0
- package/public/cmaps/CNS-EUC-H.bcmap +0 -0
- package/public/cmaps/CNS-EUC-V.bcmap +0 -0
- package/public/cmaps/CNS1-H.bcmap +0 -0
- package/public/cmaps/CNS1-V.bcmap +0 -0
- package/public/cmaps/CNS2-H.bcmap +0 -0
- package/public/cmaps/CNS2-V.bcmap +0 -3
- package/public/cmaps/ETHK-B5-H.bcmap +0 -0
- package/public/cmaps/ETHK-B5-V.bcmap +0 -0
- package/public/cmaps/ETen-B5-H.bcmap +0 -0
- package/public/cmaps/ETen-B5-V.bcmap +0 -0
- package/public/cmaps/ETenms-B5-H.bcmap +0 -3
- package/public/cmaps/ETenms-B5-V.bcmap +0 -0
- package/public/cmaps/EUC-H.bcmap +0 -0
- package/public/cmaps/EUC-V.bcmap +0 -0
- package/public/cmaps/Ext-H.bcmap +0 -0
- package/public/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/public/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/public/cmaps/Ext-V.bcmap +0 -0
- package/public/cmaps/GB-EUC-H.bcmap +0 -0
- package/public/cmaps/GB-EUC-V.bcmap +0 -0
- package/public/cmaps/GB-H.bcmap +0 -4
- package/public/cmaps/GB-V.bcmap +0 -0
- package/public/cmaps/GBK-EUC-H.bcmap +0 -0
- package/public/cmaps/GBK-EUC-V.bcmap +0 -0
- package/public/cmaps/GBK2K-H.bcmap +0 -0
- package/public/cmaps/GBK2K-V.bcmap +0 -0
- package/public/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/public/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/public/cmaps/GBT-EUC-H.bcmap +0 -0
- package/public/cmaps/GBT-EUC-V.bcmap +0 -0
- package/public/cmaps/GBT-H.bcmap +0 -0
- package/public/cmaps/GBT-V.bcmap +0 -0
- package/public/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/public/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/public/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/public/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/public/cmaps/H.bcmap +0 -0
- package/public/cmaps/HKdla-B5-H.bcmap +0 -0
- package/public/cmaps/HKdla-B5-V.bcmap +0 -0
- package/public/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/public/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/public/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/public/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/public/cmaps/HKm314-B5-H.bcmap +0 -0
- package/public/cmaps/HKm314-B5-V.bcmap +0 -0
- package/public/cmaps/HKm471-B5-H.bcmap +0 -0
- package/public/cmaps/HKm471-B5-V.bcmap +0 -0
- package/public/cmaps/HKscs-B5-H.bcmap +0 -0
- package/public/cmaps/HKscs-B5-V.bcmap +0 -0
- package/public/cmaps/Hankaku.bcmap +0 -0
- package/public/cmaps/Hiragana.bcmap +0 -0
- package/public/cmaps/KSC-EUC-H.bcmap +0 -0
- package/public/cmaps/KSC-EUC-V.bcmap +0 -0
- package/public/cmaps/KSC-H.bcmap +0 -0
- package/public/cmaps/KSC-Johab-H.bcmap +0 -0
- package/public/cmaps/KSC-Johab-V.bcmap +0 -0
- package/public/cmaps/KSC-V.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/public/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/public/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/public/cmaps/Katakana.bcmap +0 -0
- package/public/cmaps/LICENSE +0 -36
- package/public/cmaps/NWP-H.bcmap +0 -0
- package/public/cmaps/NWP-V.bcmap +0 -0
- package/public/cmaps/RKSJ-H.bcmap +0 -0
- package/public/cmaps/RKSJ-V.bcmap +0 -0
- package/public/cmaps/Roman.bcmap +0 -0
- package/public/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/public/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/public/cmaps/V.bcmap +0 -0
- package/public/cmaps/WP-Symbol.bcmap +0 -0
- package/public/polyfills/polyfills.js +0 -802
- package/public/vendor/docx/docx.worker.js +0 -5
- package/public/vendor/docx/jszip.min.js +0 -13
- package/public/vendor/libarchive/libarchive.wasm +0 -0
- package/public/vendor/libarchive/worker-bundle.js +0 -6
- package/public/vendor/pptx/pptx.worker.js +0 -26
- package/public/wasm/cad/0.8.2/dwfv-render.wasm +0 -0
- package/public/wasm/cad/0.8.2/dwg-worker.js +0 -24
- package/public/wasm/cad/0.8.2/dwg-worker.js.map +0 -1
- package/public/wasm/cad/0.8.2/libredwg-web.js +0 -2
- package/public/wasm/cad/0.8.2/libredwg-web.wasm +0 -0
- package/public/wasm/cad/dwfv-render.wasm +0 -0
- package/public/wasm/cad/dwg-worker.js +0 -24
- package/public/wasm/cad/dwg-worker.js.map +0 -1
- package/public/wasm/cad/libredwg-web.js +0 -2
- package/public/wasm/cad/libredwg-web.wasm +0 -0
- package/public/wasm/data/sql-wasm.wasm +0 -0
- package/public/wasm/hdiff.wasm +0 -0
- package/public/wasm/model/LICENSE.occt-import-js.txt +0 -504
- package/public/wasm/model/LICENSE.occt.txt +0 -502
- package/public/wasm/model/occt-import-js.js +0 -19
- package/public/wasm/model/occt-import-js.wasm +0 -0
- package/public/wasm/model/occt-worker.js +0 -83
- package/public/wasm/typst/fonts/DejaVuSansMono-Bold.ttf +0 -0
- package/public/wasm/typst/fonts/DejaVuSansMono-BoldOblique.ttf +0 -0
- package/public/wasm/typst/fonts/DejaVuSansMono-Oblique.ttf +0 -0
- package/public/wasm/typst/fonts/DejaVuSansMono.ttf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Bold.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-BoldItalic.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Italic.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Regular.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Semibold.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-SemiboldItalic.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-Bold.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-BoldItalic.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-Italic.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-Regular.otf +0 -0
- package/public/wasm/typst/fonts/NewCMMath-Bold.otf +0 -0
- package/public/wasm/typst/fonts/NewCMMath-Book.otf +0 -0
- package/public/wasm/typst/fonts/NewCMMath-Regular.otf +0 -0
- package/public/wasm/typst/fonts/README.md +0 -7
- package/public/wasm/typst/typst_ts_renderer_bg.wasm +0 -0
- package/public/wasm/typst/typst_ts_web_compiler_bg.wasm +0 -0
- package/scripts/patch-docx-grid.cjs +0 -412
- package/src/api/_base.ts +0 -243
- package/src/api/index.ts +0 -17
- package/src/api/project.ts +0 -1345
- package/src/api/user.ts +0 -1174
- package/src/contract.ts +0 -50
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useLongPress.ts +0 -137
- package/src/hooks/useOnlineStatus.ts +0 -22
- package/src/index.ts +0 -14
- package/src/types/id.ts +0 -2
- package/src/types/index.ts +0 -5
- package/src/types/project/base.ts +0 -63
- package/src/types/project/contract.ts +0 -79
- package/src/types/project/contractStatus.tsx +0 -15
- package/src/types/project/index.ts +0 -5
- package/src/types/project/member.ts +0 -46
- package/src/types/project/progress.ts +0 -43
- package/src/types/projectRole.ts +0 -17
- package/src/types/theme.ts +0 -1
- package/src/types/user/index.ts +0 -1
- package/src/types/user/role.ts +0 -7
- package/src/ui/CommentTimeline/index.tsx +0 -330
- package/src/ui/FileManager/FileContextMenu.tsx +0 -628
- package/src/ui/FileManager/FileGridView.tsx +0 -529
- package/src/ui/FileManager/FileTableView.tsx +0 -405
- package/src/ui/FileManager/FileToolbar.tsx +0 -119
- package/src/ui/FileManager/FileVersionHistoryModal.tsx +0 -175
- package/src/ui/FileManager/MoveCopyToProjectModal.tsx +0 -119
- package/src/ui/FileManager/ShareToWechatModal.tsx +0 -419
- package/src/ui/FileManager/hooks/useFileManagerActions.ts +0 -2532
- package/src/ui/FileManager/hooks/useFileManagerState.ts +0 -419
- package/src/ui/FileManager/index.tsx +0 -580
- package/src/ui/FileManager/projectFileManagerApi.ts +0 -57
- package/src/ui/FileManager/types.ts +0 -184
- package/src/ui/FileManager/utils/fileDeltaWorker.ts +0 -193
- package/src/ui/FileManager/utils/fileTree.ts +0 -178
- package/src/ui/FileManager/utils/fileUpload.ts +0 -714
- package/src/ui/FileManager/utils/fileUtils.ts +0 -65
- package/src/ui/InvoiceRecordsList/index.tsx +0 -813
- package/src/ui/MyFileSelectorModal.tsx +0 -261
- package/src/ui/ProjectSelector/index.tsx +0 -472
- package/src/ui/ProjectSelector/projectCache.ts +0 -40
- package/src/ui/RoleSelector/index.tsx +0 -473
- package/src/ui/RoleSelector/roleCache.ts +0 -40
- package/src/ui/UIAlert.tsx +0 -399
- package/src/ui/UIAlertExample.tsx +0 -129
- package/src/ui/UIConfirm.tsx +0 -335
- package/src/ui/UIConfirmExample.tsx +0 -165
- package/src/ui/UIDatePicker.tsx +0 -146
- package/src/ui/UIDateRangePicker.tsx +0 -38
- package/src/ui/UIFilePreview/ExcelEditor/index.tsx +0 -617
- package/src/ui/UIFilePreview/ExcelEditor/types.ts +0 -24
- package/src/ui/UIFilePreview/ExportDropdown.css +0 -85
- package/src/ui/UIFilePreview/ExportDropdown.tsx +0 -109
- package/src/ui/UIFilePreview/IndexedDBUtils.ts +0 -564
- package/src/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.ts +0 -576
- package/src/ui/UIFilePreview/MarkdownEditor/index.tsx +0 -677
- package/src/ui/UIFilePreview/MarkdownEditor/markdownEditor.css +0 -1005
- package/src/ui/UIFilePreview/MarkdownEditor/types.ts +0 -15
- package/src/ui/UIFilePreview/PPTXEditor/index.tsx +0 -602
- package/src/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.ts +0 -77
- package/src/ui/UIFilePreview/RichDocEditor/exportRDocPdf.ts +0 -374
- package/src/ui/UIFilePreview/RichDocEditor/index.tsx +0 -730
- package/src/ui/UIFilePreview/RichDocEditor/richdoc-editor.css +0 -59
- package/src/ui/UIFilePreview/UIFilePreview.tsx +0 -611
- package/src/ui/UIFilePreview/WordEditor/index.tsx +0 -3933
- package/src/ui/UIFilePreview/WordEditor/style.ts +0 -1213
- package/src/ui/UIFilePreview/WordEditor/word-editor.css +0 -999
- package/src/ui/UIFilePreview/filePreview.css +0 -193
- package/src/ui/UIFilePreview/filetypes/archive.tsx +0 -66
- package/src/ui/UIFilePreview/filetypes/cad.tsx +0 -287
- package/src/ui/UIFilePreview/filetypes/excel.tsx +0 -355
- package/src/ui/UIFilePreview/filetypes/image.tsx +0 -20
- package/src/ui/UIFilePreview/filetypes/imageLoader.ts +0 -63
- package/src/ui/UIFilePreview/filetypes/pdf.tsx +0 -156
- package/src/ui/UIFilePreview/filetypes/ppt.tsx +0 -535
- package/src/ui/UIFilePreview/filetypes/pptExportPdf.ts +0 -523
- package/src/ui/UIFilePreview/filetypes/video.tsx +0 -482
- package/src/ui/UIFilePreview/filetypes/word.tsx +0 -245
- package/src/ui/UIFilePreview/filetypes/wordExportMarkdown.ts +0 -86
- package/src/ui/UIFilePreview/filetypes/wordExportPdf.tsx +0 -427
- package/src/ui/UIFilePreview/index.ts +0 -35
- package/src/ui/UIFilePreview/pdfPagination.ts +0 -143
- package/src/ui/UIFilePreview/previewUtils.tsx +0 -531
- package/src/ui/UIFileUpload.tsx +0 -382
- package/src/ui/UIImageUpload.tsx +0 -195
- package/src/ui/UILoading.tsx +0 -255
- package/src/ui/UILoadingExample.tsx +0 -139
- package/src/ui/UISelect.tsx +0 -105
- package/src/ui/UIToast.tsx +0 -381
- package/src/ui/UIToastExample.tsx +0 -69
- package/src/ui/UIToastSingle.tsx +0 -279
- package/src/ui/UIViewToggle.tsx +0 -64
- package/src/ui/UserSelector/index.tsx +0 -583
- package/src/ui/index.ts +0 -84
- package/src/ui/upload/image.ts +0 -135
- package/src/ui/upload/index.ts +0 -73
- package/src/ui/upload/submitFile.ts +0 -106
- package/src/ui/upload/submitForm.ts +0 -124
- package/src/ui/upload/upload.err.ts +0 -15
- package/src/ui/upload/upload.ts +0 -250
- package/src/utils/CacheDepartmentInfo.ts +0 -372
- package/src/utils/CacheFileContent.ts +0 -315
- package/src/utils/CachePermissionInfo.ts +0 -235
- package/src/utils/CacheRoleInfo.ts +0 -303
- package/src/utils/CacheUserInfo.ts +0 -818
- package/src/utils/CacheViewToggleInfo.ts +0 -182
- package/src/utils/MessageContentUtils.ts +0 -268
- package/src/utils/clipboard.ts +0 -70
- package/src/utils/companyEmail.ts +0 -19
- package/src/utils/forbidDebugger.ts +0 -59
- package/src/utils/formatters.ts +0 -94
- package/src/utils/htmlUtils.tsx +0 -59
- package/src/utils/index.ts +0 -18
- package/src/utils/keyboard.ts +0 -114
- package/src/utils/mammothApi.ts +0 -16
- package/src/utils/polyfills.ts +0 -928
- package/src/utils/regex.ts +0 -14
- package/src/utils/storage.ts +0 -95
- package/src/utils/workerBootstrap.ts +0 -87
- package/types/hooks.d.ts +0 -5
- package/types/types/user/index.d.ts +0 -1
- package/types/types/user/role.d.ts +0 -7
- package/types/ui/FileManager/FileContextMenu.d.ts +0 -50
- package/types/ui/FileManager/FileGridView.d.ts +0 -51
- package/types/ui/FileManager/FileTableView.d.ts +0 -49
- package/types/ui/FileManager/FileToolbar.d.ts +0 -16
- package/types/ui/FileManager/FileVersionHistoryModal.d.ts +0 -9
- package/types/ui/FileManager/MoveCopyToProjectModal.d.ts +0 -17
- package/types/ui/FileManager/ShareToWechatModal.d.ts +0 -10
- package/types/ui/FileManager/hooks/useFileManagerActions.d.ts +0 -143
- package/types/ui/FileManager/hooks/useFileManagerState.d.ts +0 -146
- package/types/ui/FileManager/index.d.ts +0 -16
- package/types/ui/FileManager/projectFileManagerApi.d.ts +0 -6
- package/types/ui/FileManager/types.d.ts +0 -178
- package/types/ui/FileManager/utils/fileDeltaWorker.d.ts +0 -14
- package/types/ui/FileManager/utils/fileTree.d.ts +0 -7
- package/types/ui/FileManager/utils/fileUpload.d.ts +0 -60
- package/types/ui/FileManager/utils/fileUtils.d.ts +0 -26
- package/types/ui/InvoiceRecordsList/index.d.ts +0 -43
- package/types/ui/MyFileSelectorModal.d.ts +0 -16
- package/types/ui/UIFilePreview/ExcelEditor/index.d.ts +0 -20
- package/types/ui/UIFilePreview/ExcelEditor/types.d.ts +0 -29
- package/types/ui/UIFilePreview/ExportDropdown.d.ts +0 -26
- package/types/ui/UIFilePreview/IndexedDBUtils.d.ts +0 -109
- package/types/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.d.ts +0 -27
- package/types/ui/UIFilePreview/MarkdownEditor/index.d.ts +0 -34
- package/types/ui/UIFilePreview/MarkdownEditor/types.d.ts +0 -14
- package/types/ui/UIFilePreview/PPTXEditor/index.d.ts +0 -19
- package/types/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.d.ts +0 -23
- package/types/ui/UIFilePreview/RichDocEditor/exportRDocPdf.d.ts +0 -22
- package/types/ui/UIFilePreview/RichDocEditor/index.d.ts +0 -39
- package/types/ui/UIFilePreview/UIFilePreview.d.ts +0 -34
- package/types/ui/UIFilePreview/WordEditor/index.d.ts +0 -20
- package/types/ui/UIFilePreview/WordEditor/style.d.ts +0 -81
- package/types/ui/UIFilePreview/filetypes/archive.d.ts +0 -6
- package/types/ui/UIFilePreview/filetypes/cad.d.ts +0 -5
- package/types/ui/UIFilePreview/filetypes/excel.d.ts +0 -6
- package/types/ui/UIFilePreview/filetypes/image.d.ts +0 -6
- package/types/ui/UIFilePreview/filetypes/imageLoader.d.ts +0 -7
- package/types/ui/UIFilePreview/filetypes/pdf.d.ts +0 -7
- package/types/ui/UIFilePreview/filetypes/ppt.d.ts +0 -5
- package/types/ui/UIFilePreview/filetypes/pptExportPdf.d.ts +0 -28
- package/types/ui/UIFilePreview/filetypes/video.d.ts +0 -6
- package/types/ui/UIFilePreview/filetypes/word.d.ts +0 -5
- package/types/ui/UIFilePreview/filetypes/wordExportMarkdown.d.ts +0 -19
- package/types/ui/UIFilePreview/filetypes/wordExportPdf.d.ts +0 -32
- package/types/ui/UIFilePreview/index.d.ts +0 -46
- package/types/ui/UIFilePreview/pdfPagination.d.ts +0 -25
- package/types/ui/UIFilePreview/previewUtils.d.ts +0 -62
- package/types/ui.d.ts +0 -5
- package/types/utils/CacheFileContent.d.ts +0 -31
- package/types/utils/mammothApi.d.ts +0 -14
- package/types/utils.d.ts +0 -5
- /package/{src → dist}/styles/ant-modal.css +0 -0
- /package/{src → dist}/styles/ant-spin.css +0 -0
|
@@ -1,529 +0,0 @@
|
|
|
1
|
-
import React, { memo, useMemo, useEffect } from 'react';
|
|
2
|
-
import { useLongPress } from '../../hooks/useLongPress';
|
|
3
|
-
import { Button } from 'antd';
|
|
4
|
-
import { ProjectFile, FileSortBy } from './types';
|
|
5
|
-
import { formatDisksize } from '../../utils/formatters';
|
|
6
|
-
import { uiFilePreview } from '../UIFilePreview/index';
|
|
7
|
-
import { FileContextMenu } from './FileContextMenu';
|
|
8
|
-
import { htmlNoData } from '../../utils/htmlUtils';
|
|
9
|
-
import { CheckOutlined, WarningOutlined, CloudOutlined, LinkOutlined, SortAscendingOutlined, SortDescendingOutlined } from '@ant-design/icons';
|
|
10
|
-
import { getDisplayName } from './utils/fileUtils';
|
|
11
|
-
import { sortTree } from './utils/fileTree';
|
|
12
|
-
|
|
13
|
-
interface FileGridViewProps {
|
|
14
|
-
dataSource: ProjectFile[];
|
|
15
|
-
selectedFolderId: string | null;
|
|
16
|
-
dragOverId: string | null;
|
|
17
|
-
dragSourceId: string | null;
|
|
18
|
-
isFolderExpanded: (folderId: string) => boolean;
|
|
19
|
-
smallView: boolean;
|
|
20
|
-
onPreview: (file: ProjectFile) => void;
|
|
21
|
-
onDownload: (file: ProjectFile) => void;
|
|
22
|
-
/** 下载文件夹回调(仅管理员/负责人提供) */
|
|
23
|
-
onDownloadFolder?: (file: ProjectFile) => void;
|
|
24
|
-
/** 复制链接回调(未提供时不显示「复制链接」) */
|
|
25
|
-
onCopyLink?: (file: ProjectFile) => void;
|
|
26
|
-
onRename: (file: ProjectFile) => void;
|
|
27
|
-
onEditDescs: (file: ProjectFile) => void;
|
|
28
|
-
onDelete: (fileId: string) => void;
|
|
29
|
-
onEdit?: (file: ProjectFile) => void;
|
|
30
|
-
/** 生成临时文件链接回调 */
|
|
31
|
-
onGenerateTempLink?: (file: ProjectFile) => void;
|
|
32
|
-
/** 切换当前目录(传入文件夹 ID,null 表示根目录) */
|
|
33
|
-
onFolderChange: (folderId: string | null) => void;
|
|
34
|
-
onMove: (sourceId: string, targetId: string) => void;
|
|
35
|
-
onDragStart: (fileId: string) => void;
|
|
36
|
-
onDragEnd: () => void;
|
|
37
|
-
onDragOver: (fileId: string) => void;
|
|
38
|
-
onDragLeave: (fileId: string) => void;
|
|
39
|
-
onDrop: (sourceId: string, targetId: string) => void;
|
|
40
|
-
onRowContextMenu: (event: React.MouseEvent, record: ProjectFile) => void;
|
|
41
|
-
/** 移动到其他项目回调 */
|
|
42
|
-
onMoveToProject?: (file: ProjectFile) => void;
|
|
43
|
-
/** 复制到其他项目回调 */
|
|
44
|
-
onCopyToProject?: (file: ProjectFile) => void;
|
|
45
|
-
/** 复制副本回调 */
|
|
46
|
-
onCopyToSelf?: (file: ProjectFile) => void;
|
|
47
|
-
/** 查看文件历史版本回调 */
|
|
48
|
-
onViewVersionHistory?: (file: ProjectFile) => void;
|
|
49
|
-
/** 跳转至合同回调 */
|
|
50
|
-
onJumpToContract?: (file: ProjectFile) => void;
|
|
51
|
-
/** 排序字段 */
|
|
52
|
-
sortBy: FileSortBy;
|
|
53
|
-
/** 排序顺序 */
|
|
54
|
-
sortOrder: 'asc' | 'desc';
|
|
55
|
-
/** 切换排序字段回调(如果是相同字段则切换顺序) */
|
|
56
|
-
onSortByChange: (by: FileSortBy) => void;
|
|
57
|
-
/** 切换排序顺序回调 */
|
|
58
|
-
onSortOrderToggle: () => void;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface FileGridItemProps {
|
|
62
|
-
item: ProjectFile;
|
|
63
|
-
level: number;
|
|
64
|
-
selectedFolderId: string | null;
|
|
65
|
-
dragOverId: string | null;
|
|
66
|
-
isFolderExpanded: (folderId: string) => boolean;
|
|
67
|
-
smallView: boolean;
|
|
68
|
-
onPreview: (file: ProjectFile) => void;
|
|
69
|
-
onDownload: (file: ProjectFile) => void;
|
|
70
|
-
/** 下载文件夹回调(仅管理员/负责人提供) */
|
|
71
|
-
onDownloadFolder?: (file: ProjectFile) => void;
|
|
72
|
-
/** 复制链接回调(未提供时不显示「复制链接」) */
|
|
73
|
-
onCopyLink?: (file: ProjectFile) => void;
|
|
74
|
-
onRename: (file: ProjectFile) => void;
|
|
75
|
-
onEditDescs: (file: ProjectFile) => void;
|
|
76
|
-
onDelete: (fileId: string) => void;
|
|
77
|
-
onEdit?: (file: ProjectFile) => void;
|
|
78
|
-
/** 生成临时文件链接回调 */
|
|
79
|
-
onGenerateTempLink?: (file: ProjectFile) => void;
|
|
80
|
-
onToggleExpand: (record: ProjectFile) => void;
|
|
81
|
-
onMove: (sourceId: string, targetId: string) => void;
|
|
82
|
-
onDragStart: (fileId: string) => void;
|
|
83
|
-
onDragEnd: () => void;
|
|
84
|
-
onDragOver: (fileId: string) => void;
|
|
85
|
-
onDragLeave: (fileId: string) => void;
|
|
86
|
-
onDrop: (sourceId: string, targetId: string) => void;
|
|
87
|
-
onRowContextMenu: (event: React.MouseEvent, record: ProjectFile) => void;
|
|
88
|
-
/** 移动到其他项目回调 */
|
|
89
|
-
onMoveToProject?: (file: ProjectFile) => void;
|
|
90
|
-
/** 复制到其他项目回调 */
|
|
91
|
-
onCopyToProject?: (file: ProjectFile) => void;
|
|
92
|
-
/** 复制副本回调 */
|
|
93
|
-
onCopyToSelf?: (file: ProjectFile) => void;
|
|
94
|
-
/** 查看文件历史版本回调 */
|
|
95
|
-
onViewVersionHistory?: (file: ProjectFile) => void;
|
|
96
|
-
/** 跳转至合同回调 */
|
|
97
|
-
onJumpToContract?: (file: ProjectFile) => void;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const FileGridItem: React.FC<FileGridItemProps> = ({
|
|
101
|
-
item,
|
|
102
|
-
level,
|
|
103
|
-
selectedFolderId,
|
|
104
|
-
dragOverId,
|
|
105
|
-
isFolderExpanded,
|
|
106
|
-
smallView,
|
|
107
|
-
onPreview,
|
|
108
|
-
onDownload,
|
|
109
|
-
onDownloadFolder,
|
|
110
|
-
onCopyLink,
|
|
111
|
-
onRename,
|
|
112
|
-
onEditDescs,
|
|
113
|
-
onDelete,
|
|
114
|
-
onEdit,
|
|
115
|
-
onGenerateTempLink,
|
|
116
|
-
onToggleExpand,
|
|
117
|
-
onMove,
|
|
118
|
-
onDragStart,
|
|
119
|
-
onDragEnd,
|
|
120
|
-
onDragOver,
|
|
121
|
-
onDragLeave,
|
|
122
|
-
onDrop,
|
|
123
|
-
onRowContextMenu,
|
|
124
|
-
onMoveToProject,
|
|
125
|
-
onCopyToProject,
|
|
126
|
-
onCopyToSelf,
|
|
127
|
-
onViewVersionHistory,
|
|
128
|
-
onJumpToContract,
|
|
129
|
-
}) => {
|
|
130
|
-
const { handleTouchStart, handleTouchMove, handleTouchEnd, handleTouchCancel, wasLongPressed, resetLongPress } = useLongPress<ProjectFile>(
|
|
131
|
-
(record, e) => {
|
|
132
|
-
const touch = e.touches[0];
|
|
133
|
-
const mockEvent = {
|
|
134
|
-
preventDefault: () => {},
|
|
135
|
-
stopPropagation: () => {},
|
|
136
|
-
clientX: touch.clientX,
|
|
137
|
-
clientY: touch.clientY,
|
|
138
|
-
} as unknown as React.MouseEvent;
|
|
139
|
-
onRowContextMenu(mockEvent, record);
|
|
140
|
-
},
|
|
141
|
-
{ delay: 500, smallView }
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
const getItemClass = () => {
|
|
145
|
-
const classes = [
|
|
146
|
-
'relative',
|
|
147
|
-
'p-4',
|
|
148
|
-
'rounded-lg',
|
|
149
|
-
'cursor-pointer',
|
|
150
|
-
'hover:bg-tableHover',
|
|
151
|
-
'hover:-translate-y-px',
|
|
152
|
-
'hover:shadow-sm',
|
|
153
|
-
'transition-all',
|
|
154
|
-
'duration-200',
|
|
155
|
-
];
|
|
156
|
-
|
|
157
|
-
if (item.fileType === 'folder' && item.id === selectedFolderId) {
|
|
158
|
-
classes.push('bg-blue-100');
|
|
159
|
-
} else if (item.fileType === 'folder' && dragOverId === item.id) {
|
|
160
|
-
classes.push('bg-blue-50');
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return classes.join(' ');
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const getItemTitle = () => {
|
|
167
|
-
let title = '位置:' + (item.filePath === '/' ? '/' : item.filePath.slice(0, item.filePath.length - 1));
|
|
168
|
-
if (item.isSecure) {
|
|
169
|
-
title += '(仅管理员可见)';
|
|
170
|
-
}
|
|
171
|
-
if (item.isContractLink) {
|
|
172
|
-
title += '(合同附件)';
|
|
173
|
-
}
|
|
174
|
-
if (item.isContractSubfolder && item.contractSigned === false) {
|
|
175
|
-
title += '(未签约)';
|
|
176
|
-
}
|
|
177
|
-
return title;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
/** 未签约的合同子文件夹/附件:整体弱化显示 */
|
|
181
|
-
const isUnsignedContractItem = (item.isContractSubfolder || item.isContractLink) && item.contractSigned === false;
|
|
182
|
-
|
|
183
|
-
const handleDragOver = (e: React.DragEvent) => {
|
|
184
|
-
if (item.fileType === 'folder') {
|
|
185
|
-
e.preventDefault();
|
|
186
|
-
onDragOver(item.id);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
const handleDragLeave = () => {
|
|
191
|
-
if (dragOverId === item.id) {
|
|
192
|
-
onDragLeave(item.id);
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
const handleDrop = (e: React.DragEvent) => {
|
|
197
|
-
if (item.fileType === 'folder') {
|
|
198
|
-
e.preventDefault();
|
|
199
|
-
const sourceId = e.dataTransfer.getData('text/plain');
|
|
200
|
-
if (sourceId) {
|
|
201
|
-
onMove(sourceId, item.id);
|
|
202
|
-
}
|
|
203
|
-
onDragLeave(item.id);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const handleDoubleClick = () => {
|
|
208
|
-
if (item.fileType !== 'folder') {
|
|
209
|
-
onPreview(item);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const handleClick = () => {
|
|
214
|
-
if (!wasLongPressed(item)) {
|
|
215
|
-
if (item.fileType === 'folder') {
|
|
216
|
-
onToggleExpand(item);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
resetLongPress(item);
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
return (
|
|
223
|
-
<div
|
|
224
|
-
key={item.id}
|
|
225
|
-
title={getItemTitle()}
|
|
226
|
-
className={getItemClass()}
|
|
227
|
-
style={{ marginLeft: `${level * 16}px`, opacity: isUnsignedContractItem ? 0.55 : undefined }}
|
|
228
|
-
draggable={!item.isContractLink && !item.isVirtualContractFolder && !item.isContractSubfolder && !item.isContractTagFolder}
|
|
229
|
-
onDragStart={(e) => {
|
|
230
|
-
if (item.isContractLink || item.isVirtualContractFolder || item.isContractSubfolder || item.isContractTagFolder) {
|
|
231
|
-
e.preventDefault();
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
e.dataTransfer.setData('text/plain', item.id);
|
|
235
|
-
onDragStart(item.id);
|
|
236
|
-
}}
|
|
237
|
-
onDragEnd={() => {
|
|
238
|
-
onDragEnd();
|
|
239
|
-
}}
|
|
240
|
-
onDragOver={handleDragOver}
|
|
241
|
-
onDragLeave={handleDragLeave}
|
|
242
|
-
onDrop={handleDrop}
|
|
243
|
-
onDoubleClick={handleDoubleClick}
|
|
244
|
-
onClick={handleClick}
|
|
245
|
-
onTouchStart={handleTouchStart(item)}
|
|
246
|
-
onTouchMove={handleTouchMove(item)}
|
|
247
|
-
onTouchEnd={handleTouchEnd(item)}
|
|
248
|
-
onTouchCancel={handleTouchCancel(item)}
|
|
249
|
-
onContextMenu={(e) => {
|
|
250
|
-
e.preventDefault();
|
|
251
|
-
e.stopPropagation();
|
|
252
|
-
onRowContextMenu(e, item);
|
|
253
|
-
}}
|
|
254
|
-
>
|
|
255
|
-
<div className="flex flex-col items-center text-center">
|
|
256
|
-
<div className="relative mb-2">
|
|
257
|
-
<div className="text-4xl">
|
|
258
|
-
{uiFilePreview.getFileIcon({
|
|
259
|
-
fileName: item.fileName,
|
|
260
|
-
fileType: item.fileType,
|
|
261
|
-
isExpanded: isFolderExpanded(item.id),
|
|
262
|
-
isSecure: item.isSecure,
|
|
263
|
-
isVirtualContractFolder: item.isVirtualContractFolder,
|
|
264
|
-
isContractSubfolder: item.isContractSubfolder,
|
|
265
|
-
isContractTagFolder: item.isContractTagFolder,
|
|
266
|
-
contractSigned: item.contractSigned,
|
|
267
|
-
size: 32,
|
|
268
|
-
})}
|
|
269
|
-
</div>
|
|
270
|
-
{item.isContractLink && (
|
|
271
|
-
<span
|
|
272
|
-
className="absolute -top-1 -left-1 flex h-4 w-4 items-center justify-center rounded-full text-white text-[10px] shadow-sm"
|
|
273
|
-
style={{ backgroundColor: '#52c41a' }}
|
|
274
|
-
title="合同附件"
|
|
275
|
-
>
|
|
276
|
-
<LinkOutlined />
|
|
277
|
-
</span>
|
|
278
|
-
)}
|
|
279
|
-
{item.isLocalOnly && (
|
|
280
|
-
<span
|
|
281
|
-
className="absolute -top-1 -left-1 flex h-4 w-4 items-center justify-center rounded-full text-white text-[10px] shadow-sm"
|
|
282
|
-
style={{ backgroundColor: '#fa8c16' }}
|
|
283
|
-
title="仅保存在本地,尚未上传到服务器"
|
|
284
|
-
>
|
|
285
|
-
<CloudOutlined />
|
|
286
|
-
</span>
|
|
287
|
-
)}
|
|
288
|
-
{!item.isLocalOnly && item.hasUnsyncedChanges && (
|
|
289
|
-
<span
|
|
290
|
-
className="absolute -top-1 -left-1 flex h-4 w-4 items-center justify-center rounded-full text-white text-[10px] shadow-sm"
|
|
291
|
-
style={{ backgroundColor: '#faad14' }}
|
|
292
|
-
title="本地有未同步的修改,重新上传后可与服务器一致"
|
|
293
|
-
>
|
|
294
|
-
<WarningOutlined className="w-2.5 h-2.5" />
|
|
295
|
-
</span>
|
|
296
|
-
)}
|
|
297
|
-
{item.hasLocalCache && (
|
|
298
|
-
<span className="absolute -top-1 -right-1 flex h-3 w-3 items-center justify-center rounded-full bg-green-600 text-white text-xs">
|
|
299
|
-
<CheckOutlined className="w-2 h-2" />
|
|
300
|
-
</span>
|
|
301
|
-
)}
|
|
302
|
-
</div>
|
|
303
|
-
<div
|
|
304
|
-
className={`text-sm w-full`}
|
|
305
|
-
style={{
|
|
306
|
-
display: '-webkit-box',
|
|
307
|
-
WebkitLineClamp: 2,
|
|
308
|
-
WebkitBoxOrient: 'vertical',
|
|
309
|
-
overflow: 'hidden',
|
|
310
|
-
wordBreak: 'break-all',
|
|
311
|
-
lineHeight: '1.3em',
|
|
312
|
-
maxHeight: '2.6em',
|
|
313
|
-
}}
|
|
314
|
-
title={item.isContractLink ? `合同附件${item.descs ? `(${item.descs})` : ''}` : getDisplayName(item.fileName, { isVirtualContractFolder: item.isVirtualContractFolder, isContractSubfolder: item.isContractSubfolder, descs: item.descs })}
|
|
315
|
-
>
|
|
316
|
-
{item.isLocalOnly && (
|
|
317
|
-
<span
|
|
318
|
-
className="mr-1 inline-flex items-center text-[10px] px-1 rounded"
|
|
319
|
-
style={{ backgroundColor: '#fff7e6', color: '#d46b08', border: '1px solid #ffd591' }}
|
|
320
|
-
>
|
|
321
|
-
本地
|
|
322
|
-
</span>
|
|
323
|
-
)}
|
|
324
|
-
{!item.isLocalOnly && item.hasUnsyncedChanges && (
|
|
325
|
-
<span
|
|
326
|
-
className="mr-1 inline-flex items-center text-[10px] px-1 rounded"
|
|
327
|
-
style={{ backgroundColor: '#fffbe6', color: '#ad6800', border: '1px solid #ffe58f' }}
|
|
328
|
-
>
|
|
329
|
-
未同步
|
|
330
|
-
</span>
|
|
331
|
-
)}
|
|
332
|
-
{item.isContractSubfolder && item.contractSigned === false && (
|
|
333
|
-
<span
|
|
334
|
-
className="mr-1 inline-flex items-center text-[10px] px-1 rounded"
|
|
335
|
-
style={{ backgroundColor: '#f3f4f6', color: '#6b7280', border: '1px solid #d1d5db' }}
|
|
336
|
-
>
|
|
337
|
-
未签约
|
|
338
|
-
</span>
|
|
339
|
-
)}
|
|
340
|
-
<span className="text-sm">{getDisplayName(item.fileName, { isVirtualContractFolder: item.isVirtualContractFolder, isContractSubfolder: item.isContractSubfolder, descs: item.descs })}</span>
|
|
341
|
-
</div>
|
|
342
|
-
<div className="text-xs text-gray-400 mt-1">
|
|
343
|
-
{item.fileSize > 0 ? formatDisksize(item.fileSize) : ''}
|
|
344
|
-
</div>
|
|
345
|
-
</div>
|
|
346
|
-
<FileContextMenu
|
|
347
|
-
record={item}
|
|
348
|
-
onPreview={onPreview}
|
|
349
|
-
onDownload={onDownload}
|
|
350
|
-
onDownloadFolder={onDownloadFolder}
|
|
351
|
-
onCopyLink={onCopyLink}
|
|
352
|
-
onRename={onRename}
|
|
353
|
-
onEditDescs={onEditDescs}
|
|
354
|
-
onDelete={onDelete}
|
|
355
|
-
onEdit={onEdit}
|
|
356
|
-
onGenerateTempLink={onGenerateTempLink}
|
|
357
|
-
onMoveToProject={onMoveToProject}
|
|
358
|
-
onCopyToProject={onCopyToProject}
|
|
359
|
-
onCopyToSelf={onCopyToSelf}
|
|
360
|
-
onViewVersionHistory={onViewVersionHistory}
|
|
361
|
-
onJumpToContract={onJumpToContract}
|
|
362
|
-
trigger="click"
|
|
363
|
-
placement="bottomRight"
|
|
364
|
-
className="absolute top-2 right-2 z-10"
|
|
365
|
-
/>
|
|
366
|
-
</div>
|
|
367
|
-
);
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
const FileGridViewComponent: React.FC<FileGridViewProps> = ({
|
|
371
|
-
dataSource,
|
|
372
|
-
selectedFolderId,
|
|
373
|
-
dragOverId,
|
|
374
|
-
isFolderExpanded,
|
|
375
|
-
smallView,
|
|
376
|
-
onPreview,
|
|
377
|
-
onDownload,
|
|
378
|
-
onDownloadFolder,
|
|
379
|
-
onCopyLink,
|
|
380
|
-
onRename,
|
|
381
|
-
onEditDescs,
|
|
382
|
-
onDelete,
|
|
383
|
-
onEdit,
|
|
384
|
-
onGenerateTempLink,
|
|
385
|
-
onFolderChange,
|
|
386
|
-
onMove,
|
|
387
|
-
onDragStart,
|
|
388
|
-
onDragEnd,
|
|
389
|
-
onDragOver,
|
|
390
|
-
onDragLeave,
|
|
391
|
-
onDrop,
|
|
392
|
-
onRowContextMenu,
|
|
393
|
-
onMoveToProject,
|
|
394
|
-
onCopyToProject,
|
|
395
|
-
onCopyToSelf,
|
|
396
|
-
onViewVersionHistory,
|
|
397
|
-
onJumpToContract,
|
|
398
|
-
sortBy,
|
|
399
|
-
sortOrder,
|
|
400
|
-
onSortByChange,
|
|
401
|
-
onSortOrderToggle,
|
|
402
|
-
}) => {
|
|
403
|
-
// 排序后的数据
|
|
404
|
-
const sortedDataSource = useMemo(() => {
|
|
405
|
-
return sortTree(dataSource, sortBy, sortOrder);
|
|
406
|
-
}, [dataSource, sortBy, sortOrder]);
|
|
407
|
-
|
|
408
|
-
// 建立 id → 节点映射,用于按当前目录取子项
|
|
409
|
-
const folderMap = useMemo(() => {
|
|
410
|
-
const map = new Map<string, ProjectFile>();
|
|
411
|
-
const walk = (items: ProjectFile[]) => {
|
|
412
|
-
items.forEach((item) => {
|
|
413
|
-
map.set(item.id, item);
|
|
414
|
-
if (item.children && item.children.length > 0) {
|
|
415
|
-
walk(item.children);
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
};
|
|
419
|
-
walk(sortedDataSource);
|
|
420
|
-
return map;
|
|
421
|
-
}, [sortedDataSource]);
|
|
422
|
-
|
|
423
|
-
// selectedFolderId 为空表示根目录;进入目录后只展示该目录下的文件夹与文件
|
|
424
|
-
const currentFolder = selectedFolderId ? folderMap.get(selectedFolderId) : undefined;
|
|
425
|
-
const displayItems = currentFolder ? currentFolder.children || [] : sortedDataSource;
|
|
426
|
-
|
|
427
|
-
// 当前目录已不存在(如数据刷新、排序方式变化导致目录重建)时回到根目录
|
|
428
|
-
useEffect(() => {
|
|
429
|
-
if (selectedFolderId && !folderMap.has(selectedFolderId)) {
|
|
430
|
-
onFolderChange(null);
|
|
431
|
-
}
|
|
432
|
-
}, [selectedFolderId, folderMap, onFolderChange]);
|
|
433
|
-
|
|
434
|
-
const renderGridItems = (items: ProjectFile[]): React.ReactNode[] => {
|
|
435
|
-
return items.map((item) => (
|
|
436
|
-
<FileGridItem
|
|
437
|
-
key={item.id}
|
|
438
|
-
item={item}
|
|
439
|
-
level={0}
|
|
440
|
-
selectedFolderId={selectedFolderId}
|
|
441
|
-
dragOverId={dragOverId}
|
|
442
|
-
isFolderExpanded={isFolderExpanded}
|
|
443
|
-
smallView={smallView}
|
|
444
|
-
onPreview={onPreview}
|
|
445
|
-
onDownload={onDownload}
|
|
446
|
-
onDownloadFolder={onDownloadFolder}
|
|
447
|
-
onCopyLink={onCopyLink}
|
|
448
|
-
onRename={onRename}
|
|
449
|
-
onEditDescs={onEditDescs}
|
|
450
|
-
onDelete={onDelete}
|
|
451
|
-
onEdit={onEdit}
|
|
452
|
-
onGenerateTempLink={onGenerateTempLink}
|
|
453
|
-
onToggleExpand={(record) => onFolderChange(record.id)}
|
|
454
|
-
onMove={onMove}
|
|
455
|
-
onDragStart={onDragStart}
|
|
456
|
-
onDragEnd={onDragEnd}
|
|
457
|
-
onDragOver={onDragOver}
|
|
458
|
-
onDragLeave={onDragLeave}
|
|
459
|
-
onDrop={onDrop}
|
|
460
|
-
onRowContextMenu={onRowContextMenu}
|
|
461
|
-
onMoveToProject={onMoveToProject}
|
|
462
|
-
onCopyToProject={onCopyToProject}
|
|
463
|
-
onCopyToSelf={onCopyToSelf}
|
|
464
|
-
onViewVersionHistory={onViewVersionHistory}
|
|
465
|
-
onJumpToContract={onJumpToContract}
|
|
466
|
-
/>
|
|
467
|
-
));
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
return dataSource.length == 0
|
|
471
|
-
? (<div className="flex items-center justify-center">{htmlNoData()}</div>)
|
|
472
|
-
: (
|
|
473
|
-
<div>
|
|
474
|
-
{/* 排序控制栏 */}
|
|
475
|
-
<div className="flex items-center gap-2 mb-2 mt-2 px-2 flex-wrap">
|
|
476
|
-
<Button
|
|
477
|
-
type={sortBy === 'fileName' ? 'primary' : 'default'}
|
|
478
|
-
size="small"
|
|
479
|
-
onClick={() => onSortByChange('fileName')}
|
|
480
|
-
style={{ touchAction: 'manipulation' }}
|
|
481
|
-
>
|
|
482
|
-
按名称
|
|
483
|
-
</Button>
|
|
484
|
-
<Button
|
|
485
|
-
type={sortBy === 'fileType' ? 'primary' : 'default'}
|
|
486
|
-
size="small"
|
|
487
|
-
onClick={() => onSortByChange('fileType')}
|
|
488
|
-
style={{ touchAction: 'manipulation' }}
|
|
489
|
-
>
|
|
490
|
-
按类型
|
|
491
|
-
</Button>
|
|
492
|
-
<Button
|
|
493
|
-
type={sortBy === 'fileSize' ? 'primary' : 'default'}
|
|
494
|
-
size="small"
|
|
495
|
-
onClick={() => onSortByChange('fileSize')}
|
|
496
|
-
style={{ touchAction: 'manipulation' }}
|
|
497
|
-
>
|
|
498
|
-
按大小
|
|
499
|
-
</Button>
|
|
500
|
-
<Button
|
|
501
|
-
type={sortBy === 'uploadTime' ? 'primary' : 'default'}
|
|
502
|
-
size="small"
|
|
503
|
-
onClick={() => onSortByChange('uploadTime')}
|
|
504
|
-
style={{ touchAction: 'manipulation' }}
|
|
505
|
-
>
|
|
506
|
-
按时间
|
|
507
|
-
</Button>
|
|
508
|
-
<Button
|
|
509
|
-
type="text"
|
|
510
|
-
size="small"
|
|
511
|
-
icon={sortOrder === 'asc' ? <SortAscendingOutlined /> : <SortDescendingOutlined />}
|
|
512
|
-
onClick={onSortOrderToggle}
|
|
513
|
-
title={sortOrder === 'asc' ? '升序(点击切换为降序)' : '降序(点击切换为升序)'}
|
|
514
|
-
style={{ touchAction: 'manipulation' }}
|
|
515
|
-
>
|
|
516
|
-
{sortOrder === 'asc' ? '升序' : '降序'}
|
|
517
|
-
</Button>
|
|
518
|
-
</div>
|
|
519
|
-
<div className="grid grid-cols-3 sm:grid-cols-6 md:grid-cols-8 lg:grid-cols-10 xl:grid-cols-12 p-4">
|
|
520
|
-
{renderGridItems(displayItems)}
|
|
521
|
-
{currentFolder && displayItems.length === 0 && (
|
|
522
|
-
<div className="col-span-full text-center text-sm text-gray-400 py-6">该目录为空</div>
|
|
523
|
-
)}
|
|
524
|
-
</div>
|
|
525
|
-
</div>
|
|
526
|
-
);
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
export const FileGridView = memo(FileGridViewComponent);
|