@atlaskit/editor-core 187.8.3 → 187.8.7
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 +8 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +4 -5
- package/dist/cjs/plugins/annotation/commands/transform.js +2 -2
- package/dist/cjs/plugins/block-type/commands/block-type.js +2 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -2
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -2
- package/dist/cjs/plugins/text-color/commands/toggle-color.js +2 -2
- package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +9 -9
- package/dist/cjs/plugins/text-formatting/commands/transform-to-code.js +2 -2
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -5
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +2 -2
- package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +2 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +2 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +2 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +5 -6
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +5 -5
- package/dist/cjs/ui/Dropdown/index.js +1 -2
- package/dist/cjs/ui/styles.js +3 -5
- package/dist/cjs/utils/commands.js +8 -121
- package/dist/cjs/utils/index.js +0 -13
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -6
- package/dist/es2019/plugins/annotation/commands/transform.js +1 -1
- package/dist/es2019/plugins/block-type/commands/block-type.js +1 -1
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -5
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
- package/dist/es2019/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +1 -1
- package/dist/es2019/plugins/text-formatting/commands/transform-to-code.js +1 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +6 -5
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +3 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/es2019/ui/Dropdown/index.js +1 -2
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/es2019/ui/styles.js +0 -5
- package/dist/es2019/utils/commands.js +1 -113
- package/dist/es2019/utils/index.js +0 -12
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +3 -6
- package/dist/esm/plugins/annotation/commands/transform.js +1 -1
- package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -5
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
- package/dist/esm/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/esm/plugins/text-formatting/commands/text-formatting.js +1 -1
- package/dist/esm/plugins/text-formatting/commands/transform-to-code.js +1 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +4 -5
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/esm/ui/Dropdown/index.js +1 -2
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/esm/ui/styles.js +2 -3
- package/dist/esm/utils/commands.js +7 -118
- package/dist/esm/utils/index.js +0 -12
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types/plugins/block-type/commands/block-type.d.ts +1 -2
- package/dist/types/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
- package/dist/types/plugins/text-color/commands/toggle-color.d.ts +1 -1
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +4 -4
- package/dist/types/types/editor-instance.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +5 -8
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +2 -2
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +1 -1
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types/utils/commands.d.ts +2 -12
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +1 -2
- package/dist/types-ts4.5/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-color/commands/toggle-color.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-appearance-component.d.ts +4 -4
- package/dist/types-ts4.5/types/editor-instance.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +5 -8
- package/dist/types-ts4.5/ui/Appearance/Comment/Comment.d.ts +2 -2
- package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +1 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types-ts4.5/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
- package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +1 -1
- package/dist/types-ts4.5/ui/styles.d.ts +0 -1
- package/dist/types-ts4.5/utils/commands.d.ts +2 -12
- package/dist/types-ts4.5/utils/index.d.ts +0 -4
- package/package.json +3 -3
- package/report.api.md +2 -10
- package/tmp/api-report-tmp.d.ts +2 -7
- package/dist/cjs/ui/Appearance/FullPage/messages.js +0 -25
- package/dist/cjs/ui/DropdownMenu/index.js +0 -31
- package/dist/cjs/ui/DropdownMenu/types.js +0 -5
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -218
- package/dist/es2019/ui/Appearance/FullPage/messages.js +0 -18
- package/dist/es2019/ui/DropdownMenu/index.js +0 -18
- package/dist/es2019/ui/DropdownMenu/types.js +0 -1
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
- package/dist/esm/ui/Appearance/FullPage/messages.js +0 -18
- package/dist/esm/ui/DropdownMenu/index.js +0 -20
- package/dist/esm/ui/DropdownMenu/types.js +0 -1
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
- package/dist/types/ui/Appearance/FullPage/messages.d.ts +0 -18
- package/dist/types/ui/DropdownMenu/index.d.ts +0 -3
- package/dist/types/ui/DropdownMenu/types.d.ts +0 -1
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +0 -31
- package/dist/types-ts4.5/ui/Appearance/FullPage/messages.d.ts +0 -18
- package/dist/types-ts4.5/ui/DropdownMenu/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/DropdownMenu/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +0 -31
|
@@ -4,13 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.deleteEmptyParagraphAndMoveBlockUp =
|
|
7
|
+
exports.deleteEmptyParagraphAndMoveBlockUp = void 0;
|
|
8
8
|
exports.findCutBefore = findCutBefore;
|
|
9
|
-
exports.withScrollIntoView = exports.walkPrevNode = exports.walkNextNode = exports.
|
|
9
|
+
exports.withScrollIntoView = exports.walkPrevNode = exports.walkNextNode = exports.selectNode = exports.isNthParentOfType = exports.isFirstChildOfParent = exports.isEmptySelectionAtStart = exports.isEmptySelectionAtEnd = exports.insertContentDeleteRange = void 0;
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
|
-
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
13
|
-
var _transformToCode = require("../plugins/text-formatting/commands/transform-to-code");
|
|
14
12
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
15
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
14
|
var isEmptySelectionAtStart = function isEmptySelectionAtStart(state) {
|
|
@@ -73,117 +71,6 @@ function findCutBefore($pos) {
|
|
|
73
71
|
}
|
|
74
72
|
return null;
|
|
75
73
|
}
|
|
76
|
-
var applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, mark, tr) {
|
|
77
|
-
var schema = tr.doc.type.schema;
|
|
78
|
-
var code = schema.marks.code;
|
|
79
|
-
if (mark.type === code) {
|
|
80
|
-
(0, _transformToCode.transformSmartCharsMentionsAndEmojis)(from, to, tr);
|
|
81
|
-
}
|
|
82
|
-
tr.doc.nodesBetween(tr.mapping.map(from), tr.mapping.map(to), function (node, pos) {
|
|
83
|
-
if (!node.isText) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// This is an issue when the user selects some text.
|
|
88
|
-
// We need to check if the current node position is less than the range selection from.
|
|
89
|
-
// If it’s true, that means we should apply the mark using the range selection,
|
|
90
|
-
// not the current node position.
|
|
91
|
-
var nodeBetweenFrom = Math.max(pos, tr.mapping.map(from));
|
|
92
|
-
var nodeBetweenTo = Math.min(pos + node.nodeSize, tr.mapping.map(to));
|
|
93
|
-
if (removeMark) {
|
|
94
|
-
tr.removeMark(nodeBetweenFrom, nodeBetweenTo, mark);
|
|
95
|
-
} else {
|
|
96
|
-
tr.addMark(nodeBetweenFrom, nodeBetweenTo, mark);
|
|
97
|
-
}
|
|
98
|
-
return true;
|
|
99
|
-
});
|
|
100
|
-
return tr;
|
|
101
|
-
};
|
|
102
|
-
exports.applyMarkOnRange = applyMarkOnRange;
|
|
103
|
-
var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos) {
|
|
104
|
-
var onlyContainsMark = true;
|
|
105
|
-
doc.nodesBetween(fromPos, toPos, function (node) {
|
|
106
|
-
// Skip recursion once we've found text which doesn't include the mark
|
|
107
|
-
if (!onlyContainsMark) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
if (node.isText) {
|
|
111
|
-
onlyContainsMark && (onlyContainsMark = mark.isInSet(node.marks));
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
return onlyContainsMark;
|
|
115
|
-
};
|
|
116
|
-
var toggleMarkInRange = function toggleMarkInRange(mark) {
|
|
117
|
-
return function (state, dispatch) {
|
|
118
|
-
var tr = state.tr;
|
|
119
|
-
if (state.selection instanceof _cellSelection.CellSelection) {
|
|
120
|
-
var removeMark = true;
|
|
121
|
-
var cells = [];
|
|
122
|
-
state.selection.forEachCell(function (cell, cellPos) {
|
|
123
|
-
cells.push({
|
|
124
|
-
node: cell,
|
|
125
|
-
pos: cellPos
|
|
126
|
-
});
|
|
127
|
-
var from = cellPos;
|
|
128
|
-
var to = cellPos + cell.nodeSize;
|
|
129
|
-
removeMark && (removeMark = entireSelectionContainsMark(mark, state.doc, from, to));
|
|
130
|
-
});
|
|
131
|
-
for (var i = cells.length - 1; i >= 0; i--) {
|
|
132
|
-
var cell = cells[i];
|
|
133
|
-
var from = cell.pos;
|
|
134
|
-
var to = from + cell.node.nodeSize;
|
|
135
|
-
applyMarkOnRange(from, to, removeMark, mark, tr);
|
|
136
|
-
}
|
|
137
|
-
} else {
|
|
138
|
-
var _state$selection3 = state.selection,
|
|
139
|
-
$from = _state$selection3.$from,
|
|
140
|
-
$to = _state$selection3.$to;
|
|
141
|
-
// We decide to remove the mark only if the entire selection contains the mark
|
|
142
|
-
// Examples with *bold* text
|
|
143
|
-
// Scenario 1: Selection contains both bold and non-bold text -> bold entire selection
|
|
144
|
-
// Scenario 2: Selection contains only bold text -> un-bold entire selection
|
|
145
|
-
// Scenario 3: Selection contains no bold text -> bold entire selection
|
|
146
|
-
var _removeMark = entireSelectionContainsMark(mark, state.doc, $from.pos, $to.pos);
|
|
147
|
-
applyMarkOnRange($from.pos, $to.pos, _removeMark, mark, tr);
|
|
148
|
-
}
|
|
149
|
-
if (tr.docChanged) {
|
|
150
|
-
if (dispatch) {
|
|
151
|
-
dispatch(tr);
|
|
152
|
-
}
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
|
-
return false;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* A wrapper over the default toggleMark, except when we have a selection
|
|
161
|
-
* we only toggle marks on text nodes rather than inline nodes.
|
|
162
|
-
* @param markType
|
|
163
|
-
* @param attrs
|
|
164
|
-
*/
|
|
165
|
-
var toggleMark = function toggleMark(markType, attrs) {
|
|
166
|
-
return function (state, dispatch) {
|
|
167
|
-
var mark = markType.create(attrs);
|
|
168
|
-
|
|
169
|
-
// For cursor selections we can use the default behaviour.
|
|
170
|
-
if (state.selection instanceof _state.TextSelection && state.selection.$cursor) {
|
|
171
|
-
var tr = state.tr;
|
|
172
|
-
if (mark.isInSet(state.storedMarks || state.selection.$cursor.marks())) {
|
|
173
|
-
tr.removeStoredMark(mark);
|
|
174
|
-
} else {
|
|
175
|
-
tr.addStoredMark(mark);
|
|
176
|
-
}
|
|
177
|
-
if (dispatch) {
|
|
178
|
-
dispatch(tr);
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
return toggleMarkInRange(mark)(state, dispatch);
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
exports.toggleMark = toggleMark;
|
|
187
74
|
var withScrollIntoView = function withScrollIntoView(command) {
|
|
188
75
|
return function (state, dispatch, view) {
|
|
189
76
|
return command(state, function (tr) {
|
|
@@ -280,12 +167,12 @@ var selectNode = function selectNode(pos) {
|
|
|
280
167
|
exports.selectNode = selectNode;
|
|
281
168
|
var deleteEmptyParagraphAndMoveBlockUp = function deleteEmptyParagraphAndMoveBlockUp(canNextNodeMoveUp) {
|
|
282
169
|
return function (state, dispatch, view) {
|
|
283
|
-
var _state$
|
|
284
|
-
_state$
|
|
285
|
-
pos = _state$
|
|
286
|
-
parent = _state$
|
|
287
|
-
$head = _state$
|
|
288
|
-
empty = _state$
|
|
170
|
+
var _state$selection3 = state.selection,
|
|
171
|
+
_state$selection3$$fr = _state$selection3.$from,
|
|
172
|
+
pos = _state$selection3$$fr.pos,
|
|
173
|
+
parent = _state$selection3$$fr.parent,
|
|
174
|
+
$head = _state$selection3.$head,
|
|
175
|
+
empty = _state$selection3.empty,
|
|
289
176
|
tr = state.tr,
|
|
290
177
|
doc = state.doc;
|
|
291
178
|
var _walkNextNode = walkNextNode($head),
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -16,7 +16,6 @@ exports.canMoveUp = canMoveUp;
|
|
|
16
16
|
exports.checkNodeDown = checkNodeDown;
|
|
17
17
|
exports.compose = compose;
|
|
18
18
|
exports.dedupe = dedupe;
|
|
19
|
-
exports.filterChildrenBetween = filterChildrenBetween;
|
|
20
19
|
Object.defineProperty(exports, "findFarthestParentNode", {
|
|
21
20
|
enumerable: true,
|
|
22
21
|
get: function get() {
|
|
@@ -436,18 +435,6 @@ var isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
|
436
435
|
return (0, _utils.hasParentNodeOfType)(blockquote)(state.selection);
|
|
437
436
|
};
|
|
438
437
|
exports.isInsideBlockQuote = isInsideBlockQuote;
|
|
439
|
-
function filterChildrenBetween(doc, from, to, predicate) {
|
|
440
|
-
var results = [];
|
|
441
|
-
doc.nodesBetween(from, to, function (node, pos, parent) {
|
|
442
|
-
if (predicate(node, pos, parent)) {
|
|
443
|
-
results.push({
|
|
444
|
-
node: node,
|
|
445
|
-
pos: pos
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
return results;
|
|
450
|
-
}
|
|
451
438
|
function dedupe() {
|
|
452
439
|
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
453
440
|
var iteratee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (p) {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.8.
|
|
9
|
+
var version = "187.8.7";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -4,10 +4,9 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { editorMessages } from './messages';
|
|
7
|
-
import { browser, getAnalyticsEventSeverity, getResponseEndTime, measureRender, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { browser, getAnalyticsEventSeverity, getResponseEndTime, measureRender, startMeasure, stopMeasure, shouldForceTracking, processRawValue, analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { ExperienceStore, EditorExperience, RELIABILITY_INTERVAL } from '@atlaskit/editor-common/ufo';
|
|
9
9
|
import { createDispatch, EventDispatcher } from '../event-dispatcher';
|
|
10
|
-
import { processRawValue } from '@atlaskit/editor-common/utils';
|
|
11
10
|
import { freezeUnsafeTransactionProperties } from '../utils/performance/safer-transactions';
|
|
12
11
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
13
12
|
import { findChangedNodesFromTransaction, validateNodes, validNode } from '../utils/nodes';
|
|
@@ -19,17 +18,16 @@ import { getDocStructure } from '../utils/document-logger';
|
|
|
19
18
|
import { isFullPage } from '../utils/is-full-page';
|
|
20
19
|
import measurements from '../utils/performance/measure-enum';
|
|
21
20
|
import { getNodesCount } from '../utils/document';
|
|
22
|
-
import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
23
21
|
import { createSchema } from './create-schema';
|
|
24
22
|
import { PluginPerformanceObserver } from '../utils/performance/plugin-performance-observer';
|
|
25
23
|
import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
|
|
24
|
+
import { EVENT_NAME_DISPATCH_TRANSACTION, EVENT_NAME_STATE_APPLY, EVENT_NAME_UPDATE_STATE, EVENT_NAME_VIEW_STATE_UPDATED, EVENT_NAME_ON_CHANGE, TransactionTracker } from '../utils/performance/track-transactions';
|
|
26
25
|
import { countNodes } from '../utils/count-nodes';
|
|
27
|
-
import { TransactionTracker } from '../utils/performance/track-transactions';
|
|
28
|
-
import { EVENT_NAME_DISPATCH_TRANSACTION, EVENT_NAME_STATE_APPLY, EVENT_NAME_UPDATE_STATE, EVENT_NAME_VIEW_STATE_UPDATED, EVENT_NAME_ON_CHANGE } from '../utils/performance/track-transactions';
|
|
29
26
|
import { PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, DEFAULT_SAMPLING_RATE_VALID_TRANSACTIONS } from './consts';
|
|
30
27
|
import { getContextIdentifier } from '../plugins/base/pm-plugins/context-identifier';
|
|
31
28
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
32
29
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
30
|
+
import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
|
|
33
31
|
function handleEditorFocus(view) {
|
|
34
32
|
if (view.hasFocus()) {
|
|
35
33
|
return;
|
|
@@ -67,7 +65,6 @@ function handleEditorFocus(view) {
|
|
|
67
65
|
view.focus();
|
|
68
66
|
}, 0);
|
|
69
67
|
}
|
|
70
|
-
export const EDIT_AREA_ID = 'ak-editor-textarea';
|
|
71
68
|
export class ReactEditorView extends React.Component {
|
|
72
69
|
get transactionTracking() {
|
|
73
70
|
var _this$props$editorPro, _this$props$editorPro2;
|
|
@@ -3,7 +3,7 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
|
3
3
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addAnalytics } from '../../analytics/utils';
|
|
5
5
|
import { getSelectionPositions, getPluginState, getDraftCommandAnalyticsPayload } from '../utils';
|
|
6
|
-
import { applyMarkOnRange } from '
|
|
6
|
+
import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
7
7
|
const addAnnotationMark = id => (transaction, state) => {
|
|
8
8
|
const inlineCommentState = getPluginState(state);
|
|
9
9
|
const {
|
|
@@ -6,7 +6,7 @@ import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/
|
|
|
6
6
|
import { withAnalytics as withAnalyticsDeprecated } from '../../analytics';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
9
|
-
import { filterChildrenBetween } from '
|
|
9
|
+
import { filterChildrenBetween } from '@atlaskit/editor-common/mark';
|
|
10
10
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
11
11
|
import { CellSelection } from '@atlaskit/editor-tables';
|
|
12
12
|
import { transformToCodeBlockAction } from './transform-to-code-block';
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { injectIntl } from 'react-intl-next';
|
|
6
6
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import DropdownMenu from '
|
|
7
|
+
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
import { separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { blockTypeMenuItemStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
|
|
10
10
|
import { tooltip, findKeymapByDescription } from '../../../../keymaps';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
|
-
import { Component } from 'react';
|
|
7
6
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
8
7
|
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
9
8
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -11,7 +10,7 @@ import { borderRadius } from '@atlaskit/theme/constants';
|
|
|
11
10
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
12
11
|
import { compareArrays, shallowEqual } from '../utils';
|
|
13
12
|
import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
14
|
-
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
13
|
+
import { FloatingToolbarButton as Button, Announcer } from '@atlaskit/editor-common/ui';
|
|
15
14
|
import Dropdown from './Dropdown';
|
|
16
15
|
import Select from './Select';
|
|
17
16
|
import Separator from './Separator';
|
|
@@ -20,12 +19,11 @@ import { ExtensionsPlaceholder } from './ExtensionsPlaceholder';
|
|
|
20
19
|
import ColorPickerButton from '../../../ui/ColorPickerButton';
|
|
21
20
|
import { backgroundPaletteTooltipMessages } from '../../../ui/ColorPalette';
|
|
22
21
|
import { EmojiPickerButton } from './EmojiPickerButton';
|
|
23
|
-
import { Announcer } from '@atlaskit/editor-common/ui';
|
|
24
22
|
import { injectIntl } from 'react-intl-next';
|
|
25
23
|
import messages from './messages';
|
|
26
24
|
import { clearHoverSelection } from '@atlaskit/editor-plugin-table/commands';
|
|
27
25
|
import ScrollButtons from './ScrollButtons';
|
|
28
|
-
import { ToolbarArrowKeyNavigationProvider } from '
|
|
26
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
29
27
|
import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
|
|
30
28
|
const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
31
29
|
items,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import DropdownMenu from '
|
|
3
|
+
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
4
4
|
import { DropDownButton } from './dropdown-button';
|
|
5
5
|
export const BlockInsertMenuLegacy = props => {
|
|
6
6
|
const {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toggleMark } from '
|
|
1
|
+
import { toggleMark } from '@atlaskit/editor-common/mark';
|
|
2
2
|
import { ACTIONS, pluginKey } from '../pm-plugins/main';
|
|
3
3
|
import { getDisabledState } from '../utils/disabled';
|
|
4
4
|
export const toggleColor = color => (state, dispatch) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { applyMarkOnRange, toggleMark } from '
|
|
2
|
+
import { applyMarkOnRange, toggleMark } from '@atlaskit/editor-common/mark';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { hasCode, markActive } from '../utils';
|
|
5
5
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { checkFormattingIsPresent } from '../utils';
|
|
4
4
|
export const pluginKey = new PluginKey('clearFormattingPlugin');
|
|
5
|
-
export const plugin = dispatch => new
|
|
5
|
+
export const plugin = dispatch => new SafePlugin({
|
|
6
6
|
state: {
|
|
7
7
|
init(_config, state) {
|
|
8
8
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ruleWithAnalytics } from '../../../utils/input-rules';
|
|
2
2
|
import { createRule, createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { transformSmartCharsMentionsAndEmojis } from '
|
|
4
|
+
import { transformSmartCharsMentionsAndEmojis } from '@atlaskit/editor-common/mark';
|
|
5
5
|
var ValidAutoformatChars = /*#__PURE__*/function (ValidAutoformatChars) {
|
|
6
6
|
ValidAutoformatChars["STRONG"] = "__";
|
|
7
7
|
ValidAutoformatChars["STRIKE"] = "~~";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
// TODO: Ideally this should use the custom toggleMark function from @atlaskit/editor-common so we also disable the options when selecting inline nodes but it disables the marks when the selection is empty at this point in time which is undesirable
|
|
2
|
+
// import { toggleMark } from '@atlaskit/editor-common/mark';
|
|
1
3
|
import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
2
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
5
|
import * as keymaps from '@atlaskit/editor-common/keymaps';
|
|
4
6
|
import { shallowEqual } from '@atlaskit/editor-common/utils';
|
|
5
7
|
import { createInlineCodeFromTextInputWithAnalytics } from '../commands/text-formatting';
|
|
6
|
-
// eslint-disable-next-line no-duplicate-imports
|
|
7
8
|
import * as commands from '../commands/text-formatting';
|
|
8
9
|
import { anyMarkActive } from '../utils';
|
|
9
10
|
import { pluginKey } from './plugin-key';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import DropdownMenu from '
|
|
3
|
+
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
4
4
|
import { useMenuState } from './hooks/menu-state';
|
|
5
5
|
import { MoreButton } from './more-button';
|
|
6
6
|
export const FormattingTextDropdownMenu = /*#__PURE__*/React.memo(({
|
|
@@ -8,9 +8,8 @@ import { toolbarMessages } from '../toolbar-messages';
|
|
|
8
8
|
import * as commands from '../../../commands/text-formatting';
|
|
9
9
|
import { TOOLBAR_ACTION_SUBJECT_ID, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { pluginKey as textFormattingPluginKey } from '../../../pm-plugins/plugin-key';
|
|
11
|
-
import { toggleCode, toggleStrikethrough, toggleUnderline, tooltip, toggleBold, toggleItalic, toggleSubscript, toggleSuperscript, ToolTipContent } from '
|
|
11
|
+
import { toggleCode, toggleStrikethrough, toggleUnderline, tooltip, toggleBold, toggleItalic, toggleSubscript, toggleSuperscript, ToolTipContent, getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
12
12
|
import { IconTypes } from '../types';
|
|
13
|
-
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
14
13
|
const withToolbarInputMethod = func => func({
|
|
15
14
|
inputMethod: INPUT_METHOD.TOOLBAR
|
|
16
15
|
});
|
|
@@ -5,7 +5,7 @@ import { useIntl } from 'react-intl-next';
|
|
|
5
5
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
6
6
|
import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
|
|
7
7
|
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, tooltip } from '../../../keymaps';
|
|
8
|
-
import DropdownMenu from '
|
|
8
|
+
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
9
9
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
10
10
|
import { expandIconWrapperStyle, shortcutStyle } from '../../../ui/styles';
|
|
11
11
|
import { wrapperStyle, separatorStyles } from '@atlaskit/editor-common/styles';
|
|
@@ -22,15 +22,15 @@ import { injectIntl } from 'react-intl-next';
|
|
|
22
22
|
import messages from '../../../messages';
|
|
23
23
|
import { TableControlsPadding, MainToolbar, mainToolbarCustomComponentsSlotStyle } from './Toolbar';
|
|
24
24
|
import { createEditorContentStyle } from '../../ContentStyles';
|
|
25
|
-
import { ToolbarArrowKeyNavigationProvider } from '
|
|
25
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
26
26
|
const CommentEditorMargin = 14;
|
|
27
|
-
const CommentEditorSmallerMargin = 8;
|
|
28
27
|
const commentEditorStyle = css`
|
|
29
28
|
display: flex;
|
|
30
29
|
flex-direction: column;
|
|
31
30
|
|
|
32
31
|
.less-margin .ProseMirror {
|
|
33
|
-
margin:
|
|
32
|
+
margin: ${"var(--ds-space-150, 12px)"} ${"var(--ds-space-100, 8px)"}
|
|
33
|
+
${"var(--ds-space-100, 8px)"};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
min-width: 272px;
|
|
@@ -55,7 +55,8 @@ const ContentArea = createEditorContentStyle(css`
|
|
|
55
55
|
/** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/
|
|
56
56
|
/** Hack for table controls. Otherwise margin collapse and controls are misplaced. **/
|
|
57
57
|
.ProseMirror {
|
|
58
|
-
margin:
|
|
58
|
+
margin: ${"var(--ds-space-150, 12px)"} ${CommentEditorMargin}px
|
|
59
|
+
${CommentEditorMargin}px;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
.gridParent {
|
|
@@ -74,7 +75,7 @@ const secondaryToolbarStyle = css`
|
|
|
74
75
|
justify-content: flex-end;
|
|
75
76
|
align-items: center;
|
|
76
77
|
display: flex;
|
|
77
|
-
padding: 12px 1px;
|
|
78
|
+
padding: ${"var(--ds-space-150, 12px)"} 1px;
|
|
78
79
|
`;
|
|
79
80
|
class Editor extends React.Component {
|
|
80
81
|
constructor(props) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
|
|
2
3
|
import React, { useEffect, useState } from 'react';
|
|
3
4
|
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { N30 } from '@atlaskit/theme/colors';
|
|
@@ -12,7 +13,7 @@ const mainToolbarWrapperStyle = css`
|
|
|
12
13
|
height: auto;
|
|
13
14
|
background-color: ${"var(--ds-surface, white)"};
|
|
14
15
|
box-shadow: none;
|
|
15
|
-
padding-left: ${
|
|
16
|
+
padding-left: ${"var(--ds-space-250, 20px)"};
|
|
16
17
|
|
|
17
18
|
& > div {
|
|
18
19
|
> :first-child:not(style),
|
|
@@ -106,7 +107,7 @@ export const mainToolbarCustomComponentsSlotStyle = css`
|
|
|
106
107
|
justify-content: flex-end;
|
|
107
108
|
align-items: center;
|
|
108
109
|
flex-grow: 1;
|
|
109
|
-
padding-right: ${
|
|
110
|
+
padding-right: ${"var(--ds-space-250, 20px)"};
|
|
110
111
|
> div {
|
|
111
112
|
display: flex;
|
|
112
113
|
flex-shrink: 0;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx, useTheme } from '@emotion/react';
|
|
3
|
-
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
4
|
-
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
3
|
+
import { WidthConsumer, ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
5
4
|
import React, { useImperativeHandle, useRef } from 'react';
|
|
6
5
|
import { injectIntl } from 'react-intl-next';
|
|
7
6
|
import { ClickAreaBlock } from '../../Addon';
|
|
8
7
|
import ContextPanel from '../../ContextPanel';
|
|
9
8
|
import PluginSlot from '../../PluginSlot';
|
|
10
9
|
import { contentArea, editorContentAreaStyle, sidebarArea, ScrollContainer, editorContentGutterStyle, positionedOverEditorStyle } from './StyledComponents';
|
|
11
|
-
import messages from '
|
|
10
|
+
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
11
|
export const CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
|
|
13
12
|
const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
14
13
|
const theme = useTheme();
|
|
@@ -9,8 +9,8 @@ import { BeforePrimaryToolbarWrapper } from '../../../plugins/before-primaryTool
|
|
|
9
9
|
import Toolbar from '../../Toolbar';
|
|
10
10
|
import { mainToolbarStyle, mainToolbarIconBeforeStyle, mainToolbarFirstChildStyle, mainToolbarSecondChildStyle, nonCustomToolbarWrapperStyle, customToolbarWrapperStyle, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
|
|
11
11
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
12
|
-
import messages from '
|
|
13
|
-
import { ToolbarArrowKeyNavigationProvider } from '
|
|
12
|
+
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
14
14
|
export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
15
15
|
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5, _props$featureFlags6;
|
|
16
16
|
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { Dropdown as DropdownComponent } from '@atlaskit/editor-common/ui-menu';
|
|
2
|
+
import { Dropdown as DropdownComponent, KeyDownHandlerContext } from '@atlaskit/editor-common/ui-menu';
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
|
-
import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
|
|
5
4
|
const Dropdown = /*#__PURE__*/React.memo(({
|
|
6
5
|
...props
|
|
7
6
|
}) => {
|
package/dist/es2019/ui/styles.js
CHANGED