@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,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
|
-
};
|