@atlaskit/editor-common 78.27.1 → 78.28.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.
- package/CHANGELOG.md +37 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/clipboard/index.js +29 -1
- package/dist/cjs/extensions/module-helpers.js +1 -0
- package/dist/cjs/media/messages/comments.js +1 -1
- package/dist/cjs/media-single/CommentBadge.js +23 -3
- package/dist/cjs/messages/insert-block.js +4 -4
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/{core-plugin.js → core-plugin/index.js} +15 -1
- package/dist/cjs/preset/core-plugin/requestDocument.js +62 -0
- package/dist/cjs/preset/core-plugin/types.js +5 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MultiBodiedExtension/index.js +0 -3
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/clipboard/index.js +29 -1
- package/dist/es2019/extensions/module-helpers.js +1 -0
- package/dist/es2019/media/messages/comments.js +1 -1
- package/dist/es2019/media-single/CommentBadge.js +23 -4
- package/dist/es2019/messages/insert-block.js +4 -4
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/{core-plugin.js → core-plugin/index.js} +15 -1
- package/dist/es2019/preset/core-plugin/requestDocument.js +51 -0
- package/dist/es2019/preset/core-plugin/types.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MultiBodiedExtension/index.js +0 -3
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/clipboard/index.js +29 -1
- package/dist/esm/extensions/module-helpers.js +1 -0
- package/dist/esm/media/messages/comments.js +1 -1
- package/dist/esm/media-single/CommentBadge.js +24 -4
- package/dist/esm/messages/insert-block.js +4 -4
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/{core-plugin.js → core-plugin/index.js} +15 -1
- package/dist/esm/preset/core-plugin/requestDocument.js +54 -0
- package/dist/esm/preset/core-plugin/types.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MultiBodiedExtension/index.js +0 -3
- package/dist/types/analytics/types/cut-copy-events.d.ts +7 -2
- package/dist/types/analytics/types/enums.d.ts +2 -1
- package/dist/types/analytics/types/extension-events.d.ts +6 -1
- package/dist/types/analytics/types/insert-events.d.ts +1 -0
- package/dist/types/card/cardOptions.d.ts +6 -0
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/extensions/types/utils.d.ts +2 -1
- package/dist/types/media-single/CommentBadge.d.ts +4 -1
- package/dist/types/preset/core-plugin/index.d.ts +6 -0
- package/dist/types/preset/core-plugin/requestDocument.d.ts +7 -0
- package/dist/types/preset/core-plugin/types.d.ts +59 -0
- package/dist/types/preset/plugin-injection-api.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +2 -2
- package/dist/types-ts4.5/analytics/types/cut-copy-events.d.ts +7 -2
- package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -1
- package/dist/types-ts4.5/analytics/types/extension-events.d.ts +6 -1
- package/dist/types-ts4.5/analytics/types/insert-events.d.ts +1 -0
- package/dist/types-ts4.5/card/cardOptions.d.ts +6 -0
- package/dist/types-ts4.5/card/index.d.ts +1 -1
- package/dist/types-ts4.5/extensions/types/utils.d.ts +2 -1
- package/dist/types-ts4.5/media-single/CommentBadge.d.ts +4 -1
- package/dist/types-ts4.5/preset/core-plugin/index.d.ts +6 -0
- package/dist/types-ts4.5/preset/core-plugin/requestDocument.d.ts +7 -0
- package/dist/types-ts4.5/preset/core-plugin/types.d.ts +59 -0
- package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +2 -2
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +2 -2
- package/package.json +4 -4
- package/dist/types/preset/core-plugin.d.ts +0 -39
- package/dist/types-ts4.5/preset/core-plugin.d.ts +0 -39
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
-
import { ExtensionModuleActionHandler, ExtensionType, Icon } from './extension-manifest';
|
|
2
|
+
import type { ExtensionKey, ExtensionModuleActionHandler, ExtensionType, Icon } from './extension-manifest';
|
|
3
3
|
export type MenuItem = {
|
|
4
4
|
key: string;
|
|
5
5
|
extensionType: ExtensionType;
|
|
6
|
+
extensionKey: ExtensionKey;
|
|
6
7
|
title: string;
|
|
7
8
|
description?: string;
|
|
8
9
|
summary?: string;
|
|
@@ -5,8 +5,11 @@ export type CommentBadgeProps = {
|
|
|
5
5
|
intl: IntlShape;
|
|
6
6
|
width?: number;
|
|
7
7
|
height?: number;
|
|
8
|
+
status?: 'default' | 'entered' | 'active';
|
|
8
9
|
mediaElement?: HTMLElement | null;
|
|
9
10
|
onClick: (e: React.MouseEvent) => void;
|
|
11
|
+
onMouseEnter?: (e: React.MouseEvent) => void;
|
|
12
|
+
onMouseLeave?: (e: React.MouseEvent) => void;
|
|
10
13
|
isEditor?: boolean;
|
|
11
14
|
};
|
|
12
|
-
export declare const CommentBadge: ({ intl, width, height, mediaElement, onClick, isEditor, }: CommentBadgeProps) => jsx.JSX.Element;
|
|
15
|
+
export declare const CommentBadge: ({ intl, width, height, status, mediaElement, onClick, onMouseEnter, onMouseLeave, isEditor, }: CommentBadgeProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
2
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { Transformer } from '../../types';
|
|
5
|
+
import type { InferTransformerResultCallback } from './types';
|
|
6
|
+
export declare function toJSON(node: PMNode): JSONDocNode;
|
|
7
|
+
export declare const scheduleDocumentRequest: <GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: InferTransformerResultCallback<Transformer<any>>, transformer?: Transformer<any> | undefined) => void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
2
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { EditorCommand, NextEditorPlugin, Transformer } from '../../types';
|
|
5
|
+
export type CorePlugin = NextEditorPlugin<'core', {
|
|
6
|
+
pluginConfiguration: {
|
|
7
|
+
getEditorView: () => EditorView | undefined;
|
|
8
|
+
};
|
|
9
|
+
actions: {
|
|
10
|
+
/**
|
|
11
|
+
* Dispatches an EditorCommand to ProseMirror
|
|
12
|
+
*
|
|
13
|
+
* @param command A function (EditorCommand | undefined) that takes an object containing a `Transaction` and returns a `Transaction` if it
|
|
14
|
+
* is successful or `null` if it shouldn't be dispatched.
|
|
15
|
+
* @returns (boolean) if the command was successful in dispatching
|
|
16
|
+
*/
|
|
17
|
+
execute: (command: EditorCommand | undefined) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Focuses the editor.
|
|
20
|
+
*
|
|
21
|
+
* Calls the focus method of the `EditorView` and scrolls the
|
|
22
|
+
* current selection into view.
|
|
23
|
+
*
|
|
24
|
+
* @returns (boolean) if the focus was successful
|
|
25
|
+
*/
|
|
26
|
+
focus: () => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Blurs the editor.
|
|
29
|
+
*
|
|
30
|
+
* Calls blur on the editor DOM element.
|
|
31
|
+
*
|
|
32
|
+
* @returns (boolean) if the blur was successful
|
|
33
|
+
*/
|
|
34
|
+
blur: () => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Request the editor document.
|
|
37
|
+
* The document will return when available. If called multiple times it will throttle and return the
|
|
38
|
+
* latest document when ready.
|
|
39
|
+
*
|
|
40
|
+
* A transformer can be created using `createTransformer`.
|
|
41
|
+
*
|
|
42
|
+
* @param onReceive Callback to handle the document. Document type based on the transformer.
|
|
43
|
+
* @param options Pass a transformer for the document to be transformed into a different format.
|
|
44
|
+
*/
|
|
45
|
+
requestDocument<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(onReceive: (document: TransformerResult<GenericTransformer> | undefined) => void, options?: {
|
|
46
|
+
transformer?: GenericTransformer;
|
|
47
|
+
}): void;
|
|
48
|
+
/**
|
|
49
|
+
* Create a transformer
|
|
50
|
+
*
|
|
51
|
+
* @param schema Schema of the document
|
|
52
|
+
* @returns Transformer which can be used to request a document
|
|
53
|
+
*/
|
|
54
|
+
createTransformer<Format>(cb: (schema: Schema) => Transformer<Format>): Transformer<Format> | undefined;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
export type TransformerResult<GenericTransformer = Transformer<JSONDocNode>> = GenericTransformer extends Transformer<infer Content> ? Content : JSONDocNode;
|
|
58
|
+
export type InferTransformerResultCallback<T extends Transformer<any> | undefined> = (doc: T extends Transformer<infer U> ? TransformerResult<U> : TransformerResult<JSONDocNode>) => void;
|
|
59
|
+
export type DefaultTransformerResultCallback = (doc: TransformerResult<JSONDocNode> | undefined) => void;
|
|
@@ -40,8 +40,8 @@ export declare class EditorPluginInjectionAPI implements PluginInjectionAPIDefin
|
|
|
40
40
|
private plugins;
|
|
41
41
|
constructor({ getEditorState, getEditorView }: PluginInjectionAPIProps);
|
|
42
42
|
api<T extends NextEditorPlugin<any, any>>(): import("../types/next-editor-plugin").PublicPluginAPI<[
|
|
43
|
-
NextEditorPlugin<T extends import("
|
|
44
|
-
..."dependencies" extends keyof (T extends NextEditorPlugin<any, infer Metadata extends import("../types/next-editor-plugin").NextEditorPluginMetadata> ? Metadata : never) ? (T extends NextEditorPlugin<any, infer Metadata extends import("../types/next-editor-plugin").NextEditorPluginMetadata> ? Metadata : never)["dependencies"] extends (import("
|
|
43
|
+
NextEditorPlugin<T extends import("../types/next-editor-plugin").NextEditorPluginFunctionOptionalConfigDefinition<infer Name extends string, any, any> ? Name : never, T extends NextEditorPlugin<any, infer Metadata extends import("../types/next-editor-plugin").NextEditorPluginMetadata> ? Metadata : never>,
|
|
44
|
+
..."dependencies" extends keyof (T extends NextEditorPlugin<any, infer Metadata extends import("../types/next-editor-plugin").NextEditorPluginMetadata> ? Metadata : never) ? (T extends NextEditorPlugin<any, infer Metadata extends import("../types/next-editor-plugin").NextEditorPluginMetadata> ? Metadata : never)["dependencies"] extends (import("../types/next-editor-plugin").NextEditorPluginFunctionOptionalConfigDefinition<any, any, any> | import("../types/next-editor-plugin").OptionalPlugin<import("../types/next-editor-plugin").NextEditorPluginFunctionOptionalConfigDefinition<any, any, any>>)[] ? Exclude<(T extends NextEditorPlugin<any, infer Metadata extends import("../types/next-editor-plugin").NextEditorPluginMetadata> ? Metadata : never)["dependencies"], undefined> : [
|
|
45
45
|
] : [
|
|
46
46
|
]
|
|
47
47
|
]>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* are put together - but for now `Builder` & `Preset` aim to beinterchangeable.
|
|
6
6
|
*/
|
|
7
7
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
-
import type { CorePlugin } from '../preset/core-plugin';
|
|
8
|
+
import type { CorePlugin } from '../preset/core-plugin/types';
|
|
9
9
|
import type { EditorCommand, EditorCommandWithMetadata } from './editor-command';
|
|
10
10
|
import type { EditorPlugin } from './editor-plugin';
|
|
11
11
|
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
@@ -103,7 +103,7 @@ export type PluginDependenciesAPI<Plugin extends NextEditorPlugin<any, any>> = {
|
|
|
103
103
|
commands: Plugin extends NextEditorPlugin<any, infer Metadata> ? ExtractCommandsFromMetadata<Metadata> : never;
|
|
104
104
|
};
|
|
105
105
|
export type CreatePluginDependenciesAPI<PluginList extends NextEditorPlugin<any, any>[]> = {
|
|
106
|
-
[Plugin in PluginList[number] as `${ExtractPluginName<Plugin>}`]: Plugin extends OptionalPlugin<NextEditorPlugin<any, any>> ? PluginDependenciesAPI<Plugin> | undefined : Plugin extends NextEditorPlugin<any, any> ? PluginDependenciesAPI<Plugin> | undefined : never;
|
|
106
|
+
[Plugin in PluginList[number] as `${ExtractPluginName<Plugin>}`]: Plugin extends OptionalPlugin<NextEditorPlugin<any, any>> ? PluginDependenciesAPI<Plugin> | undefined : Plugin extends NextEditorPlugin<'core', any> ? PluginDependenciesAPI<Plugin> : Plugin extends NextEditorPlugin<any, any> ? PluginDependenciesAPI<Plugin> | undefined : never;
|
|
107
107
|
};
|
|
108
108
|
export type PluginWithConfiguration<Plugin> = undefined extends ExtractPluginConfiguration<Plugin> ? [
|
|
109
109
|
Plugin,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "78.
|
|
3
|
+
"version": "78.28.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@atlaskit/activity-provider": "^2.4.0",
|
|
97
|
-
"@atlaskit/adf-schema": "^35.
|
|
97
|
+
"@atlaskit/adf-schema": "^35.9.0",
|
|
98
98
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
99
99
|
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
100
100
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@atlaskit/button": "^17.12.0",
|
|
104
104
|
"@atlaskit/code": "^15.1.0",
|
|
105
105
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
106
|
-
"@atlaskit/custom-steps": "^0.0.
|
|
106
|
+
"@atlaskit/custom-steps": "^0.0.18",
|
|
107
107
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
108
108
|
"@atlaskit/editor-palette": "1.5.3",
|
|
109
109
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"@atlaskit/primitives": "^5.5.0",
|
|
130
130
|
"@atlaskit/profilecard": "^19.11.0",
|
|
131
131
|
"@atlaskit/section-message": "^6.4.0",
|
|
132
|
-
"@atlaskit/smart-card": "^26.
|
|
132
|
+
"@atlaskit/smart-card": "^26.56.0",
|
|
133
133
|
"@atlaskit/smart-user-picker": "^6.9.0",
|
|
134
134
|
"@atlaskit/spinner": "^16.0.0",
|
|
135
135
|
"@atlaskit/task-decision": "^17.9.0",
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { EditorCommand, NextEditorPlugin } from '../types';
|
|
3
|
-
export type CorePlugin = NextEditorPlugin<'core', {
|
|
4
|
-
pluginConfiguration: {
|
|
5
|
-
getEditorView: () => EditorView | undefined;
|
|
6
|
-
};
|
|
7
|
-
actions: {
|
|
8
|
-
/**
|
|
9
|
-
* Dispatches an EditorCommand to ProseMirror
|
|
10
|
-
*
|
|
11
|
-
* @param command A function (EditorCommand | undefined) that takes an object containing a `Transaction` and returns a `Transaction` if it
|
|
12
|
-
* is successful or `null` if it shouldn't be dispatched.
|
|
13
|
-
* @returns (boolean) if the command was successful in dispatching
|
|
14
|
-
*/
|
|
15
|
-
execute: (command: EditorCommand | undefined) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Focuses the editor.
|
|
18
|
-
*
|
|
19
|
-
* Calls the focus method of the `EditorView` and scrolls the
|
|
20
|
-
* current selection into view.
|
|
21
|
-
*
|
|
22
|
-
* @returns (boolean) if the focus was successful
|
|
23
|
-
*/
|
|
24
|
-
focus: () => boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Blurs the editor.
|
|
27
|
-
*
|
|
28
|
-
* Calls blur on the editor DOM element.
|
|
29
|
-
*
|
|
30
|
-
* @returns (boolean) if the blur was successful
|
|
31
|
-
*/
|
|
32
|
-
blur: () => boolean;
|
|
33
|
-
};
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Core plugin that is always included in the preset.
|
|
37
|
-
* Allows for executing `EditorCommand` and other core functionality.
|
|
38
|
-
*/
|
|
39
|
-
export declare const corePlugin: CorePlugin;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { EditorCommand, NextEditorPlugin } from '../types';
|
|
3
|
-
export type CorePlugin = NextEditorPlugin<'core', {
|
|
4
|
-
pluginConfiguration: {
|
|
5
|
-
getEditorView: () => EditorView | undefined;
|
|
6
|
-
};
|
|
7
|
-
actions: {
|
|
8
|
-
/**
|
|
9
|
-
* Dispatches an EditorCommand to ProseMirror
|
|
10
|
-
*
|
|
11
|
-
* @param command A function (EditorCommand | undefined) that takes an object containing a `Transaction` and returns a `Transaction` if it
|
|
12
|
-
* is successful or `null` if it shouldn't be dispatched.
|
|
13
|
-
* @returns (boolean) if the command was successful in dispatching
|
|
14
|
-
*/
|
|
15
|
-
execute: (command: EditorCommand | undefined) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Focuses the editor.
|
|
18
|
-
*
|
|
19
|
-
* Calls the focus method of the `EditorView` and scrolls the
|
|
20
|
-
* current selection into view.
|
|
21
|
-
*
|
|
22
|
-
* @returns (boolean) if the focus was successful
|
|
23
|
-
*/
|
|
24
|
-
focus: () => boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Blurs the editor.
|
|
27
|
-
*
|
|
28
|
-
* Calls blur on the editor DOM element.
|
|
29
|
-
*
|
|
30
|
-
* @returns (boolean) if the blur was successful
|
|
31
|
-
*/
|
|
32
|
-
blur: () => boolean;
|
|
33
|
-
};
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Core plugin that is always included in the preset.
|
|
37
|
-
* Allows for executing `EditorCommand` and other core functionality.
|
|
38
|
-
*/
|
|
39
|
-
export declare const corePlugin: CorePlugin;
|