@atlaskit/editor-core 187.31.7 → 187.32.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 +33 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/cjs/plugins/analytics/plugin.js +14 -12
- package/dist/cjs/plugins/annotation/index.js +15 -13
- package/dist/cjs/plugins/avatar-group/index.js +16 -14
- package/dist/cjs/plugins/base/plugin.js +12 -10
- package/dist/cjs/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/cjs/plugins/block-type/index.js +32 -30
- package/dist/cjs/plugins/breakout/index.js +10 -8
- package/dist/cjs/plugins/caption/index.js +7 -6
- package/dist/cjs/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/code-bidi-warning/index.js +2 -4
- package/dist/cjs/plugins/code-block/index.js +14 -11
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/cjs/plugins/collab-edit/index.js +16 -14
- package/dist/cjs/plugins/collab-edit/plugin.js +5 -5
- package/dist/cjs/plugins/date/index.js +18 -17
- package/dist/cjs/plugins/emoji/index.js +35 -33
- package/dist/cjs/plugins/expand/index.js +14 -13
- package/dist/cjs/plugins/extension/index.js +16 -15
- package/dist/cjs/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/feedback-dialog/index.js +5 -4
- package/dist/cjs/plugins/find-replace/index.js +17 -15
- package/dist/cjs/plugins/floating-toolbar/index.js +31 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/cjs/plugins/help-dialog/index.js +18 -17
- package/dist/cjs/plugins/insert-block/index.js +52 -51
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/cjs/plugins/layout/index.js +15 -14
- package/dist/cjs/plugins/max-content-size/index.js +4 -3
- package/dist/cjs/plugins/media/index.js +49 -47
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/main.js +7 -7
- package/dist/cjs/plugins/media/toolbar/index.js +29 -24
- package/dist/cjs/plugins/media/toolbar/linking.js +4 -4
- package/dist/cjs/plugins/media/toolbar/utils.js +22 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/mentions/index.js +17 -15
- package/dist/cjs/plugins/panel/index.js +13 -12
- package/dist/cjs/plugins/paste/index.js +13 -10
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/cjs/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/cjs/plugins/placeholder/index.js +9 -7
- package/dist/cjs/plugins/placeholder-text/index.js +23 -16
- package/dist/cjs/plugins/quick-insert/index.js +13 -12
- package/dist/cjs/plugins/rule/index.js +8 -7
- package/dist/cjs/plugins/save-on-enter/index.js +4 -3
- package/dist/cjs/plugins/selection/index.js +5 -4
- package/dist/cjs/plugins/status/index.js +20 -14
- package/dist/cjs/plugins/submit-editor/index.js +4 -3
- package/dist/cjs/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/cjs/plugins/text-color/index.js +17 -15
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/cjs/plugins/type-ahead/index.js +21 -20
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/es2019/plugins/analytics/plugin.js +11 -8
- package/dist/es2019/plugins/annotation/index.js +4 -1
- package/dist/es2019/plugins/avatar-group/index.js +8 -5
- package/dist/es2019/plugins/base/plugin.js +6 -3
- package/dist/es2019/plugins/before-primaryToolbar/index.js +4 -2
- package/dist/es2019/plugins/block-type/index.js +14 -11
- package/dist/es2019/plugins/breakout/index.js +6 -3
- package/dist/es2019/plugins/caption/index.js +3 -1
- package/dist/es2019/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/code-bidi-warning/index.js +2 -4
- package/dist/es2019/plugins/code-block/index.js +15 -9
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/es2019/plugins/collab-edit/index.js +9 -6
- package/dist/es2019/plugins/collab-edit/plugin.js +5 -5
- package/dist/es2019/plugins/date/index.js +6 -3
- package/dist/es2019/plugins/emoji/index.js +16 -13
- package/dist/es2019/plugins/expand/index.js +7 -4
- package/dist/es2019/plugins/extension/index.js +11 -8
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/feedback-dialog/index.js +4 -2
- package/dist/es2019/plugins/find-replace/index.js +8 -5
- package/dist/es2019/plugins/floating-toolbar/index.js +6 -4
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/es2019/plugins/help-dialog/index.js +9 -6
- package/dist/es2019/plugins/insert-block/index.js +12 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/es2019/plugins/layout/index.js +8 -5
- package/dist/es2019/plugins/max-content-size/index.js +3 -1
- package/dist/es2019/plugins/media/index.js +14 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -7
- package/dist/es2019/plugins/media/toolbar/index.js +29 -25
- package/dist/es2019/plugins/media/toolbar/linking.js +4 -4
- package/dist/es2019/plugins/media/toolbar/utils.js +18 -0
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/es2019/plugins/mentions/index.js +9 -6
- package/dist/es2019/plugins/panel/index.js +5 -2
- package/dist/es2019/plugins/paste/index.js +9 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/es2019/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/es2019/plugins/placeholder/index.js +10 -7
- package/dist/es2019/plugins/placeholder-text/index.js +12 -4
- package/dist/es2019/plugins/quick-insert/index.js +3 -1
- package/dist/es2019/plugins/rule/index.js +5 -3
- package/dist/es2019/plugins/save-on-enter/index.js +3 -1
- package/dist/es2019/plugins/selection/index.js +3 -1
- package/dist/es2019/plugins/status/index.js +11 -3
- package/dist/es2019/plugins/submit-editor/index.js +3 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +6 -4
- package/dist/es2019/plugins/text-color/index.js +6 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +9 -5
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/es2019/plugins/type-ahead/index.js +3 -1
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
- package/dist/es2019/use-preset.js +2 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/esm/plugins/analytics/plugin.js +14 -12
- package/dist/esm/plugins/annotation/index.js +15 -13
- package/dist/esm/plugins/avatar-group/index.js +16 -14
- package/dist/esm/plugins/base/plugin.js +12 -10
- package/dist/esm/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/esm/plugins/block-type/index.js +32 -30
- package/dist/esm/plugins/breakout/index.js +10 -8
- package/dist/esm/plugins/caption/index.js +7 -6
- package/dist/esm/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/code-bidi-warning/index.js +2 -4
- package/dist/esm/plugins/code-block/index.js +14 -11
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/esm/plugins/collab-edit/index.js +16 -14
- package/dist/esm/plugins/collab-edit/plugin.js +5 -5
- package/dist/esm/plugins/date/index.js +18 -17
- package/dist/esm/plugins/emoji/index.js +35 -33
- package/dist/esm/plugins/expand/index.js +14 -13
- package/dist/esm/plugins/extension/index.js +16 -15
- package/dist/esm/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/esm/plugins/feedback-dialog/index.js +5 -4
- package/dist/esm/plugins/find-replace/index.js +17 -15
- package/dist/esm/plugins/floating-toolbar/index.js +31 -30
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/esm/plugins/help-dialog/index.js +18 -17
- package/dist/esm/plugins/insert-block/index.js +52 -51
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/esm/plugins/layout/index.js +15 -14
- package/dist/esm/plugins/max-content-size/index.js +4 -3
- package/dist/esm/plugins/media/index.js +49 -47
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -7
- package/dist/esm/plugins/media/toolbar/index.js +30 -25
- package/dist/esm/plugins/media/toolbar/linking.js +4 -4
- package/dist/esm/plugins/media/toolbar/utils.js +19 -0
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/esm/plugins/mentions/index.js +17 -15
- package/dist/esm/plugins/panel/index.js +13 -12
- package/dist/esm/plugins/paste/index.js +13 -10
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/esm/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/esm/plugins/placeholder/index.js +9 -7
- package/dist/esm/plugins/placeholder-text/index.js +23 -16
- package/dist/esm/plugins/quick-insert/index.js +13 -12
- package/dist/esm/plugins/rule/index.js +8 -7
- package/dist/esm/plugins/save-on-enter/index.js +4 -3
- package/dist/esm/plugins/selection/index.js +5 -4
- package/dist/esm/plugins/status/index.js +20 -14
- package/dist/esm/plugins/submit-editor/index.js +4 -3
- package/dist/esm/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/esm/plugins/text-color/index.js +17 -15
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/esm/plugins/type-ahead/index.js +21 -20
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +62 -618
- package/dist/types/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types/plugins/caption/index.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types/plugins/media/types.d.ts +1 -0
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/use-preset.d.ts +2 -2
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +96 -716
- package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/selection/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/text-color/index.d.ts +3 -2
- package/dist/types-ts4.5/use-preset.d.ts +2 -2
- package/package.json +3 -3
|
@@ -45,29 +45,30 @@ function createPlugin(dispatch, imageEnabled) {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
var helpDialog = function helpDialog() {
|
|
49
|
-
var
|
|
50
|
-
|
|
48
|
+
var helpDialog = function helpDialog(_ref) {
|
|
49
|
+
var _ref$config = _ref.config,
|
|
50
|
+
imageUploadProviderExists = _ref$config === void 0 ? false : _ref$config,
|
|
51
|
+
api = _ref.api;
|
|
51
52
|
return {
|
|
52
53
|
name: 'helpDialog',
|
|
53
54
|
pmPlugins: function pmPlugins() {
|
|
54
55
|
return [{
|
|
55
56
|
name: 'helpDialog',
|
|
56
|
-
plugin: function plugin(
|
|
57
|
-
var dispatch =
|
|
57
|
+
plugin: function plugin(_ref2) {
|
|
58
|
+
var dispatch = _ref2.dispatch;
|
|
58
59
|
return createPlugin(dispatch, imageUploadProviderExists);
|
|
59
60
|
}
|
|
60
61
|
}, {
|
|
61
62
|
name: 'helpDialogKeymap',
|
|
62
63
|
plugin: function plugin() {
|
|
63
|
-
var _api$
|
|
64
|
-
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$
|
|
64
|
+
var _api$analytics;
|
|
65
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
65
66
|
}
|
|
66
67
|
}];
|
|
67
68
|
},
|
|
68
69
|
pluginsOptions: {
|
|
69
|
-
quickInsert: function quickInsert(
|
|
70
|
-
var formatMessage =
|
|
70
|
+
quickInsert: function quickInsert(_ref3) {
|
|
71
|
+
var formatMessage = _ref3.formatMessage;
|
|
71
72
|
return [{
|
|
72
73
|
id: 'helpdialog',
|
|
73
74
|
title: formatMessage(_messages.messages.help),
|
|
@@ -81,10 +82,10 @@ var helpDialog = function helpDialog() {
|
|
|
81
82
|
});
|
|
82
83
|
},
|
|
83
84
|
action: function action(insert) {
|
|
84
|
-
var _api$
|
|
85
|
+
var _api$analytics2;
|
|
85
86
|
var tr = insert('');
|
|
86
87
|
(0, _commands.openHelpCommand)(tr);
|
|
87
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
88
|
+
api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
|
|
88
89
|
action: _analytics.ACTION.HELP_OPENED,
|
|
89
90
|
actionSubject: _analytics.ACTION_SUBJECT.HELP,
|
|
90
91
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.HELP_QUICK_INSERT,
|
|
@@ -98,19 +99,19 @@ var helpDialog = function helpDialog() {
|
|
|
98
99
|
}];
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
|
-
contentComponent: function contentComponent(
|
|
102
|
-
var editorView =
|
|
102
|
+
contentComponent: function contentComponent(_ref4) {
|
|
103
|
+
var editorView = _ref4.editorView;
|
|
103
104
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
104
105
|
plugins: {
|
|
105
106
|
helpDialog: _pluginKey.pluginKey
|
|
106
107
|
},
|
|
107
|
-
render: function render(
|
|
108
|
-
var
|
|
109
|
-
helpDialog =
|
|
108
|
+
render: function render(_ref5) {
|
|
109
|
+
var _ref5$helpDialog = _ref5.helpDialog,
|
|
110
|
+
helpDialog = _ref5$helpDialog === void 0 ? {} : _ref5$helpDialog;
|
|
110
111
|
return /*#__PURE__*/_react.default.createElement(_HelpDialogLoader.HelpDialogLoader, {
|
|
111
112
|
editorView: editorView,
|
|
112
113
|
isVisible: helpDialog.isVisible,
|
|
113
|
-
quickInsertEnabled: !!(api !== null && api !== void 0 && api.
|
|
114
|
+
quickInsertEnabled: !!(api !== null && api !== void 0 && api.quickInsert),
|
|
114
115
|
imageEnabled: helpDialog.imageEnabled
|
|
115
116
|
});
|
|
116
117
|
}
|
|
@@ -34,25 +34,26 @@ var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
|
|
|
34
34
|
return 0;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
var insertBlockPlugin = function insertBlockPlugin() {
|
|
38
|
-
var _api$
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
38
|
+
var _api$featureFlags;
|
|
39
|
+
var _ref$config = _ref.config,
|
|
40
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
41
|
+
api = _ref.api;
|
|
42
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
42
43
|
return {
|
|
43
44
|
name: 'insertBlock',
|
|
44
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
45
|
-
var editorView =
|
|
46
|
-
editorActions =
|
|
47
|
-
dispatchAnalyticsEvent =
|
|
48
|
-
providerFactory =
|
|
49
|
-
popupsMountPoint =
|
|
50
|
-
popupsBoundariesElement =
|
|
51
|
-
popupsScrollableElement =
|
|
52
|
-
toolbarSize =
|
|
53
|
-
disabled =
|
|
54
|
-
isToolbarReducedSpacing =
|
|
55
|
-
isLastItem =
|
|
45
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
46
|
+
var editorView = _ref2.editorView,
|
|
47
|
+
editorActions = _ref2.editorActions,
|
|
48
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
49
|
+
providerFactory = _ref2.providerFactory,
|
|
50
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
51
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
52
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
53
|
+
toolbarSize = _ref2.toolbarSize,
|
|
54
|
+
disabled = _ref2.disabled,
|
|
55
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
56
|
+
isLastItem = _ref2.isLastItem;
|
|
56
57
|
var renderNode = function renderNode(providers) {
|
|
57
58
|
// We will slowly migrate these to use the new approach inside
|
|
58
59
|
// `ToolbarInsertBlockWithInjectionApi` and remove `WithPluginState`
|
|
@@ -66,13 +67,13 @@ var insertBlockPlugin = function insertBlockPlugin() {
|
|
|
66
67
|
placeholderTextState: _pluginKey2.pluginKey,
|
|
67
68
|
layoutState: _layout.pluginKey
|
|
68
69
|
},
|
|
69
|
-
render: function render(
|
|
70
|
-
var blockTypeState =
|
|
71
|
-
mediaState =
|
|
72
|
-
|
|
73
|
-
macroState =
|
|
74
|
-
placeholderTextState =
|
|
75
|
-
layoutState =
|
|
70
|
+
render: function render(_ref3) {
|
|
71
|
+
var blockTypeState = _ref3.blockTypeState,
|
|
72
|
+
mediaState = _ref3.mediaState,
|
|
73
|
+
_ref3$macroState = _ref3.macroState,
|
|
74
|
+
macroState = _ref3$macroState === void 0 ? {} : _ref3$macroState,
|
|
75
|
+
placeholderTextState = _ref3.placeholderTextState,
|
|
76
|
+
layoutState = _ref3.layoutState;
|
|
76
77
|
return /*#__PURE__*/_react.default.createElement(ToolbarInsertBlockWithInjectionApi, {
|
|
77
78
|
pluginInjectionApi: api,
|
|
78
79
|
editorView: editorView,
|
|
@@ -106,28 +107,28 @@ var insertBlockPlugin = function insertBlockPlugin() {
|
|
|
106
107
|
}
|
|
107
108
|
};
|
|
108
109
|
};
|
|
109
|
-
function ToolbarInsertBlockWithInjectionApi(
|
|
110
|
-
var _pluginInjectionApi$
|
|
111
|
-
var editorView =
|
|
112
|
-
editorActions =
|
|
113
|
-
dispatchAnalyticsEvent =
|
|
114
|
-
providerFactory =
|
|
115
|
-
popupsMountPoint =
|
|
116
|
-
popupsBoundariesElement =
|
|
117
|
-
popupsScrollableElement =
|
|
118
|
-
toolbarSize =
|
|
119
|
-
disabled =
|
|
120
|
-
isToolbarReducedSpacing =
|
|
121
|
-
isLastItem =
|
|
122
|
-
providers =
|
|
123
|
-
pluginInjectionApi =
|
|
124
|
-
options =
|
|
125
|
-
blockTypeState =
|
|
126
|
-
mediaState =
|
|
127
|
-
macroState =
|
|
128
|
-
placeholderTextState =
|
|
129
|
-
layoutState =
|
|
130
|
-
featureFlags =
|
|
110
|
+
function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
111
|
+
var _pluginInjectionApi$a2, _pluginInjectionApi$i;
|
|
112
|
+
var editorView = _ref4.editorView,
|
|
113
|
+
editorActions = _ref4.editorActions,
|
|
114
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
115
|
+
providerFactory = _ref4.providerFactory,
|
|
116
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
117
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
118
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
119
|
+
toolbarSize = _ref4.toolbarSize,
|
|
120
|
+
disabled = _ref4.disabled,
|
|
121
|
+
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing,
|
|
122
|
+
isLastItem = _ref4.isLastItem,
|
|
123
|
+
providers = _ref4.providers,
|
|
124
|
+
pluginInjectionApi = _ref4.pluginInjectionApi,
|
|
125
|
+
options = _ref4.options,
|
|
126
|
+
blockTypeState = _ref4.blockTypeState,
|
|
127
|
+
mediaState = _ref4.mediaState,
|
|
128
|
+
macroState = _ref4.macroState,
|
|
129
|
+
placeholderTextState = _ref4.placeholderTextState,
|
|
130
|
+
layoutState = _ref4.layoutState,
|
|
131
|
+
featureFlags = _ref4.featureFlags;
|
|
131
132
|
var buttons = toolbarSizeToButtons(toolbarSize);
|
|
132
133
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji']),
|
|
133
134
|
dateState = _useSharedPluginState.dateState,
|
|
@@ -141,9 +142,9 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
|
141
142
|
* @param name Block name
|
|
142
143
|
*/
|
|
143
144
|
var handleInsertBlockType = _react.default.useCallback(function (name) {
|
|
144
|
-
var _pluginInjectionApi$
|
|
145
|
-
return (0, _commands.insertBlockTypesWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
146
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
145
|
+
var _pluginInjectionApi$a;
|
|
146
|
+
return (0, _commands.insertBlockTypesWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions);
|
|
147
|
+
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions]);
|
|
147
148
|
return /*#__PURE__*/_react.default.createElement(_ToolbarInsertBlock.default, {
|
|
148
149
|
pluginInjectionApi: pluginInjectionApi,
|
|
149
150
|
buttons: buttons,
|
|
@@ -163,9 +164,9 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
|
163
164
|
mediaUploadsEnabled: mediaState && mediaState.allowsUploads,
|
|
164
165
|
onShowMediaPicker: mediaState && mediaState.showMediaPicker,
|
|
165
166
|
mediaSupported: !!mediaState,
|
|
166
|
-
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.
|
|
167
|
+
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
167
168
|
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
168
|
-
handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
169
|
+
handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$i = pluginInjectionApi.imageUpload) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.actions.startUpload,
|
|
169
170
|
availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
|
|
170
171
|
linkSupported: !!hyperlinkState,
|
|
171
172
|
linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
|
|
@@ -169,19 +169,19 @@ var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleLinkPanel", function (inputMethod) {
|
|
172
|
-
var _pluginInjectionApi$
|
|
172
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$h;
|
|
173
173
|
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
174
|
-
return (_pluginInjectionApi$
|
|
174
|
+
return (_pluginInjectionApi$c = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : _pluginInjectionApi$h.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$c !== void 0 ? _pluginInjectionApi$c : false;
|
|
175
175
|
});
|
|
176
176
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertMention", function (inputMethod) {
|
|
177
|
-
var _pluginInjectionApi$
|
|
177
|
+
var _pluginInjectionApi$m;
|
|
178
178
|
var _this$props = _this.props,
|
|
179
179
|
editorView = _this$props.editorView,
|
|
180
180
|
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
181
181
|
if (!editorView) {
|
|
182
182
|
return true;
|
|
183
183
|
}
|
|
184
|
-
var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
184
|
+
var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.mention) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.sharedState.currentState();
|
|
185
185
|
if (pluginState && pluginState.canInsertMention === false) {
|
|
186
186
|
return false;
|
|
187
187
|
}
|
|
@@ -189,13 +189,13 @@ var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
189
189
|
return true;
|
|
190
190
|
});
|
|
191
191
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertTable", function (inputMethod) {
|
|
192
|
-
var _pluginInjectionApi$
|
|
192
|
+
var _pluginInjectionApi$t, _pluginInjectionApi$t2, _pluginInjectionApi$t3, _pluginInjectionApi$t4;
|
|
193
193
|
var _this$props2 = _this.props,
|
|
194
194
|
pluginInjectionApi = _this$props2.pluginInjectionApi,
|
|
195
195
|
editorView = _this$props2.editorView;
|
|
196
196
|
var state = editorView.state,
|
|
197
197
|
dispatch = editorView.dispatch;
|
|
198
|
-
return (_pluginInjectionApi$
|
|
198
|
+
return (_pluginInjectionApi$t = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$t2 = pluginInjectionApi.table) === null || _pluginInjectionApi$t2 === void 0 ? void 0 : (_pluginInjectionApi$t3 = (_pluginInjectionApi$t4 = _pluginInjectionApi$t2.actions).insertTable) === null || _pluginInjectionApi$t3 === void 0 ? void 0 : _pluginInjectionApi$t3.call(_pluginInjectionApi$t4, {
|
|
199
199
|
action: _analytics.ACTION.INSERTED,
|
|
200
200
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
201
201
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
@@ -203,7 +203,7 @@ var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
203
203
|
inputMethod: inputMethod
|
|
204
204
|
},
|
|
205
205
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
206
|
-
})(state, dispatch)) !== null && _pluginInjectionApi$
|
|
206
|
+
})(state, dispatch)) !== null && _pluginInjectionApi$t !== void 0 ? _pluginInjectionApi$t : false;
|
|
207
207
|
});
|
|
208
208
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDate", function (inputMethod) {
|
|
209
209
|
var editorView = _this.props.editorView;
|
|
@@ -280,17 +280,17 @@ var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSelectedEmoji", function (emojiId) {
|
|
283
|
-
var _pluginInjectionApi$
|
|
283
|
+
var _pluginInjectionApi$e;
|
|
284
284
|
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
285
285
|
_this.props.editorView.focus();
|
|
286
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
286
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute((_pluginInjectionApi$e = pluginInjectionApi.emoji) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.commands.insertEmoji(emojiId, _analytics.INPUT_METHOD.PICKER));
|
|
287
287
|
_this.toggleEmojiPicker();
|
|
288
288
|
return true;
|
|
289
289
|
});
|
|
290
290
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openElementBrowser", function () {
|
|
291
|
-
var _pluginInjectionApi$
|
|
291
|
+
var _pluginInjectionApi$q;
|
|
292
292
|
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
293
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
293
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.commands.openElementBrowserModal);
|
|
294
294
|
});
|
|
295
295
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onItemActivated", function (_ref2) {
|
|
296
296
|
var item = _ref2.item,
|
|
@@ -20,9 +20,10 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
|
20
20
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
21
21
|
var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
22
22
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
23
|
-
var layoutPlugin = function layoutPlugin() {
|
|
24
|
-
var
|
|
25
|
-
|
|
23
|
+
var layoutPlugin = function layoutPlugin(_ref) {
|
|
24
|
+
var _ref$config = _ref.config,
|
|
25
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
26
|
+
api = _ref.api;
|
|
26
27
|
return {
|
|
27
28
|
name: 'layout',
|
|
28
29
|
nodes: function nodes() {
|
|
@@ -44,19 +45,19 @@ var layoutPlugin = function layoutPlugin() {
|
|
|
44
45
|
},
|
|
45
46
|
pluginsOptions: {
|
|
46
47
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
47
|
-
var
|
|
48
|
-
pos =
|
|
49
|
-
allowBreakout =
|
|
50
|
-
addSidebarLayouts =
|
|
51
|
-
allowSingleColumnLayout =
|
|
48
|
+
var _ref2 = _pluginKey.pluginKey.getState(state),
|
|
49
|
+
pos = _ref2.pos,
|
|
50
|
+
allowBreakout = _ref2.allowBreakout,
|
|
51
|
+
addSidebarLayouts = _ref2.addSidebarLayouts,
|
|
52
|
+
allowSingleColumnLayout = _ref2.allowSingleColumnLayout;
|
|
52
53
|
if (pos !== null) {
|
|
53
|
-
var _api$
|
|
54
|
-
return (0, _toolbar.buildToolbar)(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api === null || api === void 0 ? void 0 : (_api$
|
|
54
|
+
var _api$decorations$acti;
|
|
55
|
+
return (0, _toolbar.buildToolbar)(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api === null || api === void 0 ? void 0 : (_api$decorations$acti = api.decorations.actions) === null || _api$decorations$acti === void 0 ? void 0 : _api$decorations$acti.hoverDecoration);
|
|
55
56
|
}
|
|
56
57
|
return undefined;
|
|
57
58
|
},
|
|
58
|
-
quickInsert: function quickInsert(
|
|
59
|
-
var formatMessage =
|
|
59
|
+
quickInsert: function quickInsert(_ref3) {
|
|
60
|
+
var formatMessage = _ref3.formatMessage;
|
|
60
61
|
return [{
|
|
61
62
|
id: 'layout',
|
|
62
63
|
title: formatMessage(_messages.messages.columns),
|
|
@@ -67,9 +68,9 @@ var layoutPlugin = function layoutPlugin() {
|
|
|
67
68
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconLayout, null);
|
|
68
69
|
},
|
|
69
70
|
action: function action(insert, state) {
|
|
70
|
-
var _api$
|
|
71
|
+
var _api$analytics, _api$analytics$action;
|
|
71
72
|
var tr = insert((0, _actions.createDefaultLayoutSection)(state));
|
|
72
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
73
|
+
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.attachAnalyticsEvent({
|
|
73
74
|
action: _analytics.ACTION.INSERTED,
|
|
74
75
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
75
76
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.LAYOUT,
|
|
@@ -27,14 +27,15 @@ function createPlugin(dispatch, maxContentSize) {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
var maxContentSizePlugin = function maxContentSizePlugin(
|
|
30
|
+
var maxContentSizePlugin = function maxContentSizePlugin(_ref) {
|
|
31
|
+
var maxContentSize = _ref.config;
|
|
31
32
|
return {
|
|
32
33
|
name: 'maxContentSize',
|
|
33
34
|
pmPlugins: function pmPlugins() {
|
|
34
35
|
return [{
|
|
35
36
|
name: 'maxContentSize',
|
|
36
|
-
plugin: function plugin(
|
|
37
|
-
var dispatch =
|
|
37
|
+
plugin: function plugin(_ref2) {
|
|
38
|
+
var dispatch = _ref2.dispatch;
|
|
38
39
|
return createPlugin(dispatch, maxContentSize);
|
|
39
40
|
}
|
|
40
41
|
}];
|
|
@@ -37,11 +37,12 @@ var _mediaInline = require("./nodeviews/mediaInline");
|
|
|
37
37
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
38
38
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
39
39
|
var _mediaSingle2 = require("./utils/media-single");
|
|
40
|
-
var mediaPlugin = function mediaPlugin() {
|
|
41
|
-
var _api$
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
var mediaPlugin = function mediaPlugin(_ref) {
|
|
41
|
+
var _api$featureFlags;
|
|
42
|
+
var _ref$config = _ref.config,
|
|
43
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
44
|
+
api = _ref.api;
|
|
45
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
45
46
|
return {
|
|
46
47
|
name: 'media',
|
|
47
48
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -51,12 +52,12 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
51
52
|
return _pluginKey.stateKey.getState(editorState) || null;
|
|
52
53
|
},
|
|
53
54
|
nodes: function nodes() {
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
allowMediaGroup =
|
|
57
|
-
|
|
58
|
-
allowMediaSingle =
|
|
59
|
-
mediaFeatureFlags =
|
|
55
|
+
var _ref2 = options || {},
|
|
56
|
+
_ref2$allowMediaGroup = _ref2.allowMediaGroup,
|
|
57
|
+
allowMediaGroup = _ref2$allowMediaGroup === void 0 ? true : _ref2$allowMediaGroup,
|
|
58
|
+
_ref2$allowMediaSingl = _ref2.allowMediaSingle,
|
|
59
|
+
allowMediaSingle = _ref2$allowMediaSingl === void 0 ? false : _ref2$allowMediaSingl,
|
|
60
|
+
mediaFeatureFlags = _ref2.featureFlags;
|
|
60
61
|
var captions = (0, _mediaCommon.getMediaFeatureFlag)('captions', mediaFeatureFlags);
|
|
61
62
|
var allowMediaInline = (0, _mediaCommon.getMediaFeatureFlag)('mediaInline', mediaFeatureFlags);
|
|
62
63
|
var mediaSingleOption = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.extended-resize-experience') ? {
|
|
@@ -95,16 +96,16 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
95
96
|
pmPlugins: function pmPlugins() {
|
|
96
97
|
var pmPlugins = [{
|
|
97
98
|
name: 'media',
|
|
98
|
-
plugin: function plugin(
|
|
99
|
-
var schema =
|
|
100
|
-
dispatch =
|
|
101
|
-
getIntl =
|
|
102
|
-
eventDispatcher =
|
|
103
|
-
providerFactory =
|
|
104
|
-
errorReporter =
|
|
105
|
-
portalProviderAPI =
|
|
106
|
-
reactContext =
|
|
107
|
-
dispatchAnalyticsEvent =
|
|
99
|
+
plugin: function plugin(_ref3) {
|
|
100
|
+
var schema = _ref3.schema,
|
|
101
|
+
dispatch = _ref3.dispatch,
|
|
102
|
+
getIntl = _ref3.getIntl,
|
|
103
|
+
eventDispatcher = _ref3.eventDispatcher,
|
|
104
|
+
providerFactory = _ref3.providerFactory,
|
|
105
|
+
errorReporter = _ref3.errorReporter,
|
|
106
|
+
portalProviderAPI = _ref3.portalProviderAPI,
|
|
107
|
+
reactContext = _ref3.reactContext,
|
|
108
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
108
109
|
return (0, _main.createPlugin)(schema, {
|
|
109
110
|
providerFactory: providerFactory,
|
|
110
111
|
nodeViews: {
|
|
@@ -124,15 +125,15 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
124
125
|
}, {
|
|
125
126
|
name: 'mediaKeymap',
|
|
126
127
|
plugin: function plugin() {
|
|
127
|
-
var _api$
|
|
128
|
-
return (0, _keymap3.default)(options, api === null || api === void 0 ? void 0 : (_api$
|
|
128
|
+
var _api$analytics;
|
|
129
|
+
return (0, _keymap3.default)(options, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
129
130
|
}
|
|
130
131
|
}];
|
|
131
132
|
if (options && options.allowMediaSingle) {
|
|
132
133
|
pmPlugins.push({
|
|
133
134
|
name: 'mediaSingleKeymap',
|
|
134
|
-
plugin: function plugin(
|
|
135
|
-
var schema =
|
|
135
|
+
plugin: function plugin(_ref4) {
|
|
136
|
+
var schema = _ref4.schema;
|
|
136
137
|
return (0, _keymapMediaSingle.default)(schema);
|
|
137
138
|
}
|
|
138
139
|
});
|
|
@@ -144,25 +145,25 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
144
145
|
});
|
|
145
146
|
pmPlugins.push({
|
|
146
147
|
name: 'mediaAltTextKeymap',
|
|
147
|
-
plugin: function plugin(
|
|
148
|
-
var _api$
|
|
149
|
-
var schema =
|
|
150
|
-
return (0, _keymap.default)(schema, api === null || api === void 0 ? void 0 : (_api$
|
|
148
|
+
plugin: function plugin(_ref5) {
|
|
149
|
+
var _api$analytics2;
|
|
150
|
+
var schema = _ref5.schema;
|
|
151
|
+
return (0, _keymap.default)(schema, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
151
152
|
}
|
|
152
153
|
});
|
|
153
154
|
}
|
|
154
155
|
if (options && options.allowLinking) {
|
|
155
156
|
pmPlugins.push({
|
|
156
157
|
name: 'mediaLinking',
|
|
157
|
-
plugin: function plugin(
|
|
158
|
-
var dispatch =
|
|
158
|
+
plugin: function plugin(_ref6) {
|
|
159
|
+
var dispatch = _ref6.dispatch;
|
|
159
160
|
return (0, _linking.default)(dispatch);
|
|
160
161
|
}
|
|
161
162
|
});
|
|
162
163
|
pmPlugins.push({
|
|
163
164
|
name: 'mediaLinkingKeymap',
|
|
164
|
-
plugin: function plugin(
|
|
165
|
-
var schema =
|
|
165
|
+
plugin: function plugin(_ref7) {
|
|
166
|
+
var schema = _ref7.schema;
|
|
166
167
|
return (0, _keymap2.default)(schema);
|
|
167
168
|
}
|
|
168
169
|
});
|
|
@@ -198,16 +199,16 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
198
199
|
});
|
|
199
200
|
return pmPlugins;
|
|
200
201
|
},
|
|
201
|
-
contentComponent: function contentComponent(
|
|
202
|
-
var editorView =
|
|
203
|
-
appearance =
|
|
202
|
+
contentComponent: function contentComponent(_ref8) {
|
|
203
|
+
var editorView = _ref8.editorView,
|
|
204
|
+
appearance = _ref8.appearance;
|
|
204
205
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
205
206
|
editorView: editorView,
|
|
206
207
|
plugins: {
|
|
207
208
|
mediaState: _main.stateKey
|
|
208
209
|
},
|
|
209
|
-
render: function render(
|
|
210
|
-
var mediaState =
|
|
210
|
+
render: function render(_ref9) {
|
|
211
|
+
var mediaState = _ref9.mediaState;
|
|
211
212
|
return /*#__PURE__*/_react.default.createElement(_MediaPicker.MediaPickerComponents, {
|
|
212
213
|
editorDomElement: editorView.dom,
|
|
213
214
|
mediaState: mediaState,
|
|
@@ -217,10 +218,10 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
217
218
|
}
|
|
218
219
|
}));
|
|
219
220
|
},
|
|
220
|
-
secondaryToolbarComponent: function secondaryToolbarComponent(
|
|
221
|
-
var editorView =
|
|
222
|
-
eventDispatcher =
|
|
223
|
-
disabled =
|
|
221
|
+
secondaryToolbarComponent: function secondaryToolbarComponent(_ref10) {
|
|
222
|
+
var editorView = _ref10.editorView,
|
|
223
|
+
eventDispatcher = _ref10.eventDispatcher,
|
|
224
|
+
disabled = _ref10.disabled;
|
|
224
225
|
return /*#__PURE__*/_react.default.createElement(_ToolbarMedia.default, {
|
|
225
226
|
editorView: editorView,
|
|
226
227
|
eventDispatcher: eventDispatcher,
|
|
@@ -230,8 +231,8 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
230
231
|
});
|
|
231
232
|
},
|
|
232
233
|
pluginsOptions: {
|
|
233
|
-
quickInsert: function quickInsert(
|
|
234
|
-
var formatMessage =
|
|
234
|
+
quickInsert: function quickInsert(_ref11) {
|
|
235
|
+
var formatMessage = _ref11.formatMessage;
|
|
235
236
|
return [{
|
|
236
237
|
id: 'media',
|
|
237
238
|
title: formatMessage(_messages.messages.mediaFiles),
|
|
@@ -242,11 +243,11 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
242
243
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconImages, null);
|
|
243
244
|
},
|
|
244
245
|
action: function action(insert, state) {
|
|
245
|
-
var _api$
|
|
246
|
+
var _api$analytics3;
|
|
246
247
|
var pluginState = _main.stateKey.getState(state);
|
|
247
248
|
pluginState === null || pluginState === void 0 ? void 0 : pluginState.showMediaPicker();
|
|
248
249
|
var tr = insert('');
|
|
249
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
250
|
+
api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
|
|
250
251
|
action: _analytics.ACTION.OPENED,
|
|
251
252
|
actionSubject: _analytics.ACTION_SUBJECT.PICKER,
|
|
252
253
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PICKER_CLOUD,
|
|
@@ -268,7 +269,8 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
268
269
|
allowLinking: options && options.allowLinking,
|
|
269
270
|
allowAdvancedToolBarOptions: options && options.allowAdvancedToolBarOptions,
|
|
270
271
|
allowAltTextOnImages: options && options.allowAltTextOnImages,
|
|
271
|
-
altTextValidator: options && options.altTextValidator
|
|
272
|
+
altTextValidator: options && options.altTextValidator,
|
|
273
|
+
fullWidthEnabled: options && options.fullWidthEnabled
|
|
272
274
|
}, api);
|
|
273
275
|
}
|
|
274
276
|
}
|
|
@@ -239,7 +239,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
239
239
|
(_this$captionPlaceHol = _this.captionPlaceHolderRef.current) === null || _this$captionPlaceHol === void 0 ? void 0 : _this$captionPlaceHol.click();
|
|
240
240
|
});
|
|
241
241
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "clickPlaceholder", function () {
|
|
242
|
-
var _pluginInjectionApi$
|
|
242
|
+
var _pluginInjectionApi$a;
|
|
243
243
|
var _this$props = _this.props,
|
|
244
244
|
view = _this$props.view,
|
|
245
245
|
getPos = _this$props.getPos,
|
|
@@ -248,7 +248,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
248
248
|
if (typeof getPos === 'boolean') {
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
(0, _captions.insertAndSelectCaptionFromMediaSinglePos)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
251
|
+
(0, _captions.insertAndSelectCaptionFromMediaSinglePos)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(getPos(), node)(view.state, view.dispatch);
|
|
252
252
|
});
|
|
253
253
|
return _this;
|
|
254
254
|
}
|
|
@@ -243,16 +243,16 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
if ((0, _mediaSingle.isMediaSingle)(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
246
|
-
var _this$pluginInjection, _pluginInjectionApi$
|
|
246
|
+
var _this$pluginInjection, _pluginInjectionApi$a;
|
|
247
247
|
// read width state right before inserting to get up-to-date and define values
|
|
248
|
-
var widthPluginState = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.
|
|
249
|
-
(0, _mediaSingle.insertMediaSingleNode)(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
248
|
+
var widthPluginState = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.width.sharedState.currentState();
|
|
249
|
+
(0, _mediaSingle.insertMediaSingleNode)(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions);
|
|
250
250
|
} else if ((0, _mediaCommon2.getMediaFeatureFlag)('mediaInline', (_this$mediaOptions2 = _this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !(0, _document.isInEmptyLine)(state) && (!(0, _mediaCommon.isInsidePotentialEmptyParagraph)(state) || (0, _utils3.isInListItem)(state)) && (0, _mediaFiles.canInsertMediaInline)(state)) {
|
|
251
|
-
var _pluginInjectionApi$
|
|
252
|
-
(0, _mediaFiles.insertMediaInlineNode)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
251
|
+
var _pluginInjectionApi$a2;
|
|
252
|
+
(0, _mediaFiles.insertMediaInlineNode)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
253
253
|
} else {
|
|
254
|
-
var _pluginInjectionApi$
|
|
255
|
-
(0, _mediaFiles.insertMediaGroupNode)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
254
|
+
var _pluginInjectionApi$a3;
|
|
255
|
+
(0, _mediaFiles.insertMediaGroupNode)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(_this.view, [mediaStateWithContext], collection, _this.getInputMethod(pickerType));
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
// do events when media state changes
|