@atlaskit/editor-core 151.1.1 → 151.3.0

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 (59) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/create-editor/create-plugins-list.js +5 -2
  3. package/dist/cjs/labs/next/presets/default.js +3 -1
  4. package/dist/cjs/plugins/code-bidi-warning/index.js +5 -2
  5. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
  6. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
  7. package/dist/cjs/plugins/code-block/index.js +3 -3
  8. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  9. package/dist/cjs/plugins/code-block/pm-plugins/main.js +11 -3
  10. package/dist/cjs/plugins/find-replace/ui/Find.js +16 -9
  11. package/dist/cjs/plugins/find-replace/ui/FindReplace.js +9 -2
  12. package/dist/cjs/plugins/find-replace/ui/Replace.js +11 -3
  13. package/dist/cjs/plugins/find-replace/ui/styles.js +44 -35
  14. package/dist/cjs/plugins/status/styles.js +1 -1
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/cjs/version.json +1 -1
  17. package/dist/es2019/create-editor/create-plugins-list.js +5 -2
  18. package/dist/es2019/labs/next/presets/default.js +3 -1
  19. package/dist/es2019/plugins/code-bidi-warning/index.js +8 -2
  20. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +12 -2
  21. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +16 -5
  22. package/dist/es2019/plugins/code-block/index.js +3 -2
  23. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  24. package/dist/es2019/plugins/code-block/pm-plugins/main.js +11 -3
  25. package/dist/es2019/plugins/find-replace/ui/Find.js +18 -10
  26. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
  27. package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
  28. package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
  29. package/dist/es2019/plugins/status/styles.js +3 -0
  30. package/dist/es2019/version-wrapper.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/esm/create-editor/create-plugins-list.js +5 -2
  33. package/dist/esm/labs/next/presets/default.js +3 -1
  34. package/dist/esm/plugins/code-bidi-warning/index.js +5 -2
  35. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
  36. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
  37. package/dist/esm/plugins/code-block/index.js +3 -3
  38. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  39. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  40. package/dist/esm/plugins/find-replace/ui/Find.js +17 -10
  41. package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
  42. package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
  43. package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
  44. package/dist/esm/plugins/status/styles.js +1 -1
  45. package/dist/esm/version-wrapper.js +1 -1
  46. package/dist/esm/version.json +1 -1
  47. package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -2
  48. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +4 -2
  49. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +2 -1
  50. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +1 -0
  51. package/dist/types/plugins/code-block/index.d.ts +1 -1
  52. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +12 -1
  53. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +3 -1
  54. package/dist/types/plugins/code-block/types.d.ts +2 -0
  55. package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -0
  56. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
  57. package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
  58. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
  59. package/package.json +6 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 151.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`08348b6692c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/08348b6692c) - Update CodeBlockOptions to have appearance prop optional
8
+
9
+ ## 151.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`69fc91803d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/69fc91803d4) - [ux] Find and replace tooltip now icons are now correctly aligned and does not have a scrollbar showing up.
14
+
15
+ ## 151.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`db3477abb18`](https://bitbucket.org/atlassian/atlassian-frontend/commits/db3477abb18) - [ux] ED-13938 disabled code-bidi warning tooltip for mobile, reworked TextWrapper to fix bidi mitigation, and fixed issue where bidi warnings were not presented when renderer used with an annotation provider with draftMode set to true
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
25
+ ## 151.1.2
26
+
27
+ ### Patch Changes
28
+
29
+ - [`52f0c296810`](https://bitbucket.org/atlassian/atlassian-frontend/commits/52f0c296810) - ED-13940 fixed selecting line with a status via keys
30
+
3
31
  ## 151.1.1
4
32
 
5
33
  ### Patch Changes
@@ -115,7 +115,8 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
115
115
  },
116
116
  cardOptions: props.smartLinks || props.UNSAFE_cards,
117
117
  codeBlock: _objectSpread(_objectSpread({}, props.codeBlock), {}, {
118
- useLongPressSelection: false
118
+ useLongPressSelection: false,
119
+ appearance: props.appearance
119
120
  })
120
121
  };
121
122
  }
@@ -414,7 +415,9 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
414
415
  }
415
416
 
416
417
  if (featureFlags.codeBidiWarnings) {
417
- preset.add(_plugins.codeBidiWarningPlugin);
418
+ preset.add([_plugins.codeBidiWarningPlugin, {
419
+ appearance: props.appearance
420
+ }]);
418
421
  }
419
422
 
420
423
  var excludes = new Set();
@@ -99,7 +99,9 @@ function createDefaultPreset(options) {
99
99
  preset.add(_floatingToolbar.default);
100
100
  preset.add([_featureFlagsContext.default, options.featureFlags || {}]);
101
101
  preset.add([_selection.default, options.selection]);
102
- preset.add([_codeBlock.default, options.codeBlock]);
102
+ preset.add([_codeBlock.default, options.codeBlock || {
103
+ appearance: 'full-page'
104
+ }]);
103
105
  return preset;
104
106
  }
105
107
 
@@ -7,14 +7,17 @@ exports.default = void 0;
7
7
 
8
8
  var _main = require("./pm-plugins/main");
9
9
 
10
- var codeBidiWarning = function codeBidiWarning() {
10
+ var codeBidiWarning = function codeBidiWarning(_ref) {
11
+ var appearance = _ref.appearance;
11
12
  return {
12
13
  name: 'codeBidiWarning',
13
14
  pmPlugins: function pmPlugins() {
14
15
  return [{
15
16
  name: 'codeBidiWarning',
16
17
  plugin: function plugin(options) {
17
- return (0, _main.createPlugin)(options);
18
+ return (0, _main.createPlugin)(options, {
19
+ appearance: appearance
20
+ });
18
21
  }
19
22
  }];
20
23
  }
@@ -13,20 +13,29 @@ var _pluginKey = require("../plugin-key");
13
13
 
14
14
  var _pluginFactory = require("./plugin-factory");
15
15
 
16
- var createPlugin = function createPlugin(_ref) {
16
+ var createPlugin = function createPlugin(_ref, _ref2) {
17
17
  var dispatch = _ref.dispatch,
18
18
  reactContext = _ref.reactContext;
19
+ var appearance = _ref2.appearance;
19
20
  var intl = reactContext().intl;
20
21
  var codeBidiWarningLabel = intl.formatMessage(_messages.codeBidiWarningMessages.label);
21
22
  return new _prosemirrorState.Plugin({
22
23
  key: _pluginKey.codeBidiWarningPluginKey,
23
24
  state: (0, _pluginFactory.createPluginState)(dispatch, function (state) {
25
+ // The appearance being mobile indicates we are in an editor being
26
+ // rendered by mobile bridge in a web view.
27
+ // The tooltip is likely to have unexpected behaviour there, with being cut
28
+ // off, so we disable it. This is also to keep the behaviour consistent with
29
+ // the rendering in the mobile Native Renderer.
30
+ var tooltipEnabled = appearance !== 'mobile';
24
31
  return {
25
32
  decorationSet: (0, _pluginFactory.createBidiWarningsDecorationSetFromDoc)({
26
33
  doc: state.doc,
27
- codeBidiWarningLabel: codeBidiWarningLabel
34
+ codeBidiWarningLabel: codeBidiWarningLabel,
35
+ tooltipEnabled: tooltipEnabled
28
36
  }),
29
- codeBidiWarningLabel: codeBidiWarningLabel
37
+ codeBidiWarningLabel: codeBidiWarningLabel,
38
+ tooltipEnabled: tooltipEnabled
30
39
  };
31
40
  }),
32
41
  props: {
@@ -40,7 +40,8 @@ var _pluginFactory = (0, _pluginStateFactory.pluginFactory)(_pluginKey.codeBidiW
40
40
 
41
41
  var newBidiWarningsDecorationSet = createBidiWarningsDecorationSetFromDoc({
42
42
  doc: tr.doc,
43
- codeBidiWarningLabel: pluginState.codeBidiWarningLabel
43
+ codeBidiWarningLabel: pluginState.codeBidiWarningLabel,
44
+ tooltipEnabled: pluginState.tooltipEnabled
44
45
  });
45
46
  return _objectSpread(_objectSpread({}, pluginState), {}, {
46
47
  decorationSet: newBidiWarningsDecorationSet
@@ -55,7 +56,8 @@ exports.createPluginState = createPluginState;
55
56
 
56
57
  function createBidiWarningsDecorationSetFromDoc(_ref) {
57
58
  var doc = _ref.doc,
58
- codeBidiWarningLabel = _ref.codeBidiWarningLabel;
59
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel,
60
+ tooltipEnabled = _ref.tooltipEnabled;
59
61
  var bidiCharactersAndTheirPositions = [];
60
62
  doc.descendants(function (node, pos) {
61
63
  var isTextWithCodeMark = node.type.name === 'text' && node.marks && node.marks.some(function (mark) {
@@ -97,21 +99,29 @@ function createBidiWarningsDecorationSetFromDoc(_ref) {
97
99
  var position = _ref4.position,
98
100
  bidiCharacter = _ref4.bidiCharacter;
99
101
  return _prosemirrorView.Decoration.widget(position, function () {
100
- return renderDOM(bidiCharacter, codeBidiWarningLabel);
102
+ return renderDOM({
103
+ bidiCharacter: bidiCharacter,
104
+ codeBidiWarningLabel: codeBidiWarningLabel,
105
+ tooltipEnabled: tooltipEnabled
106
+ });
101
107
  });
102
108
  }));
103
109
 
104
110
  return newBidiWarningsDecorationSet;
105
111
  }
106
112
 
107
- function renderDOM(bidiCharacter, codeBidiWarningLabel) {
113
+ function renderDOM(_ref5) {
114
+ var bidiCharacter = _ref5.bidiCharacter,
115
+ codeBidiWarningLabel = _ref5.codeBidiWarningLabel,
116
+ tooltipEnabled = _ref5.tooltipEnabled;
108
117
  var element = document.createElement('span'); // Note: we use this pattern elsewhere (see highlighting code block, and drop cursor widget decoration)
109
118
  // we should investigate if there is a memory leak with such usage.
110
119
 
111
120
  _reactDom.default.render( /*#__PURE__*/_react.default.createElement(_bidiWarning.default, {
112
121
  bidiCharacter: bidiCharacter,
113
122
  skipChildren: true,
114
- label: codeBidiWarningLabel
123
+ label: codeBidiWarningLabel,
124
+ tooltipEnabled: tooltipEnabled
115
125
  }), element);
116
126
 
117
127
  return element;
@@ -27,8 +27,7 @@ var _messages = require("../block-type/messages");
27
27
 
28
28
  var _refreshBrowserSelection = _interopRequireDefault(require("./refresh-browser-selection"));
29
29
 
30
- var codeBlockPlugin = function codeBlockPlugin() {
31
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
30
+ var codeBlockPlugin = function codeBlockPlugin(options) {
32
31
  return {
33
32
  name: 'codeBlock',
34
33
  nodes: function nodes() {
@@ -44,7 +43,8 @@ var codeBlockPlugin = function codeBlockPlugin() {
44
43
  var reactContext = _ref.reactContext;
45
44
  return (0, _main.createPlugin)({
46
45
  useLongPressSelection: options.useLongPressSelection,
47
- reactContext: reactContext
46
+ reactContext: reactContext,
47
+ appearance: options.appearance
48
48
  });
49
49
  }
50
50
  }, {
@@ -133,7 +133,8 @@ var CodeBlockView = /*#__PURE__*/function () {
133
133
  language: node.attrs.language,
134
134
  showLineNumbers: false,
135
135
  codeBidiWarnings: this.codeBidiWarningOptions.enabled,
136
- codeBidiWarningLabel: this.codeBidiWarningOptions.label
136
+ codeBidiWarningLabel: this.codeBidiWarningOptions.label,
137
+ codeBidiWarningTooltipEnabled: this.codeBidiWarningOptions.tooltipEnabled
137
138
  }), highlighting);
138
139
 
139
140
  this.measure(performance.now() - start);
@@ -180,11 +181,13 @@ exports.CodeBlockView = CodeBlockView;
180
181
 
181
182
  var highlightingCodeBlockNodeView = function highlightingCodeBlockNodeView(_ref) {
182
183
  var codeBidiWarnings = _ref.codeBidiWarnings,
183
- codeBidiWarningLabel = _ref.codeBidiWarningLabel;
184
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel,
185
+ codeBidiWarningTooltipEnabled = _ref.codeBidiWarningTooltipEnabled;
184
186
  return function (node, view, getPos) {
185
187
  return new CodeBlockView(node, view, getPos, {
188
+ label: codeBidiWarningLabel,
186
189
  enabled: codeBidiWarnings,
187
- label: codeBidiWarningLabel
190
+ tooltipEnabled: codeBidiWarningTooltipEnabled
188
191
  });
189
192
  };
190
193
  };
@@ -36,7 +36,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
36
36
  var createPlugin = function createPlugin(_ref) {
37
37
  var _ref$useLongPressSele = _ref.useLongPressSelection,
38
38
  useLongPressSelection = _ref$useLongPressSele === void 0 ? false : _ref$useLongPressSele,
39
- reactContext = _ref.reactContext;
39
+ reactContext = _ref.reactContext,
40
+ appearance = _ref.appearance;
40
41
  var intl = reactContext().intl;
41
42
  var codeBidiWarningLabel = intl.formatMessage(_messages.codeBidiWarningMessages.label);
42
43
  return new _prosemirrorState.Plugin({
@@ -76,10 +77,17 @@ var createPlugin = function createPlugin(_ref) {
76
77
  props: {
77
78
  nodeViews: {
78
79
  codeBlock: function codeBlock(node, view, getPos) {
79
- var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(view.state);
80
+ var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(view.state); // The appearance being mobile indicates we are in an editor being
81
+ // rendered by mobile bridge in a web view.
82
+ // The tooltip is likely to have unexpected behaviour there, with being cut
83
+ // off, so we disable it. This is also to keep the behaviour consistent with
84
+ // the rendering in the mobile Native Renderer.
85
+
86
+ var codeBidiWarningTooltipEnabled = appearance !== 'mobile';
80
87
  var createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? (0, _highlightingCodeBlock.highlightingCodeBlockNodeView)({
81
88
  codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
82
- codeBidiWarningLabel: codeBidiWarningLabel
89
+ codeBidiWarningLabel: codeBidiWarningLabel,
90
+ codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
83
91
  }) : (0, _codeBlock.codeBlockNodeView)();
84
92
  return createCodeBlockNodeView(node, view, getPos);
85
93
  }
@@ -23,6 +23,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
23
23
 
24
24
  var _react = _interopRequireDefault(require("react"));
25
25
 
26
+ var _core = require("@emotion/core");
27
+
26
28
  var _reactIntl = require("react-intl");
27
29
 
28
30
  var _close = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/close"));
@@ -180,16 +182,16 @@ var Find = /*#__PURE__*/function (_React$Component) {
180
182
  _this.findNext = formatMessage(messages.findNext);
181
183
  _this.findPrevious = formatMessage(messages.findPrevious);
182
184
  _this.matchCase = formatMessage(messages.matchCase);
183
- _this.matchCaseIcon = /*#__PURE__*/_react.default.createElement(_keyboard.default, {
185
+ _this.matchCaseIcon = (0, _core.jsx)(_keyboard.default, {
184
186
  label: _this.matchCase
185
187
  });
186
- _this.findNextIcon = /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
188
+ _this.findNextIcon = (0, _core.jsx)(_chevronDown.default, {
187
189
  label: _this.findNext
188
190
  });
189
- _this.findPrevIcon = /*#__PURE__*/_react.default.createElement(_chevronUp.default, {
191
+ _this.findPrevIcon = (0, _core.jsx)(_chevronUp.default, {
190
192
  label: _this.findPrevious
191
193
  });
192
- _this.closeIcon = /*#__PURE__*/_react.default.createElement(_close.default, {
194
+ _this.closeIcon = (0, _core.jsx)(_close.default, {
193
195
  label: _this.closeFindReplaceDialog
194
196
  }); // We locally manage the value of the input inside this component in order to support compositions.
195
197
  // This requires some additional work inside componentDidUpdate to ensure we support changes that
@@ -235,7 +237,9 @@ var Find = /*#__PURE__*/function (_React$Component) {
235
237
  selectedMatchPosition: count.index + 1,
236
238
  totalResultsCount: count.total
237
239
  });
238
- return /*#__PURE__*/_react.default.createElement(_styles.SectionWrapper, null, /*#__PURE__*/_react.default.createElement(_textfield.default, {
240
+ return (0, _core.jsx)("div", {
241
+ css: _styles.sectionWrapperStyles
242
+ }, (0, _core.jsx)(_textfield.default, {
239
243
  name: "find",
240
244
  appearance: "none",
241
245
  placeholder: this.find,
@@ -247,24 +251,27 @@ var Find = /*#__PURE__*/function (_React$Component) {
247
251
  onBlur: this.props.onFindBlur,
248
252
  onCompositionStart: this.handleCompositionStart,
249
253
  onCompositionEnd: this.handleCompositionEnd
250
- }), findText && /*#__PURE__*/_react.default.createElement(_styles.Count, null, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && /*#__PURE__*/_react.default.createElement(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
254
+ }), findText && (0, _core.jsx)("span", {
255
+ "data-testid": "textfield-count",
256
+ css: _styles.countStyles
257
+ }, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && (0, _core.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
251
258
  title: this.matchCase,
252
259
  icon: this.matchCaseIcon,
253
260
  onClick: this.handleMatchCaseClick,
254
261
  isPressed: shouldMatchCase
255
- }), /*#__PURE__*/_react.default.createElement(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
262
+ }), (0, _core.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
256
263
  title: this.findNext,
257
264
  icon: this.findNextIcon,
258
265
  keymapDescription: 'Enter',
259
266
  onClick: this.handleFindNextClick,
260
267
  disabled: count.total <= 1
261
- }), /*#__PURE__*/_react.default.createElement(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
268
+ }), (0, _core.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
262
269
  title: this.findPrevious,
263
270
  icon: this.findPrevIcon,
264
271
  keymapDescription: 'Shift Enter',
265
272
  onClick: this.handleFindPrevClick,
266
273
  disabled: count.total <= 1
267
- }), /*#__PURE__*/_react.default.createElement(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
274
+ }), (0, _core.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
268
275
  title: this.closeFindReplaceDialog,
269
276
  icon: this.closeIcon,
270
277
  keymapDescription: 'Escape',
@@ -23,6 +23,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
23
23
 
24
24
  var _react = _interopRequireDefault(require("react"));
25
25
 
26
+ var _core = require("@emotion/core");
27
+
26
28
  var _Find = _interopRequireDefault(require("./Find"));
27
29
 
28
30
  var _Replace = _interopRequireDefault(require("./Replace"));
@@ -88,7 +90,9 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
88
90
  allowMatchCase = _this$props.allowMatchCase,
89
91
  shouldMatchCase = _this$props.shouldMatchCase,
90
92
  onToggleMatchCase = _this$props.onToggleMatchCase;
91
- return /*#__PURE__*/_react.default.createElement(_styles.Wrapper, null, /*#__PURE__*/_react.default.createElement(_Find.default, {
93
+ return (0, _core.jsx)("div", {
94
+ css: _styles.wrapperStyles
95
+ }, (0, _core.jsx)(_Find.default, {
92
96
  allowMatchCase: allowMatchCase,
93
97
  shouldMatchCase: shouldMatchCase,
94
98
  onToggleMatchCase: onToggleMatchCase,
@@ -102,7 +106,10 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
102
106
  onFindTextfieldRefSet: this.setFindTextfieldRef,
103
107
  onCancel: onCancel,
104
108
  onArrowDown: this.setFocusToReplace
105
- }), /*#__PURE__*/_react.default.createElement(_styles.Rule, null), /*#__PURE__*/_react.default.createElement(_Replace.default, {
109
+ }), (0, _core.jsx)("hr", {
110
+ css: _styles.ruleStyles,
111
+ id: "replace-hr-element"
112
+ }), (0, _core.jsx)(_Replace.default, {
106
113
  canReplace: count.total > 0,
107
114
  replaceText: replaceText,
108
115
  onReplace: onReplace,
@@ -23,6 +23,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
23
23
 
24
24
  var _react = _interopRequireDefault(require("react"));
25
25
 
26
+ var _core = require("@emotion/core");
27
+
28
+ var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
29
+
26
30
  var _reactIntl = require("react-intl");
27
31
 
28
32
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
@@ -167,7 +171,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
167
171
  value: function render() {
168
172
  var replaceText = this.state.replaceText;
169
173
  var canReplace = this.props.canReplace;
170
- return /*#__PURE__*/_react.default.createElement(_styles.SectionWrapper, null, /*#__PURE__*/_react.default.createElement(_textfield.default, {
174
+ return (0, _core.jsx)("div", {
175
+ css: _styles.sectionWrapperStyles
176
+ }, (0, _core.jsx)(_textfield.default, {
171
177
  name: "replace",
172
178
  appearance: "none",
173
179
  placeholder: this.replaceWith,
@@ -178,11 +184,13 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
178
184
  onKeyDown: this.handleReplaceKeyDown,
179
185
  onCompositionStart: this.handleCompositionStart,
180
186
  onCompositionEnd: this.handleCompositionEnd
181
- }), /*#__PURE__*/_react.default.createElement(_styles.ReplaceSectionButton, {
187
+ }), (0, _core.jsx)(_standardButton.default, {
188
+ css: _styles.replaceSectionButtonStyles,
182
189
  testId: this.replace,
183
190
  onClick: this.handleReplaceClick,
184
191
  isDisabled: !canReplace
185
- }, this.replace), /*#__PURE__*/_react.default.createElement(_styles.ReplaceSectionButton, {
192
+ }, this.replace), (0, _core.jsx)(_standardButton.default, {
193
+ css: _styles.replaceSectionButtonStyles,
186
194
  testId: this.replaceAll,
187
195
  onClick: this.handleReplaceAllClick,
188
196
  isDisabled: !canReplace
@@ -1,46 +1,55 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports.Count = exports.SectionWrapper = exports.Wrapper = exports.Rule = exports.ReplaceSectionButton = void 0;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
- var _react = _interopRequireDefault(require("react"));
6
+ exports.countStyles = exports.sectionWrapperStyles = exports.wrapperStyles = exports.ruleStyles = exports.replaceSectionButtonStyles = void 0;
13
7
 
14
- var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ var _core = require("@emotion/core");
15
9
 
16
10
  var _colors = require("@atlaskit/theme/colors");
17
11
 
18
- var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
19
-
20
12
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
13
 
22
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
23
-
24
- // This is a workaround because React.memo does not play well with styled-components
25
- function StyledComponentsButton(props) {
26
- return /*#__PURE__*/_react.default.createElement(_standardButton.default, props);
27
- }
28
-
29
- var ReplaceSectionButton = (0, _styledComponents.default)(StyledComponentsButton)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* increase specificity to override default Button styles */\n && {\n margin-left: 4px;\n }\n"])));
30
- exports.ReplaceSectionButton = ReplaceSectionButton;
31
-
32
- var Rule = _styledComponents.default.hr(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n border: none;\n background-color: ", ";\n margin: 4px 0px;\n height: 1px;\n border-radius: 1px;\n"])), _colors.N30A);
33
-
34
- exports.Rule = Rule;
35
-
36
- var Wrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n > *:not(", ") {\n margin: 0px 4px;\n }\n"])), Rule);
37
-
38
- exports.Wrapper = Wrapper;
39
-
40
- var SectionWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n\n > * {\n flex: 0 0 auto;\n display: inline-flex;\n height: 32px;\n }\n"])));
41
-
42
- exports.SectionWrapper = SectionWrapper;
43
-
44
- var Count = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: ", ";\n flex: 0 0 auto;\n justify-content: center;\n align-items: center;\n margin-left: 4px;\n margin-right: 8px;\n"])), _colors.N60, (0, _editorSharedStyles.relativeFontSizeToBase16)(12));
45
-
46
- exports.Count = Count;
14
+ /** @jsx jsx */
15
+ var replaceSectionButtonStyles = (0, _core.css)({
16
+ marginLeft: '4px'
17
+ });
18
+ exports.replaceSectionButtonStyles = replaceSectionButtonStyles;
19
+ var ruleStyles = (0, _core.css)({
20
+ width: '100%',
21
+ border: 'none',
22
+ backgroundColor: "".concat(_colors.N30A),
23
+ margin: '4px 0px',
24
+ height: '1px',
25
+ borderRadius: '1px'
26
+ });
27
+ exports.ruleStyles = ruleStyles;
28
+ var wrapperStyles = (0, _core.css)({
29
+ display: 'flex',
30
+ flexDirection: 'column',
31
+ '> *:not(#replace-hr-element)': {
32
+ margin: '0px 4px'
33
+ }
34
+ });
35
+ exports.wrapperStyles = wrapperStyles;
36
+ var sectionWrapperStyles = (0, _core.css)({
37
+ display: 'flex',
38
+ alignItems: 'column',
39
+ '> *': {
40
+ display: 'inline-flex',
41
+ height: '32px',
42
+ flex: '0 0 auto'
43
+ }
44
+ });
45
+ exports.sectionWrapperStyles = sectionWrapperStyles;
46
+ var countStyles = (0, _core.css)({
47
+ color: "".concat(_colors.N60),
48
+ fontSize: "".concat((0, _editorSharedStyles.relativeFontSizeToBase16)(12)),
49
+ flex: '0 0 auto',
50
+ justifyContent: 'center',
51
+ alignItems: 'center',
52
+ marginLeft: '4px',
53
+ marginRight: '8px'
54
+ });
55
+ exports.countStyles = countStyles;
@@ -17,5 +17,5 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
17
 
18
18
  var _templateObject;
19
19
 
20
- var statusStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline-block;\n\n > span {\n display: inline-block;\n cursor: pointer;\n line-height: 0; /* Prevent responsive layouts increasing height of container. */\n }\n\n &.", "\n .", "\n > span {\n ", "\n }\n }\n\n .danger {\n .", " > span {\n background-color: ", ";\n }\n\n .", ".", "\n .", "\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n }\n }\n"])), _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorDeleteBackgroundWithOpacity, _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder);
20
+ var statusStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n // these two styles can be removed when displayInlineBlockForInlineNodes is enabled by default\n // as it will make all inline nodes inline-block by default\n display: inline-block;\n user-select: all;\n\n > span {\n display: inline-block;\n cursor: pointer;\n line-height: 0; /* Prevent responsive layouts increasing height of container. */\n }\n\n &.", "\n .", "\n > span {\n ", "\n }\n }\n\n .danger {\n .", " > span {\n background-color: ", ";\n }\n\n .", ".", "\n .", "\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n }\n }\n"])), _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorDeleteBackgroundWithOpacity, _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder);
21
21
  exports.statusStyles = statusStyles;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.nextMajorVersion = exports.version = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "151.1.1";
9
+ var version = "151.3.0";
10
10
  exports.version = version;
11
11
 
12
12
  var nextMajorVersion = function nextMajorVersion() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "151.1.1",
3
+ "version": "151.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -87,7 +87,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
87
87
  },
88
88
  cardOptions: props.smartLinks || props.UNSAFE_cards,
89
89
  codeBlock: { ...props.codeBlock,
90
- useLongPressSelection: false
90
+ useLongPressSelection: false,
91
+ appearance: props.appearance
91
92
  }
92
93
  };
93
94
  }
@@ -390,7 +391,9 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
390
391
  }
391
392
 
392
393
  if (featureFlags.codeBidiWarnings) {
393
- preset.add(codeBidiWarningPlugin);
394
+ preset.add([codeBidiWarningPlugin, {
395
+ appearance: props.appearance
396
+ }]);
394
397
  }
395
398
 
396
399
  const excludes = new Set();
@@ -62,7 +62,9 @@ export function createDefaultPreset(options) {
62
62
  preset.add(floatingToolbarPlugin);
63
63
  preset.add([featureFlagsContextPlugin, options.featureFlags || {}]);
64
64
  preset.add([selectionPlugin, options.selection]);
65
- preset.add([codeBlockPlugin, options.codeBlock]);
65
+ preset.add([codeBlockPlugin, options.codeBlock || {
66
+ appearance: 'full-page'
67
+ }]);
66
68
  return preset;
67
69
  }
68
70
  export function useDefaultPreset(props) {
@@ -1,12 +1,18 @@
1
1
  import { createPlugin } from './pm-plugins/main';
2
2
 
3
- const codeBidiWarning = () => ({
3
+ const codeBidiWarning = ({
4
+ appearance
5
+ }) => ({
4
6
  name: 'codeBidiWarning',
5
7
 
6
8
  pmPlugins() {
7
9
  return [{
8
10
  name: 'codeBidiWarning',
9
- plugin: options => createPlugin(options)
11
+ plugin: options => {
12
+ return createPlugin(options, {
13
+ appearance
14
+ });
15
+ }
10
16
  }];
11
17
  }
12
18
 
@@ -5,18 +5,28 @@ import { createBidiWarningsDecorationSetFromDoc, createPluginState, getPluginSta
5
5
  export const createPlugin = ({
6
6
  dispatch,
7
7
  reactContext
8
+ }, {
9
+ appearance
8
10
  }) => {
9
11
  const intl = reactContext().intl;
10
12
  const codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
11
13
  return new Plugin({
12
14
  key: codeBidiWarningPluginKey,
13
15
  state: createPluginState(dispatch, state => {
16
+ // The appearance being mobile indicates we are in an editor being
17
+ // rendered by mobile bridge in a web view.
18
+ // The tooltip is likely to have unexpected behaviour there, with being cut
19
+ // off, so we disable it. This is also to keep the behaviour consistent with
20
+ // the rendering in the mobile Native Renderer.
21
+ const tooltipEnabled = appearance !== 'mobile';
14
22
  return {
15
23
  decorationSet: createBidiWarningsDecorationSetFromDoc({
16
24
  doc: state.doc,
17
- codeBidiWarningLabel
25
+ codeBidiWarningLabel,
26
+ tooltipEnabled
18
27
  }),
19
- codeBidiWarningLabel
28
+ codeBidiWarningLabel,
29
+ tooltipEnabled
20
30
  };
21
31
  }),
22
32
  props: {