@univerjs/docs-ui 1.0.0-alpha.1 → 1.0.0-alpha.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.
- package/lib/cjs/index.js +920 -883
- package/lib/es/index.js +919 -884
- package/lib/index.js +919 -884
- package/lib/types/commands/commands/doc-delete.command.d.ts +6 -2
- package/lib/types/commands/commands/doc-header-footer.command.d.ts +3 -9
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +2 -1
- package/lib/types/controllers/doc-header-footer.controller.d.ts +0 -8
- package/lib/types/index.d.ts +3 -3
- package/lib/types/menu/menu.d.ts +1 -0
- package/lib/types/services/doc-paragraph-menu.service.d.ts +1 -1
- package/lib/types/services/index.d.ts +1 -0
- package/lib/types/shortcuts/core-editing.shortcut.d.ts +1 -0
- package/lib/types/views/ParagraphMenu.d.ts +1 -0
- package/lib/types/views/paragraph-setting/line-spacing.d.ts +2 -14
- package/lib/umd/index.js +9 -10
- package/package.json +11 -11
|
@@ -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 { ICommand, IDocumentBody, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { ICommand, IDocumentBlockRange, IDocumentBody, IMultiCommand, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
18
18
|
import { DeleteDirection } from '@univerjs/core';
|
|
19
19
|
export interface IDeleteCustomBlockParams {
|
|
@@ -33,5 +33,9 @@ export declare function getCursorWhenDelete(textRanges: Readonly<Nullable<ITextR
|
|
|
33
33
|
export declare function isDeleteOffsetInsideBlockRange(body: IDocumentBody, offset: number): boolean;
|
|
34
34
|
export declare const DeleteLeftCommand: ICommand;
|
|
35
35
|
export declare const DeleteRightCommand: ICommand;
|
|
36
|
-
export
|
|
36
|
+
export interface IDeleteCurrentParagraphCommandParams {
|
|
37
|
+
unitId?: string;
|
|
38
|
+
blockRange?: IDocumentBlockRange;
|
|
39
|
+
}
|
|
40
|
+
export declare const DeleteCurrentParagraphCommand: IMultiCommand<IDeleteCurrentParagraphCommandParams>;
|
|
37
41
|
export {};
|
|
@@ -14,14 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand } from '@univerjs/core';
|
|
17
|
-
import {
|
|
18
|
-
import { HeaderFooterType } from '
|
|
19
|
-
export interface IHeaderFooterProps {
|
|
20
|
-
marginHeader?: number;
|
|
21
|
-
marginFooter?: number;
|
|
22
|
-
useFirstPageHeaderFooter?: BooleanNumber;
|
|
23
|
-
evenAndOddHeaders?: BooleanNumber;
|
|
24
|
-
}
|
|
17
|
+
import type { IHeaderFooterProps } from '@univerjs/docs';
|
|
18
|
+
import { HeaderFooterType } from '@univerjs/docs';
|
|
25
19
|
export interface ICoreHeaderFooterParams {
|
|
26
20
|
unitId: string;
|
|
27
21
|
createType?: HeaderFooterType;
|
|
@@ -37,7 +31,7 @@ interface IOpenHeaderFooterPanelParams {
|
|
|
37
31
|
}
|
|
38
32
|
export declare const OpenHeaderFooterPanelCommand: ICommand<IOpenHeaderFooterPanelParams>;
|
|
39
33
|
interface ICloseHeaderFooterParams {
|
|
40
|
-
unitId
|
|
34
|
+
unitId?: string;
|
|
41
35
|
}
|
|
42
36
|
export declare const CloseHeaderFooterCommand: ICommand<ICloseHeaderFooterParams>;
|
|
43
37
|
export {};
|
|
@@ -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 { ICommand, IParagraph, ISectionBreak, ITextRun } from '@univerjs/core';
|
|
16
|
+
import type { ICommand, IDocumentBody, IParagraph, ISectionBreak, ITextRun } from '@univerjs/core';
|
|
17
17
|
export declare const CreateDocTableCommandId = "doc.command.create-table";
|
|
18
18
|
export interface ICreateDocTableCommandParams {
|
|
19
19
|
rowCount: number;
|
|
@@ -49,6 +49,7 @@ export declare function shouldCreateParagraphBeforeTable(body: {
|
|
|
49
49
|
export declare function normalizeTableInsertOffset(body: {
|
|
50
50
|
dataStream: string;
|
|
51
51
|
}, startOffset: number): number;
|
|
52
|
+
export declare function canInsertTableAtOffset(body: Pick<IDocumentBody, 'tables' | 'blockRanges' | 'customBlocks'>, offset: number): boolean;
|
|
52
53
|
/**
|
|
53
54
|
* The command to create a table at cursor point.
|
|
54
55
|
*/
|
|
@@ -20,14 +20,6 @@ import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
|
20
20
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
21
21
|
import { IEditorService } from '../services/editor/editor-manager.service';
|
|
22
22
|
import { DocSelectionRenderService } from '../services/selection/doc-selection-render.service';
|
|
23
|
-
export declare enum HeaderFooterType {
|
|
24
|
-
FIRST_PAGE_HEADER = 0,
|
|
25
|
-
FIRST_PAGE_FOOTER = 1,
|
|
26
|
-
DEFAULT_HEADER = 2,
|
|
27
|
-
DEFAULT_FOOTER = 3,
|
|
28
|
-
EVEN_PAGE_HEADER = 4,
|
|
29
|
-
EVEN_PAGE_FOOTER = 5
|
|
30
|
-
}
|
|
31
23
|
export declare class DocHeaderFooterController extends Disposable implements IRenderModule {
|
|
32
24
|
private readonly _context;
|
|
33
25
|
private readonly _commandService;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export type { IInnerCutCommandParams } from './commands/commands/clipboard.inner
|
|
|
31
31
|
export { getCustomBlockIdsInSelections, getCutActionsFromDocRanges } from './commands/commands/clipboard.inner.command';
|
|
32
32
|
export { buildMoveDocBlockActions, MoveDocBlockCommand } from './commands/commands/doc-block-move.command';
|
|
33
33
|
export type { IMoveDocBlockCommandParams } from './commands/commands/doc-block-move.command';
|
|
34
|
-
export { DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
|
|
35
|
-
export type { IDeleteCustomBlockParams } from './commands/commands/doc-delete.command';
|
|
34
|
+
export { DeleteCurrentParagraphCommand, DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
|
|
35
|
+
export type { IDeleteCurrentParagraphCommandParams, IDeleteCustomBlockParams } from './commands/commands/doc-delete.command';
|
|
36
36
|
export { getCursorWhenDelete } from './commands/commands/doc-delete.command';
|
|
37
37
|
export { HorizontalLineCommand } from './commands/commands/doc-horizontal-line.command';
|
|
38
38
|
export { DocSelectAllCommand } from './commands/commands/doc-select-all.command';
|
|
@@ -72,7 +72,7 @@ export { DocBackScrollRenderController } from './controllers/render-controllers/
|
|
|
72
72
|
export { DocParagraphPlaceholderRenderController, } from './controllers/render-controllers/doc-paragraph-placeholder.render-controller';
|
|
73
73
|
export { DocRenderController } from './controllers/render-controllers/doc.render-controller';
|
|
74
74
|
export { DocUIController } from './controllers/ui.controller';
|
|
75
|
-
export { AlignMenuItemFactory, BackgroundColorSelectorMenuItemFactory, BoldMenuItemFactory, FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, FloatTextStyleMenuItemFactory, FontFamilySelectorMenuItemFactory, FontSizeSelectorMenuItemFactory, hideMenuWhenSelectionInBlockRange, isTextRangeInAnyBlockRange, ItalicMenuItemFactory, StrikeThroughMenuItemFactory, TextColorSelectorMenuItemFactory, UnderlineMenuItemFactory, } from './menu/menu';
|
|
75
|
+
export { AlignMenuItemFactory, BackgroundColorSelectorMenuItemFactory, BoldMenuItemFactory, disableMenuWhenHeaderFooterEditing, FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, FloatTextStyleMenuItemFactory, FontFamilySelectorMenuItemFactory, FontSizeSelectorMenuItemFactory, hideMenuWhenSelectionInBlockRange, isTextRangeInAnyBlockRange, ItalicMenuItemFactory, StrikeThroughMenuItemFactory, TextColorSelectorMenuItemFactory, UnderlineMenuItemFactory, } from './menu/menu';
|
|
76
76
|
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';
|
|
77
77
|
export { menuSchema as DocsUIMenuSchema } from './menu/schema';
|
|
78
78
|
export { UniverDocsUIPlugin } from './plugin';
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui
|
|
|
18
18
|
import type { LocaleKey } from '../locale/types';
|
|
19
19
|
import { HorizontalAlign, NamedStyleType, PresetListType } from '@univerjs/core';
|
|
20
20
|
import { Observable } from 'rxjs';
|
|
21
|
+
export declare function disableMenuWhenHeaderFooterEditing(accessor: IAccessor): Observable<boolean>;
|
|
21
22
|
export declare function disableMenuWhenNoDocRange(accessor: IAccessor): Observable<boolean>;
|
|
22
23
|
export declare function isTextRangeInAnyBlockRange(document: Nullable<DocumentDataModel>, range: ITextRangeParam): boolean;
|
|
23
24
|
export declare function hideMenuWhenSelectionInBlockRange(accessor: IAccessor): Observable<boolean>;
|
|
@@ -68,7 +68,7 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
|
|
|
68
68
|
private _docSkeletonManagerService;
|
|
69
69
|
private _floatMenuService;
|
|
70
70
|
private _docSelectionRenderService;
|
|
71
|
-
private
|
|
71
|
+
private _paragraphMenu;
|
|
72
72
|
private readonly _activeTarget$;
|
|
73
73
|
readonly activeTarget$: import("rxjs").Observable<IDocBlockMenuTarget | null>;
|
|
74
74
|
private readonly _slashMenuRequest$;
|
|
@@ -17,5 +17,6 @@ export { default as PastePluginLark } from './clipboard/html-to-udm/paste-plugin
|
|
|
17
17
|
export { default as PastePluginUniver } from './clipboard/html-to-udm/paste-plugins/plugin-univer';
|
|
18
18
|
export { default as PastePluginWord } from './clipboard/html-to-udm/paste-plugins/plugin-word';
|
|
19
19
|
export { type IPastePlugin } from './clipboard/html-to-udm/paste-plugins/type';
|
|
20
|
+
export type { IDocBlockMenuTarget } from './doc-paragraph-menu.service';
|
|
20
21
|
export { calcDocFitToWidthScale, DocViewScaleService, normalizeDocFitToWidthOptions, resolveDocFitBaseWidth, resolveDocViewScale } from './doc-view-scale';
|
|
21
22
|
export type { ICalcDocFitToWidthScaleParams, IResolveDocFitBaseWidthParams } from './doc-view-scale';
|
|
@@ -18,3 +18,4 @@ export declare const BreakLineShortcut: IShortcutItem;
|
|
|
18
18
|
export declare const SoftBreakLineShortcut: IShortcutItem;
|
|
19
19
|
export declare const DeleteLeftShortcut: IShortcutItem;
|
|
20
20
|
export declare const DeleteRightShortcut: IShortcutItem;
|
|
21
|
+
export declare const CloseHeaderFooterShortcut: IShortcutItem;
|
|
@@ -52,6 +52,7 @@ export declare function getParagraphMenuResolvedCommand(option: IValueOption, ta
|
|
|
52
52
|
commandId?: string;
|
|
53
53
|
params?: object;
|
|
54
54
|
};
|
|
55
|
+
export declare function getParagraphMenuCommandParams(commandId: string | undefined, commandParams: Record<string, unknown> | undefined, target: IDocBlockMenuTarget | null | undefined, unitId: string): Record<string, unknown> | undefined;
|
|
55
56
|
export declare function shouldShowParagraphSettingMenu(target: IDocBlockMenuTarget | null | undefined): boolean;
|
|
56
57
|
export declare function getParagraphMenuHiddenItemIds(menuType: string, target: IDocBlockMenuTarget | null | undefined, namedStyleType?: NamedStyleType): string[];
|
|
57
58
|
export declare function unwrapBlockRangeBody(documentBody: IDocumentBody, blockRange: IDocumentBlockRange): {
|
|
@@ -14,24 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { LocaleService } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonLine } from '@univerjs/engine-render';
|
|
17
18
|
import { SpacingRule } from '@univerjs/core';
|
|
18
19
|
interface ILineSpacingMetrics {
|
|
19
20
|
glyphLineHeight: number;
|
|
20
21
|
renderedLineHeight: number;
|
|
21
22
|
}
|
|
22
|
-
interface ILineSpacingLike {
|
|
23
|
-
contentHeight?: number;
|
|
24
|
-
paddingTop?: number;
|
|
25
|
-
paddingBottom?: number;
|
|
26
|
-
divides?: Array<{
|
|
27
|
-
glyphGroup?: Array<{
|
|
28
|
-
bBox?: {
|
|
29
|
-
ba?: number;
|
|
30
|
-
bd?: number;
|
|
31
|
-
};
|
|
32
|
-
}>;
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
23
|
export declare function getLineSpacingRuleOptions(localeService: LocaleService): {
|
|
36
24
|
label: string;
|
|
37
25
|
value: string;
|
|
@@ -46,6 +34,6 @@ export declare function getLineSpacingInputConfig(spacingRule: SpacingRule): {
|
|
|
46
34
|
};
|
|
47
35
|
export declare function convertStoredLineSpacingToDisplayValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
48
36
|
export declare function convertDisplayLineSpacingToStoredValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
49
|
-
export declare function getLineSpacingMetrics(lineNode?:
|
|
37
|
+
export declare function getLineSpacingMetrics(lineNode?: IDocumentSkeletonLine): ILineSpacingMetrics | null;
|
|
50
38
|
export declare function convertLineSpacingForRuleChange(currentStoredValue: number, currentRule: SpacingRule, nextRule: SpacingRule, metrics?: ILineSpacingMetrics | null): number;
|
|
51
39
|
export {};
|