@ones-editor/editor 1.1.16-beta.5 → 1.1.16-beta.8
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/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
- package/@ones-editor/code-block/src/code-block/header/index.d.ts +1 -0
- package/@ones-editor/code-block/src/code-block/languages.d.ts +1 -1
- package/@ones-editor/code-block/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/code-block/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/code-block/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/comments/src/comments-render/index.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/actions/update-block-text.d.ts +3 -3
- package/@ones-editor/core/src/core/editor/actions/update-box-data.d.ts +2 -2
- package/@ones-editor/core/src/core/types.d.ts +2 -2
- package/@ones-editor/core/src/utils/dom.d.ts +1 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/heading-block-collapse-button-render.d.ts +1 -4
- package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +0 -2
- package/@ones-editor/paste-special/src/paste-special-button.d.ts +0 -1
- package/@ones-editor/status/package.json +7 -0
- package/@ones-editor/status/src/dom/input.d.ts +1 -0
- package/@ones-editor/status/src/dom/overflow-tooltip-tag.d.ts +10 -0
- package/@ones-editor/status/src/dom/status-palette.d.ts +6 -0
- package/@ones-editor/status/src/index.d.ts +4 -0
- package/@ones-editor/status/src/locale/en-us.d.ts +25 -0
- package/@ones-editor/status/src/locale/index.d.ts +1 -0
- package/@ones-editor/status/src/locale/ja-jp.d.ts +25 -0
- package/@ones-editor/status/src/locale/zh-cn.d.ts +25 -0
- package/@ones-editor/status/src/status-box-command.d.ts +7 -0
- package/@ones-editor/status/src/status-box-data.d.ts +5 -0
- package/@ones-editor/status/src/status-box-editor.d.ts +21 -0
- package/@ones-editor/status/src/status-box.d.ts +4 -0
- package/@ones-editor/status/src/types.d.ts +8 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +2 -2
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +1 -2
- package/@ones-editor/ui/src/quick-menu/types.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/manual-menu.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +0 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/input/create-input.d.ts +3 -2
- package/@ones-editor/ui-base/src/popup/popup.d.ts +0 -2
- package/@ones-editor/versions/src/types.d.ts +2 -3
- package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +2 -1
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +210 -199
- package/dist/types.d.ts +1 -4
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../../../@ones-editor/core';
|
|
2
2
|
import type { GetAllQuickMenuItemsOptions } from '../../../../../../@ones-editor/ui';
|
|
3
3
|
import type { BlockMenuItem } from '../types';
|
|
4
|
-
export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before', options
|
|
4
|
+
export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before', options?: GetAllQuickMenuItemsOptions): BlockMenuItem[];
|
|
5
5
|
export declare function executeInsertBlockCommand(editor: OnesEditor, block: BlockElement, item: BlockMenuItem, insertAbove?: boolean): Promise<BlockElement | null> | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
2
|
import { DocCodeBlockData } from '../code-block-data';
|
|
3
3
|
export declare function createCodeBlockHeader(editor: OnesEditor, block: BlockElement, codeData: DocCodeBlockData): void;
|
|
4
|
+
export declare function getCodeBlockHeader(block: BlockElement): HTMLElement;
|
|
@@ -67,7 +67,7 @@ import 'prismjs/components/prism-vhdl';
|
|
|
67
67
|
import 'prismjs/components/prism-visual-basic';
|
|
68
68
|
import 'prismjs/components/prism-wasm';
|
|
69
69
|
import 'prismjs/components/prism-yaml';
|
|
70
|
-
declare const SUPPORTED_LANGUAGES: {
|
|
70
|
+
declare const SUPPORTED_LANGUAGES: () => {
|
|
71
71
|
abap: {
|
|
72
72
|
name: string;
|
|
73
73
|
aliases: string[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare class OnesEditorCommentsRender implements OnesEditorBlockRenderer {
|
|
3
3
|
renderText(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
4
|
+
renderBox(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
4
5
|
renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
|
|
5
6
|
updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
|
|
6
7
|
}
|
|
@@ -5,6 +5,7 @@ export declare const TEXT_STYLE_BACKGROUND_COLOR_PREFIX = "style-bg-color-";
|
|
|
5
5
|
export declare function addAttribute(text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
|
|
6
6
|
export declare function removeAttribute(text: DocBlockText, key: string, value: unknown, options?: {
|
|
7
7
|
ignoreValue: boolean;
|
|
8
|
+
handleBox?: boolean;
|
|
8
9
|
}): DocBlockText;
|
|
9
10
|
export declare function rangeAddAttribute(offset: number, length: number, text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
|
|
10
11
|
export declare function rangeRemoveAttribute(offset: number, length: number, text: DocBlockText, key: string, value: unknown, options?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnesEditor, BlockElement } from '../../types';
|
|
1
|
+
import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
|
|
2
2
|
import { DocBlockText, DocBlockTextActions } from '../../doc';
|
|
3
|
-
export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions): DocBlockText;
|
|
4
|
-
export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText): void;
|
|
3
|
+
export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions, options?: InsertTextOptions): DocBlockText;
|
|
4
|
+
export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText, options?: InsertTextOptions): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OnesEditor } from '../../types';
|
|
1
|
+
import { InsertTextOptions, OnesEditor } from '../../types';
|
|
2
2
|
import { DocBox } from '../../doc';
|
|
3
|
-
export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox): void;
|
|
3
|
+
export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox, options?: InsertTextOptions): void;
|
|
@@ -144,7 +144,6 @@ export interface CommandItem {
|
|
|
144
144
|
ellipsisTooltip?: string;
|
|
145
145
|
disableTooltip?: boolean;
|
|
146
146
|
disableReason?: string;
|
|
147
|
-
hideGroupItem?: boolean;
|
|
148
147
|
setCloseable?: (closeable: Closeable) => void;
|
|
149
148
|
beforePopup?: (parent: unknown) => void;
|
|
150
149
|
}
|
|
@@ -448,6 +447,7 @@ export type OnesEditorCustomCreator = (editor: OnesEditor) => OnesEditorCustom;
|
|
|
448
447
|
export interface CloneBlockResultInfo {
|
|
449
448
|
containerIdMap: Map<string, string>;
|
|
450
449
|
blockIdMap: Map<string, string>;
|
|
450
|
+
boxIdMap: Map<string, string>;
|
|
451
451
|
}
|
|
452
452
|
export interface OnesEditorDomEvents extends OnesEditorCustom {
|
|
453
453
|
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
|
|
@@ -549,7 +549,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
549
549
|
deleteChildContainers: (containerIds: string[]) => void;
|
|
550
550
|
updateBlockData: (block: BlockElement, data: DocBlockAttributes, newRange?: SelectionRange) => DocBlock;
|
|
551
551
|
updateEmbedData: (block: BlockElement, data: DocEmbedData, newRange?: SelectionRange) => DocBlock;
|
|
552
|
-
updateBoxData: (boxData: DocBox) => void;
|
|
552
|
+
updateBoxData: (boxData: DocBox, options?: InsertTextOptions) => void;
|
|
553
553
|
updateCompositionText: (text: string, end: boolean) => void;
|
|
554
554
|
getColor: (index: number, type?: string) => string;
|
|
555
555
|
}
|
|
@@ -33,4 +33,5 @@ export declare function findTarget(event: Event, cssSelector: string): Element |
|
|
|
33
33
|
export declare function findEventTargetBlock(event: Event): Element | null;
|
|
34
34
|
export declare function isElementVisible(element: Element | null): boolean;
|
|
35
35
|
export declare function getElementScale(element: Element): number;
|
|
36
|
+
export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaElement, callback: (event: KeyboardEvent, composing: boolean) => void): () => void;
|
|
36
37
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockElement,
|
|
1
|
+
import { BlockElement, OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare class HeadingBlockCollapseButton implements OnesEditorCustom {
|
|
3
3
|
private editor;
|
|
4
4
|
constructor(editor: OnesEditor);
|
|
@@ -7,8 +7,5 @@ export declare class HeadingBlockCollapseButton implements OnesEditorCustom {
|
|
|
7
7
|
handleHoverBlock: (hoveringBlock: BlockElement | null, oldHoveringBlock: BlockElement | null) => void;
|
|
8
8
|
handleClick: (editor: OnesEditor, event: MouseEvent) => void;
|
|
9
9
|
showCollapseButtons(): void;
|
|
10
|
-
handleBeforeExecCommand: (editor: OnesEditor, command: CommandItem, option: {
|
|
11
|
-
source: string;
|
|
12
|
-
}) => void;
|
|
13
10
|
destroy(): void;
|
|
14
11
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
1
|
export interface EnforceWithDocumentTitleHandlerOptions {
|
|
3
2
|
hideTitle?: boolean;
|
|
4
3
|
headingLevel?: number;
|
|
@@ -6,5 +5,4 @@ export interface EnforceWithDocumentTitleHandlerOptions {
|
|
|
6
5
|
contentPlaceholder?: string | Element;
|
|
7
6
|
readonlyTitlePlaceholder?: string;
|
|
8
7
|
addPlaceholderToAllCurrentEmptyBlock?: boolean;
|
|
9
|
-
applyContentPlaceholder?: (editor: OnesEditor) => boolean;
|
|
10
8
|
}
|
|
@@ -14,7 +14,6 @@ export default class PasteSpecialButton {
|
|
|
14
14
|
private cleaningDoc;
|
|
15
15
|
handlePasteSpecial: (bar: AbstractCommandBar, item: CommandItem) => void;
|
|
16
16
|
handleClose: () => void;
|
|
17
|
-
handleSelectionChange: () => void;
|
|
18
17
|
hide(): void;
|
|
19
18
|
clearCheckedState(): void;
|
|
20
19
|
destroy(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createStatusInput(parent: HTMLElement, defaultValue: string, onChange: ((e: Event) => void), onKeyDown: (e: KeyboardEvent, composing: boolean) => void): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class OverflowTooltipTag {
|
|
3
|
+
private editor;
|
|
4
|
+
constructor(editor: OnesEditor);
|
|
5
|
+
private check;
|
|
6
|
+
private onMouseOver;
|
|
7
|
+
destroy(): void;
|
|
8
|
+
static create(classes: string[], title: string): HTMLAnchorElement;
|
|
9
|
+
static replaceTitleSpace(title: string): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class StatusBoxCommand {
|
|
3
|
+
static id: string;
|
|
4
|
+
static get commands(): CommandItem[];
|
|
5
|
+
static insertStatus(editor: OnesEditor, containerId: string, blockIndex: number): void;
|
|
6
|
+
static insertEmptyBlockStatus(editor: OnesEditor, containerId: string, blockIndex: number): import("@ones-editor/core").BlockElement;
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DocBlockTextOp } from '../../../@ones-editor/core';
|
|
2
|
+
import { StatusBoxData, StatusColor } from './types';
|
|
3
|
+
export declare function recordLastStatusBoxData(box: StatusBoxData): void;
|
|
4
|
+
export declare function getLastStatusBoxTitle(color: StatusColor): string;
|
|
5
|
+
export declare function createEmptyStatusBox(): DocBlockTextOp;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BoxElement, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
import { Popup } from '../../../@ones-editor/ui-base';
|
|
3
|
+
import { StatusColor } from './types';
|
|
4
|
+
import { StatusPalette } from './dom/status-palette';
|
|
5
|
+
export declare class StatusBoxEditor {
|
|
6
|
+
private editor;
|
|
7
|
+
linkPopup: Popup | null;
|
|
8
|
+
boxElement?: BoxElement;
|
|
9
|
+
statusPalette: StatusPalette;
|
|
10
|
+
isEditing: boolean;
|
|
11
|
+
constructor(editor: OnesEditor);
|
|
12
|
+
editorStatus: (boxElement: BoxElement) => void;
|
|
13
|
+
focus(): void;
|
|
14
|
+
handleShow: () => void;
|
|
15
|
+
handClose: () => void;
|
|
16
|
+
handleKeyDown: (e: KeyboardEvent, composing: boolean) => void;
|
|
17
|
+
createPopupContent(title: string, color: StatusColor, subtle: boolean): HTMLDivElement;
|
|
18
|
+
onColorChange: (e: Event) => void;
|
|
19
|
+
onTitleChange: (e: Event) => void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocBox } from '../../../@ones-editor/core';
|
|
2
|
+
export declare const STATUS_COLORS: readonly ["Blue", "Grey", "Yellow", "Red", "Green", "Purple"];
|
|
3
|
+
export type StatusColor = typeof STATUS_COLORS[number];
|
|
4
|
+
export interface StatusBoxData extends DocBox {
|
|
5
|
+
title: string;
|
|
6
|
+
subtle: boolean;
|
|
7
|
+
color: StatusColor;
|
|
8
|
+
}
|