@univerjs-pro/sheets-exchange-client 0.1.12 → 0.1.13
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/index.js +2 -2
- package/lib/es/index.js +2 -2
- package/lib/index.css +1 -1
- package/lib/locale/en-US.json +24 -0
- package/lib/locale/ru-RU.json +24 -0
- package/lib/locale/zh-CN.json +24 -0
- package/lib/types/controllers/menu.d.ts +2 -1
- package/lib/types/index.d.ts +9 -3
- package/lib/types/services/operate.service.d.ts +8 -2
- package/lib/types/services/request.service.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +13 -8
- package/lib/types/locale/index.d.ts +0 -3
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-exchange-uploading{display:flex;flex-direction:column;align-items:flex-start}.univer-exchange-uploading-tip{color:var(--color-black);font-size:var(--font-size-sm);padding:0 var(--padding-lg) 0 var(--padding-sm)}.univer-exchange-uploading-progress{padding:0 var(--padding-lg) 0 var(--padding-sm)}.univer-exchange-upload-progress{width:324px;height:6px;margin:var(--margin-base) 0 var(--margin-sm) 0;background-color:rgb(var(--border-color));border-radius:var(--border-radius-lg)}.univer-exchange-upload-progress-inner{height:6px;border-radius:var(--border-radius-lg);transition:width .5s}.univer-exchange-upload-button{cursor:pointer;user-select:none;height:28px;border-width:0;border-radius:6px;padding:
|
|
1
|
+
.univer-exchange-uploading{display:flex;flex-direction:column;align-items:flex-start;margin-top:var(--margin-lg)}.univer-exchange-uploading-tip{color:var(--color-black);font-size:var(--font-size-sm);padding:0 var(--padding-lg) 0 var(--padding-sm)}.univer-exchange-uploading-progress{padding:0 var(--padding-lg) 0 var(--padding-sm)}.univer-exchange-upload-progress{width:324px;height:6px;margin:var(--margin-base) 0 var(--margin-sm) 0;background-color:rgb(var(--border-color));border-radius:var(--border-radius-lg)}.univer-exchange-upload-progress-inner{height:6px;border-radius:var(--border-radius-lg);transition:width .5s}.univer-exchange-upload-button{cursor:pointer;user-select:none;height:28px;border-width:0;border-radius:6px;padding:0 var(--padding-sm);font-size:var(--font-size-xs);transition:all .15s;color:rgb(var(--hyacinth-500));background-color:transparent;border-color:transparent}.univer-exchange-upload-button:hover{background-color:rgb(var(--hyacinth-50))}.univer-exchange-link-list{max-height:280px;overflow-y:auto;margin-top:var(--margin-lg)}.univer-exchange-link-list-inner{display:flex;list-style:none;padding:0;margin:0;gap:8px;flex-direction:column}.univer-exchange-link-list-inner-item-link{display:flex;justify-content:space-between;text-decoration-line:none;color:var(--color-black);padding:var(--padding-xs) var(--padding-sm);background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-exchange-link-list-inner-item-link:hover{background-color:rgb(var(--border-color))}.univer-exchange-link-list-inner-item-link-content{display:flex;align-items:center}.univer-exchange-link-list-inner-item-link-icon{height:20px;font-size:20px;display:flex}.univer-exchange-link-list-inner-item-link-name{margin-left:var(--margin-xxs);color:var(--color-black);font-size:var(--font-size-sm)}.univer-exchange-link-list-inner-item-link-direct{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color-secondary));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-exchange-link-list-inner-item-link-direct:hover{background-color:rgb(var(--bg-color-hover))}.univer-exchange-upload-error{display:flex;flex-direction:column;align-items:flex-start;margin-top:var(--margin-lg)}.univer-exchange-upload-error-tip{color:var(--color-black);font-size:var(--font-size-sm);padding:0 var(--padding-lg) 0 var(--padding-sm);margin-bottom:var(--margin-sm)}.univer-exchange-upload-success{display:flex;padding:0 var(--padding-xs) 0 var(--padding-sm);align-items:center;justify-content:space-between;margin-top:var(--margin-sm)}.univer-exchange-upload-success-tip{color:rgb(var(--text-color-secondary));font-size:var(--font-size-xs)}.univer-exchange-upload-notification{position:fixed;z-index:1000;bottom:48px;right:12px;width:372px;display:flex;flex-direction:column;justify-content:flex-start;padding:var(--padding-xl) var(--padding-base) var(--padding-lg) var(--padding-base);background-color:#fff;border-radius:6px;box-shadow:var(--box-shadow-base);box-sizing:border-box}.univer-exchange-upload-notification-header{display:flex;align-items:center;justify-content:space-between;padding:0 var(--padding-sm) 0 6px}.univer-exchange-upload-notification-header-title{display:flex}.univer-exchange-upload-notification-header-icon{height:24px;font-size:24px}.univer-exchange-upload-notification-header-icon-success{color:rgb(var(--success-color))}.univer-exchange-upload-notification-header-icon-uploading{color:rgb(var(--info-color))}.univer-exchange-upload-notification-header-icon-error{color:rgb(var(--error-color))}.univer-exchange-upload-notification-header-text{margin-left:6px;line-height:24px;color:var(--color-black);font-size:17px;font-weight:600}.univer-exchange-upload-notification-header-close{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color-secondary));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-exchange-upload-notification-header-close:hover{background-color:rgb(var(--bg-color-hover))}.univer-exchange-upload-notification-content{max-height:336px}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exchange": {
|
|
3
|
+
"file": "File",
|
|
4
|
+
"upload": "Open(File)",
|
|
5
|
+
"download": "Save As",
|
|
6
|
+
"uploadJson": "Upload[No Collaboration]",
|
|
7
|
+
"downloadJson": "Download[No Collaboration]",
|
|
8
|
+
"load": "Load remote xlsx file",
|
|
9
|
+
"uploadFile": "Upload xlsx file",
|
|
10
|
+
"uploading": "Uploading",
|
|
11
|
+
"uploadSuccess": "File uploaded successfully",
|
|
12
|
+
"uploadSuccessTip": "{0} file(s) uploaded successfully",
|
|
13
|
+
"downloading": "Downloading",
|
|
14
|
+
"downloadSuccess": "Download success",
|
|
15
|
+
"unknownMistake": "Unknown mistake",
|
|
16
|
+
"networkError": "Network error",
|
|
17
|
+
"tooLarge": "Data is too large",
|
|
18
|
+
"internalError": "Internal unknown error",
|
|
19
|
+
"interrupt": "The network connection was interrupted and the file upload failed.",
|
|
20
|
+
"wait": "Please wait...",
|
|
21
|
+
"cancel": "Cancel",
|
|
22
|
+
"uploadAgain": "Upload again"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exchange": {
|
|
3
|
+
"file": "Файл",
|
|
4
|
+
"upload": "Открыть(Файл)",
|
|
5
|
+
"download": "Сохранить как",
|
|
6
|
+
"uploadJson": "Загрузить[Без совместной работы]",
|
|
7
|
+
"downloadJson": "Скачать[Без совместной работы]",
|
|
8
|
+
"load": "Загрузить удаленный файл xlsx",
|
|
9
|
+
"uploadFile": "Загрузить файл xlsx",
|
|
10
|
+
"uploading": "Загрузка",
|
|
11
|
+
"uploadSuccess": "Файл успешно загружен",
|
|
12
|
+
"uploadSuccessTip": "{0} файл(ов) успешно загружен(о)",
|
|
13
|
+
"downloading": "Скачивание",
|
|
14
|
+
"downloadSuccess": "Скачивание успешно",
|
|
15
|
+
"unknownMistake": "Неизвестная ошибка",
|
|
16
|
+
"networkError": "Сетевая ошибка",
|
|
17
|
+
"tooLarge": "Данные слишком большие",
|
|
18
|
+
"internalError": "Внутренняя неизвестная ошибка",
|
|
19
|
+
"interrupt": "Сетевое соединение было прервано, и загрузка файла не удалась.",
|
|
20
|
+
"wait": "Пожалуйста, подождите...",
|
|
21
|
+
"cancel": "Отмена",
|
|
22
|
+
"uploadAgain": "Загрузить снова"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exchange": {
|
|
3
|
+
"file": "文件",
|
|
4
|
+
"upload": "打开(文件)",
|
|
5
|
+
"download": "另存为",
|
|
6
|
+
"uploadJson": "上传[非协同]",
|
|
7
|
+
"downloadJson": "下载[非协同]",
|
|
8
|
+
"load": "加载远程 XLSX 文件",
|
|
9
|
+
"uploadFile": "上传 xlsx 文件",
|
|
10
|
+
"uploading": "上传中",
|
|
11
|
+
"uploadSuccess": "文件上传成功",
|
|
12
|
+
"uploadSuccessTip": "{0}个文件上传成功",
|
|
13
|
+
"downloading": "下载中",
|
|
14
|
+
"downloadSuccess": "下载成功",
|
|
15
|
+
"unknownMistake": "未知错误",
|
|
16
|
+
"networkError": "网络异常",
|
|
17
|
+
"tooLarge": "数据流过大",
|
|
18
|
+
"internalError": "内部未知错误",
|
|
19
|
+
"interrupt": "网络连接中断,文件上传失败。",
|
|
20
|
+
"wait": "请稍等...",
|
|
21
|
+
"cancel": "取消",
|
|
22
|
+
"uploadAgain": "再次上传"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
|
+
import { IAccessor } from '@wendellhu/redi';
|
|
2
3
|
|
|
3
|
-
export declare function SheetsExchangeMenuItemFactory(): IMenuSelectorItem<string>;
|
|
4
|
+
export declare function SheetsExchangeMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
|
|
4
5
|
export declare function ImportXLSXToUnitIdMenuItemFactory(): IMenuButtonItem<string>;
|
|
5
6
|
export declare function ExportXLSXByUnitIdMenuItemFactory(): IMenuButtonItem<string>;
|
|
6
7
|
export declare function ImportXLSXToSnapshotMenuItemFactory(): IMenuButtonItem<string>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
16
|
+
export { UniverSheetsExchangeClientPlugin } from './plugin';
|
|
17
|
+
export { IExchangeService, ExchangeService } from './services/exchange.service';
|
|
18
|
+
export { getUploadXLSXFile, downloadFile } from './services/utils/tool';
|
|
19
|
+
export { IUploadNotificationService, UploadNotificationService, UploadNotificationState } from './services/upload-notification.service';
|
|
20
|
+
export { IUploadProgressService, UploadProgressService } from './services/upload-progress.service';
|
|
21
|
+
export { UploadNotificationContainer } from './views/UploadNotificationContainer';
|
|
22
|
+
export { RequestService, IRequestService } from './services/request.service';
|
|
23
|
+
export { ISheetsExchangeOperateService, SheetsExchangeOperateService } from './services/operate.service';
|
|
24
|
+
export { EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY, EXCHANGE_IMPORT_SERVER_URL_KEY, EXCHANGE_EXPORT_SERVER_URL_KEY, EXCHANGE_GET_TASK_SERVER_URL_KEY, EXCHANGE_SIGN_URL_SERVER_URL_KEY } from './services/request.service';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Disposable, ILogService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
1
|
+
import { Disposable, ILogService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
import { IDisposable } from '@wendellhu/redi';
|
|
3
3
|
import { IProgressService, IMessageService } from '@univerjs/ui';
|
|
4
4
|
import { ExchangeService } from './exchange.service';
|
|
@@ -20,12 +20,17 @@ export interface ISheetsExchangeOperateService {
|
|
|
20
20
|
* Export xlsx file by unitId
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
|
-
exportXLSXByUnitId(): Promise<void>;
|
|
23
|
+
exportXLSXByUnitId(unitId?: string, unitName?: string, unitType?: UniverInstanceType): Promise<void>;
|
|
24
24
|
/**
|
|
25
25
|
* Export xlsx file by snapshot
|
|
26
26
|
* @returns
|
|
27
27
|
*/
|
|
28
28
|
exportXLSXBySnapshot(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Customize the imported Unit URL format according to the needs of your own scene
|
|
31
|
+
* @param getLink
|
|
32
|
+
*/
|
|
33
|
+
registerLink(getLink: (unitId: string, univerType: UniverInstanceType) => string): void;
|
|
29
34
|
}
|
|
30
35
|
export declare const ISheetsExchangeOperateService: import('@wendellhu/redi').IdentifierDecorator<ISheetsExchangeOperateService>;
|
|
31
36
|
export declare class SheetsExchangeOperateService extends Disposable implements ISheetsExchangeOperateService, IDisposable {
|
|
@@ -43,6 +48,7 @@ export declare class SheetsExchangeOperateService extends Disposable implements
|
|
|
43
48
|
importXLSXToSnapshot(): Promise<void>;
|
|
44
49
|
exportXLSXByUnitId(): Promise<void>;
|
|
45
50
|
exportXLSXBySnapshot(): Promise<void>;
|
|
51
|
+
registerLink(getLink: (unitId: string, univerType: UniverInstanceType) => string): void;
|
|
46
52
|
private _getUnitID;
|
|
47
53
|
private _getUnitName;
|
|
48
54
|
private _getUnitJson;
|
|
@@ -89,7 +89,7 @@ export declare class RequestService implements IRequestService, IDisposable {
|
|
|
89
89
|
*/
|
|
90
90
|
upload(file: File | string, size?: number, flate?: boolean): Promise<IFileUploadResponse | undefined>;
|
|
91
91
|
import(importRequest: IImportRequest): Promise<IImportResponse | undefined>;
|
|
92
|
-
export(exportRequest: IExportRequest): Promise<
|
|
92
|
+
export(exportRequest: IExportRequest): Promise<IExportResponse | undefined>;
|
|
93
93
|
getTask(taskID: string): Promise<IGetTaskResponse | undefined>;
|
|
94
94
|
signUrl(fileID: string): Promise<ISignUrlResponse | undefined>;
|
|
95
95
|
private _getUploadFileURL;
|