@atlaskit/editor-core 185.2.23 → 185.2.25
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 +13 -0
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +54 -5
- package/dist/cjs/labs/next/presets/universal.js +6 -5
- package/dist/cjs/plugins/extension/actions.js +6 -4
- package/dist/cjs/plugins/extension/commands.js +19 -16
- package/dist/cjs/plugins/extension/context-panel.js +4 -4
- package/dist/cjs/plugins/extension/extension-api.js +1 -1
- package/dist/cjs/plugins/extension/index.js +11 -4
- package/dist/cjs/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -5
- package/dist/cjs/plugins/extension/toolbar.js +8 -6
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +11 -6
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +5 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/ui/ContextPanel/index.js +9 -2
- package/dist/cjs/utils/action.js +1 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +54 -5
- package/dist/es2019/labs/next/presets/universal.js +7 -6
- package/dist/es2019/plugins/extension/actions.js +6 -4
- package/dist/es2019/plugins/extension/commands.js +6 -7
- package/dist/es2019/plugins/extension/context-panel.js +4 -4
- package/dist/es2019/plugins/extension/extension-api.js +1 -1
- package/dist/es2019/plugins/extension/index.js +11 -4
- package/dist/es2019/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -5
- package/dist/es2019/plugins/extension/toolbar.js +8 -4
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +11 -6
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +5 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/ui/ContextPanel/index.js +8 -1
- package/dist/es2019/utils/action.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/editor-next/hooks/useProviderFactory.js +54 -5
- package/dist/esm/labs/next/presets/universal.js +7 -6
- package/dist/esm/plugins/extension/actions.js +6 -4
- package/dist/esm/plugins/extension/commands.js +18 -15
- package/dist/esm/plugins/extension/context-panel.js +4 -4
- package/dist/esm/plugins/extension/extension-api.js +1 -1
- package/dist/esm/plugins/extension/index.js +11 -4
- package/dist/esm/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/extension/pm-plugins/main.js +10 -5
- package/dist/esm/plugins/extension/toolbar.js +8 -6
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +11 -6
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/ui/ContextPanel/index.js +8 -1
- package/dist/esm/utils/action.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +0 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +18 -2
- package/dist/types/labs/next/presets/default.d.ts +36 -4
- package/dist/types/labs/next/presets/mobile.d.ts +18 -2
- package/dist/types/plugins/extension/actions.d.ts +2 -1
- package/dist/types/plugins/extension/commands.d.ts +4 -3
- package/dist/types/plugins/extension/context-panel.d.ts +2 -1
- package/dist/types/plugins/extension/extension-api.d.ts +2 -0
- package/dist/types/plugins/extension/index.d.ts +4 -2
- package/dist/types/plugins/extension/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/extension/toolbar.d.ts +8 -1
- package/dist/types/plugins/extension/types.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +7 -3
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/editor-next/hooks/useProviderFactory.d.ts +0 -1
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +20 -2
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +40 -4
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +20 -2
- package/dist/types-ts4.5/plugins/extension/actions.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/commands.d.ts +4 -3
- package/dist/types-ts4.5/plugins/extension/context-panel.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +2 -0
- package/dist/types-ts4.5/plugins/extension/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/extension/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +8 -1
- package/dist/types-ts4.5/plugins/extension/types.d.ts +2 -0
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +2 -0
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +7 -3
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/package.json +4 -3
- package/dist/cjs/plugins/context-panel/index.js +0 -66
- package/dist/cjs/plugins/context-panel/transforms.js +0 -13
- package/dist/cjs/plugins/context-panel/types.js +0 -5
- package/dist/es2019/plugins/context-panel/index.js +0 -45
- package/dist/es2019/plugins/context-panel/transforms.js +0 -4
- package/dist/es2019/plugins/context-panel/types.js +0 -1
- package/dist/esm/plugins/context-panel/index.js +0 -57
- package/dist/esm/plugins/context-panel/transforms.js +0 -6
- package/dist/esm/plugins/context-panel/types.js +0 -1
- package/dist/types/plugins/context-panel/index.d.ts +0 -11
- package/dist/types/plugins/context-panel/transforms.d.ts +0 -2
- package/dist/types/plugins/context-panel/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/context-panel/index.d.ts +0 -11
- package/dist/types-ts4.5/plugins/context-panel/transforms.d.ts +0 -2
- package/dist/types-ts4.5/plugins/context-panel/types.d.ts +0 -1
|
@@ -17,7 +17,6 @@ function createNewState(editorActions, quickInsert, extensionProviders, createAn
|
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
* This hook is used to create the provider factory object.
|
|
20
|
-
* WARNING: Consider any changes to also make to `src/editor.tsx`
|
|
21
20
|
*
|
|
22
21
|
* @param props
|
|
23
22
|
* @param editorActions
|
|
@@ -27,7 +26,23 @@ function createNewState(editorActions, quickInsert, extensionProviders, createAn
|
|
|
27
26
|
export default function useProviderFactory(props, editorActions, createAnalyticsEvent) {
|
|
28
27
|
const {
|
|
29
28
|
extensionProviders,
|
|
30
|
-
quickInsert
|
|
29
|
+
quickInsert,
|
|
30
|
+
linking,
|
|
31
|
+
smartLinks,
|
|
32
|
+
UNSAFE_cards,
|
|
33
|
+
autoformattingProvider,
|
|
34
|
+
media,
|
|
35
|
+
emojiProvider,
|
|
36
|
+
mentionProvider,
|
|
37
|
+
legacyImageUploadProvider,
|
|
38
|
+
taskDecisionProvider,
|
|
39
|
+
contextIdentifierProvider,
|
|
40
|
+
searchProvider,
|
|
41
|
+
macroProvider,
|
|
42
|
+
activityProvider,
|
|
43
|
+
collabEdit,
|
|
44
|
+
collabEditProvider,
|
|
45
|
+
presenceProvider
|
|
31
46
|
} = props;
|
|
32
47
|
const providerFactory = useRef(new ProviderFactory());
|
|
33
48
|
const [providerState, setProviderState] = useState(createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent));
|
|
@@ -43,11 +58,45 @@ export default function useProviderFactory(props, editorActions, createAnalytics
|
|
|
43
58
|
quickInsert && quickInsert !== (prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert)) {
|
|
44
59
|
const newState = createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent);
|
|
45
60
|
setProviderState(newState);
|
|
46
|
-
handleProviders(providerFactory.current, getProvidersFromEditorProps(
|
|
61
|
+
handleProviders(providerFactory.current, getProvidersFromEditorProps({
|
|
62
|
+
linking,
|
|
63
|
+
smartLinks,
|
|
64
|
+
UNSAFE_cards,
|
|
65
|
+
autoformattingProvider,
|
|
66
|
+
media,
|
|
67
|
+
emojiProvider,
|
|
68
|
+
mentionProvider,
|
|
69
|
+
legacyImageUploadProvider,
|
|
70
|
+
taskDecisionProvider,
|
|
71
|
+
contextIdentifierProvider,
|
|
72
|
+
searchProvider,
|
|
73
|
+
macroProvider,
|
|
74
|
+
activityProvider,
|
|
75
|
+
collabEdit,
|
|
76
|
+
collabEditProvider,
|
|
77
|
+
presenceProvider
|
|
78
|
+
}), newState.extensionProvider, newState.quickInsertProvider);
|
|
47
79
|
return;
|
|
48
80
|
}
|
|
49
|
-
handleProviders(providerFactory.current, getProvidersFromEditorProps(
|
|
50
|
-
|
|
81
|
+
handleProviders(providerFactory.current, getProvidersFromEditorProps({
|
|
82
|
+
linking,
|
|
83
|
+
smartLinks,
|
|
84
|
+
UNSAFE_cards,
|
|
85
|
+
autoformattingProvider,
|
|
86
|
+
media,
|
|
87
|
+
emojiProvider,
|
|
88
|
+
mentionProvider,
|
|
89
|
+
legacyImageUploadProvider,
|
|
90
|
+
taskDecisionProvider,
|
|
91
|
+
contextIdentifierProvider,
|
|
92
|
+
searchProvider,
|
|
93
|
+
macroProvider,
|
|
94
|
+
activityProvider,
|
|
95
|
+
collabEdit,
|
|
96
|
+
collabEditProvider,
|
|
97
|
+
presenceProvider
|
|
98
|
+
}), providerState.extensionProvider, providerState.quickInsertProvider);
|
|
99
|
+
}, [linking, smartLinks, UNSAFE_cards, autoformattingProvider, media, emojiProvider, mentionProvider, legacyImageUploadProvider, taskDecisionProvider, contextIdentifierProvider, searchProvider, macroProvider, activityProvider, collabEdit, collabEditProvider, presenceProvider, prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert, prevProps === null || prevProps === void 0 ? void 0 : prevProps.extensionProviders, createAnalyticsEvent, editorActions, providerState.extensionProvider, providerState.quickInsertProvider, extensionProviders, quickInsert]);
|
|
51
100
|
|
|
52
101
|
// componentWillUnmount equivalent
|
|
53
102
|
useEffect(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin,
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
|
|
2
|
+
import { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
2
3
|
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
3
4
|
import cardPlugin from '../../../plugins/card';
|
|
4
5
|
import { tablesPlugin } from '@atlaskit/editor-plugin-table';
|
|
@@ -227,6 +228,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
227
228
|
}]);
|
|
228
229
|
}
|
|
229
230
|
return builder;
|
|
231
|
+
}).maybeAdd(contextPanelPlugin, (plugin, builder) => {
|
|
232
|
+
if (isFullPage) {
|
|
233
|
+
return builder.add(contextPanelPlugin);
|
|
234
|
+
}
|
|
235
|
+
return builder;
|
|
230
236
|
}).maybeAdd(extensionPlugin, (plugin, builder) => {
|
|
231
237
|
if (props.allowExtension) {
|
|
232
238
|
const extensionConfig = typeof props.allowExtension === 'object' ? props.allowExtension : {};
|
|
@@ -306,11 +312,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
306
312
|
return builder.add(plugin);
|
|
307
313
|
}
|
|
308
314
|
return builder;
|
|
309
|
-
}).maybeAdd(contextPanelPlugin, (plugin, builder) => {
|
|
310
|
-
if (isFullPage) {
|
|
311
|
-
return builder.add(contextPanelPlugin);
|
|
312
|
-
}
|
|
313
|
-
return builder;
|
|
314
315
|
}).maybeAdd(scrollIntoViewPlugin, (plugin, builder) => {
|
|
315
316
|
if (props.autoScrollIntoView !== false) {
|
|
316
317
|
return builder.add(scrollIntoViewPlugin);
|
|
@@ -132,11 +132,12 @@ export const updateExtensionParams = (updateExtension, node, actions) => async (
|
|
|
132
132
|
export const editSelectedExtension = editorActions => {
|
|
133
133
|
const editorView = editorActions._privateGetEditorView();
|
|
134
134
|
const {
|
|
135
|
-
updateExtension
|
|
135
|
+
updateExtension,
|
|
136
|
+
applyChangeToContextPanel
|
|
136
137
|
} = getPluginState(editorView.state);
|
|
137
|
-
return editExtension(null, updateExtension)(editorView.state, editorView.dispatch, editorView);
|
|
138
|
+
return editExtension(null, applyChangeToContextPanel, updateExtension)(editorView.state, editorView.dispatch, editorView);
|
|
138
139
|
};
|
|
139
|
-
export const editExtension = (macroProvider, updateExtension) => (state, dispatch, view) => {
|
|
140
|
+
export const editExtension = (macroProvider, applyChangeToContextPanel, updateExtension) => (state, dispatch, view) => {
|
|
140
141
|
if (!view) {
|
|
141
142
|
return false;
|
|
142
143
|
}
|
|
@@ -156,7 +157,8 @@ export const editExtension = (macroProvider, updateExtension) => (state, dispatc
|
|
|
156
157
|
if (updateMethod && view) {
|
|
157
158
|
const actions = createExtensionAPI({
|
|
158
159
|
editorView: view,
|
|
159
|
-
editInLegacyMacroBrowser
|
|
160
|
+
editInLegacyMacroBrowser,
|
|
161
|
+
applyChange: applyChangeToContextPanel
|
|
160
162
|
});
|
|
161
163
|
updateExtensionParams(updateMethod, nodeWithPos, actions)(state, dispatch, view);
|
|
162
164
|
return;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { removeSelectedNode, removeParentNodeOfType } from 'prosemirror-utils';
|
|
2
|
-
import { applyChange } from '../context-panel/transforms';
|
|
3
2
|
import { createCommand } from './plugin-factory';
|
|
4
3
|
import { getSelectedExtension } from './utils';
|
|
5
4
|
import { removeConnectedNodes } from '@atlaskit/editor-common/utils';
|
|
@@ -11,7 +10,7 @@ export function updateState(state) {
|
|
|
11
10
|
data: state
|
|
12
11
|
});
|
|
13
12
|
}
|
|
14
|
-
export function setEditingContextToContextPanel(processParametersBefore, processParametersAfter) {
|
|
13
|
+
export function setEditingContextToContextPanel(processParametersBefore, processParametersAfter, applyChangeToContextPanel) {
|
|
15
14
|
return createCommand({
|
|
16
15
|
type: 'UPDATE_STATE',
|
|
17
16
|
data: {
|
|
@@ -19,23 +18,23 @@ export function setEditingContextToContextPanel(processParametersBefore, process
|
|
|
19
18
|
processParametersBefore,
|
|
20
19
|
processParametersAfter
|
|
21
20
|
}
|
|
22
|
-
},
|
|
21
|
+
}, applyChangeToContextPanel);
|
|
23
22
|
}
|
|
24
|
-
export const clearEditingContext = createCommand({
|
|
23
|
+
export const clearEditingContext = applyChangeToContextPanel => createCommand({
|
|
25
24
|
type: 'UPDATE_STATE',
|
|
26
25
|
data: {
|
|
27
26
|
showContextPanel: false,
|
|
28
27
|
processParametersBefore: undefined,
|
|
29
28
|
processParametersAfter: undefined
|
|
30
29
|
}
|
|
31
|
-
},
|
|
32
|
-
export const forceAutoSave = (resolve, reject) => createCommand({
|
|
30
|
+
}, applyChangeToContextPanel);
|
|
31
|
+
export const forceAutoSave = applyChangeToContextPanel => (resolve, reject) => createCommand({
|
|
33
32
|
type: 'UPDATE_STATE',
|
|
34
33
|
data: {
|
|
35
34
|
autoSaveResolve: resolve,
|
|
36
35
|
autoSaveReject: reject
|
|
37
36
|
}
|
|
38
|
-
},
|
|
37
|
+
}, applyChangeToContextPanel);
|
|
39
38
|
export const updateExtensionLayout = layout => createCommand({
|
|
40
39
|
type: 'UPDATE_STATE',
|
|
41
40
|
data: {
|
|
@@ -16,7 +16,7 @@ const areParametersEqual = (firstParameters, secondParameters) => {
|
|
|
16
16
|
}
|
|
17
17
|
return firstParameters === secondParameters;
|
|
18
18
|
};
|
|
19
|
-
export const getContextPanel = (allowAutoSave, featureFlags) => state => {
|
|
19
|
+
export const getContextPanel = (allowAutoSave, featureFlags, applyChange) => state => {
|
|
20
20
|
const nodeWithPos = getSelectedExtension(state, true);
|
|
21
21
|
|
|
22
22
|
// Adding checks to bail out early
|
|
@@ -72,14 +72,14 @@ export const getContextPanel = (allowAutoSave, featureFlags) => state => {
|
|
|
72
72
|
autoSaveResolve();
|
|
73
73
|
}
|
|
74
74
|
if (!allowAutoSave) {
|
|
75
|
-
clearEditingContext(editorView.state, editorView.dispatch);
|
|
75
|
+
clearEditingContext(applyChange)(editorView.state, editorView.dispatch);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
onCancel: async () => {
|
|
79
79
|
if (allowAutoSave) {
|
|
80
80
|
try {
|
|
81
81
|
await new Promise((resolve, reject) => {
|
|
82
|
-
forceAutoSave(resolve, reject)(editorView.state, editorView.dispatch);
|
|
82
|
+
forceAutoSave(applyChange)(resolve, reject)(editorView.state, editorView.dispatch);
|
|
83
83
|
});
|
|
84
84
|
} catch (e) {
|
|
85
85
|
// Even if the save failed, we should proceed with closing the panel
|
|
@@ -87,7 +87,7 @@ export const getContextPanel = (allowAutoSave, featureFlags) => state => {
|
|
|
87
87
|
console.error(`Autosave failed with error`, e);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
clearEditingContext(editorView.state, editorView.dispatch);
|
|
90
|
+
clearEditingContext(applyChange)(editorView.state, editorView.dispatch);
|
|
91
91
|
},
|
|
92
92
|
featureFlags: featureFlags
|
|
93
93
|
});
|
|
@@ -260,7 +260,7 @@ export const createExtensionAPI = options => {
|
|
|
260
260
|
const {
|
|
261
261
|
editorView
|
|
262
262
|
} = options;
|
|
263
|
-
setEditingContextToContextPanel(transformBefore, transformAfter)(editorView.state, editorView.dispatch, editorView);
|
|
263
|
+
setEditingContextToContextPanel(transformBefore, transformAfter, options.applyChange)(editorView.state, editorView.dispatch, editorView);
|
|
264
264
|
},
|
|
265
265
|
_editInLegacyMacroBrowser: () => {
|
|
266
266
|
const {
|
|
@@ -5,7 +5,7 @@ import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
|
|
|
5
5
|
import { getToolbarConfig } from './toolbar';
|
|
6
6
|
import { getContextPanel } from './context-panel';
|
|
7
7
|
const extensionPlugin = (options = {}, api) => {
|
|
8
|
-
var _api$dependencies, _api$dependencies$fea;
|
|
8
|
+
var _api$dependencies, _api$dependencies$fea, _api$dependencies$con2, _api$dependencies$con3;
|
|
9
9
|
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
10
10
|
return {
|
|
11
11
|
name: 'extension',
|
|
@@ -37,15 +37,22 @@ const extensionPlugin = (options = {}, api) => {
|
|
|
37
37
|
}
|
|
38
38
|
}, {
|
|
39
39
|
name: 'extensionKeymap',
|
|
40
|
-
plugin:
|
|
40
|
+
plugin: () => {
|
|
41
|
+
var _api$dependencies$con;
|
|
42
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$dependencies$con = api.dependencies.contextPanel) === null || _api$dependencies$con === void 0 ? void 0 : _api$dependencies$con.actions.applyChange);
|
|
43
|
+
}
|
|
41
44
|
}, {
|
|
42
45
|
name: 'extensionUniqueId',
|
|
43
46
|
plugin: () => createUniqueIdPlugin()
|
|
44
47
|
}];
|
|
45
48
|
},
|
|
46
49
|
pluginsOptions: {
|
|
47
|
-
floatingToolbar: getToolbarConfig(
|
|
48
|
-
|
|
50
|
+
floatingToolbar: getToolbarConfig({
|
|
51
|
+
breakoutEnabled: options.breakoutEnabled,
|
|
52
|
+
hoverDecoration: api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration,
|
|
53
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$dependencies$con2 = api.dependencies.contextPanel) === null || _api$dependencies$con2 === void 0 ? void 0 : _api$dependencies$con2.actions.applyChange
|
|
54
|
+
}),
|
|
55
|
+
contextPanel: getContextPanel(options.allowAutoSave, featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies$con3 = api.dependencies.contextPanel) === null || _api$dependencies$con3 === void 0 ? void 0 : _api$dependencies$con3.actions.applyChange)
|
|
49
56
|
}
|
|
50
57
|
};
|
|
51
58
|
};
|
|
@@ -2,14 +2,14 @@ import { keymap } from 'prosemirror-keymap';
|
|
|
2
2
|
import { getPluginState } from './main';
|
|
3
3
|
import * as keymaps from '../../../keymaps';
|
|
4
4
|
import { clearEditingContext } from '../commands';
|
|
5
|
-
export default function keymapPlugin() {
|
|
5
|
+
export default function keymapPlugin(applyChange) {
|
|
6
6
|
const list = {};
|
|
7
7
|
keymaps.bindKeymapWithCommand(keymaps.escape.common, (state, dispatch) => {
|
|
8
8
|
const extensionState = getPluginState(state);
|
|
9
9
|
if (!extensionState.showContextPanel) {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
|
-
return clearEditingContext(state, dispatch);
|
|
12
|
+
return clearEditingContext(applyChange)(state, dispatch);
|
|
13
13
|
}, list);
|
|
14
14
|
return keymap(list);
|
|
15
15
|
}
|
|
@@ -60,7 +60,8 @@ export const handleUpdate = ({
|
|
|
60
60
|
view,
|
|
61
61
|
prevState,
|
|
62
62
|
domAtPos,
|
|
63
|
-
extensionHandlers
|
|
63
|
+
extensionHandlers,
|
|
64
|
+
applyChange
|
|
64
65
|
}) => {
|
|
65
66
|
const {
|
|
66
67
|
state,
|
|
@@ -78,7 +79,7 @@ export const handleUpdate = ({
|
|
|
78
79
|
const selectedExtension = getSelectedExtension(state, true);
|
|
79
80
|
if (!selectedExtension) {
|
|
80
81
|
if (showContextPanel) {
|
|
81
|
-
clearEditingContext(state, dispatch);
|
|
82
|
+
clearEditingContext(applyChange)(state, dispatch);
|
|
82
83
|
}
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
@@ -96,7 +97,7 @@ export const handleUpdate = ({
|
|
|
96
97
|
element !== newElement;
|
|
97
98
|
if (isNewNodeSelected || shouldUpdateEditButton) {
|
|
98
99
|
if (showContextPanel) {
|
|
99
|
-
clearEditingContext(state, dispatch);
|
|
100
|
+
clearEditingContext(applyChange)(state, dispatch);
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
103
|
const {
|
|
@@ -126,9 +127,11 @@ export const handleUpdate = ({
|
|
|
126
127
|
return true;
|
|
127
128
|
};
|
|
128
129
|
const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi, useLongPressSelection = false, options = {}) => {
|
|
130
|
+
var _pluginInjectionApi$d;
|
|
129
131
|
const state = createPluginState(dispatch, {
|
|
130
132
|
showEditButton: false,
|
|
131
|
-
showContextPanel: false
|
|
133
|
+
showContextPanel: false,
|
|
134
|
+
applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.contextPanel) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.applyChange
|
|
132
135
|
});
|
|
133
136
|
const extensionNodeViewOptions = {
|
|
134
137
|
appearance: options.appearance
|
|
@@ -143,11 +146,13 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
|
|
|
143
146
|
providerFactory.subscribe('contextIdentificationProvider', contextIdentificationProviderHandler);
|
|
144
147
|
return {
|
|
145
148
|
update: (view, prevState) => {
|
|
149
|
+
var _pluginInjectionApi$d2;
|
|
146
150
|
handleUpdate({
|
|
147
151
|
view,
|
|
148
152
|
prevState,
|
|
149
153
|
domAtPos,
|
|
150
|
-
extensionHandlers
|
|
154
|
+
extensionHandlers,
|
|
155
|
+
applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.contextPanel) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions.applyChange
|
|
151
156
|
});
|
|
152
157
|
},
|
|
153
158
|
destroy: () => {
|
|
@@ -95,7 +95,7 @@ const breakoutOptions = (state, formatMessage, extensionState, breakoutEnabled)
|
|
|
95
95
|
}
|
|
96
96
|
return [];
|
|
97
97
|
};
|
|
98
|
-
const editButton = (formatMessage, extensionState) => {
|
|
98
|
+
const editButton = (formatMessage, extensionState, applyChangeToContextPanel) => {
|
|
99
99
|
if (!extensionState.showEditButton) {
|
|
100
100
|
return [];
|
|
101
101
|
}
|
|
@@ -110,7 +110,7 @@ const editButton = (formatMessage, extensionState) => {
|
|
|
110
110
|
const {
|
|
111
111
|
updateExtension
|
|
112
112
|
} = getPluginState(state);
|
|
113
|
-
editExtension(macroState && macroState.macroProvider, updateExtension)(state, dispatch, view);
|
|
113
|
+
editExtension(macroState && macroState.macroProvider, applyChangeToContextPanel, updateExtension)(state, dispatch, view);
|
|
114
114
|
return true;
|
|
115
115
|
},
|
|
116
116
|
title: formatMessage(messages.edit),
|
|
@@ -118,14 +118,18 @@ const editButton = (formatMessage, extensionState) => {
|
|
|
118
118
|
focusEditoronEnter: true
|
|
119
119
|
}];
|
|
120
120
|
};
|
|
121
|
-
export const getToolbarConfig = (
|
|
121
|
+
export const getToolbarConfig = ({
|
|
122
|
+
breakoutEnabled = true,
|
|
123
|
+
hoverDecoration,
|
|
124
|
+
applyChangeToContextPanel
|
|
125
|
+
}) => (state, intl) => {
|
|
122
126
|
const {
|
|
123
127
|
formatMessage
|
|
124
128
|
} = intl;
|
|
125
129
|
const extensionState = getPluginState(state);
|
|
126
130
|
if (extensionState && !extensionState.showContextPanel && extensionState.element) {
|
|
127
131
|
const nodeType = [state.schema.nodes.extension, state.schema.nodes.inlineExtension, state.schema.nodes.bodiedExtension];
|
|
128
|
-
const editButtonArray = editButton(formatMessage, extensionState);
|
|
132
|
+
const editButtonArray = editButton(formatMessage, extensionState, applyChangeToContextPanel);
|
|
129
133
|
const breakoutButtonArray = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled);
|
|
130
134
|
const extensionObj = getSelectedExtension(state, true);
|
|
131
135
|
|
|
@@ -21,7 +21,8 @@ const ExtensionButton = props => {
|
|
|
21
21
|
const {
|
|
22
22
|
item,
|
|
23
23
|
node,
|
|
24
|
-
editorView
|
|
24
|
+
editorView,
|
|
25
|
+
applyChangeToContextPanel
|
|
25
26
|
} = props;
|
|
26
27
|
const ButtonIcon = React.useMemo(() => item.icon ? Loadable({
|
|
27
28
|
loader: async () => resolveExtensionIcon(item.icon),
|
|
@@ -33,7 +34,8 @@ const ExtensionButton = props => {
|
|
|
33
34
|
}
|
|
34
35
|
const targetNodeAdf = nodeToJSON(node);
|
|
35
36
|
const api = createExtensionAPI({
|
|
36
|
-
editorView
|
|
37
|
+
editorView,
|
|
38
|
+
applyChange: applyChangeToContextPanel
|
|
37
39
|
});
|
|
38
40
|
item.action(targetNodeAdf, api);
|
|
39
41
|
};
|
|
@@ -53,7 +55,8 @@ export const ExtensionsPlaceholder = props => {
|
|
|
53
55
|
node,
|
|
54
56
|
editorView,
|
|
55
57
|
extensionProvider,
|
|
56
|
-
separator
|
|
58
|
+
separator,
|
|
59
|
+
applyChangeToContextPanel
|
|
57
60
|
} = props;
|
|
58
61
|
const [extensions, setExtensions] = useState([]);
|
|
59
62
|
useEffect(() => {
|
|
@@ -69,9 +72,10 @@ export const ExtensionsPlaceholder = props => {
|
|
|
69
72
|
const nodeAdf = React.useMemo(() => nodeToJSON(node), [node]);
|
|
70
73
|
const extensionItems = React.useMemo(() => {
|
|
71
74
|
return getContextualToolbarItemsFromModule(extensions, nodeAdf, createExtensionAPI({
|
|
72
|
-
editorView
|
|
75
|
+
editorView,
|
|
76
|
+
applyChange: applyChangeToContextPanel
|
|
73
77
|
}));
|
|
74
|
-
}, [extensions, nodeAdf, editorView]);
|
|
78
|
+
}, [extensions, nodeAdf, editorView, applyChangeToContextPanel]);
|
|
75
79
|
if (!extensionItems.length) {
|
|
76
80
|
return null;
|
|
77
81
|
}
|
|
@@ -86,7 +90,8 @@ export const ExtensionsPlaceholder = props => {
|
|
|
86
90
|
children.push( /*#__PURE__*/React.createElement(ExtensionButton, {
|
|
87
91
|
node: node,
|
|
88
92
|
item: item,
|
|
89
|
-
editorView: editorView
|
|
93
|
+
editorView: editorView,
|
|
94
|
+
applyChangeToContextPanel: applyChangeToContextPanel
|
|
90
95
|
}));
|
|
91
96
|
if (index < extensionItems.length - 1) {
|
|
92
97
|
children.push( /*#__PURE__*/React.createElement(Separator, null));
|
|
@@ -41,7 +41,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
41
41
|
node,
|
|
42
42
|
setDisableScroll,
|
|
43
43
|
mountRef,
|
|
44
|
-
featureFlags
|
|
44
|
+
featureFlags,
|
|
45
|
+
api
|
|
45
46
|
}) => {
|
|
46
47
|
const emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
|
|
47
48
|
const {
|
|
@@ -50,6 +51,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
50
51
|
useSomewhatSemanticTextColorNames: false
|
|
51
52
|
};
|
|
52
53
|
return jsx(ButtonGroup, null, items.filter(item => !item.hidden).map((item, idx) => {
|
|
54
|
+
var _api$dependencies$con;
|
|
53
55
|
switch (item.type) {
|
|
54
56
|
case 'button':
|
|
55
57
|
const ButtonIcon = item.icon;
|
|
@@ -205,7 +207,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
205
207
|
node: node,
|
|
206
208
|
editorView: editorView,
|
|
207
209
|
extensionProvider: extensionsProvider,
|
|
208
|
-
separator: item.separator
|
|
210
|
+
separator: item.separator,
|
|
211
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$dependencies$con = api.dependencies.contextPanel) === null || _api$dependencies$con === void 0 ? void 0 : _api$dependencies$con.actions.applyChange
|
|
209
212
|
});
|
|
210
213
|
case 'separator':
|
|
211
214
|
return jsx(Separator, {
|
|
@@ -52,7 +52,6 @@ export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
|
|
|
52
52
|
export { default as scrollIntoViewPlugin } from './scroll-into-view';
|
|
53
53
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
54
54
|
export { default as findReplacePlugin } from './find-replace';
|
|
55
|
-
export { default as contextPanelPlugin } from './context-panel';
|
|
56
55
|
export { default as selectionPlugin } from './selection';
|
|
57
56
|
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
58
57
|
export { default as clipboardPlugin } from './clipboard';
|
|
@@ -8,7 +8,6 @@ import { N30 } from '@atlaskit/theme/colors';
|
|
|
8
8
|
import { akEditorSwoopCubicBezier, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth, akEditorBreakoutPadding, akEditorContextPanelWidth, ATLASSIAN_NAVIGATION_HEIGHT } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
10
10
|
import WithPluginState from '../WithPluginState';
|
|
11
|
-
import { pluginKey as contextPanelPluginKey } from '../../plugins/context-panel';
|
|
12
11
|
import WithEditorActions from '../WithEditorActions';
|
|
13
12
|
import { getChildBreakoutModes } from '../../utils/document';
|
|
14
13
|
import { WidthContext } from '@atlaskit/editor-common/ui';
|
|
@@ -167,6 +166,14 @@ const widthPluginKey = {
|
|
|
167
166
|
return state['widthPlugin$'];
|
|
168
167
|
}
|
|
169
168
|
};
|
|
169
|
+
|
|
170
|
+
// @ts-ignore
|
|
171
|
+
const contextPanelPluginKey = {
|
|
172
|
+
key: 'contextPanelPluginKey$',
|
|
173
|
+
getState: state => {
|
|
174
|
+
return state['contextPanelPluginKey$'];
|
|
175
|
+
}
|
|
176
|
+
};
|
|
170
177
|
function ContextPanelWithActions({
|
|
171
178
|
actions,
|
|
172
179
|
...props
|
|
@@ -6,7 +6,7 @@ export async function __temporaryFixForConfigPanel(editorView) {
|
|
|
6
6
|
const extensionPluginState = editorView.state && extensionPluginKey.getState(editorView.state);
|
|
7
7
|
if (extensionPluginState && extensionPluginState.showContextPanel) {
|
|
8
8
|
await new Promise(resolve => {
|
|
9
|
-
forceAutoSave(resolve)(editorView.state, editorView.dispatch);
|
|
9
|
+
forceAutoSave(extensionPluginState.applyChangeToContextPanel)(resolve)(editorView.state, editorView.dispatch);
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -20,7 +20,6 @@ function createNewState(editorActions, quickInsert, extensionProviders, createAn
|
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
* This hook is used to create the provider factory object.
|
|
23
|
-
* WARNING: Consider any changes to also make to `src/editor.tsx`
|
|
24
23
|
*
|
|
25
24
|
* @param props
|
|
26
25
|
* @param editorActions
|
|
@@ -29,7 +28,23 @@ function createNewState(editorActions, quickInsert, extensionProviders, createAn
|
|
|
29
28
|
*/
|
|
30
29
|
export default function useProviderFactory(props, editorActions, createAnalyticsEvent) {
|
|
31
30
|
var extensionProviders = props.extensionProviders,
|
|
32
|
-
quickInsert = props.quickInsert
|
|
31
|
+
quickInsert = props.quickInsert,
|
|
32
|
+
linking = props.linking,
|
|
33
|
+
smartLinks = props.smartLinks,
|
|
34
|
+
UNSAFE_cards = props.UNSAFE_cards,
|
|
35
|
+
autoformattingProvider = props.autoformattingProvider,
|
|
36
|
+
media = props.media,
|
|
37
|
+
emojiProvider = props.emojiProvider,
|
|
38
|
+
mentionProvider = props.mentionProvider,
|
|
39
|
+
legacyImageUploadProvider = props.legacyImageUploadProvider,
|
|
40
|
+
taskDecisionProvider = props.taskDecisionProvider,
|
|
41
|
+
contextIdentifierProvider = props.contextIdentifierProvider,
|
|
42
|
+
searchProvider = props.searchProvider,
|
|
43
|
+
macroProvider = props.macroProvider,
|
|
44
|
+
activityProvider = props.activityProvider,
|
|
45
|
+
collabEdit = props.collabEdit,
|
|
46
|
+
collabEditProvider = props.collabEditProvider,
|
|
47
|
+
presenceProvider = props.presenceProvider;
|
|
33
48
|
var providerFactory = useRef(new ProviderFactory());
|
|
34
49
|
var _useState = useState(createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent)),
|
|
35
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -47,11 +62,45 @@ export default function useProviderFactory(props, editorActions, createAnalytics
|
|
|
47
62
|
quickInsert && quickInsert !== (prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert)) {
|
|
48
63
|
var newState = createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent);
|
|
49
64
|
setProviderState(newState);
|
|
50
|
-
handleProviders(providerFactory.current, getProvidersFromEditorProps(
|
|
65
|
+
handleProviders(providerFactory.current, getProvidersFromEditorProps({
|
|
66
|
+
linking: linking,
|
|
67
|
+
smartLinks: smartLinks,
|
|
68
|
+
UNSAFE_cards: UNSAFE_cards,
|
|
69
|
+
autoformattingProvider: autoformattingProvider,
|
|
70
|
+
media: media,
|
|
71
|
+
emojiProvider: emojiProvider,
|
|
72
|
+
mentionProvider: mentionProvider,
|
|
73
|
+
legacyImageUploadProvider: legacyImageUploadProvider,
|
|
74
|
+
taskDecisionProvider: taskDecisionProvider,
|
|
75
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
76
|
+
searchProvider: searchProvider,
|
|
77
|
+
macroProvider: macroProvider,
|
|
78
|
+
activityProvider: activityProvider,
|
|
79
|
+
collabEdit: collabEdit,
|
|
80
|
+
collabEditProvider: collabEditProvider,
|
|
81
|
+
presenceProvider: presenceProvider
|
|
82
|
+
}), newState.extensionProvider, newState.quickInsertProvider);
|
|
51
83
|
return;
|
|
52
84
|
}
|
|
53
|
-
handleProviders(providerFactory.current, getProvidersFromEditorProps(
|
|
54
|
-
|
|
85
|
+
handleProviders(providerFactory.current, getProvidersFromEditorProps({
|
|
86
|
+
linking: linking,
|
|
87
|
+
smartLinks: smartLinks,
|
|
88
|
+
UNSAFE_cards: UNSAFE_cards,
|
|
89
|
+
autoformattingProvider: autoformattingProvider,
|
|
90
|
+
media: media,
|
|
91
|
+
emojiProvider: emojiProvider,
|
|
92
|
+
mentionProvider: mentionProvider,
|
|
93
|
+
legacyImageUploadProvider: legacyImageUploadProvider,
|
|
94
|
+
taskDecisionProvider: taskDecisionProvider,
|
|
95
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
96
|
+
searchProvider: searchProvider,
|
|
97
|
+
macroProvider: macroProvider,
|
|
98
|
+
activityProvider: activityProvider,
|
|
99
|
+
collabEdit: collabEdit,
|
|
100
|
+
collabEditProvider: collabEditProvider,
|
|
101
|
+
presenceProvider: presenceProvider
|
|
102
|
+
}), providerState.extensionProvider, providerState.quickInsertProvider);
|
|
103
|
+
}, [linking, smartLinks, UNSAFE_cards, autoformattingProvider, media, emojiProvider, mentionProvider, legacyImageUploadProvider, taskDecisionProvider, contextIdentifierProvider, searchProvider, macroProvider, activityProvider, collabEdit, collabEditProvider, presenceProvider, prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert, prevProps === null || prevProps === void 0 ? void 0 : prevProps.extensionProviders, createAnalyticsEvent, editorActions, providerState.extensionProvider, providerState.quickInsertProvider, extensionProviders, quickInsert]);
|
|
55
104
|
|
|
56
105
|
// componentWillUnmount equivalent
|
|
57
106
|
useEffect(function () {
|
|
@@ -2,7 +2,8 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin,
|
|
5
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
|
|
6
|
+
import { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
6
7
|
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
7
8
|
import cardPlugin from '../../../plugins/card';
|
|
8
9
|
import { tablesPlugin } from '@atlaskit/editor-plugin-table';
|
|
@@ -225,6 +226,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
225
226
|
}]);
|
|
226
227
|
}
|
|
227
228
|
return builder;
|
|
229
|
+
}).maybeAdd(contextPanelPlugin, function (plugin, builder) {
|
|
230
|
+
if (isFullPage) {
|
|
231
|
+
return builder.add(contextPanelPlugin);
|
|
232
|
+
}
|
|
233
|
+
return builder;
|
|
228
234
|
}).maybeAdd(extensionPlugin, function (plugin, builder) {
|
|
229
235
|
if (props.allowExtension) {
|
|
230
236
|
var extensionConfig = _typeof(props.allowExtension) === 'object' ? props.allowExtension : {};
|
|
@@ -300,11 +306,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
300
306
|
return builder.add(plugin);
|
|
301
307
|
}
|
|
302
308
|
return builder;
|
|
303
|
-
}).maybeAdd(contextPanelPlugin, function (plugin, builder) {
|
|
304
|
-
if (isFullPage) {
|
|
305
|
-
return builder.add(contextPanelPlugin);
|
|
306
|
-
}
|
|
307
|
-
return builder;
|
|
308
309
|
}).maybeAdd(scrollIntoViewPlugin, function (plugin, builder) {
|
|
309
310
|
if (props.autoScrollIntoView !== false) {
|
|
310
311
|
return builder.add(scrollIntoViewPlugin);
|