@ones-editor/editor 2.1.1-beta.62 → 2.1.1-beta.63
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/core/src/core/types.d.ts +1 -0
- package/@ones-editor/core/src/utils/dom.d.ts +1 -1
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +3 -6
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +1 -1
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/link-popup/mobile-link-popup.d.ts +22 -0
- package/@ones-editor/ui/src/link-popup/types.d.ts +34 -0
- package/@ones-editor/ui/src/link-popup/web-link-popup.d.ts +19 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -2
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -1
- package/@ones-editor/ui-base/src/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +0 -1
- package/@ones-editor/ui-base/src/mobile-command-bar/scroll-into-view.d.ts +3 -0
- package/dist/index.js +1194 -1075
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './index.scss';
|
|
2
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
4
|
+
import { LinkEditorEvents, LinkEditorOptions, LinkPopupType } from './types';
|
|
5
|
+
export declare class MobileLinkPopup extends TypedEmitter<LinkEditorEvents> implements LinkPopupType {
|
|
6
|
+
private editor;
|
|
7
|
+
private content;
|
|
8
|
+
private options;
|
|
9
|
+
private linkPopup;
|
|
10
|
+
private onShow;
|
|
11
|
+
constructor(editor: OnesEditor, content: HTMLElement, options: LinkEditorOptions);
|
|
12
|
+
close: () => void;
|
|
13
|
+
private createItems;
|
|
14
|
+
private createHeader;
|
|
15
|
+
handleOk: () => void;
|
|
16
|
+
handleClose: () => void;
|
|
17
|
+
handleShown: () => void;
|
|
18
|
+
disabledSubmit: () => void;
|
|
19
|
+
enableSubmit: () => void;
|
|
20
|
+
manualShow: () => void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Placement } from '../../../../@ones-editor/ui-base';
|
|
2
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
+
export interface FormField {
|
|
4
|
+
getInputValue: () => string;
|
|
5
|
+
setFieldError: (error: string) => void;
|
|
6
|
+
getField: () => HTMLElement;
|
|
7
|
+
}
|
|
8
|
+
export interface Form {
|
|
9
|
+
[key: string]: FormField;
|
|
10
|
+
}
|
|
11
|
+
export type OnFinished = (linkText: string, linkUrl: string) => void;
|
|
12
|
+
export type OnClose = () => void;
|
|
13
|
+
export type OnBeforeFormatUrl = (linkUrl: string) => string | false;
|
|
14
|
+
export interface LinkEditorOptions {
|
|
15
|
+
target: HTMLElement;
|
|
16
|
+
linkText: string;
|
|
17
|
+
linkUrl: string;
|
|
18
|
+
onFinished: OnFinished;
|
|
19
|
+
onClose?: OnClose;
|
|
20
|
+
onBeforeFormatUrl?: OnBeforeFormatUrl;
|
|
21
|
+
placement?: Placement;
|
|
22
|
+
}
|
|
23
|
+
export interface LinkEditorEvents {
|
|
24
|
+
show: () => void;
|
|
25
|
+
finished: () => void;
|
|
26
|
+
close: () => void;
|
|
27
|
+
}
|
|
28
|
+
export interface LinkPopupType extends TypedEmitter<LinkEditorEvents> {
|
|
29
|
+
disabledSubmit: () => void;
|
|
30
|
+
enableSubmit: () => void;
|
|
31
|
+
destroy: () => void;
|
|
32
|
+
close: () => void;
|
|
33
|
+
manualShow: () => void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
+
import { LinkEditorEvents, LinkEditorOptions, LinkPopupType } from './types';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export declare class LinkPopup extends TypedEmitter<LinkEditorEvents> implements LinkPopupType {
|
|
5
|
+
private content;
|
|
6
|
+
private options;
|
|
7
|
+
private linkPopup;
|
|
8
|
+
private onShow;
|
|
9
|
+
constructor(content: HTMLElement, options: LinkEditorOptions);
|
|
10
|
+
private createPopupContent;
|
|
11
|
+
handleOk: () => void;
|
|
12
|
+
handleClose: () => void;
|
|
13
|
+
close: () => void;
|
|
14
|
+
disabledSubmit: () => void;
|
|
15
|
+
enableSubmit: () => void;
|
|
16
|
+
manualShow: () => void;
|
|
17
|
+
static showPopup: (content: HTMLElement, options: LinkEditorOptions) => LinkPopup;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -25,6 +25,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
25
25
|
handleDocumentKeydown: (event: KeyboardEvent) => boolean;
|
|
26
26
|
protected handleDocumentMouseDown: (event: MouseEvent) => void;
|
|
27
27
|
protected handleHidden: () => void;
|
|
28
|
+
protected handleShown: () => void;
|
|
28
29
|
protected handleShow: () => void;
|
|
29
30
|
get popper(): Element | null;
|
|
30
31
|
private getSelectedItemIndex;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { CommandItem } from '../../../../@ones-editor/core';
|
|
2
2
|
import CommandBar from './command-bar';
|
|
3
|
-
import {
|
|
3
|
+
import { CommandBarOptions, CommandItemElement, ManualShowCommandBarOptions } from './types';
|
|
4
4
|
export default class FixedToolbar extends CommandBar {
|
|
5
5
|
constructor(parent: HTMLElement, items: CommandItem[], options?: CommandBarOptions);
|
|
6
6
|
protected initCommandBarElement(elem: HTMLElement): void;
|
|
7
7
|
protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
|
|
8
8
|
close(): void;
|
|
9
|
-
onShown: (instance: AbstractManualCommandBar) => void;
|
|
10
9
|
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
11
10
|
destroy(): void;
|
|
12
11
|
protected getCommandBarRoot(): HTMLElement | null;
|
|
@@ -4,10 +4,12 @@ import type { GetReferenceClientRect, Placement } from 'tippy.js';
|
|
|
4
4
|
export { Placement };
|
|
5
5
|
export interface CommandBarEvents {
|
|
6
6
|
'show': (bar: AbstractCommandBar) => void;
|
|
7
|
+
'shown': (bar: AbstractCommandBar) => void;
|
|
7
8
|
'click': (bar: AbstractCommandBar, item: CommandItem, elem: HTMLElement) => void;
|
|
8
9
|
'close': (bar: AbstractCommandBar) => void;
|
|
9
10
|
'selectionChange': (bar: AbstractCommandBar, id: string) => void;
|
|
10
11
|
'closing': (bar: AbstractCommandBar, event: MouseEvent) => boolean | undefined;
|
|
12
|
+
'subBarShown': (bar: AbstractCommandBar, subBar: AbstractCommandBar) => void;
|
|
11
13
|
}
|
|
12
14
|
export interface ManualShowCommandBarOptions {
|
|
13
15
|
placement?: Placement;
|
|
@@ -19,7 +21,6 @@ export interface ManualShowCommandBarOptions {
|
|
|
19
21
|
getReferenceClientRect?: GetReferenceClientRect | null | undefined;
|
|
20
22
|
offset?: [number, number];
|
|
21
23
|
arrow?: boolean;
|
|
22
|
-
onShown?(instance: AbstractManualCommandBar): void;
|
|
23
24
|
}
|
|
24
25
|
export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
|
|
25
26
|
readonly isVisible: boolean;
|
|
@@ -8,7 +8,6 @@ declare class MobileBottomMenu extends CommandBar implements AbstractManualComma
|
|
|
8
8
|
createContentWithHeader: () => HTMLDivElement;
|
|
9
9
|
handleClose: () => void;
|
|
10
10
|
oldActiveElement: HTMLElement | null;
|
|
11
|
-
handleShown: () => void;
|
|
12
11
|
manualShow: (target: HTMLElement, options?: ManualShowCommandBarOptions) => void;
|
|
13
12
|
close(reason: CloseReason): void;
|
|
14
13
|
destroy(): void;
|