@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
|
@@ -73,13 +73,13 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
73
73
|
key: pluginKey,
|
|
74
74
|
state: {
|
|
75
75
|
init: function init(_, state) {
|
|
76
|
-
var _api$
|
|
77
|
-
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$
|
|
76
|
+
var _api$focus, _api$focus$sharedStat;
|
|
77
|
+
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);
|
|
78
78
|
},
|
|
79
79
|
apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
|
|
80
|
-
var _api$
|
|
80
|
+
var _api$focus2, _api$focus2$sharedSta;
|
|
81
81
|
var meta = tr.getMeta(pluginKey);
|
|
82
|
-
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$
|
|
82
|
+
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);
|
|
83
83
|
if (meta) {
|
|
84
84
|
if (meta.removePlaceholder) {
|
|
85
85
|
return emptyPlaceholder;
|
|
@@ -93,12 +93,12 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
93
93
|
},
|
|
94
94
|
props: {
|
|
95
95
|
decorations: function decorations(editorState) {
|
|
96
|
-
var _api$
|
|
96
|
+
var _api$composition;
|
|
97
97
|
var _getPlaceholderState = getPlaceholderState(editorState),
|
|
98
98
|
hasPlaceholder = _getPlaceholderState.hasPlaceholder,
|
|
99
99
|
placeholderText = _getPlaceholderState.placeholderText,
|
|
100
100
|
pos = _getPlaceholderState.pos;
|
|
101
|
-
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$
|
|
101
|
+
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$composition = api.composition) === null || _api$composition === void 0 ? void 0 : _api$composition.sharedState.currentState();
|
|
102
102
|
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
103
103
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
104
104
|
}
|
|
@@ -107,7 +107,9 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
var placeholderPlugin = function placeholderPlugin(
|
|
110
|
+
var placeholderPlugin = function placeholderPlugin(_ref) {
|
|
111
|
+
var options = _ref.config,
|
|
112
|
+
api = _ref.api;
|
|
111
113
|
return {
|
|
112
114
|
name: 'placeholder',
|
|
113
115
|
pmPlugins: function pmPlugins() {
|
|
@@ -123,7 +123,8 @@ export function createPlugin(dispatch, options) {
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(
|
|
126
|
+
var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(_ref) {
|
|
127
|
+
var options = _ref.config;
|
|
127
128
|
return {
|
|
128
129
|
name: 'placeholderText',
|
|
129
130
|
nodes: function nodes() {
|
|
@@ -135,16 +136,16 @@ var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(options) {
|
|
|
135
136
|
pmPlugins: function pmPlugins() {
|
|
136
137
|
return [{
|
|
137
138
|
name: 'placeholderText',
|
|
138
|
-
plugin: function plugin(
|
|
139
|
-
var dispatch =
|
|
139
|
+
plugin: function plugin(_ref2) {
|
|
140
|
+
var dispatch = _ref2.dispatch;
|
|
140
141
|
return createPlugin(dispatch, options);
|
|
141
142
|
}
|
|
142
143
|
}];
|
|
143
144
|
},
|
|
144
|
-
contentComponent: function contentComponent(
|
|
145
|
-
var editorView =
|
|
146
|
-
popupsMountPoint =
|
|
147
|
-
popupsBoundariesElement =
|
|
145
|
+
contentComponent: function contentComponent(_ref3) {
|
|
146
|
+
var editorView = _ref3.editorView,
|
|
147
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
148
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement;
|
|
148
149
|
var insertPlaceholderText = function insertPlaceholderText(value) {
|
|
149
150
|
return insertPlaceholderTextAtSelection(value)(editorView.state, editorView.dispatch);
|
|
150
151
|
};
|
|
@@ -164,9 +165,9 @@ var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(options) {
|
|
|
164
165
|
plugins: {
|
|
165
166
|
placeholderTextState: pluginKey
|
|
166
167
|
},
|
|
167
|
-
render: function render(
|
|
168
|
-
var
|
|
169
|
-
placeholderTextState =
|
|
168
|
+
render: function render(_ref4) {
|
|
169
|
+
var _ref4$placeholderText = _ref4.placeholderTextState,
|
|
170
|
+
placeholderTextState = _ref4$placeholderText === void 0 ? {} : _ref4$placeholderText;
|
|
170
171
|
if (placeholderTextState.showInsertPanelAt) {
|
|
171
172
|
return /*#__PURE__*/React.createElement(PlaceholderFloatingToolbar, {
|
|
172
173
|
editorViewDOM: editorView.dom,
|
|
@@ -191,8 +192,8 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
191
192
|
return plugin;
|
|
192
193
|
}
|
|
193
194
|
plugin.pluginsOptions = {
|
|
194
|
-
quickInsert: function quickInsert(
|
|
195
|
-
var formatMessage =
|
|
195
|
+
quickInsert: function quickInsert(_ref5) {
|
|
196
|
+
var formatMessage = _ref5.formatMessage;
|
|
196
197
|
return [{
|
|
197
198
|
id: 'placeholderText',
|
|
198
199
|
title: formatMessage(messages.placeholderText),
|
|
@@ -205,12 +206,12 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
205
206
|
});
|
|
206
207
|
},
|
|
207
208
|
action: function action(insert, state) {
|
|
208
|
-
var _api$
|
|
209
|
+
var _api$analytics;
|
|
209
210
|
var tr = state.tr;
|
|
210
211
|
tr.setMeta(pluginKey, {
|
|
211
212
|
showInsertPanelAt: tr.selection.anchor
|
|
212
213
|
});
|
|
213
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
214
|
+
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent({
|
|
214
215
|
action: ACTION.INSERTED,
|
|
215
216
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
216
217
|
actionSubjectId: ACTION_SUBJECT_ID.PLACEHOLDER_TEXT,
|
|
@@ -226,7 +227,13 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
226
227
|
};
|
|
227
228
|
return plugin;
|
|
228
229
|
};
|
|
229
|
-
var placeholderTextPlugin = function placeholderTextPlugin(
|
|
230
|
-
|
|
230
|
+
var placeholderTextPlugin = function placeholderTextPlugin(_ref6) {
|
|
231
|
+
var _ref6$config = _ref6.config,
|
|
232
|
+
options = _ref6$config === void 0 ? {} : _ref6$config,
|
|
233
|
+
api = _ref6.api;
|
|
234
|
+
return decorateWithPluginOptions(basePlaceholderTextPlugin({
|
|
235
|
+
config: options,
|
|
236
|
+
api: api
|
|
237
|
+
}), options, api);
|
|
231
238
|
};
|
|
232
239
|
export default placeholderTextPlugin;
|
|
@@ -11,17 +11,18 @@ import { search } from './search';
|
|
|
11
11
|
import ModalElementBrowser from './ui/ModalElementBrowser';
|
|
12
12
|
import { openElementBrowserModal, insertItem } from './commands';
|
|
13
13
|
import { memoProcessQuickInsertItems, getQuickInsertSuggestions } from '@atlaskit/editor-common/quick-insert';
|
|
14
|
-
var quickInsertPlugin = function quickInsertPlugin(
|
|
14
|
+
var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
15
|
+
var options = _ref.config;
|
|
15
16
|
return {
|
|
16
17
|
name: 'quickInsert',
|
|
17
18
|
pmPlugins: function pmPlugins(defaultItems) {
|
|
18
19
|
return [{
|
|
19
20
|
name: 'quickInsert',
|
|
20
21
|
// It's important that this plugin is above TypeAheadPlugin
|
|
21
|
-
plugin: function plugin(
|
|
22
|
-
var providerFactory =
|
|
23
|
-
getIntl =
|
|
24
|
-
dispatch =
|
|
22
|
+
plugin: function plugin(_ref2) {
|
|
23
|
+
var providerFactory = _ref2.providerFactory,
|
|
24
|
+
getIntl = _ref2.getIntl,
|
|
25
|
+
dispatch = _ref2.dispatch;
|
|
25
26
|
return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
|
|
26
27
|
}
|
|
27
28
|
}];
|
|
@@ -31,9 +32,9 @@ var quickInsertPlugin = function quickInsertPlugin(options) {
|
|
|
31
32
|
id: TypeAheadAvailableNodes.QUICK_INSERT,
|
|
32
33
|
trigger: '/',
|
|
33
34
|
headless: options === null || options === void 0 ? void 0 : options.headless,
|
|
34
|
-
getItems: function getItems(
|
|
35
|
-
var query =
|
|
36
|
-
editorState =
|
|
35
|
+
getItems: function getItems(_ref3) {
|
|
36
|
+
var query = _ref3.query,
|
|
37
|
+
editorState = _ref3.editorState;
|
|
37
38
|
var quickInsertState = pluginKey.getState(editorState);
|
|
38
39
|
return Promise.resolve(getQuickInsertSuggestions({
|
|
39
40
|
searchOptions: {
|
|
@@ -49,8 +50,8 @@ var quickInsertPlugin = function quickInsertPlugin(options) {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
|
-
contentComponent: function contentComponent(
|
|
53
|
-
var editorView =
|
|
53
|
+
contentComponent: function contentComponent(_ref4) {
|
|
54
|
+
var editorView = _ref4.editorView;
|
|
54
55
|
if (options !== null && options !== void 0 && options.enableElementBrowser) {
|
|
55
56
|
return /*#__PURE__*/React.createElement(ModalElementBrowser, {
|
|
56
57
|
editorView: editorView,
|
|
@@ -134,7 +135,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
134
135
|
},
|
|
135
136
|
view: function view(editorView) {
|
|
136
137
|
var providerHandler = /*#__PURE__*/function () {
|
|
137
|
-
var
|
|
138
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
|
|
138
139
|
var provider, providedItems;
|
|
139
140
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
140
141
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -170,7 +171,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
170
171
|
}, _callee, null, [[1, 11]]);
|
|
171
172
|
}));
|
|
172
173
|
return function providerHandler(_x, _x2) {
|
|
173
|
-
return
|
|
174
|
+
return _ref5.apply(this, arguments);
|
|
174
175
|
};
|
|
175
176
|
}();
|
|
176
177
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
|
@@ -5,9 +5,10 @@ import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
|
5
5
|
import { IconDivider } from '@atlaskit/editor-common/quick-insert';
|
|
6
6
|
import inputRulePlugin from './pm-plugins/input-rule';
|
|
7
7
|
import keymapPlugin from './pm-plugins/keymap';
|
|
8
|
-
var rulePlugin = function rulePlugin(
|
|
9
|
-
var _api$
|
|
10
|
-
var
|
|
8
|
+
var rulePlugin = function rulePlugin(_ref) {
|
|
9
|
+
var _api$featureFlags;
|
|
10
|
+
var api = _ref.api;
|
|
11
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
11
12
|
return {
|
|
12
13
|
name: 'rule',
|
|
13
14
|
nodes: function nodes() {
|
|
@@ -19,8 +20,8 @@ var rulePlugin = function rulePlugin(_, api) {
|
|
|
19
20
|
pmPlugins: function pmPlugins() {
|
|
20
21
|
return [{
|
|
21
22
|
name: 'ruleInputRule',
|
|
22
|
-
plugin: function plugin(
|
|
23
|
-
var schema =
|
|
23
|
+
plugin: function plugin(_ref2) {
|
|
24
|
+
var schema = _ref2.schema;
|
|
24
25
|
return inputRulePlugin(schema, featureFlags);
|
|
25
26
|
}
|
|
26
27
|
}, {
|
|
@@ -31,8 +32,8 @@ var rulePlugin = function rulePlugin(_, api) {
|
|
|
31
32
|
}];
|
|
32
33
|
},
|
|
33
34
|
pluginsOptions: {
|
|
34
|
-
quickInsert: function quickInsert(
|
|
35
|
-
var formatMessage =
|
|
35
|
+
quickInsert: function quickInsert(_ref3) {
|
|
36
|
+
var formatMessage = _ref3.formatMessage;
|
|
36
37
|
return [{
|
|
37
38
|
id: 'rule',
|
|
38
39
|
title: formatMessage(messages.horizontalRule),
|
|
@@ -45,14 +45,15 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
var saveOnEnterPlugin = function saveOnEnterPlugin(
|
|
48
|
+
var saveOnEnterPlugin = function saveOnEnterPlugin(_ref2) {
|
|
49
|
+
var onSave = _ref2.config;
|
|
49
50
|
return {
|
|
50
51
|
name: 'saveOnEnter',
|
|
51
52
|
pmPlugins: function pmPlugins() {
|
|
52
53
|
return [{
|
|
53
54
|
name: 'saveOnEnter',
|
|
54
|
-
plugin: function plugin(
|
|
55
|
-
var dispatch =
|
|
55
|
+
plugin: function plugin(_ref3) {
|
|
56
|
+
var dispatch = _ref3.dispatch;
|
|
56
57
|
return createPlugin(dispatch, onSave);
|
|
57
58
|
}
|
|
58
59
|
}];
|
|
@@ -2,15 +2,16 @@ import { createPlugin } from './pm-plugins/selection-main';
|
|
|
2
2
|
import selectionKeymapPlugin from './pm-plugins/keymap';
|
|
3
3
|
import gapCursorPlugin from './pm-plugins/gap-cursor-main';
|
|
4
4
|
import gapCursorKeymapPlugin from './pm-plugins/gap-cursor-keymap';
|
|
5
|
-
export var selectionPlugin = function selectionPlugin(
|
|
5
|
+
export var selectionPlugin = function selectionPlugin(_ref) {
|
|
6
|
+
var options = _ref.config;
|
|
6
7
|
return {
|
|
7
8
|
name: 'selection',
|
|
8
9
|
pmPlugins: function pmPlugins() {
|
|
9
10
|
return [{
|
|
10
11
|
name: 'selection',
|
|
11
|
-
plugin: function plugin(
|
|
12
|
-
var dispatch =
|
|
13
|
-
dispatchAnalyticsEvent =
|
|
12
|
+
plugin: function plugin(_ref2) {
|
|
13
|
+
var dispatch = _ref2.dispatch,
|
|
14
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
14
15
|
return createPlugin(dispatch, dispatchAnalyticsEvent, options);
|
|
15
16
|
}
|
|
16
17
|
}, {
|
|
@@ -10,7 +10,8 @@ import { keymapPlugin } from './keymap';
|
|
|
10
10
|
import createStatusPlugin from './plugin';
|
|
11
11
|
import { pluginKey } from './plugin-key';
|
|
12
12
|
import StatusPicker from './ui/statusPicker';
|
|
13
|
-
var baseStatusPlugin = function baseStatusPlugin(
|
|
13
|
+
var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
14
|
+
var options = _ref.config;
|
|
14
15
|
return {
|
|
15
16
|
name: 'status',
|
|
16
17
|
nodes: function nodes() {
|
|
@@ -30,19 +31,19 @@ var baseStatusPlugin = function baseStatusPlugin(options) {
|
|
|
30
31
|
plugin: keymapPlugin
|
|
31
32
|
}];
|
|
32
33
|
},
|
|
33
|
-
contentComponent: function contentComponent(
|
|
34
|
-
var editorView =
|
|
35
|
-
popupsMountPoint =
|
|
36
|
-
popupsBoundariesElement =
|
|
37
|
-
popupsScrollableElement =
|
|
34
|
+
contentComponent: function contentComponent(_ref2) {
|
|
35
|
+
var editorView = _ref2.editorView,
|
|
36
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
37
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
38
|
+
popupsScrollableElement = _ref2.popupsScrollableElement;
|
|
38
39
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
39
40
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
40
41
|
plugins: {
|
|
41
42
|
statusState: pluginKey
|
|
42
43
|
},
|
|
43
|
-
render: function render(
|
|
44
|
-
var
|
|
45
|
-
statusState =
|
|
44
|
+
render: function render(_ref3) {
|
|
45
|
+
var _ref3$statusState = _ref3.statusState,
|
|
46
|
+
statusState = _ref3$statusState === void 0 ? {} : _ref3$statusState;
|
|
46
47
|
var showStatusPickerAt = statusState.showStatusPickerAt;
|
|
47
48
|
if (typeof showStatusPickerAt !== 'number') {
|
|
48
49
|
return null;
|
|
@@ -84,12 +85,12 @@ var baseStatusPlugin = function baseStatusPlugin(options) {
|
|
|
84
85
|
};
|
|
85
86
|
};
|
|
86
87
|
var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, options) {
|
|
87
|
-
if (options.menuDisabled === true) {
|
|
88
|
+
if ((options === null || options === void 0 ? void 0 : options.menuDisabled) === true) {
|
|
88
89
|
return plugin;
|
|
89
90
|
}
|
|
90
91
|
plugin.pluginsOptions = {
|
|
91
|
-
quickInsert: function quickInsert(
|
|
92
|
-
var formatMessage =
|
|
92
|
+
quickInsert: function quickInsert(_ref4) {
|
|
93
|
+
var formatMessage = _ref4.formatMessage;
|
|
93
94
|
return [{
|
|
94
95
|
id: 'status',
|
|
95
96
|
title: formatMessage(messages.status),
|
|
@@ -115,7 +116,12 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
115
116
|
};
|
|
116
117
|
return plugin;
|
|
117
118
|
};
|
|
118
|
-
var statusPlugin = function statusPlugin(
|
|
119
|
-
|
|
119
|
+
var statusPlugin = function statusPlugin(_ref5) {
|
|
120
|
+
var options = _ref5.config,
|
|
121
|
+
api = _ref5.api;
|
|
122
|
+
return decorateWithPluginOptions(baseStatusPlugin({
|
|
123
|
+
config: options,
|
|
124
|
+
api: api
|
|
125
|
+
}), options);
|
|
120
126
|
};
|
|
121
127
|
export default statusPlugin;
|
|
@@ -37,14 +37,15 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
var submitEditorPlugin = function submitEditorPlugin(
|
|
40
|
+
var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
41
|
+
var onSave = _ref.config;
|
|
41
42
|
return {
|
|
42
43
|
name: 'submitEditor',
|
|
43
44
|
pmPlugins: function pmPlugins() {
|
|
44
45
|
return [{
|
|
45
46
|
name: 'submitEditor',
|
|
46
|
-
plugin: function plugin(
|
|
47
|
-
var dispatch =
|
|
47
|
+
plugin: function plugin(_ref2) {
|
|
48
|
+
var dispatch = _ref2.dispatch;
|
|
48
49
|
return createPlugin(dispatch, onSave);
|
|
49
50
|
}
|
|
50
51
|
}];
|
|
@@ -27,11 +27,12 @@ var addItem = function addItem(insert, listType, schema) {
|
|
|
27
27
|
})));
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin() {
|
|
31
|
-
var _ref2 =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
31
|
+
var _ref2$config = _ref2.config,
|
|
32
|
+
_ref2$config2 = _ref2$config === void 0 ? {} : _ref2$config,
|
|
33
|
+
allowNestedTasks = _ref2$config2.allowNestedTasks,
|
|
34
|
+
consumeTabs = _ref2$config2.consumeTabs,
|
|
35
|
+
useLongPressSelection = _ref2$config2.useLongPressSelection;
|
|
35
36
|
return {
|
|
36
37
|
name: 'taskDecision',
|
|
37
38
|
nodes: function nodes() {
|
|
@@ -9,9 +9,11 @@ var pluginConfig = function pluginConfig(textColorConfig) {
|
|
|
9
9
|
}
|
|
10
10
|
return textColorConfig;
|
|
11
11
|
};
|
|
12
|
-
var textColorPlugin = function textColorPlugin(
|
|
13
|
-
var _api$
|
|
14
|
-
var
|
|
12
|
+
var textColorPlugin = function textColorPlugin(_ref) {
|
|
13
|
+
var _api$featureFlags;
|
|
14
|
+
var textColorConfig = _ref.config,
|
|
15
|
+
api = _ref.api;
|
|
16
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
15
17
|
return {
|
|
16
18
|
name: 'textColor',
|
|
17
19
|
marks: function marks() {
|
|
@@ -23,26 +25,26 @@ var textColorPlugin = function textColorPlugin(textColorConfig, api) {
|
|
|
23
25
|
pmPlugins: function pmPlugins() {
|
|
24
26
|
return [{
|
|
25
27
|
name: 'textColor',
|
|
26
|
-
plugin: function plugin(
|
|
27
|
-
var dispatch =
|
|
28
|
+
plugin: function plugin(_ref2) {
|
|
29
|
+
var dispatch = _ref2.dispatch;
|
|
28
30
|
return createPlugin(dispatch, pluginConfig(textColorConfig));
|
|
29
31
|
}
|
|
30
32
|
}];
|
|
31
33
|
},
|
|
32
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
33
|
-
var editorView =
|
|
34
|
-
popupsMountPoint =
|
|
35
|
-
popupsBoundariesElement =
|
|
36
|
-
popupsScrollableElement =
|
|
37
|
-
isToolbarReducedSpacing =
|
|
38
|
-
dispatchAnalyticsEvent =
|
|
39
|
-
disabled =
|
|
34
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
|
|
35
|
+
var editorView = _ref3.editorView,
|
|
36
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
37
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
38
|
+
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
39
|
+
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
|
|
40
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
41
|
+
disabled = _ref3.disabled;
|
|
40
42
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
41
43
|
plugins: {
|
|
42
44
|
textColor: textColorPluginKey
|
|
43
45
|
},
|
|
44
|
-
render: function render(
|
|
45
|
-
var textColor =
|
|
46
|
+
render: function render(_ref4) {
|
|
47
|
+
var textColor = _ref4.textColor;
|
|
46
48
|
return /*#__PURE__*/React.createElement(ToolbarTextColor, {
|
|
47
49
|
pluginState: textColor,
|
|
48
50
|
isReducedSpacing: isToolbarReducedSpacing,
|
|
@@ -4,11 +4,16 @@ import ToolbarListsIndentation from './ui';
|
|
|
4
4
|
import { ToolbarSize } from '../../ui/Toolbar/types';
|
|
5
5
|
import { createPlugin as indentationButtonsPlugin } from './pm-plugins/indentation-buttons';
|
|
6
6
|
import { pluginKey as indentationButtonPluginKey } from './pm-plugins/indentation-buttons';
|
|
7
|
-
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref
|
|
8
|
-
var _api$
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
7
|
+
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref) {
|
|
8
|
+
var _api$featureFlags;
|
|
9
|
+
var config = _ref.config,
|
|
10
|
+
api = _ref.api;
|
|
11
|
+
var _ref2 = config !== null && config !== void 0 ? config : {},
|
|
12
|
+
_ref2$showIndentation = _ref2.showIndentationButtons,
|
|
13
|
+
showIndentationButtons = _ref2$showIndentation === void 0 ? false : _ref2$showIndentation,
|
|
14
|
+
_ref2$allowHeadingAnd = _ref2.allowHeadingAndParagraphIndentation,
|
|
15
|
+
allowHeadingAndParagraphIndentation = _ref2$allowHeadingAnd === void 0 ? false : _ref2$allowHeadingAnd;
|
|
16
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
12
17
|
return {
|
|
13
18
|
name: 'toolbarListsIndentation',
|
|
14
19
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -20,8 +25,8 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
|
|
|
20
25
|
pmPlugins: function pmPlugins() {
|
|
21
26
|
return [{
|
|
22
27
|
name: 'indentationButtons',
|
|
23
|
-
plugin: function plugin(
|
|
24
|
-
var dispatch =
|
|
28
|
+
plugin: function plugin(_ref3) {
|
|
29
|
+
var dispatch = _ref3.dispatch;
|
|
25
30
|
return indentationButtonsPlugin({
|
|
26
31
|
dispatch: dispatch,
|
|
27
32
|
showIndentationButtons: showIndentationButtons,
|
|
@@ -31,14 +36,14 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
|
|
|
31
36
|
}
|
|
32
37
|
}];
|
|
33
38
|
},
|
|
34
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
35
|
-
var editorView =
|
|
36
|
-
popupsMountPoint =
|
|
37
|
-
popupsBoundariesElement =
|
|
38
|
-
popupsScrollableElement =
|
|
39
|
-
toolbarSize =
|
|
40
|
-
disabled =
|
|
41
|
-
isToolbarReducedSpacing =
|
|
39
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref4) {
|
|
40
|
+
var editorView = _ref4.editorView,
|
|
41
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
42
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
43
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
44
|
+
toolbarSize = _ref4.toolbarSize,
|
|
45
|
+
disabled = _ref4.disabled,
|
|
46
|
+
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
|
|
42
47
|
var isSmall = toolbarSize < ToolbarSize.L;
|
|
43
48
|
return /*#__PURE__*/React.createElement(PrimaryToolbarComponent, {
|
|
44
49
|
featureFlags: featureFlags,
|
|
@@ -55,17 +60,17 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
|
|
|
55
60
|
}
|
|
56
61
|
};
|
|
57
62
|
};
|
|
58
|
-
function PrimaryToolbarComponent(
|
|
59
|
-
var featureFlags =
|
|
60
|
-
popupsMountPoint =
|
|
61
|
-
popupsBoundariesElement =
|
|
62
|
-
popupsScrollableElement =
|
|
63
|
-
isSmall =
|
|
64
|
-
isToolbarReducedSpacing =
|
|
65
|
-
disabled =
|
|
66
|
-
editorView =
|
|
67
|
-
showIndentationButtons =
|
|
68
|
-
pluginInjectionApi =
|
|
63
|
+
function PrimaryToolbarComponent(_ref5) {
|
|
64
|
+
var featureFlags = _ref5.featureFlags,
|
|
65
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
66
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
67
|
+
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
68
|
+
isSmall = _ref5.isSmall,
|
|
69
|
+
isToolbarReducedSpacing = _ref5.isToolbarReducedSpacing,
|
|
70
|
+
disabled = _ref5.disabled,
|
|
71
|
+
editorView = _ref5.editorView,
|
|
72
|
+
showIndentationButtons = _ref5.showIndentationButtons,
|
|
73
|
+
pluginInjectionApi = _ref5.pluginInjectionApi;
|
|
69
74
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['list', 'toolbarListsIndentation']),
|
|
70
75
|
listState = _useSharedPluginState.listState,
|
|
71
76
|
toolbarListsIndentationState = _useSharedPluginState.toolbarListsIndentationState;
|
|
@@ -19,7 +19,7 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
|
|
|
19
19
|
// not use the indentation mark.
|
|
20
20
|
// Check for lists before paragraphs and headings in case
|
|
21
21
|
// the selection is in a list nested in a layout column.
|
|
22
|
-
if (api !== null && api !== void 0 && api.
|
|
22
|
+
if (api !== null && api !== void 0 && api.list.actions.isInsideListItem(editorState.tr)) {
|
|
23
23
|
var _getListItemAttribute = getListItemAttributes(selection.$head),
|
|
24
24
|
indentLevel = _getListItemAttribute.indentLevel,
|
|
25
25
|
itemIndex = _getListItemAttribute.itemIndex;
|
|
@@ -8,10 +8,10 @@ export var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
8
8
|
editorView = _ref.editorView;
|
|
9
9
|
switch (buttonName) {
|
|
10
10
|
case 'bullet_list':
|
|
11
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
11
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleBulletList(INPUT_METHOD.TOOLBAR));
|
|
12
12
|
break;
|
|
13
13
|
case 'ordered_list':
|
|
14
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
14
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleOrderedList(INPUT_METHOD.TOOLBAR));
|
|
15
15
|
break;
|
|
16
16
|
case 'indent':
|
|
17
17
|
{
|
|
@@ -21,7 +21,7 @@ export var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
21
21
|
indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
22
22
|
}
|
|
23
23
|
if (node === 'list') {
|
|
24
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
24
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(INPUT_METHOD.TOOLBAR));
|
|
25
25
|
}
|
|
26
26
|
if (node === 'taskList') {
|
|
27
27
|
indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
@@ -36,7 +36,7 @@ export var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
36
36
|
outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
37
37
|
}
|
|
38
38
|
if (_node === 'list') {
|
|
39
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
39
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(INPUT_METHOD.TOOLBAR));
|
|
40
40
|
}
|
|
41
41
|
if (_node === 'taskList') {
|
|
42
42
|
outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|