@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
|
@@ -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
|
}];
|
|
@@ -24,11 +24,12 @@ import { ReactMediaInlineNode } from './nodeviews/mediaInline';
|
|
|
24
24
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
25
25
|
import { stateKey } from './pm-plugins/plugin-key';
|
|
26
26
|
export { insertMediaSingleNode } from './utils/media-single';
|
|
27
|
-
var mediaPlugin = function mediaPlugin() {
|
|
28
|
-
var _api$
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
var mediaPlugin = function mediaPlugin(_ref) {
|
|
28
|
+
var _api$featureFlags;
|
|
29
|
+
var _ref$config = _ref.config,
|
|
30
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
31
|
+
api = _ref.api;
|
|
32
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
32
33
|
return {
|
|
33
34
|
name: 'media',
|
|
34
35
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -38,12 +39,12 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
38
39
|
return stateKey.getState(editorState) || null;
|
|
39
40
|
},
|
|
40
41
|
nodes: function nodes() {
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
allowMediaGroup =
|
|
44
|
-
|
|
45
|
-
allowMediaSingle =
|
|
46
|
-
mediaFeatureFlags =
|
|
42
|
+
var _ref2 = options || {},
|
|
43
|
+
_ref2$allowMediaGroup = _ref2.allowMediaGroup,
|
|
44
|
+
allowMediaGroup = _ref2$allowMediaGroup === void 0 ? true : _ref2$allowMediaGroup,
|
|
45
|
+
_ref2$allowMediaSingl = _ref2.allowMediaSingle,
|
|
46
|
+
allowMediaSingle = _ref2$allowMediaSingl === void 0 ? false : _ref2$allowMediaSingl,
|
|
47
|
+
mediaFeatureFlags = _ref2.featureFlags;
|
|
47
48
|
var captions = getMediaFeatureFlag('captions', mediaFeatureFlags);
|
|
48
49
|
var allowMediaInline = getMediaFeatureFlag('mediaInline', mediaFeatureFlags);
|
|
49
50
|
var mediaSingleOption = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
|
|
@@ -82,16 +83,16 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
82
83
|
pmPlugins: function pmPlugins() {
|
|
83
84
|
var pmPlugins = [{
|
|
84
85
|
name: 'media',
|
|
85
|
-
plugin: function plugin(
|
|
86
|
-
var schema =
|
|
87
|
-
dispatch =
|
|
88
|
-
getIntl =
|
|
89
|
-
eventDispatcher =
|
|
90
|
-
providerFactory =
|
|
91
|
-
errorReporter =
|
|
92
|
-
portalProviderAPI =
|
|
93
|
-
reactContext =
|
|
94
|
-
dispatchAnalyticsEvent =
|
|
86
|
+
plugin: function plugin(_ref3) {
|
|
87
|
+
var schema = _ref3.schema,
|
|
88
|
+
dispatch = _ref3.dispatch,
|
|
89
|
+
getIntl = _ref3.getIntl,
|
|
90
|
+
eventDispatcher = _ref3.eventDispatcher,
|
|
91
|
+
providerFactory = _ref3.providerFactory,
|
|
92
|
+
errorReporter = _ref3.errorReporter,
|
|
93
|
+
portalProviderAPI = _ref3.portalProviderAPI,
|
|
94
|
+
reactContext = _ref3.reactContext,
|
|
95
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
95
96
|
return createPlugin(schema, {
|
|
96
97
|
providerFactory: providerFactory,
|
|
97
98
|
nodeViews: {
|
|
@@ -111,15 +112,15 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
111
112
|
}, {
|
|
112
113
|
name: 'mediaKeymap',
|
|
113
114
|
plugin: function plugin() {
|
|
114
|
-
var _api$
|
|
115
|
-
return keymapPlugin(options, api === null || api === void 0 ? void 0 : (_api$
|
|
115
|
+
var _api$analytics;
|
|
116
|
+
return keymapPlugin(options, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
116
117
|
}
|
|
117
118
|
}];
|
|
118
119
|
if (options && options.allowMediaSingle) {
|
|
119
120
|
pmPlugins.push({
|
|
120
121
|
name: 'mediaSingleKeymap',
|
|
121
|
-
plugin: function plugin(
|
|
122
|
-
var schema =
|
|
122
|
+
plugin: function plugin(_ref4) {
|
|
123
|
+
var schema = _ref4.schema;
|
|
123
124
|
return keymapMediaSinglePlugin(schema);
|
|
124
125
|
}
|
|
125
126
|
});
|
|
@@ -131,25 +132,25 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
131
132
|
});
|
|
132
133
|
pmPlugins.push({
|
|
133
134
|
name: 'mediaAltTextKeymap',
|
|
134
|
-
plugin: function plugin(
|
|
135
|
-
var _api$
|
|
136
|
-
var schema =
|
|
137
|
-
return keymapMediaAltTextPlugin(schema, api === null || api === void 0 ? void 0 : (_api$
|
|
135
|
+
plugin: function plugin(_ref5) {
|
|
136
|
+
var _api$analytics2;
|
|
137
|
+
var schema = _ref5.schema;
|
|
138
|
+
return keymapMediaAltTextPlugin(schema, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
138
139
|
}
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
142
|
if (options && options.allowLinking) {
|
|
142
143
|
pmPlugins.push({
|
|
143
144
|
name: 'mediaLinking',
|
|
144
|
-
plugin: function plugin(
|
|
145
|
-
var dispatch =
|
|
145
|
+
plugin: function plugin(_ref6) {
|
|
146
|
+
var dispatch = _ref6.dispatch;
|
|
146
147
|
return linkingPlugin(dispatch);
|
|
147
148
|
}
|
|
148
149
|
});
|
|
149
150
|
pmPlugins.push({
|
|
150
151
|
name: 'mediaLinkingKeymap',
|
|
151
|
-
plugin: function plugin(
|
|
152
|
-
var schema =
|
|
152
|
+
plugin: function plugin(_ref7) {
|
|
153
|
+
var schema = _ref7.schema;
|
|
153
154
|
return keymapLinkingPlugin(schema);
|
|
154
155
|
}
|
|
155
156
|
});
|
|
@@ -185,16 +186,16 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
185
186
|
});
|
|
186
187
|
return pmPlugins;
|
|
187
188
|
},
|
|
188
|
-
contentComponent: function contentComponent(
|
|
189
|
-
var editorView =
|
|
190
|
-
appearance =
|
|
189
|
+
contentComponent: function contentComponent(_ref8) {
|
|
190
|
+
var editorView = _ref8.editorView,
|
|
191
|
+
appearance = _ref8.appearance;
|
|
191
192
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WithPluginState, {
|
|
192
193
|
editorView: editorView,
|
|
193
194
|
plugins: {
|
|
194
195
|
mediaState: pluginKey
|
|
195
196
|
},
|
|
196
|
-
render: function render(
|
|
197
|
-
var mediaState =
|
|
197
|
+
render: function render(_ref9) {
|
|
198
|
+
var mediaState = _ref9.mediaState;
|
|
198
199
|
return /*#__PURE__*/React.createElement(MediaPickerComponents, {
|
|
199
200
|
editorDomElement: editorView.dom,
|
|
200
201
|
mediaState: mediaState,
|
|
@@ -204,10 +205,10 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
204
205
|
}
|
|
205
206
|
}));
|
|
206
207
|
},
|
|
207
|
-
secondaryToolbarComponent: function secondaryToolbarComponent(
|
|
208
|
-
var editorView =
|
|
209
|
-
eventDispatcher =
|
|
210
|
-
disabled =
|
|
208
|
+
secondaryToolbarComponent: function secondaryToolbarComponent(_ref10) {
|
|
209
|
+
var editorView = _ref10.editorView,
|
|
210
|
+
eventDispatcher = _ref10.eventDispatcher,
|
|
211
|
+
disabled = _ref10.disabled;
|
|
211
212
|
return /*#__PURE__*/React.createElement(ToolbarMedia, {
|
|
212
213
|
editorView: editorView,
|
|
213
214
|
eventDispatcher: eventDispatcher,
|
|
@@ -217,8 +218,8 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
217
218
|
});
|
|
218
219
|
},
|
|
219
220
|
pluginsOptions: {
|
|
220
|
-
quickInsert: function quickInsert(
|
|
221
|
-
var formatMessage =
|
|
221
|
+
quickInsert: function quickInsert(_ref11) {
|
|
222
|
+
var formatMessage = _ref11.formatMessage;
|
|
222
223
|
return [{
|
|
223
224
|
id: 'media',
|
|
224
225
|
title: formatMessage(messages.mediaFiles),
|
|
@@ -229,11 +230,11 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
229
230
|
return /*#__PURE__*/React.createElement(IconImages, null);
|
|
230
231
|
},
|
|
231
232
|
action: function action(insert, state) {
|
|
232
|
-
var _api$
|
|
233
|
+
var _api$analytics3;
|
|
233
234
|
var pluginState = pluginKey.getState(state);
|
|
234
235
|
pluginState === null || pluginState === void 0 ? void 0 : pluginState.showMediaPicker();
|
|
235
236
|
var tr = insert('');
|
|
236
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
237
|
+
api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
|
|
237
238
|
action: ACTION.OPENED,
|
|
238
239
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
239
240
|
actionSubjectId: ACTION_SUBJECT_ID.PICKER_CLOUD,
|
|
@@ -255,7 +256,8 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
255
256
|
allowLinking: options && options.allowLinking,
|
|
256
257
|
allowAdvancedToolBarOptions: options && options.allowAdvancedToolBarOptions,
|
|
257
258
|
allowAltTextOnImages: options && options.allowAltTextOnImages,
|
|
258
|
-
altTextValidator: options && options.altTextValidator
|
|
259
|
+
altTextValidator: options && options.altTextValidator,
|
|
260
|
+
fullWidthEnabled: options && options.fullWidthEnabled
|
|
259
261
|
}, api);
|
|
260
262
|
}
|
|
261
263
|
}
|
|
@@ -230,7 +230,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
230
230
|
(_this$captionPlaceHol = _this.captionPlaceHolderRef.current) === null || _this$captionPlaceHol === void 0 ? void 0 : _this$captionPlaceHol.click();
|
|
231
231
|
});
|
|
232
232
|
_defineProperty(_assertThisInitialized(_this), "clickPlaceholder", function () {
|
|
233
|
-
var _pluginInjectionApi$
|
|
233
|
+
var _pluginInjectionApi$a;
|
|
234
234
|
var _this$props = _this.props,
|
|
235
235
|
view = _this$props.view,
|
|
236
236
|
getPos = _this$props.getPos,
|
|
@@ -239,7 +239,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
239
239
|
if (typeof getPos === 'boolean') {
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
|
-
insertAndSelectCaptionFromMediaSinglePos(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
242
|
+
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);
|
|
243
243
|
});
|
|
244
244
|
return _this;
|
|
245
245
|
}
|
|
@@ -226,16 +226,16 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
if (isMediaSingle(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
229
|
-
var _this$pluginInjection, _pluginInjectionApi$
|
|
229
|
+
var _this$pluginInjection, _pluginInjectionApi$a;
|
|
230
230
|
// read width state right before inserting to get up-to-date and define values
|
|
231
|
-
var widthPluginState = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.
|
|
232
|
-
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
231
|
+
var widthPluginState = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.width.sharedState.currentState();
|
|
232
|
+
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);
|
|
233
233
|
} else if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions2 = _this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !isInEmptyLine(state) && (!isInsidePotentialEmptyParagraph(state) || isInListItem(state)) && canInsertMediaInline(state)) {
|
|
234
|
-
var _pluginInjectionApi$
|
|
235
|
-
insertMediaInlineNode(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
234
|
+
var _pluginInjectionApi$a2;
|
|
235
|
+
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));
|
|
236
236
|
} else {
|
|
237
|
-
var _pluginInjectionApi$
|
|
238
|
-
insertMediaGroupNode(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
237
|
+
var _pluginInjectionApi$a3;
|
|
238
|
+
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));
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
// do events when media state changes
|