@yudaocode/univer-pdfs-ui 1.6.210 → 1.6.211

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/index.css CHANGED
@@ -1107,10 +1107,79 @@
1107
1107
  flex-direction: column;
1108
1108
  gap: 10px;
1109
1109
  min-height: 0;
1110
+ overflow-y: auto;
1110
1111
  background: #FFFFFF;
1111
1112
  z-index: 2;
1112
1113
  }
1113
1114
 
1115
+ .univer-pdf-io-badge {
1116
+ display: inline-block;
1117
+ padding: 0 5px;
1118
+ border-radius: 999px;
1119
+ font-size: 10px;
1120
+ line-height: 15px;
1121
+ font-weight: 500;
1122
+ }
1123
+
1124
+ .univer-pdf-io-badge.is-ready {
1125
+ background: #E8F7EE;
1126
+ color: #16803C;
1127
+ }
1128
+
1129
+ .univer-pdf-io-badge.is-unconfigured {
1130
+ background: #F4F5F7;
1131
+ color: #7D8698;
1132
+ }
1133
+
1134
+ .univer-pdf-io-import-box {
1135
+ padding: 8px 10px;
1136
+ background: #F9FAFB;
1137
+ border: 1px solid #E3E5EA;
1138
+ border-radius: 6px;
1139
+ display: flex;
1140
+ flex-direction: column;
1141
+ gap: 7px;
1142
+ }
1143
+
1144
+ .univer-pdf-io-staged-card {
1145
+ padding: 8px 10px;
1146
+ background: #FFFFFF;
1147
+ border: 1px solid #D2DAFA;
1148
+ border-radius: 6px;
1149
+ display: flex;
1150
+ flex-direction: column;
1151
+ gap: 6px;
1152
+ }
1153
+
1154
+ .univer-pdf-io-warnings-box {
1155
+ padding: 6px 8px;
1156
+ border-radius: 5px;
1157
+ font-size: 11px;
1158
+ line-height: 1.45;
1159
+ background: #FFFBEB;
1160
+ border: 1px solid #FDE68A;
1161
+ color: #92400E;
1162
+ }
1163
+
1164
+ .univer-pdf-io-warnings-box.is-clean {
1165
+ background: #F4F5F7;
1166
+ border-color: #E3E5EA;
1167
+ color: #4E5565;
1168
+ }
1169
+
1170
+ .univer-pdf-io-error-banner {
1171
+ padding: 8px 10px;
1172
+ border-radius: 6px;
1173
+ background: #FEF2F2;
1174
+ border: 1px solid #FECACA;
1175
+ color: #B91C1C;
1176
+ font-size: 11.5px;
1177
+ line-height: 1.45;
1178
+ display: flex;
1179
+ flex-direction: column;
1180
+ gap: 6px;
1181
+ }
1182
+
1114
1183
  .univer-pdf-modal-label {
1115
1184
  font-size: 12px;
1116
1185
  font-weight: 600;
@@ -1,13 +1,13 @@
1
1
  import * as _univerjs_core from '@univerjs/core';
2
2
  import { Disposable, ICommandService, IOperation, Plugin, Injector, UniverInstanceType } from '@univerjs/core';
3
3
  import { IMenuManagerService, IUIPartsService, ISidebarService, ComponentManager, IconManager } from '@univerjs/ui';
4
- import { PdfElementType, IPdfjsAssetsConfig, IPdfExportOptions, PdfInteractionMode, PdfDisplayUnit, IPdfImportOutcome, IPdfPageSize } from '@yudaocode/univer-pdfs';
4
+ import { PdfElementType, IPdfjsAssetsConfig, IPdfExportOptions, PdfIoTarget, PdfInteractionMode, PdfDisplayUnit, IPdfImportOutcome, IPdfPageSize, IPdfImportOutcomeReport, IPdfIoCapabilities } from '@yudaocode/univer-pdfs';
5
5
  import { Observable } from 'rxjs';
6
6
  export { default as PdfsUIEnUS } from './locale/en-US.js';
7
7
  export { IPdfsUILocale, default as PdfsUIZhCN } from './locale/zh-CN.js';
8
8
  import React from 'react';
9
9
 
10
- type PdfModalTabMode = 'preview' | 'json';
10
+ type PdfModalTabMode = 'preview' | 'import' | 'json';
11
11
  type PdfShapeKind = 'rect' | 'ellipse' | 'line' | 'highlight';
12
12
  interface IReportWidgetsConfig {
13
13
  qrcode?: boolean;
@@ -163,9 +163,13 @@ declare const OpenPdfPreviewOperation: IOperation<{
163
163
  declare function readBrowserFileAsOverlayOutcome(file: File, options?: {
164
164
  password?: string;
165
165
  }): Promise<IPdfImportOutcome>;
166
- declare const UploadBasePdfOperation: IOperation<{
166
+ interface IUploadBasePdfOperationParams {
167
+ file?: File;
167
168
  password?: string;
168
- }>;
169
+ target?: PdfIoTarget;
170
+ unitId?: string;
171
+ }
172
+ declare const UploadBasePdfOperation: IOperation<IUploadBasePdfOperationParams, boolean | Promise<boolean>>;
169
173
  declare const SavePdfToHostOperation: IOperation;
170
174
  interface IPrintPdfOperationParams {
171
175
  unitId?: string;
@@ -238,6 +242,33 @@ declare const PdfInspectorPanel: React.FC;
238
242
 
239
243
  declare const PdfLeftSidebar: React.FC;
240
244
 
245
+ interface IPdfModalIoErrorState {
246
+ operation: 'import' | 'export' | 'preview';
247
+ message: string;
248
+ failedTarget: 'browser' | 'server';
249
+ fallbackTarget: 'browser' | 'server';
250
+ }
251
+ declare function resolveInitialModalIoTarget(caps: IPdfIoCapabilities, tab?: PdfModalTabMode): 'browser' | 'server';
252
+ interface IPdfUnifiedIoSectionProps {
253
+ ioTarget: 'browser' | 'server';
254
+ browserAvailable: boolean;
255
+ serverAvailable: boolean;
256
+ snapSizeKb: string;
257
+ editorEnabled: boolean;
258
+ importing: boolean;
259
+ rendering: boolean;
260
+ selectedFileName?: string;
261
+ pendingImport: IPdfImportOutcomeReport | null;
262
+ ioError: IPdfModalIoErrorState | null;
263
+ fileInputRef: React.RefObject<HTMLInputElement | null>;
264
+ onSelectTarget: (target: 'browser' | 'server') => void;
265
+ onFileInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
266
+ onPickFileClick: () => void;
267
+ onConfirmImport: () => void;
268
+ onCancelImport: () => void;
269
+ onSwitchAndRetry: () => void;
270
+ }
271
+ declare const PdfUnifiedIoSection: React.FC<IPdfUnifiedIoSectionProps>;
241
272
  declare const PdfPreviewModal: React.FC;
242
273
 
243
- export { AdjustPdfZoomOperation, IPdfsUIFeatureService, type IPrintPdfOperationParams, type IReportWidgetsConfig, type IResolvedPdfsUIFeatures, type IUniverPdfsUIConfig, type IUniverPdfsUIEditorConfig, type IUniverPdfsUIFeatures, InsertPdfPresetElementOperation, OpenPdfPreviewOperation, PDF_INSPECTOR_COMPONENT_KEY, PDF_INSPECTOR_SIDEBAR_ID, PdfCanvasView, PdfInspectorPanel, PdfInspectorPanel as PdfInspectorSidebar, PdfLeftSidebar, PdfPreviewModal, type PdfShapeKind, PdfStatusBar, PdfsUIController, PdfsUIFeatureService, PrintPdfOperation, SavePdfToHostOperation, SelectActivePdfPageOperation, SetPdfInkColorOperation, SetPdfInteractionModeOperation, SwitchPdfDisplayUnitOperation, TogglePdfCalibrationGridOperation, TogglePdfGridOperation, TogglePdfInspectorOperation, TogglePdfMarginsOperation, TogglePdfRulerOperation, TogglePdfSnapOperation, UNIVER_PDFS_UI_PLUGIN_NAME, UniverPdfsUIPlugin, UpdatePdfUIFeaturesOperation, UploadBasePdfOperation, clearPdfDocumentCache, computePdfDocumentCacheKey, configurePdfjsAssets, getPdfjsAssetsConfig, inspectSourcePdfPages, isPdfElementTypeAllowed, isPdfShapeTypeAllowed, openPdfInspectorSidebar, readBrowserFileAsOverlayOutcome, renderSourcePdfPageToCanvas, resolvePdfsUIFeatures };
274
+ export { AdjustPdfZoomOperation, type IPdfModalIoErrorState, type IPdfUnifiedIoSectionProps, IPdfsUIFeatureService, type IPrintPdfOperationParams, type IReportWidgetsConfig, type IResolvedPdfsUIFeatures, type IUniverPdfsUIConfig, type IUniverPdfsUIEditorConfig, type IUniverPdfsUIFeatures, type IUploadBasePdfOperationParams, InsertPdfPresetElementOperation, OpenPdfPreviewOperation, PDF_INSPECTOR_COMPONENT_KEY, PDF_INSPECTOR_SIDEBAR_ID, PdfCanvasView, PdfInspectorPanel, PdfInspectorPanel as PdfInspectorSidebar, PdfLeftSidebar, type PdfModalTabMode, PdfPreviewModal, type PdfShapeKind, PdfStatusBar, PdfUnifiedIoSection, PdfsUIController, PdfsUIFeatureService, PrintPdfOperation, SavePdfToHostOperation, SelectActivePdfPageOperation, SetPdfInkColorOperation, SetPdfInteractionModeOperation, SwitchPdfDisplayUnitOperation, TogglePdfCalibrationGridOperation, TogglePdfGridOperation, TogglePdfInspectorOperation, TogglePdfMarginsOperation, TogglePdfRulerOperation, TogglePdfSnapOperation, UNIVER_PDFS_UI_PLUGIN_NAME, UniverPdfsUIPlugin, UpdatePdfUIFeaturesOperation, UploadBasePdfOperation, clearPdfDocumentCache, computePdfDocumentCacheKey, configurePdfjsAssets, getPdfjsAssetsConfig, inspectSourcePdfPages, isPdfElementTypeAllowed, isPdfShapeTypeAllowed, openPdfInspectorSidebar, readBrowserFileAsOverlayOutcome, renderSourcePdfPageToCanvas, resolveInitialModalIoTarget, resolvePdfsUIFeatures };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yudaocode/univer-pdfs-ui",
3
- "version": "1.6.210",
3
+ "version": "1.6.211",
4
4
  "description": "Univer PDFs UI plugin with native Univer Ribbon, Left Thumbnail Sidebar, Canvas Designer, and Inspector Sidebar",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/yudaocode/yudao-univer#readme",
@@ -61,7 +61,7 @@
61
61
  "react": ">=18.0.0",
62
62
  "react-dom": ">=18.0.0",
63
63
  "rxjs": ">=7.0.0",
64
- "@yudaocode/univer-pdfs": "^1.6.210"
64
+ "@yudaocode/univer-pdfs": "^1.6.211"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@univerjs/core": "1.6.2",
@@ -72,7 +72,7 @@
72
72
  "react": "^18.3.1",
73
73
  "react-dom": "^18.3.1",
74
74
  "rxjs": "^7.8.1",
75
- "@yudaocode/univer-pdfs": "1.6.210"
75
+ "@yudaocode/univer-pdfs": "1.6.211"
76
76
  },
77
77
  "scripts": {
78
78
  "build": "tsup",