@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,261 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import type { Key } from 'react';
|
|
3
|
-
import { ReloadOutlined } from '@ant-design/icons';
|
|
4
|
-
import { Button, Empty, Input, Modal, Spin, Tree, message } from 'antd';
|
|
5
|
-
import type { DataNode } from 'antd/es/tree';
|
|
6
|
-
import { API } from '../api/index';
|
|
7
|
-
import { ResponseCode } from '../api/_base';
|
|
8
|
-
import type { ProjectFile } from './FileManager/types';
|
|
9
|
-
import { buildFileTree, sortFiles } from './FileManager/utils/fileTree';
|
|
10
|
-
import { filterNotesRootFiles } from './FileManager/utils/fileUtils';
|
|
11
|
-
import { uiFilePreview } from './UIFilePreview/index';
|
|
12
|
-
import { CacheUserInfo } from '../utils/CacheUserInfo';
|
|
13
|
-
|
|
14
|
-
interface MyFileSelectorModalProps {
|
|
15
|
-
open: boolean;
|
|
16
|
-
confirmLoading?: boolean;
|
|
17
|
-
title?: string;
|
|
18
|
-
searchPlaceholder?: string;
|
|
19
|
-
selectionMode?: 'single' | 'multiple';
|
|
20
|
-
okText?: string | ((selectedFiles: ProjectFile[]) => string);
|
|
21
|
-
emptyDescription?: string;
|
|
22
|
-
helperText?: string | ((selectedFiles: ProjectFile[]) => string);
|
|
23
|
-
fileFilter?: (file: ProjectFile) => boolean;
|
|
24
|
-
onCancel: () => void;
|
|
25
|
-
onConfirm: (files: ProjectFile[]) => void | Promise<void>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const isFolderFile = (file: ProjectFile) => file.fileType === 'folder';
|
|
29
|
-
|
|
30
|
-
const formatFileSize = (size?: number) => {
|
|
31
|
-
if (!size || size <= 0) {
|
|
32
|
-
return '';
|
|
33
|
-
}
|
|
34
|
-
if (size < 1024) {
|
|
35
|
-
return `${size} B`;
|
|
36
|
-
}
|
|
37
|
-
if (size < 1024 * 1024) {
|
|
38
|
-
return `${(size / 1024).toFixed(1)} KB`;
|
|
39
|
-
}
|
|
40
|
-
return `${(size / 1024 / 1024).toFixed(1)} MB`;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const flattenFiles = (files: ProjectFile[]): ProjectFile[] =>
|
|
44
|
-
files.flatMap((file) => [file, ...flattenFiles(file.children || [])]);
|
|
45
|
-
|
|
46
|
-
const getFileDisplayPath = (file: ProjectFile) => {
|
|
47
|
-
const folderPath = file.filePath && file.filePath !== '/' ? file.filePath : '/';
|
|
48
|
-
return `${folderPath}${folderPath.endsWith('/') ? '' : '/'}${file.fileName}`;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const getDefaultOkText = (selectedFiles: ProjectFile[], selectionMode: 'single' | 'multiple') => {
|
|
52
|
-
if (selectionMode === 'single') {
|
|
53
|
-
return selectedFiles.length ? '选择文件' : '请选择文件';
|
|
54
|
-
}
|
|
55
|
-
return selectedFiles.length ? `添加 ${selectedFiles.length} 个文件` : '添加文件';
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const getDefaultHelperText = (selectedFiles: ProjectFile[], selectionMode: 'single' | 'multiple') => {
|
|
59
|
-
if (selectionMode === 'single') {
|
|
60
|
-
return selectedFiles.length ? `已选择:${selectedFiles[0].fileName}` : '只能选择文件,文件夹不会被选中。';
|
|
61
|
-
}
|
|
62
|
-
return `只能选择文件,文件夹不会被添加。已选择 ${selectedFiles.length} 个文件。`;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const filterTreeFiles = (
|
|
66
|
-
files: ProjectFile[],
|
|
67
|
-
keyword: string,
|
|
68
|
-
fileFilter?: (file: ProjectFile) => boolean,
|
|
69
|
-
): ProjectFile[] => {
|
|
70
|
-
const normalizedKeyword = keyword.trim().toLowerCase();
|
|
71
|
-
|
|
72
|
-
return files.flatMap((file) => {
|
|
73
|
-
if (isFolderFile(file)) {
|
|
74
|
-
const children = filterTreeFiles(file.children || [], keyword, fileFilter);
|
|
75
|
-
return children.length ? [{ ...file, children }] : [];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const matchesKeyword = !normalizedKeyword || getFileDisplayPath(file).toLowerCase().includes(normalizedKeyword);
|
|
79
|
-
const matchesFilter = fileFilter ? fileFilter(file) : true;
|
|
80
|
-
return matchesKeyword && matchesFilter ? [file] : [];
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const toTreeNodes = (
|
|
85
|
-
files: ProjectFile[],
|
|
86
|
-
selectableFileIds: Set<string>,
|
|
87
|
-
selectionMode: 'single' | 'multiple',
|
|
88
|
-
): DataNode[] =>
|
|
89
|
-
files.map((file) => {
|
|
90
|
-
const selectable = selectableFileIds.has(file.id);
|
|
91
|
-
return {
|
|
92
|
-
key: file.id,
|
|
93
|
-
selectable: selectionMode === 'single' ? selectable : false,
|
|
94
|
-
disableCheckbox: selectionMode === 'multiple' ? !selectable : undefined,
|
|
95
|
-
title: (
|
|
96
|
-
<div className="flex w-full min-w-0 max-w-full items-center gap-2 whitespace-nowrap">
|
|
97
|
-
<span className="flex h-5 w-5 shrink-0 items-center justify-center text-base text-muted">
|
|
98
|
-
{uiFilePreview.getFileIcon({
|
|
99
|
-
fileName: file.fileName,
|
|
100
|
-
fileType: file.fileType,
|
|
101
|
-
size: 18,
|
|
102
|
-
})}
|
|
103
|
-
</span>
|
|
104
|
-
<span className="min-w-0 flex-1 truncate" title={file.fileName}>{file.fileName}</span>
|
|
105
|
-
{!isFolderFile(file) && (
|
|
106
|
-
<span className="w-16 shrink-0 text-right text-xs text-muted">{formatFileSize(file.fileSize || 0)}</span>
|
|
107
|
-
)}
|
|
108
|
-
</div>
|
|
109
|
-
),
|
|
110
|
-
children: file.children?.length ? toTreeNodes(file.children, selectableFileIds, selectionMode) : undefined,
|
|
111
|
-
};
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
export const MyFileSelectorModal = ({
|
|
115
|
-
open,
|
|
116
|
-
confirmLoading = false,
|
|
117
|
-
title = '从我的文件选择文件',
|
|
118
|
-
searchPlaceholder = '搜索我的文件',
|
|
119
|
-
selectionMode = 'multiple',
|
|
120
|
-
okText,
|
|
121
|
-
emptyDescription,
|
|
122
|
-
helperText,
|
|
123
|
-
fileFilter,
|
|
124
|
-
onCancel,
|
|
125
|
-
onConfirm,
|
|
126
|
-
}: MyFileSelectorModalProps) => {
|
|
127
|
-
const [loading, setLoading] = useState(false);
|
|
128
|
-
const [projectId, setProjectId] = useState('');
|
|
129
|
-
const [files, setFiles] = useState<ProjectFile[]>([]);
|
|
130
|
-
const [selectedKeys, setSelectedKeys] = useState<Key[]>([]);
|
|
131
|
-
const [keyword, setKeyword] = useState('');
|
|
132
|
-
|
|
133
|
-
const loadFiles = async () => {
|
|
134
|
-
const user = CacheUserInfo.currentLocalUser();
|
|
135
|
-
if (!user?.id) {
|
|
136
|
-
message.warning('请先登录后再选择我的文件');
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
setLoading(true);
|
|
141
|
-
try {
|
|
142
|
-
let nextProjectId = user.id;
|
|
143
|
-
const projectRes = await API.project.project.getProjectName({ projectId: user.id });
|
|
144
|
-
if (!projectRes.data) {
|
|
145
|
-
const enableRes = await API.project.project.enableUserPrivateProject();
|
|
146
|
-
if (enableRes.code !== ResponseCode.SUCCESS || !enableRes.data) {
|
|
147
|
-
message.error(enableRes.message || '启用我的文件失败');
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
nextProjectId = enableRes.data;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
setProjectId(nextProjectId);
|
|
154
|
-
const listRes = await API.project.file.listFiles({ projectId: nextProjectId });
|
|
155
|
-
if (listRes.code !== ResponseCode.SUCCESS) {
|
|
156
|
-
message.error(listRes.message || '加载我的文件失败');
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
setFiles(sortFiles(filterNotesRootFiles((listRes.data || []) as ProjectFile[])));
|
|
161
|
-
} finally {
|
|
162
|
-
setLoading(false);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
useEffect(() => {
|
|
167
|
-
if (!open) {
|
|
168
|
-
setSelectedKeys([]);
|
|
169
|
-
setKeyword('');
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
void loadFiles();
|
|
174
|
-
}, [open]);
|
|
175
|
-
|
|
176
|
-
const fileTreeData = useMemo(() => buildFileTree(files), [files]);
|
|
177
|
-
const allFiles = useMemo(() => flattenFiles(fileTreeData), [fileTreeData]);
|
|
178
|
-
const selectableFiles = useMemo(
|
|
179
|
-
() => allFiles.filter((file) => !isFolderFile(file) && (!fileFilter || fileFilter(file))),
|
|
180
|
-
[allFiles, fileFilter],
|
|
181
|
-
);
|
|
182
|
-
const selectableFileIds = useMemo(() => new Set(selectableFiles.map((file) => file.id)), [selectableFiles]);
|
|
183
|
-
const fileMap = useMemo(() => new Map(selectableFiles.map((file) => [file.id, file])), [selectableFiles]);
|
|
184
|
-
const selectedFiles = useMemo(
|
|
185
|
-
() => selectedKeys.flatMap((key) => {
|
|
186
|
-
const file = fileMap.get(String(key));
|
|
187
|
-
return file ? [file] : [];
|
|
188
|
-
}),
|
|
189
|
-
[selectedKeys, fileMap],
|
|
190
|
-
);
|
|
191
|
-
const treeData = useMemo(
|
|
192
|
-
() => toTreeNodes(filterTreeFiles(fileTreeData, keyword, fileFilter), selectableFileIds, selectionMode),
|
|
193
|
-
[fileFilter, fileTreeData, keyword, selectableFileIds, selectionMode],
|
|
194
|
-
);
|
|
195
|
-
|
|
196
|
-
const resolvedOkText = typeof okText === 'function' ? okText(selectedFiles) : okText || getDefaultOkText(selectedFiles, selectionMode);
|
|
197
|
-
const resolvedHelperText = typeof helperText === 'function'
|
|
198
|
-
? helperText(selectedFiles)
|
|
199
|
-
: helperText || getDefaultHelperText(selectedFiles, selectionMode);
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<Modal
|
|
203
|
-
title={title}
|
|
204
|
-
open={open}
|
|
205
|
-
width={720}
|
|
206
|
-
className="max-md:!top-2 max-md:!max-w-[calc(100vw-16px)] max-md:[&_.ant-modal-body]:!flex max-md:[&_.ant-modal-body]:!min-h-0 max-md:[&_.ant-modal-body]:!flex-1 max-md:[&_.ant-modal-body]:!flex-col max-md:[&_.ant-modal-body]:!overflow-hidden max-md:[&_.ant-modal-content]:!flex max-md:[&_.ant-modal-content]:!h-[calc(100dvh-16px)] max-md:[&_.ant-modal-content]:!flex-col max-md:[&_.ant-modal-footer]:!shrink-0"
|
|
207
|
-
okText={resolvedOkText}
|
|
208
|
-
cancelText="取消"
|
|
209
|
-
confirmLoading={confirmLoading}
|
|
210
|
-
okButtonProps={{ disabled: selectedFiles.length === 0 }}
|
|
211
|
-
onCancel={confirmLoading ? undefined : onCancel}
|
|
212
|
-
onOk={() => onConfirm(selectedFiles)}
|
|
213
|
-
>
|
|
214
|
-
<div className="flex min-h-0 flex-col gap-3 max-md:flex-1">
|
|
215
|
-
<div className="flex shrink-0 items-center gap-2">
|
|
216
|
-
<Input.Search
|
|
217
|
-
allowClear
|
|
218
|
-
placeholder={searchPlaceholder}
|
|
219
|
-
value={keyword}
|
|
220
|
-
onChange={(event) => setKeyword(event.target.value)}
|
|
221
|
-
/>
|
|
222
|
-
<Button icon={<ReloadOutlined />} disabled={loading || confirmLoading} onClick={loadFiles}>
|
|
223
|
-
刷新
|
|
224
|
-
</Button>
|
|
225
|
-
</div>
|
|
226
|
-
|
|
227
|
-
<div className="max-h-[52vh] min-h-[360px] overflow-y-auto overflow-x-hidden rounded-xl border border-email-divider bg-surface p-3 max-md:min-h-0 max-md:flex-1 max-md:max-h-none">
|
|
228
|
-
<Spin spinning={loading}>
|
|
229
|
-
{treeData.length ? (
|
|
230
|
-
<Tree
|
|
231
|
-
className="w-full [&_.ant-tree-list-holder-inner]:!w-full [&_.ant-tree-node-content-wrapper]:!min-w-0 [&_.ant-tree-node-content-wrapper]:!flex-1 [&_.ant-tree-node-content-wrapper]:!overflow-hidden [&_.ant-tree-title]:!block [&_.ant-tree-title]:!min-w-0 [&_.ant-tree-title]:!w-full [&_.ant-tree-treenode]:!w-full [&_.ant-tree-treenode]:!min-w-0"
|
|
232
|
-
checkable={selectionMode === 'multiple'}
|
|
233
|
-
selectable={selectionMode === 'single'}
|
|
234
|
-
checkStrictly
|
|
235
|
-
treeData={treeData}
|
|
236
|
-
checkedKeys={selectionMode === 'multiple' ? selectedKeys : undefined}
|
|
237
|
-
selectedKeys={selectionMode === 'single' ? selectedKeys : undefined}
|
|
238
|
-
defaultExpandAll={Boolean(keyword.trim())}
|
|
239
|
-
onCheck={(keys) => {
|
|
240
|
-
const nextKeys = Array.isArray(keys) ? keys : keys.checked;
|
|
241
|
-
setSelectedKeys(nextKeys.filter((key) => selectableFileIds.has(String(key))));
|
|
242
|
-
}}
|
|
243
|
-
onSelect={(keys) => {
|
|
244
|
-
setSelectedKeys(keys.filter((key) => selectableFileIds.has(String(key))).slice(0, 1));
|
|
245
|
-
}}
|
|
246
|
-
/>
|
|
247
|
-
) : (
|
|
248
|
-
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={projectId ? emptyDescription || '暂无可选择的文件' : '我的文件尚未启用'} />
|
|
249
|
-
)}
|
|
250
|
-
</Spin>
|
|
251
|
-
</div>
|
|
252
|
-
|
|
253
|
-
<div className="shrink-0 text-xs text-muted">
|
|
254
|
-
{resolvedHelperText}
|
|
255
|
-
</div>
|
|
256
|
-
</div>
|
|
257
|
-
</Modal>
|
|
258
|
-
);
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export default MyFileSelectorModal;
|