@yudaocode/univer-docs-ui 1.6.217 → 1.6.219

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
@@ -344,3 +344,234 @@
344
344
  border-color: #2c53f1;
345
345
  background: #ffffff;
346
346
  }
347
+
348
+ /* Slash `/` Quick-Insert Trigger & Floating Palette */
349
+ .yudao-doc-slash-trigger-btn {
350
+ position: fixed;
351
+ right: 24px;
352
+ top: 96px;
353
+ z-index: 9985;
354
+ border: 1px solid #d2dafa;
355
+ background: #ffffff;
356
+ color: #2c53f1;
357
+ border-radius: 999px;
358
+ padding: 5px 12px;
359
+ font-size: 11.5px;
360
+ font-weight: 600;
361
+ cursor: pointer;
362
+ box-shadow: 0 4px 12px rgba(44, 83, 241, 0.12);
363
+ transition: all 0.14s ease;
364
+ }
365
+
366
+ .yudao-doc-slash-trigger-btn:hover {
367
+ background: #f3f5ff;
368
+ border-color: #2c53f1;
369
+ }
370
+
371
+ .yudao-doc-slash-menu {
372
+ position: fixed;
373
+ z-index: 9993;
374
+ width: 304px;
375
+ max-height: 360px;
376
+ background: #ffffff;
377
+ border: 1px solid #e3e5ea;
378
+ border-radius: 10px;
379
+ box-shadow: 0 12px 32px rgba(27, 28, 31, 0.16);
380
+ display: flex;
381
+ flex-direction: column;
382
+ overflow: hidden;
383
+ font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
384
+ }
385
+
386
+ .yudao-doc-slash-search-wrap {
387
+ display: flex;
388
+ align-items: center;
389
+ gap: 6px;
390
+ padding: 8px 10px;
391
+ border-bottom: 1px solid #eeeff1;
392
+ background: #f9fafb;
393
+ }
394
+
395
+ .yudao-doc-slash-prefix {
396
+ font-size: 13px;
397
+ font-weight: 700;
398
+ color: #2c53f1;
399
+ padding: 0 2px;
400
+ }
401
+
402
+ .yudao-doc-slash-search {
403
+ flex: 1;
404
+ border: none;
405
+ background: transparent;
406
+ outline: none;
407
+ font-size: 12px;
408
+ color: #1b1c1f;
409
+ }
410
+
411
+ .yudao-doc-slash-list {
412
+ flex: 1;
413
+ overflow-y: auto;
414
+ padding: 4px;
415
+ display: flex;
416
+ flex-direction: column;
417
+ gap: 2px;
418
+ }
419
+
420
+ .yudao-doc-slash-item {
421
+ display: flex;
422
+ align-items: center;
423
+ gap: 8px;
424
+ width: 100%;
425
+ border: none;
426
+ background: transparent;
427
+ padding: 6px 8px;
428
+ border-radius: 6px;
429
+ cursor: pointer;
430
+ text-align: left;
431
+ transition: background 0.12s ease;
432
+ }
433
+
434
+ .yudao-doc-slash-item:hover,
435
+ .yudao-doc-slash-item.is-active {
436
+ background: #f3f5ff;
437
+ }
438
+
439
+ .yudao-doc-slash-badge {
440
+ min-width: 30px;
441
+ height: 22px;
442
+ border-radius: 5px;
443
+ background: #eff2f8;
444
+ color: #2c53f1;
445
+ font-size: 10.5px;
446
+ font-weight: 700;
447
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
448
+ display: inline-flex;
449
+ align-items: center;
450
+ justify-content: center;
451
+ flex-shrink: 0;
452
+ }
453
+
454
+ .yudao-doc-slash-meta {
455
+ display: flex;
456
+ flex-direction: column;
457
+ min-width: 0;
458
+ }
459
+
460
+ .yudao-doc-slash-label {
461
+ font-size: 12px;
462
+ font-weight: 600;
463
+ color: #1b1c1f;
464
+ }
465
+
466
+ .yudao-doc-slash-desc {
467
+ font-size: 10.5px;
468
+ color: #6b7280;
469
+ white-space: nowrap;
470
+ overflow: hidden;
471
+ text-overflow: ellipsis;
472
+ }
473
+
474
+ /* Live Rich Block Companion Dock */
475
+ .yudao-doc-companion-dock {
476
+ position: fixed;
477
+ right: 24px;
478
+ top: 134px;
479
+ z-index: 9980;
480
+ width: 316px;
481
+ max-height: calc(100vh - 240px);
482
+ background: rgba(255, 255, 255, 0.98);
483
+ border: 1px solid #e3e5ea;
484
+ border-radius: 10px;
485
+ box-shadow: 0 10px 28px rgba(27, 28, 31, 0.12);
486
+ display: flex;
487
+ flex-direction: column;
488
+ overflow: hidden;
489
+ font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
490
+ }
491
+
492
+ .yudao-doc-companion-header {
493
+ padding: 8px 10px;
494
+ background: #f9fafb;
495
+ border-bottom: 1px solid #eeeff1;
496
+ display: flex;
497
+ align-items: center;
498
+ justify-content: space-between;
499
+ }
500
+
501
+ .yudao-doc-companion-body {
502
+ flex: 1;
503
+ overflow-y: auto;
504
+ padding: 8px 10px;
505
+ display: flex;
506
+ flex-direction: column;
507
+ gap: 8px;
508
+ }
509
+
510
+ /* Collapsible Page-Bottom Footnotes & Endnotes Strip */
511
+ .yudao-doc-footnote-strip {
512
+ position: fixed;
513
+ left: 236px;
514
+ right: 24px;
515
+ bottom: 8px;
516
+ z-index: 9978;
517
+ max-height: 170px;
518
+ background: rgba(255, 255, 255, 0.97);
519
+ border: 1px solid #e3e5ea;
520
+ border-radius: 8px;
521
+ box-shadow: 0 -4px 16px rgba(27, 28, 31, 0.08);
522
+ display: flex;
523
+ flex-direction: column;
524
+ overflow: hidden;
525
+ font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
526
+ }
527
+
528
+ .yudao-doc-footnote-header {
529
+ padding: 5px 10px;
530
+ background: #f8fafc;
531
+ border-bottom: 1px solid #edf2f7;
532
+ display: flex;
533
+ align-items: center;
534
+ justify-content: space-between;
535
+ }
536
+
537
+ .yudao-doc-footnote-items {
538
+ overflow-y: auto;
539
+ padding: 6px 10px;
540
+ display: flex;
541
+ flex-direction: column;
542
+ gap: 5px;
543
+ }
544
+
545
+ .yudao-doc-footnote-item {
546
+ display: flex;
547
+ align-items: center;
548
+ gap: 6px;
549
+ }
550
+
551
+ /* Left-Margin Page Line-Number Ruler Strip (`<w:lnNumType>`) */
552
+ .yudao-doc-linenum-ruler {
553
+ position: fixed;
554
+ left: 244px;
555
+ top: 112px;
556
+ bottom: 64px;
557
+ width: 34px;
558
+ z-index: 9970;
559
+ pointer-events: none;
560
+ display: flex;
561
+ flex-direction: column;
562
+ gap: 4px;
563
+ padding: 8px 6px 8px 2px;
564
+ border-right: 1px dashed rgba(148, 163, 184, 0.45);
565
+ background: linear-gradient(90deg, rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0));
566
+ overflow: hidden;
567
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
568
+ }
569
+
570
+ .yudao-doc-linenum-tick {
571
+ height: 18px;
572
+ line-height: 18px;
573
+ text-align: right;
574
+ font-size: 10.5px;
575
+ color: #8492a6;
576
+ user-select: none;
577
+ }
@@ -93,6 +93,10 @@ interface IDocsUIFeatureService {
93
93
  readonly modalOpen$: Observable<boolean>;
94
94
  readonly modalTab$: Observable<DocModalTabMode>;
95
95
  readonly ioModal$: Observable<IDocIoModalConfig | undefined>;
96
+ readonly editingChartId$: Observable<string | null>;
97
+ readonly editingMiniSheetId$: Observable<string | null>;
98
+ readonly editingSmartArtId$: Observable<string | null>;
99
+ readonly slashMenuOpen$: Observable<boolean>;
96
100
  getFeatures(): IResolvedDocsUIFeatures;
97
101
  setFeatures(features: IUniverDocsUIFeatures): void;
98
102
  patchFeatures(patch: Partial<IResolvedDocsUIFeatures>): void;
@@ -103,6 +107,18 @@ interface IDocsUIFeatureService {
103
107
  openModal(tab?: DocModalTabMode | string, ioModal?: IDocIoModalConfig): void;
104
108
  closeModal(): void;
105
109
  setModalTab(tab: DocModalTabMode): void;
110
+ getEditingChartId(): string | null;
111
+ openChartEditor(chartId: string): void;
112
+ closeChartEditor(): void;
113
+ getEditingMiniSheetId(): string | null;
114
+ openMiniSheetEditor(sheetId: string): void;
115
+ closeMiniSheetEditor(): void;
116
+ getEditingSmartArtId(): string | null;
117
+ openSmartArtEditor(smartArtId: string): void;
118
+ closeSmartArtEditor(): void;
119
+ isSlashMenuOpen(): boolean;
120
+ openSlashMenu(): void;
121
+ closeSlashMenu(): void;
106
122
  }
107
123
  declare const IDocsUIFeatureService: _univerjs_core.IdentifierDecorator<IDocsUIFeatureService>;
108
124
  declare class DocsUIFeatureService extends Disposable implements IDocsUIFeatureService {
@@ -110,11 +126,19 @@ declare class DocsUIFeatureService extends Disposable implements IDocsUIFeatureS
110
126
  private readonly _modalOpen$;
111
127
  private readonly _modalTab$;
112
128
  private readonly _ioModal$;
129
+ private readonly _editingChartId$;
130
+ private readonly _editingMiniSheetId$;
131
+ private readonly _editingSmartArtId$;
132
+ private readonly _slashMenuOpen$;
113
133
  private _baseIoModal?;
114
134
  readonly features$: Observable<IResolvedDocsUIFeatures>;
115
135
  readonly modalOpen$: Observable<boolean>;
116
136
  readonly modalTab$: Observable<DocModalTabMode>;
117
137
  readonly ioModal$: Observable<IDocIoModalConfig | undefined>;
138
+ readonly editingChartId$: Observable<string | null>;
139
+ readonly editingMiniSheetId$: Observable<string | null>;
140
+ readonly editingSmartArtId$: Observable<string | null>;
141
+ readonly slashMenuOpen$: Observable<boolean>;
118
142
  constructor(initial?: IUniverDocsUIFeatures, initialIoModal?: IDocIoModalConfig);
119
143
  private _mergeIoModal;
120
144
  private _resolveValidTab;
@@ -128,6 +152,18 @@ declare class DocsUIFeatureService extends Disposable implements IDocsUIFeatureS
128
152
  openModal(tab?: DocModalTabMode | string, ioModal?: IDocIoModalConfig): void;
129
153
  closeModal(): void;
130
154
  setModalTab(tab: DocModalTabMode): void;
155
+ getEditingChartId(): string | null;
156
+ openChartEditor(chartId: string): void;
157
+ closeChartEditor(): void;
158
+ getEditingMiniSheetId(): string | null;
159
+ openMiniSheetEditor(sheetId: string): void;
160
+ closeMiniSheetEditor(): void;
161
+ getEditingSmartArtId(): string | null;
162
+ openSmartArtEditor(smartArtId: string): void;
163
+ closeSmartArtEditor(): void;
164
+ isSlashMenuOpen(): boolean;
165
+ openSlashMenu(): void;
166
+ closeSlashMenu(): void;
131
167
  }
132
168
 
133
169
  interface IUniverDocsExtUIConfig {
@@ -258,4 +294,31 @@ declare const DocPreviewAndIoModal: React.FC;
258
294
 
259
295
  declare const DocSdtCanvasPopupHost: React.FC;
260
296
 
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 };
297
+ declare const DocCanvasEnhancementsHost: React.FC;
298
+
299
+ declare const DocChartEditorModal: React.FC;
300
+
301
+ declare const DocMiniSheetModal: React.FC;
302
+
303
+ declare const DocSmartArtEditorModal: React.FC;
304
+
305
+ interface ISlashCommandItem {
306
+ id: string;
307
+ badge: string;
308
+ label: string;
309
+ desc: string;
310
+ keywords: string;
311
+ action: () => void;
312
+ }
313
+ interface IDocSlashMenuProps {
314
+ open: boolean;
315
+ anchorPos?: {
316
+ x: number;
317
+ y: number;
318
+ } | null;
319
+ stripLeadingSlashOnExecute?: boolean;
320
+ onClose: () => void;
321
+ }
322
+ declare const DocSlashMenu: React.FC<IDocSlashMenuProps>;
323
+
324
+ export { DOC_IMPORT_ACCEPT_EXTENSIONS, DOC_INSPECTOR_COMPONENT_KEY, DOC_INSPECTOR_SIDEBAR_ID, DocCanvasEnhancementsHost, DocChartEditorModal, DocInspectorPanel, type DocIoModalTabKey, DocLeftSidebar, DocMiniSheetModal, type DocModalTabMode, DocPreviewAndIoModal, DocSdtCanvasPopupHost, DocSlashMenu, DocSmartArtEditorModal, DocsExtUIController, DocsUIFeatureService, FillDocSampleDatasetOperation, type IDocIoModalConfig, type IDocSlashMenuProps, IDocsUIFeatureService, type IIoErrorState, type IOpenDocModalOperationParams, type IPendingImportState, type IResolvedDocsUIFeatures, type ISlashCommandItem, 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.217",
3
+ "version": "1.6.219",
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.217"
65
+ "@yudaocode/univer-docs": "^1.6.219"
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.217"
78
+ "@yudaocode/univer-docs": "1.6.219"
79
79
  },
80
80
  "scripts": {
81
81
  "build": "tsup",