@ones-editor/editor 2.1.7 → 2.1.8-beta.2
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/block-renderers/block-renderers.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/doc.d.ts +1 -1
- package/@ones-editor/core/src/core/types.d.ts +2 -0
- package/@ones-editor/sharedb-doc/src/versions/sharedb-server.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/versions/simple-client.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +2 -2
- package/@ones-editor/ui/src/tooltips/index.d.ts +21 -9
- package/@ones-editor/versions/src/constant/index.d.ts +1 -0
- package/@ones-editor/versions/src/history-render/index.d.ts +15 -1
- package/@ones-editor/versions/src/history-tooltip/index.d.ts +10 -0
- package/@ones-editor/versions/src/types.d.ts +4 -0
- package/@ones-editor/versions/src/utils/block-text.d.ts +3 -1
- package/@ones-editor/versions/src/utils/index.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/index.d.ts +1 -0
- package/dist/index.js +677 -242
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './style.scss';
|
|
2
2
|
import OnesEditorToolbar from './toolbar/toolbar-handler';
|
|
3
3
|
import OnesEditorQuickMenu, { getAllQuickMenuItems, getHeadingMenuOptions, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider, BasicCommands, GetAllQuickMenuItemsOptions, QuickMenuCommandParams, AddMenuCommand, QuickMenuItemFilter } from './quick-menu';
|
|
4
|
-
import OnesEditorTooltip from './tooltips';
|
|
4
|
+
import OnesEditorTooltip, { OnesEditorTooltipCallbacks, EditorTooltipTippyInstance, OnesEditorTooltipProps } from './tooltips';
|
|
5
5
|
import TextStyleShortcuts from './shortcuts';
|
|
6
6
|
import { editLink } from './link-popup';
|
|
7
7
|
import { getToolbar } from './toolbar/helper';
|
|
@@ -12,7 +12,7 @@ import { InlineBoxCommandProvider } from './quick-menu/inline-box-items';
|
|
|
12
12
|
import './locale';
|
|
13
13
|
import type { OnesEditorToolbarBase } from './toolbar/types';
|
|
14
14
|
import type { QuickMenuItem } from './quick-menu';
|
|
15
|
-
export type { QuickMenuItemFilter, QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, GetAllQuickMenuItemsOptions, OnesEditorToolbarBase, };
|
|
15
|
+
export type { QuickMenuItemFilter, QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, GetAllQuickMenuItemsOptions, OnesEditorToolbarBase, OnesEditorTooltipCallbacks, EditorTooltipTippyInstance, OnesEditorTooltipProps, };
|
|
16
16
|
export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions, BasicCommands, GroupOrder, isSelectBoxOnly, InlineBoxCommandProvider, getReferenceClientRect, };
|
|
17
17
|
export { createTextButton } from './text-button';
|
|
18
18
|
export { mergeCommands } from './toolbar/merge-commands';
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
1
|
+
import { EventCallbacks, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { delegate, DelegateInstance } from 'tippy.js';
|
|
3
|
+
export type OnesEditorTooltipCallbacks = {
|
|
4
|
+
onBeforeShow?: (instance: EditorTooltipTippyInstance) => void;
|
|
5
|
+
};
|
|
6
|
+
export type EditorTooltipTippyInstance = DelegateInstance;
|
|
7
|
+
export type OnesEditorTooltipProps = Omit<Parameters<typeof delegate>[1], 'onShow' | 'content' | 'onShown' | 'onHide' | 'target'>;
|
|
8
|
+
type DelegateProps = OnesEditorTooltipProps & {
|
|
9
|
+
attributeNames: string[];
|
|
10
|
+
};
|
|
11
|
+
type OnesEditorTooltipOptions = {
|
|
12
|
+
onBeforeTooltipInitialize?: (props: Partial<DelegateProps>) => DelegateProps;
|
|
13
|
+
};
|
|
14
|
+
export default class OnesEditorTooltip extends EventCallbacks<OnesEditorTooltipCallbacks> {
|
|
4
15
|
private editor;
|
|
5
|
-
instance:
|
|
16
|
+
instance: DelegateInstance;
|
|
6
17
|
mousedown: boolean;
|
|
7
|
-
currentInstance:
|
|
8
|
-
|
|
18
|
+
currentInstance: DelegateInstance | null;
|
|
19
|
+
attributeNames: string[];
|
|
9
20
|
attributeDesc: string;
|
|
10
21
|
private _lastClickButtonId;
|
|
11
22
|
private observer;
|
|
12
23
|
private observerCallback;
|
|
13
|
-
constructor(editor: OnesEditor);
|
|
24
|
+
constructor(editor: OnesEditor, options?: OnesEditorTooltipOptions);
|
|
14
25
|
set lastClickButtonId(value: string);
|
|
15
26
|
createContent: (reference: Element) => string | HTMLDivElement;
|
|
16
27
|
visible(): boolean | undefined;
|
|
@@ -20,9 +31,9 @@ export default class OnesEditorTooltip {
|
|
|
20
31
|
private destroyObserver;
|
|
21
32
|
handleDocumentMouseDown: () => void;
|
|
22
33
|
handleDocumentMouseUp: () => void;
|
|
23
|
-
handleShown: (a:
|
|
34
|
+
handleShown: (a: DelegateInstance) => void;
|
|
24
35
|
handleHidden: () => void;
|
|
25
|
-
handleShow: (instance:
|
|
36
|
+
handleShow: (instance: DelegateInstance) => boolean;
|
|
26
37
|
private fixContainerForFullscreen;
|
|
27
38
|
}
|
|
28
39
|
declare global {
|
|
@@ -30,3 +41,4 @@ declare global {
|
|
|
30
41
|
isDragging?: boolean;
|
|
31
42
|
}
|
|
32
43
|
}
|
|
44
|
+
export {};
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
|
|
1
|
+
import type { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
|
|
2
2
|
export default class OnesEditorHistoryRender implements OnesEditorBlockRenderer {
|
|
3
3
|
renderBox(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
4
4
|
renderText(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
5
5
|
renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
|
|
6
6
|
updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
|
|
7
|
+
renderChildContainer(editor: OnesEditor, path: BlockPath, containerId: string): {
|
|
8
|
+
classes: string[];
|
|
9
|
+
attributes: {
|
|
10
|
+
"data-history-editor-tooltip": string;
|
|
11
|
+
};
|
|
12
|
+
styles: {
|
|
13
|
+
"--op-color": string;
|
|
14
|
+
"--op-selected-color": string;
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
classes?: undefined;
|
|
18
|
+
attributes?: undefined;
|
|
19
|
+
styles?: undefined;
|
|
20
|
+
};
|
|
7
21
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { OnesEditorTooltipCallbacks, EditorTooltipTippyInstance } from '../../../../@ones-editor/ui';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export declare class OnesEditorHistoryTooltip implements OnesEditorTooltipCallbacks {
|
|
5
|
+
static register(editor: OnesEditor): void;
|
|
6
|
+
private createContent;
|
|
7
|
+
private getReferenceClientRect;
|
|
8
|
+
private getPropsFromDifferentBlock;
|
|
9
|
+
onBeforeShow: (instance: EditorTooltipTippyInstance) => void;
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OnesEditor, DocVersion, OnesEditorDocHistoryData, OnesEditorDoc, OnesEditorBlockRenderer } from '../../../@ones-editor/core';
|
|
2
2
|
export interface VersionDialogOptions {
|
|
3
3
|
container: HTMLElement;
|
|
4
|
+
showPublishedVersions?: boolean;
|
|
4
5
|
initSelectedVersion?: VersionNum;
|
|
5
6
|
useCreatedBy?: boolean;
|
|
6
7
|
enableEdit?: boolean;
|
|
@@ -26,3 +27,6 @@ export interface OnesEditorVersionsProvider {
|
|
|
26
27
|
export type HistoryUser = OnesEditorDocHistoryData['user'];
|
|
27
28
|
export type UserColorTypes = 'flag' | 'selection';
|
|
28
29
|
export type UserColors = Record<UserColorTypes, string>;
|
|
30
|
+
export type HistoryDocMeta = {
|
|
31
|
+
'createBy'?: HistoryUser;
|
|
32
|
+
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { HistoryUser } from '../types';
|
|
2
|
-
|
|
2
|
+
type OpType = 'insert' | 'delete' | 'update';
|
|
3
|
+
export declare function getOpDescription(user: HistoryUser, type: OpType): string;
|
|
4
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OnesEditorRemoteUsers } from '../../../../@ones-editor/core';
|
|
2
2
|
import { HistoryUser, UserColors } from '../types';
|
|
3
3
|
export * from './block-text';
|
|
4
|
+
export declare function removeOpacityFromHexColor(hexColor: string): string;
|
|
4
5
|
export declare function getUserColors(users: OnesEditorRemoteUsers, user: HistoryUser): UserColors;
|
|
@@ -12,6 +12,7 @@ export declare class OnesEditorVersionsDialog implements OnesEditorCustom {
|
|
|
12
12
|
get versionHelper(): import("@ones-editor/core").OnesEditorDocVersionHelper;
|
|
13
13
|
get editor(): OnesEditor | null;
|
|
14
14
|
constructor(server: OnesEditorDocServer, provider: OnesEditorVersionsProvider);
|
|
15
|
+
private handleBeforeShowTooltip;
|
|
15
16
|
private handleRevert;
|
|
16
17
|
private handleSelectVersion;
|
|
17
18
|
private handleCompareWithVersion;
|