@atlaskit/editor-core 203.6.2 → 203.6.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.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/composable-editor/hooks/useProviderFactory.js +14 -4
- package/dist/cjs/presets/default.js +3 -1
- package/dist/cjs/utils/extensions.js +27 -8
- package/dist/cjs/utils/prepare-quick-insert-provider.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/hooks/useProviderFactory.js +13 -3
- package/dist/es2019/presets/default.js +4 -1
- package/dist/es2019/utils/extensions.js +25 -6
- package/dist/es2019/utils/prepare-quick-insert-provider.js +2 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/hooks/useProviderFactory.js +14 -4
- package/dist/esm/presets/default.js +3 -1
- package/dist/esm/utils/extensions.js +27 -8
- package/dist/esm/utils/prepare-quick-insert-provider.js +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +2 -1
- package/dist/types/presets/default.d.ts +4 -2
- package/dist/types/presets/universal.d.ts +2 -1
- package/dist/types/presets/useUniversalPreset.d.ts +2 -1
- package/dist/types/utils/extensions.d.ts +4 -1
- package/dist/types/utils/prepare-quick-insert-provider.d.ts +4 -1
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +2 -1
- package/dist/types-ts4.5/presets/default.d.ts +4 -2
- package/dist/types-ts4.5/presets/universal.d.ts +2 -1
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +2 -1
- package/dist/types-ts4.5/utils/extensions.d.ts +6 -1
- package/dist/types-ts4.5/utils/prepare-quick-insert-provider.d.ts +6 -1
- package/package.json +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 203.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#180750](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180750)
|
|
8
|
+
[`f019b16b9161a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f019b16b9161a) -
|
|
9
|
+
[ux] Introduces access to the ExtensionAPI from extension module quickInsert actions
|
|
10
|
+
- [#180067](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180067)
|
|
11
|
+
[`fdee6c449ca83`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fdee6c449ca83) -
|
|
12
|
+
[ux] Adding block quote as an option to the text formatting menu for full page editors
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 203.6.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#180080](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180080)
|
|
20
|
+
[`2c21ba8914848`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c21ba8914848) -
|
|
21
|
+
[ux] ED-26013 fix expand on auto scoll for long node
|
|
22
|
+
|
|
3
23
|
## 203.6.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -11,11 +11,20 @@ var _prepareExtensionProvider = _interopRequireDefault(require("../../utils/prep
|
|
|
11
11
|
var _prepareQuickInsertProvider = _interopRequireDefault(require("../../utils/prepare-quick-insert-provider"));
|
|
12
12
|
var _getProvidersFromEditorProps = _interopRequireDefault(require("../utils/getProvidersFromEditorProps"));
|
|
13
13
|
var _handleProviders = _interopRequireDefault(require("../utils/handleProviders"));
|
|
14
|
-
function
|
|
14
|
+
function useEditorRef(preset) {
|
|
15
|
+
var apiRef = (0, _react.useRef)();
|
|
16
|
+
(0, _react.useEffect)(function () {
|
|
17
|
+
return preset === null || preset === void 0 ? void 0 : preset.apiResolver.on(function (api) {
|
|
18
|
+
apiRef.current = api;
|
|
19
|
+
});
|
|
20
|
+
}, [preset === null || preset === void 0 ? void 0 : preset.apiResolver]);
|
|
21
|
+
return apiRef;
|
|
22
|
+
}
|
|
23
|
+
function prepareProviders(editorActions, apiRef, quickInsert, extensionProviders, createAnalyticsEvent) {
|
|
15
24
|
var extensionProvider = (0, _prepareExtensionProvider.default)(function () {
|
|
16
25
|
return editorActions;
|
|
17
26
|
})(extensionProviders);
|
|
18
|
-
var quickInsertProvider = (0, _prepareQuickInsertProvider.default)(editorActions, extensionProvider, quickInsert, createAnalyticsEvent);
|
|
27
|
+
var quickInsertProvider = (0, _prepareQuickInsertProvider.default)(editorActions, apiRef, extensionProvider, quickInsert, createAnalyticsEvent);
|
|
19
28
|
return {
|
|
20
29
|
extensionProvider: extensionProvider,
|
|
21
30
|
quickInsertProvider: quickInsertProvider
|
|
@@ -63,14 +72,15 @@ function useProviderFactory(props, editorActions, createAnalyticsEvent) {
|
|
|
63
72
|
});
|
|
64
73
|
}, [autoformattingProvider, emojiProvider, mentionProvider, legacyImageUploadProvider, taskDecisionProvider, contextIdentifierProvider, searchProvider, macroProvider, activityProvider, collabEdit, collabEditProvider, presenceProvider]);
|
|
65
74
|
var providerFactory = (0, _react.useRef)(new _providerFactory.ProviderFactory());
|
|
75
|
+
var editorRef = useEditorRef(props.preset);
|
|
66
76
|
var preparedProviders = (0, _react.useMemo)(function () {
|
|
67
77
|
return (
|
|
68
78
|
// Though this will introduce some performance regression related to quick insert
|
|
69
79
|
// loading but we can remove it soon when Forge will move to new API.
|
|
70
80
|
// quickInsert={Promise.resolve(consumerQuickInsert)} is one of the main reason behind this performance issue.
|
|
71
|
-
prepareProviders(editorActions, quickInsert, extensionProviders, createAnalyticsEvent)
|
|
81
|
+
prepareProviders(editorActions, editorRef, quickInsert, extensionProviders, createAnalyticsEvent)
|
|
72
82
|
);
|
|
73
|
-
}, [extensionProviders, quickInsert, editorActions, createAnalyticsEvent]);
|
|
83
|
+
}, [extensionProviders, quickInsert, editorActions, createAnalyticsEvent, editorRef]);
|
|
74
84
|
(0, _react.useEffect)(function () {
|
|
75
85
|
(0, _handleProviders.default)(providerFactory.current, providers, preparedProviders.extensionProvider, preparedProviders.quickInsertProvider);
|
|
76
86
|
}, [providers, preparedProviders]);
|
|
@@ -56,7 +56,9 @@ function createDefaultPreset(options) {
|
|
|
56
56
|
isFullPage: isFullPage
|
|
57
57
|
})]).add(_clipboard.clipboardPlugin).add(_focus.focusPlugin).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
|
|
58
58
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
59
|
-
}]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(options.allowUndoRedoButtons)).add(_primaryToolbar.primaryToolbarPlugin).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([_blockType.blockTypePlugin, options.blockType
|
|
59
|
+
}]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(options.allowUndoRedoButtons)).add(_primaryToolbar.primaryToolbarPlugin).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([_blockType.blockTypePlugin, _objectSpread(_objectSpread({}, options.blockType), {}, {
|
|
60
|
+
includeBlockQuoteAsTextstyleOption: isFullPage
|
|
61
|
+
})]).add(_clearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).add([_selectionToolbar.selectionToolbarPlugin, {
|
|
60
62
|
preferenceToolbarAboveSelection: !!options.preferenceToolbarAboveSelection
|
|
61
63
|
}]).add([_hyperlink.hyperlinkPlugin, _objectSpread(_objectSpread({}, options.hyperlinkOptions), {}, {
|
|
62
64
|
// @ts-ignore Temporary solution to check for Live Page editor.
|
|
@@ -13,6 +13,7 @@ var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
15
15
|
var _providerHelpers = require("@atlaskit/editor-common/provider-helpers");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
/**
|
|
17
18
|
* Utils to send analytics event when a extension is inserted using quickInsert
|
|
18
19
|
*/
|
|
@@ -34,11 +35,11 @@ function sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source) {
|
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
function extensionProviderToQuickInsertProvider(_x, _x2, _x3) {
|
|
38
|
+
function extensionProviderToQuickInsertProvider(_x, _x2, _x3, _x4) {
|
|
38
39
|
return _extensionProviderToQuickInsertProvider.apply(this, arguments);
|
|
39
40
|
}
|
|
40
41
|
function _extensionProviderToQuickInsertProvider() {
|
|
41
|
-
_extensionProviderToQuickInsertProvider = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(extensionProvider, editorActions, createAnalyticsEvent) {
|
|
42
|
+
_extensionProviderToQuickInsertProvider = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(extensionProvider, editorActions, apiRef, createAnalyticsEvent) {
|
|
42
43
|
var extensions;
|
|
43
44
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
44
45
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -70,12 +71,30 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
70
71
|
isDisabledOffline: true,
|
|
71
72
|
action: function action(insert, state, source) {
|
|
72
73
|
if (typeof item.node === 'function') {
|
|
73
|
-
(0,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_add_extension_api_to_quick_insert')) {
|
|
75
|
+
var _apiRef$current;
|
|
76
|
+
var extensionAPI = apiRef === null || apiRef === void 0 || (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.extension) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.actions) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.api();
|
|
77
|
+
// While the api can be "undefined" there are no runtime scenarios where this is the case because:
|
|
78
|
+
// - The quick insert API can only be called from an active editor
|
|
79
|
+
// - The extension module handler can only be called from an active editor with the extension plugin
|
|
80
|
+
// Therefore this should always be run unless there is something very wrong.
|
|
81
|
+
if (extensionAPI) {
|
|
82
|
+
(0, _extensions.resolveImport)(item.node(extensionAPI)).then(function (node) {
|
|
83
|
+
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
84
|
+
if (node) {
|
|
85
|
+
editorActions.replaceSelection(node);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
77
88
|
}
|
|
78
|
-
}
|
|
89
|
+
} else {
|
|
90
|
+
// @ts-expect-error No longer supported without extension API - this will be removed once we cleanup the FG.
|
|
91
|
+
(0, _extensions.resolveImport)(item.node()).then(function (node) {
|
|
92
|
+
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
93
|
+
if (node) {
|
|
94
|
+
editorActions.replaceSelection(node);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
79
98
|
return insert('');
|
|
80
99
|
} else {
|
|
81
100
|
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
@@ -95,7 +114,7 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
95
114
|
}));
|
|
96
115
|
return _extensionProviderToQuickInsertProvider.apply(this, arguments);
|
|
97
116
|
}
|
|
98
|
-
function combineQuickInsertProviders(
|
|
117
|
+
function combineQuickInsertProviders(_x5) {
|
|
99
118
|
return _combineQuickInsertProviders.apply(this, arguments);
|
|
100
119
|
}
|
|
101
120
|
function _combineQuickInsertProviders() {
|
|
@@ -15,8 +15,8 @@ var _extensions = require("./extensions");
|
|
|
15
15
|
* @param createAnalyticsEvent
|
|
16
16
|
* @returns Quick insert provider if available
|
|
17
17
|
*/
|
|
18
|
-
function prepareQuickInsertProvider(editorActions, extensionProvider, quickInsert, createAnalyticsEvent) {
|
|
18
|
+
function prepareQuickInsertProvider(editorActions, apiRef, extensionProvider, quickInsert, createAnalyticsEvent) {
|
|
19
19
|
var quickInsertProvider = quickInsert && typeof quickInsert !== 'boolean' && quickInsert.provider;
|
|
20
|
-
var extensionQuickInsertProvider = extensionProvider && (0, _extensions.extensionProviderToQuickInsertProvider)(extensionProvider, editorActions, createAnalyticsEvent);
|
|
20
|
+
var extensionQuickInsertProvider = extensionProvider && (0, _extensions.extensionProviderToQuickInsertProvider)(extensionProvider, editorActions, apiRef, createAnalyticsEvent);
|
|
21
21
|
return quickInsertProvider && extensionQuickInsertProvider ? (0, _extensions.combineQuickInsertProviders)([quickInsertProvider, extensionQuickInsertProvider]) : quickInsertProvider || extensionQuickInsertProvider;
|
|
22
22
|
}
|
|
@@ -4,9 +4,18 @@ import prepareExtensionProvider from '../../utils/prepare-extension-provider';
|
|
|
4
4
|
import prepareQuickInsertProvider from '../../utils/prepare-quick-insert-provider';
|
|
5
5
|
import getProvidersFromEditorProps from '../utils/getProvidersFromEditorProps';
|
|
6
6
|
import handleProviders from '../utils/handleProviders';
|
|
7
|
-
function
|
|
7
|
+
function useEditorRef(preset) {
|
|
8
|
+
const apiRef = useRef();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
return preset === null || preset === void 0 ? void 0 : preset.apiResolver.on(api => {
|
|
11
|
+
apiRef.current = api;
|
|
12
|
+
});
|
|
13
|
+
}, [preset === null || preset === void 0 ? void 0 : preset.apiResolver]);
|
|
14
|
+
return apiRef;
|
|
15
|
+
}
|
|
16
|
+
function prepareProviders(editorActions, apiRef, quickInsert, extensionProviders, createAnalyticsEvent) {
|
|
8
17
|
const extensionProvider = prepareExtensionProvider(() => editorActions)(extensionProviders);
|
|
9
|
-
const quickInsertProvider = prepareQuickInsertProvider(editorActions, extensionProvider, quickInsert, createAnalyticsEvent);
|
|
18
|
+
const quickInsertProvider = prepareQuickInsertProvider(editorActions, apiRef, extensionProvider, quickInsert, createAnalyticsEvent);
|
|
10
19
|
return {
|
|
11
20
|
extensionProvider,
|
|
12
21
|
quickInsertProvider
|
|
@@ -54,11 +63,12 @@ export default function useProviderFactory(props, editorActions, createAnalytics
|
|
|
54
63
|
presenceProvider
|
|
55
64
|
}), [autoformattingProvider, emojiProvider, mentionProvider, legacyImageUploadProvider, taskDecisionProvider, contextIdentifierProvider, searchProvider, macroProvider, activityProvider, collabEdit, collabEditProvider, presenceProvider]);
|
|
56
65
|
const providerFactory = useRef(new ProviderFactory());
|
|
66
|
+
const editorRef = useEditorRef(props.preset);
|
|
57
67
|
const preparedProviders = useMemo(() =>
|
|
58
68
|
// Though this will introduce some performance regression related to quick insert
|
|
59
69
|
// loading but we can remove it soon when Forge will move to new API.
|
|
60
70
|
// quickInsert={Promise.resolve(consumerQuickInsert)} is one of the main reason behind this performance issue.
|
|
61
|
-
prepareProviders(editorActions, quickInsert, extensionProviders, createAnalyticsEvent), [extensionProviders, quickInsert, editorActions, createAnalyticsEvent]);
|
|
71
|
+
prepareProviders(editorActions, editorRef, quickInsert, extensionProviders, createAnalyticsEvent), [extensionProviders, quickInsert, editorActions, createAnalyticsEvent, editorRef]);
|
|
62
72
|
useEffect(() => {
|
|
63
73
|
handleProviders(providerFactory.current, providers, preparedProviders.extensionProvider, preparedProviders.quickInsertProvider);
|
|
64
74
|
}, [providers, preparedProviders]);
|
|
@@ -48,7 +48,10 @@ export function createDefaultPreset(options) {
|
|
|
48
48
|
isFullPage
|
|
49
49
|
}]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
50
50
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
51
|
-
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(primaryToolbarPlugin).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin,
|
|
51
|
+
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(primaryToolbarPlugin).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, {
|
|
52
|
+
...options.blockType,
|
|
53
|
+
includeBlockQuoteAsTextstyleOption: isFullPage
|
|
54
|
+
}]).add(clearMarksOnEmptyDocPlugin).add([selectionToolbarPlugin, {
|
|
52
55
|
preferenceToolbarAboveSelection: !!options.preferenceToolbarAboveSelection
|
|
53
56
|
}]).add([hyperlinkPlugin, {
|
|
54
57
|
...options.hyperlinkOptions,
|
|
@@ -3,6 +3,7 @@ import Loadable from 'react-loadable';
|
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { getQuickInsertItemsFromModule, resolveImport } from '@atlaskit/editor-common/extensions';
|
|
5
5
|
import { combineProviders } from '@atlaskit/editor-common/provider-helpers';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
/**
|
|
7
8
|
* Utils to send analytics event when a extension is inserted using quickInsert
|
|
8
9
|
*/
|
|
@@ -24,7 +25,7 @@ function sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source) {
|
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
export async function extensionProviderToQuickInsertProvider(extensionProvider, editorActions, createAnalyticsEvent) {
|
|
28
|
+
export async function extensionProviderToQuickInsertProvider(extensionProvider, editorActions, apiRef, createAnalyticsEvent) {
|
|
28
29
|
const extensions = await extensionProvider.getExtensions();
|
|
29
30
|
return {
|
|
30
31
|
getItems: () => {
|
|
@@ -45,12 +46,30 @@ export async function extensionProviderToQuickInsertProvider(extensionProvider,
|
|
|
45
46
|
isDisabledOffline: true,
|
|
46
47
|
action: (insert, state, source) => {
|
|
47
48
|
if (typeof item.node === 'function') {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
if (fg('platform_editor_add_extension_api_to_quick_insert')) {
|
|
50
|
+
var _apiRef$current, _apiRef$current$exten, _apiRef$current$exten2;
|
|
51
|
+
const extensionAPI = apiRef === null || apiRef === void 0 ? void 0 : (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : (_apiRef$current$exten = _apiRef$current.extension) === null || _apiRef$current$exten === void 0 ? void 0 : (_apiRef$current$exten2 = _apiRef$current$exten.actions) === null || _apiRef$current$exten2 === void 0 ? void 0 : _apiRef$current$exten2.api();
|
|
52
|
+
// While the api can be "undefined" there are no runtime scenarios where this is the case because:
|
|
53
|
+
// - The quick insert API can only be called from an active editor
|
|
54
|
+
// - The extension module handler can only be called from an active editor with the extension plugin
|
|
55
|
+
// Therefore this should always be run unless there is something very wrong.
|
|
56
|
+
if (extensionAPI) {
|
|
57
|
+
resolveImport(item.node(extensionAPI)).then(node => {
|
|
58
|
+
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
59
|
+
if (node) {
|
|
60
|
+
editorActions.replaceSelection(node);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
52
63
|
}
|
|
53
|
-
}
|
|
64
|
+
} else {
|
|
65
|
+
// @ts-expect-error No longer supported without extension API - this will be removed once we cleanup the FG.
|
|
66
|
+
resolveImport(item.node()).then(node => {
|
|
67
|
+
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
68
|
+
if (node) {
|
|
69
|
+
editorActions.replaceSelection(node);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
54
73
|
return insert('');
|
|
55
74
|
} else {
|
|
56
75
|
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
@@ -10,8 +10,8 @@ import { combineQuickInsertProviders, extensionProviderToQuickInsertProvider } f
|
|
|
10
10
|
* @param createAnalyticsEvent
|
|
11
11
|
* @returns Quick insert provider if available
|
|
12
12
|
*/
|
|
13
|
-
export default function prepareQuickInsertProvider(editorActions, extensionProvider, quickInsert, createAnalyticsEvent) {
|
|
13
|
+
export default function prepareQuickInsertProvider(editorActions, apiRef, extensionProvider, quickInsert, createAnalyticsEvent) {
|
|
14
14
|
const quickInsertProvider = quickInsert && typeof quickInsert !== 'boolean' && quickInsert.provider;
|
|
15
|
-
const extensionQuickInsertProvider = extensionProvider && extensionProviderToQuickInsertProvider(extensionProvider, editorActions, createAnalyticsEvent);
|
|
15
|
+
const extensionQuickInsertProvider = extensionProvider && extensionProviderToQuickInsertProvider(extensionProvider, editorActions, apiRef, createAnalyticsEvent);
|
|
16
16
|
return quickInsertProvider && extensionQuickInsertProvider ? combineQuickInsertProviders([quickInsertProvider, extensionQuickInsertProvider]) : quickInsertProvider || extensionQuickInsertProvider;
|
|
17
17
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "203.6.
|
|
2
|
+
export const version = "203.6.4";
|
|
@@ -4,11 +4,20 @@ import prepareExtensionProvider from '../../utils/prepare-extension-provider';
|
|
|
4
4
|
import prepareQuickInsertProvider from '../../utils/prepare-quick-insert-provider';
|
|
5
5
|
import getProvidersFromEditorProps from '../utils/getProvidersFromEditorProps';
|
|
6
6
|
import handleProviders from '../utils/handleProviders';
|
|
7
|
-
function
|
|
7
|
+
function useEditorRef(preset) {
|
|
8
|
+
var apiRef = useRef();
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
return preset === null || preset === void 0 ? void 0 : preset.apiResolver.on(function (api) {
|
|
11
|
+
apiRef.current = api;
|
|
12
|
+
});
|
|
13
|
+
}, [preset === null || preset === void 0 ? void 0 : preset.apiResolver]);
|
|
14
|
+
return apiRef;
|
|
15
|
+
}
|
|
16
|
+
function prepareProviders(editorActions, apiRef, quickInsert, extensionProviders, createAnalyticsEvent) {
|
|
8
17
|
var extensionProvider = prepareExtensionProvider(function () {
|
|
9
18
|
return editorActions;
|
|
10
19
|
})(extensionProviders);
|
|
11
|
-
var quickInsertProvider = prepareQuickInsertProvider(editorActions, extensionProvider, quickInsert, createAnalyticsEvent);
|
|
20
|
+
var quickInsertProvider = prepareQuickInsertProvider(editorActions, apiRef, extensionProvider, quickInsert, createAnalyticsEvent);
|
|
12
21
|
return {
|
|
13
22
|
extensionProvider: extensionProvider,
|
|
14
23
|
quickInsertProvider: quickInsertProvider
|
|
@@ -56,14 +65,15 @@ export default function useProviderFactory(props, editorActions, createAnalytics
|
|
|
56
65
|
});
|
|
57
66
|
}, [autoformattingProvider, emojiProvider, mentionProvider, legacyImageUploadProvider, taskDecisionProvider, contextIdentifierProvider, searchProvider, macroProvider, activityProvider, collabEdit, collabEditProvider, presenceProvider]);
|
|
58
67
|
var providerFactory = useRef(new ProviderFactory());
|
|
68
|
+
var editorRef = useEditorRef(props.preset);
|
|
59
69
|
var preparedProviders = useMemo(function () {
|
|
60
70
|
return (
|
|
61
71
|
// Though this will introduce some performance regression related to quick insert
|
|
62
72
|
// loading but we can remove it soon when Forge will move to new API.
|
|
63
73
|
// quickInsert={Promise.resolve(consumerQuickInsert)} is one of the main reason behind this performance issue.
|
|
64
|
-
prepareProviders(editorActions, quickInsert, extensionProviders, createAnalyticsEvent)
|
|
74
|
+
prepareProviders(editorActions, editorRef, quickInsert, extensionProviders, createAnalyticsEvent)
|
|
65
75
|
);
|
|
66
|
-
}, [extensionProviders, quickInsert, editorActions, createAnalyticsEvent]);
|
|
76
|
+
}, [extensionProviders, quickInsert, editorActions, createAnalyticsEvent, editorRef]);
|
|
67
77
|
useEffect(function () {
|
|
68
78
|
handleProviders(providerFactory.current, providers, preparedProviders.extensionProvider, preparedProviders.quickInsertProvider);
|
|
69
79
|
}, [providers, preparedProviders]);
|
|
@@ -50,7 +50,9 @@ export function createDefaultPreset(options) {
|
|
|
50
50
|
isFullPage: isFullPage
|
|
51
51
|
})]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
52
52
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
53
|
-
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(primaryToolbarPlugin).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, options.blockType
|
|
53
|
+
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).add(primaryToolbarPlugin).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, _objectSpread(_objectSpread({}, options.blockType), {}, {
|
|
54
|
+
includeBlockQuoteAsTextstyleOption: isFullPage
|
|
55
|
+
})]).add(clearMarksOnEmptyDocPlugin).add([selectionToolbarPlugin, {
|
|
54
56
|
preferenceToolbarAboveSelection: !!options.preferenceToolbarAboveSelection
|
|
55
57
|
}]).add([hyperlinkPlugin, _objectSpread(_objectSpread({}, options.hyperlinkOptions), {}, {
|
|
56
58
|
// @ts-ignore Temporary solution to check for Live Page editor.
|
|
@@ -5,6 +5,7 @@ import Loadable from 'react-loadable';
|
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { getQuickInsertItemsFromModule, resolveImport } from '@atlaskit/editor-common/extensions';
|
|
7
7
|
import { combineProviders } from '@atlaskit/editor-common/provider-helpers';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
/**
|
|
9
10
|
* Utils to send analytics event when a extension is inserted using quickInsert
|
|
10
11
|
*/
|
|
@@ -26,11 +27,11 @@ function sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source) {
|
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
export function extensionProviderToQuickInsertProvider(_x, _x2, _x3) {
|
|
30
|
+
export function extensionProviderToQuickInsertProvider(_x, _x2, _x3, _x4) {
|
|
30
31
|
return _extensionProviderToQuickInsertProvider.apply(this, arguments);
|
|
31
32
|
}
|
|
32
33
|
function _extensionProviderToQuickInsertProvider() {
|
|
33
|
-
_extensionProviderToQuickInsertProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(extensionProvider, editorActions, createAnalyticsEvent) {
|
|
34
|
+
_extensionProviderToQuickInsertProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(extensionProvider, editorActions, apiRef, createAnalyticsEvent) {
|
|
34
35
|
var extensions;
|
|
35
36
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
36
37
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -62,12 +63,30 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
62
63
|
isDisabledOffline: true,
|
|
63
64
|
action: function action(insert, state, source) {
|
|
64
65
|
if (typeof item.node === 'function') {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
if (fg('platform_editor_add_extension_api_to_quick_insert')) {
|
|
67
|
+
var _apiRef$current;
|
|
68
|
+
var extensionAPI = apiRef === null || apiRef === void 0 || (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.extension) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.actions) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.api();
|
|
69
|
+
// While the api can be "undefined" there are no runtime scenarios where this is the case because:
|
|
70
|
+
// - The quick insert API can only be called from an active editor
|
|
71
|
+
// - The extension module handler can only be called from an active editor with the extension plugin
|
|
72
|
+
// Therefore this should always be run unless there is something very wrong.
|
|
73
|
+
if (extensionAPI) {
|
|
74
|
+
resolveImport(item.node(extensionAPI)).then(function (node) {
|
|
75
|
+
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
76
|
+
if (node) {
|
|
77
|
+
editorActions.replaceSelection(node);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
69
80
|
}
|
|
70
|
-
}
|
|
81
|
+
} else {
|
|
82
|
+
// @ts-expect-error No longer supported without extension API - this will be removed once we cleanup the FG.
|
|
83
|
+
resolveImport(item.node()).then(function (node) {
|
|
84
|
+
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
85
|
+
if (node) {
|
|
86
|
+
editorActions.replaceSelection(node);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
71
90
|
return insert('');
|
|
72
91
|
} else {
|
|
73
92
|
sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent, source);
|
|
@@ -87,7 +106,7 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
87
106
|
}));
|
|
88
107
|
return _extensionProviderToQuickInsertProvider.apply(this, arguments);
|
|
89
108
|
}
|
|
90
|
-
export function combineQuickInsertProviders(
|
|
109
|
+
export function combineQuickInsertProviders(_x5) {
|
|
91
110
|
return _combineQuickInsertProviders.apply(this, arguments);
|
|
92
111
|
}
|
|
93
112
|
function _combineQuickInsertProviders() {
|
|
@@ -10,8 +10,8 @@ import { combineQuickInsertProviders, extensionProviderToQuickInsertProvider } f
|
|
|
10
10
|
* @param createAnalyticsEvent
|
|
11
11
|
* @returns Quick insert provider if available
|
|
12
12
|
*/
|
|
13
|
-
export default function prepareQuickInsertProvider(editorActions, extensionProvider, quickInsert, createAnalyticsEvent) {
|
|
13
|
+
export default function prepareQuickInsertProvider(editorActions, apiRef, extensionProvider, quickInsert, createAnalyticsEvent) {
|
|
14
14
|
var quickInsertProvider = quickInsert && typeof quickInsert !== 'boolean' && quickInsert.provider;
|
|
15
|
-
var extensionQuickInsertProvider = extensionProvider && extensionProviderToQuickInsertProvider(extensionProvider, editorActions, createAnalyticsEvent);
|
|
15
|
+
var extensionQuickInsertProvider = extensionProvider && extensionProviderToQuickInsertProvider(extensionProvider, editorActions, apiRef, createAnalyticsEvent);
|
|
16
16
|
return quickInsertProvider && extensionQuickInsertProvider ? combineQuickInsertProviders([quickInsertProvider, extensionQuickInsertProvider]) : quickInsertProvider || extensionQuickInsertProvider;
|
|
17
17
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "203.6.
|
|
2
|
+
export var version = "203.6.4";
|
|
@@ -6523,7 +6523,8 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
6523
6523
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
6524
6524
|
};
|
|
6525
6525
|
commands: {
|
|
6526
|
-
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6526
|
+
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6527
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6527
6528
|
};
|
|
6528
6529
|
}, import("@atlaskit/editor-plugin-block-type").BlockTypePluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
6529
6530
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"typeAhead", {
|
|
@@ -1514,7 +1514,8 @@ export declare function createDefaultPreset(options: DefaultPresetPluginOptions)
|
|
|
1514
1514
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
1515
1515
|
};
|
|
1516
1516
|
commands: {
|
|
1517
|
-
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1517
|
+
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1518
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1518
1519
|
};
|
|
1519
1520
|
}, BlockTypePluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
1520
1521
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"typeAhead", {
|
|
@@ -4330,7 +4331,8 @@ export declare function useDefaultPreset(props: DefaultPresetPluginOptions): Edi
|
|
|
4330
4331
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
4331
4332
|
};
|
|
4332
4333
|
commands: {
|
|
4333
|
-
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
4334
|
+
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
4335
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
4334
4336
|
};
|
|
4335
4337
|
}, BlockTypePluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
4336
4338
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"typeAhead", {
|
|
@@ -6575,7 +6575,8 @@ export default function createUniversalPresetInternal({ appearance, props, featu
|
|
|
6575
6575
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
6576
6576
|
};
|
|
6577
6577
|
commands: {
|
|
6578
|
-
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6578
|
+
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6579
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6579
6580
|
};
|
|
6580
6581
|
}, import("@atlaskit/editor-plugin-block-type").BlockTypePluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
6581
6582
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"typeAhead", {
|
|
@@ -6523,7 +6523,8 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
|
|
|
6523
6523
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
6524
6524
|
};
|
|
6525
6525
|
commands: {
|
|
6526
|
-
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6526
|
+
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6527
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
6527
6528
|
};
|
|
6528
6529
|
}, import("@atlaskit/editor-plugin-block-type").BlockTypePluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
6529
6530
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"typeAhead", {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
2
3
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
4
|
import type { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import { type PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugins/extension';
|
|
4
7
|
import type EditorActions from '../actions';
|
|
5
|
-
export declare function extensionProviderToQuickInsertProvider(extensionProvider: ExtensionProvider, editorActions: EditorActions, createAnalyticsEvent?: CreateUIAnalyticsEvent): Promise<QuickInsertProvider>;
|
|
8
|
+
export declare function extensionProviderToQuickInsertProvider(extensionProvider: ExtensionProvider, editorActions: EditorActions, apiRef: React.MutableRefObject<PublicPluginAPI<[ExtensionPlugin]> | undefined>, createAnalyticsEvent?: CreateUIAnalyticsEvent): Promise<QuickInsertProvider>;
|
|
6
9
|
export declare function combineQuickInsertProviders(quickInsertProviders: Array<QuickInsertProvider | Promise<QuickInsertProvider>>): Promise<QuickInsertProvider>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
2
3
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
4
|
import type { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
5
|
import type { QuickInsertOptions } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { type PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugins/extension';
|
|
5
8
|
import type EditorActions from '../actions';
|
|
6
9
|
/**
|
|
7
10
|
*
|
|
@@ -13,4 +16,4 @@ import type EditorActions from '../actions';
|
|
|
13
16
|
* @param createAnalyticsEvent
|
|
14
17
|
* @returns Quick insert provider if available
|
|
15
18
|
*/
|
|
16
|
-
export default function prepareQuickInsertProvider(editorActions: EditorActions, extensionProvider?: ExtensionProvider, quickInsert?: QuickInsertOptions, createAnalyticsEvent?: CreateUIAnalyticsEvent): Promise<QuickInsertProvider> | undefined;
|
|
19
|
+
export default function prepareQuickInsertProvider(editorActions: EditorActions, apiRef: React.MutableRefObject<PublicPluginAPI<[ExtensionPlugin]> | undefined>, extensionProvider?: ExtensionProvider, quickInsert?: QuickInsertOptions, createAnalyticsEvent?: CreateUIAnalyticsEvent): Promise<QuickInsertProvider> | undefined;
|
|
@@ -7932,7 +7932,8 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
7932
7932
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
7933
7933
|
};
|
|
7934
7934
|
commands: {
|
|
7935
|
-
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7935
|
+
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7936
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7936
7937
|
};
|
|
7937
7938
|
}, import("@atlaskit/editor-plugin-block-type").BlockTypePluginOptions | undefined>,
|
|
7938
7939
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
@@ -1843,7 +1843,8 @@ export declare function createDefaultPreset(options: DefaultPresetPluginOptions)
|
|
|
1843
1843
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
1844
1844
|
};
|
|
1845
1845
|
commands: {
|
|
1846
|
-
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1846
|
+
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1847
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1847
1848
|
};
|
|
1848
1849
|
}, BlockTypePluginOptions | undefined>,
|
|
1849
1850
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
@@ -5262,7 +5263,8 @@ export declare function useDefaultPreset(props: DefaultPresetPluginOptions): Edi
|
|
|
5262
5263
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
5263
5264
|
};
|
|
5264
5265
|
commands: {
|
|
5265
|
-
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
5266
|
+
setTextLevel: (level: import("@atlaskit/editor-plugins/block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
5267
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugins/block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
5266
5268
|
};
|
|
5267
5269
|
}, BlockTypePluginOptions | undefined>,
|
|
5268
5270
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
@@ -7984,7 +7984,8 @@ export default function createUniversalPresetInternal({ appearance, props, featu
|
|
|
7984
7984
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
7985
7985
|
};
|
|
7986
7986
|
commands: {
|
|
7987
|
-
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7987
|
+
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7988
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7988
7989
|
};
|
|
7989
7990
|
}, import("@atlaskit/editor-plugin-block-type").BlockTypePluginOptions | undefined>,
|
|
7990
7991
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
@@ -7932,7 +7932,8 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
|
|
|
7932
7932
|
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").Command;
|
|
7933
7933
|
};
|
|
7934
7934
|
commands: {
|
|
7935
|
-
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7935
|
+
setTextLevel: (level: import("@atlaskit/editor-plugin-block-type").TextBlockTypes, inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod, fromBlockQuote?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7936
|
+
insertBlockQuote: (inputMethod: import("@atlaskit/editor-plugin-block-type").InputMethod) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
7936
7937
|
};
|
|
7937
7938
|
}, import("@atlaskit/editor-plugin-block-type").BlockTypePluginOptions | undefined>,
|
|
7938
7939
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"undoRedoPlugin", {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
2
3
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
4
|
import type { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import { type PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugins/extension';
|
|
4
7
|
import type EditorActions from '../actions';
|
|
5
|
-
export declare function extensionProviderToQuickInsertProvider(extensionProvider: ExtensionProvider, editorActions: EditorActions,
|
|
8
|
+
export declare function extensionProviderToQuickInsertProvider(extensionProvider: ExtensionProvider, editorActions: EditorActions, apiRef: React.MutableRefObject<PublicPluginAPI<[
|
|
9
|
+
ExtensionPlugin
|
|
10
|
+
]> | undefined>, createAnalyticsEvent?: CreateUIAnalyticsEvent): Promise<QuickInsertProvider>;
|
|
6
11
|
export declare function combineQuickInsertProviders(quickInsertProviders: Array<QuickInsertProvider | Promise<QuickInsertProvider>>): Promise<QuickInsertProvider>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
2
3
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
4
|
import type { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
5
|
import type { QuickInsertOptions } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { type PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugins/extension';
|
|
5
8
|
import type EditorActions from '../actions';
|
|
6
9
|
/**
|
|
7
10
|
*
|
|
@@ -13,4 +16,6 @@ import type EditorActions from '../actions';
|
|
|
13
16
|
* @param createAnalyticsEvent
|
|
14
17
|
* @returns Quick insert provider if available
|
|
15
18
|
*/
|
|
16
|
-
export default function prepareQuickInsertProvider(editorActions: EditorActions,
|
|
19
|
+
export default function prepareQuickInsertProvider(editorActions: EditorActions, apiRef: React.MutableRefObject<PublicPluginAPI<[
|
|
20
|
+
ExtensionPlugin
|
|
21
|
+
]> | undefined>, extensionProvider?: ExtensionProvider, quickInsert?: QuickInsertOptions, createAnalyticsEvent?: CreateUIAnalyticsEvent): Promise<QuickInsertProvider> | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "203.6.
|
|
3
|
+
"version": "203.6.4",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/analytics-next": "^10.2.0",
|
|
44
44
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
45
45
|
"@atlaskit/button": "^20.3.0",
|
|
46
|
-
"@atlaskit/editor-common": "^96.
|
|
46
|
+
"@atlaskit/editor-common": "^96.6.0",
|
|
47
47
|
"@atlaskit/editor-json-transformer": "^8.21.0",
|
|
48
48
|
"@atlaskit/editor-plugin-quick-insert": "1.8.0",
|
|
49
49
|
"@atlaskit/editor-plugins": "^5.9.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/mention": "^23.4.0",
|
|
56
56
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
57
57
|
"@atlaskit/task-decision": "^17.11.0",
|
|
58
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
58
|
+
"@atlaskit/tmp-editor-statsig": "^2.28.0",
|
|
59
59
|
"@atlaskit/tokens": "^2.5.0",
|
|
60
60
|
"@atlaskit/tooltip": "^19.0.0",
|
|
61
61
|
"@atlaskit/width-detector": "^4.3.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@atlaskit/visual-regression": "*",
|
|
104
104
|
"@atlassian/adf-schema-json": "^1.22.0",
|
|
105
105
|
"@atlassian/feature-flags-test-utils": "*",
|
|
106
|
-
"@atlassian/search-provider": "3.0.
|
|
106
|
+
"@atlassian/search-provider": "3.0.13",
|
|
107
107
|
"@emotion/jest": "^11.8.0",
|
|
108
108
|
"@storybook/addon-knobs": "^6.4.0",
|
|
109
109
|
"@testing-library/react": "^12.1.5",
|
|
@@ -303,6 +303,9 @@
|
|
|
303
303
|
"platform_editor_disable_rerender_tracking_jira": {
|
|
304
304
|
"type": "boolean"
|
|
305
305
|
},
|
|
306
|
+
"platform_editor_add_extension_api_to_quick_insert": {
|
|
307
|
+
"type": "boolean"
|
|
308
|
+
},
|
|
306
309
|
"platform_editor_ed-25557_lnv_add_ssr_placeholder": {
|
|
307
310
|
"type": "boolean",
|
|
308
311
|
"referenceOnly": true
|
|
@@ -378,6 +381,10 @@
|
|
|
378
381
|
"type": "boolean",
|
|
379
382
|
"referenceOnly": true
|
|
380
383
|
},
|
|
384
|
+
"platform_editor_long_node_expand": {
|
|
385
|
+
"type": "boolean",
|
|
386
|
+
"referenceOnly": true
|
|
387
|
+
},
|
|
381
388
|
"platform_editor_table_row_span_fix": {
|
|
382
389
|
"type": "boolean",
|
|
383
390
|
"referenceOnly": true
|