@univerjs/docs-ui 0.2.4 → 0.2.6
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 +4 -4
- package/lib/es/index.js +2134 -1729
- package/lib/index.css +1 -1
- package/lib/types/controllers/app-ui-controller.d.ts +1 -2
- package/lib/types/controllers/doc-container-ui-controller.d.ts +1 -2
- package/lib/types/controllers/doc-ui.controller.d.ts +8 -4
- package/lib/types/controllers/menu/context-menu.d.ts +7 -0
- package/lib/types/controllers/menu/menu.d.ts +1 -1
- package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +18 -0
- package/lib/types/controllers/render-controllers/doc-hover.render-controller.d.ts +11 -0
- package/lib/types/controllers/render-controllers/doc-resize.render-controller.d.ts +12 -0
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +4 -3
- package/lib/types/controllers/shortcut/toolbar.shortcut.d.ts +14 -0
- package/lib/types/docs-ui-plugin.d.ts +1 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +2 -3
- package/lib/types/services/doc-hover-manager.service.d.ts +18 -0
- package/lib/types/services/doc-page-layout.service.d.ts +8 -0
- package/lib/types/services/doc-popup-manager.service.d.ts +1 -2
- package/lib/types/views/count-bar/CountBar.d.ts +8 -0
- package/lib/types/views/count-bar/ZoomSlider.d.ts +3 -0
- package/lib/types/views/count-bar/index.d.ts +16 -0
- package/lib/types/views/doc-footer/DocFooter.d.ts +3 -0
- package/lib/types/views/doc-footer/index.d.ts +16 -0
- package/lib/umd/index.js +4 -4
- package/package.json +15 -17
- package/lib/types/services/doc-mark-selection.service.d.ts +0 -27
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-panel{padding-top:20px;font-size:var(--font-size-sm)}.univer-options-section{margin-top:10px;padding-bottom:10px}.univer-options-form-item{display:block;margin-bottom:5px}.univer-options-input{width:80%;margin-top:5px}.univer-options-margin-setting{display:flex}
|
|
1
|
+
.univer-doc-count-bar{display:flex;flex:0 0 260px;justify-content:flex-end}.univer-doc-footer-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 var(--padding-xl)}.univer-panel{padding-top:20px;font-size:var(--font-size-sm)}.univer-options-section{margin-top:10px;padding-bottom:10px}.univer-options-form-item{display:block;margin-bottom:5px}.univer-options-input{width:80%;margin-top:5px}.univer-options-margin-setting{display:flex}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LocaleService, RxDisposable } from '@univerjs/core';
|
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { Injector, LocaleService, RxDisposable } from '@univerjs/core';
|
|
3
2
|
import { ILayoutService } from '@univerjs/ui';
|
|
4
3
|
import { ITextSelectionRenderManager } from '@univerjs/engine-render';
|
|
5
4
|
import { IUniverDocsUIConfig } from '../basics';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LocaleService } from '@univerjs/core';
|
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { Injector, LocaleService } from '@univerjs/core';
|
|
3
2
|
import { IUniverDocsUIConfig } from '../basics';
|
|
4
3
|
import { DocContainer } from '../views/doc-container/DocContainer';
|
|
5
4
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Disposable } from '@univerjs/core';
|
|
2
|
-
import { ComponentManager, ILayoutService, IMenuService } from '@univerjs/ui';
|
|
3
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { ComponentManager, ILayoutService, IMenuService, IShortcutService, IUIPartsService } from '@univerjs/ui';
|
|
4
3
|
import { IUniverDocsUIConfig } from '../basics';
|
|
5
4
|
|
|
6
5
|
export declare class DocUIController extends Disposable {
|
|
@@ -9,9 +8,14 @@ export declare class DocUIController extends Disposable {
|
|
|
9
8
|
private readonly _componentManager;
|
|
10
9
|
private readonly _layoutService;
|
|
11
10
|
private readonly _menuService;
|
|
12
|
-
|
|
11
|
+
private readonly _uiPartsService;
|
|
12
|
+
private readonly _univerInstanceService;
|
|
13
|
+
private readonly _shortcutService;
|
|
14
|
+
constructor(_config: Partial<IUniverDocsUIConfig>, _injector: Injector, _componentManager: ComponentManager, _layoutService: ILayoutService, _menuService: IMenuService, _uiPartsService: IUIPartsService, _univerInstanceService: IUniverInstanceService, _shortcutService: IShortcutService);
|
|
13
15
|
private _initCustomComponents;
|
|
16
|
+
private _initUiParts;
|
|
14
17
|
private _initMenus;
|
|
18
|
+
private _initShortCut;
|
|
15
19
|
private _init;
|
|
16
20
|
private _initFocusHandler;
|
|
17
21
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IAccessor } from '@univerjs/core';
|
|
2
|
+
import { IMenuButtonItem } from '@univerjs/ui';
|
|
3
|
+
|
|
4
|
+
export declare const CopyMenuFactory: (accessor: IAccessor) => IMenuButtonItem;
|
|
5
|
+
export declare const CutMenuFactory: (accessor: IAccessor) => IMenuButtonItem;
|
|
6
|
+
export declare const PasteMenuFactory: (accessor: IAccessor) => IMenuButtonItem;
|
|
7
|
+
export declare const DeleteMenuFactory: (accessor: IAccessor) => IMenuButtonItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
|
-
import { IAccessor } from '@
|
|
2
|
+
import { IAccessor } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare function BoldMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
5
5
|
export declare function ItalicMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Workbook, Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
+
import { TextSelectionManagerService } from '@univerjs/docs';
|
|
3
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
|
+
import { IContextMenuService } from '@univerjs/ui';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This controller subscribe to context menu events in sheet rendering views and invoke context menu at a correct
|
|
8
|
+
* position and with correct menu type.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DocContextMenuRenderController extends Disposable implements IRenderModule {
|
|
11
|
+
private readonly _context;
|
|
12
|
+
private readonly _contextMenuService;
|
|
13
|
+
private readonly _textSelectionManagerService;
|
|
14
|
+
private readonly _commandService;
|
|
15
|
+
constructor(_context: IRenderContext<Workbook>, _contextMenuService: IContextMenuService, _textSelectionManagerService: TextSelectionManagerService, _commandService: ICommandService);
|
|
16
|
+
private _initPointerDown;
|
|
17
|
+
private _initEditChange;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { DocHoverManagerService } from '../../services/doc-hover-manager.service';
|
|
4
|
+
|
|
5
|
+
export declare class DocHoverRenderController extends Disposable implements IRenderModule {
|
|
6
|
+
private _context;
|
|
7
|
+
private readonly _docHoverManagerService;
|
|
8
|
+
constructor(_context: IRenderContext, _docHoverManagerService: DocHoverManagerService);
|
|
9
|
+
private _initPointerDown;
|
|
10
|
+
private _initScroll;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { TextSelectionManagerService } from '@univerjs/docs';
|
|
4
|
+
import { DocPageLayoutService } from '../../services/doc-page-layout.service';
|
|
5
|
+
|
|
6
|
+
export declare class DocResizeRenderController extends Disposable implements IRenderModule {
|
|
7
|
+
private _context;
|
|
8
|
+
private readonly _docPageLayoutService;
|
|
9
|
+
private readonly _textSelectionManagerService;
|
|
10
|
+
constructor(_context: IRenderContext, _docPageLayoutService: DocPageLayoutService, _textSelectionManagerService: TextSelectionManagerService);
|
|
11
|
+
private _initResize;
|
|
12
|
+
}
|
|
@@ -2,6 +2,7 @@ import { DocumentDataModel, Disposable, ICommandService, IUniverInstanceService
|
|
|
2
2
|
import { DocSkeletonManagerService, TextSelectionManagerService } from '@univerjs/docs';
|
|
3
3
|
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
4
|
import { IEditorService } from '@univerjs/ui';
|
|
5
|
+
import { DocPageLayoutService } from '../../services/doc-page-layout.service';
|
|
5
6
|
|
|
6
7
|
export declare class DocZoomRenderController extends Disposable implements IRenderModule {
|
|
7
8
|
private readonly _context;
|
|
@@ -10,11 +11,11 @@ export declare class DocZoomRenderController extends Disposable implements IRend
|
|
|
10
11
|
private readonly _commandService;
|
|
11
12
|
private readonly _textSelectionManagerService;
|
|
12
13
|
private readonly _editorService;
|
|
13
|
-
|
|
14
|
+
private readonly _docPageLayoutService;
|
|
15
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _textSelectionManagerService: TextSelectionManagerService, _editorService: IEditorService, _docPageLayoutService: DocPageLayoutService);
|
|
14
16
|
private _init;
|
|
15
17
|
private _initRenderRefresher;
|
|
16
18
|
private _initSkeletonListener;
|
|
17
19
|
private _initCommandExecutedListener;
|
|
18
|
-
|
|
19
|
-
private _calculatePagePosition;
|
|
20
|
+
updateViewZoom(zoomRatio: number, needRefreshSelection?: boolean): void;
|
|
20
21
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IShortcutItem } from '@univerjs/ui';
|
|
2
|
+
|
|
3
|
+
export declare const BoldShortCut: IShortcutItem;
|
|
4
|
+
export declare const ItalicShortCut: IShortcutItem;
|
|
5
|
+
export declare const UnderlineShortCut: IShortcutItem;
|
|
6
|
+
export declare const StrikeThroughShortCut: IShortcutItem;
|
|
7
|
+
export declare const SubscriptShortCut: IShortcutItem;
|
|
8
|
+
export declare const SuperscriptShortCut: IShortcutItem;
|
|
9
|
+
export declare const AlignLeftShortCut: IShortcutItem;
|
|
10
|
+
export declare const AlignRightShortCut: IShortcutItem;
|
|
11
|
+
export declare const AlignCenterShortCut: IShortcutItem;
|
|
12
|
+
export declare const AlignJustifyShortCut: IShortcutItem;
|
|
13
|
+
export declare const OrderListShortCut: IShortcutItem;
|
|
14
|
+
export declare const BulletListShortCut: IShortcutItem;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ILogService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { ILogService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
2
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
3
|
import { IUniverDocsUIConfig } from './basics';
|
|
5
4
|
|
package/lib/types/index.d.ts
CHANGED
|
@@ -23,4 +23,5 @@ export * from './services';
|
|
|
23
23
|
export { DocsRenderService } from './services/docs-render.service';
|
|
24
24
|
export { DocCanvasPopManagerService } from './services/doc-popup-manager.service';
|
|
25
25
|
export { docDrawingPositionToTransform, transformToDocDrawingPosition } from './basics/transform-position';
|
|
26
|
+
export { DocHoverManagerService } from './services/doc-hover-manager.service';
|
|
26
27
|
export { DocCopyCommand, DocCutCommand, DocPasteCommand } from './commands/commands/clipboard.command';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IDocumentBody, Disposable, ICommandService, ILogService, IUniverInstanceService, SliceBodyType } from '@univerjs/core';
|
|
1
|
+
import { IDisposable, IDocumentBody, Disposable, ICommandService, ILogService, IUniverInstanceService, SliceBodyType } from '@univerjs/core';
|
|
2
2
|
import { IClipboardInterfaceService } from '@univerjs/ui';
|
|
3
|
-
import { IDisposable } from '@wendellhu/redi';
|
|
4
3
|
import { DocCustomRangeService, TextSelectionManagerService } from '@univerjs/docs';
|
|
5
4
|
|
|
6
5
|
export interface IClipboardPropertyItem {
|
|
@@ -17,7 +16,7 @@ export interface IDocClipboardService {
|
|
|
17
16
|
legacyPaste(html?: string, text?: string): Promise<boolean>;
|
|
18
17
|
addClipboardHook(hook: IDocClipboardHook): IDisposable;
|
|
19
18
|
}
|
|
20
|
-
export declare const IDocClipboardService: import('@
|
|
19
|
+
export declare const IDocClipboardService: import('@univerjs/core').IdentifierDecorator<IDocClipboardService>;
|
|
21
20
|
export declare class DocClipboardService extends Disposable implements IDocClipboardService {
|
|
22
21
|
private readonly _univerInstanceService;
|
|
23
22
|
private readonly _logService;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICustomRange, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { IMouseEvent, IPointerEvent, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
+
|
|
4
|
+
export declare class DocHoverManagerService extends Disposable {
|
|
5
|
+
private readonly _univerInstanceService;
|
|
6
|
+
private readonly _renderManagerService;
|
|
7
|
+
private readonly _activeCustomRanges$;
|
|
8
|
+
readonly activeCustomRanges$: import('rxjs').Observable<ICustomRange[]>;
|
|
9
|
+
private readonly _activeIndex$;
|
|
10
|
+
readonly activeIndex$: import('rxjs').Observable<Nullable<number>>;
|
|
11
|
+
private _scrolling;
|
|
12
|
+
constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
|
|
13
|
+
private _getTransformCoordForDocumentOffset;
|
|
14
|
+
private _calcActiveCustomRanges;
|
|
15
|
+
onMouseMove(evt: IPointerEvent | IMouseEvent): void;
|
|
16
|
+
startScroll(): void;
|
|
17
|
+
endScroll(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocumentDataModel, Disposable } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
|
|
4
|
+
export declare class DocPageLayoutService extends Disposable implements IRenderModule {
|
|
5
|
+
private _context;
|
|
6
|
+
constructor(_context: IRenderContext<DocumentDataModel>);
|
|
7
|
+
calculatePagePosition(): this | undefined;
|
|
8
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ITextRange, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { IDisposable, ITextRange, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IRenderManagerService, BaseObject, IBoundRectNoAngle, Scene } from '@univerjs/engine-render';
|
|
3
3
|
import { IPopup, ICanvasPopupService } from '@univerjs/ui';
|
|
4
|
-
import { IDisposable } from '@wendellhu/redi';
|
|
5
4
|
|
|
6
5
|
export declare function transformBound2OffsetBound(originBound: IBoundRectNoAngle, scene: Scene): IBoundRectNoAngle;
|
|
7
6
|
export declare function transformPosition2Offset(x: number, y: number, scene: Scene): {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 * from './CountBar';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 { DocFooter } from './DocFooter';
|