@atlaskit/editor-core 188.11.4 → 188.12.1
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 +19 -0
- package/dist/cjs/labs/next/presets/universal.js +15 -3
- package/dist/cjs/plugins/annotation/index.js +12 -1
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
- package/dist/cjs/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/cjs/plugins/annotation/toolbar.js +2 -156
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
- package/dist/cjs/plugins/layout/actions.js +20 -17
- package/dist/cjs/plugins/layout/index.js +6 -2
- package/dist/cjs/plugins/panel/index.js +1 -1
- package/dist/cjs/plugins/panel/toolbar.js +9 -7
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +0 -6
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/cjs/plugins/undo-redo/index.js +7 -16
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +59 -75
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +14 -2
- package/dist/es2019/plugins/annotation/index.js +14 -1
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/es2019/plugins/annotation/pm-plugins/plugin-factory.js +6 -0
- package/dist/es2019/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/es2019/plugins/annotation/toolbar.js +1 -156
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -3
- package/dist/es2019/plugins/layout/actions.js +4 -3
- package/dist/es2019/plugins/layout/index.js +63 -57
- package/dist/es2019/plugins/panel/index.js +1 -1
- package/dist/es2019/plugins/panel/toolbar.js +9 -7
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +1 -4
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +22 -14
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/es2019/plugins/undo-redo/index.js +6 -17
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +60 -61
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +14 -2
- package/dist/esm/plugins/annotation/index.js +12 -1
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
- package/dist/esm/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/esm/plugins/annotation/toolbar.js +1 -156
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
- package/dist/esm/plugins/layout/actions.js +15 -12
- package/dist/esm/plugins/layout/index.js +7 -3
- package/dist/esm/plugins/panel/index.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +9 -7
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +1 -6
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/esm/plugins/undo-redo/index.js +6 -16
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +56 -74
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/annotation/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +3 -1
- package/dist/types/plugins/layout/actions.d.ts +2 -1
- package/dist/types/plugins/layout/index.d.ts +4 -0
- package/dist/types/plugins/panel/index.d.ts +2 -2
- package/dist/types/plugins/panel/toolbar.d.ts +5 -3
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +0 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
- package/dist/types/plugins/tasks-and-decisions/types.d.ts +5 -1
- package/dist/types/plugins/undo-redo/types.d.ts +2 -1
- package/dist/types/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +2 -6
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/layout/actions.d.ts +2 -1
- package/dist/types-ts4.5/plugins/layout/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/panel/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +5 -3
- package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +0 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
- package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/undo-redo/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +2 -6
- package/package.json +8 -3
- package/dist/cjs/plugins/history/actions.js +0 -10
- package/dist/cjs/plugins/history/index.js +0 -75
- package/dist/cjs/plugins/history/pm-history-types.js +0 -5
- package/dist/cjs/plugins/history/reducer.js +0 -18
- package/dist/cjs/plugins/history/types.js +0 -5
- package/dist/cjs/plugins/history/utils.js +0 -19
- package/dist/es2019/plugins/history/actions.js +0 -4
- package/dist/es2019/plugins/history/index.js +0 -61
- package/dist/es2019/plugins/history/pm-history-types.js +0 -1
- package/dist/es2019/plugins/history/reducer.js +0 -12
- package/dist/es2019/plugins/history/types.js +0 -1
- package/dist/es2019/plugins/history/utils.js +0 -11
- package/dist/esm/plugins/history/actions.js +0 -4
- package/dist/esm/plugins/history/index.js +0 -68
- package/dist/esm/plugins/history/pm-history-types.js +0 -1
- package/dist/esm/plugins/history/reducer.js +0 -12
- package/dist/esm/plugins/history/types.js +0 -1
- package/dist/esm/plugins/history/utils.js +0 -13
- package/dist/types/plugins/history/actions.d.ts +0 -8
- package/dist/types/plugins/history/index.d.ts +0 -13
- package/dist/types/plugins/history/pm-history-types.d.ts +0 -17
- package/dist/types/plugins/history/reducer.d.ts +0 -4
- package/dist/types/plugins/history/types.d.ts +0 -4
- package/dist/types/plugins/history/utils.d.ts +0 -4
- package/dist/types-ts4.5/plugins/history/actions.d.ts +0 -8
- package/dist/types-ts4.5/plugins/history/index.d.ts +0 -13
- package/dist/types-ts4.5/plugins/history/pm-history-types.d.ts +0 -17
- package/dist/types-ts4.5/plugins/history/reducer.d.ts +0 -4
- package/dist/types-ts4.5/plugins/history/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/history/utils.d.ts +0 -4
package/dist/cjs/plugins/rank.js
CHANGED
|
@@ -19,7 +19,7 @@ var _default = exports.default = {
|
|
|
19
19
|
'mediaKeymap',
|
|
20
20
|
// selection keymap needs to be above gap cursor keymap so it can set node selections from
|
|
21
21
|
// left/right arrows
|
|
22
|
-
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
22
|
+
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'selectionToolbar', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
23
23
|
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
24
24
|
marks: [
|
|
25
25
|
// Fragment mark is both for inline and block elements
|
|
@@ -79,7 +79,7 @@ var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
|
79
79
|
name: 'tasksAndDecisionsKeyMap',
|
|
80
80
|
plugin: function plugin(_ref5) {
|
|
81
81
|
var schema = _ref5.schema;
|
|
82
|
-
return (0, _keymaps.default)(schema, allowNestedTasks, consumeTabs);
|
|
82
|
+
return (0, _keymaps.default)(schema, api, allowNestedTasks, consumeTabs);
|
|
83
83
|
}
|
|
84
84
|
} // Needs to be after "save-on-enter"
|
|
85
85
|
];
|
|
@@ -15,7 +15,8 @@ var _steps = require("@atlaskit/adf-schema/steps");
|
|
|
15
15
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
16
16
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
17
17
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
18
|
-
var _analytics = require("
|
|
18
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
19
|
+
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
19
20
|
var _commands2 = require("../commands");
|
|
20
21
|
var _commands3 = require("./commands");
|
|
21
22
|
var _helpers = require("./helpers");
|
|
@@ -96,16 +97,18 @@ var joinTaskDecisionFollowing = function joinTaskDecisionFollowing(state, dispat
|
|
|
96
97
|
}
|
|
97
98
|
return false;
|
|
98
99
|
};
|
|
99
|
-
var getUnindentCommand = exports.getUnindentCommand = function getUnindentCommand() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
var getUnindentCommand = exports.getUnindentCommand = function getUnindentCommand(editorAnalyticsAPI) {
|
|
101
|
+
return function () {
|
|
102
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
|
103
|
+
return (0, _utils2.filterCommand)(_helpers.isInsideTask, function (state, dispatch) {
|
|
104
|
+
var normalizedSelection = (0, _utils3.normalizeTaskItemsSelection)(state.selection);
|
|
105
|
+
var curIndentLevel = (0, _helpers.getCurrentIndentLevel)(normalizedSelection);
|
|
106
|
+
if (!curIndentLevel || curIndentLevel === 1) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, _analytics.INDENT_DIRECTION.OUTDENT, inputMethod))((0, _commands.autoJoin)(_commands3.liftSelection, ['taskList']))(state, dispatch);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
109
112
|
};
|
|
110
113
|
|
|
111
114
|
// if selection is decision item or first action item in table cell
|
|
@@ -122,53 +125,59 @@ var shouldLetTabThroughInTable = function shouldLetTabThroughInTable(state) {
|
|
|
122
125
|
}
|
|
123
126
|
return false;
|
|
124
127
|
};
|
|
125
|
-
var getIndentCommand = exports.getIndentCommand = function getIndentCommand() {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
var getIndentCommand = exports.getIndentCommand = function getIndentCommand(editorAnalyticsAPI) {
|
|
129
|
+
return function () {
|
|
130
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
|
131
|
+
return (0, _utils2.filterCommand)(_helpers.isInsideTask, function (state, dispatch) {
|
|
132
|
+
var normalizedSelection = (0, _utils3.normalizeTaskItemsSelection)(state.selection);
|
|
133
|
+
var curIndentLevel = (0, _helpers.getCurrentIndentLevel)(normalizedSelection);
|
|
134
|
+
if (!curIndentLevel || curIndentLevel >= 6) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, _analytics.INDENT_DIRECTION.INDENT, inputMethod))((0, _commands.autoJoin)(_commands3.wrapSelectionInTaskList, ['taskList']))(state, dispatch);
|
|
138
|
+
});
|
|
139
|
+
};
|
|
135
140
|
};
|
|
136
|
-
var backspaceFrom = function backspaceFrom(
|
|
137
|
-
return function (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
var backspaceFrom = function backspaceFrom(editorAnalyticsAPI) {
|
|
142
|
+
return function ($from) {
|
|
143
|
+
return function (state, dispatch) {
|
|
144
|
+
// previous was empty, just delete backwards
|
|
145
|
+
var taskBefore = $from.doc.resolve($from.before());
|
|
146
|
+
if (taskBefore.nodeBefore && (0, _helpers.isActionOrDecisionItem)(taskBefore.nodeBefore) && taskBefore.nodeBefore.nodeSize === 2) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
143
149
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
// if nested, just unindent
|
|
151
|
+
var _state$schema$nodes3 = state.schema.nodes,
|
|
152
|
+
taskList = _state$schema$nodes3.taskList,
|
|
153
|
+
paragraph = _state$schema$nodes3.paragraph;
|
|
154
|
+
if ($from.node($from.depth - 2).type === taskList) {
|
|
155
|
+
return getUnindentCommand(editorAnalyticsAPI)()(state, dispatch);
|
|
156
|
+
}
|
|
151
157
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
// bottom level, should "unwrap" taskItem contents into paragraph
|
|
159
|
+
// we achieve this by slicing the content out, and replacing
|
|
160
|
+
if (actionDecisionFollowsOrNothing($from)) {
|
|
161
|
+
if (dispatch) {
|
|
162
|
+
var taskContent = state.doc.slice($from.start(), $from.end()).content;
|
|
157
163
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
164
|
+
// might be end of document after
|
|
165
|
+
var slice = taskContent.size ? paragraph.createChecked(undefined, taskContent) : paragraph.createChecked();
|
|
166
|
+
dispatch(splitListItemWith(state.tr, slice, $from, true));
|
|
167
|
+
}
|
|
168
|
+
return true;
|
|
161
169
|
}
|
|
162
|
-
return
|
|
163
|
-
}
|
|
164
|
-
return false;
|
|
170
|
+
return false;
|
|
171
|
+
};
|
|
165
172
|
};
|
|
166
173
|
};
|
|
167
|
-
var backspace =
|
|
168
|
-
return (0,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
174
|
+
var backspace = function backspace(editorAnalyticsAPI) {
|
|
175
|
+
return (0, _utils2.filterCommand)(_utils2.isEmptySelectionAtStart, (0, _commands.autoJoin)((0, _commands.chainCommands)(function (state, dispatch) {
|
|
176
|
+
return (0, _commands3.joinAtCut)(state.selection.$from)(state, dispatch);
|
|
177
|
+
}, (0, _utils2.filterCommand)(_helpers.isInsideTaskOrDecisionItem, function (state, dispatch) {
|
|
178
|
+
return backspaceFrom(editorAnalyticsAPI)(state.selection.$from)(state, dispatch);
|
|
179
|
+
})), ['taskList', 'decisionList']));
|
|
180
|
+
};
|
|
172
181
|
var unindentTaskOrUnwrapTaskDecisionFollowing = function unindentTaskOrUnwrapTaskDecisionFollowing(state, dispatch) {
|
|
173
182
|
var $from = state.selection.$from,
|
|
174
183
|
_state$schema$nodes4 = state.schema.nodes,
|
|
@@ -278,42 +287,44 @@ var splitListItem = function splitListItem(state, dispatch) {
|
|
|
278
287
|
}
|
|
279
288
|
return false;
|
|
280
289
|
};
|
|
281
|
-
var enter =
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
$
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
290
|
+
var enter = function enter(editorAnalyticsAPI) {
|
|
291
|
+
return (0, _utils2.filterCommand)(_helpers.isInsideTaskOrDecisionItem, (0, _commands.chainCommands)((0, _utils2.filterCommand)(_helpers.isEmptyTaskDecision, (0, _commands.chainCommands)(getUnindentCommand(editorAnalyticsAPI)(), splitListItem)), function (state, dispatch) {
|
|
292
|
+
var selection = state.selection,
|
|
293
|
+
schema = state.schema;
|
|
294
|
+
var taskItem = schema.nodes.taskItem;
|
|
295
|
+
var $from = selection.$from,
|
|
296
|
+
$to = selection.$to;
|
|
297
|
+
var node = $from.node($from.depth);
|
|
298
|
+
var nodeType = node && node.type;
|
|
299
|
+
var listType = nodeType === taskItem ? 'taskList' : 'decisionList';
|
|
300
|
+
var addItem = function addItem(_ref) {
|
|
301
|
+
var tr = _ref.tr,
|
|
302
|
+
itemLocalId = _ref.itemLocalId;
|
|
303
|
+
// ED-8932: When cursor is at the beginning of a task item, instead of split, we insert above.
|
|
304
|
+
if ($from.pos === $to.pos && $from.parentOffset === 0) {
|
|
305
|
+
var newTask = nodeType.createAndFill({
|
|
306
|
+
localId: itemLocalId
|
|
307
|
+
});
|
|
308
|
+
if (newTask) {
|
|
309
|
+
// Current position will point to text node, but we want to insert above the taskItem node
|
|
310
|
+
return tr.insert($from.pos - 1, newTask);
|
|
311
|
+
}
|
|
301
312
|
}
|
|
313
|
+
return tr.split($from.pos, 1, [{
|
|
314
|
+
type: nodeType,
|
|
315
|
+
attrs: {
|
|
316
|
+
localId: itemLocalId
|
|
317
|
+
}
|
|
318
|
+
}]);
|
|
319
|
+
};
|
|
320
|
+
var insertTr = (0, _commands2.insertTaskDecisionWithAnalytics)(state, listType, _analytics.INPUT_METHOD.KEYBOARD, addItem);
|
|
321
|
+
if (insertTr && dispatch) {
|
|
322
|
+
insertTr.scrollIntoView();
|
|
323
|
+
dispatch(insertTr);
|
|
302
324
|
}
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
localId: itemLocalId
|
|
307
|
-
}
|
|
308
|
-
}]);
|
|
309
|
-
};
|
|
310
|
-
var insertTr = (0, _commands2.insertTaskDecisionWithAnalytics)(state, listType, _analytics.INPUT_METHOD.KEYBOARD, addItem);
|
|
311
|
-
if (insertTr && dispatch) {
|
|
312
|
-
insertTr.scrollIntoView();
|
|
313
|
-
dispatch(insertTr);
|
|
314
|
-
}
|
|
315
|
-
return true;
|
|
316
|
-
}));
|
|
325
|
+
return true;
|
|
326
|
+
}));
|
|
327
|
+
};
|
|
317
328
|
var cmdOptEnter = (0, _utils2.filterCommand)(_helpers.isInsideTaskOrDecisionItem, function (state, dispatch) {
|
|
318
329
|
var selection = state.selection,
|
|
319
330
|
schema = state.schema;
|
|
@@ -334,17 +345,20 @@ var cmdOptEnter = (0, _utils2.filterCommand)(_helpers.isInsideTaskOrDecisionItem
|
|
|
334
345
|
}
|
|
335
346
|
return true;
|
|
336
347
|
});
|
|
337
|
-
function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
348
|
+
function keymapPlugin(schema, api, allowNestedTasks, consumeTabs) {
|
|
349
|
+
var _api$analytics3, _api$analytics4;
|
|
338
350
|
var indentHandlers = {
|
|
339
351
|
'Shift-Tab': (0, _utils2.filterCommand)([_helpers.isInsideTaskOrDecisionItem, function (state) {
|
|
340
352
|
return !shouldLetTabThroughInTable(state);
|
|
341
353
|
}], function (state, dispatch) {
|
|
342
|
-
|
|
354
|
+
var _api$analytics;
|
|
355
|
+
return getUnindentCommand(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(_analytics.INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
|
|
343
356
|
}),
|
|
344
357
|
Tab: (0, _utils2.filterCommand)([_helpers.isInsideTaskOrDecisionItem, function (state) {
|
|
345
358
|
return !shouldLetTabThroughInTable(state);
|
|
346
359
|
}], function (state, dispatch) {
|
|
347
|
-
|
|
360
|
+
var _api$analytics2;
|
|
361
|
+
return getIndentCommand(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(_analytics.INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
|
|
348
362
|
})
|
|
349
363
|
};
|
|
350
364
|
var defaultHandlers = consumeTabs ? {
|
|
@@ -352,10 +366,10 @@ function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
|
352
366
|
Tab: _helpers.isInsideTaskOrDecisionItem
|
|
353
367
|
} : {};
|
|
354
368
|
var keymaps = _objectSpread((0, _defineProperty2.default)({
|
|
355
|
-
Backspace: backspace,
|
|
369
|
+
Backspace: backspace(api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions),
|
|
356
370
|
Delete: deleteForwards,
|
|
357
371
|
'Ctrl-d': deleteForwards,
|
|
358
|
-
Enter: enter
|
|
372
|
+
Enter: enter(api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)
|
|
359
373
|
}, _keymaps.toggleTaskItemCheckbox.common, cmdOptEnter), allowNestedTasks ? indentHandlers : defaultHandlers);
|
|
360
374
|
return (0, _keymap.keymap)(keymaps);
|
|
361
375
|
}
|
|
@@ -30,7 +30,8 @@ var onItemActivated = exports.onItemActivated = function onItemActivated(pluginI
|
|
|
30
30
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
31
31
|
}
|
|
32
32
|
if (node === 'taskList') {
|
|
33
|
-
|
|
33
|
+
var _pluginInjectionApi$a;
|
|
34
|
+
(0, _keymaps.getIndentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
34
35
|
}
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
@@ -45,7 +46,8 @@ var onItemActivated = exports.onItemActivated = function onItemActivated(pluginI
|
|
|
45
46
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
46
47
|
}
|
|
47
48
|
if (_node === 'taskList') {
|
|
48
|
-
|
|
49
|
+
var _pluginInjectionApi$a2;
|
|
50
|
+
(0, _keymaps.getUnindentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
49
51
|
}
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
@@ -8,9 +8,9 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _keymaps = require("./pm-plugins/keymaps");
|
|
10
10
|
var _main = require("./pm-plugins/main");
|
|
11
|
-
var _history = require("../history");
|
|
12
11
|
var _ToolbarUndoRedo = _interopRequireDefault(require("./ui/ToolbarUndoRedo"));
|
|
13
|
-
|
|
12
|
+
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
13
|
+
|
|
14
14
|
var undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
15
15
|
var api = _ref.api;
|
|
16
16
|
return {
|
|
@@ -32,20 +32,11 @@ var undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
|
32
32
|
var editorView = _ref2.editorView,
|
|
33
33
|
disabled = _ref2.disabled,
|
|
34
34
|
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing;
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var historyState = _ref3.historyState;
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(_ToolbarUndoRedo.default, {
|
|
42
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
43
|
-
disabled: disabled,
|
|
44
|
-
historyState: historyState,
|
|
45
|
-
editorView: editorView,
|
|
46
|
-
api: api
|
|
47
|
-
});
|
|
48
|
-
}
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_ToolbarUndoRedo.default, {
|
|
36
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
37
|
+
disabled: disabled,
|
|
38
|
+
editorView: editorView,
|
|
39
|
+
api: api
|
|
49
40
|
});
|
|
50
41
|
}
|
|
51
42
|
};
|
|
@@ -6,16 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.ToolbarUndoRedo = void 0;
|
|
9
|
-
var
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _react = require("react");
|
|
15
|
-
var _react2 = require("@emotion/react");
|
|
9
|
+
var _react = require("@emotion/react");
|
|
16
10
|
var _reactIntlNext = require("react-intl-next");
|
|
17
11
|
var _undo = _interopRequireDefault(require("@atlaskit/icon/glyph/undo"));
|
|
18
12
|
var _redo = _interopRequireDefault(require("@atlaskit/icon/glyph/redo"));
|
|
13
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
19
14
|
var _keymaps = require("../../../../keymaps");
|
|
20
15
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
21
16
|
var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
|
|
@@ -24,8 +19,8 @@ var _commands = require("../../commands");
|
|
|
24
19
|
var _keymaps2 = require("@atlaskit/editor-common/keymaps");
|
|
25
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
/** @jsx jsx */
|
|
23
|
+
|
|
29
24
|
var closeTypeAheadAndRunCommand = function closeTypeAheadAndRunCommand(editorView, api) {
|
|
30
25
|
return function (command) {
|
|
31
26
|
var _api$typeAhead;
|
|
@@ -51,70 +46,59 @@ var forceFocus = function forceFocus(editorView, api) {
|
|
|
51
46
|
}
|
|
52
47
|
};
|
|
53
48
|
};
|
|
54
|
-
var ToolbarUndoRedo = exports.ToolbarUndoRedo =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}),
|
|
110
|
-
testId: "ak-editor-toolbar-button-redo",
|
|
111
|
-
"aria-label": (0, _keymaps.tooltip)(_keymaps.redo, labelRedo),
|
|
112
|
-
"aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.redo)
|
|
113
|
-
}), (0, _react2.jsx)("span", {
|
|
114
|
-
css: _styles.separatorStyles
|
|
115
|
-
}));
|
|
116
|
-
}
|
|
117
|
-
}]);
|
|
118
|
-
return ToolbarUndoRedo;
|
|
119
|
-
}(_react.PureComponent);
|
|
49
|
+
var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
|
|
50
|
+
var disabled = _ref.disabled,
|
|
51
|
+
isReducedSpacing = _ref.isReducedSpacing,
|
|
52
|
+
editorView = _ref.editorView,
|
|
53
|
+
api = _ref.api,
|
|
54
|
+
formatMessage = _ref.intl.formatMessage;
|
|
55
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['history']),
|
|
56
|
+
historyState = _useSharedPluginState.historyState;
|
|
57
|
+
var handleUndo = function handleUndo() {
|
|
58
|
+
forceFocus(editorView, api)(_commands.undoFromToolbar);
|
|
59
|
+
};
|
|
60
|
+
var handleRedo = function handleRedo() {
|
|
61
|
+
forceFocus(editorView, api)(_commands.redoFromToolbar);
|
|
62
|
+
};
|
|
63
|
+
var labelUndo = formatMessage(_messages.undoRedoMessages.undo);
|
|
64
|
+
var labelRedo = formatMessage(_messages.undoRedoMessages.redo);
|
|
65
|
+
var _ref2 = historyState !== null && historyState !== void 0 ? historyState : {},
|
|
66
|
+
canUndo = _ref2.canUndo,
|
|
67
|
+
canRedo = _ref2.canRedo;
|
|
68
|
+
return (0, _react.jsx)("span", {
|
|
69
|
+
css: _styles.buttonGroupStyle
|
|
70
|
+
}, (0, _react.jsx)(_ToolbarButton.default, {
|
|
71
|
+
buttonId: _ToolbarButton.TOOLBAR_BUTTON.UNDO,
|
|
72
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
73
|
+
onClick: handleUndo,
|
|
74
|
+
disabled: !canUndo || disabled,
|
|
75
|
+
"aria-label": (0, _keymaps.tooltip)(_keymaps.undo, labelUndo),
|
|
76
|
+
"aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.undo),
|
|
77
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
78
|
+
description: labelUndo,
|
|
79
|
+
keymap: _keymaps.undo
|
|
80
|
+
}),
|
|
81
|
+
iconBefore: (0, _react.jsx)(_undo.default, {
|
|
82
|
+
label: ""
|
|
83
|
+
}),
|
|
84
|
+
testId: "ak-editor-toolbar-button-undo"
|
|
85
|
+
}), (0, _react.jsx)(_ToolbarButton.default, {
|
|
86
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
87
|
+
buttonId: _ToolbarButton.TOOLBAR_BUTTON.REDO,
|
|
88
|
+
onClick: handleRedo,
|
|
89
|
+
disabled: !canRedo || disabled,
|
|
90
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
91
|
+
description: labelRedo,
|
|
92
|
+
keymap: _keymaps.redo
|
|
93
|
+
}),
|
|
94
|
+
iconBefore: (0, _react.jsx)(_redo.default, {
|
|
95
|
+
label: ""
|
|
96
|
+
}),
|
|
97
|
+
testId: "ak-editor-toolbar-button-redo",
|
|
98
|
+
"aria-label": (0, _keymaps.tooltip)(_keymaps.redo, labelRedo),
|
|
99
|
+
"aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.redo)
|
|
100
|
+
}), (0, _react.jsx)("span", {
|
|
101
|
+
css: _styles.separatorStyles
|
|
102
|
+
}));
|
|
103
|
+
};
|
|
120
104
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(ToolbarUndoRedo);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "188.
|
|
8
|
+
var version = exports.version = "188.12.1";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, panelPlugin, placeholderTextPlugin, tasksAndDecisionsPlugin, textColorPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin,
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, panelPlugin, placeholderTextPlugin, tasksAndDecisionsPlugin, textColorPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, expandPlugin, isExpandInsertionEnabled, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../../../plugins';
|
|
2
|
+
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
2
3
|
import { statusPlugin } from '@atlaskit/editor-plugin-status';
|
|
3
4
|
import { datePlugin } from '@atlaskit/editor-plugin-date';
|
|
4
5
|
import { captionPlugin } from '@atlaskit/editor-plugin-caption';
|
|
@@ -19,6 +20,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
19
20
|
import { saveOnEnterPlugin } from '@atlaskit/editor-plugin-save-on-enter';
|
|
20
21
|
import { scrollIntoViewPlugin } from '@atlaskit/editor-plugin-scroll-into-view';
|
|
21
22
|
import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
23
|
+
import { selectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
|
22
24
|
import { isFullPage as fullPageCheck } from '../../../utils/is-full-page';
|
|
23
25
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
24
26
|
import { createDefaultPreset } from './default';
|
|
@@ -397,6 +399,16 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
397
399
|
return builder;
|
|
398
400
|
}).add([codeBidiWarningPlugin, {
|
|
399
401
|
appearance
|
|
400
|
-
}])
|
|
402
|
+
}])
|
|
403
|
+
/**
|
|
404
|
+
* Do not use this plugin - it is for AI purposes only.
|
|
405
|
+
*/.maybeAdd(selectionToolbarPlugin, (plugin, builder) => {
|
|
406
|
+
if (getBooleanFF('platform.editor.enable-selection-toolbar_ucdwd')) {
|
|
407
|
+
return builder.add([plugin, {
|
|
408
|
+
preferenceToolbarAboveSelection: false
|
|
409
|
+
}]);
|
|
410
|
+
}
|
|
411
|
+
return builder;
|
|
412
|
+
});
|
|
401
413
|
return finalPreset;
|
|
402
414
|
}
|
|
@@ -7,6 +7,7 @@ import { getPluginState } from './utils';
|
|
|
7
7
|
import { buildToolbar } from './toolbar';
|
|
8
8
|
import { InlineCommentView } from './ui/InlineCommentView';
|
|
9
9
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
10
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
const annotationPlugin = ({
|
|
11
12
|
config: annotationProviders,
|
|
12
13
|
api
|
|
@@ -53,7 +54,19 @@ const annotationPlugin = ({
|
|
|
53
54
|
}],
|
|
54
55
|
pluginsOptions: {
|
|
55
56
|
floatingToolbar(state, intl) {
|
|
56
|
-
if (!annotationProviders) {
|
|
57
|
+
if (getBooleanFF('platform.editor.enable-selection-toolbar_ucdwd') || !annotationProviders) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const pluginState = getPluginState(state);
|
|
61
|
+
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
62
|
+
const {
|
|
63
|
+
isToolbarAbove
|
|
64
|
+
} = annotationProviders.inlineComment;
|
|
65
|
+
return buildToolbar(state, intl, isToolbarAbove);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
selectionToolbar(state, intl) {
|
|
69
|
+
if (!getBooleanFF('platform.editor.enable-selection-toolbar_ucdwd') || !annotationProviders) {
|
|
57
70
|
return;
|
|
58
71
|
}
|
|
59
72
|
const pluginState = getPluginState(state);
|
|
@@ -11,6 +11,12 @@ const handleDocChanged = (tr, prevPluginState) => {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
const handleSelectionChanged = (tr, pluginState) => {
|
|
14
|
+
if (pluginState.skipSelectionHandling) {
|
|
15
|
+
return {
|
|
16
|
+
...pluginState,
|
|
17
|
+
skipSelectionHandling: false
|
|
18
|
+
};
|
|
19
|
+
}
|
|
14
20
|
const selectedAnnotations = findAnnotationsInSelection(tr.selection, tr.doc);
|
|
15
21
|
const changed = selectedAnnotations.length !== pluginState.selectedAnnotations.length || selectedAnnotations.some(annotationInfo => {
|
|
16
22
|
return !pluginState.selectedAnnotations.some(aInfo => aInfo.type === annotationInfo.id);
|
|
@@ -54,7 +54,8 @@ export default ((pluginState, action) => {
|
|
|
54
54
|
case ACTIONS.SET_SELECTED_ANNOTATION:
|
|
55
55
|
return {
|
|
56
56
|
...pluginState,
|
|
57
|
-
selectedAnnotations: [...action.data.selectedAnnotations]
|
|
57
|
+
selectedAnnotations: [...action.data.selectedAnnotations],
|
|
58
|
+
skipSelectionHandling: true
|
|
58
59
|
};
|
|
59
60
|
default:
|
|
60
61
|
return pluginState;
|