@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,482 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
-
import { PlayCircleOutlined, LoadingOutlined, ReloadOutlined, PauseCircleOutlined } from '@ant-design/icons';
|
|
3
|
-
import { AuthorizationHandler } from '../../../api/_base';
|
|
4
|
-
import { Button } from 'antd';
|
|
5
|
-
|
|
6
|
-
export interface VideoPreviewProps {
|
|
7
|
-
previewUrl: string;
|
|
8
|
-
type: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const VideoPreview: React.FC<VideoPreviewProps> = ({ previewUrl, type }) => {
|
|
12
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
-
const [isLoaded, setIsLoaded] = useState(false);
|
|
14
|
-
const [isError, setIsError] = useState(false);
|
|
15
|
-
const [hasInteracted, setHasInteracted] = useState(false);
|
|
16
|
-
const [playbackRate, setPlaybackRate] = useState(1);
|
|
17
|
-
const [posterBlobUrl, setPosterBlobUrl] = useState<string | null>(null);
|
|
18
|
-
const [isPlaying, setIsPlaying] = useState(false);
|
|
19
|
-
const [bufferProgress, setBufferProgress] = useState(0);
|
|
20
|
-
const videoRef = useRef<HTMLVideoElement>(null);
|
|
21
|
-
|
|
22
|
-
// 获取带有 Authorization header 的请求头
|
|
23
|
-
const getAuthHeaders = useCallback(() => {
|
|
24
|
-
const headers: Record<string, string> = {};
|
|
25
|
-
const handler = {
|
|
26
|
-
headers: {
|
|
27
|
-
set: (key: string, value: string) => {
|
|
28
|
-
headers[key] = value;
|
|
29
|
-
},
|
|
30
|
-
} as any,
|
|
31
|
-
};
|
|
32
|
-
AuthorizationHandler.requestHandleSid(handler);
|
|
33
|
-
return headers;
|
|
34
|
-
}, []);
|
|
35
|
-
|
|
36
|
-
// 尝试获取视频缩略图
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (type !== 'video') return;
|
|
39
|
-
|
|
40
|
-
const generatePoster = async () => {
|
|
41
|
-
const headers = getAuthHeaders();
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
// 使用 HEAD 请求获取文件信息(避免下载完整文件)
|
|
45
|
-
const headResponse = await fetch(previewUrl, {
|
|
46
|
-
method: 'HEAD',
|
|
47
|
-
headers: { Authorization: headers.Authorization || '' },
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
if (!headResponse.ok) {
|
|
51
|
-
console.warn('HEAD request failed, trying GET for poster');
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 尝试获取视频第一帧(使用 Range 请求只获取部分数据)
|
|
56
|
-
const rangeResponse = await fetch(previewUrl, {
|
|
57
|
-
method: 'GET',
|
|
58
|
-
headers: {
|
|
59
|
-
Authorization: headers.Authorization || '',
|
|
60
|
-
Range: 'bytes=0-102400', // 获取前 100KB
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
if (!rangeResponse.ok && rangeResponse.status !== 206) {
|
|
65
|
-
console.warn('Failed to fetch video header for poster');
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const blob = await rangeResponse.blob();
|
|
70
|
-
const videoUrl = URL.createObjectURL(blob);
|
|
71
|
-
|
|
72
|
-
const video = document.createElement('video');
|
|
73
|
-
video.crossOrigin = 'anonymous';
|
|
74
|
-
video.src = videoUrl;
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
await new Promise<void>((resolve, reject) => {
|
|
78
|
-
video.onloadedmetadata = () => {
|
|
79
|
-
video.currentTime = 0.1;
|
|
80
|
-
resolve();
|
|
81
|
-
};
|
|
82
|
-
video.onerror = reject;
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
await new Promise<void>((resolve) => {
|
|
86
|
-
video.onseeked = () => resolve();
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
const canvas = document.createElement('canvas');
|
|
90
|
-
canvas.width = video.videoWidth || 640;
|
|
91
|
-
canvas.height = video.videoHeight || 360;
|
|
92
|
-
const ctx = canvas.getContext('2d');
|
|
93
|
-
if (ctx) {
|
|
94
|
-
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
95
|
-
const posterUrl = canvas.toDataURL('image/jpeg', 0.7);
|
|
96
|
-
setPosterBlobUrl(posterUrl);
|
|
97
|
-
}
|
|
98
|
-
} catch (error) {
|
|
99
|
-
console.warn('Failed to generate video poster:', error);
|
|
100
|
-
} finally {
|
|
101
|
-
URL.revokeObjectURL(videoUrl);
|
|
102
|
-
}
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.warn('Failed to fetch video for poster:', error);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
generatePoster();
|
|
109
|
-
}, [previewUrl, type, getAuthHeaders]);
|
|
110
|
-
|
|
111
|
-
const handlePlayClick = async () => {
|
|
112
|
-
if (isError) {
|
|
113
|
-
setIsError(false);
|
|
114
|
-
setIsLoading(true);
|
|
115
|
-
setHasInteracted(true);
|
|
116
|
-
await setupStreamedVideo();
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
setHasInteracted(true);
|
|
121
|
-
setIsLoading(true);
|
|
122
|
-
await setupStreamedVideo();
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// 设置流式视频加载
|
|
126
|
-
const setupStreamedVideo = async () => {
|
|
127
|
-
try {
|
|
128
|
-
const headers = getAuthHeaders();
|
|
129
|
-
|
|
130
|
-
// 先检查服务器是否支持 Range 请求(流式加载的关键)
|
|
131
|
-
const headResponse = await fetch(previewUrl, {
|
|
132
|
-
method: 'HEAD',
|
|
133
|
-
headers: { Authorization: headers.Authorization || '' },
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
const acceptRanges = headResponse.headers.get('accept-ranges');
|
|
137
|
-
const contentLength = headResponse.headers.get('content-length');
|
|
138
|
-
|
|
139
|
-
console.log(`Server supports ranges: ${acceptRanges}`);
|
|
140
|
-
console.log(`Content length: ${contentLength}`);
|
|
141
|
-
|
|
142
|
-
// 创建支持流式播放的视频源
|
|
143
|
-
const videoSource = document.createElement('source');
|
|
144
|
-
videoSource.src = previewUrl;
|
|
145
|
-
|
|
146
|
-
// 如果服务器支持范围请求,视频将自动流式加载
|
|
147
|
-
if (videoRef.current) {
|
|
148
|
-
// 清除现有源
|
|
149
|
-
while (videoRef.current.firstChild) {
|
|
150
|
-
videoRef.current.removeChild(videoRef.current.firstChild);
|
|
151
|
-
}
|
|
152
|
-
videoRef.current.appendChild(videoSource);
|
|
153
|
-
|
|
154
|
-
// 设置跨域和认证头
|
|
155
|
-
videoRef.current.crossOrigin = 'use-credentials';
|
|
156
|
-
|
|
157
|
-
// 加载视频
|
|
158
|
-
await videoRef.current.load();
|
|
159
|
-
|
|
160
|
-
setIsLoading(false);
|
|
161
|
-
setIsLoaded(true);
|
|
162
|
-
setIsPlaying(true);
|
|
163
|
-
|
|
164
|
-
// 尝试播放(可能因浏览器策略失败,需要用户交互)
|
|
165
|
-
videoRef.current.play().catch(() => {});
|
|
166
|
-
}
|
|
167
|
-
} catch (error) {
|
|
168
|
-
console.error('Video setup error:', error);
|
|
169
|
-
// 降级到完整下载模式
|
|
170
|
-
await fallbackToFullDownload();
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// 降级方案:完整下载后播放
|
|
175
|
-
const fallbackToFullDownload = async () => {
|
|
176
|
-
try {
|
|
177
|
-
const headers = getAuthHeaders();
|
|
178
|
-
|
|
179
|
-
const response = await fetch(previewUrl, {
|
|
180
|
-
headers: { Authorization: headers.Authorization || '' },
|
|
181
|
-
method: 'GET',
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
if (!response.ok) {
|
|
185
|
-
throw new Error(`视频加载失败,状态码: ${response.status}`);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const blob = await response.blob();
|
|
189
|
-
const url = URL.createObjectURL(blob);
|
|
190
|
-
|
|
191
|
-
if (videoRef.current) {
|
|
192
|
-
videoRef.current.src = url;
|
|
193
|
-
await videoRef.current.load();
|
|
194
|
-
setIsLoading(false);
|
|
195
|
-
setIsLoaded(true);
|
|
196
|
-
setIsPlaying(true);
|
|
197
|
-
videoRef.current.play().catch(() => {});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// 清理:组件卸载时释放 blob URL
|
|
201
|
-
return () => {
|
|
202
|
-
URL.revokeObjectURL(url);
|
|
203
|
-
};
|
|
204
|
-
} catch (error) {
|
|
205
|
-
console.error('Fallback download error:', error);
|
|
206
|
-
setIsLoading(false);
|
|
207
|
-
setIsError(true);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const handleVideoProgress = () => {
|
|
212
|
-
if (videoRef.current) {
|
|
213
|
-
const buffered = videoRef.current.buffered;
|
|
214
|
-
const duration = videoRef.current.duration;
|
|
215
|
-
|
|
216
|
-
if (buffered.length > 0 && duration > 0) {
|
|
217
|
-
const bufferedEnd = buffered.end(buffered.length - 1);
|
|
218
|
-
const percent = Math.min((bufferedEnd / duration) * 100, 100);
|
|
219
|
-
setBufferProgress(percent);
|
|
220
|
-
|
|
221
|
-
// 检测是否缓冲完成
|
|
222
|
-
if (percent >= 99) {
|
|
223
|
-
console.log('Video fully buffered');
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
const handleVideoLoaded = () => {
|
|
230
|
-
setIsLoading(false);
|
|
231
|
-
setIsLoaded(true);
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
const handleVideoError = () => {
|
|
235
|
-
console.error('Video element error');
|
|
236
|
-
setIsLoading(false);
|
|
237
|
-
setIsError(true);
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
const handleVideoPlay = () => {
|
|
241
|
-
setIsPlaying(true);
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
const handleVideoPause = () => {
|
|
245
|
-
setIsPlaying(false);
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
const handlePlaybackRateChange = (rate: number) => {
|
|
249
|
-
setPlaybackRate(rate);
|
|
250
|
-
if (videoRef.current) {
|
|
251
|
-
videoRef.current.playbackRate = rate;
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
const togglePlayPause = () => {
|
|
256
|
-
if (videoRef.current) {
|
|
257
|
-
if (isPlaying) {
|
|
258
|
-
videoRef.current.pause();
|
|
259
|
-
} else {
|
|
260
|
-
videoRef.current.play().catch(() => {});
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
if (type !== 'video') return null;
|
|
266
|
-
|
|
267
|
-
return (
|
|
268
|
-
<div style={{
|
|
269
|
-
width: '100%',
|
|
270
|
-
height: '100%',
|
|
271
|
-
display: 'flex',
|
|
272
|
-
justifyContent: 'center',
|
|
273
|
-
alignItems: 'center',
|
|
274
|
-
background: '#000',
|
|
275
|
-
position: 'relative',
|
|
276
|
-
}}>
|
|
277
|
-
{/* 视频元素 - 支持流式加载 */}
|
|
278
|
-
<video
|
|
279
|
-
ref={videoRef}
|
|
280
|
-
controls
|
|
281
|
-
preload="metadata"
|
|
282
|
-
onLoadedData={handleVideoLoaded}
|
|
283
|
-
onError={handleVideoError}
|
|
284
|
-
onProgress={handleVideoProgress}
|
|
285
|
-
onPlay={handleVideoPlay}
|
|
286
|
-
onPause={handleVideoPause}
|
|
287
|
-
style={{
|
|
288
|
-
maxWidth: '100%',
|
|
289
|
-
maxHeight: 'calc(100vh - 40px)',
|
|
290
|
-
objectFit: 'contain',
|
|
291
|
-
display: hasInteracted && !isLoading && !isError ? 'block' : 'none',
|
|
292
|
-
}}
|
|
293
|
-
crossOrigin="use-credentials"
|
|
294
|
-
/>
|
|
295
|
-
|
|
296
|
-
{/* 缓冲进度条 */}
|
|
297
|
-
{isPlaying && bufferProgress > 0 && bufferProgress < 100 && (
|
|
298
|
-
<div
|
|
299
|
-
style={{
|
|
300
|
-
position: 'absolute',
|
|
301
|
-
bottom: '45px',
|
|
302
|
-
left: '20px',
|
|
303
|
-
right: '20px',
|
|
304
|
-
height: '4px',
|
|
305
|
-
backgroundColor: 'rgba(255, 255, 255, 0.3)',
|
|
306
|
-
borderRadius: '2px',
|
|
307
|
-
}}
|
|
308
|
-
>
|
|
309
|
-
<div
|
|
310
|
-
style={{
|
|
311
|
-
height: '100%',
|
|
312
|
-
backgroundColor: '#1890ff',
|
|
313
|
-
borderRadius: '2px',
|
|
314
|
-
transition: 'width 0.3s ease',
|
|
315
|
-
width: `${bufferProgress}%`,
|
|
316
|
-
}}
|
|
317
|
-
/>
|
|
318
|
-
</div>
|
|
319
|
-
)}
|
|
320
|
-
|
|
321
|
-
{/* 缩略图/加载遮罩 */}
|
|
322
|
-
{!hasInteracted || isLoading || isError ? (
|
|
323
|
-
<div
|
|
324
|
-
style={{
|
|
325
|
-
position: 'absolute',
|
|
326
|
-
top: 0,
|
|
327
|
-
left: 0,
|
|
328
|
-
right: 0,
|
|
329
|
-
bottom: 0,
|
|
330
|
-
display: 'flex',
|
|
331
|
-
flexDirection: 'column',
|
|
332
|
-
justifyContent: 'center',
|
|
333
|
-
alignItems: 'center',
|
|
334
|
-
background: '#1a1a1a',
|
|
335
|
-
}}
|
|
336
|
-
>
|
|
337
|
-
{/* 缩略图 */}
|
|
338
|
-
{!isLoading && !isError && (
|
|
339
|
-
<img
|
|
340
|
-
src={posterBlobUrl || 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 72"%3E%3Crect fill="%232a2a2a" width="128" height="72"/%3E%3Ctext fill="%234a4a4a" font-family="sans-serif" font-size="12" x="50%25" y="50%25" text-anchor="middle" dominant-baseline="middle"%3E视频预览%3C/text%3E%3C/svg%3E'}
|
|
341
|
-
alt="Video preview"
|
|
342
|
-
style={{
|
|
343
|
-
maxWidth: '100%',
|
|
344
|
-
maxHeight: 'calc(100vh - 200px)',
|
|
345
|
-
objectFit: 'contain',
|
|
346
|
-
}}
|
|
347
|
-
/>
|
|
348
|
-
)}
|
|
349
|
-
|
|
350
|
-
{/* 加载状态 */}
|
|
351
|
-
{isLoading && (
|
|
352
|
-
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16 }}>
|
|
353
|
-
<LoadingOutlined style={{ fontSize: 48, color: '#1890ff' }} spin />
|
|
354
|
-
<span style={{ color: '#999', fontSize: 14 }}>正在准备视频...</span>
|
|
355
|
-
</div>
|
|
356
|
-
)}
|
|
357
|
-
|
|
358
|
-
{/* 错误状态 */}
|
|
359
|
-
{isError && (
|
|
360
|
-
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16 }}>
|
|
361
|
-
<div style={{ fontSize: 48, color: '#ff4d4f' }}>
|
|
362
|
-
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
363
|
-
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
|
|
364
|
-
</svg>
|
|
365
|
-
</div>
|
|
366
|
-
<span style={{ color: '#ff4d4f', fontSize: 14 }}>视频加载失败</span>
|
|
367
|
-
<Button
|
|
368
|
-
type="primary"
|
|
369
|
-
onClick={handlePlayClick}
|
|
370
|
-
style={{
|
|
371
|
-
padding: '8px 16px',
|
|
372
|
-
color: '#fff',
|
|
373
|
-
border: 'none',
|
|
374
|
-
borderRadius: '4px',
|
|
375
|
-
cursor: 'pointer',
|
|
376
|
-
display: 'flex',
|
|
377
|
-
alignItems: 'center',
|
|
378
|
-
gap: 8,
|
|
379
|
-
}}
|
|
380
|
-
>
|
|
381
|
-
<ReloadOutlined />
|
|
382
|
-
重试加载
|
|
383
|
-
</Button>
|
|
384
|
-
</div>
|
|
385
|
-
)}
|
|
386
|
-
|
|
387
|
-
{/* 播放按钮 */}
|
|
388
|
-
{!isLoading && !isError && (
|
|
389
|
-
<Button
|
|
390
|
-
type="primary"
|
|
391
|
-
onClick={handlePlayClick}
|
|
392
|
-
style={{
|
|
393
|
-
position: 'absolute',
|
|
394
|
-
width: '80px',
|
|
395
|
-
height: '80px',
|
|
396
|
-
borderRadius: '50%',
|
|
397
|
-
backgroundColor: 'rgba(24, 144, 255, 0.9)',
|
|
398
|
-
border: 'none',
|
|
399
|
-
cursor: 'pointer',
|
|
400
|
-
display: 'flex',
|
|
401
|
-
justifyContent: 'center',
|
|
402
|
-
alignItems: 'center',
|
|
403
|
-
transition: 'transform 0.2s',
|
|
404
|
-
}}
|
|
405
|
-
onMouseEnter={(e) => {
|
|
406
|
-
(e.currentTarget as HTMLElement).style.transform = 'scale(1.1)';
|
|
407
|
-
}}
|
|
408
|
-
onMouseLeave={(e) => {
|
|
409
|
-
(e.currentTarget as HTMLElement).style.transform = 'scale(1)';
|
|
410
|
-
}}
|
|
411
|
-
>
|
|
412
|
-
<PlayCircleOutlined style={{ fontSize: 48, color: '#fff' }} />
|
|
413
|
-
</Button>
|
|
414
|
-
)}
|
|
415
|
-
</div>
|
|
416
|
-
) : null}
|
|
417
|
-
|
|
418
|
-
{/* 播放/暂停切换按钮(视频加载后显示在中央) */}
|
|
419
|
-
{isLoaded && (
|
|
420
|
-
<Button
|
|
421
|
-
type="text"
|
|
422
|
-
onClick={togglePlayPause}
|
|
423
|
-
style={{
|
|
424
|
-
position: 'absolute',
|
|
425
|
-
width: '60px',
|
|
426
|
-
height: '60px',
|
|
427
|
-
borderRadius: '50%',
|
|
428
|
-
backgroundColor: 'rgba(0, 0, 0, 0.6)',
|
|
429
|
-
border: 'none',
|
|
430
|
-
cursor: 'pointer',
|
|
431
|
-
display: 'none',
|
|
432
|
-
justifyContent: 'center',
|
|
433
|
-
alignItems: 'center',
|
|
434
|
-
transition: 'opacity 0.3s',
|
|
435
|
-
}}
|
|
436
|
-
className="video-overlay-play-btn"
|
|
437
|
-
>
|
|
438
|
-
{isPlaying ? (
|
|
439
|
-
<PauseCircleOutlined style={{ fontSize: 36, color: '#fff' }} />
|
|
440
|
-
) : (
|
|
441
|
-
<PlayCircleOutlined style={{ fontSize: 36, color: '#fff' }} />
|
|
442
|
-
)}
|
|
443
|
-
</Button>
|
|
444
|
-
)}
|
|
445
|
-
|
|
446
|
-
{/* 播放速度控制 */}
|
|
447
|
-
{isLoaded && (
|
|
448
|
-
<div
|
|
449
|
-
style={{
|
|
450
|
-
position: 'absolute',
|
|
451
|
-
bottom: '60px',
|
|
452
|
-
right: '20px',
|
|
453
|
-
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
454
|
-
padding: '4px',
|
|
455
|
-
borderRadius: '4px',
|
|
456
|
-
display: 'flex',
|
|
457
|
-
gap: '4px',
|
|
458
|
-
}}
|
|
459
|
-
>
|
|
460
|
-
{[0.5, 1, 1.25, 1.5, 2].map((rate) => (
|
|
461
|
-
<Button
|
|
462
|
-
type="text"
|
|
463
|
-
key={rate}
|
|
464
|
-
onClick={() => handlePlaybackRateChange(rate)}
|
|
465
|
-
style={{
|
|
466
|
-
padding: '4px 8px',
|
|
467
|
-
backgroundColor: playbackRate === rate ? '#1890ff' : 'transparent',
|
|
468
|
-
color: '#fff',
|
|
469
|
-
border: 'none',
|
|
470
|
-
borderRadius: '2px',
|
|
471
|
-
fontSize: '12px',
|
|
472
|
-
cursor: 'pointer',
|
|
473
|
-
}}
|
|
474
|
-
>
|
|
475
|
-
{rate}x
|
|
476
|
-
</Button>
|
|
477
|
-
))}
|
|
478
|
-
</div>
|
|
479
|
-
)}
|
|
480
|
-
</div>
|
|
481
|
-
);
|
|
482
|
-
};
|