@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.
@@ -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 { BlockElement, BlockPathComponent, OnesEditor } from '../../../@ones-editor/core';
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: (editor: OnesEditor, target: BlockPathComponent, parentBlock?: BlockElement, childBlock?: BlockElement) => void): void;
4
- export declare function untrackChildBlockEvent(editor: OnesEditor, callback: (editor: OnesEditor, target: BlockPathComponent, parentBlock?: BlockElement, childBlock?: BlockElement) => void): void;
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;
@@ -4,3 +4,4 @@ export { OnesEditorHoveringBlock, OnesEditorHoveringBlockFilter, OnesEditorHover
4
4
  export * from './block-helper';
5
5
  export * from './run-once';
6
6
  export * from './find-block';
7
+ export * from './deferred-content';
@@ -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;