@univerjs/docs-ui 1.0.3 → 1.1.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.
Files changed (109) hide show
  1. package/lib/cjs/index.js +1600 -475
  2. package/lib/cjs/locale/ar-SA.js +14 -0
  3. package/lib/cjs/locale/ca-ES.js +14 -0
  4. package/lib/cjs/locale/de-DE.js +14 -0
  5. package/lib/cjs/locale/en-US.js +14 -0
  6. package/lib/cjs/locale/es-ES.js +14 -0
  7. package/lib/cjs/locale/fa-IR.js +14 -0
  8. package/lib/cjs/locale/fr-FR.js +14 -0
  9. package/lib/cjs/locale/id-ID.js +14 -0
  10. package/lib/cjs/locale/it-IT.js +14 -0
  11. package/lib/cjs/locale/ja-JP.js +14 -0
  12. package/lib/cjs/locale/ko-KR.js +14 -0
  13. package/lib/cjs/locale/pl-PL.js +14 -0
  14. package/lib/cjs/locale/pt-BR.js +14 -0
  15. package/lib/cjs/locale/ru-RU.js +14 -0
  16. package/lib/cjs/locale/sk-SK.js +14 -0
  17. package/lib/cjs/locale/vi-VN.js +14 -0
  18. package/lib/cjs/locale/zh-CN.js +14 -0
  19. package/lib/cjs/locale/zh-HK.js +14 -0
  20. package/lib/cjs/locale/zh-TW.js +14 -0
  21. package/lib/es/index.js +1585 -466
  22. package/lib/es/locale/ar-SA.js +14 -0
  23. package/lib/es/locale/ca-ES.js +14 -0
  24. package/lib/es/locale/de-DE.js +14 -0
  25. package/lib/es/locale/en-US.js +14 -0
  26. package/lib/es/locale/es-ES.js +14 -0
  27. package/lib/es/locale/fa-IR.js +14 -0
  28. package/lib/es/locale/fr-FR.js +14 -0
  29. package/lib/es/locale/id-ID.js +14 -0
  30. package/lib/es/locale/it-IT.js +14 -0
  31. package/lib/es/locale/ja-JP.js +14 -0
  32. package/lib/es/locale/ko-KR.js +14 -0
  33. package/lib/es/locale/pl-PL.js +14 -0
  34. package/lib/es/locale/pt-BR.js +14 -0
  35. package/lib/es/locale/ru-RU.js +14 -0
  36. package/lib/es/locale/sk-SK.js +14 -0
  37. package/lib/es/locale/vi-VN.js +14 -0
  38. package/lib/es/locale/zh-CN.js +14 -0
  39. package/lib/es/locale/zh-HK.js +14 -0
  40. package/lib/es/locale/zh-TW.js +14 -0
  41. package/lib/index.css +26 -4
  42. package/lib/index.js +1585 -466
  43. package/lib/locale/ar-SA.js +14 -0
  44. package/lib/locale/ca-ES.js +14 -0
  45. package/lib/locale/de-DE.js +14 -0
  46. package/lib/locale/en-US.js +14 -0
  47. package/lib/locale/es-ES.js +14 -0
  48. package/lib/locale/fa-IR.js +14 -0
  49. package/lib/locale/fr-FR.js +14 -0
  50. package/lib/locale/id-ID.js +14 -0
  51. package/lib/locale/it-IT.js +14 -0
  52. package/lib/locale/ja-JP.js +14 -0
  53. package/lib/locale/ko-KR.js +14 -0
  54. package/lib/locale/pl-PL.js +14 -0
  55. package/lib/locale/pt-BR.js +14 -0
  56. package/lib/locale/ru-RU.js +14 -0
  57. package/lib/locale/sk-SK.js +14 -0
  58. package/lib/locale/vi-VN.js +14 -0
  59. package/lib/locale/zh-CN.js +14 -0
  60. package/lib/locale/zh-HK.js +14 -0
  61. package/lib/locale/zh-TW.js +14 -0
  62. package/lib/types/commands/commands/doc-delete.command.d.ts +5 -2
  63. package/lib/types/commands/commands/doc-header-footer.command.d.ts +2 -0
  64. package/lib/types/commands/commands/insert-header-footer-field.command.d.ts +28 -0
  65. package/lib/types/commands/commands/refresh-header-footer-fields.command.d.ts +22 -0
  66. package/lib/types/commands/operations/doc-header-footer-ribbon.operation.d.ts +19 -0
  67. package/lib/types/controllers/doc-header-footer-ribbon.controller.d.ts +31 -0
  68. package/lib/types/controllers/render-controllers/doc-field.render-controller.d.ts +31 -0
  69. package/lib/types/controllers/ui.controller.d.ts +1 -0
  70. package/lib/types/index.d.ts +1 -0
  71. package/lib/types/locale/en-US.d.ts +14 -0
  72. package/lib/types/menu/display.menu.d.ts +21 -0
  73. package/lib/types/menu/header-footer-ribbon.d.ts +17 -0
  74. package/lib/types/services/clipboard/clipboard.service.d.ts +4 -0
  75. package/lib/types/services/doc-event-manager.service.d.ts +1 -0
  76. package/lib/types/services/doc-paragraph-menu.service.d.ts +11 -2
  77. package/lib/types/services/doc-zoom.d.ts +4 -1
  78. package/lib/types/services/selection/doc-selection-render.service.d.ts +2 -0
  79. package/lib/types/services/selection/word-boundary.d.ts +1 -0
  80. package/lib/types/shortcuts/core-editing.shortcut.d.ts +4 -0
  81. package/lib/types/shortcuts/format.shortcut.d.ts +1 -0
  82. package/lib/types/shortcuts/utils.d.ts +1 -0
  83. package/lib/types/utils/date-time-field.d.ts +22 -0
  84. package/lib/types/views/header-footer/panel/DocHeaderFooterFields.d.ts +19 -0
  85. package/lib/types/views/header-footer/panel/DocHeaderFooterRibbonControl.d.ts +20 -0
  86. package/lib/types/views/header-footer/panel/component-name.d.ts +2 -0
  87. package/lib/types/views/header-footer/panel/use-header-footer-options.d.ts +2 -2
  88. package/lib/umd/facade.js +1 -1
  89. package/lib/umd/index.js +16 -15
  90. package/lib/umd/locale/ar-SA.js +1 -1
  91. package/lib/umd/locale/ca-ES.js +1 -1
  92. package/lib/umd/locale/de-DE.js +1 -1
  93. package/lib/umd/locale/en-US.js +1 -1
  94. package/lib/umd/locale/es-ES.js +1 -1
  95. package/lib/umd/locale/fa-IR.js +1 -1
  96. package/lib/umd/locale/fr-FR.js +1 -1
  97. package/lib/umd/locale/id-ID.js +1 -1
  98. package/lib/umd/locale/it-IT.js +1 -1
  99. package/lib/umd/locale/ja-JP.js +1 -1
  100. package/lib/umd/locale/ko-KR.js +1 -1
  101. package/lib/umd/locale/pl-PL.js +1 -1
  102. package/lib/umd/locale/pt-BR.js +1 -1
  103. package/lib/umd/locale/ru-RU.js +1 -1
  104. package/lib/umd/locale/sk-SK.js +1 -1
  105. package/lib/umd/locale/vi-VN.js +1 -1
  106. package/lib/umd/locale/zh-CN.js +1 -1
  107. package/lib/umd/locale/zh-HK.js +1 -1
  108. package/lib/umd/locale/zh-TW.js +1 -1
  109. package/package.json +13 -13
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { DocumentDataModel } from '@univerjs/core';
17
+ import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
+ import { Disposable, IUniverInstanceService } from '@univerjs/core';
19
+ import { DocSkeletonManagerService } from '@univerjs/docs';
20
+ import { IRenderManagerService } from '@univerjs/engine-render';
21
+ import { IRibbonService } from '@univerjs/ui';
22
+ export declare class DocHeaderFooterRibbonController extends Disposable implements IRenderModule {
23
+ private readonly _context;
24
+ private readonly _instanceService;
25
+ private readonly _ribbonService;
26
+ private readonly _renderManager;
27
+ private _visible;
28
+ constructor(_context: IRenderContext<DocumentDataModel>, skeletonManager: DocSkeletonManagerService, _instanceService: IUniverInstanceService, _ribbonService: IRibbonService, _renderManager: IRenderManagerService);
29
+ private _focusedDocumentEditsHeaderFooter;
30
+ dispose(): void;
31
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { DocumentDataModel } from '@univerjs/core';
17
+ import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
+ import { Disposable, IUniverInstanceService, ThemeService } from '@univerjs/core';
19
+ import { DocSelectionManagerService } from '@univerjs/docs';
20
+ import { DocEventManagerService } from '../../services/doc-event-manager.service';
21
+ export declare class DocFieldRenderController extends Disposable implements IRenderModule {
22
+ private readonly _context;
23
+ private readonly _events;
24
+ private readonly _selections;
25
+ private readonly _instances;
26
+ private _hovered;
27
+ private _shade;
28
+ constructor(_context: IRenderContext<DocumentDataModel>, _events: DocEventManagerService, _selections: DocSelectionManagerService, theme: ThemeService, _instances: IUniverInstanceService);
29
+ private _drawFields;
30
+ private _getActiveFields;
31
+ }
@@ -32,6 +32,7 @@ export declare class DocUIController extends Disposable {
32
32
  private _initShortCut;
33
33
  private _init;
34
34
  private _initCommands;
35
+ private _initDateTimeFields;
35
36
  private _initFocusHandler;
36
37
  private _shouldPreserveEmbedFocus;
37
38
  }
@@ -81,6 +81,7 @@ export { scrollDocsTableLikeCustomBlockLive } from './embed-docs-custom-block-sc
81
81
  export type { IDocsTableLikeCustomBlockScrollOptions } from './embed-docs-custom-block-scroll';
82
82
  export { resolveDocsCustomBlockRenderViewport } from './embed-host-anchor';
83
83
  export type { IDocsCustomBlockLayoutViewport, IDocsCustomBlockRenderViewportParams } from './embed-host-anchor';
84
+ export { ParagraphSettingMenuFactory } from './menu/context-menu';
84
85
  export { AlignMenuItemFactory, BackgroundColorSelectorMenuItemFactory, BoldMenuItemFactory, disableMenuWhenHeaderFooterEditing, disableMenuWithoutDocumentUnitPermission, FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, FloatTextStyleMenuItemFactory, FontFamilySelectorMenuItemFactory, FontSizeSelectorMenuItemFactory, hideMenuWhenSelectionInBlockRange, isTextRangeInAnyBlockRange, ItalicMenuItemFactory, StrikeThroughMenuItemFactory, TextColorSelectorMenuItemFactory, UnderlineMenuItemFactory, } from './menu/menu';
85
86
  export { DOC_CONTENT_INSERT_MENU_ID, DOC_PARAGRAPH_T_ALIGN_MENU_ID, DOC_PARAGRAPH_T_COLORS_MENU_ID, DOC_PARAGRAPH_T_DIVIDER_MENU_ID, DOC_PARAGRAPH_T_EDIT_MENU_ID, DOC_PARAGRAPH_T_INSERT_BELOW_MENU_ID, DOC_PARAGRAPH_T_INSERT_MENU_ID, DOC_TABLE_BLOCK_MENU_ID, EMPTY_PARAGRAPH_MENU_ID, getDocBlockRangeMenuId, INSERT_BELLOW_MENU_ID, ParagraphMenuInsertBelowSubmenuItemFactory, } from './menu/paragraph-menu';
86
87
  export { menuSchema as DocsUIMenuSchema } from './menu/schema';
@@ -53,6 +53,8 @@ declare const locale: {
53
53
  recovering: string;
54
54
  };
55
55
  toolbar: {
56
+ zoom: string;
57
+ fullscreen: string;
56
58
  font: string;
57
59
  fontSize: string;
58
60
  bold: string;
@@ -115,6 +117,18 @@ declare const locale: {
115
117
  deleteTable: string;
116
118
  };
117
119
  headerFooter: {
120
+ navigation: string;
121
+ options: string;
122
+ position: string;
123
+ refreshFields: string;
124
+ pageNumber: string;
125
+ currentPage: string;
126
+ totalPages: string;
127
+ dateTime: string;
128
+ updateAutomatically: string;
129
+ insertFailed: string;
130
+ goToHeader: string;
131
+ goToFooter: string;
118
132
  header: string;
119
133
  footer: string;
120
134
  panel: string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { IAccessor } from '@univerjs/core';
17
+ import type { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
18
+ import type { LocaleKey } from '../locale/types';
19
+ export declare const DOC_ZOOM_RATIO_MENU_ID = "doc.menu.zoom-ratio";
20
+ export declare function DocZoomRatioMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, number>;
21
+ export declare function DocFullscreenMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { MenuSchemaType } from '@univerjs/ui';
17
+ export declare const headerFooterRibbonSchema: MenuSchemaType;
@@ -39,6 +39,8 @@ export interface IDocClipboardPasteContext {
39
39
  targetUnitId: string;
40
40
  }
41
41
  export interface IDocClipboardHook {
42
+ /** Opt an internal rich-text editor into the post-paste format menu. */
43
+ supportsPasteOptions?(unitId: string): boolean;
42
44
  /** Supply a rich fragment for selections owned by a plugin rather than native text ranges. */
43
45
  onCopySelection?(unitId: string): {
44
46
  documentData: IDocumentData;
@@ -73,6 +75,7 @@ export interface IDocClipboardService {
73
75
  pasteFromClipboard(mode?: DocPasteMode): Promise<boolean>;
74
76
  legacyPaste(options: IDocClipboardPayload): Promise<boolean>;
75
77
  readonly pasteOptions$: Observable<IDocPasteOptionsState | null>;
78
+ isPasteOptionsEnabled(unitId: string): boolean;
76
79
  setNextPasteMode(mode: DocPasteMode): void;
77
80
  dismissPasteOptions(): void;
78
81
  changePasteMode(mode: DocPasteMode): Promise<boolean>;
@@ -107,6 +110,7 @@ export declare class DocClipboardService extends Disposable implements IDocClipb
107
110
  cut(ranges?: ITextRangeWithStyle[]): Promise<boolean>;
108
111
  pasteFromClipboard(mode?: DocPasteMode): Promise<boolean>;
109
112
  paste(items?: ClipboardItem[], mode?: DocPasteMode): Promise<boolean>;
113
+ isPasteOptionsEnabled(unitId: string): boolean;
110
114
  setNextPasteMode(mode: DocPasteMode): void;
111
115
  legacyPaste(options: IDocClipboardPayload): Promise<boolean>;
112
116
  dismissPasteOptions(): void;
@@ -169,6 +169,7 @@ export declare class DocEventManagerService extends Disposable implements IRende
169
169
  isPointerOnInteractiveRange(offsetX: number, offsetY: number): boolean;
170
170
  isPointerOnNonChecklistBullet(offsetX: number, offsetY: number): boolean;
171
171
  getBulletBounds(): IBulletBound[];
172
+ getCustomRangeBounds(): ICustomRangeBound[];
172
173
  getListContextMenuBulletByOffset(offsetX: number, offsetY: number): Nullable<IBulletBound>;
173
174
  private _buildCustomRangeBoundsBySegment;
174
175
  private _buildCustomRangeBounds;
@@ -75,6 +75,11 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
75
75
  private _paragraphMenu;
76
76
  private readonly _activeTarget$;
77
77
  readonly activeTarget$: import("rxjs").Observable<IDocBlockMenuTarget | null>;
78
+ private _focusedTableMenu;
79
+ private readonly _focusedTableTarget$;
80
+ readonly focusedTableTarget$: import("rxjs").Observable<IDocBlockMenuTarget | null>;
81
+ private readonly _focusedTableMenuDismiss$;
82
+ readonly focusedTableMenuDismiss$: import("rxjs").Observable<void>;
78
83
  private readonly _slashMenuRequest$;
79
84
  readonly slashMenuRequest$: import("rxjs").Observable<IDocSlashMenuRequest | null>;
80
85
  private _isBlockMenuDragging;
@@ -84,6 +89,7 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
84
89
  private _dragInteraction;
85
90
  get activeParagraph(): IMutiPageParagraphBound | undefined;
86
91
  get activeTarget(): IDocBlockMenuTarget | null;
92
+ get focusedTableTarget(): IDocBlockMenuTarget | null;
87
93
  setBlockMenuDragging(isDragging: boolean): void;
88
94
  get isBlockMenuDragging(): boolean;
89
95
  constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docEventManagerService: DocEventManagerService, _docPopupManagerService: DocCanvasPopManagerService, _docSkeletonManagerService: DocSkeletonManagerService, _floatMenuService: DocFloatMenuService, _docSelectionRenderService: DocSelectionRenderService, _permissionService: IPermissionService, _docLayoutInteractionService: DocLayoutInteractionService, _contextService: IContextService);
@@ -92,7 +98,7 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
92
98
  private _hasExpandedSelectionRanges;
93
99
  private _hasExpandedTextSelection;
94
100
  private _hasExpandedSelection;
95
- setParagraphMenuActive(active: boolean): void;
101
+ setParagraphMenuActive(active: boolean, focusedTable?: boolean): void;
96
102
  private _init;
97
103
  private _handleSlashMenuKeydown;
98
104
  private _handleSlashMenuInputBefore;
@@ -103,13 +109,16 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
103
109
  private _getSlashMenuParagraph;
104
110
  private _getSlashMenuAnchorRect;
105
111
  showParagraphMenu(paragraph: IMutiPageParagraphBound): void;
106
- showTableMenu(tableBound: ITableBound): void;
112
+ showTableMenu(tableBound: ITableBound, focused?: boolean): void;
113
+ private _showHoverTableMenu;
114
+ private _showFocusedTableMenu;
107
115
  private _shouldKeepCurrentCellMenuForTable;
108
116
  getDropTargetFromClientPoint(clientX: number, clientY: number, sourceRange: {
109
117
  startOffset: number;
110
118
  endOffset: number;
111
119
  }): IDocBlockDropTarget | null;
112
120
  hideParagraphMenu(force?: boolean): void;
121
+ hideFocusedTableMenu(): void;
113
122
  private _canEditDocument;
114
123
  dispose(): void;
115
124
  private _buildParagraphMenuTarget;
@@ -13,8 +13,11 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { DocumentDataModel } from '@univerjs/core';
16
+ import type { DocumentDataModel, ICommandService, IUniverInstanceService } from '@univerjs/core';
17
+ import { Observable } from 'rxjs';
17
18
  export declare const DEFAULT_MODERN_DOC_ZOOM_RATIO = 1;
19
+ export declare const DOC_ZOOM_SHORTCUTS: number[];
18
20
  type DocZoomSource = Pick<DocumentDataModel, 'getSettings' | 'getSnapshot'>;
19
21
  export declare function getDocEffectiveZoomRatio(documentModel: DocZoomSource): number;
22
+ export declare function getDocZoomRatio$(commandService: ICommandService, instanceService: IUniverInstanceService): Observable<number>;
20
23
  export {};
@@ -92,6 +92,8 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
92
92
  get hasPendingSelection(): boolean;
93
93
  get isOnPointerEvent(): boolean;
94
94
  get isFocusing(): boolean;
95
+ get inputElement(): HTMLDivElement;
96
+ get selectionContainer(): HTMLDivElement;
95
97
  get isEditing(): boolean;
96
98
  get canFocusing(): boolean;
97
99
  cancelPointerSelection(): void;
@@ -19,4 +19,5 @@ export interface IWordBoundary {
19
19
  endOffset: number;
20
20
  }
21
21
  export declare function getWordBoundaryByIndex(content: string, nodeIndex: number, paragraphStartOffset: number): IWordBoundary | null;
22
+ export declare function getWordSelectionByIndex(content: string, nodeIndex: number, paragraphStartOffset: number, isBack: boolean): IWordBoundary | null;
22
23
  export declare function getNextWordBoundaryOffset(content: string, nodeIndex: number, paragraphStartOffset: number, direction: Direction): number | null;
@@ -19,3 +19,7 @@ export declare const SoftBreakLineShortcut: IShortcutItem;
19
19
  export declare const DeleteLeftShortcut: IShortcutItem;
20
20
  export declare const DeleteRightShortcut: IShortcutItem;
21
21
  export declare const CloseHeaderFooterShortcut: IShortcutItem;
22
+ export declare const DeleteWordLeftShortcut: IShortcutItem;
23
+ export declare const DeleteWordRightShortcut: IShortcutItem;
24
+ export declare const DeleteLineStartShortcut: IShortcutItem;
25
+ export declare const DeleteLineEndShortcut: IShortcutItem;
@@ -15,4 +15,5 @@
15
15
  */
16
16
  import type { IShortcutItem } from '@univerjs/ui';
17
17
  export declare const TabShortCut: IShortcutItem;
18
+ export declare const UpdateDocFieldsShortcut: IShortcutItem;
18
19
  export declare const ShiftTabShortCut: IShortcutItem;
@@ -14,5 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IContextService } from '@univerjs/core';
17
+ export declare function whenTextEditorFocused(contextService: IContextService): boolean;
17
18
  export declare function whenDocAndEditorFocused(contextService: IContextService): boolean;
18
19
  export declare function whenDocAndEditorFocusedWithBreakLine(contextService: IContextService): boolean;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export type DateTimeFieldFormat = 'short' | 'long' | 'time';
17
+ export declare function createDateTimeField(format: DateTimeFieldFormat, locale: string, date: Date): {
18
+ fieldType: string;
19
+ instruction: string;
20
+ cachedResult: string;
21
+ };
22
+ export declare function resolveDateTimeField(instruction: string, locale: string, date: Date): string | undefined;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare function DocHeaderFooterFields({ unitId, disabled }: {
17
+ unitId: string;
18
+ disabled: boolean;
19
+ }): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ interface IHeaderFooterRibbonControlProps {
17
+ kind: 'insertion' | 'navigation' | 'options' | 'position';
18
+ }
19
+ export declare function DocHeaderFooterRibbonControl(props: IHeaderFooterRibbonControlProps): import("react").JSX.Element | null;
20
+ export {};
@@ -14,3 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export declare const COMPONENT_DOC_HEADER_FOOTER_PANEL = "COMPONENT_DOC_HEADER_FOOTER_PANEL";
17
+ export declare const DOC_HEADER_FOOTER_RIBBON_TAB = "docs-ui.ribbon.header-footer";
18
+ export declare const DOC_HEADER_FOOTER_RIBBON_CONTROL = "DocHeaderFooterRibbonControl";
@@ -19,7 +19,7 @@ export declare function useHeaderFooterOptions(unitId: string): {
19
19
  linkedToPrevious: boolean;
20
20
  options: IHeaderFooterProps;
21
21
  handleLinkToPreviousChange: (linked: boolean) => Promise<void>;
22
- handleCheckboxChange: (val: boolean, type: "useFirstPageHeaderFooter" | "evenAndOddHeaders") => void;
22
+ handleCheckboxChange: (val: boolean, type: "useFirstPageHeaderFooter" | "evenAndOddHeaders") => Promise<void>;
23
23
  handleMarginChange: (val: number, type: "marginHeader" | "marginFooter") => Promise<void>;
24
- closeHeaderFooter: () => void;
24
+ closeHeaderFooter: () => Promise<boolean>;
25
25
  };
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/docs/facade"),require("@univerjs/engine-render")):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/docs`,`@univerjs/docs-ui`,`@univerjs/docs/facade`,`@univerjs/engine-render`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverDocs,e.UniverDocsUi,e.UniverDocsFacade,e.UniverEngineRender))})(this,function(e,t,n,r,i){var a=class extends r.FDocument{setSelection(r,a){var o,s,c;let l=this._injector.get(i.IRenderManagerService).getRenderUnitById(this.getId());if(l==null)return;let u=l.with(n.DocSelectionRenderService),d=l.with(t.DocSkeletonManagerService).getSkeleton(),f=d.findBodyPageIndexByCharIndex(r),p=(o=d.getSkeletonData())==null?void 0:o.pages[f],m=((s=this.getDocumentDataModel().getBody())==null?void 0:s.dataStream.length)??0,h=f<0&&r>=0&&r<m,g=u.getSegment(),_=(c=l.getInjector)==null?void 0:c.call(l),v=_!=null&&_.has(n.DocBackScrollRenderController)?l.with(n.DocBackScrollRenderController):null,y={startOffset:r,endOffset:a,collapsed:r===a},b=()=>{u.removeAllRanges(),u.addDocRanges([{startOffset:r,endOffset:a,rangeType:e.DOC_RANGE_TYPE.TEXT}],!0)};if(g===``&&v!=null&&(h||p!=null&&p.isMaterializationPlaceholder||!v.isViewportReady())){var x;let e=(x=this.getDocumentDataModel().getBody())==null?void 0:x.dataStream;v.scrollToRange(y,()=>{var t;u.getSegment()===g&&((t=this.getDocumentDataModel().getBody())==null?void 0:t.dataStream)===e&&b()}),u.removeAllRanges(),u.addDocRanges([],!0,{shouldFocus:!1}),u.blur();return}b(),g===``&&v!=null&&v.scrollToRange(y)}};r.FDocument.extend(a)});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/docs/facade"),require("@univerjs/engine-render")):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/docs`,`@univerjs/docs-ui`,`@univerjs/docs/facade`,`@univerjs/engine-render`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverDocs,e.UniverDocsUi,e.UniverDocsFacade,e.UniverEngineRender))})(this,function(e,t,n,r,i){var a=class extends r.FDocument{setSelection(r,a){var o,s,c;let l=this._injector.get(i.IRenderManagerService).getRenderUnitById(this.getId());if(l==null)return;let u=l.with(n.DocSelectionRenderService),d=l.with(t.DocSkeletonManagerService).getSkeleton(),f=d.findBodyPageIndexByCharIndex(r),p=(o=d.getSkeletonData())==null?void 0:o.pages[f],m=((s=this.getDocumentDataModel().getBody())==null?void 0:s.dataStream.length)??0,h=f<0&&r>=0&&r<m,g=u.getSegment(),_=(c=l.getInjector)==null?void 0:c.call(l),v=_!=null&&_.has(n.DocBackScrollRenderController)?l.with(n.DocBackScrollRenderController):null,y={startOffset:r,endOffset:a,collapsed:r===a},b=()=>{u.removeAllRanges(),u.addDocRanges([{startOffset:r,endOffset:a,rangeType:e.DOC_RANGE_TYPE.TEXT}],!0)};if(g===``&&v!=null&&(h||p!=null&&p.isMaterializationPlaceholder||!v.isViewportReady())){var x;let e=(x=this.getDocumentDataModel().getBody())==null?void 0:x.dataStream;v.scrollToRange(y,()=>{var t;u.getSegment()===g&&((t=this.getDocumentDataModel().getBody())==null?void 0:t.dataStream)===e&&b()}),u.removeAllRanges(),u.addDocRanges([],!0,{shouldFocus:!1}),u.blur()}else b(),g===``&&v!=null&&v.scrollToRange(y)}};r.FDocument.extend(a)});