@yudaocode/univer-docs-ui 1.6.215 → 1.6.216
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 +315 -140
- package/lib/cjs/index.js.map +1 -1
- package/lib/es/index.js +313 -140
- package/lib/es/index.js.map +1 -1
- package/lib/types/index.d.ts +77 -11
- package/package.json +3 -3
package/lib/types/index.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import * as _univerjs_core from '@univerjs/core';
|
|
2
|
-
import { Disposable, Injector, ICommandService, LocaleService, IOperation, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
|
+
import { Disposable, Injector, ICommandService, LocaleService, IOperation, Plugin, UniverInstanceType, IDocumentData } from '@univerjs/core';
|
|
3
3
|
import { IMenuManagerService, IUIPartsService, ISidebarService, ComponentManager, IconManager, IShortcutService } from '@univerjs/ui';
|
|
4
|
-
import { DocSdtKind, DocIoTarget, IDocPdfExportOptions, DocSdtControlKind, IDocSdtControlSpec, IDocDatasetGroup } from '@yudaocode/univer-docs';
|
|
4
|
+
import { DocSdtKind, DocIoTarget, IDocPdfExportOptions, DocSdtControlKind, IDocSdtControlSpec, IDocDatasetGroup, DocExportFormat, IDocImportWarning, IDocIoService } from '@yudaocode/univer-docs';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
export { default as enUS } from './locale/en-US.js';
|
|
7
7
|
export { IDocsUILocale, default as zhCN } from './locale/zh-CN.js';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
type DocModalTabMode = 'import' | 'preview' | 'form' | 'json';
|
|
10
|
+
type DocModalTabMode = 'import' | 'export' | 'print' | 'preview' | 'form' | 'json';
|
|
11
|
+
type DocIoModalTabKey = 'import' | 'export' | 'print' | 'preview' | 'form' | 'json';
|
|
12
|
+
interface IDocIoModalConfig {
|
|
13
|
+
tabs?: DocIoModalTabKey[];
|
|
14
|
+
defaultTab?: DocModalTabMode | string;
|
|
15
|
+
showPipelineBadge?: boolean;
|
|
16
|
+
}
|
|
11
17
|
interface IUniverDocsUIFeatures {
|
|
12
18
|
/** Enable structured SDT form controls (text/date/select/cascader/checkbox/lock). Default: `false` */
|
|
13
19
|
sdtControls?: boolean;
|
|
@@ -73,9 +79,12 @@ interface IUniverDocsUIFeatures {
|
|
|
73
79
|
bookmarks?: boolean;
|
|
74
80
|
/** Optional allow-list of permitted SDT control kinds (all kinds allowed when omitted) */
|
|
75
81
|
allowedSdtKinds?: DocSdtKind[];
|
|
82
|
+
/** Optional IO modal compact mode configuration */
|
|
83
|
+
ioModal?: IDocIoModalConfig;
|
|
76
84
|
}
|
|
77
|
-
type IResolvedDocsUIFeatures = Required<Omit<IUniverDocsUIFeatures, 'allowedSdtKinds'>> & {
|
|
85
|
+
type IResolvedDocsUIFeatures = Required<Omit<IUniverDocsUIFeatures, 'allowedSdtKinds' | 'ioModal'>> & {
|
|
78
86
|
allowedSdtKinds?: DocSdtKind[];
|
|
87
|
+
ioModal?: IDocIoModalConfig;
|
|
79
88
|
};
|
|
80
89
|
declare function isDocSdtKindAllowed(features: Pick<IUniverDocsUIFeatures, 'allowedSdtKinds'> | undefined, kind: DocSdtKind): boolean;
|
|
81
90
|
declare function resolveDocsUIFeatures(raw?: IUniverDocsUIFeatures): IResolvedDocsUIFeatures;
|
|
@@ -83,12 +92,15 @@ interface IDocsUIFeatureService {
|
|
|
83
92
|
readonly features$: Observable<IResolvedDocsUIFeatures>;
|
|
84
93
|
readonly modalOpen$: Observable<boolean>;
|
|
85
94
|
readonly modalTab$: Observable<DocModalTabMode>;
|
|
95
|
+
readonly ioModal$: Observable<IDocIoModalConfig | undefined>;
|
|
86
96
|
getFeatures(): IResolvedDocsUIFeatures;
|
|
87
97
|
setFeatures(features: IUniverDocsUIFeatures): void;
|
|
88
98
|
patchFeatures(patch: Partial<IResolvedDocsUIFeatures>): void;
|
|
99
|
+
getIoModalConfig(): IDocIoModalConfig | undefined;
|
|
100
|
+
setIoModalConfig(config?: IDocIoModalConfig): void;
|
|
89
101
|
isModalOpen(): boolean;
|
|
90
102
|
getModalTab(): DocModalTabMode;
|
|
91
|
-
openModal(tab?: DocModalTabMode): void;
|
|
103
|
+
openModal(tab?: DocModalTabMode | string, ioModal?: IDocIoModalConfig): void;
|
|
92
104
|
closeModal(): void;
|
|
93
105
|
setModalTab(tab: DocModalTabMode): void;
|
|
94
106
|
}
|
|
@@ -97,16 +109,23 @@ declare class DocsUIFeatureService extends Disposable implements IDocsUIFeatureS
|
|
|
97
109
|
private readonly _features$;
|
|
98
110
|
private readonly _modalOpen$;
|
|
99
111
|
private readonly _modalTab$;
|
|
112
|
+
private readonly _ioModal$;
|
|
113
|
+
private _baseIoModal?;
|
|
100
114
|
readonly features$: Observable<IResolvedDocsUIFeatures>;
|
|
101
115
|
readonly modalOpen$: Observable<boolean>;
|
|
102
116
|
readonly modalTab$: Observable<DocModalTabMode>;
|
|
103
|
-
|
|
117
|
+
readonly ioModal$: Observable<IDocIoModalConfig | undefined>;
|
|
118
|
+
constructor(initial?: IUniverDocsUIFeatures, initialIoModal?: IDocIoModalConfig);
|
|
119
|
+
private _mergeIoModal;
|
|
120
|
+
private _resolveValidTab;
|
|
104
121
|
getFeatures(): IResolvedDocsUIFeatures;
|
|
105
122
|
setFeatures(features: IUniverDocsUIFeatures): void;
|
|
106
123
|
patchFeatures(patch: Partial<IResolvedDocsUIFeatures>): void;
|
|
124
|
+
getIoModalConfig(): IDocIoModalConfig | undefined;
|
|
125
|
+
setIoModalConfig(config?: IDocIoModalConfig): void;
|
|
107
126
|
isModalOpen(): boolean;
|
|
108
127
|
getModalTab(): DocModalTabMode;
|
|
109
|
-
openModal(tab?: DocModalTabMode): void;
|
|
128
|
+
openModal(tab?: DocModalTabMode | string, ioModal?: IDocIoModalConfig): void;
|
|
110
129
|
closeModal(): void;
|
|
111
130
|
setModalTab(tab: DocModalTabMode): void;
|
|
112
131
|
}
|
|
@@ -116,6 +135,8 @@ interface IUniverDocsExtUIConfig {
|
|
|
116
135
|
defaultOpenInspector?: boolean;
|
|
117
136
|
/** On-demand enterprise structured form & dataset features (all `false` by default) */
|
|
118
137
|
features?: IUniverDocsUIFeatures;
|
|
138
|
+
/** Optional IO modal compact mode configuration (visible tabs, defaultTab, pipeline badge visibility) */
|
|
139
|
+
ioModal?: IDocIoModalConfig;
|
|
119
140
|
}
|
|
120
141
|
declare class DocsExtUIController extends Disposable {
|
|
121
142
|
private readonly _config;
|
|
@@ -142,9 +163,11 @@ declare const DOC_INSPECTOR_SIDEBAR_ID = "yudao.docs.inspector.sidebar";
|
|
|
142
163
|
declare const DOC_INSPECTOR_COMPONENT_KEY = "yudao.docs.inspector.component";
|
|
143
164
|
declare function openDocInspectorSidebar(sidebarService: ISidebarService): void;
|
|
144
165
|
declare const ToggleDocInspectorOperation: IOperation;
|
|
145
|
-
|
|
146
|
-
tab?: DocModalTabMode;
|
|
147
|
-
|
|
166
|
+
interface IOpenDocModalOperationParams {
|
|
167
|
+
tab?: DocModalTabMode | string;
|
|
168
|
+
ioModal?: IDocIoModalConfig;
|
|
169
|
+
}
|
|
170
|
+
declare const OpenDocModalOperation: IOperation<IOpenDocModalOperationParams>;
|
|
148
171
|
declare const PrintDocOperation: IOperation<{
|
|
149
172
|
unitId?: string;
|
|
150
173
|
options?: IDocPdfExportOptions;
|
|
@@ -153,6 +176,8 @@ declare const DOC_IMPORT_ACCEPT_EXTENSIONS = ".docx,.doc,.rtf,.odt,.xml,.md,.htm
|
|
|
153
176
|
declare const ImportDocFileOperation: IOperation<{
|
|
154
177
|
file?: File;
|
|
155
178
|
target?: DocIoTarget;
|
|
179
|
+
signal?: AbortSignal;
|
|
180
|
+
ioModal?: IDocIoModalConfig;
|
|
156
181
|
}>;
|
|
157
182
|
declare const QuickInsertDocSdtOperation: IOperation<{
|
|
158
183
|
kind: DocSdtControlKind;
|
|
@@ -161,6 +186,7 @@ declare const FillDocSampleDatasetOperation: IOperation;
|
|
|
161
186
|
declare const UpdateDocsUIFeaturesOperation: IOperation<{
|
|
162
187
|
features?: IUniverDocsUIFeatures;
|
|
163
188
|
patch?: Partial<IResolvedDocsUIFeatures>;
|
|
189
|
+
ioModal?: IDocIoModalConfig;
|
|
164
190
|
}>;
|
|
165
191
|
|
|
166
192
|
declare const UNIVER_DOCS_EXT_UI_PLUGIN_NAME = "YUDAO_UNIVER_DOCS_EXT_UI_PLUGIN";
|
|
@@ -188,8 +214,48 @@ declare const DocInspectorPanel: React.FC;
|
|
|
188
214
|
declare const YUDAO_DOC_FIELD_DND_MIME = "application/x-yudao-doc-field";
|
|
189
215
|
declare const DocLeftSidebar: React.FC;
|
|
190
216
|
|
|
217
|
+
interface IPendingImportState {
|
|
218
|
+
snapshot: Partial<IDocumentData>;
|
|
219
|
+
warnings: IDocImportWarning[];
|
|
220
|
+
executedBy: 'browser' | 'server';
|
|
221
|
+
fileName: string;
|
|
222
|
+
}
|
|
223
|
+
interface IIoErrorState {
|
|
224
|
+
operation: 'import' | 'export';
|
|
225
|
+
failedTarget: 'browser' | 'server';
|
|
226
|
+
message: string;
|
|
227
|
+
exportFormat?: DocExportFormat;
|
|
228
|
+
}
|
|
229
|
+
declare function runGuardedStagedImport(params: {
|
|
230
|
+
file: File;
|
|
231
|
+
unitId: string;
|
|
232
|
+
activeTarget: 'browser' | 'server';
|
|
233
|
+
ioService: IDocIoService;
|
|
234
|
+
importReqSeqRef: {
|
|
235
|
+
current: number;
|
|
236
|
+
};
|
|
237
|
+
importAbortRef: {
|
|
238
|
+
current: AbortController | null;
|
|
239
|
+
};
|
|
240
|
+
onStaged: (pending: IPendingImportState) => void;
|
|
241
|
+
onError: (errState: IIoErrorState) => void;
|
|
242
|
+
}): Promise<void>;
|
|
243
|
+
declare function confirmStagedDocImport(params: {
|
|
244
|
+
commandService: {
|
|
245
|
+
syncExecuteCommand: (id: string, params?: any) => boolean;
|
|
246
|
+
};
|
|
247
|
+
unitId: string;
|
|
248
|
+
pendingImport: IPendingImportState;
|
|
249
|
+
}): {
|
|
250
|
+
ok: true;
|
|
251
|
+
statusTip: string;
|
|
252
|
+
} | {
|
|
253
|
+
ok: false;
|
|
254
|
+
ioError: IIoErrorState;
|
|
255
|
+
statusTip: string;
|
|
256
|
+
};
|
|
191
257
|
declare const DocPreviewAndIoModal: React.FC;
|
|
192
258
|
|
|
193
259
|
declare const DocSdtCanvasPopupHost: React.FC;
|
|
194
260
|
|
|
195
|
-
export { DOC_IMPORT_ACCEPT_EXTENSIONS, DOC_INSPECTOR_COMPONENT_KEY, DOC_INSPECTOR_SIDEBAR_ID, DocInspectorPanel, DocLeftSidebar, type DocModalTabMode, DocPreviewAndIoModal, DocSdtCanvasPopupHost, DocsExtUIController, DocsUIFeatureService, FillDocSampleDatasetOperation, IDocsUIFeatureService, type IResolvedDocsUIFeatures, type IUniverDocsExtUIConfig, type IUniverDocsUIFeatures, ImportDocFileOperation, OpenDocModalOperation, PrintDocOperation, QuickInsertDocSdtOperation, ToggleDocInspectorOperation, UNIVER_DOCS_EXT_UI_PLUGIN_NAME, UniverDocsExtUIPlugin, UpdateDocsUIFeaturesOperation, YUDAO_DOC_FIELD_DND_MIME, isDocSdtKindAllowed, openDocInspectorSidebar, resolveDocsUIFeatures, resolveEffectiveSdtDatasetBinding };
|
|
261
|
+
export { DOC_IMPORT_ACCEPT_EXTENSIONS, DOC_INSPECTOR_COMPONENT_KEY, DOC_INSPECTOR_SIDEBAR_ID, DocInspectorPanel, type DocIoModalTabKey, DocLeftSidebar, type DocModalTabMode, DocPreviewAndIoModal, DocSdtCanvasPopupHost, DocsExtUIController, DocsUIFeatureService, FillDocSampleDatasetOperation, type IDocIoModalConfig, IDocsUIFeatureService, type IIoErrorState, type IOpenDocModalOperationParams, type IPendingImportState, type IResolvedDocsUIFeatures, type IUniverDocsExtUIConfig, type IUniverDocsUIFeatures, ImportDocFileOperation, OpenDocModalOperation, PrintDocOperation, QuickInsertDocSdtOperation, ToggleDocInspectorOperation, UNIVER_DOCS_EXT_UI_PLUGIN_NAME, UniverDocsExtUIPlugin, UpdateDocsUIFeaturesOperation, YUDAO_DOC_FIELD_DND_MIME, confirmStagedDocImport, isDocSdtKindAllowed, openDocInspectorSidebar, resolveDocsUIFeatures, resolveEffectiveSdtDatasetBinding, runGuardedStagedImport };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yudaocode/univer-docs-ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.216",
|
|
4
4
|
"description": "Univer Docs UI enhancement plugin: on-demand SDT structured controls, table row loop binding, per-instance canvas popups, and DOCX/HTML/PDF IO modal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/yudaocode/yudao-univer#readme",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"react": ">=18.0.0",
|
|
63
63
|
"react-dom": ">=18.0.0",
|
|
64
64
|
"rxjs": ">=7.0.0",
|
|
65
|
-
"@yudaocode/univer-docs": "^1.6.
|
|
65
|
+
"@yudaocode/univer-docs": "^1.6.216"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@univerjs/core": "1.6.2",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react": "^18.3.1",
|
|
76
76
|
"react-dom": "^18.3.1",
|
|
77
77
|
"rxjs": "^7.8.2",
|
|
78
|
-
"@yudaocode/univer-docs": "1.6.
|
|
78
|
+
"@yudaocode/univer-docs": "1.6.216"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsup",
|