@ones-editor/editor 1.1.23 → 1.1.24-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.
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -1
- package/@ones-editor/core/src/core/doc/apply-data-delta.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/doc.d.ts +22 -1
- package/@ones-editor/core/src/core/editor/actions/update-block-data.d.ts +2 -2
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/editor-selection.d.ts +3 -1
- package/@ones-editor/core/src/core/types.d.ts +5 -3
- package/@ones-editor/find-dialog/src/shortcuts.d.ts +2 -0
- package/@ones-editor/input-handlers/src/enforce-with-document-title/enforce-with-document-title-handler.d.ts +1 -0
- package/@ones-editor/input-handlers/src/enforce-with-document-title/placeholder.d.ts +1 -0
- package/@ones-editor/list-block/src/converter/selection-to-doc.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar-handler.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +2 -0
- package/@ones-editor/versions/src/types.d.ts +1 -1
- package/dist/index.js +177 -177
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
-
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
|
|
3
|
+
import type { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
|
|
4
4
|
import { MiniGroupList } from './group-list';
|
|
5
5
|
interface MiniCommentsListEvents {
|
|
6
6
|
onMiniCommentClose: () => void;
|
|
@@ -23,11 +23,32 @@ export type DocBlockTextActions = DocBlockTextActionOp[];
|
|
|
23
23
|
export type DocBlockAttributes = {
|
|
24
24
|
[index: string]: unknown;
|
|
25
25
|
};
|
|
26
|
+
export type ExportDSpecText = {
|
|
27
|
+
type: 'text';
|
|
28
|
+
data: string;
|
|
29
|
+
};
|
|
30
|
+
export type ExportDSpecImage = {
|
|
31
|
+
type: 'image';
|
|
32
|
+
data: string;
|
|
33
|
+
};
|
|
34
|
+
export type ExportDSpecLink = {
|
|
35
|
+
type: 'link';
|
|
36
|
+
data: {
|
|
37
|
+
url: string;
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type ExportDSpecBlock = {
|
|
42
|
+
type: 'block';
|
|
43
|
+
data: string[];
|
|
44
|
+
};
|
|
45
|
+
export type DocExportSpec = ExportDSpecText | ExportDSpecImage | ExportDSpecLink | ExportDSpecBlock;
|
|
26
46
|
export type DocBlock = {
|
|
27
47
|
type: string;
|
|
28
48
|
id: string;
|
|
29
49
|
text?: DocBlockText;
|
|
30
50
|
children?: string[];
|
|
51
|
+
exportSpec?: DocExportSpec[];
|
|
31
52
|
} & DocBlockAttributes;
|
|
32
53
|
export type DocEmbedData = {
|
|
33
54
|
[index: string]: unknown;
|
|
@@ -206,7 +227,7 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
|
|
|
206
227
|
findContainerBlocks: (containerId: string) => DocBlock[] | null;
|
|
207
228
|
getBlockData: (containerId: string, blockIndex: number) => DocBlock;
|
|
208
229
|
localUpdateBlockText: (containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions) => DocBlockText;
|
|
209
|
-
localUpdateBlockData: (containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange) => DocBlock;
|
|
230
|
+
localUpdateBlockData: (containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange, options?: UpdateBlockOptions) => DocBlock;
|
|
210
231
|
localInsertBlock: (containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions) => DocBlock;
|
|
211
232
|
localDeleteBlock: (containerId: string, blockIndex: number, newRange: OnesEditorDocRange) => DocBlock;
|
|
212
233
|
localInsertChildContainers: (containers: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocBlock, DocBlockAttributes, DocEmbedData, OnesEditorDocRange } from '../../doc';
|
|
1
|
+
import { DocBlock, DocBlockAttributes, DocEmbedData, OnesEditorDocRange, UpdateBlockOptions } from '../../doc';
|
|
2
2
|
import { BlockElement, OnesEditor, SelectionRange } from '../../types';
|
|
3
|
-
export declare function editorUpdateBlockData(editor: OnesEditor, block: BlockElement, data: DocBlockAttributes, newRange: OnesEditorDocRange): DocBlock;
|
|
3
|
+
export declare function editorUpdateBlockData(editor: OnesEditor, block: BlockElement, data: DocBlockAttributes, newRange: OnesEditorDocRange, options?: UpdateBlockOptions): DocBlock;
|
|
4
4
|
export declare function editorUpdateEmbedData(editor: OnesEditor, block: BlockElement, data: DocEmbedData, newRange?: SelectionRange): DocBlock;
|
|
@@ -16,7 +16,7 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
|
|
|
16
16
|
getBlockData(containerId: string, blockIndex: number): DocBlock;
|
|
17
17
|
verifyBlockWritable(containerId: string, blockIndex: number): void;
|
|
18
18
|
localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions): DocBlockText;
|
|
19
|
-
localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange): DocBlock;
|
|
19
|
+
localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange, options?: UpdateBlockOptions): DocBlock;
|
|
20
20
|
localInsertBlock(containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions): DocBlock;
|
|
21
21
|
localDeleteBlock(containerId: string, blockIndex: number, newRange: OnesEditorDocRange): DocBlock;
|
|
22
22
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
@@ -17,7 +17,9 @@ export declare class EditorSelection implements OnesEditorSelection {
|
|
|
17
17
|
selectBlock(block: BlockElement, start: number, end?: number, options?: ChangeSelectionOptions): void;
|
|
18
18
|
setSelection(anchor: BlockPosition, focus?: BlockPosition, options?: ChangeSelectionOptions): SelectionRange;
|
|
19
19
|
setRange(range: SelectionRange, options?: ChangeSelectionOptions): SelectionRange;
|
|
20
|
-
updateSelection(
|
|
20
|
+
updateSelection(oldRange: SelectionRange | null, options?: {
|
|
21
|
+
focusBlockChanged: boolean;
|
|
22
|
+
}): void;
|
|
21
23
|
getFocusedPos(): BlockPosition;
|
|
22
24
|
getAnchorPos(): BlockPosition;
|
|
23
25
|
selectionChanging(anchor: BlockPosition, focus: BlockPosition): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import { DocBlock, DocBlockAttributes, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, InsertBlockOptions, OnesEditorDoc, OnesEditorDocRange } from './doc';
|
|
2
|
+
import { DocBlock, DocBlockAttributes, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, InsertBlockOptions, OnesEditorDoc, OnesEditorDocRange, UpdateBlockOptions } from './doc';
|
|
3
3
|
export type ContainerElement = HTMLDivElement & {
|
|
4
4
|
__neverUse: 'ContainerElement';
|
|
5
5
|
};
|
|
@@ -550,7 +550,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
550
550
|
insertDocAt: (container: ContainerElement, blockIndex: number, doc: DocObject, cloneDocResult?: CloneBlockResultInfo) => BlockElement[];
|
|
551
551
|
pasteDoc: (doc: DocObject) => Promise<void>;
|
|
552
552
|
deleteChildContainers: (containerIds: string[]) => void;
|
|
553
|
-
updateBlockData: (block: BlockElement, data: DocBlockAttributes, newRange?: SelectionRange) => DocBlock;
|
|
553
|
+
updateBlockData: (block: BlockElement, data: DocBlockAttributes, newRange?: SelectionRange, options?: UpdateBlockOptions) => DocBlock;
|
|
554
554
|
updateEmbedData: (block: BlockElement, data: DocEmbedData, newRange?: SelectionRange) => DocBlock;
|
|
555
555
|
updateBoxData: (boxData: DocBox, options?: InsertTextOptions) => void;
|
|
556
556
|
updateCompositionText: (text: string, end: boolean) => void;
|
|
@@ -568,7 +568,9 @@ export interface OnesEditorSelection {
|
|
|
568
568
|
setSelection: (anchor: BlockPosition, focus?: BlockPosition, options?: ChangeSelectionOptions) => SelectionRange;
|
|
569
569
|
setRange: (range: SelectionRange, options?: ChangeSelectionOptions) => SelectionRange;
|
|
570
570
|
selectBlock: (block: BlockElement, start: number, end?: number, options?: ChangeSelectionOptions) => void;
|
|
571
|
-
updateSelection: (old: SelectionRange | null
|
|
571
|
+
updateSelection: (old: SelectionRange | null, options?: {
|
|
572
|
+
focusBlockChanged: boolean;
|
|
573
|
+
}) => void;
|
|
572
574
|
updateLastCaretRect: () => void;
|
|
573
575
|
getSuggestedCaretX: () => number | undefined;
|
|
574
576
|
getAnchorPos: () => BlockPosition;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
import './locale';
|
|
3
3
|
export declare function handleFindReplace(editor: OnesEditor): boolean;
|
|
4
|
+
declare function handleReplaceAndFind(editor: OnesEditor): boolean;
|
|
4
5
|
declare const FindReplaceShortcuts: {
|
|
5
6
|
'CtrlOrCmd+F': typeof handleFindReplace;
|
|
7
|
+
'CtrlOrCmd+Shift+H': typeof handleReplaceAndFind;
|
|
6
8
|
};
|
|
7
9
|
export { FindReplaceShortcuts, };
|
|
@@ -12,6 +12,7 @@ declare class EnforceWithDocumentTitleHandler implements OnesEditorInputHandler
|
|
|
12
12
|
handleSelectionChange: (editor: OnesEditor) => void;
|
|
13
13
|
private reload;
|
|
14
14
|
private applyPlaceholder;
|
|
15
|
+
private removePlaceholder;
|
|
15
16
|
private isDocumentTitleBlock;
|
|
16
17
|
}
|
|
17
18
|
export default EnforceWithDocumentTitleHandler;
|
|
@@ -3,4 +3,5 @@ import { EnforceWithDocumentTitleHandlerOptions } from './types';
|
|
|
3
3
|
export declare function isEmptyTextBlockWithoutCompositionText(editor: OnesEditor, block: BlockElement): boolean;
|
|
4
4
|
export declare function removePlaceholderFromBlock(editor: OnesEditor, block: BlockElement): void;
|
|
5
5
|
export declare function applyPlaceholderToBlock(editor: OnesEditor, block: BlockElement, placeholder: string | Element): void;
|
|
6
|
+
export declare function removeAllPlaceholders(editor: OnesEditor): void;
|
|
6
7
|
export declare function applyPlaceholder(editor: OnesEditor, options: EnforceWithDocumentTitleHandlerOptions): void;
|
|
@@ -10,6 +10,7 @@ export declare class TableBlockBorderHandler {
|
|
|
10
10
|
show(tableBlock: BlockElement): void;
|
|
11
11
|
update(): void;
|
|
12
12
|
closeToolbar(): void;
|
|
13
|
+
isInBlock: (block: BlockElement, event: MouseEvent) => boolean;
|
|
13
14
|
hide(): void;
|
|
14
15
|
}
|
|
15
16
|
export declare function handleTableBorderBar(editor: OnesEditor, type: 'create' | 'update'): void;
|