@atlaskit/editor-core 187.23.1 → 187.24.0
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 +17 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +2 -1
- package/dist/cjs/editor-next/editor-internal.js +3 -0
- package/dist/cjs/plugins/block-type/index.js +3 -6
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +12 -12
- package/dist/cjs/plugins/caption/pm-plugins/keymap.js +9 -12
- package/dist/cjs/plugins/help-dialog/index.js +3 -6
- package/dist/cjs/plugins/media/pm-plugins/alt-text/keymap.js +3 -6
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -6
- package/dist/cjs/plugins/media/pm-plugins/keymap.js +8 -11
- package/dist/cjs/plugins/media/pm-plugins/linking/keymap.js +2 -5
- package/dist/cjs/plugins/status/keymap.js +3 -6
- package/dist/cjs/plugins/submit-editor/index.js +3 -6
- package/dist/cjs/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/cjs/presets/context.js +40 -0
- package/dist/cjs/ui/EditorContext/index.js +2 -1
- package/dist/cjs/use-preset.js +51 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +2 -1
- package/dist/es2019/editor-next/editor-internal.js +3 -0
- package/dist/es2019/plugins/block-type/index.js +3 -3
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +11 -12
- package/dist/es2019/plugins/caption/pm-plugins/keymap.js +9 -9
- package/dist/es2019/plugins/help-dialog/index.js +2 -3
- package/dist/es2019/plugins/media/pm-plugins/alt-text/keymap.js +3 -3
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/keymap.js +8 -8
- package/dist/es2019/plugins/media/pm-plugins/linking/keymap.js +2 -2
- package/dist/es2019/plugins/status/keymap.js +3 -3
- package/dist/es2019/plugins/submit-editor/index.js +3 -3
- package/dist/es2019/plugins/text-color/commands/toggle-color.js +2 -2
- package/dist/es2019/presets/context.js +25 -0
- package/dist/es2019/ui/EditorContext/index.js +2 -1
- package/dist/es2019/use-preset.js +45 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +2 -1
- package/dist/esm/editor-next/editor-internal.js +3 -0
- package/dist/esm/plugins/block-type/index.js +3 -3
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +11 -12
- package/dist/esm/plugins/caption/pm-plugins/keymap.js +9 -9
- package/dist/esm/plugins/help-dialog/index.js +2 -3
- package/dist/esm/plugins/media/pm-plugins/alt-text/keymap.js +3 -3
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/keymap.js +8 -8
- package/dist/esm/plugins/media/pm-plugins/linking/keymap.js +2 -2
- package/dist/esm/plugins/status/keymap.js +3 -3
- package/dist/esm/plugins/submit-editor/index.js +3 -3
- package/dist/esm/plugins/text-color/commands/toggle-color.js +2 -2
- package/dist/esm/presets/context.js +26 -0
- package/dist/esm/ui/EditorContext/index.js +2 -1
- package/dist/esm/use-preset.js +45 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +2 -0
- package/dist/types/labs/next/presets/default.d.ts +28 -28
- package/dist/types/plugins/emoji/commands/insert-emoji.d.ts +2 -2
- package/dist/types/plugins/emoji/index.d.ts +2 -2
- package/dist/types/plugins/find-replace/index.d.ts +1 -1
- package/dist/types/presets/context.d.ts +15 -0
- package/dist/types/use-preset.d.ts +48 -0
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +2 -0
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +28 -28
- package/dist/types-ts4.5/plugins/emoji/commands/insert-emoji.d.ts +2 -2
- package/dist/types-ts4.5/plugins/emoji/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +1 -1
- package/dist/types-ts4.5/presets/context.d.ts +15 -0
- package/dist/types-ts4.5/use-preset.d.ts +52 -0
- package/package.json +4 -4
- package/report.api.md +6 -0
- package/tmp/api-report-tmp.d.ts +6 -0
- package/use-preset/package.json +15 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
|
-
import
|
|
4
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '
|
|
3
|
+
import { submit } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { stateKey as mediaPluginKey } from '../../plugins/media/pm-plugins/plugin-key';
|
|
6
6
|
import { analyticsEventKey } from '../analytics/consts';
|
|
7
7
|
export function createPlugin(eventDispatch, onSave) {
|
|
8
8
|
if (!onSave) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
return keymap(_defineProperty({}, "".concat(
|
|
11
|
+
return keymap(_defineProperty({}, "".concat(submit.common), function _(state, _dispatch, editorView) {
|
|
12
12
|
var mediaState = mediaPluginKey.getState(state);
|
|
13
13
|
if (mediaState && mediaState.waitForMediaUpload && !mediaState.allUploadsFinished) {
|
|
14
14
|
return true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toggleMark } from '@atlaskit/editor-common/mark';
|
|
2
2
|
import { ACTIONS, pluginKey } from '../pm-plugins/main';
|
|
3
3
|
import { getDisabledState } from '../utils/disabled';
|
|
4
|
-
import {
|
|
4
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
5
5
|
export var toggleColor = function toggleColor(color) {
|
|
6
6
|
return function (state, dispatch) {
|
|
7
7
|
var textColor = state.schema.marks.textColor;
|
|
@@ -21,7 +21,7 @@ export var toggleColor = function toggleColor(color) {
|
|
|
21
21
|
color: color
|
|
22
22
|
});
|
|
23
23
|
state.tr.scrollIntoView();
|
|
24
|
-
|
|
24
|
+
editorCommandToPMCommand(toggleMark(textColor, {
|
|
25
25
|
color: color
|
|
26
26
|
}))(state, dispatch);
|
|
27
27
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useState, useContext } from 'react';
|
|
3
|
+
export var EditorAPIContext = /*#__PURE__*/React.createContext({});
|
|
4
|
+
export var PresetContextProvider = function PresetContextProvider(_ref) {
|
|
5
|
+
var children = _ref.children;
|
|
6
|
+
var _useState = useState(),
|
|
7
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
8
|
+
editorApi = _useState2[0],
|
|
9
|
+
setEditorApi = _useState2[1];
|
|
10
|
+
return /*#__PURE__*/React.createElement(EditorAPIContext.Provider, {
|
|
11
|
+
value: {
|
|
12
|
+
editorApi: editorApi,
|
|
13
|
+
setEditorApi: setEditorApi
|
|
14
|
+
}
|
|
15
|
+
}, children);
|
|
16
|
+
};
|
|
17
|
+
export var usePresetContext = function usePresetContext() {
|
|
18
|
+
var _useContext = useContext(EditorAPIContext),
|
|
19
|
+
editorApi = _useContext.editorApi;
|
|
20
|
+
return editorApi;
|
|
21
|
+
};
|
|
22
|
+
export var useSetPresetContext = function useSetPresetContext() {
|
|
23
|
+
var _useContext2 = useContext(EditorAPIContext),
|
|
24
|
+
setEditorApi = _useContext2.setEditorApi;
|
|
25
|
+
return setEditorApi;
|
|
26
|
+
};
|
|
@@ -9,6 +9,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import EditorActions from '../../actions';
|
|
12
|
+
import { PresetContextProvider } from '../../presets/context';
|
|
12
13
|
var EditorContext = /*#__PURE__*/React.createContext({});
|
|
13
14
|
export var useEditorContext = function useEditorContext() {
|
|
14
15
|
return React.useContext(EditorContext);
|
|
@@ -35,7 +36,7 @@ var LegacyEditorContext = /*#__PURE__*/function (_React$Component) {
|
|
|
35
36
|
value: function render() {
|
|
36
37
|
return /*#__PURE__*/React.createElement(EditorContext.Provider, {
|
|
37
38
|
value: this.getChildContext()
|
|
38
|
-
}, this.props.children);
|
|
39
|
+
}, /*#__PURE__*/React.createElement(PresetContextProvider, null, this.props.children));
|
|
39
40
|
}
|
|
40
41
|
}]);
|
|
41
42
|
return LegacyEditorContext;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { usePresetContext } from './presets/context';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a preset.
|
|
5
|
+
*
|
|
6
|
+
* Takes an input function that returns a preset (and memoizes it) depending
|
|
7
|
+
* on the dependency array provided.
|
|
8
|
+
*
|
|
9
|
+
* Returns a pluginInjectionApi in order to apply actions and subscribe to plugin
|
|
10
|
+
* changes outside of the editor.
|
|
11
|
+
*
|
|
12
|
+
* @param createPreset
|
|
13
|
+
* @param dependencies
|
|
14
|
+
* @returns PresetAPI ({ pluginInjectionApi, preset, actionBuilder })
|
|
15
|
+
*
|
|
16
|
+
* Example:
|
|
17
|
+
* ```ts
|
|
18
|
+
* function ExampleEditor() {
|
|
19
|
+
* const { preset, editorApi } = usePreset(() =>
|
|
20
|
+
* new EditorPresetBuilder().add(plugin1).add(plugin2)
|
|
21
|
+
* , []);
|
|
22
|
+
*
|
|
23
|
+
* // Can execute typesafe commands based on plugin1 or 2
|
|
24
|
+
* const runCommand = () => editorApi.executeCommand(
|
|
25
|
+
* editorApi.dependencies.plugin1.commands.doSomething()
|
|
26
|
+
* )
|
|
27
|
+
* return (
|
|
28
|
+
* <>
|
|
29
|
+
* <Editor preset={preset} />
|
|
30
|
+
* <Button onClick={runCommand}>Run command</Button>
|
|
31
|
+
* </>
|
|
32
|
+
* )
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function usePreset(createPreset, dependencies) {
|
|
37
|
+
var editorApi = usePresetContext();
|
|
38
|
+
|
|
39
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
+
var preset = useMemo(createPreset, dependencies);
|
|
41
|
+
return {
|
|
42
|
+
editorApi: editorApi,
|
|
43
|
+
preset: preset
|
|
44
|
+
};
|
|
45
|
+
}
|
package/dist/esm/version.json
CHANGED
|
@@ -16,6 +16,7 @@ import { FULL_WIDTH_MODE } from '@atlaskit/editor-common/analytics';
|
|
|
16
16
|
import type { EditorAppearance, EditorConfig, EditorReactContext, EditorPlugin, EditorProps } from '../types';
|
|
17
17
|
import type { EditorNextProps } from '../types/editor-props';
|
|
18
18
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
19
|
+
import type { SetEditorAPI } from '../presets/context';
|
|
19
20
|
import { TransactionTracker } from '../utils/performance/track-transactions';
|
|
20
21
|
import type { FireAnalyticsCallback, AnalyticsEventPayload, DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
21
22
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
@@ -26,6 +27,7 @@ export interface EditorViewProps {
|
|
|
26
27
|
portalProviderAPI: PortalProviderAPI;
|
|
27
28
|
disabled?: boolean;
|
|
28
29
|
experienceStore?: ExperienceStore;
|
|
30
|
+
setEditorApi?: SetEditorAPI;
|
|
29
31
|
render?: (props: {
|
|
30
32
|
editor: JSX.Element;
|
|
31
33
|
view?: EditorView;
|
|
@@ -263,13 +263,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
263
263
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
264
264
|
}>>];
|
|
265
265
|
commands: {
|
|
266
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
267
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
268
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
269
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
270
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
271
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
272
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
266
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
267
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
268
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
269
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
270
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
271
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
272
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
273
273
|
};
|
|
274
274
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
275
275
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -303,13 +303,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
303
303
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
304
304
|
}>>];
|
|
305
305
|
commands: {
|
|
306
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
307
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
308
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
309
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
310
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
311
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
312
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
306
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
307
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
308
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
309
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
310
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
311
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
312
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
313
313
|
};
|
|
314
314
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
315
315
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -634,13 +634,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
634
634
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
635
635
|
}>>];
|
|
636
636
|
commands: {
|
|
637
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
638
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
639
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
640
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
641
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
642
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
643
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
637
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
638
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
639
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
640
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
641
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
642
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
643
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
644
644
|
};
|
|
645
645
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
646
646
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -674,13 +674,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
674
674
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
675
675
|
}>>];
|
|
676
676
|
commands: {
|
|
677
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
678
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
679
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
680
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
681
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
682
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
683
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
677
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
678
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
679
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
680
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
681
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
682
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
683
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
684
684
|
};
|
|
685
685
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
686
686
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EmojiId } from '@atlaskit/emoji';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) =>
|
|
4
|
+
export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
|
|
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EmojiDescription, EmojiProvider, EmojiId } from '@atlaskit/emoji';
|
|
5
|
-
import type { Command, NextEditorPlugin, PMPluginFactoryParams, OptionalPlugin,
|
|
5
|
+
import type { Command, NextEditorPlugin, PMPluginFactoryParams, OptionalPlugin, EditorCommand } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { TypeAheadItem } from '../type-ahead/types';
|
|
8
8
|
import type { EmojiPluginOptions, EmojiPluginState } from './types';
|
|
@@ -18,7 +18,7 @@ export type EmojiPlugin = NextEditorPlugin<'emoji', {
|
|
|
18
18
|
dependencies: [OptionalPlugin<typeof analyticsPlugin>];
|
|
19
19
|
sharedState: EmojiPluginState | undefined;
|
|
20
20
|
commands: {
|
|
21
|
-
insertEmoji: (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) =>
|
|
21
|
+
insertEmoji: (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
|
|
22
22
|
};
|
|
23
23
|
}>;
|
|
24
24
|
export declare const emojiPlugin: EmojiPlugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
export type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
|
|
4
|
+
export interface EditorAPIContextType {
|
|
5
|
+
editorApi?: PublicPluginAPI<any>;
|
|
6
|
+
setEditorApi?: SetEditorAPI;
|
|
7
|
+
}
|
|
8
|
+
export declare const EditorAPIContext: React.Context<EditorAPIContextType>;
|
|
9
|
+
interface EditorAPIProviderProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const PresetContextProvider: ({ children }: EditorAPIProviderProps) => JSX.Element;
|
|
13
|
+
export declare const usePresetContext: () => PublicPluginAPI<any> | undefined;
|
|
14
|
+
export declare const useSetPresetContext: () => SetEditorAPI | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { DependencyList } from 'react';
|
|
2
|
+
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
3
|
+
import type { AllEditorPresetPluginTypes, PublicPluginAPI, NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
4
|
+
type ExtractNextEditorPlugins<Plugins extends AllEditorPresetPluginTypes[]> = {
|
|
5
|
+
[PluginNumber in keyof Plugins]: Plugins[PluginNumber] extends NextEditorPlugin<infer Name, infer Metadata> ? NextEditorPlugin<Name, Metadata> : Plugins[PluginNumber] extends [
|
|
6
|
+
NextEditorPlugin<infer Name, infer Metadata>,
|
|
7
|
+
any
|
|
8
|
+
] ? NextEditorPlugin<Name, Metadata> : never;
|
|
9
|
+
};
|
|
10
|
+
interface PresetAPI<PluginNames extends string[] = [], StackPlugins extends AllEditorPresetPluginTypes[] = []> {
|
|
11
|
+
editorApi: PublicPluginAPI<ExtractNextEditorPlugins<StackPlugins>> | undefined;
|
|
12
|
+
preset: EditorPresetBuilder<PluginNames, StackPlugins>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a preset.
|
|
16
|
+
*
|
|
17
|
+
* Takes an input function that returns a preset (and memoizes it) depending
|
|
18
|
+
* on the dependency array provided.
|
|
19
|
+
*
|
|
20
|
+
* Returns a pluginInjectionApi in order to apply actions and subscribe to plugin
|
|
21
|
+
* changes outside of the editor.
|
|
22
|
+
*
|
|
23
|
+
* @param createPreset
|
|
24
|
+
* @param dependencies
|
|
25
|
+
* @returns PresetAPI ({ pluginInjectionApi, preset, actionBuilder })
|
|
26
|
+
*
|
|
27
|
+
* Example:
|
|
28
|
+
* ```ts
|
|
29
|
+
* function ExampleEditor() {
|
|
30
|
+
* const { preset, editorApi } = usePreset(() =>
|
|
31
|
+
* new EditorPresetBuilder().add(plugin1).add(plugin2)
|
|
32
|
+
* , []);
|
|
33
|
+
*
|
|
34
|
+
* // Can execute typesafe commands based on plugin1 or 2
|
|
35
|
+
* const runCommand = () => editorApi.executeCommand(
|
|
36
|
+
* editorApi.dependencies.plugin1.commands.doSomething()
|
|
37
|
+
* )
|
|
38
|
+
* return (
|
|
39
|
+
* <>
|
|
40
|
+
* <Editor preset={preset} />
|
|
41
|
+
* <Button onClick={runCommand}>Run command</Button>
|
|
42
|
+
* </>
|
|
43
|
+
* )
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function usePreset<PluginNames extends string[] = [], StackPlugins extends AllEditorPresetPluginTypes[] = []>(createPreset: () => EditorPresetBuilder<PluginNames, StackPlugins>, dependencies: DependencyList): PresetAPI<PluginNames, StackPlugins>;
|
|
48
|
+
export {};
|
|
@@ -16,6 +16,7 @@ import { FULL_WIDTH_MODE } from '@atlaskit/editor-common/analytics';
|
|
|
16
16
|
import type { EditorAppearance, EditorConfig, EditorReactContext, EditorPlugin, EditorProps } from '../types';
|
|
17
17
|
import type { EditorNextProps } from '../types/editor-props';
|
|
18
18
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
19
|
+
import type { SetEditorAPI } from '../presets/context';
|
|
19
20
|
import { TransactionTracker } from '../utils/performance/track-transactions';
|
|
20
21
|
import type { FireAnalyticsCallback, AnalyticsEventPayload, DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
21
22
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
@@ -26,6 +27,7 @@ export interface EditorViewProps {
|
|
|
26
27
|
portalProviderAPI: PortalProviderAPI;
|
|
27
28
|
disabled?: boolean;
|
|
28
29
|
experienceStore?: ExperienceStore;
|
|
30
|
+
setEditorApi?: SetEditorAPI;
|
|
29
31
|
render?: (props: {
|
|
30
32
|
editor: JSX.Element;
|
|
31
33
|
view?: EditorView;
|
|
@@ -320,13 +320,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
320
320
|
}>>
|
|
321
321
|
];
|
|
322
322
|
commands: {
|
|
323
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
324
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
325
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
326
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
327
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
328
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
329
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
323
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
324
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
325
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
326
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
327
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
328
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
329
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
330
330
|
};
|
|
331
331
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
332
332
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -366,13 +366,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
366
366
|
}>>
|
|
367
367
|
];
|
|
368
368
|
commands: {
|
|
369
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
370
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
371
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
372
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
373
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
374
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
375
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
369
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
370
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
371
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
372
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
373
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
374
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
375
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
376
376
|
};
|
|
377
377
|
}>,
|
|
378
378
|
(config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
@@ -771,13 +771,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
771
771
|
}>>
|
|
772
772
|
];
|
|
773
773
|
commands: {
|
|
774
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
775
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
776
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
777
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
778
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
779
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
780
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
774
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
775
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
776
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
777
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
778
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
779
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
780
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
781
781
|
};
|
|
782
782
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
783
783
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -817,13 +817,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
817
817
|
}>>
|
|
818
818
|
];
|
|
819
819
|
commands: {
|
|
820
|
-
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
821
|
-
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").
|
|
822
|
-
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").
|
|
823
|
-
toggleCode: import("@atlaskit/editor-plugin-text-formatting").
|
|
824
|
-
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").
|
|
825
|
-
toggleEm: import("@atlaskit/editor-plugin-text-formatting").
|
|
826
|
-
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").
|
|
820
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
821
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
822
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
823
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
824
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
825
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
826
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
|
|
827
827
|
};
|
|
828
828
|
}>,
|
|
829
829
|
(config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EmojiId } from '@atlaskit/emoji';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) =>
|
|
4
|
+
export declare const insertEmoji: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
|
|
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EmojiDescription, EmojiProvider, EmojiId } from '@atlaskit/emoji';
|
|
5
|
-
import type { Command, NextEditorPlugin, PMPluginFactoryParams, OptionalPlugin,
|
|
5
|
+
import type { Command, NextEditorPlugin, PMPluginFactoryParams, OptionalPlugin, EditorCommand } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { TypeAheadItem } from '../type-ahead/types';
|
|
8
8
|
import type { EmojiPluginOptions, EmojiPluginState } from './types';
|
|
@@ -20,7 +20,7 @@ export type EmojiPlugin = NextEditorPlugin<'emoji', {
|
|
|
20
20
|
];
|
|
21
21
|
sharedState: EmojiPluginState | undefined;
|
|
22
22
|
commands: {
|
|
23
|
-
insertEmoji: (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) =>
|
|
23
|
+
insertEmoji: (emojiId: EmojiId, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
|
|
24
24
|
};
|
|
25
25
|
}>;
|
|
26
26
|
export declare const emojiPlugin: EmojiPlugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
export type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
|
|
4
|
+
export interface EditorAPIContextType {
|
|
5
|
+
editorApi?: PublicPluginAPI<any>;
|
|
6
|
+
setEditorApi?: SetEditorAPI;
|
|
7
|
+
}
|
|
8
|
+
export declare const EditorAPIContext: React.Context<EditorAPIContextType>;
|
|
9
|
+
interface EditorAPIProviderProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const PresetContextProvider: ({ children }: EditorAPIProviderProps) => JSX.Element;
|
|
13
|
+
export declare const usePresetContext: () => PublicPluginAPI<any> | undefined;
|
|
14
|
+
export declare const useSetPresetContext: () => SetEditorAPI | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DependencyList } from 'react';
|
|
2
|
+
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
3
|
+
import type { AllEditorPresetPluginTypes, PublicPluginAPI, NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
4
|
+
type ExtractNextEditorPlugins<Plugins extends AllEditorPresetPluginTypes[]> = {
|
|
5
|
+
[PluginNumber in keyof Plugins]: Plugins[PluginNumber] extends NextEditorPlugin<infer Name, infer Metadata> ? NextEditorPlugin<Name, Metadata> : Plugins[PluginNumber] extends [
|
|
6
|
+
NextEditorPlugin<infer Name, infer Metadata>,
|
|
7
|
+
any
|
|
8
|
+
] ? NextEditorPlugin<Name, Metadata> : never;
|
|
9
|
+
};
|
|
10
|
+
interface PresetAPI<PluginNames extends string[] = [
|
|
11
|
+
], StackPlugins extends AllEditorPresetPluginTypes[] = [
|
|
12
|
+
]> {
|
|
13
|
+
editorApi: PublicPluginAPI<ExtractNextEditorPlugins<StackPlugins>> | undefined;
|
|
14
|
+
preset: EditorPresetBuilder<PluginNames, StackPlugins>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a preset.
|
|
18
|
+
*
|
|
19
|
+
* Takes an input function that returns a preset (and memoizes it) depending
|
|
20
|
+
* on the dependency array provided.
|
|
21
|
+
*
|
|
22
|
+
* Returns a pluginInjectionApi in order to apply actions and subscribe to plugin
|
|
23
|
+
* changes outside of the editor.
|
|
24
|
+
*
|
|
25
|
+
* @param createPreset
|
|
26
|
+
* @param dependencies
|
|
27
|
+
* @returns PresetAPI ({ pluginInjectionApi, preset, actionBuilder })
|
|
28
|
+
*
|
|
29
|
+
* Example:
|
|
30
|
+
* ```ts
|
|
31
|
+
* function ExampleEditor() {
|
|
32
|
+
* const { preset, editorApi } = usePreset(() =>
|
|
33
|
+
* new EditorPresetBuilder().add(plugin1).add(plugin2)
|
|
34
|
+
* , []);
|
|
35
|
+
*
|
|
36
|
+
* // Can execute typesafe commands based on plugin1 or 2
|
|
37
|
+
* const runCommand = () => editorApi.executeCommand(
|
|
38
|
+
* editorApi.dependencies.plugin1.commands.doSomething()
|
|
39
|
+
* )
|
|
40
|
+
* return (
|
|
41
|
+
* <>
|
|
42
|
+
* <Editor preset={preset} />
|
|
43
|
+
* <Button onClick={runCommand}>Run command</Button>
|
|
44
|
+
* </>
|
|
45
|
+
* )
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function usePreset<PluginNames extends string[] = [
|
|
50
|
+
], StackPlugins extends AllEditorPresetPluginTypes[] = [
|
|
51
|
+
]>(createPreset: () => EditorPresetBuilder<PluginNames, StackPlugins>, dependencies: DependencyList): PresetAPI<PluginNames, StackPlugins>;
|
|
52
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.
|
|
3
|
+
"version": "187.24.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.7.0",
|
|
58
|
-
"@atlaskit/editor-common": "^74.
|
|
58
|
+
"@atlaskit/editor-common": "^74.46.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@atlaskit/editor-plugin-guideline": "^0.3.4",
|
|
73
73
|
"@atlaskit/editor-plugin-hyperlink": "^0.3.0",
|
|
74
74
|
"@atlaskit/editor-plugin-image-upload": "^0.1.0",
|
|
75
|
-
"@atlaskit/editor-plugin-table": "^2.
|
|
75
|
+
"@atlaskit/editor-plugin-table": "^2.9.0",
|
|
76
76
|
"@atlaskit/editor-plugin-text-formatting": "^0.2.0",
|
|
77
77
|
"@atlaskit/editor-plugin-width": "^0.1.0",
|
|
78
78
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"@atlaskit/collab-provider": "9.10.1",
|
|
147
147
|
"@atlaskit/dropdown-menu": "^11.11.0",
|
|
148
148
|
"@atlaskit/editor-extension-dropbox": "^0.4.0",
|
|
149
|
-
"@atlaskit/editor-plugin-table": "^2.
|
|
149
|
+
"@atlaskit/editor-plugin-table": "^2.9.0",
|
|
150
150
|
"@atlaskit/editor-test-helpers": "^18.11.0",
|
|
151
151
|
"@atlaskit/flag": "^15.2.0",
|
|
152
152
|
"@atlaskit/icon-object": "^6.3.0",
|
package/report.api.md
CHANGED
|
@@ -130,6 +130,7 @@ import { PresenceResource } from '@atlaskit/mention/resource';
|
|
|
130
130
|
import PropTypes from 'prop-types';
|
|
131
131
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
132
132
|
import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
133
|
+
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
133
134
|
import { PureComponent } from 'react';
|
|
134
135
|
import { QuickInsertActionInsert } from '@atlaskit/editor-common/provider-factory';
|
|
135
136
|
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -974,6 +975,8 @@ interface EditorViewProps {
|
|
|
974
975
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
975
976
|
editorRef: React_2.RefObject<HTMLDivElement>;
|
|
976
977
|
}) => JSX.Element;
|
|
978
|
+
// (undocumented)
|
|
979
|
+
setEditorApi?: SetEditorAPI;
|
|
977
980
|
}
|
|
978
981
|
|
|
979
982
|
// @public (undocumented)
|
|
@@ -1957,6 +1960,9 @@ export function setBlockTypeWithAnalytics(
|
|
|
1957
1960
|
editorAnalyticsApi: EditorAnalyticsAPI | undefined,
|
|
1958
1961
|
): Command_2;
|
|
1959
1962
|
|
|
1963
|
+
// @public (undocumented)
|
|
1964
|
+
type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
|
|
1965
|
+
|
|
1960
1966
|
// @public (undocumented)
|
|
1961
1967
|
export const setIsExpanded: (isExpanded: boolean) => Command_2;
|
|
1962
1968
|
|