@univerjs-pro/exchange-client 1.0.0-alpha.8 → 1.0.0-beta.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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.css +42 -4
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/config/config.d.ts +0 -23
- package/lib/types/controllers/components.controller.d.ts +3 -3
- package/lib/types/facade/f-univer.d.ts +5 -279
- package/lib/types/index.d.ts +5 -2
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/services/exchange.service.d.ts +12 -82
- package/lib/types/services/operate.service.d.ts +17 -96
- package/lib/types/services/request.service.d.ts +78 -10
- package/lib/types/services/utils/content-type.d.ts +6 -2
- package/lib/types/services/utils/snapshot.d.ts +7 -39
- package/lib/types/services/utils/tool.d.ts +1 -0
- package/lib/types/views/export-format-dialog/ExportFormatDialog.d.ts +14 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -12
- package/lib/types/views/UploadNotificationContainer.d.ts +0 -1
|
@@ -1,79 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { IDisposable, IDocumentData } from '@univerjs/core';
|
|
1
|
+
import type { IDisposable, UniverInstanceType } from '@univerjs/core';
|
|
3
2
|
import type { Observable } from 'rxjs';
|
|
4
3
|
import type { ExchangeService } from './exchange.service';
|
|
5
4
|
import type { UploadNotificationService } from './upload-notification.service';
|
|
6
|
-
import { Disposable, ILogService,
|
|
5
|
+
import { Disposable, ILogService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
7
6
|
import { IMessageService } from '@univerjs/ui';
|
|
7
|
+
type UnitImporter = (file: File) => Promise<string | undefined>;
|
|
8
8
|
export interface IExchangeOperateService {
|
|
9
9
|
interrupt(): void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* Upload xlsx file to server, get snapshot and refresh current sheet
|
|
16
|
-
*/
|
|
17
|
-
importXLSXToSnapshot(): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Export xlsx file by unitId
|
|
20
|
-
*/
|
|
21
|
-
exportXLSXByUnitId(unitId?: string, unitName?: string): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Export xlsx file by snapshot
|
|
24
|
-
*/
|
|
25
|
-
exportXLSXBySnapshot(): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Upload file to server, get unitId and open unit
|
|
28
|
-
*/
|
|
29
|
-
importDOCXToUnitId(): Promise<string | undefined>;
|
|
30
|
-
/**
|
|
31
|
-
* Upload docx file to server, get snapshot and refresh current doc
|
|
32
|
-
*/
|
|
33
|
-
importDOCXToSnapshot(): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Export docx file by unitId
|
|
36
|
-
*/
|
|
37
|
-
exportDOCXByUnitId(unitId?: string, unitName?: string): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Export docx file by snapshot
|
|
40
|
-
*/
|
|
41
|
-
exportDOCXBySnapshot(snapshot?: IDocumentData): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Upload pptx file to server, get unitId and open unit
|
|
44
|
-
*/
|
|
45
|
-
importPPTXToUnitId(): Promise<string | undefined>;
|
|
46
|
-
/**
|
|
47
|
-
* Upload pptx file to server, get snapshot and refresh current slide
|
|
48
|
-
*/
|
|
49
|
-
importPPTXToSnapshot(): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Export pptx file by unitId
|
|
52
|
-
*/
|
|
53
|
-
exportPPTXByUnitId(unitId?: string, unitName?: string): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Export pptx file by snapshot
|
|
56
|
-
*/
|
|
57
|
-
exportPPTXBySnapshot(): Promise<void>;
|
|
58
|
-
/** Import a PDF file to a new backend unit. */
|
|
59
|
-
importPDFToUnitId(): Promise<string | undefined>;
|
|
60
|
-
/** Import a PDF file as snapshot data without changing the current Unit. */
|
|
61
|
-
importPDFToSnapshot(): Promise<IPdfUnitData | undefined>;
|
|
62
|
-
/** Export a PDF file by unit id. */
|
|
63
|
-
exportPDFByUnitId(unitId?: string, unitName?: string, unitType?: UniverInstanceType): Promise<void>;
|
|
64
|
-
/** Export the current local PDF unit snapshot. */
|
|
65
|
-
exportPDFBySnapshot(): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Upload file, supports multiple types
|
|
68
|
-
*/
|
|
69
|
-
uploadFileToUnitId(types: UniverInstanceType[]): Promise<{
|
|
70
|
-
unitId: string;
|
|
71
|
-
type: UniverInstanceType;
|
|
72
|
-
} | undefined>;
|
|
73
|
-
/**
|
|
74
|
-
* Upload file using the currently focused unit type.
|
|
75
|
-
*/
|
|
76
|
-
importFileToUnitIdByCurrentType(): Promise<string | undefined>;
|
|
10
|
+
importFileToUnitId(type: UniverInstanceType, importer: UnitImporter): Promise<string | undefined>;
|
|
11
|
+
retryImportFileToUnitId(): Promise<string | undefined>;
|
|
12
|
+
importFileAsSnapshot<T>(type: UniverInstanceType, importer: (file: File) => Promise<T | undefined>): Promise<T | undefined>;
|
|
13
|
+
importFileToSnapshot<T>(type: UniverInstanceType, importer: (file: File) => Promise<T | undefined>): Promise<void>;
|
|
14
|
+
exportFile(exporter: () => Promise<File | undefined>, unitName: string | undefined, fileExt: string): Promise<void>;
|
|
77
15
|
/**
|
|
78
16
|
* Customize the imported Unit URL format according to the needs of your own scene
|
|
79
17
|
*/
|
|
@@ -97,39 +35,21 @@ export declare class ExchangeOperateService extends Disposable implements IExcha
|
|
|
97
35
|
private readonly _exchangeService;
|
|
98
36
|
private readonly _uploadNotificationService;
|
|
99
37
|
protected readonly _logService: ILogService;
|
|
100
|
-
private readonly _resourceLoaderService;
|
|
101
38
|
private readonly _progress$;
|
|
102
39
|
readonly progress$: Observable<IUploadProgress>;
|
|
103
40
|
private _totalUploadTaskCount;
|
|
104
41
|
private _doneUploadTaskCount;
|
|
105
|
-
|
|
42
|
+
private _isSelectingUnitImportFile;
|
|
43
|
+
private _lastUnitImportContext;
|
|
44
|
+
constructor(_univerInstanceService: IUniverInstanceService, _messageService: IMessageService, _localeService: LocaleService, _exchangeService: ExchangeService, _uploadNotificationService: UploadNotificationService, _logService: ILogService);
|
|
106
45
|
interrupt(): void;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
importDOCXToSnapshot(): Promise<void>;
|
|
113
|
-
exportDOCXByUnitId(unitId?: string, unitName?: string): Promise<void>;
|
|
114
|
-
exportDOCXBySnapshot(snapshot?: IDocumentData): Promise<void>;
|
|
115
|
-
importPPTXToUnitId(): Promise<string | undefined>;
|
|
116
|
-
importPDFToUnitId(): Promise<string | undefined>;
|
|
117
|
-
importPDFToSnapshot(): Promise<IPdfUnitData | undefined>;
|
|
118
|
-
exportPDFByUnitId(unitId?: string, unitName?: string, unitType?: UniverInstanceType): Promise<void>;
|
|
119
|
-
exportPDFBySnapshot(): Promise<void>;
|
|
120
|
-
importPPTXToSnapshot(): Promise<void>;
|
|
121
|
-
exportPPTXByUnitId(unitId?: string, unitName?: string): Promise<void>;
|
|
122
|
-
exportPPTXBySnapshot(): Promise<void>;
|
|
123
|
-
uploadFileToUnitId(_types: UniverInstanceType[]): Promise<{
|
|
124
|
-
unitId: string;
|
|
125
|
-
type: UniverInstanceType;
|
|
126
|
-
} | undefined>;
|
|
127
|
-
importFileToUnitIdByCurrentType(): Promise<string | undefined>;
|
|
46
|
+
importFileToUnitId(type: UniverInstanceType, importer: UnitImporter): Promise<string | undefined>;
|
|
47
|
+
retryImportFileToUnitId(): Promise<string | undefined>;
|
|
48
|
+
importFileToSnapshot<T>(type: UniverInstanceType, importer: (file: File) => Promise<T | undefined>): Promise<void>;
|
|
49
|
+
importFileAsSnapshot<T>(type: UniverInstanceType, importer: (file: File) => Promise<T | undefined>): Promise<T | undefined>;
|
|
50
|
+
exportFile(exporter: () => Promise<File | undefined>, unitName: string | undefined, fileExt: string): Promise<void>;
|
|
128
51
|
registerLink(getLink: (unitId: string, univerType: UniverInstanceType) => string): void;
|
|
129
52
|
private _importFileToUnitId;
|
|
130
|
-
private _getUnitID;
|
|
131
|
-
private _getUnitNameByType;
|
|
132
|
-
private _getUnitJson;
|
|
133
53
|
private _refreshUnit;
|
|
134
54
|
/**
|
|
135
55
|
* Get unit link /?unit={unitId}&type=2
|
|
@@ -150,3 +70,4 @@ export declare class ExchangeOperateService extends Disposable implements IExcha
|
|
|
150
70
|
private _fileTypeError;
|
|
151
71
|
private _uploadTaskNotDone;
|
|
152
72
|
}
|
|
73
|
+
export {};
|
|
@@ -15,14 +15,84 @@ export declare enum ImportOutputType {
|
|
|
15
15
|
JSON = 2,
|
|
16
16
|
UNRECOGNIZED = -1
|
|
17
17
|
}
|
|
18
|
+
export declare enum ExchangeFormat {
|
|
19
|
+
XLSX = "xlsx",
|
|
20
|
+
CSV = "csv",
|
|
21
|
+
TSV = "tsv",
|
|
22
|
+
DOCX = "docx",
|
|
23
|
+
PPTX = "pptx",
|
|
24
|
+
PDF = "pdf"
|
|
25
|
+
}
|
|
26
|
+
export declare enum ExchangeBaseImportMode {
|
|
27
|
+
/**
|
|
28
|
+
* Select the source automatically. Imports visible worksheets when no native Excel table exists;
|
|
29
|
+
* otherwise imports native Excel tables and any visible worksheets that do not contain one.
|
|
30
|
+
*/
|
|
31
|
+
AUTO = "auto",
|
|
32
|
+
/** Import only native Excel tables. */
|
|
33
|
+
TABLES = "tables",
|
|
34
|
+
/** Import each visible worksheet as a Base table. */
|
|
35
|
+
SHEETS = "sheets",
|
|
36
|
+
/** Import native Excel tables plus visible worksheets that do not contain a native Excel table. */
|
|
37
|
+
HYBRID = "hybrid"
|
|
38
|
+
}
|
|
39
|
+
export declare enum ExchangeBaseFormulaPolicy {
|
|
40
|
+
/**
|
|
41
|
+
* Try to convert formulas. Import falls back to cached values when conversion fails;
|
|
42
|
+
* export fails when a formula cannot be converted.
|
|
43
|
+
*/
|
|
44
|
+
CONVERT_THEN_VALUES = "convert-then-values",
|
|
45
|
+
/** Do not convert formulas; use their cached result values. */
|
|
46
|
+
VALUES = "values",
|
|
47
|
+
/** Do not convert formulas; preserve the source formulas as plain text. */
|
|
48
|
+
TEXT = "text",
|
|
49
|
+
/** Require every formula to be converted successfully, otherwise fail the operation. */
|
|
50
|
+
FAIL = "fail"
|
|
51
|
+
}
|
|
52
|
+
export declare enum ExchangeBaseExportMode {
|
|
53
|
+
/** Export each non-empty Base table as a native Excel table. Empty tables remain ordinary ranges. */
|
|
54
|
+
TABLES = "tables",
|
|
55
|
+
/** Export Base tables as ordinary worksheet ranges without native Excel table metadata. */
|
|
56
|
+
RANGES = "ranges"
|
|
57
|
+
}
|
|
58
|
+
export interface IExchangeSheetImportOption {
|
|
59
|
+
minSheetColumnCount?: number;
|
|
60
|
+
minSheetRowCount?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface IExchangeSheetExportOption {
|
|
63
|
+
useImageUrl?: boolean;
|
|
64
|
+
csv?: {
|
|
65
|
+
sheetId?: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export interface IExchangeBaseImportOption {
|
|
69
|
+
xlsx?: {
|
|
70
|
+
baseMode?: ExchangeBaseImportMode;
|
|
71
|
+
baseFormulaPolicy?: ExchangeBaseFormulaPolicy;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface IExchangeBaseExportOption {
|
|
75
|
+
csv?: {
|
|
76
|
+
tableId?: string;
|
|
77
|
+
};
|
|
78
|
+
xlsx?: {
|
|
79
|
+
baseExportMode?: ExchangeBaseExportMode;
|
|
80
|
+
baseFormulaPolicy?: ExchangeBaseFormulaPolicy;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface IExchangeImportOptions {
|
|
84
|
+
sheet?: IExchangeSheetImportOption;
|
|
85
|
+
base?: IExchangeBaseImportOption;
|
|
86
|
+
}
|
|
87
|
+
export interface IExchangeExportOptions {
|
|
88
|
+
sheet?: IExchangeSheetExportOption;
|
|
89
|
+
base?: IExchangeBaseExportOption;
|
|
90
|
+
}
|
|
18
91
|
export interface IImportRequest {
|
|
19
92
|
fileID: string;
|
|
20
93
|
type: UniverInstanceType;
|
|
21
94
|
outputType: ImportOutputType;
|
|
22
|
-
|
|
23
|
-
fileUrl: string;
|
|
24
|
-
minSheetColumnCount: number;
|
|
25
|
-
minSheetRowCount: number;
|
|
95
|
+
options?: IExchangeImportOptions;
|
|
26
96
|
}
|
|
27
97
|
export interface IImportResponse {
|
|
28
98
|
taskID: string;
|
|
@@ -30,14 +100,12 @@ export interface IImportResponse {
|
|
|
30
100
|
}
|
|
31
101
|
export interface IExportRequest {
|
|
32
102
|
/** If unitID is specified, the input is the unit in the database */
|
|
33
|
-
unitID
|
|
103
|
+
unitID?: string;
|
|
34
104
|
/** If jsonID is specified, the input is the json file which represents a univer unit */
|
|
35
|
-
jsonID
|
|
105
|
+
jsonID?: string;
|
|
36
106
|
type: UniverInstanceType;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/** If ignoreTableExport is set to true, tables will be ignored on export */
|
|
40
|
-
ignoreTableExport?: boolean;
|
|
107
|
+
format: ExchangeFormat;
|
|
108
|
+
options?: IExchangeExportOptions;
|
|
41
109
|
}
|
|
42
110
|
export interface IExportResponse {
|
|
43
111
|
error: IError | undefined;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
export declare const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
3
|
+
export declare const DOC = "application/msword";
|
|
4
|
+
export declare const XLS = "application/vnd.ms-excel";
|
|
3
5
|
export declare const XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const CSV = "text/csv";
|
|
7
|
+
export declare const TSV = "text/tab-separated-values";
|
|
8
|
+
export declare const PPT = "application/vnd.ms-powerpoint";
|
|
6
9
|
export declare const PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
7
10
|
export declare const PDF = "application/pdf";
|
|
8
11
|
export declare const UNIT_CONTENT_TYPE: Record<UniverInstanceType, string[]>;
|
|
9
12
|
export declare const CONTENT_TYPE_EXTNAME: {
|
|
10
13
|
[key: string]: string;
|
|
11
14
|
};
|
|
15
|
+
export declare const UNIT_FILE_EXTENSIONS: Record<UniverInstanceType, string[]>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ILogContext, ISnapshotServerService } from '@univerjs-pro/collaboration';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { ICopyFileMetaResponse, IDocumentMeta, IFetchMissingChangesetsResponse, IGetDeserializedSheetBlockResponse, IGetLatestCsReqIdBySidResponse, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevResponse, IPdfMeta, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotResponse, ISheetBlock, ISlideMeta, ISnapshot, IWorkbookMeta, IWorksheetMeta } from '@univerjs/protocol';
|
|
5
|
-
import { transformSnapshotToSlideData } from '@univerjs-pro/collaboration';
|
|
2
|
+
import type { Nullable } from '@univerjs/core';
|
|
3
|
+
import type { IBoardMeta, ICopyFileMetaResponse, IDocumentMeta, IFetchMissingChangesetsResponse, IGetDeserializedSheetBlockResponse, IGetLatestCsReqIdBySidResponse, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevResponse, IPdfMeta, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotResponse, ISheetBlock, ISlideMeta, ISnapshot, IWorkbookMeta, IWorksheetMeta } from '@univerjs/protocol';
|
|
6
4
|
export interface IWorksheetMetaJson extends Omit<IWorksheetMeta, 'originalMeta'> {
|
|
7
5
|
originalMeta: string;
|
|
8
6
|
}
|
|
@@ -15,10 +13,12 @@ export interface IWorkbookMetaJson extends Omit<IWorkbookMeta, 'originalMeta' |
|
|
|
15
13
|
export interface IDocumentMetaJson extends Omit<IDocumentMeta, 'originalMeta'> {
|
|
16
14
|
originalMeta: string;
|
|
17
15
|
}
|
|
18
|
-
export type IExchangeSlideDocumentData = ReturnType<typeof transformSnapshotToSlideData>;
|
|
19
16
|
export interface ISlideMetaJson extends Omit<ISlideMeta, 'originalMeta'> {
|
|
20
17
|
originalMeta: string;
|
|
21
18
|
}
|
|
19
|
+
export interface IBoardMetaJson extends Omit<IBoardMeta, 'originalMeta'> {
|
|
20
|
+
originalMeta: string;
|
|
21
|
+
}
|
|
22
22
|
export interface IPdfMetaJson extends Omit<IPdfMeta, 'originalMeta'> {
|
|
23
23
|
originalMeta: string;
|
|
24
24
|
}
|
|
@@ -26,7 +26,7 @@ export interface ISnapshotJson extends Omit<ISnapshot, 'workbook' | 'doc' | 'sli
|
|
|
26
26
|
workbook: Partial<IWorkbookMetaJson>;
|
|
27
27
|
doc: Partial<IDocumentMetaJson>;
|
|
28
28
|
slide?: Partial<ISlideMetaJson>;
|
|
29
|
-
board?:
|
|
29
|
+
board?: Partial<IBoardMetaJson>;
|
|
30
30
|
pdf?: Partial<IPdfMetaJson>;
|
|
31
31
|
}
|
|
32
32
|
export interface ISheetBlockData extends Omit<ISheetBlock, 'data'> {
|
|
@@ -50,44 +50,12 @@ export interface ISnapshotBlockJsonResponse {
|
|
|
50
50
|
* @param snapshot
|
|
51
51
|
*/
|
|
52
52
|
export declare function transformWorkbookSnapshotMetaToString(snapshot: ISnapshot): Nullable<ISnapshotJson>;
|
|
53
|
-
/**
|
|
54
|
-
* Convert the Uint8Array in the snapshot to a string for easy transmission to the backend
|
|
55
|
-
* @param snapshot
|
|
56
|
-
*/
|
|
57
|
-
export declare function transformDocumentSnapshotMetaToString(snapshot: ISnapshot): Nullable<ISnapshotJson>;
|
|
58
|
-
/**
|
|
59
|
-
* Convert the Uint8Array in the slide snapshot to a string for easy transmission to the backend.
|
|
60
|
-
*/
|
|
61
|
-
export declare function transformSlideSnapshotMetaToString(snapshot: ISnapshot): Nullable<ISnapshotJson>;
|
|
62
|
-
/** Convert the Uint8Array in the PDF snapshot to a string for transmission. */
|
|
63
|
-
export declare function transformPdfSnapshotMetaToString(snapshot: ISnapshot): Nullable<ISnapshotJson>;
|
|
64
53
|
/**
|
|
65
54
|
* Convert the Uint8Array in the sheet block to a string for easy transmission to the backend
|
|
66
55
|
* @param sheetBlocks
|
|
67
|
-
* @returns
|
|
56
|
+
* @returns Encoded sheet blocks keyed by block id.
|
|
68
57
|
*/
|
|
69
58
|
export declare function transformSheetBlockMetaToString(sheetBlocks: ISheetBlock[]): ISheetBlockJson;
|
|
70
|
-
/**
|
|
71
|
-
* Convert the document data to snapshot data
|
|
72
|
-
*/
|
|
73
|
-
export declare function transformDocumentDataToSnapshotJson(documentData: IDocumentData): Promise<ISnapshotBlockJson>;
|
|
74
|
-
/**
|
|
75
|
-
* Convert the slide data to snapshot data.
|
|
76
|
-
* @returns Snapshot JSON payload with slide meta encoded as a string.
|
|
77
|
-
*/
|
|
78
|
-
export declare function transformSlideDataToSnapshotJson(slideData: IExchangeSlideDocumentData): Promise<ISnapshotBlockJson>;
|
|
79
|
-
/** Convert PDF unit data to snapshot JSON. */
|
|
80
|
-
export declare function transformPdfDataToSnapshotJson(pdfData: IPdfUnitData): Promise<ISnapshotBlockJson>;
|
|
81
|
-
/**
|
|
82
|
-
* Convert the Snapshot data to workbook data
|
|
83
|
-
*/
|
|
84
|
-
export declare function transformSnapshotJsonToDocumentData(json: ISnapshotBlockJsonResponse): IDocumentData;
|
|
85
|
-
/**
|
|
86
|
-
* Convert the Snapshot data to slide data.
|
|
87
|
-
*/
|
|
88
|
-
export declare function transformSnapshotJsonToSlideData(json: ISnapshotBlockJsonResponse): IExchangeSlideDocumentData;
|
|
89
|
-
/** Convert snapshot JSON to PDF unit data. */
|
|
90
|
-
export declare function transformSnapshotJsonToPdfData(json: ISnapshotBlockJsonResponse | ISnapshotBlockJson): IPdfUnitData;
|
|
91
59
|
/**
|
|
92
60
|
* The server needs to fully implement all interfaces, but when used by the client, use saveSheetBlock to cache the sheet block locally, and use getSheetBlock to obtain the sheet block.
|
|
93
61
|
*/
|
|
@@ -7,6 +7,7 @@ export declare function downloadFileByURL(url: string, filename: string, fileExt
|
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
9
|
export declare function getUniverInstanceTypeByFile(file: File): UniverInstanceType.UNIVER_UNKNOWN;
|
|
10
|
+
export declare function isSupportedFileType(file: File, univerType: UniverInstanceType): boolean;
|
|
10
11
|
export declare function getUploadFile(types: UniverInstanceType[], multiple?: boolean): Promise<FileList | null>;
|
|
11
12
|
export declare function getFileByURL(url: string, httpService: HTTPService): Promise<File | undefined>;
|
|
12
13
|
export declare function getFileNameFromURL(url: string): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExchangeFormat } from '../../services/request.service';
|
|
2
|
+
export declare const EXPORT_FORMAT_DIALOG = "exchange-client.export-format-dialog";
|
|
3
|
+
export interface IExchangeTargetItem {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IExportFormatDialogProps {
|
|
8
|
+
formats: ExchangeFormat[];
|
|
9
|
+
items: IExchangeTargetItem[];
|
|
10
|
+
selectedId: string;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
onConfirm: (format: ExchangeFormat, selectedId: string) => void | Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function ExportFormatDialog({ formats, items, selectedId: initialSelectedId, onCancel, onConfirm, }: IExportFormatDialogProps): import("react").JSX.Element;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0xa35d(_0x3a5908,_0x2cd682){_0x3a5908=_0x3a5908-0x148;var _0x42dd26=_0x42dd();var _0xa35d1f=_0x42dd26[_0x3a5908];return _0xa35d1f;}(function(_0x99db09,_0x875413){var _0x128661=_0xa35d,_0x201c8a=_0x99db09();while(!![]){try{var _0xdb54a8=-parseInt(_0x128661(0x156))/0x1*(parseInt(_0x128661(0x150))/0x2)+-parseInt(_0x128661(0x151))/0x3+parseInt(_0x128661(0x157))/0x4+parseInt(_0x128661(0x14e))/0x5*(parseInt(_0x128661(0x14d))/0x6)+-parseInt(_0x128661(0x14a))/0x7+-parseInt(_0x128661(0x153))/0x8*(parseInt(_0x128661(0x158))/0x9)+parseInt(_0x128661(0x14b))/0xa;if(_0xdb54a8===_0x875413)break;else _0x201c8a['push'](_0x201c8a['shift']());}catch(_0x2c8d48){_0x201c8a['push'](_0x201c8a['shift']());}}}(_0x42dd,0x3aa5b),function(_0x21e37e,_0x39b389){var _0x442bb6=_0xa35d;typeof exports==_0x442bb6(0x14f)&&typeof module<'u'?_0x39b389(require('@univerjs-pro/exchange-client'),require('@univerjs/core/facade')):typeof define=='function'&&define['amd']?define(['@univerjs-pro/exchange-client','@univerjs/core/facade'],_0x39b389):(_0x21e37e=typeof globalThis<'u'?globalThis:_0x21e37e||self,_0x39b389(_0x21e37e['UniverProExchangeClient'],_0x21e37e[_0x442bb6(0x155)]));}(this,function(_0x9e699e,_0x598d11){var _0x3d0e92=_0xa35d,_0x375357=class extends _0x598d11[_0x3d0e92(0x14c)]{['downloadFile'](_0x45f75a,_0x1eea23,_0x232f7a){var _0x2df643=_0x3d0e92;this[_0x2df643(0x154)]['get'](_0x9e699e[_0x2df643(0x152)])[_0x2df643(0x149)](_0x45f75a,_0x1eea23,_0x232f7a);}};_0x598d11[_0x3d0e92(0x14c)][_0x3d0e92(0x148)](_0x375357);}));function _0x42dd(){var _0x1fb7e1=['1747QJiAcZ','107500FsXTNQ','603CgsFOc','extend','downloadFile','2029503sDKcKQ','9223010LdjjWS','FUniver','54nARoFY','161145KVAwXd','object','26nFydUM','867807LQdnga','IExchangeService','47416yhJjYE','_injector','UniverCoreFacade'];_0x42dd=function(){return _0x1fb7e1;};return _0x42dd();}
|