@atlaskit/editor-core 187.31.7 → 187.32.1
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 +40 -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/ScrollButtons.js +29 -24
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +5 -5
- 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/media/utils/media-single.js +19 -4
- 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/ScrollButtons.js +9 -4
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
- 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/media/utils/media-single.js +22 -4
- 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/ScrollButtons.js +28 -23
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +4 -4
- 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/media/utils/media-single.js +19 -4
- 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/floating-toolbar/ui/ScrollButtons.d.ts +3 -3
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -2
- 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/floating-toolbar/ui/ScrollButtons.d.ts +3 -3
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -2
- 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
|
@@ -110,7 +110,8 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
|
|
|
110
110
|
function filterUndefined(x) {
|
|
111
111
|
return !!x;
|
|
112
112
|
}
|
|
113
|
-
var floatingToolbarPlugin = function floatingToolbarPlugin(
|
|
113
|
+
var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
114
|
+
var api = _ref.api;
|
|
114
115
|
return {
|
|
115
116
|
name: 'floatingToolbar',
|
|
116
117
|
pmPlugins: function pmPlugins() {
|
|
@@ -118,10 +119,10 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
118
119
|
return [{
|
|
119
120
|
// Should be after all toolbar plugins
|
|
120
121
|
name: 'floatingToolbar',
|
|
121
|
-
plugin: function plugin(
|
|
122
|
-
var dispatch =
|
|
123
|
-
providerFactory =
|
|
124
|
-
getIntl =
|
|
122
|
+
plugin: function plugin(_ref2) {
|
|
123
|
+
var dispatch = _ref2.dispatch,
|
|
124
|
+
providerFactory = _ref2.providerFactory,
|
|
125
|
+
getIntl = _ref2.getIntl;
|
|
125
126
|
return floatingToolbarPluginFactory({
|
|
126
127
|
floatingToolbarHandlers: floatingToolbarHandlers,
|
|
127
128
|
dispatch: dispatch,
|
|
@@ -131,8 +132,8 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
131
132
|
}
|
|
132
133
|
}, {
|
|
133
134
|
name: 'floatingToolbarData',
|
|
134
|
-
plugin: function plugin(
|
|
135
|
-
var dispatch =
|
|
135
|
+
plugin: function plugin(_ref3) {
|
|
136
|
+
var dispatch = _ref3.dispatch;
|
|
136
137
|
return floatingToolbarDataPluginFactory(dispatch);
|
|
137
138
|
}
|
|
138
139
|
}, {
|
|
@@ -156,13 +157,13 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
156
157
|
floatingToolbarData: dataPluginKey.getState(editorState)
|
|
157
158
|
};
|
|
158
159
|
},
|
|
159
|
-
contentComponent: function contentComponent(
|
|
160
|
-
var popupsMountPoint =
|
|
161
|
-
popupsBoundariesElement =
|
|
162
|
-
popupsScrollableElement =
|
|
163
|
-
editorView =
|
|
164
|
-
providerFactory =
|
|
165
|
-
dispatchAnalyticsEvent =
|
|
160
|
+
contentComponent: function contentComponent(_ref4) {
|
|
161
|
+
var popupsMountPoint = _ref4.popupsMountPoint,
|
|
162
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
163
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
164
|
+
editorView = _ref4.editorView,
|
|
165
|
+
providerFactory = _ref4.providerFactory,
|
|
166
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
|
|
166
167
|
return /*#__PURE__*/React.createElement(ContentComponent, {
|
|
167
168
|
editorView: editorView,
|
|
168
169
|
pluginInjectionApi: api,
|
|
@@ -176,22 +177,22 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
176
177
|
};
|
|
177
178
|
};
|
|
178
179
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
179
|
-
function ContentComponent(
|
|
180
|
-
var _pluginInjectionApi$
|
|
181
|
-
var pluginInjectionApi =
|
|
182
|
-
editorView =
|
|
183
|
-
popupsMountPoint =
|
|
184
|
-
popupsBoundariesElement =
|
|
185
|
-
popupsScrollableElement =
|
|
186
|
-
providerFactory =
|
|
187
|
-
dispatchAnalyticsEvent =
|
|
188
|
-
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
180
|
+
function ContentComponent(_ref5) {
|
|
181
|
+
var _pluginInjectionApi$f, _configWithNodeInfo$c, _configWithNodeInfo$c2;
|
|
182
|
+
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
183
|
+
editorView = _ref5.editorView,
|
|
184
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
185
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
186
|
+
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
187
|
+
providerFactory = _ref5.providerFactory,
|
|
188
|
+
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
189
|
+
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.featureFlags) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.sharedState.currentState()) || {};
|
|
189
190
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled']),
|
|
190
191
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
191
192
|
editorDisabledState = _useSharedPluginState.editorDisabledState;
|
|
192
|
-
var
|
|
193
|
-
configWithNodeInfo =
|
|
194
|
-
floatingToolbarData =
|
|
193
|
+
var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
|
|
194
|
+
configWithNodeInfo = _ref6.configWithNodeInfo,
|
|
195
|
+
floatingToolbarData = _ref6.floatingToolbarData;
|
|
195
196
|
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)) {
|
|
196
197
|
return null;
|
|
197
198
|
}
|
|
@@ -219,7 +220,7 @@ function ContentComponent(_ref4) {
|
|
|
219
220
|
return null;
|
|
220
221
|
}
|
|
221
222
|
var customPositionCalculation;
|
|
222
|
-
var toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
223
|
+
var toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.decorations.actions.hoverDecoration);
|
|
223
224
|
if (onPositionCalculated) {
|
|
224
225
|
customPositionCalculation = function customPositionCalculation(nextPos) {
|
|
225
226
|
return onPositionCalculated(editorView, nextPos);
|
|
@@ -230,8 +231,8 @@ function ContentComponent(_ref4) {
|
|
|
230
231
|
};
|
|
231
232
|
|
|
232
233
|
// Confirm dialog
|
|
233
|
-
var
|
|
234
|
-
confirmDialogForItem =
|
|
234
|
+
var _ref7 = floatingToolbarData || {},
|
|
235
|
+
confirmDialogForItem = _ref7.confirmDialogForItem;
|
|
235
236
|
var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
236
237
|
var scrollable = featureFlags.floatingToolbarCopyButton && config.scrollable;
|
|
237
238
|
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;
|
|
@@ -13,7 +13,7 @@ import rafSchedule from 'raf-schd';
|
|
|
13
13
|
var toolbarScrollButtons = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: ", ";\n padding: ", " ", ";\n border-left: solid ", " 1px;\n flex-shrink: 0;\n align-items: center;\n"])), "var(--ds-space-050, 4px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(N30, ")"));
|
|
14
14
|
var LeftIcon = ChevronLeftLargeIcon;
|
|
15
15
|
var RightIcon = ChevronRightLargeIcon;
|
|
16
|
-
export
|
|
16
|
+
export var ScrollButtons = function ScrollButtons(_ref) {
|
|
17
17
|
var intl = _ref.intl,
|
|
18
18
|
scrollContainerRef = _ref.scrollContainerRef,
|
|
19
19
|
node = _ref.node,
|
|
@@ -31,52 +31,56 @@ export default (function (_ref) {
|
|
|
31
31
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
32
32
|
canScrollRight = _useState6[0],
|
|
33
33
|
setCanScrollRight = _useState6[1];
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
var setCanScrollDebounced = rafSchedule(function () {
|
|
35
|
+
// Refs are null before mounting and after unmount
|
|
36
|
+
if (!scrollContainerRef.current) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var _scrollContainerRef$c = scrollContainerRef.current,
|
|
40
|
+
scrollLeft = _scrollContainerRef$c.scrollLeft,
|
|
41
|
+
scrollWidth = _scrollContainerRef$c.scrollWidth,
|
|
42
|
+
offsetWidth = _scrollContainerRef$c.offsetWidth;
|
|
39
43
|
setCanScrollLeft(scrollLeft > 0);
|
|
40
44
|
setCanScrollRight(scrollLeft + offsetWidth < scrollWidth - 1); // -1 to account for half pixel
|
|
41
45
|
});
|
|
42
46
|
|
|
43
47
|
var onScroll = function onScroll() {
|
|
44
|
-
return
|
|
48
|
+
return setCanScrollDebounced();
|
|
45
49
|
};
|
|
46
50
|
var scrollLeft = function scrollLeft() {
|
|
47
|
-
var _scrollContainerRef$
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
scrollContainerWidth =
|
|
51
|
-
var scrollLeft = ((_scrollContainerRef$
|
|
51
|
+
var _scrollContainerRef$c2, _scrollContainerRef$c3, _scrollContainerRef$c4;
|
|
52
|
+
var _ref2 = ((_scrollContainerRef$c2 = scrollContainerRef.current) === null || _scrollContainerRef$c2 === void 0 ? void 0 : _scrollContainerRef$c2.getBoundingClientRect()) || {},
|
|
53
|
+
_ref2$width = _ref2.width,
|
|
54
|
+
scrollContainerWidth = _ref2$width === void 0 ? 0 : _ref2$width;
|
|
55
|
+
var scrollLeft = ((_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.scrollLeft) || 0;
|
|
52
56
|
|
|
53
57
|
// scroll to current position - scroll container width
|
|
54
58
|
var scrollTo = scrollLeft - scrollContainerWidth;
|
|
55
|
-
(_scrollContainerRef$
|
|
59
|
+
(_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 ? void 0 : _scrollContainerRef$c4.scrollTo({
|
|
56
60
|
top: 0,
|
|
57
61
|
left: scrollTo,
|
|
58
62
|
behavior: 'smooth'
|
|
59
63
|
});
|
|
60
64
|
};
|
|
61
65
|
var scrollRight = function scrollRight() {
|
|
62
|
-
var _scrollContainerRef$
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
scrollContainerWidth =
|
|
66
|
-
var scrollLeft = ((_scrollContainerRef$
|
|
66
|
+
var _scrollContainerRef$c5, _scrollContainerRef$c6, _scrollContainerRef$c7;
|
|
67
|
+
var _ref3 = ((_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.getBoundingClientRect()) || {},
|
|
68
|
+
_ref3$width = _ref3.width,
|
|
69
|
+
scrollContainerWidth = _ref3$width === void 0 ? 0 : _ref3$width;
|
|
70
|
+
var scrollLeft = ((_scrollContainerRef$c6 = scrollContainerRef.current) === null || _scrollContainerRef$c6 === void 0 ? void 0 : _scrollContainerRef$c6.scrollLeft) || 0;
|
|
67
71
|
|
|
68
72
|
// scroll to current position + scroll container width
|
|
69
73
|
var scrollTo = scrollLeft + scrollContainerWidth;
|
|
70
|
-
(_scrollContainerRef$
|
|
74
|
+
(_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 ? void 0 : _scrollContainerRef$c7.scrollTo({
|
|
71
75
|
top: 0,
|
|
72
76
|
left: scrollTo,
|
|
73
77
|
behavior: 'smooth'
|
|
74
78
|
});
|
|
75
79
|
};
|
|
76
80
|
var resizeObserver = new ResizeObserver(function (t) {
|
|
77
|
-
var _scrollContainerRef$
|
|
78
|
-
var widthNeededToShowAllItems = ((_scrollContainerRef$
|
|
79
|
-
var availableSpace = (_scrollContainerRef$
|
|
81
|
+
var _scrollContainerRef$c8, _scrollContainerRef$c9, _scrollContainerRef$c10;
|
|
82
|
+
var widthNeededToShowAllItems = ((_scrollContainerRef$c8 = scrollContainerRef.current) === null || _scrollContainerRef$c8 === void 0 ? void 0 : _scrollContainerRef$c8.scrollWidth) || 0;
|
|
83
|
+
var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0 ? void 0 : (_scrollContainerRef$c10 = _scrollContainerRef$c9.parentNode) === null || _scrollContainerRef$c10 === void 0 ? void 0 : _scrollContainerRef$c10.offsetWidth;
|
|
80
84
|
if (availableSpace >= widthNeededToShowAllItems) {
|
|
81
85
|
setNeedScroll(false);
|
|
82
86
|
} else {
|
|
@@ -99,6 +103,7 @@ export default (function (_ref) {
|
|
|
99
103
|
scrollContainerRefCurrent.removeEventListener('scroll', onScroll);
|
|
100
104
|
resizeObserver.unobserve(scrollContainerRefCurrent);
|
|
101
105
|
}
|
|
106
|
+
setCanScrollDebounced.cancel();
|
|
102
107
|
};
|
|
103
108
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
109
|
}, []);
|
|
@@ -131,4 +136,4 @@ export default (function (_ref) {
|
|
|
131
136
|
onClick: scrollRight,
|
|
132
137
|
disabled: !canScrollRight || disabled
|
|
133
138
|
})) : null;
|
|
134
|
-
}
|
|
139
|
+
};
|
|
@@ -32,7 +32,7 @@ import { EmojiPickerButton } from './EmojiPickerButton';
|
|
|
32
32
|
import { injectIntl } from 'react-intl-next';
|
|
33
33
|
import messages from './messages';
|
|
34
34
|
import { clearHoverSelection } from '@atlaskit/editor-plugin-table/commands';
|
|
35
|
-
import ScrollButtons from './ScrollButtons';
|
|
35
|
+
import { ScrollButtons } from './ScrollButtons';
|
|
36
36
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
37
37
|
import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
|
|
38
38
|
var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
@@ -59,7 +59,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
59
59
|
return jsx(ButtonGroup, null, items.filter(function (item) {
|
|
60
60
|
return !item.hidden;
|
|
61
61
|
}).map(function (item, idx) {
|
|
62
|
-
var _api$
|
|
62
|
+
var _api$contextPanel;
|
|
63
63
|
switch (item.type) {
|
|
64
64
|
case 'button':
|
|
65
65
|
var ButtonIcon = item.icon;
|
|
@@ -231,7 +231,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
231
231
|
editorView: editorView,
|
|
232
232
|
extensionProvider: extensionsProvider,
|
|
233
233
|
separator: item.separator,
|
|
234
|
-
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$
|
|
234
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange
|
|
235
235
|
});
|
|
236
236
|
case 'separator':
|
|
237
237
|
return jsx(Separator, {
|
|
@@ -374,7 +374,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
374
374
|
if (table) {
|
|
375
375
|
return clearHoverSelection()(state, dispatch);
|
|
376
376
|
}
|
|
377
|
-
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.
|
|
377
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.decorations.actions.removeDecoration(state, dispatch);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
}, {
|
|
@@ -37,29 +37,30 @@ export function createPlugin(dispatch, imageEnabled) {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
var helpDialog = function helpDialog() {
|
|
41
|
-
var
|
|
42
|
-
|
|
40
|
+
var helpDialog = function helpDialog(_ref) {
|
|
41
|
+
var _ref$config = _ref.config,
|
|
42
|
+
imageUploadProviderExists = _ref$config === void 0 ? false : _ref$config,
|
|
43
|
+
api = _ref.api;
|
|
43
44
|
return {
|
|
44
45
|
name: 'helpDialog',
|
|
45
46
|
pmPlugins: function pmPlugins() {
|
|
46
47
|
return [{
|
|
47
48
|
name: 'helpDialog',
|
|
48
|
-
plugin: function plugin(
|
|
49
|
-
var dispatch =
|
|
49
|
+
plugin: function plugin(_ref2) {
|
|
50
|
+
var dispatch = _ref2.dispatch;
|
|
50
51
|
return createPlugin(dispatch, imageUploadProviderExists);
|
|
51
52
|
}
|
|
52
53
|
}, {
|
|
53
54
|
name: 'helpDialogKeymap',
|
|
54
55
|
plugin: function plugin() {
|
|
55
|
-
var _api$
|
|
56
|
-
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$
|
|
56
|
+
var _api$analytics;
|
|
57
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
57
58
|
}
|
|
58
59
|
}];
|
|
59
60
|
},
|
|
60
61
|
pluginsOptions: {
|
|
61
|
-
quickInsert: function quickInsert(
|
|
62
|
-
var formatMessage =
|
|
62
|
+
quickInsert: function quickInsert(_ref3) {
|
|
63
|
+
var formatMessage = _ref3.formatMessage;
|
|
63
64
|
return [{
|
|
64
65
|
id: 'helpdialog',
|
|
65
66
|
title: formatMessage(messages.help),
|
|
@@ -73,10 +74,10 @@ var helpDialog = function helpDialog() {
|
|
|
73
74
|
});
|
|
74
75
|
},
|
|
75
76
|
action: function action(insert) {
|
|
76
|
-
var _api$
|
|
77
|
+
var _api$analytics2;
|
|
77
78
|
var tr = insert('');
|
|
78
79
|
openHelpCommand(tr);
|
|
79
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
80
|
+
api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
|
|
80
81
|
action: ACTION.HELP_OPENED,
|
|
81
82
|
actionSubject: ACTION_SUBJECT.HELP,
|
|
82
83
|
actionSubjectId: ACTION_SUBJECT_ID.HELP_QUICK_INSERT,
|
|
@@ -90,19 +91,19 @@ var helpDialog = function helpDialog() {
|
|
|
90
91
|
}];
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
|
-
contentComponent: function contentComponent(
|
|
94
|
-
var editorView =
|
|
94
|
+
contentComponent: function contentComponent(_ref4) {
|
|
95
|
+
var editorView = _ref4.editorView;
|
|
95
96
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
96
97
|
plugins: {
|
|
97
98
|
helpDialog: pluginKey
|
|
98
99
|
},
|
|
99
|
-
render: function render(
|
|
100
|
-
var
|
|
101
|
-
helpDialog =
|
|
100
|
+
render: function render(_ref5) {
|
|
101
|
+
var _ref5$helpDialog = _ref5.helpDialog,
|
|
102
|
+
helpDialog = _ref5$helpDialog === void 0 ? {} : _ref5$helpDialog;
|
|
102
103
|
return /*#__PURE__*/React.createElement(HelpDialogLoader, {
|
|
103
104
|
editorView: editorView,
|
|
104
105
|
isVisible: helpDialog.isVisible,
|
|
105
|
-
quickInsertEnabled: !!(api !== null && api !== void 0 && api.
|
|
106
|
+
quickInsertEnabled: !!(api !== null && api !== void 0 && api.quickInsert),
|
|
106
107
|
imageEnabled: helpDialog.imageEnabled
|
|
107
108
|
});
|
|
108
109
|
}
|
|
@@ -27,25 +27,26 @@ var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
|
|
|
27
27
|
return 0;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
var insertBlockPlugin = function insertBlockPlugin() {
|
|
31
|
-
var _api$
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
31
|
+
var _api$featureFlags;
|
|
32
|
+
var _ref$config = _ref.config,
|
|
33
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
34
|
+
api = _ref.api;
|
|
35
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
35
36
|
return {
|
|
36
37
|
name: 'insertBlock',
|
|
37
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
38
|
-
var editorView =
|
|
39
|
-
editorActions =
|
|
40
|
-
dispatchAnalyticsEvent =
|
|
41
|
-
providerFactory =
|
|
42
|
-
popupsMountPoint =
|
|
43
|
-
popupsBoundariesElement =
|
|
44
|
-
popupsScrollableElement =
|
|
45
|
-
toolbarSize =
|
|
46
|
-
disabled =
|
|
47
|
-
isToolbarReducedSpacing =
|
|
48
|
-
isLastItem =
|
|
38
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
39
|
+
var editorView = _ref2.editorView,
|
|
40
|
+
editorActions = _ref2.editorActions,
|
|
41
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
42
|
+
providerFactory = _ref2.providerFactory,
|
|
43
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
44
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
45
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
46
|
+
toolbarSize = _ref2.toolbarSize,
|
|
47
|
+
disabled = _ref2.disabled,
|
|
48
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
49
|
+
isLastItem = _ref2.isLastItem;
|
|
49
50
|
var renderNode = function renderNode(providers) {
|
|
50
51
|
// We will slowly migrate these to use the new approach inside
|
|
51
52
|
// `ToolbarInsertBlockWithInjectionApi` and remove `WithPluginState`
|
|
@@ -59,13 +60,13 @@ var insertBlockPlugin = function insertBlockPlugin() {
|
|
|
59
60
|
placeholderTextState: placeholderTextStateKey,
|
|
60
61
|
layoutState: layoutStateKey
|
|
61
62
|
},
|
|
62
|
-
render: function render(
|
|
63
|
-
var blockTypeState =
|
|
64
|
-
mediaState =
|
|
65
|
-
|
|
66
|
-
macroState =
|
|
67
|
-
placeholderTextState =
|
|
68
|
-
layoutState =
|
|
63
|
+
render: function render(_ref3) {
|
|
64
|
+
var blockTypeState = _ref3.blockTypeState,
|
|
65
|
+
mediaState = _ref3.mediaState,
|
|
66
|
+
_ref3$macroState = _ref3.macroState,
|
|
67
|
+
macroState = _ref3$macroState === void 0 ? {} : _ref3$macroState,
|
|
68
|
+
placeholderTextState = _ref3.placeholderTextState,
|
|
69
|
+
layoutState = _ref3.layoutState;
|
|
69
70
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlockWithInjectionApi, {
|
|
70
71
|
pluginInjectionApi: api,
|
|
71
72
|
editorView: editorView,
|
|
@@ -99,28 +100,28 @@ var insertBlockPlugin = function insertBlockPlugin() {
|
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
};
|
|
102
|
-
function ToolbarInsertBlockWithInjectionApi(
|
|
103
|
-
var _pluginInjectionApi$
|
|
104
|
-
var editorView =
|
|
105
|
-
editorActions =
|
|
106
|
-
dispatchAnalyticsEvent =
|
|
107
|
-
providerFactory =
|
|
108
|
-
popupsMountPoint =
|
|
109
|
-
popupsBoundariesElement =
|
|
110
|
-
popupsScrollableElement =
|
|
111
|
-
toolbarSize =
|
|
112
|
-
disabled =
|
|
113
|
-
isToolbarReducedSpacing =
|
|
114
|
-
isLastItem =
|
|
115
|
-
providers =
|
|
116
|
-
pluginInjectionApi =
|
|
117
|
-
options =
|
|
118
|
-
blockTypeState =
|
|
119
|
-
mediaState =
|
|
120
|
-
macroState =
|
|
121
|
-
placeholderTextState =
|
|
122
|
-
layoutState =
|
|
123
|
-
featureFlags =
|
|
103
|
+
function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
104
|
+
var _pluginInjectionApi$a2, _pluginInjectionApi$i;
|
|
105
|
+
var editorView = _ref4.editorView,
|
|
106
|
+
editorActions = _ref4.editorActions,
|
|
107
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
108
|
+
providerFactory = _ref4.providerFactory,
|
|
109
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
110
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
111
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
112
|
+
toolbarSize = _ref4.toolbarSize,
|
|
113
|
+
disabled = _ref4.disabled,
|
|
114
|
+
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing,
|
|
115
|
+
isLastItem = _ref4.isLastItem,
|
|
116
|
+
providers = _ref4.providers,
|
|
117
|
+
pluginInjectionApi = _ref4.pluginInjectionApi,
|
|
118
|
+
options = _ref4.options,
|
|
119
|
+
blockTypeState = _ref4.blockTypeState,
|
|
120
|
+
mediaState = _ref4.mediaState,
|
|
121
|
+
macroState = _ref4.macroState,
|
|
122
|
+
placeholderTextState = _ref4.placeholderTextState,
|
|
123
|
+
layoutState = _ref4.layoutState,
|
|
124
|
+
featureFlags = _ref4.featureFlags;
|
|
124
125
|
var buttons = toolbarSizeToButtons(toolbarSize);
|
|
125
126
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji']),
|
|
126
127
|
dateState = _useSharedPluginState.dateState,
|
|
@@ -134,9 +135,9 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
|
134
135
|
* @param name Block name
|
|
135
136
|
*/
|
|
136
137
|
var handleInsertBlockType = React.useCallback(function (name) {
|
|
137
|
-
var _pluginInjectionApi$
|
|
138
|
-
return insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
139
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
138
|
+
var _pluginInjectionApi$a;
|
|
139
|
+
return insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions);
|
|
140
|
+
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions]);
|
|
140
141
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
141
142
|
pluginInjectionApi: pluginInjectionApi,
|
|
142
143
|
buttons: buttons,
|
|
@@ -156,9 +157,9 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
|
156
157
|
mediaUploadsEnabled: mediaState && mediaState.allowsUploads,
|
|
157
158
|
onShowMediaPicker: mediaState && mediaState.showMediaPicker,
|
|
158
159
|
mediaSupported: !!mediaState,
|
|
159
|
-
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.
|
|
160
|
+
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
160
161
|
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
161
|
-
handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
162
|
+
handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$i = pluginInjectionApi.imageUpload) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.actions.startUpload,
|
|
162
163
|
availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
|
|
163
164
|
linkSupported: !!hyperlinkState,
|
|
164
165
|
linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
|
|
@@ -164,19 +164,19 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
_defineProperty(_assertThisInitialized(_this), "toggleLinkPanel", function (inputMethod) {
|
|
167
|
-
var _pluginInjectionApi$
|
|
167
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$h;
|
|
168
168
|
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
169
|
-
return (_pluginInjectionApi$
|
|
169
|
+
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;
|
|
170
170
|
});
|
|
171
171
|
_defineProperty(_assertThisInitialized(_this), "insertMention", function (inputMethod) {
|
|
172
|
-
var _pluginInjectionApi$
|
|
172
|
+
var _pluginInjectionApi$m;
|
|
173
173
|
var _this$props = _this.props,
|
|
174
174
|
editorView = _this$props.editorView,
|
|
175
175
|
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
176
176
|
if (!editorView) {
|
|
177
177
|
return true;
|
|
178
178
|
}
|
|
179
|
-
var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
179
|
+
var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.mention) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.sharedState.currentState();
|
|
180
180
|
if (pluginState && pluginState.canInsertMention === false) {
|
|
181
181
|
return false;
|
|
182
182
|
}
|
|
@@ -184,13 +184,13 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
184
184
|
return true;
|
|
185
185
|
});
|
|
186
186
|
_defineProperty(_assertThisInitialized(_this), "insertTable", function (inputMethod) {
|
|
187
|
-
var _pluginInjectionApi$
|
|
187
|
+
var _pluginInjectionApi$t, _pluginInjectionApi$t2, _pluginInjectionApi$t3, _pluginInjectionApi$t4;
|
|
188
188
|
var _this$props2 = _this.props,
|
|
189
189
|
pluginInjectionApi = _this$props2.pluginInjectionApi,
|
|
190
190
|
editorView = _this$props2.editorView;
|
|
191
191
|
var state = editorView.state,
|
|
192
192
|
dispatch = editorView.dispatch;
|
|
193
|
-
return (_pluginInjectionApi$
|
|
193
|
+
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, {
|
|
194
194
|
action: ACTION.INSERTED,
|
|
195
195
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
196
196
|
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
@@ -198,7 +198,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
198
198
|
inputMethod: inputMethod
|
|
199
199
|
},
|
|
200
200
|
eventType: EVENT_TYPE.TRACK
|
|
201
|
-
})(state, dispatch)) !== null && _pluginInjectionApi$
|
|
201
|
+
})(state, dispatch)) !== null && _pluginInjectionApi$t !== void 0 ? _pluginInjectionApi$t : false;
|
|
202
202
|
});
|
|
203
203
|
_defineProperty(_assertThisInitialized(_this), "createDate", function (inputMethod) {
|
|
204
204
|
var editorView = _this.props.editorView;
|
|
@@ -275,17 +275,17 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
275
275
|
};
|
|
276
276
|
});
|
|
277
277
|
_defineProperty(_assertThisInitialized(_this), "handleSelectedEmoji", function (emojiId) {
|
|
278
|
-
var _pluginInjectionApi$
|
|
278
|
+
var _pluginInjectionApi$e;
|
|
279
279
|
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
280
280
|
_this.props.editorView.focus();
|
|
281
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
281
|
+
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, INPUT_METHOD.PICKER));
|
|
282
282
|
_this.toggleEmojiPicker();
|
|
283
283
|
return true;
|
|
284
284
|
});
|
|
285
285
|
_defineProperty(_assertThisInitialized(_this), "openElementBrowser", function () {
|
|
286
|
-
var _pluginInjectionApi$
|
|
286
|
+
var _pluginInjectionApi$q;
|
|
287
287
|
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
288
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
288
|
+
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);
|
|
289
289
|
});
|
|
290
290
|
_defineProperty(_assertThisInitialized(_this), "onItemActivated", function (_ref2) {
|
|
291
291
|
var item = _ref2.item,
|
|
@@ -8,9 +8,10 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
8
8
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
9
9
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
10
10
|
export { pluginKey };
|
|
11
|
-
var layoutPlugin = function layoutPlugin() {
|
|
12
|
-
var
|
|
13
|
-
|
|
11
|
+
var layoutPlugin = function layoutPlugin(_ref) {
|
|
12
|
+
var _ref$config = _ref.config,
|
|
13
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
14
|
+
api = _ref.api;
|
|
14
15
|
return {
|
|
15
16
|
name: 'layout',
|
|
16
17
|
nodes: function nodes() {
|
|
@@ -32,19 +33,19 @@ var layoutPlugin = function layoutPlugin() {
|
|
|
32
33
|
},
|
|
33
34
|
pluginsOptions: {
|
|
34
35
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
35
|
-
var
|
|
36
|
-
pos =
|
|
37
|
-
allowBreakout =
|
|
38
|
-
addSidebarLayouts =
|
|
39
|
-
allowSingleColumnLayout =
|
|
36
|
+
var _ref2 = pluginKey.getState(state),
|
|
37
|
+
pos = _ref2.pos,
|
|
38
|
+
allowBreakout = _ref2.allowBreakout,
|
|
39
|
+
addSidebarLayouts = _ref2.addSidebarLayouts,
|
|
40
|
+
allowSingleColumnLayout = _ref2.allowSingleColumnLayout;
|
|
40
41
|
if (pos !== null) {
|
|
41
|
-
var _api$
|
|
42
|
-
return buildToolbar(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api === null || api === void 0 ? void 0 : (_api$
|
|
42
|
+
var _api$decorations$acti;
|
|
43
|
+
return 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);
|
|
43
44
|
}
|
|
44
45
|
return undefined;
|
|
45
46
|
},
|
|
46
|
-
quickInsert: function quickInsert(
|
|
47
|
-
var formatMessage =
|
|
47
|
+
quickInsert: function quickInsert(_ref3) {
|
|
48
|
+
var formatMessage = _ref3.formatMessage;
|
|
48
49
|
return [{
|
|
49
50
|
id: 'layout',
|
|
50
51
|
title: formatMessage(messages.columns),
|
|
@@ -55,9 +56,9 @@ var layoutPlugin = function layoutPlugin() {
|
|
|
55
56
|
return /*#__PURE__*/React.createElement(IconLayout, null);
|
|
56
57
|
},
|
|
57
58
|
action: function action(insert, state) {
|
|
58
|
-
var _api$
|
|
59
|
+
var _api$analytics, _api$analytics$action;
|
|
59
60
|
var tr = insert(createDefaultLayoutSection(state));
|
|
60
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
61
|
+
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({
|
|
61
62
|
action: ACTION.INSERTED,
|
|
62
63
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
63
64
|
actionSubjectId: ACTION_SUBJECT_ID.LAYOUT,
|
|
@@ -19,14 +19,15 @@ export function createPlugin(dispatch, maxContentSize) {
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
var maxContentSizePlugin = function maxContentSizePlugin(
|
|
22
|
+
var maxContentSizePlugin = function maxContentSizePlugin(_ref) {
|
|
23
|
+
var maxContentSize = _ref.config;
|
|
23
24
|
return {
|
|
24
25
|
name: 'maxContentSize',
|
|
25
26
|
pmPlugins: function pmPlugins() {
|
|
26
27
|
return [{
|
|
27
28
|
name: 'maxContentSize',
|
|
28
|
-
plugin: function plugin(
|
|
29
|
-
var dispatch =
|
|
29
|
+
plugin: function plugin(_ref2) {
|
|
30
|
+
var dispatch = _ref2.dispatch;
|
|
30
31
|
return createPlugin(dispatch, maxContentSize);
|
|
31
32
|
}
|
|
32
33
|
}];
|