@atlaskit/editor-core 188.13.5 → 188.13.6
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 +6 -0
- package/dist/cjs/i18n/cs.js +0 -6
- package/dist/cjs/i18n/da.js +0 -6
- package/dist/cjs/i18n/de.js +0 -6
- package/dist/cjs/i18n/en.js +0 -6
- package/dist/cjs/i18n/en_GB.js +0 -6
- package/dist/cjs/i18n/en_ZZ.js +0 -6
- package/dist/cjs/i18n/es.js +0 -6
- package/dist/cjs/i18n/fi.js +0 -6
- package/dist/cjs/i18n/fr.js +0 -6
- package/dist/cjs/i18n/hu.js +0 -6
- package/dist/cjs/i18n/it.js +0 -6
- package/dist/cjs/i18n/ja.js +0 -6
- package/dist/cjs/i18n/ko.js +0 -6
- package/dist/cjs/i18n/nb.js +0 -6
- package/dist/cjs/i18n/nl.js +0 -6
- package/dist/cjs/i18n/pl.js +0 -6
- package/dist/cjs/i18n/pt_BR.js +0 -6
- package/dist/cjs/i18n/ru.js +0 -6
- package/dist/cjs/i18n/sv.js +0 -6
- package/dist/cjs/i18n/th.js +0 -6
- package/dist/cjs/i18n/tr.js +0 -6
- package/dist/cjs/i18n/uk.js +0 -6
- package/dist/cjs/i18n/vi.js +0 -6
- package/dist/cjs/i18n/zh.js +0 -6
- package/dist/cjs/i18n/zh_TW.js +0 -6
- package/dist/cjs/plugins/expand/commands.js +84 -72
- package/dist/cjs/plugins/expand/index.js +10 -5
- package/dist/cjs/plugins/expand/nodeviews/index.js +8 -5
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +2 -1
- package/dist/cjs/plugins/expand/toolbar.js +6 -2
- package/dist/cjs/plugins/feedback-dialog/index.js +7 -4
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +37 -32
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +95 -89
- package/dist/cjs/plugins/tasks-and-decisions/index.js +10 -5
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/input-rules.js +41 -38
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +9 -6
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +9 -6
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/i18n/cs.js +0 -6
- package/dist/es2019/i18n/da.js +0 -6
- package/dist/es2019/i18n/de.js +0 -6
- package/dist/es2019/i18n/en.js +0 -6
- package/dist/es2019/i18n/en_GB.js +0 -6
- package/dist/es2019/i18n/en_ZZ.js +0 -6
- package/dist/es2019/i18n/es.js +0 -6
- package/dist/es2019/i18n/fi.js +0 -6
- package/dist/es2019/i18n/fr.js +0 -6
- package/dist/es2019/i18n/hu.js +0 -6
- package/dist/es2019/i18n/it.js +0 -6
- package/dist/es2019/i18n/ja.js +0 -6
- package/dist/es2019/i18n/ko.js +0 -6
- package/dist/es2019/i18n/nb.js +0 -6
- package/dist/es2019/i18n/nl.js +0 -6
- package/dist/es2019/i18n/pl.js +0 -6
- package/dist/es2019/i18n/pt_BR.js +0 -6
- package/dist/es2019/i18n/ru.js +0 -6
- package/dist/es2019/i18n/sv.js +0 -6
- package/dist/es2019/i18n/th.js +0 -6
- package/dist/es2019/i18n/tr.js +0 -6
- package/dist/es2019/i18n/uk.js +0 -6
- package/dist/es2019/i18n/vi.js +0 -6
- package/dist/es2019/i18n/zh.js +0 -6
- package/dist/es2019/i18n/zh_TW.js +0 -6
- package/dist/es2019/plugins/expand/commands.js +17 -9
- package/dist/es2019/plugins/expand/index.js +11 -6
- package/dist/es2019/plugins/expand/nodeviews/index.js +8 -5
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +2 -1
- package/dist/es2019/plugins/expand/toolbar.js +7 -2
- package/dist/es2019/plugins/feedback-dialog/index.js +7 -4
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +14 -10
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +7 -7
- package/dist/es2019/plugins/tasks-and-decisions/index.js +12 -5
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/input-rules.js +8 -8
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +4 -2
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +4 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/i18n/cs.js +0 -6
- package/dist/esm/i18n/da.js +0 -6
- package/dist/esm/i18n/de.js +0 -6
- package/dist/esm/i18n/en.js +0 -6
- package/dist/esm/i18n/en_GB.js +0 -6
- package/dist/esm/i18n/en_ZZ.js +0 -6
- package/dist/esm/i18n/es.js +0 -6
- package/dist/esm/i18n/fi.js +0 -6
- package/dist/esm/i18n/fr.js +0 -6
- package/dist/esm/i18n/hu.js +0 -6
- package/dist/esm/i18n/it.js +0 -6
- package/dist/esm/i18n/ja.js +0 -6
- package/dist/esm/i18n/ko.js +0 -6
- package/dist/esm/i18n/nb.js +0 -6
- package/dist/esm/i18n/nl.js +0 -6
- package/dist/esm/i18n/pl.js +0 -6
- package/dist/esm/i18n/pt_BR.js +0 -6
- package/dist/esm/i18n/ru.js +0 -6
- package/dist/esm/i18n/sv.js +0 -6
- package/dist/esm/i18n/th.js +0 -6
- package/dist/esm/i18n/tr.js +0 -6
- package/dist/esm/i18n/uk.js +0 -6
- package/dist/esm/i18n/vi.js +0 -6
- package/dist/esm/i18n/zh.js +0 -6
- package/dist/esm/i18n/zh_TW.js +0 -6
- package/dist/esm/plugins/expand/commands.js +84 -72
- package/dist/esm/plugins/expand/index.js +11 -6
- package/dist/esm/plugins/expand/nodeviews/index.js +8 -5
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +2 -1
- package/dist/esm/plugins/expand/toolbar.js +6 -2
- package/dist/esm/plugins/feedback-dialog/index.js +7 -4
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +37 -32
- package/dist/esm/plugins/tasks-and-decisions/commands.js +95 -89
- package/dist/esm/plugins/tasks-and-decisions/index.js +10 -5
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/input-rules.js +40 -36
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +9 -6
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +9 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/i18n/cs.d.ts +0 -6
- package/dist/types/i18n/da.d.ts +0 -6
- package/dist/types/i18n/de.d.ts +0 -6
- package/dist/types/i18n/en.d.ts +0 -6
- package/dist/types/i18n/en_GB.d.ts +0 -6
- package/dist/types/i18n/en_ZZ.d.ts +0 -6
- package/dist/types/i18n/es.d.ts +0 -6
- package/dist/types/i18n/fi.d.ts +0 -6
- package/dist/types/i18n/fr.d.ts +0 -6
- package/dist/types/i18n/hu.d.ts +0 -6
- package/dist/types/i18n/it.d.ts +0 -6
- package/dist/types/i18n/ja.d.ts +0 -6
- package/dist/types/i18n/ko.d.ts +0 -6
- package/dist/types/i18n/nb.d.ts +0 -6
- package/dist/types/i18n/nl.d.ts +0 -6
- package/dist/types/i18n/pl.d.ts +0 -6
- package/dist/types/i18n/pt_BR.d.ts +0 -6
- package/dist/types/i18n/ru.d.ts +0 -6
- package/dist/types/i18n/sv.d.ts +0 -6
- package/dist/types/i18n/th.d.ts +0 -6
- package/dist/types/i18n/tr.d.ts +0 -6
- package/dist/types/i18n/uk.d.ts +0 -6
- package/dist/types/i18n/vi.d.ts +0 -6
- package/dist/types/i18n/zh.d.ts +0 -6
- package/dist/types/i18n/zh_TW.d.ts +0 -6
- package/dist/types/plugins/code-block/index.d.ts +2 -2
- package/dist/types/plugins/expand/commands.d.ts +6 -5
- package/dist/types/plugins/expand/index.d.ts +12 -5
- package/dist/types/plugins/expand/toolbar.d.ts +3 -3
- package/dist/types/plugins/feedback-dialog/index.d.ts +5 -2
- package/dist/types/plugins/insert-block/types.d.ts +13 -11
- package/dist/types/plugins/tasks-and-decisions/commands.d.ts +5 -4
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +2 -1
- package/dist/types/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +3 -0
- package/dist/types/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +3 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +0 -6
- package/dist/types-ts4.5/i18n/da.d.ts +0 -6
- package/dist/types-ts4.5/i18n/de.d.ts +0 -6
- package/dist/types-ts4.5/i18n/en.d.ts +0 -6
- package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -6
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -6
- package/dist/types-ts4.5/i18n/es.d.ts +0 -6
- package/dist/types-ts4.5/i18n/fi.d.ts +0 -6
- package/dist/types-ts4.5/i18n/fr.d.ts +0 -6
- package/dist/types-ts4.5/i18n/hu.d.ts +0 -6
- package/dist/types-ts4.5/i18n/it.d.ts +0 -6
- package/dist/types-ts4.5/i18n/ja.d.ts +0 -6
- package/dist/types-ts4.5/i18n/ko.d.ts +0 -6
- package/dist/types-ts4.5/i18n/nb.d.ts +0 -6
- package/dist/types-ts4.5/i18n/nl.d.ts +0 -6
- package/dist/types-ts4.5/i18n/pl.d.ts +0 -6
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -6
- package/dist/types-ts4.5/i18n/ru.d.ts +0 -6
- package/dist/types-ts4.5/i18n/sv.d.ts +0 -6
- package/dist/types-ts4.5/i18n/th.d.ts +0 -6
- package/dist/types-ts4.5/i18n/tr.d.ts +0 -6
- package/dist/types-ts4.5/i18n/uk.d.ts +0 -6
- package/dist/types-ts4.5/i18n/vi.d.ts +0 -6
- package/dist/types-ts4.5/i18n/zh.d.ts +0 -6
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -6
- package/dist/types-ts4.5/plugins/code-block/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/expand/commands.d.ts +6 -5
- package/dist/types-ts4.5/plugins/expand/index.d.ts +12 -5
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +3 -3
- package/dist/types-ts4.5/plugins/feedback-dialog/index.d.ts +7 -2
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +13 -11
- package/dist/types-ts4.5/plugins/tasks-and-decisions/commands.d.ts +5 -4
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +2 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { IconFeedback } from '@atlaskit/editor-common/quick-insert';
|
|
9
9
|
import { version as coreVersion } from '../../version-wrapper';
|
|
10
|
-
import {
|
|
10
|
+
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
|
|
12
12
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
13
13
|
var showJiraCollectorDialog;
|
|
@@ -81,7 +81,8 @@ export var openFeedbackDialog = /*#__PURE__*/function () {
|
|
|
81
81
|
};
|
|
82
82
|
}();
|
|
83
83
|
var feedbackDialog = function feedbackDialog(_ref3) {
|
|
84
|
-
var feedbackInfo = _ref3.config
|
|
84
|
+
var feedbackInfo = _ref3.config,
|
|
85
|
+
api = _ref3.api;
|
|
85
86
|
defaultFeedbackInfo = feedbackInfo !== null && feedbackInfo !== void 0 ? feedbackInfo : {};
|
|
86
87
|
return {
|
|
87
88
|
name: 'feedbackDialog',
|
|
@@ -98,16 +99,18 @@ var feedbackDialog = function feedbackDialog(_ref3) {
|
|
|
98
99
|
return /*#__PURE__*/React.createElement(IconFeedback, null);
|
|
99
100
|
},
|
|
100
101
|
action: function action(insert, state) {
|
|
102
|
+
var _api$analytics;
|
|
101
103
|
var tr = insert('');
|
|
102
104
|
openFeedbackDialog(feedbackInfo);
|
|
103
|
-
|
|
105
|
+
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.attachAnalyticsEvent({
|
|
104
106
|
action: ACTION.OPENED,
|
|
105
107
|
actionSubject: ACTION_SUBJECT.FEEDBACK_DIALOG,
|
|
106
108
|
attributes: {
|
|
107
109
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
108
110
|
},
|
|
109
111
|
eventType: EVENT_TYPE.UI
|
|
110
|
-
});
|
|
112
|
+
})(tr);
|
|
113
|
+
return tr;
|
|
111
114
|
}
|
|
112
115
|
}];
|
|
113
116
|
}
|
|
@@ -22,7 +22,6 @@ import { separatorStyles, buttonGroupStyle, wrapperStyle } from '@atlaskit/edito
|
|
|
22
22
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
23
23
|
import { showPlaceholderFloatingToolbar } from '../../../placeholder-text/actions';
|
|
24
24
|
import { insertTaskDecisionCommand } from '../../../tasks-and-decisions/commands';
|
|
25
|
-
import { insertExpand } from '../../../expand/commands';
|
|
26
25
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
27
26
|
import { messages } from './messages';
|
|
28
27
|
import { createItems } from './create-items';
|
|
@@ -243,13 +242,15 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
243
242
|
}
|
|
244
243
|
return true;
|
|
245
244
|
});
|
|
246
|
-
_defineProperty(_assertThisInitialized(_this), "insertTaskDecision", function (
|
|
247
|
-
return function () {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
_defineProperty(_assertThisInitialized(_this), "insertTaskDecision", function (editorAnalyticsAPI) {
|
|
246
|
+
return function (name, inputMethod) {
|
|
247
|
+
return function () {
|
|
248
|
+
var _this$props$editorVie = _this.props.editorView,
|
|
249
|
+
state = _this$props$editorVie.state,
|
|
250
|
+
dispatch = _this$props$editorVie.dispatch;
|
|
251
|
+
var listType = name === 'action' ? 'taskList' : 'decisionList';
|
|
252
|
+
return insertTaskDecisionCommand(editorAnalyticsAPI)(listType, inputMethod)(state, dispatch);
|
|
253
|
+
};
|
|
253
254
|
};
|
|
254
255
|
});
|
|
255
256
|
_defineProperty(_assertThisInitialized(_this), "insertHorizontalRule", function (inputMethod) {
|
|
@@ -262,16 +263,19 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
262
263
|
return (_pluginInjectionApi$r = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$r2 = pluginInjectionApi.rule) === null || _pluginInjectionApi$r2 === void 0 ? void 0 : _pluginInjectionApi$r2.actions.insertHorizontalRule(inputMethod)(state, dispatch)) !== null && _pluginInjectionApi$r !== void 0 ? _pluginInjectionApi$r : false;
|
|
263
264
|
});
|
|
264
265
|
_defineProperty(_assertThisInitialized(_this), "insertExpand", function () {
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
var _pluginInjectionApi$e, _pluginInjectionApi$e2;
|
|
267
|
+
var _this$props7 = _this.props,
|
|
268
|
+
_this$props7$editorVi = _this$props7.editorView,
|
|
269
|
+
state = _this$props7$editorVi.state,
|
|
270
|
+
dispatch = _this$props7$editorVi.dispatch,
|
|
271
|
+
pluginInjectionApi = _this$props7.pluginInjectionApi;
|
|
272
|
+
return (_pluginInjectionApi$e = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.expand) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.actions.insertExpand(state, dispatch)) !== null && _pluginInjectionApi$e !== void 0 ? _pluginInjectionApi$e : false;
|
|
269
273
|
});
|
|
270
274
|
_defineProperty(_assertThisInitialized(_this), "insertBlockType", function (itemName) {
|
|
271
275
|
return function () {
|
|
272
|
-
var _this$
|
|
273
|
-
editorView = _this$
|
|
274
|
-
onInsertBlockType = _this$
|
|
276
|
+
var _this$props8 = _this.props,
|
|
277
|
+
editorView = _this$props8.editorView,
|
|
278
|
+
onInsertBlockType = _this$props8.onInsertBlockType;
|
|
275
279
|
var state = editorView.state,
|
|
276
280
|
dispatch = editorView.dispatch;
|
|
277
281
|
onInsertBlockType(itemName)(state, dispatch);
|
|
@@ -279,10 +283,10 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
279
283
|
};
|
|
280
284
|
});
|
|
281
285
|
_defineProperty(_assertThisInitialized(_this), "handleSelectedEmoji", function (emojiId) {
|
|
282
|
-
var _pluginInjectionApi$
|
|
286
|
+
var _pluginInjectionApi$e3;
|
|
283
287
|
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
284
288
|
_this.props.editorView.focus();
|
|
285
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute((_pluginInjectionApi$
|
|
289
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute((_pluginInjectionApi$e3 = pluginInjectionApi.emoji) === null || _pluginInjectionApi$e3 === void 0 ? void 0 : _pluginInjectionApi$e3.commands.insertEmoji(emojiId, INPUT_METHOD.PICKER));
|
|
286
290
|
_this.toggleEmojiPicker();
|
|
287
291
|
return true;
|
|
288
292
|
});
|
|
@@ -292,13 +296,14 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
292
296
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.commands.openElementBrowserModal);
|
|
293
297
|
});
|
|
294
298
|
_defineProperty(_assertThisInitialized(_this), "onItemActivated", function (_ref2) {
|
|
299
|
+
var _this$props$pluginInj;
|
|
295
300
|
var item = _ref2.item,
|
|
296
301
|
inputMethod = _ref2.inputMethod;
|
|
297
|
-
var _this$
|
|
298
|
-
editorView = _this$
|
|
299
|
-
editorActions = _this$
|
|
300
|
-
handleImageUpload = _this$
|
|
301
|
-
expandEnabled = _this$
|
|
302
|
+
var _this$props9 = _this.props,
|
|
303
|
+
editorView = _this$props9.editorView,
|
|
304
|
+
editorActions = _this$props9.editorActions,
|
|
305
|
+
handleImageUpload = _this$props9.handleImageUpload,
|
|
306
|
+
expandEnabled = _this$props9.expandEnabled;
|
|
302
307
|
|
|
303
308
|
// need to do this before inserting nodes so scrollIntoView works properly
|
|
304
309
|
if (!editorView.hasFocus()) {
|
|
@@ -334,7 +339,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
334
339
|
break;
|
|
335
340
|
case 'action':
|
|
336
341
|
case 'decision':
|
|
337
|
-
_this.insertTaskDecision(item.value.name, inputMethod)();
|
|
342
|
+
_this.insertTaskDecision((_this$props$pluginInj = _this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || (_this$props$pluginInj = _this$props$pluginInj.analytics) === null || _this$props$pluginInj === void 0 ? void 0 : _this$props$pluginInj.actions)(item.value.name, inputMethod)();
|
|
338
343
|
break;
|
|
339
344
|
case 'horizontalrule':
|
|
340
345
|
_this.insertHorizontalRule(inputMethod);
|
|
@@ -414,12 +419,12 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
414
419
|
key: "renderPopup",
|
|
415
420
|
value: function renderPopup() {
|
|
416
421
|
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
417
|
-
var _this$
|
|
418
|
-
popupsMountPoint = _this$
|
|
419
|
-
popupsBoundariesElement = _this$
|
|
420
|
-
popupsScrollableElement = _this$
|
|
421
|
-
emojiProvider = _this$
|
|
422
|
-
replacePlusMenuWithElementBrowser = _this$
|
|
422
|
+
var _this$props10 = this.props,
|
|
423
|
+
popupsMountPoint = _this$props10.popupsMountPoint,
|
|
424
|
+
popupsBoundariesElement = _this$props10.popupsBoundariesElement,
|
|
425
|
+
popupsScrollableElement = _this$props10.popupsScrollableElement,
|
|
426
|
+
emojiProvider = _this$props10.emojiProvider,
|
|
427
|
+
replacePlusMenuWithElementBrowser = _this$props10.replacePlusMenuWithElementBrowser;
|
|
423
428
|
var dropdownEmoji = this.state.dropdownItems.some(function (_ref4) {
|
|
424
429
|
var name = _ref4.value.name;
|
|
425
430
|
return name === 'emoji';
|
|
@@ -456,9 +461,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
456
461
|
buttons = _this$state.buttons,
|
|
457
462
|
dropdownItems = _this$state.dropdownItems,
|
|
458
463
|
emojiPickerOpen = _this$state.emojiPickerOpen;
|
|
459
|
-
var _this$
|
|
460
|
-
isDisabled = _this$
|
|
461
|
-
isReducedSpacing = _this$
|
|
464
|
+
var _this$props11 = this.props,
|
|
465
|
+
isDisabled = _this$props11.isDisabled,
|
|
466
|
+
isReducedSpacing = _this$props11.isReducedSpacing;
|
|
462
467
|
if (buttons.length === 0 && dropdownItems.length === 0) {
|
|
463
468
|
return null;
|
|
464
469
|
}
|
|
@@ -6,7 +6,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import { findParentNodeOfType, hasParentNodeOfType, replaceParentNodeOfType, safeInsert, setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
|
|
8
8
|
import { uuid } from '@atlaskit/adf-schema';
|
|
9
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID,
|
|
9
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, USER_CONTEXT } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
11
11
|
import { stateKey as taskDecisionStateKey } from './pm-plugins/plugin-key';
|
|
12
12
|
import { autoJoinTr } from '@atlaskit/editor-common/utils';
|
|
@@ -64,100 +64,106 @@ export var getListTypes = function getListTypes(listType, schema) {
|
|
|
64
64
|
item: decisionItem
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
export var insertTaskDecisionAction = function insertTaskDecisionAction(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
export var insertTaskDecisionAction = function insertTaskDecisionAction(editorAnalyticsAPI) {
|
|
68
|
+
return function (state, listType) {
|
|
69
|
+
var inputMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : INPUT_METHOD.TOOLBAR;
|
|
70
|
+
var addItem = arguments.length > 3 ? arguments[3] : undefined;
|
|
71
|
+
var listLocalId = arguments.length > 4 ? arguments[4] : undefined;
|
|
72
|
+
var itemLocalId = arguments.length > 5 ? arguments[5] : undefined;
|
|
73
|
+
var itemAttrs = arguments.length > 6 ? arguments[6] : undefined;
|
|
74
|
+
var schema = state.schema;
|
|
75
|
+
var addAndCreateList = function addAndCreateList(_ref) {
|
|
76
|
+
var tr = _ref.tr,
|
|
77
|
+
list = _ref.list,
|
|
78
|
+
item = _ref.item,
|
|
79
|
+
listLocalId = _ref.listLocalId,
|
|
80
|
+
itemLocalId = _ref.itemLocalId;
|
|
81
|
+
return createListAtSelection(tr, list, item, schema, state, listLocalId, itemLocalId, itemAttrs);
|
|
82
|
+
};
|
|
83
|
+
var addToList = function addToList(_ref2) {
|
|
84
|
+
var state = _ref2.state,
|
|
85
|
+
tr = _ref2.tr,
|
|
86
|
+
item = _ref2.item,
|
|
87
|
+
itemLocalId = _ref2.itemLocalId;
|
|
88
|
+
var $to = state.selection.$to;
|
|
89
|
+
var endPos = $to.end($to.depth);
|
|
90
|
+
var newItemParagraphPos = endPos + 2;
|
|
91
|
+
return tr.split(endPos, 1, [{
|
|
92
|
+
type: item,
|
|
93
|
+
attrs: {
|
|
94
|
+
localId: itemLocalId
|
|
95
|
+
}
|
|
96
|
+
}]).setSelection(new TextSelection(tr.doc.resolve(newItemParagraphPos)));
|
|
97
|
+
};
|
|
98
|
+
var addAndCreateListFn = addItem !== null && addItem !== void 0 ? addItem : addAndCreateList;
|
|
99
|
+
var tr = insertTaskDecisionWithAnalytics(editorAnalyticsAPI)(state, listType, inputMethod, addAndCreateListFn, addToList, listLocalId, itemLocalId, itemAttrs);
|
|
100
|
+
if (!tr) {
|
|
101
|
+
return state.tr;
|
|
102
|
+
}
|
|
103
|
+
autoJoinTr(tr, ['taskList', 'decisionList']);
|
|
104
|
+
return tr;
|
|
81
105
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
localId: itemLocalId
|
|
106
|
+
};
|
|
107
|
+
export var insertTaskDecisionCommand = function insertTaskDecisionCommand(editorAnalyticsAPI) {
|
|
108
|
+
return function (listType) {
|
|
109
|
+
var inputMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INPUT_METHOD.TOOLBAR;
|
|
110
|
+
var addItem = arguments.length > 2 ? arguments[2] : undefined;
|
|
111
|
+
var listLocalId = arguments.length > 3 ? arguments[3] : undefined;
|
|
112
|
+
var itemLocalId = arguments.length > 4 ? arguments[4] : undefined;
|
|
113
|
+
return function (state, dispatch) {
|
|
114
|
+
var tr = insertTaskDecisionAction(editorAnalyticsAPI)(state, listType, inputMethod, addItem, listLocalId, itemLocalId);
|
|
115
|
+
if (dispatch) {
|
|
116
|
+
dispatch(tr);
|
|
94
117
|
}
|
|
95
|
-
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
96
120
|
};
|
|
97
|
-
var addAndCreateListFn = addItem !== null && addItem !== void 0 ? addItem : addAndCreateList;
|
|
98
|
-
var tr = insertTaskDecisionWithAnalytics(state, listType, inputMethod, addAndCreateListFn, addToList, listLocalId, itemLocalId, itemAttrs);
|
|
99
|
-
if (!tr) {
|
|
100
|
-
return state.tr;
|
|
101
|
-
}
|
|
102
|
-
autoJoinTr(tr, ['taskList', 'decisionList']);
|
|
103
|
-
return tr;
|
|
104
121
|
};
|
|
105
|
-
export var
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var tr =
|
|
112
|
-
|
|
113
|
-
|
|
122
|
+
export var insertTaskDecisionWithAnalytics = function insertTaskDecisionWithAnalytics(editorAnalyticsAPI) {
|
|
123
|
+
return function (state, listType, inputMethod, addAndCreateList, addToList, listLocalId, itemLocalId, itemAttrs) {
|
|
124
|
+
var schema = state.schema;
|
|
125
|
+
var _getListTypes = getListTypes(listType, schema),
|
|
126
|
+
list = _getListTypes.list,
|
|
127
|
+
item = _getListTypes.item;
|
|
128
|
+
var tr = state.tr;
|
|
129
|
+
var $to = state.selection.$to;
|
|
130
|
+
var listNode = findParentNodeOfType(list)(state.selection);
|
|
131
|
+
var contextIdentifierProvider = taskDecisionStateKey.getState(state).contextIdentifierProvider;
|
|
132
|
+
var contextData = getContextData(contextIdentifierProvider);
|
|
133
|
+
var insertTrCreator;
|
|
134
|
+
var itemIdx;
|
|
135
|
+
var listSize;
|
|
136
|
+
if (!listNode) {
|
|
137
|
+
// Not a list - convert to one.
|
|
138
|
+
itemIdx = 0;
|
|
139
|
+
listSize = 1;
|
|
140
|
+
insertTrCreator = addAndCreateList;
|
|
141
|
+
} else if ($to.node().textContent.length >= 0) {
|
|
142
|
+
listSize = listNode.node.childCount + 1;
|
|
143
|
+
listLocalId = listLocalId || listNode.node.attrs.localId;
|
|
144
|
+
var listItemNode = findParentNodeOfType(item)(state.selection); // finds current item in list
|
|
145
|
+
itemIdx = listItemNode ? state.doc.resolve(listItemNode.pos).index() + 1 : 0;
|
|
146
|
+
insertTrCreator = addToList ? addToList : addAndCreateList;
|
|
114
147
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (!listNode) {
|
|
132
|
-
// Not a list - convert to one.
|
|
133
|
-
itemIdx = 0;
|
|
134
|
-
listSize = 1;
|
|
135
|
-
insertTrCreator = addAndCreateList;
|
|
136
|
-
} else if ($to.node().textContent.length >= 0) {
|
|
137
|
-
listSize = listNode.node.childCount + 1;
|
|
138
|
-
listLocalId = listLocalId || listNode.node.attrs.localId;
|
|
139
|
-
var listItemNode = findParentNodeOfType(item)(state.selection); // finds current item in list
|
|
140
|
-
itemIdx = listItemNode ? state.doc.resolve(listItemNode.pos).index() + 1 : 0;
|
|
141
|
-
insertTrCreator = addToList ? addToList : addAndCreateList;
|
|
142
|
-
}
|
|
143
|
-
listLocalId = listLocalId || uuid.generate();
|
|
144
|
-
itemLocalId = itemLocalId || uuid.generate();
|
|
145
|
-
if (insertTrCreator) {
|
|
146
|
-
var insertTr = insertTrCreator({
|
|
147
|
-
state: state,
|
|
148
|
-
tr: tr,
|
|
149
|
-
list: list,
|
|
150
|
-
item: item,
|
|
151
|
-
listLocalId: listLocalId,
|
|
152
|
-
itemLocalId: itemLocalId,
|
|
153
|
-
itemAttrs: itemAttrs
|
|
154
|
-
});
|
|
155
|
-
if (insertTr) {
|
|
156
|
-
insertTr = addAnalytics(state, insertTr, generateAnalyticsPayload(listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx || 0, listSize || 0));
|
|
148
|
+
listLocalId = listLocalId || uuid.generate();
|
|
149
|
+
itemLocalId = itemLocalId || uuid.generate();
|
|
150
|
+
if (insertTrCreator) {
|
|
151
|
+
var insertTr = insertTrCreator({
|
|
152
|
+
state: state,
|
|
153
|
+
tr: tr,
|
|
154
|
+
list: list,
|
|
155
|
+
item: item,
|
|
156
|
+
listLocalId: listLocalId,
|
|
157
|
+
itemLocalId: itemLocalId,
|
|
158
|
+
itemAttrs: itemAttrs
|
|
159
|
+
});
|
|
160
|
+
if (insertTr) {
|
|
161
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(generateAnalyticsPayload(listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx || 0, listSize || 0))(insertTr);
|
|
162
|
+
}
|
|
163
|
+
return insertTr;
|
|
157
164
|
}
|
|
158
|
-
return
|
|
159
|
-
}
|
|
160
|
-
return null;
|
|
165
|
+
return null;
|
|
166
|
+
};
|
|
161
167
|
};
|
|
162
168
|
export var isSupportedSourceNode = function isSupportedSourceNode(schema, selection) {
|
|
163
169
|
var _schema$nodes2 = schema.nodes,
|
|
@@ -64,9 +64,10 @@ var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
|
64
64
|
}, {
|
|
65
65
|
name: 'tasksAndDecisionsInputRule',
|
|
66
66
|
plugin: function plugin(_ref4) {
|
|
67
|
+
var _api$analytics;
|
|
67
68
|
var schema = _ref4.schema,
|
|
68
69
|
featureFlags = _ref4.featureFlags;
|
|
69
|
-
return inputRulePlugin(schema, featureFlags);
|
|
70
|
+
return inputRulePlugin(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(schema, featureFlags);
|
|
70
71
|
}
|
|
71
72
|
}, {
|
|
72
73
|
name: 'tasksAndDecisionsKeyMap',
|
|
@@ -85,11 +86,13 @@ var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
|
85
86
|
}, jsx(ToolbarDecision, {
|
|
86
87
|
editorView: editorView,
|
|
87
88
|
isDisabled: disabled,
|
|
88
|
-
isReducedSpacing: true
|
|
89
|
+
isReducedSpacing: true,
|
|
90
|
+
editorAPI: api
|
|
89
91
|
}), jsx(ToolbarTask, {
|
|
90
92
|
editorView: editorView,
|
|
91
93
|
isDisabled: disabled,
|
|
92
|
-
isReducedSpacing: true
|
|
94
|
+
isReducedSpacing: true,
|
|
95
|
+
editorAPI: api
|
|
93
96
|
}));
|
|
94
97
|
},
|
|
95
98
|
pluginsOptions: {
|
|
@@ -106,7 +109,8 @@ var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
|
106
109
|
return jsx(IconAction, null);
|
|
107
110
|
},
|
|
108
111
|
action: function action(insert, state) {
|
|
109
|
-
|
|
112
|
+
var _api$analytics2;
|
|
113
|
+
return insertTaskDecisionAction(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(state, 'taskList', INPUT_METHOD.QUICK_INSERT, addItem(insert, 'taskList', state.schema));
|
|
110
114
|
}
|
|
111
115
|
}, {
|
|
112
116
|
id: 'decision',
|
|
@@ -118,7 +122,8 @@ var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
|
118
122
|
return jsx(IconDecision, null);
|
|
119
123
|
},
|
|
120
124
|
action: function action(insert, state) {
|
|
121
|
-
|
|
125
|
+
var _api$analytics3;
|
|
126
|
+
return insertTaskDecisionAction(api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions)(state, 'decisionList', INPUT_METHOD.QUICK_INSERT, addItem(insert, 'decisionList', state.schema));
|
|
122
127
|
}
|
|
123
128
|
}];
|
|
124
129
|
}
|
|
@@ -5,23 +5,25 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
5
5
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { createRule, createPlugin } from '@atlaskit/prosemirror-input-rules';
|
|
7
7
|
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
8
|
-
import { INPUT_METHOD } from '
|
|
8
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { changeInDepth, insertTaskDecisionAction, getListTypes } from '../commands';
|
|
10
|
-
var createListRule = function createListRule(
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
var createListRule = function createListRule(editorAnalyticsAPI) {
|
|
11
|
+
return function (regex, listType, itemAttrs) {
|
|
12
|
+
return createRule(regex, function (state, _match, start, end) {
|
|
13
|
+
var paragraph = state.schema.nodes.paragraph;
|
|
14
|
+
var _getListTypes = getListTypes(listType, state.schema),
|
|
15
|
+
list = _getListTypes.list;
|
|
16
|
+
var $end = state.doc.resolve(end);
|
|
17
|
+
var $endOfParent = state.doc.resolve($end.after());
|
|
18
|
+
// Only allow creating list in nodes that support them.
|
|
19
|
+
// Parent must be a paragraph as we don't want this applying to headings
|
|
20
|
+
if ($end.parent.type !== paragraph || !canInsert($endOfParent, list.createAndFill())) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
var insertTr = insertTaskDecisionAction(editorAnalyticsAPI)(state, listType, INPUT_METHOD.FORMATTING, addItem(start, end), undefined, undefined, itemAttrs);
|
|
24
|
+
return insertTr;
|
|
25
|
+
});
|
|
26
|
+
};
|
|
25
27
|
};
|
|
26
28
|
var addItem = function addItem(start, end) {
|
|
27
29
|
return function (_ref) {
|
|
@@ -61,24 +63,26 @@ var addItem = function addItem(start, end) {
|
|
|
61
63
|
return tr;
|
|
62
64
|
};
|
|
63
65
|
};
|
|
64
|
-
export function inputRulePlugin(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
66
|
+
export var inputRulePlugin = function inputRulePlugin(editorAnalyticsAPI) {
|
|
67
|
+
return function (schema, featureFlags) {
|
|
68
|
+
var rules = [];
|
|
69
|
+
var _schema$nodes = schema.nodes,
|
|
70
|
+
decisionList = _schema$nodes.decisionList,
|
|
71
|
+
decisionItem = _schema$nodes.decisionItem,
|
|
72
|
+
taskList = _schema$nodes.taskList,
|
|
73
|
+
taskItem = _schema$nodes.taskItem;
|
|
74
|
+
if (decisionList && decisionItem) {
|
|
75
|
+
rules.push(createListRule(editorAnalyticsAPI)(new RegExp("(^|".concat(leafNodeReplacementCharacter, ")\\<\\>\\s$")), 'decisionList'));
|
|
76
|
+
}
|
|
77
|
+
if (taskList && taskItem) {
|
|
78
|
+
rules.push(createListRule(editorAnalyticsAPI)(new RegExp("(^|".concat(leafNodeReplacementCharacter, ")\\[\\]\\s$")), 'taskList'));
|
|
79
|
+
rules.push(createListRule(editorAnalyticsAPI)(new RegExp("(^|".concat(leafNodeReplacementCharacter, ")\\[x\\]\\s$")), 'taskList', {
|
|
80
|
+
state: 'DONE'
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
return createPlugin('tasks-and-decisions', rules, {
|
|
84
|
+
isBlockNodeRule: true
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
};
|
|
84
88
|
export default inputRulePlugin;
|
|
@@ -309,7 +309,7 @@ var enter = function enter(editorAnalyticsAPI) {
|
|
|
309
309
|
}
|
|
310
310
|
}]);
|
|
311
311
|
};
|
|
312
|
-
var insertTr = insertTaskDecisionWithAnalytics(state, listType, INPUT_METHOD.KEYBOARD, addItem);
|
|
312
|
+
var insertTr = insertTaskDecisionWithAnalytics(editorAnalyticsAPI)(state, listType, INPUT_METHOD.KEYBOARD, addItem);
|
|
313
313
|
if (insertTr && dispatch) {
|
|
314
314
|
insertTr.scrollIntoView();
|
|
315
315
|
dispatch(insertTr);
|
|
@@ -27,11 +27,14 @@ export var ToolbarDecision = /*#__PURE__*/function (_PureComponent) {
|
|
|
27
27
|
disabled: false
|
|
28
28
|
});
|
|
29
29
|
_defineProperty(_assertThisInitialized(_this), "handleInsertDecision", function () {
|
|
30
|
-
var
|
|
30
|
+
var _editorAPI$analytics;
|
|
31
|
+
var _this$props = _this.props,
|
|
32
|
+
editorView = _this$props.editorView,
|
|
33
|
+
editorAPI = _this$props.editorAPI;
|
|
31
34
|
if (!editorView) {
|
|
32
35
|
return false;
|
|
33
36
|
}
|
|
34
|
-
insertTaskDecisionCommand('decisionList')(editorView.state, editorView.dispatch);
|
|
37
|
+
insertTaskDecisionCommand(editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions)('decisionList')(editorView.state, editorView.dispatch);
|
|
35
38
|
return true;
|
|
36
39
|
});
|
|
37
40
|
return _this;
|
|
@@ -40,10 +43,10 @@ export var ToolbarDecision = /*#__PURE__*/function (_PureComponent) {
|
|
|
40
43
|
key: "render",
|
|
41
44
|
value: function render() {
|
|
42
45
|
var disabled = this.state.disabled;
|
|
43
|
-
var _this$
|
|
44
|
-
isDisabled = _this$
|
|
45
|
-
isReducedSpacing = _this$
|
|
46
|
-
formatMessage = _this$
|
|
46
|
+
var _this$props2 = this.props,
|
|
47
|
+
isDisabled = _this$props2.isDisabled,
|
|
48
|
+
isReducedSpacing = _this$props2.isReducedSpacing,
|
|
49
|
+
formatMessage = _this$props2.intl.formatMessage;
|
|
47
50
|
var label = formatMessage(messages.decision);
|
|
48
51
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
49
52
|
buttonId: TOOLBAR_BUTTON.DECISION_LIST,
|
|
@@ -27,11 +27,14 @@ export var ToolbarTask = /*#__PURE__*/function (_PureComponent) {
|
|
|
27
27
|
disabled: false
|
|
28
28
|
});
|
|
29
29
|
_defineProperty(_assertThisInitialized(_this), "handleInsertTask", function () {
|
|
30
|
-
var
|
|
30
|
+
var _editorAPI$analytics;
|
|
31
|
+
var _this$props = _this.props,
|
|
32
|
+
editorView = _this$props.editorView,
|
|
33
|
+
editorAPI = _this$props.editorAPI;
|
|
31
34
|
if (!editorView) {
|
|
32
35
|
return false;
|
|
33
36
|
}
|
|
34
|
-
insertTaskDecisionCommand('taskList')(editorView.state, editorView.dispatch);
|
|
37
|
+
insertTaskDecisionCommand(editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions)('taskList')(editorView.state, editorView.dispatch);
|
|
35
38
|
return true;
|
|
36
39
|
});
|
|
37
40
|
return _this;
|
|
@@ -40,10 +43,10 @@ export var ToolbarTask = /*#__PURE__*/function (_PureComponent) {
|
|
|
40
43
|
key: "render",
|
|
41
44
|
value: function render() {
|
|
42
45
|
var disabled = this.state.disabled;
|
|
43
|
-
var _this$
|
|
44
|
-
isDisabled = _this$
|
|
45
|
-
isReducedSpacing = _this$
|
|
46
|
-
formatMessage = _this$
|
|
46
|
+
var _this$props2 = this.props,
|
|
47
|
+
isDisabled = _this$props2.isDisabled,
|
|
48
|
+
isReducedSpacing = _this$props2.isReducedSpacing,
|
|
49
|
+
formatMessage = _this$props2.intl.formatMessage;
|
|
47
50
|
var label = formatMessage(messages.action);
|
|
48
51
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
49
52
|
buttonId: TOOLBAR_BUTTON.TASK_LIST,
|
package/dist/types/i18n/cs.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ declare const _default: {
|
|
|
30
30
|
'fabric.editor.configPanel.submit': string;
|
|
31
31
|
'fabric.editor.decisionPlaceholder': string;
|
|
32
32
|
'fabric.editor.edit': string;
|
|
33
|
-
'fabric.editor.editDateText': string;
|
|
34
33
|
'fabric.editor.editorAssistiveLabel': string;
|
|
35
34
|
'fabric.editor.editors': string;
|
|
36
35
|
'fabric.editor.error': string;
|
|
@@ -47,13 +46,8 @@ declare const _default: {
|
|
|
47
46
|
'fabric.editor.headingLink.toolbarHelpTitle': string;
|
|
48
47
|
'fabric.editor.indent': string;
|
|
49
48
|
'fabric.editor.info': string;
|
|
50
|
-
'fabric.editor.invalidDateError': string;
|
|
51
|
-
'fabric.editor.inviteItem.title': string;
|
|
52
49
|
'fabric.editor.leftSidebar': string;
|
|
53
50
|
'fabric.editor.matchCase': string;
|
|
54
|
-
'fabric.editor.mentionNode.label': string;
|
|
55
|
-
'fabric.editor.mentionsAddLabel': string;
|
|
56
|
-
'fabric.editor.mentionsIconLabel': string;
|
|
57
51
|
'fabric.editor.noResultsFound': string;
|
|
58
52
|
'fabric.editor.note': string;
|
|
59
53
|
'fabric.editor.outdent': string;
|