@univerjs/docs-ui 1.0.0-beta.1 → 1.0.0-beta.2

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.
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { DocumentDataModel } from '@univerjs/core';
17
17
  import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
- import { Disposable, ICommandService, IUniverInstanceService, LocaleService } from '@univerjs/core';
18
+ import { Disposable, ICommandService, IUniverInstanceService, LocaleService, ThemeService } from '@univerjs/core';
19
19
  import { DocSkeletonManagerService } from '@univerjs/docs';
20
20
  import { IRenderManagerService } from '@univerjs/engine-render';
21
21
  import { IEditorService } from '../services/editor/editor-manager.service';
@@ -29,15 +29,21 @@ export declare class DocHeaderFooterController extends Disposable implements IRe
29
29
  private readonly _docSkeletonManagerService;
30
30
  private readonly _docSelectionRenderService;
31
31
  private readonly _localeService;
32
+ private readonly _themeService;
32
33
  private _loadedMap;
33
- constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _docSkeletonManagerService: DocSkeletonManagerService, _docSelectionRenderService: DocSelectionRenderService, _localeService: LocaleService);
34
+ private _headerFooterColors;
35
+ constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _docSkeletonManagerService: DocSkeletonManagerService, _docSelectionRenderService: DocSelectionRenderService, _localeService: LocaleService, _themeService: ThemeService);
34
36
  private _initialize;
37
+ private _initThemeColors;
35
38
  dispose(): void;
36
39
  private _listenSwitchMode;
37
40
  private _init;
38
41
  private _initialMain;
39
42
  private _getTransformCoordForDocumentOffset;
40
43
  private _drawHeaderFooterLabel;
44
+ private _drawHeaderFooterPage;
45
+ private _drawHeaderFooterCover;
46
+ private _drawHeaderFooterGuides;
41
47
  private _isEditorReadOnly;
42
48
  private _isTraditionalMode;
43
49
  }
@@ -41,6 +41,7 @@ export interface IDocsCustomBlockLayoutViewport {
41
41
  offsetLeft?: number;
42
42
  pageContentWidth?: number;
43
43
  viewScale?: number;
44
+ visibleCanvasHeight?: number;
44
45
  viewportHeight?: number;
45
46
  width: number;
46
47
  }
@@ -97,9 +97,12 @@ export { DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE, IDocEmbedInteractionBou
97
97
  export { DocEventManagerService, getListMarkerFallbackBound, getListParagraphContextMenuHit, } from './services/doc-event-manager.service';
98
98
  export type { IBulletBound, IMutiPageParagraphBound } from './services/doc-event-manager.service';
99
99
  export { DocIMEInputManagerService } from './services/doc-ime-input-manager.service';
100
+ export { SetDocInputStyleCommand } from './services/doc-menu-style.service';
101
+ export type { ISetDocInputStyleCommandParams } from './services/doc-menu-style.service';
100
102
  export { DocPageLayoutService } from './services/doc-page-layout.service';
101
103
  export { DocParagraphMenuService } from './services/doc-paragraph-menu.service';
102
104
  export { calcDocRangePositions, DocCanvasPopManagerService } from './services/doc-popup-manager.service';
105
+ export type { IDocPrintPreparationContext } from './services/doc-print-interceptor.service';
103
106
  export { DocPrintInterceptorService } from './services/doc-print-interceptor.service';
104
107
  export type { IDocPrintComponentContext, IDocPrintContext } from './services/doc-print-interceptor.service';
105
108
  export { DocsRenderService } from './services/docs-render.service';
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IDisposable } from '@univerjs/core';
17
+ import type { Observable } from 'rxjs';
17
18
  import { Subject } from 'rxjs';
18
19
  export declare const DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE = "data-embed-interaction-boundary-owner";
19
20
  export declare const EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE = "data-embed-interaction-boundary-owner";
@@ -23,6 +24,7 @@ export interface IDocEmbedInteractionBoundaryService {
23
24
  hasRecentInteractionFor?(embedId: string | undefined, ownerDocument?: Document): boolean;
24
25
  }
25
26
  export interface IDocEmbedRuntimeFocusCoordinator {
27
+ readonly runtimeSessionChanged$: Observable<void>;
26
28
  isChildUnitRuntimeEvent(unitId: string | undefined, target: EventTarget | null | undefined, event?: Event): boolean;
27
29
  isChildUnitInActiveSession(unitId: string | undefined): boolean;
28
30
  shouldSuppressHostInteraction(unitId: string | undefined, target?: EventTarget | null, event?: Event): boolean;
@@ -46,6 +46,10 @@ interface ICustomRangeActive {
46
46
  segmentPageIndex: number;
47
47
  rects: IBoundRectNoAngle[];
48
48
  }
49
+ interface ICustomRangeClickEvent extends ICustomRangeActive {
50
+ ctrlKey: boolean;
51
+ metaKey: boolean;
52
+ }
49
53
  interface IBulletActive {
50
54
  paragraph: IParagraph;
51
55
  segmentId?: string;
@@ -98,7 +102,9 @@ export declare class DocEventManagerService extends Disposable implements IRende
98
102
  private readonly _hoverCustomRanges$;
99
103
  readonly hoverCustomRanges$: import("rxjs").Observable<ICustomRangeActive[]>;
100
104
  private readonly _clickCustomRanges$;
101
- readonly clickCustomRanges$: import("rxjs").Observable<ICustomRangeActive>;
105
+ readonly clickCustomRanges$: import("rxjs").Observable<ICustomRangeClickEvent>;
106
+ private readonly _pointerDownCustomRanges$;
107
+ readonly pointerDownCustomRanges$: import("rxjs").Observable<ICustomRangeActive[]>;
102
108
  private readonly _hoverBullet$;
103
109
  readonly hoverBullet$: import("rxjs").Observable<Nullable<IBulletActive>>;
104
110
  private readonly _clickBullet$;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ITextStyle, Nullable } from '@univerjs/core';
16
+ import type { ICommand, ITextStyle, Nullable } from '@univerjs/core';
17
17
  import { Disposable, IUniverInstanceService, ThemeService } from '@univerjs/core';
18
18
  import { DocSelectionManagerService } from '@univerjs/docs';
19
19
  import { IRenderManagerService } from '@univerjs/engine-render';
@@ -31,3 +31,7 @@ export declare class DocMenuStyleService extends Disposable {
31
31
  setStyleCache(style: ITextStyle): void;
32
32
  private _clearStyleCache;
33
33
  }
34
+ export interface ISetDocInputStyleCommandParams {
35
+ style: ITextStyle;
36
+ }
37
+ export declare const SetDocInputStyleCommand: ICommand<ISetDocInputStyleCommandParams>;
@@ -61,4 +61,5 @@ export declare class DocCanvasPopManagerService extends Disposable {
61
61
  */
62
62
  attachPopupToRange(range: ITextRangeParam, popup: IDocCanvasPopup, unitId: string): INeedCheckDisposable;
63
63
  private _resolveEmbeddedPopupInjector;
64
+ private _resolvePopupManagerService;
64
65
  }
@@ -33,8 +33,13 @@ export interface IDocPrintDomtContext extends IDocPrintContext {
33
33
  export interface IDocPrintComponentContext extends IDocPrintContext {
34
34
  documents: Documents;
35
35
  }
36
+ export interface IDocPrintPreparationContext {
37
+ unitId: string;
38
+ dpr: number;
39
+ }
36
40
  export declare class DocPrintInterceptorService extends Disposable {
37
41
  private _printComponentMap;
42
+ private readonly _printPreparationHandlers;
38
43
  readonly interceptor: InterceptorManager<{
39
44
  PRINTING_COMPONENT_COLLECT: import("@univerjs/core").IInterceptor<undefined, IDocPrintComponentContext>;
40
45
  PRINTING_DOM_COLLECT: import("@univerjs/core").IInterceptor<DisposableCollection, IDocPrintDomtContext>;
@@ -42,4 +47,7 @@ export declare class DocPrintInterceptorService extends Disposable {
42
47
  constructor();
43
48
  registerPrintComponent(componentKey: string, printingComponentKey: string): void;
44
49
  getPrintComponent(componentKey: string): string | undefined;
50
+ registerPrintPreparation(handler: (context: IDocPrintPreparationContext) => Promise<void>): () => boolean;
51
+ preparePrint(context: IDocPrintPreparationContext): Promise<void>;
52
+ dispose(): void;
45
53
  }
@@ -17,6 +17,7 @@ import type { DocumentDataModel, IDisposable, Nullable } from '@univerjs/core';
17
17
  import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
18
  import { Disposable, IContextService, IUniverInstanceService } from '@univerjs/core';
19
19
  import { DocSelectionManagerService } from '@univerjs/docs';
20
+ import { IDocEmbedRuntimeFocusCoordinator } from './doc-embed-integration.service';
20
21
  import { DocCanvasPopManagerService } from './doc-popup-manager.service';
21
22
  import { DocSelectionRenderService } from './selection/doc-selection-render.service';
22
23
  export declare class DocFloatMenuService extends Disposable implements IRenderModule {
@@ -26,9 +27,12 @@ export declare class DocFloatMenuService extends Disposable implements IRenderMo
26
27
  private readonly _univerInstanceService;
27
28
  private readonly _docSelectionRenderService;
28
29
  private readonly _contextService;
30
+ private readonly _embedRuntimeFocusCoordinator?;
29
31
  private _floatMenu;
30
32
  private _suppressed;
31
- constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService, _univerInstanceService: IUniverInstanceService, _docSelectionRenderService: DocSelectionRenderService, _contextService: IContextService);
33
+ private _embedSuppressed;
34
+ private _invalidatedSelection;
35
+ constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService, _univerInstanceService: IUniverInstanceService, _docSelectionRenderService: DocSelectionRenderService, _contextService: IContextService, _embedRuntimeFocusCoordinator?: IDocEmbedRuntimeFocusCoordinator | undefined);
32
36
  get floatMenu(): Nullable<{
33
37
  disposable: IDisposable;
34
38
  start: number;
@@ -37,6 +41,8 @@ export declare class DocFloatMenuService extends Disposable implements IRenderMo
37
41
  hideFloatMenu(): void;
38
42
  setSuppressed(suppressed: boolean): void;
39
43
  private _initSelectionChange;
44
+ private _initEmbedRuntimeLifecycle;
45
+ private _getSelectionKey;
40
46
  private _hideFloatMenu;
41
47
  private _showFloatMenu;
42
48
  }