@atlaskit/editor-plugin-tasks-and-decisions 29.0.5 → 29.0.8
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 +20 -0
- package/dist/cjs/nodeviews/DecisionItemNodeView.js +2 -2
- package/dist/cjs/nodeviews/TaskItemNodeView.js +6 -15
- package/dist/cjs/nodeviews/decisionItemNodeSpec.js +3 -3
- package/dist/cjs/nodeviews/hooks/use-show-placeholder.js +2 -2
- package/dist/cjs/nodeviews/taskItemNodeSpec.js +8 -14
- package/dist/cjs/pm-plugins/actions/move-selected-task-list-items.js +7 -5
- package/dist/cjs/pm-plugins/commands.js +2 -2
- package/dist/cjs/pm-plugins/helpers.js +1 -1
- package/dist/cjs/pm-plugins/input-rules.js +8 -7
- package/dist/cjs/pm-plugins/insert-commands.js +23 -22
- package/dist/cjs/pm-plugins/keymaps.js +33 -30
- package/dist/cjs/pm-plugins/main.js +5 -6
- package/dist/cjs/pm-plugins/toggle-tasklist-commands.js +27 -26
- package/dist/cjs/pm-plugins/utils/paste.js +3 -3
- package/dist/cjs/tasksAndDecisionsPlugin.js +21 -21
- package/dist/cjs/ui/DecisionListBlockMenuItem/DecisionListBlockMenuItem.js +7 -7
- package/dist/cjs/ui/Task/RequestToEditPopup.js +19 -17
- package/dist/cjs/ui/Task/index.js +7 -6
- package/dist/cjs/ui/TaskListBlockMenuItem/TaskListBlockMenuItem.js +7 -7
- package/dist/cjs/ui/TaskListMenuItem/TaskListMenuItem.js +10 -8
- package/dist/cjs/ui/ToolbarDecision/index.js +6 -5
- package/dist/cjs/ui/ToolbarTask/index.js +6 -5
- package/dist/cjs/ui/quick-insert/TasksAndDecisionsQuickInsertMenuItem.js +9 -9
- package/dist/cjs/ui/quick-insert/getTasksAndDecisionsQuickInsertComponents.js +5 -5
- package/dist/cjs/ui/toolbar-components.js +7 -6
- package/dist/es2019/nodeviews/DecisionItemNodeView.js +1 -1
- package/dist/es2019/nodeviews/TaskItemNodeView.js +2 -10
- package/dist/es2019/nodeviews/decisionItemNodeSpec.js +1 -1
- package/dist/es2019/nodeviews/hooks/use-show-placeholder.js +1 -1
- package/dist/es2019/nodeviews/taskItemNodeSpec.js +4 -10
- package/dist/es2019/pm-plugins/actions/move-selected-task-list-items.js +3 -1
- package/dist/es2019/pm-plugins/commands.js +1 -1
- package/dist/es2019/pm-plugins/helpers.js +1 -1
- package/dist/es2019/pm-plugins/input-rules.js +3 -2
- package/dist/es2019/pm-plugins/insert-commands.js +4 -3
- package/dist/es2019/pm-plugins/keymaps.js +8 -5
- package/dist/es2019/pm-plugins/main.js +3 -5
- package/dist/es2019/pm-plugins/toggle-tasklist-commands.js +4 -3
- package/dist/es2019/pm-plugins/utils/paste.js +1 -1
- package/dist/es2019/tasksAndDecisionsPlugin.js +7 -7
- package/dist/es2019/ui/DecisionListBlockMenuItem/DecisionListBlockMenuItem.js +3 -3
- package/dist/es2019/ui/Task/RequestToEditPopup.js +8 -6
- package/dist/es2019/ui/Task/index.js +4 -3
- package/dist/es2019/ui/TaskListBlockMenuItem/TaskListBlockMenuItem.js +3 -3
- package/dist/es2019/ui/TaskListMenuItem/TaskListMenuItem.js +5 -3
- package/dist/es2019/ui/ToolbarDecision/index.js +3 -2
- package/dist/es2019/ui/ToolbarTask/index.js +3 -2
- package/dist/es2019/ui/quick-insert/TasksAndDecisionsQuickInsertMenuItem.js +3 -3
- package/dist/es2019/ui/quick-insert/getTasksAndDecisionsQuickInsertComponents.js +1 -1
- package/dist/es2019/ui/toolbar-components.js +2 -1
- package/dist/esm/nodeviews/DecisionItemNodeView.js +1 -1
- package/dist/esm/nodeviews/TaskItemNodeView.js +5 -14
- package/dist/esm/nodeviews/decisionItemNodeSpec.js +1 -1
- package/dist/esm/nodeviews/hooks/use-show-placeholder.js +1 -1
- package/dist/esm/nodeviews/taskItemNodeSpec.js +4 -10
- package/dist/esm/pm-plugins/actions/move-selected-task-list-items.js +3 -1
- package/dist/esm/pm-plugins/commands.js +1 -1
- package/dist/esm/pm-plugins/helpers.js +1 -1
- package/dist/esm/pm-plugins/input-rules.js +3 -2
- package/dist/esm/pm-plugins/insert-commands.js +4 -3
- package/dist/esm/pm-plugins/keymaps.js +8 -5
- package/dist/esm/pm-plugins/main.js +5 -6
- package/dist/esm/pm-plugins/toggle-tasklist-commands.js +4 -3
- package/dist/esm/pm-plugins/utils/paste.js +1 -1
- package/dist/esm/tasksAndDecisionsPlugin.js +7 -7
- package/dist/esm/ui/DecisionListBlockMenuItem/DecisionListBlockMenuItem.js +3 -3
- package/dist/esm/ui/Task/RequestToEditPopup.js +8 -6
- package/dist/esm/ui/Task/index.js +4 -3
- package/dist/esm/ui/TaskListBlockMenuItem/TaskListBlockMenuItem.js +3 -3
- package/dist/esm/ui/TaskListMenuItem/TaskListMenuItem.js +5 -3
- package/dist/esm/ui/ToolbarDecision/index.js +3 -2
- package/dist/esm/ui/ToolbarTask/index.js +3 -2
- package/dist/esm/ui/quick-insert/TasksAndDecisionsQuickInsertMenuItem.js +3 -3
- package/dist/esm/ui/quick-insert/getTasksAndDecisionsQuickInsertComponents.js +1 -1
- package/dist/esm/ui/toolbar-components.js +2 -1
- package/dist/types/nodeviews/TaskItemNodeView.d.ts +2 -2
- package/dist/types/nodeviews/hooks/use-show-placeholder.d.ts +1 -1
- package/dist/types/nodeviews/task-node-view.d.ts +1 -1
- package/dist/types/pm-plugins/commands.d.ts +1 -1
- package/dist/types/pm-plugins/input-rules.d.ts +2 -2
- package/dist/types/pm-plugins/insert-commands.d.ts +4 -3
- package/dist/types/pm-plugins/keymaps.d.ts +4 -3
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/task-list-indentation.d.ts +1 -1
- package/dist/types/pm-plugins/toggle-tasklist-commands.d.ts +2 -2
- package/dist/types/tasksAndDecisionsPluginType.d.ts +10 -9
- package/dist/types/types/index.d.ts +4 -3
- package/dist/types/ui/DecisionListBlockMenuItem/DecisionListBlockMenuItem.d.ts +1 -1
- package/dist/types/ui/Task/RequestToEditPopup.d.ts +2 -2
- package/dist/types/ui/Task/index.d.ts +2 -2
- package/dist/types/ui/Task/task-item-with-providers.d.ts +1 -1
- package/dist/types/ui/TaskListBlockMenuItem/TaskListBlockMenuItem.d.ts +1 -1
- package/dist/types/ui/TaskListMenuItem/TaskListMenuItem.d.ts +2 -2
- package/dist/types/ui/ToolbarDecision/index.d.ts +1 -1
- package/dist/types/ui/ToolbarTask/index.d.ts +1 -1
- package/dist/types/ui/quick-insert/TasksAndDecisionsQuickInsertMenuItem.d.ts +1 -1
- package/dist/types/ui/quick-insert/getTasksAndDecisionsQuickInsertComponents.d.ts +1 -1
- package/dist/types/ui/toolbar-components.d.ts +2 -2
- package/package.json +3 -3
|
@@ -13,19 +13,21 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
var _reactIntl = require("react-intl");
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
16
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
17
|
+
var _generalEvents = require("@atlaskit/editor-common/analytics/types/general-events");
|
|
18
|
+
var _tasksAndDecisions = require("@atlaskit/editor-common/messages/tasks-and-decisions");
|
|
19
|
+
var _Popup = _interopRequireDefault(require("@atlaskit/editor-common/Popup"));
|
|
19
20
|
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
20
|
-
var
|
|
21
|
-
var
|
|
21
|
+
var _withReactEditorViewOuterListeners = _interopRequireDefault(require("@atlaskit/editor-common/ui-react/with-react-editor-view-outer-listeners"));
|
|
22
|
+
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/useSharedPluginStateSelector");
|
|
23
|
+
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
22
24
|
var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
|
|
23
25
|
var _checkMark = _interopRequireDefault(require("@atlaskit/icon/core/check-mark"));
|
|
24
26
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
25
27
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
26
28
|
// import Popup from '@atlaskit/popup';
|
|
27
29
|
// oxlint-disable-next-line import/no-duplicates
|
|
28
|
-
var PopupWithListeners = (0,
|
|
30
|
+
var PopupWithListeners = (0, _withReactEditorViewOuterListeners.default)(_Popup.default);
|
|
29
31
|
var TRYING_REQUEST_TIMEOUT = 3000;
|
|
30
32
|
var popupContentWrapper = null;
|
|
31
33
|
var wrapperStyles = null;
|
|
@@ -38,18 +40,18 @@ var pressableStyles = {
|
|
|
38
40
|
var anaylyticsEventPayload = function anaylyticsEventPayload(action) {
|
|
39
41
|
return {
|
|
40
42
|
action: action,
|
|
41
|
-
actionSubject:
|
|
42
|
-
eventType:
|
|
43
|
+
actionSubject: _enums.ACTION_SUBJECT.REQUEST_TO_EDIT_POP_UP,
|
|
44
|
+
eventType: _enums.EVENT_TYPE.UI,
|
|
43
45
|
attributes: {
|
|
44
|
-
platform:
|
|
45
|
-
mode:
|
|
46
|
+
platform: _generalEvents.PLATFORMS.WEB,
|
|
47
|
+
mode: _generalEvents.MODE.EDITOR
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
};
|
|
49
51
|
var RequestedMessage = function RequestedMessage() {
|
|
50
52
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
51
53
|
formatMessage = _useIntl.formatMessage;
|
|
52
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, formatMessage(
|
|
54
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.requestToEdit), /*#__PURE__*/React.createElement(_checkMark.default, {
|
|
53
55
|
label: "requested-to-edit",
|
|
54
56
|
color: "var(--ds-icon-disabled, #080F214A)"
|
|
55
57
|
}));
|
|
@@ -62,7 +64,7 @@ var RequestToEditButton = function RequestToEditButton(_ref) {
|
|
|
62
64
|
onClick: onClick,
|
|
63
65
|
xcss: pressableStyles.pressableMotion,
|
|
64
66
|
testId: "request-to-edit-popup-request-btn"
|
|
65
|
-
}, formatMessage(
|
|
67
|
+
}, formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.requestToEdit)));
|
|
66
68
|
};
|
|
67
69
|
var RequestToEditPopup = exports.RequestToEditPopup = function RequestToEditPopup(_ref2) {
|
|
68
70
|
var element = _ref2.element,
|
|
@@ -119,11 +121,11 @@ var RequestToEditPopup = exports.RequestToEditPopup = function RequestToEditPopu
|
|
|
119
121
|
requestToEdit();
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(anaylyticsEventPayload(
|
|
124
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(anaylyticsEventPayload(_enums.ACTION.REQUEST_TO_EDIT))(tr);
|
|
123
125
|
editorView.dispatch(tr);
|
|
124
126
|
};
|
|
125
127
|
var onHandleDismiss = function onHandleDismiss(editorAnalyticsAPI) {
|
|
126
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.fireAnalyticsEvent(anaylyticsEventPayload(
|
|
128
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.fireAnalyticsEvent(anaylyticsEventPayload(_enums.ACTION.DISMISSED));
|
|
127
129
|
setIsOpen(false);
|
|
128
130
|
onClose();
|
|
129
131
|
};
|
|
@@ -147,7 +149,7 @@ var RequestToEditPopup = exports.RequestToEditPopup = function RequestToEditPopu
|
|
|
147
149
|
fitHeight: 148,
|
|
148
150
|
handleClickOutside: onHandleCancel,
|
|
149
151
|
handleEscapeKeydown: onHandleCancel,
|
|
150
|
-
zIndex:
|
|
152
|
+
zIndex: _constants.akEditorFloatingDialogZIndex,
|
|
151
153
|
mountTo: mountTo,
|
|
152
154
|
boundariesElement: boundariesElement,
|
|
153
155
|
scrollableElement: scrollableElement,
|
|
@@ -165,7 +167,7 @@ var RequestToEditPopup = exports.RequestToEditPopup = function RequestToEditPopu
|
|
|
165
167
|
space: "space.150"
|
|
166
168
|
}, /*#__PURE__*/React.createElement(_heading.default, {
|
|
167
169
|
size: "xsmall"
|
|
168
|
-
}, formatMessage(
|
|
170
|
+
}, formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.editAccessTitle)), /*#__PURE__*/React.createElement("div", null, formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.requestToEditDescription)), /*#__PURE__*/React.createElement("div", {
|
|
169
171
|
className: (0, _runtime.ax)(["_zulp1b66 _1e0c1txw _4cvr1h6o _syaz1gmx"])
|
|
170
172
|
}, tryingRequest || requested ? /*#__PURE__*/React.createElement(RequestedMessage, null) : /*#__PURE__*/React.createElement(RequestToEditButton, {
|
|
171
173
|
onClick: onHandleEdit
|
|
@@ -180,6 +182,6 @@ var RequestToEditPopup = exports.RequestToEditPopup = function RequestToEditPopu
|
|
|
180
182
|
},
|
|
181
183
|
xcss: pressableStyles.pressableMotion,
|
|
182
184
|
testId: "request-to-edit-popup-cancel-btn"
|
|
183
|
-
}, formatMessage(
|
|
185
|
+
}, formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.dismiss)))))));
|
|
184
186
|
}));
|
|
185
187
|
};
|
|
@@ -16,9 +16,10 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
18
|
var _reactIntl = require("react-intl");
|
|
19
|
-
var
|
|
20
|
-
var _providerFactory2 = require("@atlaskit/editor-common/provider-factory");
|
|
21
|
-
var
|
|
19
|
+
var _tasksAndDecisions = require("@atlaskit/editor-common/messages/tasks-and-decisions");
|
|
20
|
+
var _providerFactory2 = _interopRequireDefault(require("@atlaskit/editor-common/provider-factory/provider-factory"));
|
|
21
|
+
var _withProviders = require("@atlaskit/editor-common/provider-factory/with-providers");
|
|
22
|
+
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/useSharedPluginStateSelector");
|
|
22
23
|
var _taskItemWithProviders = _interopRequireDefault(require("./task-item-with-providers"));
|
|
23
24
|
var _excluded = ["providers", "intl", "taskDecisionProvider", "api", "placeholder"];
|
|
24
25
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -43,12 +44,12 @@ var TaskItem = exports.TaskItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
43
44
|
// Ignored via go/ees005
|
|
44
45
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
45
46
|
, (0, _extends2.default)({}, otherProps, {
|
|
46
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(
|
|
47
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.taskPlaceholder),
|
|
47
48
|
taskDecisionProvider: taskDecisionProvider ? Promise.resolve(taskDecisionProvider) : undefined,
|
|
48
49
|
contextIdentifierProvider: contextIdentifierProvider
|
|
49
50
|
}));
|
|
50
51
|
});
|
|
51
|
-
_this.providerFactory = props.providers || new _providerFactory2.
|
|
52
|
+
_this.providerFactory = props.providers || new _providerFactory2.default();
|
|
52
53
|
return _this;
|
|
53
54
|
}
|
|
54
55
|
(0, _inherits2.default)(TaskItem, _PureComponent);
|
|
@@ -65,7 +66,7 @@ var TaskItem = exports.TaskItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
65
66
|
key: "render",
|
|
66
67
|
value: function render() {
|
|
67
68
|
var providers = ['contextIdentifierProvider'];
|
|
68
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_withProviders.WithProviders, {
|
|
69
70
|
providers: providers,
|
|
70
71
|
providerFactory: this.providerFactory,
|
|
71
72
|
renderNode: this.renderWithProvider
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TaskListBlockMenuItem = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
11
|
+
var _tasksAndDecisions = require("@atlaskit/editor-common/messages/tasks-and-decisions");
|
|
12
|
+
var _toolbarDropdownItem = require("@atlaskit/editor-toolbar/toolbar-dropdown-item");
|
|
13
13
|
var _task = _interopRequireDefault(require("@atlaskit/icon/core/task"));
|
|
14
14
|
var NODE_NAME = 'taskList';
|
|
15
15
|
var TaskListBlockMenuItem = exports.TaskListBlockMenuItem = function TaskListBlockMenuItem(_ref) {
|
|
@@ -18,8 +18,8 @@ var TaskListBlockMenuItem = exports.TaskListBlockMenuItem = function TaskListBlo
|
|
|
18
18
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
19
19
|
formatMessage = _useIntl.formatMessage;
|
|
20
20
|
var onClick = function onClick(event) {
|
|
21
|
-
var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ?
|
|
22
|
-
var inputMethod =
|
|
21
|
+
var triggeredFrom = event.nativeEvent instanceof KeyboardEvent || event.nativeEvent.detail === 0 ? _enums.INPUT_METHOD.KEYBOARD : _enums.INPUT_METHOD.MOUSE;
|
|
22
|
+
var inputMethod = _enums.INPUT_METHOD.BLOCK_MENU;
|
|
23
23
|
api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
|
|
24
24
|
var _api$blockMenu;
|
|
25
25
|
var tr = _ref2.tr;
|
|
@@ -34,11 +34,11 @@ var TaskListBlockMenuItem = exports.TaskListBlockMenuItem = function TaskListBlo
|
|
|
34
34
|
}) : null;
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_toolbarDropdownItem.ToolbarDropdownItem, {
|
|
38
38
|
onClick: onClick,
|
|
39
39
|
elemBefore: /*#__PURE__*/_react.default.createElement(_task.default, {
|
|
40
40
|
label: "",
|
|
41
41
|
size: "small"
|
|
42
42
|
})
|
|
43
|
-
}, formatMessage(
|
|
43
|
+
}, formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.taskList));
|
|
44
44
|
};
|
|
@@ -7,15 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TaskListMenuItem = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
10
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
|
-
var
|
|
13
|
-
var
|
|
11
|
+
var _tasksAndDecisions = require("@atlaskit/editor-common/messages/tasks-and-decisions");
|
|
12
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
13
|
+
var _taskIcon = require("@atlaskit/editor-toolbar/task-icon");
|
|
14
|
+
var _toolbarDropdownItem = require("@atlaskit/editor-toolbar/toolbar-dropdown-item");
|
|
15
|
+
var _toolbarKeyboardShortcutHint = require("@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint");
|
|
14
16
|
var TaskListMenuItem = exports.TaskListMenuItem = function TaskListMenuItem(_ref) {
|
|
15
17
|
var api = _ref.api;
|
|
16
18
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
17
19
|
formatMessage = _useIntl.formatMessage;
|
|
18
|
-
var _useSharedPluginState = (0,
|
|
20
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['taskDecision'], function (states) {
|
|
19
21
|
var _states$taskDecisionS;
|
|
20
22
|
return {
|
|
21
23
|
isInsideTask: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
@@ -26,16 +28,16 @@ var TaskListMenuItem = exports.TaskListMenuItem = function TaskListMenuItem(_ref
|
|
|
26
28
|
var _api$taskDecision;
|
|
27
29
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList());
|
|
28
30
|
};
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
30
|
-
elemBefore: /*#__PURE__*/_react.default.createElement(
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_toolbarDropdownItem.ToolbarDropdownItem, {
|
|
32
|
+
elemBefore: /*#__PURE__*/_react.default.createElement(_taskIcon.TaskIcon, {
|
|
31
33
|
size: "small",
|
|
32
34
|
label: ""
|
|
33
35
|
}),
|
|
34
|
-
elemAfter: /*#__PURE__*/_react.default.createElement(
|
|
36
|
+
elemAfter: /*#__PURE__*/_react.default.createElement(_toolbarKeyboardShortcutHint.ToolbarKeyboardShortcutHint, {
|
|
35
37
|
shortcut: (0, _keymaps.formatShortcut)(_keymaps.toggleTaskList)
|
|
36
38
|
}),
|
|
37
39
|
isSelected: isInsideTask,
|
|
38
40
|
onClick: handleClick,
|
|
39
41
|
ariaKeyshortcuts: (0, _keymaps.formatShortcut)(_keymaps.toggleTaskList)
|
|
40
|
-
}, formatMessage(
|
|
42
|
+
}, formatMessage(_tasksAndDecisions.tasksAndDecisionsMessages.taskList));
|
|
41
43
|
};
|
|
@@ -7,8 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _toolbarButton = require("@atlaskit/editor-common/analytics/types/toolbar-button");
|
|
11
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
12
|
+
var _ToolbarButton = _interopRequireDefault(require("@atlaskit/editor-common/ui-menu/ToolbarButton"));
|
|
12
13
|
var _decision = _interopRequireDefault(require("@atlaskit/icon/core/decision"));
|
|
13
14
|
var _insertCommands = require("../../pm-plugins/insert-commands");
|
|
14
15
|
var ToolbarDecision = function ToolbarDecision(_ref) {
|
|
@@ -17,7 +18,7 @@ var ToolbarDecision = function ToolbarDecision(_ref) {
|
|
|
17
18
|
formatMessage = _ref.intl.formatMessage,
|
|
18
19
|
editorView = _ref.editorView,
|
|
19
20
|
editorAPI = _ref.editorAPI;
|
|
20
|
-
var label = formatMessage(
|
|
21
|
+
var label = formatMessage(_insertBlock.toolbarInsertBlockMessages.decision);
|
|
21
22
|
var handleInsertDecision = function handleInsertDecision() {
|
|
22
23
|
var _editorAPI$analytics;
|
|
23
24
|
if (!editorView) {
|
|
@@ -30,8 +31,8 @@ var ToolbarDecision = function ToolbarDecision(_ref) {
|
|
|
30
31
|
(0, _insertCommands.insertTaskDecisionCommand)(editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions, getContextIdentifier)('decisionList')(editorView.state, editorView.dispatch);
|
|
31
32
|
return true;
|
|
32
33
|
};
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
34
|
-
buttonId:
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
35
|
+
buttonId: _toolbarButton.TOOLBAR_ACTION_SUBJECT_ID.DECISION_LIST,
|
|
35
36
|
onClick: handleInsertDecision,
|
|
36
37
|
disabled: isDisabled,
|
|
37
38
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -7,8 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _toolbarButton = require("@atlaskit/editor-common/analytics/types/toolbar-button");
|
|
11
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
12
|
+
var _ToolbarButton = _interopRequireDefault(require("@atlaskit/editor-common/ui-menu/ToolbarButton"));
|
|
12
13
|
var _checkboxChecked = _interopRequireDefault(require("@atlaskit/icon/core/checkbox-checked"));
|
|
13
14
|
var _insertCommands = require("../../pm-plugins/insert-commands");
|
|
14
15
|
var ToolbarTask = function ToolbarTask(_ref) {
|
|
@@ -17,7 +18,7 @@ var ToolbarTask = function ToolbarTask(_ref) {
|
|
|
17
18
|
formatMessage = _ref.intl.formatMessage,
|
|
18
19
|
editorAPI = _ref.editorAPI,
|
|
19
20
|
editorView = _ref.editorView;
|
|
20
|
-
var label = formatMessage(
|
|
21
|
+
var label = formatMessage(_insertBlock.toolbarInsertBlockMessages.action);
|
|
21
22
|
var handleInsertTask = function handleInsertTask() {
|
|
22
23
|
var _editorAPI$analytics;
|
|
23
24
|
if (!editorView) {
|
|
@@ -30,8 +31,8 @@ var ToolbarTask = function ToolbarTask(_ref) {
|
|
|
30
31
|
(0, _insertCommands.insertTaskDecisionCommand)(editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions, getContextIdentifier)('taskList')(editorView.state, editorView.dispatch);
|
|
31
32
|
return true;
|
|
32
33
|
};
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
34
|
-
buttonId:
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
35
|
+
buttonId: _toolbarButton.TOOLBAR_ACTION_SUBJECT_ID.TASK_LIST,
|
|
35
36
|
onClick: handleInsertTask,
|
|
36
37
|
disabled: isDisabled,
|
|
37
38
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -8,11 +8,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.TasksAndDecisionsQuickInsertMenuItem = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactIntl = require("react-intl");
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
12
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
14
13
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
15
|
-
var
|
|
14
|
+
var _messages = require("@atlaskit/editor-common/quick-insert/messages");
|
|
15
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
16
16
|
var _decision = _interopRequireDefault(require("@atlaskit/icon/core/decision"));
|
|
17
17
|
var _fieldCheckboxGroup = _interopRequireDefault(require("@atlaskit/icon/core/field-checkbox-group"));
|
|
18
18
|
var _insertCommands = require("../../pm-plugins/insert-commands");
|
|
@@ -24,7 +24,7 @@ var TasksAndDecisionsQuickInsertMenuItem = exports.TasksAndDecisionsQuickInsertM
|
|
|
24
24
|
previewImageUrls = _ref.previewImageUrls;
|
|
25
25
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
26
26
|
formatMessage = _useIntl.formatMessage;
|
|
27
|
-
var _useSharedPluginState = (0,
|
|
27
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['contextIdentifier'], function (states) {
|
|
28
28
|
var _states$contextIdenti;
|
|
29
29
|
return {
|
|
30
30
|
contextIdentifierProvider: (_states$contextIdenti = states.contextIdentifierState) === null || _states$contextIdenti === void 0 ? void 0 : _states$contextIdenti.contextIdentifierProvider
|
|
@@ -36,7 +36,7 @@ var TasksAndDecisionsQuickInsertMenuItem = exports.TasksAndDecisionsQuickInsertM
|
|
|
36
36
|
return previewImageUrls ? {
|
|
37
37
|
image: previewImageUrls,
|
|
38
38
|
attribution: {
|
|
39
|
-
name: formatMessage(
|
|
39
|
+
name: formatMessage(_messages.messages.previewAttributionAtlassian)
|
|
40
40
|
}
|
|
41
41
|
} : undefined;
|
|
42
42
|
}, [formatMessage, previewImageUrls]);
|
|
@@ -60,10 +60,10 @@ var TasksAndDecisionsQuickInsertMenuItem = exports.TasksAndDecisionsQuickInsertM
|
|
|
60
60
|
};
|
|
61
61
|
return (0, _insertCommands.insertTaskDecisionAction)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, function () {
|
|
62
62
|
return contextIdentifierProvider;
|
|
63
|
-
})(editorView.state, item, source !== null && source !== void 0 ? source :
|
|
63
|
+
})(editorView.state, item, source !== null && source !== void 0 ? source : _enums.INPUT_METHOD.QUICK_INSERT, addAndCreateList);
|
|
64
64
|
}, [api, contextIdentifierProvider, item]);
|
|
65
65
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
66
|
-
description: description !== null && description !== void 0 ? description : formatMessage(isAction ?
|
|
66
|
+
description: description !== null && description !== void 0 ? description : formatMessage(isAction ? _insertBlock.toolbarInsertBlockMessages.actionDescription : _insertBlock.toolbarInsertBlockMessages.decisionDescription),
|
|
67
67
|
iconBefore: isAction ? /*#__PURE__*/_react.default.createElement(_fieldCheckboxGroup.default, {
|
|
68
68
|
label: ""
|
|
69
69
|
}) : /*#__PURE__*/_react.default.createElement(_decision.default, {
|
|
@@ -72,6 +72,6 @@ var TasksAndDecisionsQuickInsertMenuItem = exports.TasksAndDecisionsQuickInsertM
|
|
|
72
72
|
onSelect: onSelect,
|
|
73
73
|
preview: preview,
|
|
74
74
|
shortcut: isAction ? '[]' : '<>',
|
|
75
|
-
title: formatMessage(isAction ?
|
|
75
|
+
title: formatMessage(isAction ? _insertBlock.toolbarInsertBlockMessages.action : _insertBlock.toolbarInsertBlockMessages.decision)
|
|
76
76
|
});
|
|
77
77
|
};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getTasksAndDecisionsQuickInsertComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
10
10
|
var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher");
|
|
11
11
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
12
12
|
var _rank = require("@atlaskit/editor-common/quick-insert/rank");
|
|
@@ -33,10 +33,10 @@ var getTasksAndDecisionsQuickInsertComponents = exports.getTasksAndDecisionsQuic
|
|
|
33
33
|
match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref2) {
|
|
34
34
|
var formatMessage = _ref2.formatMessage;
|
|
35
35
|
return {
|
|
36
|
-
description: quickInsertActionDescription !== null && quickInsertActionDescription !== void 0 ? quickInsertActionDescription : formatMessage(
|
|
36
|
+
description: quickInsertActionDescription !== null && quickInsertActionDescription !== void 0 ? quickInsertActionDescription : formatMessage(_insertBlock.toolbarInsertBlockMessages.actionDescription),
|
|
37
37
|
keywords: ['checkbox', 'task', 'todo'],
|
|
38
38
|
shortcut: '[]',
|
|
39
|
-
title: formatMessage(
|
|
39
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.action)
|
|
40
40
|
};
|
|
41
41
|
}),
|
|
42
42
|
component: function component() {
|
|
@@ -58,10 +58,10 @@ var getTasksAndDecisionsQuickInsertComponents = exports.getTasksAndDecisionsQuic
|
|
|
58
58
|
match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref3) {
|
|
59
59
|
var formatMessage = _ref3.formatMessage;
|
|
60
60
|
return {
|
|
61
|
-
description: formatMessage(
|
|
61
|
+
description: formatMessage(_insertBlock.toolbarInsertBlockMessages.decisionDescription),
|
|
62
62
|
keywords: [],
|
|
63
63
|
shortcut: '<>',
|
|
64
|
-
title: formatMessage(
|
|
64
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.decision)
|
|
65
65
|
};
|
|
66
66
|
}),
|
|
67
67
|
component: function component() {
|
|
@@ -6,17 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getTasksAndDecisionsToolbarComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _keys = require("@atlaskit/editor-common/toolbar/keys");
|
|
10
|
+
var _rank = require("@atlaskit/editor-common/toolbar/rank");
|
|
10
11
|
var _TaskListMenuItem = require("./TaskListMenuItem/TaskListMenuItem");
|
|
11
12
|
var getTasksAndDecisionsToolbarComponents = exports.getTasksAndDecisionsToolbarComponents = function getTasksAndDecisionsToolbarComponents(_ref) {
|
|
12
13
|
var api = _ref.api;
|
|
13
14
|
return [{
|
|
14
|
-
type:
|
|
15
|
-
key:
|
|
15
|
+
type: _keys.TASK_LIST_MENU_ITEM.type,
|
|
16
|
+
key: _keys.TASK_LIST_MENU_ITEM.key,
|
|
16
17
|
parents: [{
|
|
17
|
-
type:
|
|
18
|
-
key:
|
|
19
|
-
rank:
|
|
18
|
+
type: _keys.LISTS_INDENTATION_MENU_SECTION.type,
|
|
19
|
+
key: _keys.LISTS_INDENTATION_MENU_SECTION.key,
|
|
20
|
+
rank: _rank.LISTS_INDENTATION_MENU_SECTION_RANK[_keys.TASK_LIST_MENU_ITEM.key]
|
|
20
21
|
}],
|
|
21
22
|
component: function component(_ref2) {
|
|
22
23
|
var parents = _ref2.parents;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
2
|
+
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages/tasks-and-decisions';
|
|
3
3
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
5
|
import { decisionItemToDOM } from './decisionItemNodeSpec';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { bindAll } from 'bind-event-listener';
|
|
3
3
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
|
|
4
|
-
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages/tasks-and-decisions';
|
|
5
5
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
import { openRequestEditPopupAt } from '../pm-plugins/helpers';
|
|
8
7
|
import { taskItemToDom } from './taskItemNodeSpec';
|
|
9
8
|
import { isContentEmpty } from './utils';
|
|
@@ -102,16 +101,9 @@ export class TaskItemNodeView {
|
|
|
102
101
|
}
|
|
103
102
|
return undefined;
|
|
104
103
|
}
|
|
105
|
-
isContentEmpty(node) {
|
|
106
|
-
return node.content.childCount === 0;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
104
|
// Update the placeholder visibility based on content
|
|
110
105
|
updatePlaceholder(node) {
|
|
111
|
-
|
|
112
|
-
if (expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
|
|
113
|
-
currentIsContentEmpty = isContentEmpty(node);
|
|
114
|
-
}
|
|
106
|
+
const currentIsContentEmpty = isContentEmpty(node);
|
|
115
107
|
if (currentIsContentEmpty !== this.emptyContent) {
|
|
116
108
|
var _this$contentDOM;
|
|
117
109
|
this.emptyContent = currentIsContentEmpty;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/
|
|
2
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/useSharedPluginState';
|
|
3
3
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
export const useShowPlaceholder = ({
|
|
5
5
|
editorView,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
2
|
-
import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
1
|
+
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages/tasks-and-decisions';
|
|
2
|
+
import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles/task-decision';
|
|
4
3
|
import { isContentEmpty } from './utils';
|
|
5
4
|
const getCheckBoxId = localId => `task-checkbox-${localId}`;
|
|
6
5
|
|
|
@@ -33,14 +32,9 @@ export function taskItemToDom(node, placeholder, intl) {
|
|
|
33
32
|
'data-task-is-block': 'true'
|
|
34
33
|
} : {})
|
|
35
34
|
};
|
|
36
|
-
|
|
35
|
+
const contentDomDataAttrs = isContentEmpty(node) ? {
|
|
37
36
|
'data-empty': 'true'
|
|
38
|
-
};
|
|
39
|
-
if (expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true)) {
|
|
40
|
-
contentDomDataAttrs = isContentEmpty(node) ? {
|
|
41
|
-
'data-empty': 'true'
|
|
42
|
-
} : {};
|
|
43
|
-
}
|
|
37
|
+
} : {};
|
|
44
38
|
const checkboxIcons = ['http://www.w3.org/2000/svg svg', {
|
|
45
39
|
width: '20',
|
|
46
40
|
height: '20',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { buildReplacementFragment
|
|
1
|
+
import { buildReplacementFragment } from '@atlaskit/editor-common/lists/build-replacement-fragment';
|
|
2
|
+
import { narrowReplacementRange } from '@atlaskit/editor-common/lists/narrow-replacement-range';
|
|
3
|
+
import { computeSelectionOffsets, restoreSelection } from '@atlaskit/editor-common/lists/restore-selection';
|
|
2
4
|
import { findFarthestParentNode } from '@atlaskit/editor-common/utils';
|
|
3
5
|
import { flattenTaskList, rebuildTaskList } from '../task-list-indentation';
|
|
4
6
|
const MAX_TASK_LIST_DEPTH = 6;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findCutBefore } from '@atlaskit/editor-common/commands';
|
|
2
|
-
import { getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
|
|
2
|
+
import { getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists/block-mark';
|
|
3
3
|
import { isTaskList } from '@atlaskit/editor-common/transforms';
|
|
4
4
|
import { ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
5
|
import { isActionOrDecisionItem, isActionOrDecisionList } from './helpers';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
1
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
2
2
|
import { findFarthestParentNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import {
|
|
6
|
+
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules/constants';
|
|
7
|
+
import { createPlugin } from '@atlaskit/prosemirror-input-rules/utils';
|
|
7
8
|
import { changeInDepth, getListTypes, insertTaskDecisionAction } from './insert-commands';
|
|
8
9
|
const createListRule = (editorAnalyticsAPI, getContextIdentifierProvider) => (regex, listType, itemAttrs) => {
|
|
9
10
|
return createRule(regex, (state, _match, start, end) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { uuid } from '@atlaskit/adf-schema/uuid';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { USER_CONTEXT } from '@atlaskit/editor-common/analytics/types/insert-events';
|
|
4
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
5
|
+
import { autoJoinTr } from '@atlaskit/editor-common/utils/autojoin';
|
|
5
6
|
import { NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
6
7
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
8
|
import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
|
|
2
2
|
import { uuid } from '@atlaskit/adf-schema/uuid';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE,
|
|
4
|
-
import {
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { INDENT_DIRECTION, INDENT_TYPE } from '@atlaskit/editor-common/analytics/types/format-events';
|
|
5
5
|
import { toggleTaskItemCheckbox, toggleTaskList as toggleTaskListKeymap } from '@atlaskit/editor-common/keymaps';
|
|
6
|
-
import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForParagraphAtPos } from '@atlaskit/editor-common/lists';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForParagraphAtPos } from '@atlaskit/editor-common/lists/block-mark';
|
|
7
|
+
import { Side } from '@atlaskit/editor-common/selection';
|
|
8
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
9
|
+
import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
10
|
+
import { deleteEmptyParagraphAndMoveBlockUp, isEmptySelectionAtEnd, isEmptySelectionAtStart } from '@atlaskit/editor-common/utils/commands';
|
|
11
|
+
import { withAnalytics } from '@atlaskit/editor-common/withAnalytics';
|
|
9
12
|
import { autoJoin, chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
10
13
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
11
14
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
|
|
2
2
|
import { uuid } from '@atlaskit/adf-schema/uuid';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { createSelectionClickHandler
|
|
4
|
+
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
5
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
5
6
|
import { getStepRange } from '@atlaskit/editor-common/utils';
|
|
6
7
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
8
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
9
|
import { DecisionItemNodeView } from '../nodeviews/DecisionItemNodeView';
|
|
10
10
|
import { taskView } from '../nodeviews/task-node-view';
|
|
11
11
|
import { focusTaskDecision, openRequestEditPopup, setProvider } from './actions';
|
|
@@ -31,9 +31,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
31
31
|
decisionItem: node => {
|
|
32
32
|
return new DecisionItemNodeView(node, getIntl());
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
|
|
36
|
-
} : {})
|
|
34
|
+
blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
|
|
37
35
|
},
|
|
38
36
|
decorations(state) {
|
|
39
37
|
const pluginState = stateKey.getState(state);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { uuid } from '@atlaskit/adf-schema/uuid';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists';
|
|
4
|
-
import {
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists/analytics';
|
|
4
|
+
import { transformTaskListToBlockNodes, isBulletOrOrderedList, isTaskList, getFormattedNode } from '@atlaskit/editor-common/transforms';
|
|
5
|
+
import { transformBetweenListTypes, transformToTaskList } from '@atlaskit/editor-common/transforms/list-transforms';
|
|
5
6
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
7
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
8
|
export const toggleTaskList = editorAnalyticsAPI => (targetType = 'paragraph') => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { uuid } from '@atlaskit/adf-schema/uuid';
|
|
2
|
-
import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
|
|
2
|
+
import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists/block-mark';
|
|
3
3
|
import { createBlockTaskItem, isTaskList } from '@atlaskit/editor-common/transforms';
|
|
4
4
|
import { Slice, Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
/**
|