@atlaskit/editor-core 187.31.6 → 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 +42 -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/extension/ui/Extension/Extension/index.js +11 -2
- 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/extension/ui/Extension/Extension/index.js +13 -2
- 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/extension/ui/Extension/Extension/index.js +11 -2
- 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 +4 -4
|
@@ -121,7 +121,8 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
|
|
|
121
121
|
function filterUndefined(x) {
|
|
122
122
|
return !!x;
|
|
123
123
|
}
|
|
124
|
-
var floatingToolbarPlugin = function floatingToolbarPlugin(
|
|
124
|
+
var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
125
|
+
var api = _ref.api;
|
|
125
126
|
return {
|
|
126
127
|
name: 'floatingToolbar',
|
|
127
128
|
pmPlugins: function pmPlugins() {
|
|
@@ -129,10 +130,10 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
129
130
|
return [{
|
|
130
131
|
// Should be after all toolbar plugins
|
|
131
132
|
name: 'floatingToolbar',
|
|
132
|
-
plugin: function plugin(
|
|
133
|
-
var dispatch =
|
|
134
|
-
providerFactory =
|
|
135
|
-
getIntl =
|
|
133
|
+
plugin: function plugin(_ref2) {
|
|
134
|
+
var dispatch = _ref2.dispatch,
|
|
135
|
+
providerFactory = _ref2.providerFactory,
|
|
136
|
+
getIntl = _ref2.getIntl;
|
|
136
137
|
return floatingToolbarPluginFactory({
|
|
137
138
|
floatingToolbarHandlers: floatingToolbarHandlers,
|
|
138
139
|
dispatch: dispatch,
|
|
@@ -142,8 +143,8 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
142
143
|
}
|
|
143
144
|
}, {
|
|
144
145
|
name: 'floatingToolbarData',
|
|
145
|
-
plugin: function plugin(
|
|
146
|
-
var dispatch =
|
|
146
|
+
plugin: function plugin(_ref3) {
|
|
147
|
+
var dispatch = _ref3.dispatch;
|
|
147
148
|
return (0, _plugin.createPlugin)(dispatch);
|
|
148
149
|
}
|
|
149
150
|
}, {
|
|
@@ -167,13 +168,13 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
167
168
|
floatingToolbarData: _pluginKey.pluginKey.getState(editorState)
|
|
168
169
|
};
|
|
169
170
|
},
|
|
170
|
-
contentComponent: function contentComponent(
|
|
171
|
-
var popupsMountPoint =
|
|
172
|
-
popupsBoundariesElement =
|
|
173
|
-
popupsScrollableElement =
|
|
174
|
-
editorView =
|
|
175
|
-
providerFactory =
|
|
176
|
-
dispatchAnalyticsEvent =
|
|
171
|
+
contentComponent: function contentComponent(_ref4) {
|
|
172
|
+
var popupsMountPoint = _ref4.popupsMountPoint,
|
|
173
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
174
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
175
|
+
editorView = _ref4.editorView,
|
|
176
|
+
providerFactory = _ref4.providerFactory,
|
|
177
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
|
|
177
178
|
return /*#__PURE__*/_react.default.createElement(ContentComponent, {
|
|
178
179
|
editorView: editorView,
|
|
179
180
|
pluginInjectionApi: api,
|
|
@@ -186,22 +187,22 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
};
|
|
189
|
-
function ContentComponent(
|
|
190
|
-
var _pluginInjectionApi$
|
|
191
|
-
var pluginInjectionApi =
|
|
192
|
-
editorView =
|
|
193
|
-
popupsMountPoint =
|
|
194
|
-
popupsBoundariesElement =
|
|
195
|
-
popupsScrollableElement =
|
|
196
|
-
providerFactory =
|
|
197
|
-
dispatchAnalyticsEvent =
|
|
198
|
-
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
190
|
+
function ContentComponent(_ref5) {
|
|
191
|
+
var _pluginInjectionApi$f, _configWithNodeInfo$c, _configWithNodeInfo$c2;
|
|
192
|
+
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
193
|
+
editorView = _ref5.editorView,
|
|
194
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
195
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
196
|
+
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
197
|
+
providerFactory = _ref5.providerFactory,
|
|
198
|
+
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
199
|
+
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.featureFlags) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.sharedState.currentState()) || {};
|
|
199
200
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['floatingToolbar', 'editorDisabled']),
|
|
200
201
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
201
202
|
editorDisabledState = _useSharedPluginState.editorDisabledState;
|
|
202
|
-
var
|
|
203
|
-
configWithNodeInfo =
|
|
204
|
-
floatingToolbarData =
|
|
203
|
+
var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
|
|
204
|
+
configWithNodeInfo = _ref6.configWithNodeInfo,
|
|
205
|
+
floatingToolbarData = _ref6.floatingToolbarData;
|
|
205
206
|
if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
|
|
206
207
|
return null;
|
|
207
208
|
}
|
|
@@ -229,7 +230,7 @@ function ContentComponent(_ref4) {
|
|
|
229
230
|
return null;
|
|
230
231
|
}
|
|
231
232
|
var customPositionCalculation;
|
|
232
|
-
var toolbarItems = (0, _toolbar.processCopyButtonItems)(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
233
|
+
var toolbarItems = (0, _toolbar.processCopyButtonItems)(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.decorations.actions.hoverDecoration);
|
|
233
234
|
if (onPositionCalculated) {
|
|
234
235
|
customPositionCalculation = function customPositionCalculation(nextPos) {
|
|
235
236
|
return onPositionCalculated(editorView, nextPos);
|
|
@@ -240,8 +241,8 @@ function ContentComponent(_ref4) {
|
|
|
240
241
|
};
|
|
241
242
|
|
|
242
243
|
// Confirm dialog
|
|
243
|
-
var
|
|
244
|
-
confirmDialogForItem =
|
|
244
|
+
var _ref7 = floatingToolbarData || {},
|
|
245
|
+
confirmDialogForItem = _ref7.confirmDialogForItem;
|
|
245
246
|
var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
246
247
|
var scrollable = featureFlags.floatingToolbarCopyButton && config.scrollable;
|
|
247
248
|
var confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
|
|
@@ -69,7 +69,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
69
69
|
return (0, _react2.jsx)(_buttonGroup.default, null, items.filter(function (item) {
|
|
70
70
|
return !item.hidden;
|
|
71
71
|
}).map(function (item, idx) {
|
|
72
|
-
var _api$
|
|
72
|
+
var _api$contextPanel;
|
|
73
73
|
switch (item.type) {
|
|
74
74
|
case 'button':
|
|
75
75
|
var ButtonIcon = item.icon;
|
|
@@ -241,7 +241,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
241
241
|
editorView: editorView,
|
|
242
242
|
extensionProvider: extensionsProvider,
|
|
243
243
|
separator: item.separator,
|
|
244
|
-
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$
|
|
244
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange
|
|
245
245
|
});
|
|
246
246
|
case 'separator':
|
|
247
247
|
return (0, _react2.jsx)(_Separator.default, {
|
|
@@ -386,7 +386,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
386
386
|
if (table) {
|
|
387
387
|
return (0, _commands2.clearHoverSelection)()(state, dispatch);
|
|
388
388
|
}
|
|
389
|
-
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.
|
|
389
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.decorations.actions.removeDecoration(state, dispatch);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}, {
|
|
@@ -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
|
}];
|