@ones-editor/editor 0.0.7-beta.2 → 0.0.7-beta.21

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.
@@ -68,10 +68,6 @@ import 'prismjs/components/prism-visual-basic';
68
68
  import 'prismjs/components/prism-wasm';
69
69
  import 'prismjs/components/prism-yaml';
70
70
  declare const SUPPORTED_LANGUAGES: {
71
- plain: {
72
- name: string;
73
- aliases: string[];
74
- };
75
71
  abap: {
76
72
  name: string;
77
73
  aliases: string[];
@@ -172,6 +168,10 @@ declare const SUPPORTED_LANGUAGES: {
172
168
  name: string;
173
169
  aliases: string[];
174
170
  };
171
+ markup: {
172
+ name: string;
173
+ aliases: string[];
174
+ };
175
175
  java: {
176
176
  name: string;
177
177
  aliases: string[];
@@ -220,10 +220,6 @@ declare const SUPPORTED_LANGUAGES: {
220
220
  name: string;
221
221
  aliases: string[];
222
222
  };
223
- markup: {
224
- name: string;
225
- aliases: string[];
226
- };
227
223
  matlab: {
228
224
  name: string;
229
225
  aliases: string[];
@@ -256,6 +252,10 @@ declare const SUPPORTED_LANGUAGES: {
256
252
  name: string;
257
253
  aliases: string[];
258
254
  };
255
+ plain: {
256
+ name: string;
257
+ aliases: string[];
258
+ };
259
259
  powershell: {
260
260
  name: string;
261
261
  aliases: string[];
@@ -7,4 +7,5 @@ export declare class StandardBlockRenderer implements OnesEditorBlockRenderer {
7
7
  renderText(editor: OnesEditor, path: BlockPath, attributes: AttributeMap): OnesEditorBlockRenderResult;
8
8
  renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
9
9
  updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
10
+ generateCSSCustomProperties(attributes: AttributeMap): OnesEditorBlockRenderResult;
10
11
  }
@@ -1,3 +1,4 @@
1
+ import AttributeMap from 'quill-delta/dist/AttributeMap';
1
2
  import { DocBlock, DocBox } from '../../doc';
2
3
  import { BlockBackgroundElement, BlockContentElement, BlockElement, BlockPath, BlockToolsElement, BoxContentElement, BoxElement, ContainerElement, InsertionContentElement, InsertionElement, OnesEditor } from '../../types';
3
4
  export declare function isBlock(node: Node): node is BlockElement;
@@ -23,7 +24,7 @@ export declare function getBoxId(box: BoxElement): string;
23
24
  export declare function getParentBox(node: Node): BoxElement | null;
24
25
  export declare function createBoxContentElement(boxElement: BoxElement): BoxContentElement;
25
26
  export declare function getBoxContent(box: BoxElement): BoxContentElement;
26
- export declare function createInsertionElement(type: string, id: string): InsertionElement;
27
+ export declare function createInsertionElement(type: string, id: string, attributes?: AttributeMap): InsertionElement;
27
28
  export declare function findInsertionById(editor: OnesEditor, id: string): InsertionElement | null;
28
29
  export declare function createInsertionContentElement(insertionElement: InsertionElement): InsertionContentElement;
29
30
  export declare function getInsertionContent(insertion: InsertionElement): InsertionContentElement;
@@ -4,8 +4,6 @@ export declare class RootContainer {
4
4
  private editor;
5
5
  rootContainer: ContainerElement;
6
6
  resizeObserver: ResizeObserver;
7
- private isMouseDown;
8
- private bindEvent;
9
7
  constructor(editor: OnesEditor, rootContainer: ContainerElement);
10
8
  private bindEvents;
11
9
  private unbindEvents;
@@ -46,7 +46,8 @@ export interface DocBox {
46
46
  export interface DocInsertion {
47
47
  id: string;
48
48
  type: string;
49
- [index: string]: string | boolean | number;
49
+ [index: string]: string | boolean | number | AttributeMap | undefined;
50
+ attributes?: AttributeMap;
50
51
  }
51
52
  export interface DocComment {
52
53
  id: string;
@@ -12,5 +12,6 @@ export default class DropIndicator {
12
12
  show(block: BlockElement, insertPos: DropInsertPos): void;
13
13
  hide(): void;
14
14
  private getIndicatorRect;
15
+ getViewRect(block: BlockElement): DOMRect;
15
16
  }
16
17
  export {};
@@ -19,7 +19,7 @@ export default abstract class GraphBase {
19
19
  createEmbedContent(content: BlockContentElement, block: DocEmbedBlock): void;
20
20
  updateEmbedContent(content: BlockContentElement, block: DocEmbedBlock): void;
21
21
  protected updateImage(embed: HTMLDivElement, code: string | undefined, url: string | undefined | null, err: Error | null): Promise<void>;
22
- protected errorBoundary(embed: HTMLDivElement, code: string | undefined, url: string | undefined | null, reason: 'imageLoadError' | 'grammarError'): void;
22
+ protected errorBoundary(embed: HTMLDivElement, code: string | undefined, url: string | undefined | null, reason: 'imageLoadError' | 'grammarError', error?: Error): void;
23
23
  protected emptyContent(): void;
24
24
  protected updateSpecialClasses(embed: HTMLDivElement, code: string | undefined, err: Error | null): void;
25
25
  editGraph(content: BlockContentElement): void;
@@ -3,6 +3,7 @@ export declare class HeadingBlockCollapseButton implements OnesEditorCustom {
3
3
  private editor;
4
4
  constructor(editor: OnesEditor);
5
5
  handleLoad: () => void;
6
+ handleReadonlyChanged: () => void;
6
7
  handleHoverBlock: (hoveringBlock: BlockElement | null, oldHoveringBlock: BlockElement | null) => void;
7
8
  handleClick: (editor: OnesEditor, event: MouseEvent) => void;
8
9
  showCollapseButtons(): void;
@@ -10,6 +10,7 @@ declare class EnforceWithDocumentTitleHandler implements OnesEditorInputHandler
10
10
  handleRemoteChanged(editor: OnesEditor): void;
11
11
  handleUpdateCompositionText(editor: OnesEditor): void;
12
12
  handleSelectionChange: (editor: OnesEditor) => void;
13
+ private reload;
13
14
  private applyPlaceholder;
14
15
  private isDocumentTitleBlock;
15
16
  }
@@ -11,6 +11,7 @@ export default class PasteSpecialButton {
11
11
  private checkedId;
12
12
  constructor(editor: OnesEditor, onPasteSpecial: OnPasteSpecial);
13
13
  show(docs: OnesEditorDocs): void;
14
+ private cleaningDoc;
14
15
  handlePasteSpecial: (bar: AbstractCommandBar, item: CommandItem) => void;
15
16
  handleClose: () => void;
16
17
  handleSelectionChange: () => void;
@@ -14,3 +14,4 @@ export declare function reCalculateImageDims(dims: (ImageDimWithBuffer | undefin
14
14
  height: number;
15
15
  buffer: ArrayBuffer;
16
16
  }[];
17
+ export declare function calcImagesSize(dims: (ImageDimWithBuffer | undefined)[], maxWidth: number, data?: unknown): void;