@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.
Files changed (151) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/create-editor/ReactEditorViewInternal.js +4 -5
  3. package/dist/cjs/plugins/annotation/commands/transform.js +2 -2
  4. package/dist/cjs/plugins/block-type/commands/block-type.js +2 -2
  5. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -2
  6. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -2
  7. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -2
  8. package/dist/cjs/plugins/text-color/commands/toggle-color.js +2 -2
  9. package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +9 -9
  10. package/dist/cjs/plugins/text-formatting/commands/transform-to-code.js +2 -2
  11. package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -5
  12. package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +2 -2
  13. package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +2 -1
  14. package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +2 -2
  15. package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +2 -3
  16. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
  17. package/dist/cjs/ui/Appearance/Comment/Comment.js +5 -6
  18. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +2 -2
  19. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -2
  20. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +5 -5
  21. package/dist/cjs/ui/Dropdown/index.js +1 -2
  22. package/dist/cjs/ui/styles.js +3 -5
  23. package/dist/cjs/utils/commands.js +8 -121
  24. package/dist/cjs/utils/index.js +0 -13
  25. package/dist/cjs/version-wrapper.js +1 -1
  26. package/dist/cjs/version.json +1 -1
  27. package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -6
  28. package/dist/es2019/plugins/annotation/commands/transform.js +1 -1
  29. package/dist/es2019/plugins/block-type/commands/block-type.js +1 -1
  30. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
  31. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -5
  32. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
  33. package/dist/es2019/plugins/text-color/commands/toggle-color.js +1 -1
  34. package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +1 -1
  35. package/dist/es2019/plugins/text-formatting/commands/transform-to-code.js +1 -1
  36. package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
  37. package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
  38. package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +2 -1
  39. package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
  40. package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
  41. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
  42. package/dist/es2019/ui/Appearance/Comment/Comment.js +6 -5
  43. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +3 -2
  44. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
  45. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
  46. package/dist/es2019/ui/Dropdown/index.js +1 -2
  47. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
  48. package/dist/es2019/ui/styles.js +0 -5
  49. package/dist/es2019/utils/commands.js +1 -113
  50. package/dist/es2019/utils/index.js +0 -12
  51. package/dist/es2019/version-wrapper.js +1 -1
  52. package/dist/es2019/version.json +1 -1
  53. package/dist/esm/create-editor/ReactEditorViewInternal.js +3 -6
  54. package/dist/esm/plugins/annotation/commands/transform.js +1 -1
  55. package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
  56. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
  57. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -5
  58. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
  59. package/dist/esm/plugins/text-color/commands/toggle-color.js +1 -1
  60. package/dist/esm/plugins/text-formatting/commands/text-formatting.js +1 -1
  61. package/dist/esm/plugins/text-formatting/commands/transform-to-code.js +1 -1
  62. package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
  63. package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
  64. package/dist/esm/plugins/text-formatting/pm-plugins/main.js +2 -1
  65. package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
  66. package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
  67. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
  68. package/dist/esm/ui/Appearance/Comment/Comment.js +4 -5
  69. package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
  70. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
  71. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
  72. package/dist/esm/ui/Dropdown/index.js +1 -2
  73. package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
  74. package/dist/esm/ui/styles.js +2 -3
  75. package/dist/esm/utils/commands.js +7 -118
  76. package/dist/esm/utils/index.js +0 -12
  77. package/dist/esm/version-wrapper.js +1 -1
  78. package/dist/esm/version.json +1 -1
  79. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +0 -1
  80. package/dist/types/plugins/block-type/commands/block-type.d.ts +1 -2
  81. package/dist/types/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
  82. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
  83. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
  84. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
  85. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
  86. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
  87. package/dist/types/plugins/text-color/commands/toggle-color.d.ts +1 -1
  88. package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
  89. package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  90. package/dist/types/types/editor-appearance-component.d.ts +4 -4
  91. package/dist/types/types/editor-instance.d.ts +1 -1
  92. package/dist/types/types/editor-props.d.ts +5 -8
  93. package/dist/types/ui/Appearance/Comment/Comment.d.ts +2 -2
  94. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
  95. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  96. package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
  97. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  98. package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -1
  99. package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
  100. package/dist/types/ui/ElementBrowser/types.d.ts +1 -1
  101. package/dist/types/ui/styles.d.ts +0 -1
  102. package/dist/types/utils/commands.d.ts +2 -12
  103. package/dist/types/utils/index.d.ts +0 -4
  104. package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +0 -1
  105. package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +1 -2
  106. package/dist/types-ts4.5/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
  107. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
  108. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
  109. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
  110. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
  111. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
  112. package/dist/types-ts4.5/plugins/text-color/commands/toggle-color.d.ts +1 -1
  113. package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
  114. package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  115. package/dist/types-ts4.5/types/editor-appearance-component.d.ts +4 -4
  116. package/dist/types-ts4.5/types/editor-instance.d.ts +1 -1
  117. package/dist/types-ts4.5/types/editor-props.d.ts +5 -8
  118. package/dist/types-ts4.5/ui/Appearance/Comment/Comment.d.ts +2 -2
  119. package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +1 -2
  120. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  121. package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +1 -1
  122. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  123. package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +1 -1
  124. package/dist/types-ts4.5/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
  125. package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +1 -1
  126. package/dist/types-ts4.5/ui/styles.d.ts +0 -1
  127. package/dist/types-ts4.5/utils/commands.d.ts +2 -12
  128. package/dist/types-ts4.5/utils/index.d.ts +0 -4
  129. package/package.json +3 -3
  130. package/report.api.md +2 -10
  131. package/tmp/api-report-tmp.d.ts +2 -7
  132. package/dist/cjs/ui/Appearance/FullPage/messages.js +0 -25
  133. package/dist/cjs/ui/DropdownMenu/index.js +0 -31
  134. package/dist/cjs/ui/DropdownMenu/types.js +0 -5
  135. package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -218
  136. package/dist/es2019/ui/Appearance/FullPage/messages.js +0 -18
  137. package/dist/es2019/ui/DropdownMenu/index.js +0 -18
  138. package/dist/es2019/ui/DropdownMenu/types.js +0 -1
  139. package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
  140. package/dist/esm/ui/Appearance/FullPage/messages.js +0 -18
  141. package/dist/esm/ui/DropdownMenu/index.js +0 -20
  142. package/dist/esm/ui/DropdownMenu/types.js +0 -1
  143. package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
  144. package/dist/types/ui/Appearance/FullPage/messages.d.ts +0 -18
  145. package/dist/types/ui/DropdownMenu/index.d.ts +0 -3
  146. package/dist/types/ui/DropdownMenu/types.d.ts +0 -1
  147. package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +0 -31
  148. package/dist/types-ts4.5/ui/Appearance/FullPage/messages.d.ts +0 -18
  149. package/dist/types-ts4.5/ui/DropdownMenu/index.d.ts +0 -3
  150. package/dist/types-ts4.5/ui/DropdownMenu/types.d.ts +0 -1
  151. 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 = exports.applyMarkOnRange = void 0;
7
+ exports.deleteEmptyParagraphAndMoveBlockUp = void 0;
8
8
  exports.findCutBefore = findCutBefore;
9
- exports.withScrollIntoView = exports.walkPrevNode = exports.walkNextNode = exports.toggleMark = exports.selectNode = exports.isNthParentOfType = exports.isFirstChildOfParent = exports.isEmptySelectionAtStart = exports.isEmptySelectionAtEnd = exports.insertContentDeleteRange = void 0;
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$selection4 = state.selection,
284
- _state$selection4$$fr = _state$selection4.$from,
285
- pos = _state$selection4$$fr.pos,
286
- parent = _state$selection4$$fr.parent,
287
- $head = _state$selection4.$head,
288
- empty = _state$selection4.empty,
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),
@@ -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.3";
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('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.8.3",
3
+ "version": "187.8.7",
4
4
  "sideEffects": false
5
5
  }
@@ -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 '../../../utils/commands';
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 '../../../utils';
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 '../../../../ui/DropdownMenu';
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 '../../../ui/ToolbarArrowKeyNavigationProvider';
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 '../../../../ui/DropdownMenu';
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 '../../../utils/commands';
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 '../../../utils/commands';
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,4 +1,4 @@
1
- import { filterChildrenBetween } from '../../../utils';
1
+ import { filterChildrenBetween } from '@atlaskit/editor-common/mark';
2
2
  const SMART_TO_ASCII = {
3
3
  '…': '...',
4
4
  '→': '->',
@@ -1,8 +1,8 @@
1
- import * as safePlugin from '@atlaskit/editor-common/safe-plugin';
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 safePlugin.SafePlugin({
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 '../commands/transform-to-code';
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 '../../../../ui/DropdownMenu';
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 '../../../../../keymaps';
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 '../../../ui/DropdownMenu';
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 '../../ToolbarArrowKeyNavigationProvider';
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: 12px ${CommentEditorSmallerMargin}px ${CommentEditorSmallerMargin}px;
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: 12px ${CommentEditorMargin}px ${CommentEditorMargin}px;
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: ${TableControlsPadding}px;
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: ${TableControlsPadding}px;
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 './messages';
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 './messages';
13
- import { ToolbarArrowKeyNavigationProvider } from '../../ToolbarArrowKeyNavigationProvider';
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
  }) => {
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
+
3
4
  import { useCallback, useState } from 'react';
4
5
  import { css, jsx } from '@emotion/react';
5
6
  // AFP-2532 TODO: Fix automatic suppressions below
@@ -22,9 +22,4 @@ export const buttonContentReducedSpacingStyle = css`
22
22
  `;
23
23
  export const clickSelectWrapperStyle = css`
24
24
  user-select: all;
25
- `;
26
- export const centeredToolbarContainer = css`
27
- display: flex;
28
- width: 100%;
29
- align-items: center;
30
25
  `;