@ones-editor/editor 1.1.24 → 1.1.27
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/types.d.ts +2 -2
- package/@ones-editor/find-dialog/src/shortcuts.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/dist/index.js +175 -175
- 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;
|
|
@@ -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;
|
|
@@ -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, };
|
|
@@ -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;
|