@ones-editor/editor 3.1.4-beta.h1447.3 → 3.1.5-beta.ONES22302330.1
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/child-block-tracker/src/event-tracker.d.ts +4 -0
- package/@ones-editor/child-block-tracker/src/index.d.ts +4 -3
- package/@ones-editor/core/src/core/converter/selected-block-to-doc.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/selection-background.d.ts +1 -1
- package/@ones-editor/core/src/core/types.d.ts +1 -1
- package/@ones-editor/core/src/helper/deferred-content.d.ts +6 -0
- package/@ones-editor/core/src/helper/index.d.ts +1 -0
- package/@ones-editor/scroll-container/src/observer/container-intersection-observer.d.ts +1 -0
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +3 -1
- package/@ones-editor/table-block/src/table-block/selection-to-doc.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +258 -48
- package/package.json +1 -1
|
@@ -5,9 +5,13 @@ export interface ChildBlockEvents {
|
|
|
5
5
|
change: (editor: OnesEditor, target: BlockPathComponent, parentBlock: BlockElement, childBlock: BlockElement, action: ChildBlockAction) => void;
|
|
6
6
|
insert: (editor: OnesEditor, target: BlockPathComponent) => void;
|
|
7
7
|
}
|
|
8
|
+
export type ChildBlockListener = (editor: OnesEditor, target: BlockPathComponent, parentBlock?: BlockElement, childBlock?: BlockElement) => void;
|
|
8
9
|
export declare class ChildBlockEventTracker extends TypedEmitter<ChildBlockEvents> implements OnesEditorDocCallbacks {
|
|
9
10
|
private editor;
|
|
11
|
+
private trackedListeners;
|
|
10
12
|
constructor(editor: OnesEditor);
|
|
13
|
+
track(callback: ChildBlockListener): void;
|
|
14
|
+
untrack(callback: ChildBlockListener): void;
|
|
11
15
|
handleChild(containerId: string, blockIndex: number, action: ChildBlockAction): void;
|
|
12
16
|
onUpdateBlockData(containerId: string, blockIndex: number): void;
|
|
13
17
|
onUpdateBlockText(containerId: string, blockIndex: number): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
import type { ChildBlockListener } from './event-tracker';
|
|
2
3
|
export * from './event-tracker';
|
|
3
|
-
export declare function trackChildBlockEvent(editor: OnesEditor, callback:
|
|
4
|
-
export declare function untrackChildBlockEvent(editor: OnesEditor, callback:
|
|
4
|
+
export declare function trackChildBlockEvent(editor: OnesEditor, callback: ChildBlockListener): void;
|
|
5
|
+
export declare function untrackChildBlockEvent(editor: OnesEditor, callback: ChildBlockListener): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocObject } from '../doc';
|
|
2
2
|
import { OnesEditor, SelectedBlock } from '../types';
|
|
3
|
-
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock): DocObject;
|
|
3
|
+
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock, getSourceDoc?: () => DocObject): DocObject;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OnesEditor } from '../types';
|
|
1
|
+
import type { OnesEditor } from '../types';
|
|
2
2
|
export declare function updateSelectionBackground(editor: OnesEditor): void;
|
|
@@ -281,7 +281,7 @@ export interface Block {
|
|
|
281
281
|
offset: number;
|
|
282
282
|
data?: DocBlockAttributes;
|
|
283
283
|
}) => ConvertBlockResult | null;
|
|
284
|
-
selectionToDoc?: (editor: OnesEditor, selectedBlock: SelectedBlock) => DocObject;
|
|
284
|
+
selectionToDoc?: (editor: OnesEditor, selectedBlock: SelectedBlock, getSourceDoc?: () => DocObject) => DocObject;
|
|
285
285
|
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown', path: BlockPath) => string;
|
|
286
286
|
toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject) => Promise<DocObject | undefined>;
|
|
287
287
|
getBlockStyles?: (editor: OnesEditor, block: BlockElement) => BlockStyles;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BlockElement, OnesEditor } from '../core/types';
|
|
2
|
+
export declare function renderDeferredBlock(block: HTMLElement): void;
|
|
3
|
+
export declare function deferBlockContent(editor: OnesEditor, block: BlockElement, ids: string[], render: () => void): void;
|
|
4
|
+
export declare function renderDeferredContents(editor: OnesEditor): void;
|
|
5
|
+
export declare function removeDeferredBlock(editor: OnesEditor, block: HTMLElement): void;
|
|
6
|
+
export declare function renderDeferredId(editor: OnesEditor, id: string): void;
|
|
@@ -3,6 +3,7 @@ export declare class ContainerIntersectionObserver {
|
|
|
3
3
|
private scrollCore;
|
|
4
4
|
private callback;
|
|
5
5
|
private intersectionObserver;
|
|
6
|
+
private intersecting;
|
|
6
7
|
constructor(scrollCore: ScrollCore, callback: (entry: IntersectionObserverEntry) => void);
|
|
7
8
|
private get containers();
|
|
8
9
|
private handleIntersection;
|
|
@@ -15,7 +15,9 @@ export declare class ScrollListener extends TypedEmitter<ChildEvents> implements
|
|
|
15
15
|
private scrollWrapResizeObserve;
|
|
16
16
|
private locatingContainerResizeObserver;
|
|
17
17
|
private isWindowEventBind;
|
|
18
|
+
private boundContainers;
|
|
18
19
|
containers: ScrollCore['containers'];
|
|
20
|
+
private containerCallbacks;
|
|
19
21
|
constructor(parentContainer: ParentContainerElement);
|
|
20
22
|
private load;
|
|
21
23
|
private handleScrollContainerScroll;
|
|
@@ -26,7 +28,7 @@ export declare class ScrollListener extends TypedEmitter<ChildEvents> implements
|
|
|
26
28
|
private getScrollContainerInViewable;
|
|
27
29
|
private unbindCore;
|
|
28
30
|
private bindCore;
|
|
29
|
-
bind(container: ContainerElement, option: ScrollContainerOptions): void;
|
|
31
|
+
bind(container: ContainerElement, option: ScrollContainerOptions, callbacks?: ChildEvents): void;
|
|
30
32
|
unbind(container: ContainerElement): void;
|
|
31
33
|
destroy(): void;
|
|
32
34
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DocObject, OnesEditor, SelectedBlock } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function selectionToDoc(editor: OnesEditor, selectedBlock: SelectedBlock): DocObject;
|
|
2
|
+
export declare function selectionToDoc(editor: OnesEditor, selectedBlock: SelectedBlock, getSourceDoc?: () => DocObject): DocObject;
|