@atlaskit/editor-core 189.3.1 → 189.3.3

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 (63) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/code-block/actions.js +1 -1
  3. package/dist/cjs/plugins/code-block/ide-ux/line-handling.js +1 -1
  4. package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  5. package/dist/cjs/plugins/code-block/pm-plugins/keymaps.js +7 -4
  6. package/dist/cjs/plugins/code-block/toolbar.js +5 -3
  7. package/dist/cjs/plugins/code-block/utils.js +5 -1
  8. package/dist/cjs/plugins/expand/index.js +3 -3
  9. package/dist/cjs/plugins/feedback-dialog/index.js +3 -3
  10. package/dist/cjs/plugins/find-replace/ui/Find.js +15 -12
  11. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +2 -2
  12. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +2 -2
  13. package/dist/cjs/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +1 -2
  14. package/dist/cjs/ui/ContentStyles/index.js +7 -7
  15. package/dist/cjs/utils/index.js +0 -53
  16. package/dist/cjs/version-wrapper.js +1 -1
  17. package/dist/es2019/plugins/code-block/actions.js +1 -1
  18. package/dist/es2019/plugins/code-block/ide-ux/line-handling.js +1 -1
  19. package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  20. package/dist/es2019/plugins/code-block/pm-plugins/keymaps.js +5 -2
  21. package/dist/es2019/plugins/code-block/toolbar.js +1 -2
  22. package/dist/es2019/plugins/code-block/utils.js +4 -1
  23. package/dist/es2019/plugins/expand/index.js +1 -1
  24. package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
  25. package/dist/es2019/plugins/find-replace/ui/Find.js +14 -11
  26. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -1
  27. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +1 -1
  28. package/dist/es2019/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +5 -6
  29. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  30. package/dist/es2019/utils/index.js +0 -36
  31. package/dist/es2019/version-wrapper.js +1 -1
  32. package/dist/esm/plugins/code-block/actions.js +1 -1
  33. package/dist/esm/plugins/code-block/ide-ux/line-handling.js +1 -1
  34. package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  35. package/dist/esm/plugins/code-block/pm-plugins/keymaps.js +5 -2
  36. package/dist/esm/plugins/code-block/toolbar.js +1 -2
  37. package/dist/esm/plugins/code-block/utils.js +4 -1
  38. package/dist/esm/plugins/expand/index.js +1 -1
  39. package/dist/esm/plugins/feedback-dialog/index.js +1 -1
  40. package/dist/esm/plugins/find-replace/ui/Find.js +15 -12
  41. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -1
  42. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +1 -1
  43. package/dist/esm/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +2 -3
  44. package/dist/esm/ui/ContentStyles/index.js +1 -1
  45. package/dist/esm/utils/index.js +0 -50
  46. package/dist/esm/version-wrapper.js +1 -1
  47. package/dist/types/plugins/code-block/actions.d.ts +1 -1
  48. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
  49. package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -1
  50. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +2 -2
  51. package/dist/types/plugins/code-block/types.d.ts +1 -2
  52. package/dist/types/plugins/code-block/utils.d.ts +3 -0
  53. package/dist/{types-ts4.5/plugins/code-block/styles.d.ts → types/ui/ContentStyles/code-block.d.ts} +1 -1
  54. package/dist/types/utils/index.d.ts +2 -18
  55. package/dist/types-ts4.5/plugins/code-block/actions.d.ts +1 -1
  56. package/dist/types-ts4.5/plugins/code-block/nodeviews/code-block.d.ts +1 -1
  57. package/dist/types-ts4.5/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -1
  58. package/dist/types-ts4.5/plugins/code-block/pm-plugins/main.d.ts +2 -2
  59. package/dist/types-ts4.5/plugins/code-block/types.d.ts +1 -2
  60. package/dist/types-ts4.5/plugins/code-block/utils.d.ts +3 -0
  61. package/dist/{types/plugins/code-block/styles.d.ts → types-ts4.5/ui/ContentStyles/code-block.d.ts} +1 -1
  62. package/dist/types-ts4.5/utils/index.d.ts +2 -39
  63. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 189.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42734](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42734) [`9a298d1b3c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a298d1b3c3) - Decouple code-block plugin from editor-core.
8
+
9
+ ## 189.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42567](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42567) [`7c771cc4e22`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7c771cc4e22) - [ux] [ECA11Y-142] Added feature flag to rollout A11y changes for find and replace
14
+
3
15
  ## 189.3.1
4
16
 
5
17
  ### Patch Changes
@@ -13,7 +13,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _pluginKey = require("./plugin-key");
14
14
  var _codeBlockCopySelectionPlugin = require("./pm-plugins/codeBlockCopySelectionPlugin");
15
15
  var _actions = require("./pm-plugins/actions");
16
- var _clipboard = require("../../utils/clipboard");
16
+ var _clipboard = require("@atlaskit/editor-common/clipboard");
17
17
  var _insert = require("@atlaskit/editor-common/insert");
18
18
  var _transformToCodeBlock = require("./transform-to-code-block");
19
19
  var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getLineInfo = exports.getEndOfCurrentLine = exports.forEachLine = void 0;
7
7
  exports.getLinesFromSelection = getLinesFromSelection;
8
8
  exports.isSelectionEntirelyInsideCodeBlock = exports.isCursorInsideCodeBlock = exports.getStartOfCurrentLine = void 0;
9
- var _utils = require("../../../utils");
9
+ var _utils = require("../utils");
10
10
  var isSelectionEntirelyInsideCodeBlock = exports.isSelectionEntirelyInsideCodeBlock = function isSelectionEntirelyInsideCodeBlock(state) {
11
11
  return state.selection.$from.sameParent(state.selection.$to) && state.selection.$from.parent.type === state.schema.nodes.codeBlock;
12
12
  };
@@ -8,7 +8,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
10
10
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
- var _utils2 = require("../../../utils");
11
+ var _utils2 = require("../utils");
12
12
  var _utils3 = require("@atlaskit/editor-common/utils");
13
13
  var _pairedCharacterHandling = require("../ide-ux/paired-character-handling");
14
14
  var _bracketHandling = require("../ide-ux/bracket-handling");
@@ -8,7 +8,8 @@ exports.keymapPlugin = keymapPlugin;
8
8
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
9
9
  var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
- var _utils2 = require("../../../utils");
11
+ var _utils2 = require("../utils");
12
+ var _utils3 = require("@atlaskit/editor-common/utils");
12
13
  var deleteCurrentItem = function deleteCurrentItem($from) {
13
14
  return function (tr) {
14
15
  return tr.delete($from.before($from.depth), $from.after($from.depth));
@@ -44,15 +45,17 @@ function keymapPlugin(schema) {
44
45
  dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
45
46
  return true;
46
47
  }
47
- if ($cursor.node && (0, _utils2.isEmptyNode)(schema)($cursor.node()) && ((0, _utils.hasParentNodeOfType)(layoutColumn)(state.selection) || (0, _utils.hasParentNodeOfType)(table)(state.selection))) {
48
+ if ($cursor.node && (0, _utils3.isEmptyNode)(schema)($cursor.node()) && ((0, _utils.hasParentNodeOfType)(layoutColumn)(state.selection) || (0, _utils.hasParentNodeOfType)(table)(state.selection))) {
48
49
  var tr = state.tr;
49
50
  var insertPos = $cursor.pos;
50
- dispatch((0, _utils2.pipe)(deleteCurrentItem($cursor), setTextSelection(insertPos))(tr).scrollIntoView());
51
+ deleteCurrentItem($cursor)(tr);
52
+ setTextSelection(insertPos)(tr);
53
+ dispatch(tr.scrollIntoView());
51
54
  return true;
52
55
  }
53
56
 
54
57
  // Handle not nested empty code block
55
- if ((0, _utils2.isEmptyNode)(schema)($cursor.node())) {
58
+ if ((0, _utils3.isEmptyNode)(schema)($cursor.node())) {
56
59
  dispatch(deleteCurrentItem($cursor)(state === null || state === void 0 ? void 0 : state.tr));
57
60
  return true;
58
61
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -10,11 +11,12 @@ var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove
10
11
  var _copy = _interopRequireDefault(require("@atlaskit/icon/glyph/copy"));
11
12
  var _utils = require("@atlaskit/editor-prosemirror/utils");
12
13
  var _actions = require("./actions");
13
- var _messages = _interopRequireDefault(require("../../messages"));
14
- var _messages2 = require("@atlaskit/editor-common/messages");
14
+ var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
15
15
  var _codeBlockCopySelectionPlugin = require("./pm-plugins/codeBlockCopySelectionPlugin");
16
16
  var _pluginKey = require("./plugin-key");
17
17
  var _languageList = require("./language-list");
18
+ 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); }
19
+ 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; }
18
20
  var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
19
21
  selectLanguage: {
20
22
  id: 'fabric.editor.selectLanguage',
@@ -80,7 +82,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
80
82
  // note: copyContentToClipboard contains logic that also removes the
81
83
  // visual feedback for the copy button
82
84
  onClick: _actions.copyContentToClipboard,
83
- title: formatMessage(codeBlockState.contentCopied ? _messages2.codeBlockButtonMessages.copiedCodeToClipboard : _messages2.codeBlockButtonMessages.copyCodeToClipboard),
85
+ title: formatMessage(codeBlockState.contentCopied ? _messages.codeBlockButtonMessages.copiedCodeToClipboard : _messages.codeBlockButtonMessages.copyCodeToClipboard),
84
86
  onMouseEnter: _codeBlockCopySelectionPlugin.provideVisualFeedbackForCopyButton,
85
87
  // note: resetCopiedState contains logic that also removes the
86
88
  // visual feedback for the copy button
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "findCodeBlock", {
9
9
  return _transforms.findCodeBlock;
10
10
  }
11
11
  });
12
+ exports.getCursor = getCursor;
12
13
  Object.defineProperty(exports, "transformSingleLineCodeBlockToCodeMark", {
13
14
  enumerable: true,
14
15
  get: function get() {
@@ -21,4 +22,7 @@ Object.defineProperty(exports, "transformSliceToJoinAdjacentCodeBlocks", {
21
22
  return _transforms.transformSliceToJoinAdjacentCodeBlocks;
22
23
  }
23
24
  });
24
- var _transforms = require("@atlaskit/editor-common/transforms");
25
+ var _transforms = require("@atlaskit/editor-common/transforms");
26
+ function getCursor(selection) {
27
+ return selection.$cursor || undefined;
28
+ }
@@ -21,7 +21,7 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
21
21
  var _analytics = require("@atlaskit/editor-common/analytics");
22
22
  var _toolbar = require("./toolbar");
23
23
  var _commands = require("./commands");
24
- var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
24
+ var _messages = require("@atlaskit/editor-common/messages");
25
25
  var _utils = require("@atlaskit/editor-common/utils");
26
26
  var _pluginFactory = require("./pm-plugins/plugin-factory");
27
27
  var expandPlugin = function expandPlugin(_ref) {
@@ -68,8 +68,8 @@ var expandPlugin = function expandPlugin(_ref) {
68
68
  }
69
69
  return [{
70
70
  id: 'expand',
71
- title: formatMessage(_messages.messages.expand),
72
- description: formatMessage(_messages.messages.expandDescription),
71
+ title: formatMessage(_messages.toolbarInsertBlockMessages.expand),
72
+ description: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
73
73
  keywords: ['accordion', 'collapse'],
74
74
  priority: 600,
75
75
  icon: function icon() {
@@ -14,7 +14,7 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
14
14
  var _versionWrapper = require("../../version-wrapper");
15
15
  var _analytics = require("@atlaskit/editor-common/analytics");
16
16
  var _loadJiraCollectorDialogScript = _interopRequireDefault(require("./loadJiraCollectorDialogScript"));
17
- var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
17
+ var _messages = require("@atlaskit/editor-common/messages");
18
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
19
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
20
  var showJiraCollectorDialog;
@@ -98,8 +98,8 @@ var feedbackDialog = function feedbackDialog(_ref3) {
98
98
  var formatMessage = _ref4.formatMessage;
99
99
  return [{
100
100
  id: 'feedbackdialog',
101
- title: formatMessage(_messages.messages.feedbackDialog),
102
- description: formatMessage(_messages.messages.feedbackDialogDescription),
101
+ title: formatMessage(_messages.toolbarInsertBlockMessages.feedbackDialog),
102
+ description: formatMessage(_messages.toolbarInsertBlockMessages.feedbackDialogDescription),
103
103
  priority: 400,
104
104
  keywords: ['bug'],
105
105
  icon: function icon() {
@@ -25,6 +25,7 @@ var _styles = require("./styles");
25
25
  var _analytics = require("@atlaskit/editor-common/analytics");
26
26
  var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
27
27
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
28
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
28
29
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
29
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
30
31
  var FIND_DEBOUNCE_MS = exports.FIND_DEBOUNCE_MS = 100;
@@ -220,19 +221,21 @@ var Find = /*#__PURE__*/function (_React$Component) {
220
221
  }, {
221
222
  key: "componentDidUpdate",
222
223
  value: function componentDidUpdate(prevProps) {
223
- var _this$state2,
224
- _this3 = this;
224
+ var _this3 = this;
225
225
  // focus on update if find text did not change
226
- if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
227
- this.focusFindTextfield();
228
- }
229
- if (this.props.findText !== prevProps.findText) {
230
- this.syncFindText(function () {
231
- // focus after input is synced if find text provided
232
- if (_this3.props.findText) {
233
- _this3.focusFindTextfield();
234
- }
235
- });
226
+ if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace')) {
227
+ var _this$state2;
228
+ if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
229
+ this.focusFindTextfield();
230
+ }
231
+ if (this.props.findText !== prevProps.findText) {
232
+ this.syncFindText(function () {
233
+ // focus after input is synced if find text provided
234
+ if (_this3.props.findText) {
235
+ _this3.focusFindTextfield();
236
+ }
237
+ });
238
+ }
236
239
  }
237
240
  }
238
241
  }, {
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _reactIntlNext = require("react-intl-next");
18
18
  var _decision = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/decision"));
19
19
  var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
20
- var _messages = require("../../../insert-block/ui/ToolbarInsertBlock/messages");
20
+ var _messages = require("@atlaskit/editor-common/messages");
21
21
  var _commands = require("../../commands");
22
22
  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); }
23
23
  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; }
@@ -57,7 +57,7 @@ var ToolbarDecision = exports.ToolbarDecision = /*#__PURE__*/function (_PureComp
57
57
  isDisabled = _this$props2.isDisabled,
58
58
  isReducedSpacing = _this$props2.isReducedSpacing,
59
59
  formatMessage = _this$props2.intl.formatMessage;
60
- var label = formatMessage(_messages.messages.decision);
60
+ var label = formatMessage(_messages.toolbarInsertBlockMessages.decision);
61
61
  return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
62
62
  buttonId: _ToolbarButton.TOOLBAR_BUTTON.DECISION_LIST,
63
63
  onClick: this.handleInsertDecision,
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _reactIntlNext = require("react-intl-next");
18
18
  var _task = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/task"));
19
19
  var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
20
- var _messages = require("../../../insert-block/ui/ToolbarInsertBlock/messages");
20
+ var _messages = require("@atlaskit/editor-common/messages");
21
21
  var _commands = require("../../commands");
22
22
  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); }
23
23
  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; }
@@ -57,7 +57,7 @@ var ToolbarTask = exports.ToolbarTask = /*#__PURE__*/function (_PureComponent) {
57
57
  isDisabled = _this$props2.isDisabled,
58
58
  isReducedSpacing = _this$props2.isReducedSpacing,
59
59
  formatMessage = _this$props2.intl.formatMessage;
60
- var label = formatMessage(_messages.messages.action);
60
+ var label = formatMessage(_messages.toolbarInsertBlockMessages.action);
61
61
  return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
62
62
  buttonId: _ToolbarButton.TOOLBAR_BUTTON.TASK_LIST,
63
63
  onClick: this.handleInsertTask,
@@ -9,12 +9,11 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
9
9
  var _react = require("@emotion/react");
10
10
  var _colors = require("@atlaskit/theme/colors");
11
11
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
- var _classNames = require("./ui/class-names");
13
12
  var _styles = require("@atlaskit/editor-common/styles");
14
13
  var _templateObject, _templateObject2;
15
14
  var GutterDangerOverlay = function GutterDangerOverlay() {
16
15
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &::after {\n height: 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n width: 24px;\n background-color: ", ";\n }\n"])), "var(--ds-blanket-danger, none)");
17
16
  };
18
17
  var codeBlockStyles = exports.codeBlockStyles = function codeBlockStyles(props) {
19
- return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror li {\n /* if same list item has multiple code blocks we need top margin for all but first */\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), (0, _styles.codeBlockSharedStyles)(props), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _classNames.codeBlockClassNames.gutter, "var(--ds-background-danger, ".concat(_colors.R75, ")"), "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _classNames.codeBlockClassNames.content, "var(--ds-blanket-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _classNames.codeBlockClassNames.gutter, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _classNames.codeBlockClassNames.content, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))");
18
+ return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror li {\n /* if same list item has multiple code blocks we need top margin for all but first */\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), (0, _styles.codeBlockSharedStyles)(props), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, ".concat(_colors.R75, ")"), "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))");
20
19
  };
@@ -16,15 +16,15 @@ var _styles2 = require("../../plugins/collab-edit/styles");
16
16
  var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
17
17
  var _styles3 = require("@atlaskit/editor-plugin-block-type/styles");
18
18
  var _styles4 = require("@atlaskit/editor-plugin-paste-options-toolbar/styles");
19
- var _styles5 = require("../../plugins/code-block/styles");
19
+ var _codeBlock = require("./code-block");
20
20
  var _media = require("./media");
21
21
  var _layout = require("./layout");
22
22
  var _panel = require("./panel");
23
- var _styles6 = require("@atlaskit/editor-plugin-placeholder-text/styles");
24
- var _styles7 = require("../../plugins/extension/ui/styles");
25
- var _styles8 = require("../../plugins/expand/ui/styles");
26
- var _styles9 = require("../../plugins/find-replace/styles");
27
- var _styles10 = require("../../plugins/tasks-and-decisions/styles");
23
+ var _styles5 = require("@atlaskit/editor-plugin-placeholder-text/styles");
24
+ var _styles6 = require("../../plugins/extension/ui/styles");
25
+ var _styles7 = require("../../plugins/expand/ui/styles");
26
+ var _styles8 = require("../../plugins/find-replace/styles");
27
+ var _styles9 = require("../../plugins/tasks-and-decisions/styles");
28
28
  var _status = require("./status");
29
29
  var _date = require("./date");
30
30
  var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
47
47
  var contentStyles = function contentStyles(props) {
48
48
  return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
49
49
  theme: props.theme
50
- }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles6.placeholderTextStyles, placeholderStyles, (0, _styles5.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _layout.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles7.extensionStyles, (0, _styles8.expandStyles)(props), _styles9.findReplaceStyles, _styles4.textHighlightStyle, _styles10.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
50
+ }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _layout.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles6.extensionStyles, (0, _styles7.expandStyles)(props), _styles8.findReplaceStyles, _styles4.textHighlightStyle, _styles9.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
51
51
  };
52
52
  var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
53
53
  return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
@@ -16,14 +16,12 @@ Object.defineProperty(exports, "checkNodeDown", {
16
16
  return _utils2.checkNodeDown;
17
17
  }
18
18
  });
19
- exports.compose = compose;
20
19
  Object.defineProperty(exports, "findFarthestParentNode", {
21
20
  enumerable: true,
22
21
  get: function get() {
23
22
  return _document.findFarthestParentNode;
24
23
  }
25
24
  });
26
- exports.getCursor = getCursor;
27
25
  Object.defineProperty(exports, "getNodesCount", {
28
26
  enumerable: true,
29
27
  get: function get() {
@@ -124,7 +122,6 @@ Object.defineProperty(exports, "nonNullable", {
124
122
  return _utils2.nonNullable;
125
123
  }
126
124
  });
127
- exports.pipe = pipe;
128
125
  Object.defineProperty(exports, "setNodeSelection", {
129
126
  enumerable: true,
130
127
  get: function get() {
@@ -161,9 +158,6 @@ function isMarkTypeCompatibleWithMark(markType, mark) {
161
158
  function isMarkTypeAllowedInNode(markType, state) {
162
159
  return (0, _commands.toggleMark)(markType)(state);
163
160
  }
164
- function getCursor(selection) {
165
- return selection.$cursor || undefined;
166
- }
167
161
 
168
162
  /**
169
163
  * Check if a mark is allowed at the current selection / cursor based on a given state.
@@ -250,53 +244,6 @@ var isInsideBlockQuote = exports.isInsideBlockQuote = function isInsideBlockQuot
250
244
  var blockquote = state.schema.nodes.blockquote;
251
245
  return (0, _utils.hasParentNodeOfType)(blockquote)(state.selection);
252
246
  };
253
- /** Helper type for single arg function */
254
-
255
- /**
256
- * Compose 1 to n functions.
257
- * @param func first function
258
- * @param funcs additional functions
259
- */
260
- function compose(func) {
261
- for (var _len = arguments.length, funcs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
262
- funcs[_key - 1] = arguments[_key];
263
- }
264
- var allFuncs = [func].concat(funcs);
265
- return function composed(raw) {
266
- return allFuncs.reduceRight(function (memo, func) {
267
- return func(memo);
268
- }, raw);
269
- };
270
- }
271
-
272
- // one function
273
-
274
- // two function
275
-
276
- // three function
277
-
278
- // If needed add more than 3 function
279
- // Generic
280
-
281
- // rest
282
- function pipe() {
283
- for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
284
- fns[_key2] = arguments[_key2];
285
- }
286
- if (fns.length === 0) {
287
- return function (a) {
288
- return a;
289
- };
290
- }
291
- if (fns.length === 1) {
292
- return fns[0];
293
- }
294
- return fns.reduce(function (prevFn, nextFn) {
295
- return function () {
296
- return nextFn(prevFn.apply(void 0, arguments));
297
- };
298
- });
299
- }
300
247
  function sum(arr, f) {
301
248
  return arr.reduce(function (val, x) {
302
249
  return val + f(x);
@@ -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 = "189.3.1";
8
+ var version = exports.version = "189.3.3";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -3,7 +3,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { pluginKey } from './plugin-key';
4
4
  import { copySelectionPluginKey } from './pm-plugins/codeBlockCopySelectionPlugin';
5
5
  import { ACTIONS } from './pm-plugins/actions';
6
- import { copyToClipboard } from '../../utils/clipboard';
6
+ import { copyToClipboard } from '@atlaskit/editor-common/clipboard';
7
7
  import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
8
8
  import { transformToCodeBlockAction } from './transform-to-code-block';
9
9
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
@@ -1,4 +1,4 @@
1
- import { getCursor } from '../../../utils';
1
+ import { getCursor } from '../utils';
2
2
  export const isSelectionEntirelyInsideCodeBlock = state => state.selection.$from.sameParent(state.selection.$to) && state.selection.$from.parent.type === state.schema.nodes.codeBlock;
3
3
  export const isCursorInsideCodeBlock = state => !!getCursor(state.selection) && isSelectionEntirelyInsideCodeBlock(state);
4
4
  export const getStartOfCurrentLine = state => {
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
4
4
  import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
5
- import { getCursor } from '../../../utils';
5
+ import { getCursor } from '../utils';
6
6
  import { filterCommand as filter } from '@atlaskit/editor-common/utils';
7
7
  import { isCursorBeforeClosingCharacter, isClosingCharacter } from '../ide-ux/paired-character-handling';
8
8
  import { getAutoClosingBracketInfo, shouldAutoCloseBracket } from '../ide-ux/bracket-handling';
@@ -1,7 +1,8 @@
1
1
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
2
2
  import { Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
- import { getCursor, isEmptyNode, pipe } from '../../../utils';
4
+ import { getCursor } from '../utils';
5
+ import { isEmptyNode } from '@atlaskit/editor-common/utils';
5
6
  const deleteCurrentItem = $from => tr => {
6
7
  return tr.delete($from.before($from.depth), $from.after($from.depth));
7
8
  };
@@ -39,7 +40,9 @@ export function keymapPlugin(schema) {
39
40
  tr
40
41
  } = state;
41
42
  const insertPos = $cursor.pos;
42
- dispatch(pipe(deleteCurrentItem($cursor), setTextSelection(insertPos))(tr).scrollIntoView());
43
+ deleteCurrentItem($cursor)(tr);
44
+ setTextSelection(insertPos)(tr);
45
+ dispatch(tr.scrollIntoView());
43
46
  return true;
44
47
  }
45
48
 
@@ -3,8 +3,7 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
3
3
  import CopyIcon from '@atlaskit/icon/glyph/copy';
4
4
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { removeCodeBlock, changeLanguage, copyContentToClipboard, resetCopiedState } from './actions';
6
- import commonMessages from '../../messages';
7
- import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
6
+ import commonMessages, { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
8
7
  import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
9
8
  import { pluginKey } from './plugin-key';
10
9
  import { createLanguageList, getLanguageIdentifier, DEFAULT_LANGUAGES } from './language-list';
@@ -1 +1,4 @@
1
- export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
1
+ export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
2
+ export function getCursor(selection) {
3
+ return selection.$cursor || undefined;
4
+ }
@@ -6,7 +6,7 @@ import { IconExpand } from '@atlaskit/editor-common/quick-insert';
6
6
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
7
7
  import { getToolbarConfig } from './toolbar';
8
8
  import { createExpandNode, insertExpand } from './commands';
9
- import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
9
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
10
10
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
11
11
  const expandPlugin = ({
12
12
  config: options = {},
@@ -3,7 +3,7 @@ import { IconFeedback } from '@atlaskit/editor-common/quick-insert';
3
3
  import { version as coreVersion } from '../../version-wrapper';
4
4
  import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
5
5
  import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
6
- import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
6
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  let showJiraCollectorDialog;
8
8
  let feedbackInfoHash;
9
9
  let defaultFeedbackInfo;
@@ -13,6 +13,7 @@ import { countStyles, sectionWrapperStyles } from './styles';
13
13
  import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
14
14
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
15
15
  import rafSchd from 'raf-schd';
16
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
17
  export const FIND_DEBOUNCE_MS = 100;
17
18
  const messages = defineMessages({
18
19
  find: {
@@ -200,18 +201,20 @@ class Find extends React.Component {
200
201
  });
201
202
  }
202
203
  componentDidUpdate(prevProps) {
203
- var _this$state2;
204
204
  // focus on update if find text did not change
205
- if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
206
- this.focusFindTextfield();
207
- }
208
- if (this.props.findText !== prevProps.findText) {
209
- this.syncFindText(() => {
210
- // focus after input is synced if find text provided
211
- if (this.props.findText) {
212
- this.focusFindTextfield();
213
- }
214
- });
205
+ if (!getBooleanFF('platform.editor.a11y-find-replace')) {
206
+ var _this$state2;
207
+ if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
208
+ this.focusFindTextfield();
209
+ }
210
+ if (this.props.findText !== prevProps.findText) {
211
+ this.syncFindText(() => {
212
+ // focus after input is synced if find text provided
213
+ if (this.props.findText) {
214
+ this.focusFindTextfield();
215
+ }
216
+ });
217
+ }
215
218
  }
216
219
  }
217
220
  componentWillUnmount() {
@@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
3
3
  import { injectIntl } from 'react-intl-next';
4
4
  import DecisionIcon from '@atlaskit/icon/glyph/editor/decision';
5
5
  import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
6
- import { messages } from '../../../insert-block/ui/ToolbarInsertBlock/messages';
6
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { insertTaskDecisionCommand } from '../../commands';
8
8
  export class ToolbarDecision extends PureComponent {
9
9
  constructor(...args) {
@@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
3
3
  import { injectIntl } from 'react-intl-next';
4
4
  import TaskIcon from '@atlaskit/icon/glyph/editor/task';
5
5
  import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
6
- import { messages } from '../../../insert-block/ui/ToolbarInsertBlock/messages';
6
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { insertTaskDecisionCommand } from '../../commands';
8
8
  export class ToolbarTask extends PureComponent {
9
9
  constructor(...args) {
@@ -1,8 +1,7 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { R75 } from '@atlaskit/theme/colors';
3
3
  import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
4
- import { codeBlockClassNames } from './ui/class-names';
5
- import { codeBlockSharedStyles } from '@atlaskit/editor-common/styles';
4
+ import { codeBlockSharedStyles, CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
6
5
  const GutterDangerOverlay = () => css`
7
6
  &::after {
8
7
  height: 100%;
@@ -43,26 +42,26 @@ export const codeBlockStyles = props => css`
43
42
  box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
44
43
  ${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
45
44
 
46
- .${codeBlockClassNames.gutter} {
45
+ .${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
47
46
  background-color: ${`var(--ds-background-danger, ${R75})`};
48
47
  color: ${`var(--ds-text-danger, ${akEditorDeleteIconColor})`};
49
48
  ${GutterDangerOverlay()};
50
49
  }
51
50
 
52
- .${codeBlockClassNames.content} {
51
+ .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT} {
53
52
  background-color: ${`var(--ds-blanket-danger, ${akEditorDeleteBackground})`};
54
53
  }
55
54
  }
56
55
 
57
56
  /* Danger when nested node */
58
57
  .ProseMirror .danger .code-block {
59
- .${codeBlockClassNames.gutter} {
58
+ .${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
60
59
  background-color: ${"var(--ds-background-danger, rgba(255, 143, 115, 0.5))"};
61
60
  color: ${`var(--ds-text-danger, ${akEditorDeleteIconColor})`};
62
61
  ${GutterDangerOverlay()};
63
62
  }
64
63
 
65
- .${codeBlockClassNames.content} {
64
+ .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT} {
66
65
  background-color: ${"var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))"};
67
66
  }
68
67
  }