@atlaskit/editor-core 183.1.1 → 184.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/cjs/i18n/da.js +1 -1
- package/dist/cjs/i18n/en_ZZ.js +8 -34
- package/dist/cjs/i18n/it.js +1 -1
- package/dist/cjs/i18n/nb.js +3 -3
- package/dist/cjs/i18n/nl.js +4 -4
- package/dist/cjs/i18n/pl.js +1 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- package/dist/cjs/i18n/ru.js +1 -1
- package/dist/cjs/i18n/th.js +2 -2
- package/dist/cjs/i18n/uk.js +1 -1
- package/dist/cjs/i18n/vi.js +2 -2
- package/dist/cjs/i18n/zh.js +1 -1
- package/dist/cjs/labs/next/full-page.js +2 -6
- package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/labs/next/presets/universal.js +2 -1
- package/dist/cjs/plugins/breakout/index.js +54 -35
- package/dist/cjs/plugins/card/toolbar.js +4 -3
- package/dist/cjs/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/cjs/plugins/copy-button/commands.js +8 -1
- package/dist/cjs/plugins/extension/index.js +1 -1
- package/dist/cjs/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/cjs/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +34 -4
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/cjs/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/cjs/plugins/help-dialog/index.js +12 -8
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/media/index.js +15 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +53 -34
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/index.js +4 -3
- package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +4 -1
- package/dist/cjs/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/cjs/test-utils.js +6 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +1 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +9 -10
- package/dist/cjs/ui/ContextPanel/index.js +67 -56
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/cjs/ui/Resizer/index.js +8 -8
- package/dist/cjs/ui/WidthEmitter/index.js +10 -4
- package/dist/cjs/utils/clipboard.js +18 -11
- package/dist/cjs/utils/performance/instrumented-plugin.js +14 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/i18n/da.js +1 -1
- package/dist/es2019/i18n/en_ZZ.js +8 -34
- package/dist/es2019/i18n/it.js +1 -1
- package/dist/es2019/i18n/nb.js +3 -3
- package/dist/es2019/i18n/nl.js +4 -4
- package/dist/es2019/i18n/pl.js +1 -1
- package/dist/es2019/i18n/pt_BR.js +1 -1
- package/dist/es2019/i18n/ru.js +1 -1
- package/dist/es2019/i18n/th.js +2 -2
- package/dist/es2019/i18n/uk.js +1 -1
- package/dist/es2019/i18n/vi.js +2 -2
- package/dist/es2019/i18n/zh.js +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -5
- package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +2 -1
- package/dist/es2019/plugins/breakout/index.js +48 -31
- package/dist/es2019/plugins/card/toolbar.js +4 -3
- package/dist/es2019/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/es2019/plugins/copy-button/commands.js +9 -2
- package/dist/es2019/plugins/extension/index.js +1 -1
- package/dist/es2019/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +38 -2
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/es2019/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/es2019/plugins/help-dialog/index.js +14 -9
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/es2019/plugins/media/index.js +15 -5
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +21 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +53 -33
- package/dist/es2019/plugins/media/styles.js +1 -7
- package/dist/es2019/plugins/media/toolbar/index.js +4 -4
- package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +9 -9
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/es2019/test-utils.js +6 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +1 -2
- package/dist/es2019/ui/ContextPanel/index.js +66 -43
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +8 -9
- package/dist/es2019/ui/Resizer/index.js +1 -1
- package/dist/es2019/ui/WidthEmitter/index.js +10 -4
- package/dist/es2019/utils/clipboard.js +12 -7
- package/dist/es2019/utils/performance/instrumented-plugin.js +15 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/i18n/da.js +1 -1
- package/dist/esm/i18n/en_ZZ.js +8 -34
- package/dist/esm/i18n/it.js +1 -1
- package/dist/esm/i18n/nb.js +3 -3
- package/dist/esm/i18n/nl.js +4 -4
- package/dist/esm/i18n/pl.js +1 -1
- package/dist/esm/i18n/pt_BR.js +1 -1
- package/dist/esm/i18n/ru.js +1 -1
- package/dist/esm/i18n/th.js +2 -2
- package/dist/esm/i18n/uk.js +1 -1
- package/dist/esm/i18n/vi.js +2 -2
- package/dist/esm/i18n/zh.js +1 -1
- package/dist/esm/labs/next/full-page.js +2 -5
- package/dist/esm/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +2 -1
- package/dist/esm/plugins/breakout/index.js +54 -35
- package/dist/esm/plugins/card/toolbar.js +4 -3
- package/dist/esm/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/esm/plugins/copy-button/commands.js +9 -2
- package/dist/esm/plugins/extension/index.js +1 -1
- package/dist/esm/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/esm/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +33 -2
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/esm/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/esm/plugins/help-dialog/index.js +12 -8
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/esm/plugins/media/index.js +15 -5
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +54 -35
- package/dist/esm/plugins/media/styles.js +2 -2
- package/dist/esm/plugins/media/toolbar/index.js +4 -3
- package/dist/esm/plugins/media/ui/ImageBorder/styles.js +4 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/esm/test-utils.js +6 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -2
- package/dist/esm/ui/ContextPanel/index.js +64 -53
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/esm/ui/Resizer/index.js +1 -1
- package/dist/esm/ui/WidthEmitter/index.js +10 -4
- package/dist/esm/utils/clipboard.js +16 -10
- package/dist/esm/utils/performance/instrumented-plugin.js +14 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/create-editor/get-plugins.d.ts +2 -0
- package/dist/types/i18n/en_ZZ.d.ts +2 -28
- package/dist/types/index.d.ts +0 -1
- package/dist/types/plugins/breakout/index.d.ts +4 -0
- package/dist/types/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +2 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types/plugins/index.d.ts +0 -3
- package/dist/types/plugins/media/index.d.ts +12 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types/test-utils.d.ts +3 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types/ui/Resizer/types.d.ts +2 -2
- package/dist/types/utils/clipboard.d.ts +1 -0
- package/dist/types-ts4.5/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/get-plugins.d.ts +2 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +2 -28
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/breakout/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types-ts4.5/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types-ts4.5/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types-ts4.5/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/help-dialog/index.d.ts +5 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/media/index.d.ts +9 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types-ts4.5/test-utils.d.ts +3 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/clipboard.d.ts +1 -0
- package/package.json +20 -18
- package/report.api.md +15 -63
- package/dist/cjs/plugins/collab-edit/provider/index.js +0 -5
- package/dist/cjs/plugins/collab-edit/provider/types.js +0 -5
- package/dist/cjs/plugins/grid/index.js +0 -207
- package/dist/cjs/plugins/grid/styles.js +0 -16
- package/dist/cjs/plugins/grid/types.js +0 -5
- package/dist/cjs/plugins/width/index.js +0 -88
- package/dist/cjs/ui/ContextPanel/context.js +0 -89
- package/dist/es2019/plugins/collab-edit/provider/index.js +0 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +0 -1
- package/dist/es2019/plugins/grid/index.js +0 -168
- package/dist/es2019/plugins/grid/styles.js +0 -36
- package/dist/es2019/plugins/grid/types.js +0 -1
- package/dist/es2019/plugins/width/index.js +0 -72
- package/dist/es2019/ui/ContextPanel/context.js +0 -65
- package/dist/esm/plugins/collab-edit/provider/index.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +0 -1
- package/dist/esm/plugins/grid/index.js +0 -191
- package/dist/esm/plugins/grid/styles.js +0 -7
- package/dist/esm/plugins/grid/types.js +0 -1
- package/dist/esm/plugins/width/index.js +0 -78
- package/dist/esm/ui/ContextPanel/context.js +0 -79
- package/dist/types/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types/plugins/grid/index.d.ts +0 -25
- package/dist/types/plugins/grid/styles.d.ts +0 -2
- package/dist/types/plugins/grid/types.d.ts +0 -7
- package/dist/types/plugins/width/index.d.ts +0 -18
- package/dist/types/ui/ContextPanel/context.d.ts +0 -24
- package/dist/types-ts4.5/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/grid/index.d.ts +0 -27
- package/dist/types-ts4.5/plugins/grid/styles.d.ts +0 -2
- package/dist/types-ts4.5/plugins/grid/types.d.ts +0 -7
- package/dist/types-ts4.5/plugins/width/index.d.ts +0 -18
- package/dist/types-ts4.5/ui/ContextPanel/context.d.ts +0 -24
|
@@ -6,7 +6,7 @@ import { openHelp, tooltip } from '../../keymaps';
|
|
|
6
6
|
import WithPluginState from '../../ui/WithPluginState';
|
|
7
7
|
import { HelpDialogLoader } from './ui/HelpDialogLoader';
|
|
8
8
|
import { pluginKey as quickInsertPluginKey } from '../quick-insert';
|
|
9
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID,
|
|
9
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
|
|
11
11
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
12
12
|
import { openHelpCommand } from './commands';
|
|
@@ -37,7 +37,7 @@ export function createPlugin(dispatch, imageEnabled) {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
const helpDialog = (imageUploadProviderExists = false) => ({
|
|
40
|
+
const helpDialog = (imageUploadProviderExists = false, api) => ({
|
|
41
41
|
name: 'helpDialog',
|
|
42
42
|
pmPlugins() {
|
|
43
43
|
return [{
|
|
@@ -47,7 +47,10 @@ const helpDialog = (imageUploadProviderExists = false) => ({
|
|
|
47
47
|
}) => createPlugin(dispatch, imageUploadProviderExists)
|
|
48
48
|
}, {
|
|
49
49
|
name: 'helpDialogKeymap',
|
|
50
|
-
plugin: () =>
|
|
50
|
+
plugin: () => {
|
|
51
|
+
var _api$dependencies$ana;
|
|
52
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions);
|
|
53
|
+
}
|
|
51
54
|
}];
|
|
52
55
|
},
|
|
53
56
|
pluginsOptions: {
|
|
@@ -63,10 +66,11 @@ const helpDialog = (imageUploadProviderExists = false) => ({
|
|
|
63
66
|
icon: () => /*#__PURE__*/React.createElement(QuestionCircleIcon, {
|
|
64
67
|
label: ""
|
|
65
68
|
}),
|
|
66
|
-
action(insert
|
|
69
|
+
action(insert) {
|
|
70
|
+
var _api$dependencies$ana2;
|
|
67
71
|
const tr = insert('');
|
|
68
72
|
openHelpCommand(tr);
|
|
69
|
-
|
|
73
|
+
api === null || api === void 0 ? void 0 : (_api$dependencies$ana2 = api.dependencies.analytics) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.actions.attachAnalyticsEvent({
|
|
70
74
|
action: ACTION.HELP_OPENED,
|
|
71
75
|
actionSubject: ACTION_SUBJECT.HELP,
|
|
72
76
|
actionSubjectId: ACTION_SUBJECT_ID.HELP_QUICK_INSERT,
|
|
@@ -74,7 +78,8 @@ const helpDialog = (imageUploadProviderExists = false) => ({
|
|
|
74
78
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
75
79
|
},
|
|
76
80
|
eventType: EVENT_TYPE.UI
|
|
77
|
-
});
|
|
81
|
+
})(tr);
|
|
82
|
+
return tr;
|
|
78
83
|
}
|
|
79
84
|
}]
|
|
80
85
|
},
|
|
@@ -98,7 +103,7 @@ const helpDialog = (imageUploadProviderExists = false) => ({
|
|
|
98
103
|
});
|
|
99
104
|
}
|
|
100
105
|
});
|
|
101
|
-
const keymapPlugin =
|
|
106
|
+
const keymapPlugin = editorAnalyticsAPI => {
|
|
102
107
|
const list = {};
|
|
103
108
|
keymaps.bindKeymapWithCommand(keymaps.openHelp.common, (state, dispatch) => {
|
|
104
109
|
let {
|
|
@@ -106,7 +111,7 @@ const keymapPlugin = () => {
|
|
|
106
111
|
} = state;
|
|
107
112
|
const isVisible = tr.getMeta(pluginKey);
|
|
108
113
|
if (!isVisible) {
|
|
109
|
-
|
|
114
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
110
115
|
action: ACTION.CLICKED,
|
|
111
116
|
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
112
117
|
actionSubjectId: ACTION_SUBJECT_ID.BUTTON_HELP,
|
|
@@ -114,7 +119,7 @@ const keymapPlugin = () => {
|
|
|
114
119
|
inputMethod: INPUT_METHOD.SHORTCUT
|
|
115
120
|
},
|
|
116
121
|
eventType: EVENT_TYPE.UI
|
|
117
|
-
});
|
|
122
|
+
})(tr);
|
|
118
123
|
openHelpCommand(tr, dispatch);
|
|
119
124
|
}
|
|
120
125
|
return true;
|
|
@@ -33,11 +33,9 @@ export { default as textColorPlugin } from './text-color';
|
|
|
33
33
|
export { default as textFormattingPlugin } from './text-formatting';
|
|
34
34
|
export { default as typeAheadPlugin } from './type-ahead';
|
|
35
35
|
export { default as unsupportedContentPlugin } from './unsupported-content';
|
|
36
|
-
export { default as widthPlugin } from './width';
|
|
37
36
|
export { default as cardPlugin } from './card';
|
|
38
37
|
export { default as floatingToolbarPlugin } from './floating-toolbar';
|
|
39
38
|
export { default as statusPlugin } from './status';
|
|
40
|
-
export { default as gridPlugin } from './grid';
|
|
41
39
|
export { default as breakoutPlugin } from './breakout';
|
|
42
40
|
export { default as alignmentPlugin } from './alignment';
|
|
43
41
|
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
@@ -14,19 +14,26 @@ import ToolbarMedia from './ui/ToolbarMedia';
|
|
|
14
14
|
import { ReactMediaGroupNode } from './nodeviews/mediaGroup';
|
|
15
15
|
import { ReactMediaSingleNode } from './nodeviews/mediaSingle';
|
|
16
16
|
import { floatingToolbar } from './toolbar';
|
|
17
|
-
import {
|
|
17
|
+
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
18
18
|
import { IconImages } from '../quick-insert/assets';
|
|
19
19
|
import WithPluginState from '../../ui/WithPluginState';
|
|
20
20
|
import { MediaPickerComponents } from './ui/MediaPicker';
|
|
21
21
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
22
22
|
import { ReactMediaNode } from './nodeviews/mediaNodeView';
|
|
23
23
|
import { ReactMediaInlineNode } from './nodeviews/mediaInline';
|
|
24
|
+
import { stateKey } from './pm-plugins/plugin-key';
|
|
24
25
|
export { insertMediaSingleNode } from './utils/media-single';
|
|
25
26
|
const mediaPlugin = (options = {}, api) => {
|
|
26
27
|
var _api$dependencies, _api$dependencies$fea;
|
|
27
28
|
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()) || {};
|
|
28
29
|
return {
|
|
29
30
|
name: 'media',
|
|
31
|
+
getSharedState(editorState) {
|
|
32
|
+
if (!editorState) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return stateKey.getState(editorState);
|
|
36
|
+
},
|
|
30
37
|
nodes() {
|
|
31
38
|
const {
|
|
32
39
|
allowMediaGroup = true,
|
|
@@ -80,7 +87,7 @@ const mediaPlugin = (options = {}, api) => {
|
|
|
80
87
|
nodeViews: {
|
|
81
88
|
mediaGroup: ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory, options),
|
|
82
89
|
mediaSingle: ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, options, api),
|
|
83
|
-
media: ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options),
|
|
90
|
+
media: ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options, api),
|
|
84
91
|
mediaInline: ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory)
|
|
85
92
|
},
|
|
86
93
|
errorReporter,
|
|
@@ -207,9 +214,11 @@ const mediaPlugin = (options = {}, api) => {
|
|
|
207
214
|
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
|
|
208
215
|
icon: () => /*#__PURE__*/React.createElement(IconImages, null),
|
|
209
216
|
action(insert, state) {
|
|
217
|
+
var _api$dependencies$ana;
|
|
210
218
|
const pluginState = pluginKey.getState(state);
|
|
211
219
|
pluginState.showMediaPicker();
|
|
212
|
-
|
|
220
|
+
const tr = insert('');
|
|
221
|
+
api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions.attachAnalyticsEvent({
|
|
213
222
|
action: ACTION.OPENED,
|
|
214
223
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
215
224
|
actionSubjectId: ACTION_SUBJECT_ID.PICKER_CLOUD,
|
|
@@ -217,7 +226,8 @@ const mediaPlugin = (options = {}, api) => {
|
|
|
217
226
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
218
227
|
},
|
|
219
228
|
eventType: EVENT_TYPE.UI
|
|
220
|
-
});
|
|
229
|
+
})(tr);
|
|
230
|
+
return tr;
|
|
221
231
|
}
|
|
222
232
|
}],
|
|
223
233
|
floatingToolbar: (state, intl, providerFactory) => floatingToolbar(state, intl, {
|
|
@@ -229,7 +239,7 @@ const mediaPlugin = (options = {}, api) => {
|
|
|
229
239
|
allowAdvancedToolBarOptions: options && options.allowAdvancedToolBarOptions,
|
|
230
240
|
allowAltTextOnImages: options && options.allowAltTextOnImages,
|
|
231
241
|
altTextValidator: options && options.altTextValidator
|
|
232
|
-
})
|
|
242
|
+
}, api)
|
|
233
243
|
}
|
|
234
244
|
};
|
|
235
245
|
};
|
|
@@ -4,11 +4,21 @@ import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-comm
|
|
|
4
4
|
import { NodeSelection } from 'prosemirror-state';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { SelectionBasedNodeView } from '../../../../nodeviews';
|
|
7
|
-
import WithPluginState from '../../../../ui/WithPluginState';
|
|
8
|
-
import { pluginKey as widthPluginKey } from '../../../width';
|
|
9
7
|
import MediaNode from './media';
|
|
10
8
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
11
9
|
import { isMediaBlobUrlFromAttrs } from '../../utils/media-common';
|
|
10
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
const MediaNodeWithProviders = ({
|
|
12
|
+
pluginInjectionApi,
|
|
13
|
+
innerComponent
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
widthState
|
|
17
|
+
} = useSharedPluginState(pluginInjectionApi, ['width']);
|
|
18
|
+
return innerComponent({
|
|
19
|
+
width: widthState
|
|
20
|
+
});
|
|
21
|
+
};
|
|
12
22
|
class MediaNodeView extends SelectionBasedNodeView {
|
|
13
23
|
constructor(...args) {
|
|
14
24
|
super(...args);
|
|
@@ -69,12 +79,12 @@ class MediaNodeView extends SelectionBasedNodeView {
|
|
|
69
79
|
mediaProvider,
|
|
70
80
|
contextIdentifierProvider
|
|
71
81
|
}) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
const {
|
|
83
|
+
pluginInjectionApi
|
|
84
|
+
} = this.reactComponentProps;
|
|
85
|
+
return /*#__PURE__*/React.createElement(MediaNodeWithProviders, {
|
|
86
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
87
|
+
innerComponent: this.renderMediaNodeWithState(mediaProvider, contextIdentifierProvider)
|
|
78
88
|
});
|
|
79
89
|
});
|
|
80
90
|
}
|
|
@@ -124,11 +134,12 @@ class MediaNodeView extends SelectionBasedNodeView {
|
|
|
124
134
|
});
|
|
125
135
|
}
|
|
126
136
|
}
|
|
127
|
-
export const ReactMediaNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}) => (node, view, getPos) => {
|
|
137
|
+
export const ReactMediaNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi) => (node, view, getPos) => {
|
|
128
138
|
const hasIntlContext = true;
|
|
129
139
|
return new MediaNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
130
140
|
eventDispatcher,
|
|
131
141
|
providerFactory,
|
|
132
|
-
mediaOptions
|
|
142
|
+
mediaOptions,
|
|
143
|
+
pluginInjectionApi
|
|
133
144
|
}, undefined, undefined, undefined, hasIntlContext).init();
|
|
134
145
|
};
|
|
@@ -7,11 +7,9 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
7
7
|
import { MediaSingle, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { isNodeSelectedOrInRange } from '../../../utils/nodes';
|
|
10
|
-
import WithPluginState from '../../../ui/WithPluginState';
|
|
11
|
-
import { pluginKey as widthPluginKey } from '../../width';
|
|
12
10
|
import { setNodeSelection, setTextSelection } from '../../../utils';
|
|
13
11
|
import ResizableMediaSingle from '../ui/ResizableMediaSingle';
|
|
14
|
-
import {
|
|
12
|
+
import { MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
|
|
15
13
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
16
14
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
17
15
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
@@ -24,6 +22,7 @@ import ReactNodeView from '../../../nodeviews/ReactNodeView';
|
|
|
24
22
|
import CaptionPlaceholder from '../ui/CaptionPlaceholder';
|
|
25
23
|
import { NodeSelection } from 'prosemirror-state';
|
|
26
24
|
import { insertAndSelectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
25
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
27
26
|
export default class MediaSingleNode extends Component {
|
|
28
27
|
constructor(...args) {
|
|
29
28
|
super(...args);
|
|
@@ -158,12 +157,12 @@ export default class MediaSingleNode extends Component {
|
|
|
158
157
|
(_this$captionPlaceHol = this.captionPlaceHolderRef.current) === null || _this$captionPlaceHol === void 0 ? void 0 : _this$captionPlaceHol.click();
|
|
159
158
|
});
|
|
160
159
|
_defineProperty(this, "displayGrid", (visible, gridType, highlight) => {
|
|
161
|
-
var _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
160
|
+
var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3;
|
|
162
161
|
const {
|
|
163
162
|
pluginInjectionApi,
|
|
164
163
|
view
|
|
165
164
|
} = this.props;
|
|
166
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.grid) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions.displayGrid(view)({
|
|
165
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.grid) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : (_pluginInjectionApi$d3 = _pluginInjectionApi$d2.actions) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.displayGrid(view)({
|
|
167
166
|
visible,
|
|
168
167
|
gridType,
|
|
169
168
|
highlight: highlight
|
|
@@ -321,6 +320,42 @@ _defineProperty(MediaSingleNode, "defaultProps", {
|
|
|
321
320
|
mediaOptions: {}
|
|
322
321
|
});
|
|
323
322
|
_defineProperty(MediaSingleNode, "displayName", 'MediaSingleNode');
|
|
323
|
+
const MediaSingleNodeWrapper = ({
|
|
324
|
+
pluginInjectionApi,
|
|
325
|
+
mediaProvider,
|
|
326
|
+
contextIdentifierProvider,
|
|
327
|
+
node,
|
|
328
|
+
getPos,
|
|
329
|
+
mediaOptions,
|
|
330
|
+
view,
|
|
331
|
+
fullWidthMode,
|
|
332
|
+
selected,
|
|
333
|
+
eventDispatcher,
|
|
334
|
+
dispatchAnalyticsEvent,
|
|
335
|
+
forwardRef
|
|
336
|
+
}) => {
|
|
337
|
+
const {
|
|
338
|
+
widthState,
|
|
339
|
+
mediaState
|
|
340
|
+
} = useSharedPluginState(pluginInjectionApi, ['width', 'media']);
|
|
341
|
+
return jsx(MediaSingleNode, {
|
|
342
|
+
width: widthState.width,
|
|
343
|
+
lineLength: widthState.lineLength,
|
|
344
|
+
node: node,
|
|
345
|
+
getPos: getPos,
|
|
346
|
+
mediaProvider: mediaProvider,
|
|
347
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
348
|
+
mediaOptions: mediaOptions,
|
|
349
|
+
view: view,
|
|
350
|
+
fullWidthMode: fullWidthMode,
|
|
351
|
+
selected: selected,
|
|
352
|
+
eventDispatcher: eventDispatcher,
|
|
353
|
+
mediaPluginState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
|
|
354
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
355
|
+
forwardRef: forwardRef,
|
|
356
|
+
pluginInjectionApi: pluginInjectionApi
|
|
357
|
+
});
|
|
358
|
+
};
|
|
324
359
|
class MediaSingleNodeView extends ReactNodeView {
|
|
325
360
|
constructor(...args) {
|
|
326
361
|
super(...args);
|
|
@@ -404,34 +439,19 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
404
439
|
mediaProvider,
|
|
405
440
|
contextIdentifierProvider
|
|
406
441
|
}) => {
|
|
407
|
-
return jsx(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
node: this.node,
|
|
421
|
-
getPos: getPos,
|
|
422
|
-
mediaProvider: mediaProvider,
|
|
423
|
-
contextIdentifierProvider: contextIdentifierProvider,
|
|
424
|
-
mediaOptions: mediaOptions,
|
|
425
|
-
view: this.view,
|
|
426
|
-
fullWidthMode: fullWidthMode,
|
|
427
|
-
selected: this.isNodeSelected,
|
|
428
|
-
eventDispatcher: eventDispatcher,
|
|
429
|
-
mediaPluginState: mediaPluginState,
|
|
430
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
431
|
-
forwardRef: forwardRef,
|
|
432
|
-
pluginInjectionApi: pluginInjectionApi
|
|
433
|
-
});
|
|
434
|
-
}
|
|
442
|
+
return jsx(MediaSingleNodeWrapper, {
|
|
443
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
444
|
+
mediaProvider: mediaProvider,
|
|
445
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
446
|
+
node: this.node,
|
|
447
|
+
getPos: getPos,
|
|
448
|
+
mediaOptions: mediaOptions,
|
|
449
|
+
view: this.view,
|
|
450
|
+
fullWidthMode: fullWidthMode,
|
|
451
|
+
selected: this.isNodeSelected,
|
|
452
|
+
eventDispatcher: eventDispatcher,
|
|
453
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
454
|
+
forwardRef: forwardRef
|
|
435
455
|
});
|
|
436
456
|
}
|
|
437
457
|
});
|
|
@@ -2,7 +2,7 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { mediaSingleSharedStyle, richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderBoldSize, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorSelectedNodeClassName, akEditorDeleteIconColor } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { N60, B200 } from '@atlaskit/theme/colors';
|
|
5
|
-
import { fileCardImageViewSelector,
|
|
5
|
+
import { fileCardImageViewSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
6
6
|
export const mediaStyles = css`
|
|
7
7
|
.ProseMirror {
|
|
8
8
|
${mediaSingleSharedStyle} & [layout='full-width'] .${richMediaClassName},
|
|
@@ -120,12 +120,6 @@ export const mediaStyles = css`
|
|
|
120
120
|
${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
|
|
121
121
|
transition: background-color 0s, box-shadow 0s;
|
|
122
122
|
}
|
|
123
|
-
.mediaGroupView-content-wrap.danger {
|
|
124
|
-
/* Media inline */
|
|
125
|
-
.${fileCardImageViewSelectedSelector}::after {
|
|
126
|
-
border: 1px solid ${`var(--ds-border-danger, ${akEditorDeleteIconColor})`};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
123
|
/* Danger when nested node or common */
|
|
130
124
|
.danger {
|
|
131
125
|
/* Media single */
|
|
@@ -187,7 +187,7 @@ const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState) => {
|
|
|
187
187
|
}];
|
|
188
188
|
return items;
|
|
189
189
|
};
|
|
190
|
-
const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, mediaLinkingState, getEditorFeatureFlags) => {
|
|
190
|
+
const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, mediaLinkingState, widthPluginDependencyApi, getEditorFeatureFlags) => {
|
|
191
191
|
const {
|
|
192
192
|
mediaSingle
|
|
193
193
|
} = state.schema.nodes;
|
|
@@ -230,7 +230,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
if (allowAdvancedToolBarOptions) {
|
|
233
|
-
toolbarButtons = [...toolbarButtons, ...buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, allowResizing, allowResizingInTables)];
|
|
233
|
+
toolbarButtons = [...toolbarButtons, ...buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPluginDependencyApi, allowResizing, allowResizingInTables)];
|
|
234
234
|
if (toolbarButtons.length) {
|
|
235
235
|
toolbarButtons.push({
|
|
236
236
|
type: 'separator'
|
|
@@ -312,7 +312,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
312
312
|
}, removeButton];
|
|
313
313
|
return items;
|
|
314
314
|
};
|
|
315
|
-
export const floatingToolbar = (state, intl, options = {}) => {
|
|
315
|
+
export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) => {
|
|
316
316
|
const {
|
|
317
317
|
media,
|
|
318
318
|
mediaInline,
|
|
@@ -379,7 +379,7 @@ export const floatingToolbar = (state, intl, options = {}) => {
|
|
|
379
379
|
const element = (_mediaPluginState$ele3 = mediaPluginState.element) === null || _mediaPluginState$ele3 === void 0 ? void 0 : _mediaPluginState$ele3.querySelector(`.${MediaSingleNodeSelector}`);
|
|
380
380
|
return element || mediaPluginState.element;
|
|
381
381
|
};
|
|
382
|
-
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, getEditorFeatureFlags);
|
|
382
|
+
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.width, getEditorFeatureFlags);
|
|
383
383
|
}
|
|
384
384
|
return {
|
|
385
385
|
...baseToolbar,
|
|
@@ -92,6 +92,13 @@ export const line = (size, selected) => css`
|
|
|
92
92
|
transform: translate(-50%, -50%) rotate(135deg);
|
|
93
93
|
}
|
|
94
94
|
`;
|
|
95
|
+
const getHoverStyles = selector => `&:hover ${selector} {
|
|
96
|
+
background: ${`var(--ds-background-neutral-subtle-hovered, ${colors.N20A})`};
|
|
97
|
+
|
|
98
|
+
&:hover {
|
|
99
|
+
background: ${`var(--ds-background-neutral-hovered, ${colors.N30A})`};
|
|
100
|
+
}
|
|
101
|
+
}`;
|
|
95
102
|
export const toolbarButtonWrapper = ({
|
|
96
103
|
enabled,
|
|
97
104
|
isOpen
|
|
@@ -116,13 +123,6 @@ export const toolbarButtonWrapper = ({
|
|
|
116
123
|
margin-left: 1px;
|
|
117
124
|
}
|
|
118
125
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
${!enabled && ` background: ${`var(--ds-background-neutral-subtle-hovered, ${colors.N30A})`};`}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.image-border-toolbar-dropdown {
|
|
125
|
-
${!isOpen && !enabled && `background: ${`var(--ds-background-neutral-subtle-hovered, ${colors.N30A})`};`}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
126
|
+
${!enabled && getHoverStyles('.image-border-toolbar-btn')}
|
|
127
|
+
${!isOpen && !enabled && getHoverStyles('.image-border-toolbar-dropdown')}
|
|
128
128
|
`;
|
|
@@ -29,6 +29,7 @@ import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
|
29
29
|
import { extractSliceFromStep } from '../../../utils/step';
|
|
30
30
|
import { pluginKey as stateKey, createPluginState } from './plugin-factory';
|
|
31
31
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
32
|
+
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
32
33
|
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
33
34
|
const atlassianMarkDownParser = new MarkdownTransformer(schema, md);
|
|
34
35
|
function getMarkdownSlice(text, openStart, openEnd) {
|
|
@@ -158,6 +159,11 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
158
159
|
} = state.schema.nodes;
|
|
159
160
|
const isPastingTextInsidePlaceholderText = ((_state$doc$resolve$no = state.doc.resolve(state.selection.$anchor.pos).nodeAfter) === null || _state$doc$resolve$no === void 0 ? void 0 : _state$doc$resolve$no.type) === placeholder;
|
|
160
161
|
|
|
162
|
+
// Don't add closeHistory if we're pasting over layout columns, as we will appendTransaction
|
|
163
|
+
// to cleanup the layout's structure and we want to keep the paste and re-structuring as
|
|
164
|
+
// one event.
|
|
165
|
+
const isPastingOverLayoutColumns = hasParentNodeOfType(state.schema.nodes.layoutColumn)(state.selection);
|
|
166
|
+
|
|
161
167
|
// don't add closeHistory call if we're pasting a table, as some tables may involve additional
|
|
162
168
|
// appendedTransactions to repair them (if they're partial or incomplete) and we don't want
|
|
163
169
|
// to split those repairing transactions in prosemirror-history when they're being added to the
|
|
@@ -173,7 +179,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
173
179
|
});
|
|
174
180
|
return tableExists;
|
|
175
181
|
});
|
|
176
|
-
if (!isPastingTextInsidePlaceholderText && !isPastingTable) {
|
|
182
|
+
if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns) {
|
|
177
183
|
tr.setMeta(betterTypePluginKey, true);
|
|
178
184
|
}
|
|
179
185
|
addLinkMetadata(view.state.selection, tr, {
|
|
@@ -38,6 +38,9 @@ function lightProcessPluginsList(editorPlugins) {
|
|
|
38
38
|
if (editorPlugin.nodes) {
|
|
39
39
|
acc.nodes.push(...editorPlugin.nodes());
|
|
40
40
|
}
|
|
41
|
+
if (editorPlugin.contentComponent) {
|
|
42
|
+
acc.contentComponents.push(editorPlugin.contentComponent);
|
|
43
|
+
}
|
|
41
44
|
if (editorPlugin.onEditorViewStateUpdated) {
|
|
42
45
|
acc.onEditorViewStateUpdatedCallbacks.push(editorPlugin.onEditorViewStateUpdated);
|
|
43
46
|
}
|
|
@@ -46,6 +49,7 @@ function lightProcessPluginsList(editorPlugins) {
|
|
|
46
49
|
nodes: [],
|
|
47
50
|
marks: [],
|
|
48
51
|
plugins: [],
|
|
52
|
+
contentComponents: [],
|
|
49
53
|
onEditorViewStateUpdatedCallbacks: []
|
|
50
54
|
});
|
|
51
55
|
}
|
|
@@ -66,7 +70,8 @@ export const createPMSchemaAndPlugins = (inputPreset = new EditorPresetBuilder()
|
|
|
66
70
|
return {
|
|
67
71
|
plugins,
|
|
68
72
|
schema,
|
|
69
|
-
onEditorViewStateUpdatedCallbacks: editorConfig.onEditorViewStateUpdatedCallbacks
|
|
73
|
+
onEditorViewStateUpdatedCallbacks: editorConfig.onEditorViewStateUpdatedCallbacks,
|
|
74
|
+
editorConfig
|
|
70
75
|
};
|
|
71
76
|
};
|
|
72
77
|
export { PortalProviderAPI } from './ui/PortalProvider';
|
|
@@ -17,7 +17,7 @@ import WithFlash from '../../WithFlash';
|
|
|
17
17
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
18
18
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
19
19
|
import WidthEmitter from '../../WidthEmitter';
|
|
20
|
-
import { GRID_GUTTER } from '
|
|
20
|
+
import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
|
|
21
21
|
import classnames from 'classnames';
|
|
22
22
|
import { injectIntl } from 'react-intl-next';
|
|
23
23
|
import messages from '../../../messages';
|
|
@@ -5,7 +5,7 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import rafSchedule from 'raf-schd';
|
|
6
6
|
import { akEditorToolbarKeylineHeight } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { fullPageEditorWrapper } from './StyledComponents';
|
|
8
|
-
import { ContextPanelWidthProvider } from '
|
|
8
|
+
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
10
10
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
11
11
|
export class FullPageEditor extends React.Component {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx, useTheme } from '@emotion/react';
|
|
3
3
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
4
|
-
import { ContextPanelConsumer } from '
|
|
4
|
+
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { ClickAreaBlock } from '../../Addon';
|
|
@@ -7,7 +7,7 @@ import FindReplaceToolbarButtonWithState from '../../../plugins/find-replace/Fin
|
|
|
7
7
|
import { BeforePrimaryToolbarWrapper } from '../../../plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper';
|
|
8
8
|
import Toolbar from '../../Toolbar';
|
|
9
9
|
import { mainToolbarStyle, mainToolbarIconBeforeStyle, mainToolbarFirstChildStyle, mainToolbarSecondChildStyle, nonCustomToolbarWrapperStyle, customToolbarWrapperStyle, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
|
|
10
|
-
import { ContextPanelConsumer } from '
|
|
10
|
+
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
11
11
|
import messages from './messages';
|
|
12
12
|
import { ToolbarArrowKeyNavigationProvider } from '../../ToolbarArrowKeyNavigationProvider';
|
|
13
13
|
export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { jsx, css, useTheme } from '@emotion/react';
|
|
4
|
-
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles, resizerStyles } from '@atlaskit/editor-common/styles';
|
|
4
|
+
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles, resizerStyles, gridStyles } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { unsupportedStyles } from '../../plugins/unsupported-content/styles';
|
|
7
7
|
import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
@@ -20,7 +20,6 @@ import { mentionsStyles } from '../../plugins/mentions/styles';
|
|
|
20
20
|
import { emojiStyles } from '../../plugins/emoji/styles';
|
|
21
21
|
import { textFormattingStyles } from '../../plugins/text-formatting/styles';
|
|
22
22
|
import { placeholderTextStyles } from '../../plugins/placeholder-text/styles';
|
|
23
|
-
import { gridStyles } from '../../plugins/grid/styles';
|
|
24
23
|
import { linkStyles } from '../../plugins/hyperlink/styles';
|
|
25
24
|
import { extensionStyles } from '../../plugins/extension/ui/styles';
|
|
26
25
|
import { expandStyles } from '../../plugins/expand/ui/styles';
|