@ones-editor/editor 1.1.17-beta.3 → 1.1.17-beta.4

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.
Files changed (38) hide show
  1. package/@ones-editor/code-block/src/code-block/languages.d.ts +1 -1
  2. package/@ones-editor/code-block/src/locale/en-us.d.ts +1 -0
  3. package/@ones-editor/code-block/src/locale/ja-jp.d.ts +1 -0
  4. package/@ones-editor/code-block/src/locale/zh-cn.d.ts +1 -0
  5. package/@ones-editor/comments/src/comment-quick-reply/index.d.ts +1 -0
  6. package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -1
  7. package/@ones-editor/comments/src/comments-render/index.d.ts +1 -0
  8. package/@ones-editor/context-menu/src/menu/index.d.ts +1 -0
  9. package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +2 -1
  10. package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -0
  11. package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +1 -0
  12. package/@ones-editor/core/src/core/editor/actions/update-block-text.d.ts +3 -3
  13. package/@ones-editor/core/src/core/editor/actions/update-box-data.d.ts +2 -2
  14. package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -0
  15. package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -1
  16. package/@ones-editor/core/src/core/types.d.ts +4 -1
  17. package/@ones-editor/core/src/utils/dom.d.ts +4 -0
  18. package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +1 -0
  19. package/@ones-editor/status/package.json +7 -0
  20. package/@ones-editor/status/src/dom/input.d.ts +1 -0
  21. package/@ones-editor/status/src/dom/overflow-tooltip-tag.d.ts +10 -0
  22. package/@ones-editor/status/src/dom/status-palette.d.ts +6 -0
  23. package/@ones-editor/status/src/index.d.ts +4 -0
  24. package/@ones-editor/status/src/locale/en-us.d.ts +25 -0
  25. package/@ones-editor/status/src/locale/index.d.ts +1 -0
  26. package/@ones-editor/status/src/locale/ja-jp.d.ts +25 -0
  27. package/@ones-editor/status/src/locale/zh-cn.d.ts +25 -0
  28. package/@ones-editor/status/src/status-box-command.d.ts +7 -0
  29. package/@ones-editor/status/src/status-box-data.d.ts +5 -0
  30. package/@ones-editor/status/src/status-box-editor.d.ts +21 -0
  31. package/@ones-editor/status/src/status-box.d.ts +4 -0
  32. package/@ones-editor/status/src/types.d.ts +8 -0
  33. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  34. package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
  35. package/@ones-editor/ui-base/src/input/create-input.d.ts +3 -2
  36. package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +2 -1
  37. package/dist/index.js +210 -199
  38. package/package.json +2 -1
@@ -67,7 +67,7 @@ import 'prismjs/components/prism-vhdl';
67
67
  import 'prismjs/components/prism-visual-basic';
68
68
  import 'prismjs/components/prism-wasm';
69
69
  import 'prismjs/components/prism-yaml';
70
- declare const SUPPORTED_LANGUAGES: {
70
+ declare const SUPPORTED_LANGUAGES: () => {
71
71
  abap: {
72
72
  name: string;
73
73
  aliases: string[];
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  caption: string;
8
8
  search: string;
9
9
  copySuccess: string;
10
+ plainText: string;
10
11
  };
11
12
  };
12
13
  export default _default;
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  caption: string;
8
8
  search: string;
9
9
  copySuccess: string;
10
+ plainText: string;
10
11
  };
11
12
  };
12
13
  export default _default;
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  caption: string;
8
8
  search: string;
9
9
  copySuccess: string;
10
+ plainText: string;
10
11
  };
11
12
  };
12
13
  export default _default;
@@ -21,4 +21,5 @@ export declare class CommentQuickReply {
21
21
  cancel: () => void;
22
22
  hide: () => void;
23
23
  show: () => void;
24
+ destroy(): void;
24
25
  }
@@ -1,6 +1,6 @@
1
1
  import { OnesEditor } from '../../../../../@ones-editor/core';
2
2
  import { TypedEmitter } from 'tiny-typed-emitter';
3
- import type { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
3
+ import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../..';
4
4
  import { MiniGroupList } from './group-list';
5
5
  interface MiniCommentsListEvents {
6
6
  onMiniCommentClose: () => void;
@@ -1,6 +1,7 @@
1
1
  import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
2
2
  export declare class OnesEditorCommentsRender implements OnesEditorBlockRenderer {
3
3
  renderText(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
4
+ renderBox(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
4
5
  renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
5
6
  updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
6
7
  }
@@ -12,6 +12,7 @@ declare class OnesEditorContextMenu implements OnesEditorCustom {
12
12
  private isInEditor;
13
13
  private handleContextMenuShown;
14
14
  private handleContextMenuClick;
15
+ private handleContextMenuClose;
15
16
  private handleImageEmbedAction;
16
17
  }
17
18
  export default OnesEditorContextMenu;
@@ -2,8 +2,9 @@ import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlock
2
2
  export declare function complexBlockGetAllChildContainers(editor: OnesEditor, block: BlockElement, options?: GetChildContainerOptions): ContainerElement[];
3
3
  export declare function complexBlockGetSelectedContainers(editor: OnesEditor, block: BlockElement, start: BlockPosition, end: BlockPosition): ContainerElement[];
4
4
  export declare function isFirstChildBlockInComplexBlock(editor: OnesEditor, childBlock: BlockElement): boolean;
5
- export declare function complexBlockGeFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
5
+ export declare function complexBlockGetFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
6
6
  export declare function complexBlockGetLastSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
7
+ export declare function complexBlockGetDeepFirstChild(editor: OnesEditor, container: ContainerElement): BlockElement | null;
7
8
  export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEditor, childContainer: ContainerElement, options?: GetChildContainerOptions): BlockElement | null;
8
9
  export declare function complexBlockGetTopChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
9
10
  export declare function complexBlockGetBottomChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
@@ -27,6 +27,7 @@ export declare class EditorInput implements OnesEditorInput {
27
27
  callbacks: EditorInputCallbacks;
28
28
  inputElement: HTMLInputElement;
29
29
  constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
30
+ private isInCommandbar;
30
31
  destroy(): void;
31
32
  getInput(): HTMLInputElement;
32
33
  focus(): void;
@@ -5,6 +5,7 @@ export declare const TEXT_STYLE_BACKGROUND_COLOR_PREFIX = "style-bg-color-";
5
5
  export declare function addAttribute(text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
6
6
  export declare function removeAttribute(text: DocBlockText, key: string, value: unknown, options?: {
7
7
  ignoreValue: boolean;
8
+ handleBox?: boolean;
8
9
  }): DocBlockText;
9
10
  export declare function rangeAddAttribute(offset: number, length: number, text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
10
11
  export declare function rangeRemoveAttribute(offset: number, length: number, text: DocBlockText, key: string, value: unknown, options?: {
@@ -1,4 +1,4 @@
1
- import { OnesEditor, BlockElement } from '../../types';
1
+ import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
2
2
  import { DocBlockText, DocBlockTextActions } from '../../doc';
3
- export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions): DocBlockText;
4
- export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText): void;
3
+ export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions, options?: InsertTextOptions): DocBlockText;
4
+ export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText, options?: InsertTextOptions): void;
@@ -1,3 +1,3 @@
1
- import { OnesEditor } from '../../types';
1
+ import { InsertTextOptions, OnesEditor } from '../../types';
2
2
  import { DocBox } from '../../doc';
3
- export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox): void;
3
+ export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox, options?: InsertTextOptions): void;
@@ -34,6 +34,7 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
34
34
  onCustomMessage(msg: unknown): void;
35
35
  onStatusChanged(status: OnesEditorDocStatus): void;
36
36
  onError(error: Error): void;
37
+ onAuthRecover(): void;
37
38
  uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
38
39
  addResources(resourceIds: string[]): Promise<string[]>;
39
40
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="lodash" />
1
2
  import { EditorInputCallbacks } from '../composition/editor-input';
2
3
  import { OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
3
4
  import { DocObject } from '../doc';
@@ -18,7 +19,8 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
18
19
  onPaste(event: ClipboardEvent): void;
19
20
  onPasteText: (text: string, options?: PasteOptions) => Promise<void>;
20
21
  onFocus(): void;
21
- onBlur(): void;
22
+ onBlur: import("lodash").DebouncedFunc<() => void>;
23
+ removeActiveForBlur: import("lodash").DebouncedFunc<() => void>;
22
24
  addHandler(handler: OnesEditorInputHandler): void;
23
25
  removeHandler(handler: OnesEditorInputHandler): void;
24
26
  handleBeforeInsertText(containerId: string, blockIndex: number, offset: number, text: string): boolean;
@@ -398,6 +398,7 @@ export interface OnesEditorOptionalOptions {
398
398
  colors?: string[];
399
399
  scrollContainer?: HTMLElement;
400
400
  enableComments?: boolean;
401
+ enableContextMenu?: boolean;
401
402
  settingsProvider?: OnesEditorSettingsProvider;
402
403
  }
403
404
  export interface OnesEditorOptions {
@@ -406,6 +407,7 @@ export interface OnesEditorOptions {
406
407
  [index: string]: unknown;
407
408
  };
408
409
  enableComments?: boolean;
410
+ enableContextMenu?: boolean;
409
411
  scrollContainer?: HTMLElement;
410
412
  }
411
413
  export interface OnesEditorComponents {
@@ -447,6 +449,7 @@ export type OnesEditorCustomCreator = (editor: OnesEditor) => OnesEditorCustom;
447
449
  export interface CloneBlockResultInfo {
448
450
  containerIdMap: Map<string, string>;
449
451
  blockIdMap: Map<string, string>;
452
+ boxIdMap: Map<string, string>;
450
453
  }
451
454
  export interface OnesEditorDomEvents extends OnesEditorCustom {
452
455
  addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
@@ -548,7 +551,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
548
551
  deleteChildContainers: (containerIds: string[]) => void;
549
552
  updateBlockData: (block: BlockElement, data: DocBlockAttributes, newRange?: SelectionRange) => DocBlock;
550
553
  updateEmbedData: (block: BlockElement, data: DocEmbedData, newRange?: SelectionRange) => DocBlock;
551
- updateBoxData: (boxData: DocBox) => void;
554
+ updateBoxData: (boxData: DocBox, options?: InsertTextOptions) => void;
552
555
  updateCompositionText: (text: string, end: boolean) => void;
553
556
  getColor: (index: number, type?: string) => string;
554
557
  }
@@ -33,4 +33,8 @@ export declare function findTarget(event: Event, cssSelector: string): Element |
33
33
  export declare function findEventTargetBlock(event: Event): Element | null;
34
34
  export declare function isElementVisible(element: Element | null): boolean;
35
35
  export declare function getElementScale(element: Element): number;
36
+ export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaElement, callback: (event: KeyboardEvent, composing: boolean) => void): () => void;
37
+ export declare function getElementFromPoint(x: number, y: number, options?: {
38
+ noFilter: boolean;
39
+ }): Element;
36
40
  export {};
@@ -27,6 +27,7 @@ export declare class AuthConnection {
27
27
  }>;
28
28
  logout(): Promise<void>;
29
29
  init(auth: AuthMessage): Promise<void>;
30
+ reConnect(token: string): Promise<void>;
30
31
  handleAuthError(): Promise<void>;
31
32
  reAuth: () => Promise<void>;
32
33
  private emitPermissionError;
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@ones-editor/status",
3
+ "version": "1.0.0",
4
+ "main": "./src/index.js",
5
+ "license": "MIT",
6
+ "types": "src/index.d.ts"
7
+ }
@@ -0,0 +1 @@
1
+ export declare function createStatusInput(parent: HTMLElement, defaultValue: string, onChange: ((e: Event) => void), onKeyDown: (e: KeyboardEvent, composing: boolean) => void): void;
@@ -0,0 +1,10 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ export declare class OverflowTooltipTag {
3
+ private editor;
4
+ constructor(editor: OnesEditor);
5
+ private check;
6
+ private onMouseOver;
7
+ destroy(): void;
8
+ static create(classes: string[], title: string): HTMLAnchorElement;
9
+ static replaceTitleSpace(title: string): string;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { StatusColor } from '../types';
2
+ export declare function createPalette(): HTMLDivElement;
3
+ export declare class StatusPalette {
4
+ root: HTMLElement;
5
+ changeColor: (color: StatusColor) => void;
6
+ }
@@ -0,0 +1,4 @@
1
+ import StatusBox from './status-box';
2
+ import { StatusBoxCommand } from './status-box-command';
3
+ import './locale';
4
+ export { StatusBox, StatusBoxCommand, };
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ status: {
3
+ empty: string;
4
+ command: {
5
+ name: string;
6
+ };
7
+ color: {
8
+ red: string;
9
+ yellow: string;
10
+ green: string;
11
+ blue: string;
12
+ purple: string;
13
+ grey: string;
14
+ };
15
+ colorDefaultTitle: {
16
+ red: string;
17
+ yellow: string;
18
+ green: string;
19
+ blue: string;
20
+ purple: string;
21
+ grey: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ status: {
3
+ empty: string;
4
+ command: {
5
+ name: string;
6
+ };
7
+ color: {
8
+ red: string;
9
+ yellow: string;
10
+ green: string;
11
+ blue: string;
12
+ purple: string;
13
+ grey: string;
14
+ };
15
+ colorDefaultTitle: {
16
+ red: string;
17
+ yellow: string;
18
+ green: string;
19
+ blue: string;
20
+ purple: string;
21
+ grey: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ status: {
3
+ empty: string;
4
+ command: {
5
+ name: string;
6
+ };
7
+ color: {
8
+ red: string;
9
+ yellow: string;
10
+ green: string;
11
+ blue: string;
12
+ purple: string;
13
+ grey: string;
14
+ };
15
+ colorDefaultTitle: {
16
+ red: string;
17
+ yellow: string;
18
+ green: string;
19
+ blue: string;
20
+ purple: string;
21
+ grey: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare class StatusBoxCommand {
3
+ static id: string;
4
+ static get commands(): CommandItem[];
5
+ static insertStatus(editor: OnesEditor, containerId: string, blockIndex: number): void;
6
+ static insertEmptyBlockStatus(editor: OnesEditor, containerId: string, blockIndex: number): import("@ones-editor/core").BlockElement;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { DocBlockTextOp } from '../../../@ones-editor/core';
2
+ import { StatusBoxData, StatusColor } from './types';
3
+ export declare function recordLastStatusBoxData(box: StatusBoxData): void;
4
+ export declare function getLastStatusBoxTitle(color: StatusColor): string;
5
+ export declare function createEmptyStatusBox(): DocBlockTextOp;
@@ -0,0 +1,21 @@
1
+ import { BoxElement, OnesEditor } from '../../../@ones-editor/core';
2
+ import { Popup } from '../../../@ones-editor/ui-base';
3
+ import { StatusColor } from './types';
4
+ import { StatusPalette } from './dom/status-palette';
5
+ export declare class StatusBoxEditor {
6
+ private editor;
7
+ linkPopup: Popup | null;
8
+ boxElement?: BoxElement;
9
+ statusPalette: StatusPalette;
10
+ isEditing: boolean;
11
+ constructor(editor: OnesEditor);
12
+ editorStatus: (boxElement: BoxElement) => void;
13
+ focus(): void;
14
+ handleShow: () => void;
15
+ handClose: () => void;
16
+ handleKeyDown: (e: KeyboardEvent, composing: boolean) => void;
17
+ createPopupContent(title: string, color: StatusColor, subtle: boolean): HTMLDivElement;
18
+ onColorChange: (e: Event) => void;
19
+ onTitleChange: (e: Event) => void;
20
+ destroy(): void;
21
+ }
@@ -0,0 +1,4 @@
1
+ import { Box } from '../../../@ones-editor/core';
2
+ import './status-box.scss';
3
+ declare const StatusBox: Box;
4
+ export default StatusBox;
@@ -0,0 +1,8 @@
1
+ import { DocBox } from '../../../@ones-editor/core';
2
+ export declare const STATUS_COLORS: readonly ["Blue", "Grey", "Yellow", "Red", "Green", "Purple"];
3
+ export type StatusColor = typeof STATUS_COLORS[number];
4
+ export interface StatusBoxData extends DocBox {
5
+ title: string;
6
+ subtle: boolean;
7
+ color: StatusColor;
8
+ }