@atlaskit/editor-core 187.31.7 → 187.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/cjs/plugins/analytics/plugin.js +14 -12
- package/dist/cjs/plugins/annotation/index.js +15 -13
- package/dist/cjs/plugins/avatar-group/index.js +16 -14
- package/dist/cjs/plugins/base/plugin.js +12 -10
- package/dist/cjs/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/cjs/plugins/block-type/index.js +32 -30
- package/dist/cjs/plugins/breakout/index.js +10 -8
- package/dist/cjs/plugins/caption/index.js +7 -6
- package/dist/cjs/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/code-bidi-warning/index.js +2 -4
- package/dist/cjs/plugins/code-block/index.js +14 -11
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/cjs/plugins/collab-edit/index.js +16 -14
- package/dist/cjs/plugins/collab-edit/plugin.js +5 -5
- package/dist/cjs/plugins/date/index.js +18 -17
- package/dist/cjs/plugins/emoji/index.js +35 -33
- package/dist/cjs/plugins/expand/index.js +14 -13
- package/dist/cjs/plugins/extension/index.js +16 -15
- package/dist/cjs/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/feedback-dialog/index.js +5 -4
- package/dist/cjs/plugins/find-replace/index.js +17 -15
- package/dist/cjs/plugins/floating-toolbar/index.js +31 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/cjs/plugins/help-dialog/index.js +18 -17
- package/dist/cjs/plugins/insert-block/index.js +52 -51
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/cjs/plugins/layout/index.js +15 -14
- package/dist/cjs/plugins/max-content-size/index.js +4 -3
- package/dist/cjs/plugins/media/index.js +49 -47
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/main.js +7 -7
- package/dist/cjs/plugins/media/toolbar/index.js +29 -24
- package/dist/cjs/plugins/media/toolbar/linking.js +4 -4
- package/dist/cjs/plugins/media/toolbar/utils.js +22 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/mentions/index.js +17 -15
- package/dist/cjs/plugins/panel/index.js +13 -12
- package/dist/cjs/plugins/paste/index.js +13 -10
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/cjs/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/cjs/plugins/placeholder/index.js +9 -7
- package/dist/cjs/plugins/placeholder-text/index.js +23 -16
- package/dist/cjs/plugins/quick-insert/index.js +13 -12
- package/dist/cjs/plugins/rule/index.js +8 -7
- package/dist/cjs/plugins/save-on-enter/index.js +4 -3
- package/dist/cjs/plugins/selection/index.js +5 -4
- package/dist/cjs/plugins/status/index.js +20 -14
- package/dist/cjs/plugins/submit-editor/index.js +4 -3
- package/dist/cjs/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/cjs/plugins/text-color/index.js +17 -15
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/cjs/plugins/type-ahead/index.js +21 -20
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/es2019/plugins/analytics/plugin.js +11 -8
- package/dist/es2019/plugins/annotation/index.js +4 -1
- package/dist/es2019/plugins/avatar-group/index.js +8 -5
- package/dist/es2019/plugins/base/plugin.js +6 -3
- package/dist/es2019/plugins/before-primaryToolbar/index.js +4 -2
- package/dist/es2019/plugins/block-type/index.js +14 -11
- package/dist/es2019/plugins/breakout/index.js +6 -3
- package/dist/es2019/plugins/caption/index.js +3 -1
- package/dist/es2019/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/code-bidi-warning/index.js +2 -4
- package/dist/es2019/plugins/code-block/index.js +15 -9
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/es2019/plugins/collab-edit/index.js +9 -6
- package/dist/es2019/plugins/collab-edit/plugin.js +5 -5
- package/dist/es2019/plugins/date/index.js +6 -3
- package/dist/es2019/plugins/emoji/index.js +16 -13
- package/dist/es2019/plugins/expand/index.js +7 -4
- package/dist/es2019/plugins/extension/index.js +11 -8
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/feedback-dialog/index.js +4 -2
- package/dist/es2019/plugins/find-replace/index.js +8 -5
- package/dist/es2019/plugins/floating-toolbar/index.js +6 -4
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/es2019/plugins/help-dialog/index.js +9 -6
- package/dist/es2019/plugins/insert-block/index.js +12 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/es2019/plugins/layout/index.js +8 -5
- package/dist/es2019/plugins/max-content-size/index.js +3 -1
- package/dist/es2019/plugins/media/index.js +14 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -7
- package/dist/es2019/plugins/media/toolbar/index.js +29 -25
- package/dist/es2019/plugins/media/toolbar/linking.js +4 -4
- package/dist/es2019/plugins/media/toolbar/utils.js +18 -0
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/es2019/plugins/mentions/index.js +9 -6
- package/dist/es2019/plugins/panel/index.js +5 -2
- package/dist/es2019/plugins/paste/index.js +9 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/es2019/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/es2019/plugins/placeholder/index.js +10 -7
- package/dist/es2019/plugins/placeholder-text/index.js +12 -4
- package/dist/es2019/plugins/quick-insert/index.js +3 -1
- package/dist/es2019/plugins/rule/index.js +5 -3
- package/dist/es2019/plugins/save-on-enter/index.js +3 -1
- package/dist/es2019/plugins/selection/index.js +3 -1
- package/dist/es2019/plugins/status/index.js +11 -3
- package/dist/es2019/plugins/submit-editor/index.js +3 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +6 -4
- package/dist/es2019/plugins/text-color/index.js +6 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +9 -5
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/es2019/plugins/type-ahead/index.js +3 -1
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
- package/dist/es2019/use-preset.js +2 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/esm/plugins/analytics/plugin.js +14 -12
- package/dist/esm/plugins/annotation/index.js +15 -13
- package/dist/esm/plugins/avatar-group/index.js +16 -14
- package/dist/esm/plugins/base/plugin.js +12 -10
- package/dist/esm/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/esm/plugins/block-type/index.js +32 -30
- package/dist/esm/plugins/breakout/index.js +10 -8
- package/dist/esm/plugins/caption/index.js +7 -6
- package/dist/esm/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/code-bidi-warning/index.js +2 -4
- package/dist/esm/plugins/code-block/index.js +14 -11
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/esm/plugins/collab-edit/index.js +16 -14
- package/dist/esm/plugins/collab-edit/plugin.js +5 -5
- package/dist/esm/plugins/date/index.js +18 -17
- package/dist/esm/plugins/emoji/index.js +35 -33
- package/dist/esm/plugins/expand/index.js +14 -13
- package/dist/esm/plugins/extension/index.js +16 -15
- package/dist/esm/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/esm/plugins/feedback-dialog/index.js +5 -4
- package/dist/esm/plugins/find-replace/index.js +17 -15
- package/dist/esm/plugins/floating-toolbar/index.js +31 -30
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/esm/plugins/help-dialog/index.js +18 -17
- package/dist/esm/plugins/insert-block/index.js +52 -51
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/esm/plugins/layout/index.js +15 -14
- package/dist/esm/plugins/max-content-size/index.js +4 -3
- package/dist/esm/plugins/media/index.js +49 -47
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -7
- package/dist/esm/plugins/media/toolbar/index.js +30 -25
- package/dist/esm/plugins/media/toolbar/linking.js +4 -4
- package/dist/esm/plugins/media/toolbar/utils.js +19 -0
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/esm/plugins/mentions/index.js +17 -15
- package/dist/esm/plugins/panel/index.js +13 -12
- package/dist/esm/plugins/paste/index.js +13 -10
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/esm/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/esm/plugins/placeholder/index.js +9 -7
- package/dist/esm/plugins/placeholder-text/index.js +23 -16
- package/dist/esm/plugins/quick-insert/index.js +13 -12
- package/dist/esm/plugins/rule/index.js +8 -7
- package/dist/esm/plugins/save-on-enter/index.js +4 -3
- package/dist/esm/plugins/selection/index.js +5 -4
- package/dist/esm/plugins/status/index.js +20 -14
- package/dist/esm/plugins/submit-editor/index.js +4 -3
- package/dist/esm/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/esm/plugins/text-color/index.js +17 -15
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/esm/plugins/type-ahead/index.js +21 -20
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +62 -618
- package/dist/types/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types/plugins/caption/index.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types/plugins/media/types.d.ts +1 -0
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/use-preset.d.ts +2 -2
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +96 -716
- package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/selection/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/text-color/index.d.ts +3 -2
- package/dist/types-ts4.5/use-preset.d.ts +2 -2
- package/package.json +3 -3
|
@@ -83,13 +83,13 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
83
83
|
key: pluginKey,
|
|
84
84
|
state: {
|
|
85
85
|
init: function init(_, state) {
|
|
86
|
-
var _api$
|
|
87
|
-
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$
|
|
86
|
+
var _api$focus, _api$focus$sharedStat;
|
|
87
|
+
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
|
|
88
88
|
},
|
|
89
89
|
apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
|
|
90
|
-
var _api$
|
|
90
|
+
var _api$focus2, _api$focus2$sharedSta;
|
|
91
91
|
var meta = tr.getMeta(pluginKey);
|
|
92
|
-
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$
|
|
92
|
+
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$focus2 = api.focus) === null || _api$focus2 === void 0 ? void 0 : (_api$focus2$sharedSta = _api$focus2.sharedState.currentState()) === null || _api$focus2$sharedSta === void 0 ? void 0 : _api$focus2$sharedSta.hasFocus);
|
|
93
93
|
if (meta) {
|
|
94
94
|
if (meta.removePlaceholder) {
|
|
95
95
|
return emptyPlaceholder;
|
|
@@ -103,12 +103,12 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
103
103
|
},
|
|
104
104
|
props: {
|
|
105
105
|
decorations: function decorations(editorState) {
|
|
106
|
-
var _api$
|
|
106
|
+
var _api$composition;
|
|
107
107
|
var _getPlaceholderState = getPlaceholderState(editorState),
|
|
108
108
|
hasPlaceholder = _getPlaceholderState.hasPlaceholder,
|
|
109
109
|
placeholderText = _getPlaceholderState.placeholderText,
|
|
110
110
|
pos = _getPlaceholderState.pos;
|
|
111
|
-
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$
|
|
111
|
+
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$composition = api.composition) === null || _api$composition === void 0 ? void 0 : _api$composition.sharedState.currentState();
|
|
112
112
|
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
113
113
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
114
114
|
}
|
|
@@ -117,7 +117,9 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
var placeholderPlugin = function placeholderPlugin(
|
|
120
|
+
var placeholderPlugin = function placeholderPlugin(_ref) {
|
|
121
|
+
var options = _ref.config,
|
|
122
|
+
api = _ref.api;
|
|
121
123
|
return {
|
|
122
124
|
name: 'placeholder',
|
|
123
125
|
pmPlugins: function pmPlugins() {
|
|
@@ -131,7 +131,8 @@ function createPlugin(dispatch, options) {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(
|
|
134
|
+
var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(_ref) {
|
|
135
|
+
var options = _ref.config;
|
|
135
136
|
return {
|
|
136
137
|
name: 'placeholderText',
|
|
137
138
|
nodes: function nodes() {
|
|
@@ -143,16 +144,16 @@ var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(options) {
|
|
|
143
144
|
pmPlugins: function pmPlugins() {
|
|
144
145
|
return [{
|
|
145
146
|
name: 'placeholderText',
|
|
146
|
-
plugin: function plugin(
|
|
147
|
-
var dispatch =
|
|
147
|
+
plugin: function plugin(_ref2) {
|
|
148
|
+
var dispatch = _ref2.dispatch;
|
|
148
149
|
return createPlugin(dispatch, options);
|
|
149
150
|
}
|
|
150
151
|
}];
|
|
151
152
|
},
|
|
152
|
-
contentComponent: function contentComponent(
|
|
153
|
-
var editorView =
|
|
154
|
-
popupsMountPoint =
|
|
155
|
-
popupsBoundariesElement =
|
|
153
|
+
contentComponent: function contentComponent(_ref3) {
|
|
154
|
+
var editorView = _ref3.editorView,
|
|
155
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
156
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement;
|
|
156
157
|
var insertPlaceholderText = function insertPlaceholderText(value) {
|
|
157
158
|
return (0, _actions.insertPlaceholderTextAtSelection)(value)(editorView.state, editorView.dispatch);
|
|
158
159
|
};
|
|
@@ -172,9 +173,9 @@ var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(options) {
|
|
|
172
173
|
plugins: {
|
|
173
174
|
placeholderTextState: _pluginKey.pluginKey
|
|
174
175
|
},
|
|
175
|
-
render: function render(
|
|
176
|
-
var
|
|
177
|
-
placeholderTextState =
|
|
176
|
+
render: function render(_ref4) {
|
|
177
|
+
var _ref4$placeholderText = _ref4.placeholderTextState,
|
|
178
|
+
placeholderTextState = _ref4$placeholderText === void 0 ? {} : _ref4$placeholderText;
|
|
178
179
|
if (placeholderTextState.showInsertPanelAt) {
|
|
179
180
|
return /*#__PURE__*/_react.default.createElement(_PlaceholderFloatingToolbar.default, {
|
|
180
181
|
editorViewDOM: editorView.dom,
|
|
@@ -199,8 +200,8 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
199
200
|
return plugin;
|
|
200
201
|
}
|
|
201
202
|
plugin.pluginsOptions = {
|
|
202
|
-
quickInsert: function quickInsert(
|
|
203
|
-
var formatMessage =
|
|
203
|
+
quickInsert: function quickInsert(_ref5) {
|
|
204
|
+
var formatMessage = _ref5.formatMessage;
|
|
204
205
|
return [{
|
|
205
206
|
id: 'placeholderText',
|
|
206
207
|
title: formatMessage(_messages.messages.placeholderText),
|
|
@@ -213,12 +214,12 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
213
214
|
});
|
|
214
215
|
},
|
|
215
216
|
action: function action(insert, state) {
|
|
216
|
-
var _api$
|
|
217
|
+
var _api$analytics;
|
|
217
218
|
var tr = state.tr;
|
|
218
219
|
tr.setMeta(_pluginKey.pluginKey, {
|
|
219
220
|
showInsertPanelAt: tr.selection.anchor
|
|
220
221
|
});
|
|
221
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
222
|
+
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent({
|
|
222
223
|
action: _analytics.ACTION.INSERTED,
|
|
223
224
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
224
225
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PLACEHOLDER_TEXT,
|
|
@@ -234,8 +235,14 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
234
235
|
};
|
|
235
236
|
return plugin;
|
|
236
237
|
};
|
|
237
|
-
var placeholderTextPlugin = function placeholderTextPlugin(
|
|
238
|
-
|
|
238
|
+
var placeholderTextPlugin = function placeholderTextPlugin(_ref6) {
|
|
239
|
+
var _ref6$config = _ref6.config,
|
|
240
|
+
options = _ref6$config === void 0 ? {} : _ref6$config,
|
|
241
|
+
api = _ref6.api;
|
|
242
|
+
return decorateWithPluginOptions(basePlaceholderTextPlugin({
|
|
243
|
+
config: options,
|
|
244
|
+
api: api
|
|
245
|
+
}), options, api);
|
|
239
246
|
};
|
|
240
247
|
var _default = placeholderTextPlugin;
|
|
241
248
|
exports.default = _default;
|
|
@@ -18,17 +18,18 @@ var _commands = require("./commands");
|
|
|
18
18
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
19
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
var quickInsertPlugin = function quickInsertPlugin(
|
|
21
|
+
var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
22
|
+
var options = _ref.config;
|
|
22
23
|
return {
|
|
23
24
|
name: 'quickInsert',
|
|
24
25
|
pmPlugins: function pmPlugins(defaultItems) {
|
|
25
26
|
return [{
|
|
26
27
|
name: 'quickInsert',
|
|
27
28
|
// It's important that this plugin is above TypeAheadPlugin
|
|
28
|
-
plugin: function plugin(
|
|
29
|
-
var providerFactory =
|
|
30
|
-
getIntl =
|
|
31
|
-
dispatch =
|
|
29
|
+
plugin: function plugin(_ref2) {
|
|
30
|
+
var providerFactory = _ref2.providerFactory,
|
|
31
|
+
getIntl = _ref2.getIntl,
|
|
32
|
+
dispatch = _ref2.dispatch;
|
|
32
33
|
return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
|
|
33
34
|
}
|
|
34
35
|
}];
|
|
@@ -38,9 +39,9 @@ var quickInsertPlugin = function quickInsertPlugin(options) {
|
|
|
38
39
|
id: _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT,
|
|
39
40
|
trigger: '/',
|
|
40
41
|
headless: options === null || options === void 0 ? void 0 : options.headless,
|
|
41
|
-
getItems: function getItems(
|
|
42
|
-
var query =
|
|
43
|
-
editorState =
|
|
42
|
+
getItems: function getItems(_ref3) {
|
|
43
|
+
var query = _ref3.query,
|
|
44
|
+
editorState = _ref3.editorState;
|
|
44
45
|
var quickInsertState = _pluginKey.pluginKey.getState(editorState);
|
|
45
46
|
return Promise.resolve((0, _quickInsert.getQuickInsertSuggestions)({
|
|
46
47
|
searchOptions: {
|
|
@@ -56,8 +57,8 @@ var quickInsertPlugin = function quickInsertPlugin(options) {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
|
-
contentComponent: function contentComponent(
|
|
60
|
-
var editorView =
|
|
60
|
+
contentComponent: function contentComponent(_ref4) {
|
|
61
|
+
var editorView = _ref4.editorView;
|
|
61
62
|
if (options !== null && options !== void 0 && options.enableElementBrowser) {
|
|
62
63
|
return /*#__PURE__*/_react.default.createElement(_ModalElementBrowser.default, {
|
|
63
64
|
editorView: editorView,
|
|
@@ -142,7 +143,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
142
143
|
},
|
|
143
144
|
view: function view(editorView) {
|
|
144
145
|
var providerHandler = /*#__PURE__*/function () {
|
|
145
|
-
var
|
|
146
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
|
|
146
147
|
var provider, providedItems;
|
|
147
148
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
148
149
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -178,7 +179,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
178
179
|
}, _callee, null, [[1, 11]]);
|
|
179
180
|
}));
|
|
180
181
|
return function providerHandler(_x, _x2) {
|
|
181
|
-
return
|
|
182
|
+
return _ref5.apply(this, arguments);
|
|
182
183
|
};
|
|
183
184
|
}();
|
|
184
185
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
|
@@ -12,9 +12,10 @@ var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
|
12
12
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
13
13
|
var _inputRule = _interopRequireDefault(require("./pm-plugins/input-rule"));
|
|
14
14
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
15
|
-
var rulePlugin = function rulePlugin(
|
|
16
|
-
var _api$
|
|
17
|
-
var
|
|
15
|
+
var rulePlugin = function rulePlugin(_ref) {
|
|
16
|
+
var _api$featureFlags;
|
|
17
|
+
var api = _ref.api;
|
|
18
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
18
19
|
return {
|
|
19
20
|
name: 'rule',
|
|
20
21
|
nodes: function nodes() {
|
|
@@ -26,8 +27,8 @@ var rulePlugin = function rulePlugin(_, api) {
|
|
|
26
27
|
pmPlugins: function pmPlugins() {
|
|
27
28
|
return [{
|
|
28
29
|
name: 'ruleInputRule',
|
|
29
|
-
plugin: function plugin(
|
|
30
|
-
var schema =
|
|
30
|
+
plugin: function plugin(_ref2) {
|
|
31
|
+
var schema = _ref2.schema;
|
|
31
32
|
return (0, _inputRule.default)(schema, featureFlags);
|
|
32
33
|
}
|
|
33
34
|
}, {
|
|
@@ -38,8 +39,8 @@ var rulePlugin = function rulePlugin(_, api) {
|
|
|
38
39
|
}];
|
|
39
40
|
},
|
|
40
41
|
pluginsOptions: {
|
|
41
|
-
quickInsert: function quickInsert(
|
|
42
|
-
var formatMessage =
|
|
42
|
+
quickInsert: function quickInsert(_ref3) {
|
|
43
|
+
var formatMessage = _ref3.formatMessage;
|
|
43
44
|
return [{
|
|
44
45
|
id: 'rule',
|
|
45
46
|
title: formatMessage(_messages.messages.horizontalRule),
|
|
@@ -52,14 +52,15 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
var saveOnEnterPlugin = function saveOnEnterPlugin(
|
|
55
|
+
var saveOnEnterPlugin = function saveOnEnterPlugin(_ref2) {
|
|
56
|
+
var onSave = _ref2.config;
|
|
56
57
|
return {
|
|
57
58
|
name: 'saveOnEnter',
|
|
58
59
|
pmPlugins: function pmPlugins() {
|
|
59
60
|
return [{
|
|
60
61
|
name: 'saveOnEnter',
|
|
61
|
-
plugin: function plugin(
|
|
62
|
-
var dispatch =
|
|
62
|
+
plugin: function plugin(_ref3) {
|
|
63
|
+
var dispatch = _ref3.dispatch;
|
|
63
64
|
return createPlugin(dispatch, onSave);
|
|
64
65
|
}
|
|
65
66
|
}];
|
|
@@ -9,15 +9,16 @@ var _selectionMain = require("./pm-plugins/selection-main");
|
|
|
9
9
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
10
10
|
var _gapCursorMain = _interopRequireDefault(require("./pm-plugins/gap-cursor-main"));
|
|
11
11
|
var _gapCursorKeymap = _interopRequireDefault(require("./pm-plugins/gap-cursor-keymap"));
|
|
12
|
-
var selectionPlugin = function selectionPlugin(
|
|
12
|
+
var selectionPlugin = function selectionPlugin(_ref) {
|
|
13
|
+
var options = _ref.config;
|
|
13
14
|
return {
|
|
14
15
|
name: 'selection',
|
|
15
16
|
pmPlugins: function pmPlugins() {
|
|
16
17
|
return [{
|
|
17
18
|
name: 'selection',
|
|
18
|
-
plugin: function plugin(
|
|
19
|
-
var dispatch =
|
|
20
|
-
dispatchAnalyticsEvent =
|
|
19
|
+
plugin: function plugin(_ref2) {
|
|
20
|
+
var dispatch = _ref2.dispatch,
|
|
21
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
21
22
|
return (0, _selectionMain.createPlugin)(dispatch, dispatchAnalyticsEvent, options);
|
|
22
23
|
}
|
|
23
24
|
}, {
|
|
@@ -17,7 +17,8 @@ var _keymap = require("./keymap");
|
|
|
17
17
|
var _plugin = _interopRequireDefault(require("./plugin"));
|
|
18
18
|
var _pluginKey = require("./plugin-key");
|
|
19
19
|
var _statusPicker = _interopRequireDefault(require("./ui/statusPicker"));
|
|
20
|
-
var baseStatusPlugin = function baseStatusPlugin(
|
|
20
|
+
var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
21
|
+
var options = _ref.config;
|
|
21
22
|
return {
|
|
22
23
|
name: 'status',
|
|
23
24
|
nodes: function nodes() {
|
|
@@ -37,19 +38,19 @@ var baseStatusPlugin = function baseStatusPlugin(options) {
|
|
|
37
38
|
plugin: _keymap.keymapPlugin
|
|
38
39
|
}];
|
|
39
40
|
},
|
|
40
|
-
contentComponent: function contentComponent(
|
|
41
|
-
var editorView =
|
|
42
|
-
popupsMountPoint =
|
|
43
|
-
popupsBoundariesElement =
|
|
44
|
-
popupsScrollableElement =
|
|
41
|
+
contentComponent: function contentComponent(_ref2) {
|
|
42
|
+
var editorView = _ref2.editorView,
|
|
43
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
44
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
45
|
+
popupsScrollableElement = _ref2.popupsScrollableElement;
|
|
45
46
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
46
47
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
47
48
|
plugins: {
|
|
48
49
|
statusState: _pluginKey.pluginKey
|
|
49
50
|
},
|
|
50
|
-
render: function render(
|
|
51
|
-
var
|
|
52
|
-
statusState =
|
|
51
|
+
render: function render(_ref3) {
|
|
52
|
+
var _ref3$statusState = _ref3.statusState,
|
|
53
|
+
statusState = _ref3$statusState === void 0 ? {} : _ref3$statusState;
|
|
53
54
|
var showStatusPickerAt = statusState.showStatusPickerAt;
|
|
54
55
|
if (typeof showStatusPickerAt !== 'number') {
|
|
55
56
|
return null;
|
|
@@ -91,12 +92,12 @@ var baseStatusPlugin = function baseStatusPlugin(options) {
|
|
|
91
92
|
};
|
|
92
93
|
};
|
|
93
94
|
var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, options) {
|
|
94
|
-
if (options.menuDisabled === true) {
|
|
95
|
+
if ((options === null || options === void 0 ? void 0 : options.menuDisabled) === true) {
|
|
95
96
|
return plugin;
|
|
96
97
|
}
|
|
97
98
|
plugin.pluginsOptions = {
|
|
98
|
-
quickInsert: function quickInsert(
|
|
99
|
-
var formatMessage =
|
|
99
|
+
quickInsert: function quickInsert(_ref4) {
|
|
100
|
+
var formatMessage = _ref4.formatMessage;
|
|
100
101
|
return [{
|
|
101
102
|
id: 'status',
|
|
102
103
|
title: formatMessage(_messages.messages.status),
|
|
@@ -122,8 +123,13 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
122
123
|
};
|
|
123
124
|
return plugin;
|
|
124
125
|
};
|
|
125
|
-
var statusPlugin = function statusPlugin(
|
|
126
|
-
|
|
126
|
+
var statusPlugin = function statusPlugin(_ref5) {
|
|
127
|
+
var options = _ref5.config,
|
|
128
|
+
api = _ref5.api;
|
|
129
|
+
return decorateWithPluginOptions(baseStatusPlugin({
|
|
130
|
+
config: options,
|
|
131
|
+
api: api
|
|
132
|
+
}), options);
|
|
127
133
|
};
|
|
128
134
|
var _default = statusPlugin;
|
|
129
135
|
exports.default = _default;
|
|
@@ -45,14 +45,15 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
var submitEditorPlugin = function submitEditorPlugin(
|
|
48
|
+
var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
49
|
+
var onSave = _ref.config;
|
|
49
50
|
return {
|
|
50
51
|
name: 'submitEditor',
|
|
51
52
|
pmPlugins: function pmPlugins() {
|
|
52
53
|
return [{
|
|
53
54
|
name: 'submitEditor',
|
|
54
|
-
plugin: function plugin(
|
|
55
|
-
var dispatch =
|
|
55
|
+
plugin: function plugin(_ref2) {
|
|
56
|
+
var dispatch = _ref2.dispatch;
|
|
56
57
|
return createPlugin(dispatch, onSave);
|
|
57
58
|
}
|
|
58
59
|
}];
|
|
@@ -34,11 +34,12 @@ var addItem = function addItem(insert, listType, schema) {
|
|
|
34
34
|
})));
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin() {
|
|
38
|
-
var _ref2 =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
38
|
+
var _ref2$config = _ref2.config,
|
|
39
|
+
_ref2$config2 = _ref2$config === void 0 ? {} : _ref2$config,
|
|
40
|
+
allowNestedTasks = _ref2$config2.allowNestedTasks,
|
|
41
|
+
consumeTabs = _ref2$config2.consumeTabs,
|
|
42
|
+
useLongPressSelection = _ref2$config2.useLongPressSelection;
|
|
42
43
|
return {
|
|
43
44
|
name: 'taskDecision',
|
|
44
45
|
nodes: function nodes() {
|
|
@@ -22,9 +22,11 @@ var pluginConfig = function pluginConfig(textColorConfig) {
|
|
|
22
22
|
}
|
|
23
23
|
return textColorConfig;
|
|
24
24
|
};
|
|
25
|
-
var textColorPlugin = function textColorPlugin(
|
|
26
|
-
var _api$
|
|
27
|
-
var
|
|
25
|
+
var textColorPlugin = function textColorPlugin(_ref) {
|
|
26
|
+
var _api$featureFlags;
|
|
27
|
+
var textColorConfig = _ref.config,
|
|
28
|
+
api = _ref.api;
|
|
29
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
28
30
|
return {
|
|
29
31
|
name: 'textColor',
|
|
30
32
|
marks: function marks() {
|
|
@@ -36,26 +38,26 @@ var textColorPlugin = function textColorPlugin(textColorConfig, api) {
|
|
|
36
38
|
pmPlugins: function pmPlugins() {
|
|
37
39
|
return [{
|
|
38
40
|
name: 'textColor',
|
|
39
|
-
plugin: function plugin(
|
|
40
|
-
var dispatch =
|
|
41
|
+
plugin: function plugin(_ref2) {
|
|
42
|
+
var dispatch = _ref2.dispatch;
|
|
41
43
|
return (0, _main.createPlugin)(dispatch, pluginConfig(textColorConfig));
|
|
42
44
|
}
|
|
43
45
|
}];
|
|
44
46
|
},
|
|
45
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
46
|
-
var editorView =
|
|
47
|
-
popupsMountPoint =
|
|
48
|
-
popupsBoundariesElement =
|
|
49
|
-
popupsScrollableElement =
|
|
50
|
-
isToolbarReducedSpacing =
|
|
51
|
-
dispatchAnalyticsEvent =
|
|
52
|
-
disabled =
|
|
47
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
|
|
48
|
+
var editorView = _ref3.editorView,
|
|
49
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
50
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
51
|
+
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
52
|
+
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
|
|
53
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
54
|
+
disabled = _ref3.disabled;
|
|
53
55
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
54
56
|
plugins: {
|
|
55
57
|
textColor: _main.pluginKey
|
|
56
58
|
},
|
|
57
|
-
render: function render(
|
|
58
|
-
var textColor =
|
|
59
|
+
render: function render(_ref4) {
|
|
60
|
+
var textColor = _ref4.textColor;
|
|
59
61
|
return /*#__PURE__*/_react.default.createElement(_ToolbarTextColor.default, {
|
|
60
62
|
pluginState: textColor,
|
|
61
63
|
isReducedSpacing: isToolbarReducedSpacing,
|
|
@@ -10,11 +10,16 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
10
10
|
var _ui = _interopRequireDefault(require("./ui"));
|
|
11
11
|
var _types = require("../../ui/Toolbar/types");
|
|
12
12
|
var _indentationButtons = require("./pm-plugins/indentation-buttons");
|
|
13
|
-
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref
|
|
14
|
-
var _api$
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
13
|
+
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref) {
|
|
14
|
+
var _api$featureFlags;
|
|
15
|
+
var config = _ref.config,
|
|
16
|
+
api = _ref.api;
|
|
17
|
+
var _ref2 = config !== null && config !== void 0 ? config : {},
|
|
18
|
+
_ref2$showIndentation = _ref2.showIndentationButtons,
|
|
19
|
+
showIndentationButtons = _ref2$showIndentation === void 0 ? false : _ref2$showIndentation,
|
|
20
|
+
_ref2$allowHeadingAnd = _ref2.allowHeadingAndParagraphIndentation,
|
|
21
|
+
allowHeadingAndParagraphIndentation = _ref2$allowHeadingAnd === void 0 ? false : _ref2$allowHeadingAnd;
|
|
22
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
18
23
|
return {
|
|
19
24
|
name: 'toolbarListsIndentation',
|
|
20
25
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -26,8 +31,8 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
|
|
|
26
31
|
pmPlugins: function pmPlugins() {
|
|
27
32
|
return [{
|
|
28
33
|
name: 'indentationButtons',
|
|
29
|
-
plugin: function plugin(
|
|
30
|
-
var dispatch =
|
|
34
|
+
plugin: function plugin(_ref3) {
|
|
35
|
+
var dispatch = _ref3.dispatch;
|
|
31
36
|
return (0, _indentationButtons.createPlugin)({
|
|
32
37
|
dispatch: dispatch,
|
|
33
38
|
showIndentationButtons: showIndentationButtons,
|
|
@@ -37,14 +42,14 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
|
|
|
37
42
|
}
|
|
38
43
|
}];
|
|
39
44
|
},
|
|
40
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
41
|
-
var editorView =
|
|
42
|
-
popupsMountPoint =
|
|
43
|
-
popupsBoundariesElement =
|
|
44
|
-
popupsScrollableElement =
|
|
45
|
-
toolbarSize =
|
|
46
|
-
disabled =
|
|
47
|
-
isToolbarReducedSpacing =
|
|
45
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref4) {
|
|
46
|
+
var editorView = _ref4.editorView,
|
|
47
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
48
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
49
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
50
|
+
toolbarSize = _ref4.toolbarSize,
|
|
51
|
+
disabled = _ref4.disabled,
|
|
52
|
+
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
|
|
48
53
|
var isSmall = toolbarSize < _types.ToolbarSize.L;
|
|
49
54
|
return /*#__PURE__*/_react.default.createElement(PrimaryToolbarComponent, {
|
|
50
55
|
featureFlags: featureFlags,
|
|
@@ -61,17 +66,17 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
|
|
|
61
66
|
}
|
|
62
67
|
};
|
|
63
68
|
};
|
|
64
|
-
function PrimaryToolbarComponent(
|
|
65
|
-
var featureFlags =
|
|
66
|
-
popupsMountPoint =
|
|
67
|
-
popupsBoundariesElement =
|
|
68
|
-
popupsScrollableElement =
|
|
69
|
-
isSmall =
|
|
70
|
-
isToolbarReducedSpacing =
|
|
71
|
-
disabled =
|
|
72
|
-
editorView =
|
|
73
|
-
showIndentationButtons =
|
|
74
|
-
pluginInjectionApi =
|
|
69
|
+
function PrimaryToolbarComponent(_ref5) {
|
|
70
|
+
var featureFlags = _ref5.featureFlags,
|
|
71
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
72
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
73
|
+
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
74
|
+
isSmall = _ref5.isSmall,
|
|
75
|
+
isToolbarReducedSpacing = _ref5.isToolbarReducedSpacing,
|
|
76
|
+
disabled = _ref5.disabled,
|
|
77
|
+
editorView = _ref5.editorView,
|
|
78
|
+
showIndentationButtons = _ref5.showIndentationButtons,
|
|
79
|
+
pluginInjectionApi = _ref5.pluginInjectionApi;
|
|
75
80
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['list', 'toolbarListsIndentation']),
|
|
76
81
|
listState = _useSharedPluginState.listState,
|
|
77
82
|
toolbarListsIndentationState = _useSharedPluginState.toolbarListsIndentationState;
|
|
@@ -26,7 +26,7 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
|
|
|
26
26
|
// not use the indentation mark.
|
|
27
27
|
// Check for lists before paragraphs and headings in case
|
|
28
28
|
// the selection is in a list nested in a layout column.
|
|
29
|
-
if (api !== null && api !== void 0 && api.
|
|
29
|
+
if (api !== null && api !== void 0 && api.list.actions.isInsideListItem(editorState.tr)) {
|
|
30
30
|
var _getListItemAttribute = (0, _lists.getListItemAttributes)(selection.$head),
|
|
31
31
|
indentLevel = _getListItemAttribute.indentLevel,
|
|
32
32
|
itemIndex = _getListItemAttribute.itemIndex;
|
|
@@ -14,10 +14,10 @@ var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
14
14
|
editorView = _ref.editorView;
|
|
15
15
|
switch (buttonName) {
|
|
16
16
|
case 'bullet_list':
|
|
17
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
17
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleBulletList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
18
18
|
break;
|
|
19
19
|
case 'ordered_list':
|
|
20
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
20
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleOrderedList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
21
21
|
break;
|
|
22
22
|
case 'indent':
|
|
23
23
|
{
|
|
@@ -27,7 +27,7 @@ var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
27
27
|
(0, _commands.getIndentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
28
28
|
}
|
|
29
29
|
if (node === 'list') {
|
|
30
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
30
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
31
31
|
}
|
|
32
32
|
if (node === 'taskList') {
|
|
33
33
|
(0, _keymaps.getIndentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
@@ -42,7 +42,7 @@ var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
42
42
|
(0, _commands.getOutdentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
43
43
|
}
|
|
44
44
|
if (_node === 'list') {
|
|
45
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
45
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
46
46
|
}
|
|
47
47
|
if (_node === 'taskList') {
|
|
48
48
|
(0, _keymaps.getUnindentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|