@atlaskit/editor-core 193.2.6 → 193.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 (82) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +23 -3
  3. package/dist/cjs/presets/universal.js +0 -1
  4. package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +4 -5
  5. package/dist/cjs/ui/Addon/Dropdown/styles.js +9 -4
  6. package/dist/cjs/ui/Addon/DropdownItem/styles.js +15 -4
  7. package/dist/cjs/ui/Appearance/Chromeless.js +26 -6
  8. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +20 -14
  9. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +66 -12
  10. package/dist/cjs/ui/AppearanceComponents/Mobile.js +15 -4
  11. package/dist/cjs/ui/ChromeCollapsed/styles.js +23 -4
  12. package/dist/cjs/ui/ContentStyles/date.js +1 -0
  13. package/dist/cjs/ui/ContentStyles/extension.js +1 -1
  14. package/dist/cjs/ui/ContentStyles/index.js +3 -0
  15. package/dist/cjs/ui/ContentStyles/layout.js +1 -0
  16. package/dist/cjs/ui/ContentStyles/media.js +1 -1
  17. package/dist/cjs/ui/ContentStyles/status.js +1 -0
  18. package/dist/cjs/ui/ContentStyles/tasks-and-decisions.js +1 -1
  19. package/dist/cjs/ui/ContextPanel/index.js +24 -8
  20. package/dist/cjs/ui/PluginSlot/index.js +4 -5
  21. package/dist/cjs/ui/Toolbar/ToolbarInner.js +7 -5
  22. package/dist/cjs/ui/WithFlash/index.js +7 -4
  23. package/dist/cjs/version-wrapper.js +1 -1
  24. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +23 -35
  25. package/dist/es2019/presets/universal.js +0 -1
  26. package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +3 -4
  27. package/dist/es2019/ui/Addon/Dropdown/styles.js +9 -9
  28. package/dist/es2019/ui/Addon/DropdownItem/styles.js +14 -15
  29. package/dist/es2019/ui/Appearance/Chromeless.js +23 -25
  30. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +16 -11
  31. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +68 -81
  32. package/dist/es2019/ui/AppearanceComponents/Mobile.js +12 -13
  33. package/dist/es2019/ui/ChromeCollapsed/styles.js +21 -23
  34. package/dist/es2019/ui/ContentStyles/date.js +1 -0
  35. package/dist/es2019/ui/ContentStyles/expand.js +1 -2
  36. package/dist/es2019/ui/ContentStyles/extension.js +1 -1
  37. package/dist/es2019/ui/ContentStyles/index.js +5 -3
  38. package/dist/es2019/ui/ContentStyles/layout.js +2 -0
  39. package/dist/es2019/ui/ContentStyles/media.js +1 -1
  40. package/dist/es2019/ui/ContentStyles/status.js +2 -0
  41. package/dist/es2019/ui/ContentStyles/tasks-and-decisions.js +1 -1
  42. package/dist/es2019/ui/ContextPanel/index.js +23 -23
  43. package/dist/es2019/ui/PluginSlot/index.js +3 -3
  44. package/dist/es2019/ui/Toolbar/ToolbarInner.js +5 -6
  45. package/dist/es2019/ui/WithFlash/index.js +7 -4
  46. package/dist/es2019/version-wrapper.js +1 -1
  47. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +23 -3
  48. package/dist/esm/presets/universal.js +0 -1
  49. package/dist/esm/ui/Addon/ClickAreaMobile/index.js +3 -3
  50. package/dist/esm/ui/Addon/Dropdown/styles.js +9 -3
  51. package/dist/esm/ui/Addon/DropdownItem/styles.js +15 -3
  52. package/dist/esm/ui/Appearance/Chromeless.js +25 -4
  53. package/dist/esm/ui/Appearance/Comment/Toolbar.js +20 -14
  54. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +66 -12
  55. package/dist/esm/ui/AppearanceComponents/Mobile.js +13 -3
  56. package/dist/esm/ui/ChromeCollapsed/styles.js +23 -3
  57. package/dist/esm/ui/ContentStyles/date.js +1 -0
  58. package/dist/esm/ui/ContentStyles/expand.js +1 -2
  59. package/dist/esm/ui/ContentStyles/extension.js +1 -1
  60. package/dist/esm/ui/ContentStyles/index.js +5 -3
  61. package/dist/esm/ui/ContentStyles/layout.js +2 -0
  62. package/dist/esm/ui/ContentStyles/media.js +1 -1
  63. package/dist/esm/ui/ContentStyles/status.js +2 -0
  64. package/dist/esm/ui/ContentStyles/tasks-and-decisions.js +1 -1
  65. package/dist/esm/ui/ContextPanel/index.js +23 -6
  66. package/dist/esm/ui/PluginSlot/index.js +3 -3
  67. package/dist/esm/ui/Toolbar/ToolbarInner.js +6 -3
  68. package/dist/esm/ui/WithFlash/index.js +7 -4
  69. package/dist/esm/version-wrapper.js +1 -1
  70. package/dist/types/create-editor/ErrorBoundary.d.ts +1 -1
  71. package/dist/types/create-editor/WithEditorView.d.ts +2 -2
  72. package/dist/types/create-editor/get-ui-component.d.ts +1 -1
  73. package/dist/types/types/extension-config.d.ts +0 -1
  74. package/dist/types/ui/Toolbar/Toolbar.d.ts +2 -2
  75. package/dist/types/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -3
  76. package/dist/types-ts4.5/create-editor/ErrorBoundary.d.ts +1 -1
  77. package/dist/types-ts4.5/create-editor/WithEditorView.d.ts +2 -2
  78. package/dist/types-ts4.5/create-editor/get-ui-component.d.ts +1 -1
  79. package/dist/types-ts4.5/types/extension-config.d.ts +0 -1
  80. package/dist/types-ts4.5/ui/Toolbar/Toolbar.d.ts +2 -2
  81. package/dist/types-ts4.5/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -3
  82. package/package.json +6 -6
@@ -17,7 +17,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
17
17
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
18
18
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
20
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
21
20
  var _react = _interopRequireWildcard(require("react"));
22
21
  var _react2 = require("@emotion/react");
23
22
  var _Transition = _interopRequireDefault(require("react-transition-group/Transition"));
@@ -30,20 +29,22 @@ var _document = require("../../utils/document");
30
29
  var _WithEditorActions = _interopRequireDefault(require("../WithEditorActions"));
31
30
  var _WithPluginState = _interopRequireDefault(require("../WithPluginState"));
32
31
  var _excluded = ["actions"];
33
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
34
- /** @jsx jsx */
35
32
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
36
33
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
37
34
  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; }
38
35
  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; }
39
36
  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); }; }
40
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
37
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
41
38
  var ANIM_SPEED_MS = 500;
42
39
  var EDITOR_WIDTH = _editorSharedStyles.akEditorDefaultLayoutWidth + _editorSharedStyles.akEditorBreakoutPadding;
43
40
  var WIDE_EDITOR_WIDTH = _editorSharedStyles.akEditorWideLayoutWidth + _editorSharedStyles.akEditorBreakoutPadding;
44
41
  var FULLWIDTH_MODE = 'full-width';
45
42
  var WIDE_MODE = 'wide';
46
- var absolutePanelStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right: 0;\n height: calc(100% - ", ");\n"])), _editorSharedStyles.ATLASSIAN_NAVIGATION_HEIGHT);
43
+ var absolutePanelStyles = (0, _react2.css)({
44
+ position: 'absolute',
45
+ right: 0,
46
+ height: "calc(100% - ".concat(_editorSharedStyles.ATLASSIAN_NAVIGATION_HEIGHT, ")")
47
+ });
47
48
  var checkTableExistsInDoc = function checkTableExistsInDoc(editorView) {
48
49
  var tableNodeSchema = editorView.state.schema.nodes.table;
49
50
  var findResult = (0, _utils.findChildrenByType)(editorView.state.doc, tableNodeSchema);
@@ -69,9 +70,24 @@ var shouldPanelBePositionedOverEditor = exports.shouldPanelBePositionedOverEdito
69
70
  return editorNotFullWidth && (hasSpaceForPanel || hasSpaceForWideBreakoutsAndPanel) && !isTableInDoc;
70
71
  }
71
72
  };
72
- var panelHidden = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 0;\n"])));
73
- var panel = exports.panel = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n height: 100%;\n transition: width ", "ms ", ";\n overflow: hidden;\n box-shadow: inset 2px 0 0 0 ", ";\n"])), _editorSharedStyles.akEditorContextPanelWidth, ANIM_SPEED_MS, _editorSharedStyles.akEditorSwoopCubicBezier, "var(--ds-border, ".concat(_colors.N30, ")"));
74
- var content = exports.content = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n transition: width 600ms ", ";\n box-sizing: border-box;\n padding: ", " ", " 0px;\n width: ", "px;\n height: 100%;\n overflow-y: auto;\n"])), _editorSharedStyles.akEditorSwoopCubicBezier, "var(--ds-space-200, 16px)", "var(--ds-space-200, 16px)", _editorSharedStyles.akEditorContextPanelWidth);
73
+ var panelHidden = (0, _react2.css)({
74
+ width: 0
75
+ });
76
+ var panel = exports.panel = (0, _react2.css)({
77
+ width: "".concat(_editorSharedStyles.akEditorContextPanelWidth, "px"),
78
+ height: '100%',
79
+ transition: "width ".concat(ANIM_SPEED_MS, "ms ").concat(_editorSharedStyles.akEditorSwoopCubicBezier),
80
+ overflow: 'hidden',
81
+ boxShadow: "inset 2px 0 0 0 ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
82
+ });
83
+ var content = exports.content = (0, _react2.css)({
84
+ transition: "width 600ms ".concat(_editorSharedStyles.akEditorSwoopCubicBezier),
85
+ boxSizing: 'border-box',
86
+ padding: "var(--ds-space-200, 16px)".concat(" ", "var(--ds-space-200, 16px)", " 0px"),
87
+ width: "".concat(_editorSharedStyles.akEditorContextPanelWidth, "px"),
88
+ height: '100%',
89
+ overflowY: 'auto'
90
+ });
75
91
  var SwappableContentArea = exports.SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
76
92
  (0, _inherits2.default)(SwappableContentArea, _React$PureComponent);
77
93
  var _super = _createSuper(SwappableContentArea);
@@ -12,18 +12,17 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
12
12
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
16
15
  var _react = _interopRequireDefault(require("react"));
17
16
  var _react2 = require("@emotion/react");
18
17
  var _analytics = require("@atlaskit/editor-common/analytics");
19
18
  var _utils = require("../../utils");
20
19
  var _ErrorBoundary = require("../ErrorBoundary");
21
20
  var _mountPluginHooks = require("./mount-plugin-hooks");
22
- var _templateObject;
23
- /** @jsx jsx */
24
21
  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); }; }
25
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
26
- var pluginsComponentsWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
22
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
23
+ var pluginsComponentsWrapper = (0, _react2.css)({
24
+ display: 'flex'
25
+ });
27
26
  var PluginSlot = exports.default = /*#__PURE__*/function (_React$Component) {
28
27
  (0, _inherits2.default)(PluginSlot, _React$Component);
29
28
  var _super = _createSuper(PluginSlot);
@@ -10,15 +10,17 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
10
10
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _react2 = require("@emotion/react");
16
16
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
- var _templateObject;
18
- /** @jsx jsx */
19
17
  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); }; }
20
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
- var toolbarComponentsWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n\n @media (max-width: ", "px) {\n justify-content: space-between;\n }\n"])), _editorSharedStyles.akEditorMobileMaxWidth);
18
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
19
+ var toolbarComponentsWrapper = (0, _react2.css)((0, _defineProperty2.default)({
20
+ display: 'flex'
21
+ }, "@media (max-width: ".concat(_editorSharedStyles.akEditorMobileMaxWidth, "px)"), {
22
+ justifyContent: 'space-between'
23
+ }));
22
24
  var ToolbarInner = exports.ToolbarInner = /*#__PURE__*/function (_React$Component) {
23
25
  (0, _inherits2.default)(ToolbarInner, _React$Component);
24
26
  var _super = _createSuper(ToolbarInner);
@@ -64,10 +64,13 @@ var WithFlash = exports.default = /*#__PURE__*/function (_React$Component) {
64
64
  animate = _this$props.animate,
65
65
  children = _this$props.children;
66
66
  this.toggle = animate && !this.toggle;
67
- return (0, _react2.jsx)("div", {
68
- css: animate ? flashWrapperAnimated : flashWrapper,
69
- className: this.toggle ? '-flash' : ''
70
- }, children);
67
+ return (
68
+ // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
69
+ (0, _react2.jsx)("div", {
70
+ css: animate ? flashWrapperAnimated : flashWrapper,
71
+ className: this.toggle ? '-flash' : ''
72
+ }, children)
73
+ );
71
74
  }
72
75
  }]);
73
76
  return WithFlash;
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "193.2.6";
8
+ var version = exports.version = "193.3.0";
@@ -5,43 +5,31 @@ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
5
5
  // For reasoning behind styles, see comments in:
6
6
  // ./getInlineNodeViewProducer -> portalChildren()
7
7
 
8
- export const InlineNodeViewSharedStyles = css`
9
- .${inlineNodeViewClassname} {
10
- display: inline;
11
- user-select: all;
12
- /* Collapses zero width spaces inside the inline node view
13
- to prevent the node from line breaking too early.
14
- */
15
- white-space: nowrap;
16
- /* Then reset to the Editor default so we don't interfere
17
- with any component styling. */
18
- & > *:not(.zeroWidthSpaceContainer) {
19
- white-space: pre-wrap;
8
+ export const InlineNodeViewSharedStyles = css({
9
+ [`.${inlineNodeViewClassname}`]: {
10
+ display: 'inline',
11
+ userSelect: 'all',
12
+ whiteSpace: 'nowrap',
13
+ '& > *:not(.zeroWidthSpaceContainer)': {
14
+ whiteSpace: 'pre-wrap'
15
+ },
16
+ '& > .assistive': {
17
+ userSelect: 'none'
20
18
  }
21
- // Prevent visually hidden assistive text from being selected.
22
- & > .assistive {
23
- user-select: none;
24
- }
25
- }
26
- /** Remove browser deafult selections style. This prevents
27
- unexpected visual artefacts in Safari when navigating
28
- with the keyboard or making range selections. */
29
- &.ua-safari {
30
- .${inlineNodeViewClassname} {
31
- ::selection,
32
- *::selection {
33
- background: transparent;
19
+ },
20
+ '&.ua-safari': {
21
+ [`.${inlineNodeViewClassname}`]: {
22
+ '::selection, *::selection': {
23
+ background: 'transparent'
34
24
  }
35
25
  }
36
- }
37
-
38
- &.ua-chrome .${inlineNodeViewClassname} > span {
39
- user-select: none;
40
- }
41
-
42
- .${inlineNodeViewClassname}AddZeroWidthSpace {
43
- ::after {
44
- content: '${ZERO_WIDTH_SPACE}';
26
+ },
27
+ [`&.ua-chrome .${inlineNodeViewClassname} > span`]: {
28
+ userSelect: 'none'
29
+ },
30
+ [`.${inlineNodeViewClassname}AddZeroWidthSpace`]: {
31
+ '::after': {
32
+ content: `'${ZERO_WIDTH_SPACE}'`
45
33
  }
46
34
  }
47
- `;
35
+ });
@@ -146,7 +146,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
146
146
  allowCustomPanelEdit: typeof props.allowPanel === 'object' ? props.allowPanel.allowCustomPanelEdit : false
147
147
  }], Boolean(props.allowPanel)).maybeAdd(contextPanelPlugin, Boolean(isFullPage)).maybeAdd([extensionPlugin, {
148
148
  breakoutEnabled: appearance === 'full-page' && (typeof props.allowExtension === 'object' ? props.allowExtension.allowBreakout : true) !== false,
149
- allowAutoSave: typeof props.allowExtension === 'object' ? props.allowExtension.allowAutoSave : false,
150
149
  extensionHandlers: props.extensionHandlers,
151
150
  useLongPressSelection: false,
152
151
  appearance
@@ -12,10 +12,9 @@ import { clickAreaClickHandler } from '../click-area-helper';
12
12
  const clickWrapper = ({
13
13
  isExpanded,
14
14
  minHeight
15
- }) => css`
16
- height: 100%;
17
- ${isExpanded && minHeight ? `min-height: ${minHeight}px` : ''};
18
- `;
15
+ }) => css({
16
+ height: '100%'
17
+ }, isExpanded && minHeight ? `min-height: ${minHeight}px` : '');
19
18
  /**
20
19
  * Click Area is responsible for improving UX by ensuring the user
21
20
  * can always tap beneath the content area, to insert more content.
@@ -1,12 +1,12 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N60A } from '@atlaskit/theme/colors';
3
3
  import { borderRadius } from '@atlaskit/theme/constants';
4
- export const dropdown = css`
5
- display: flex;
6
- flex-direction: column;
7
- background: ${"var(--ds-surface-overlay, white)"};
8
- border-radius: ${borderRadius()}px;
9
- box-shadow: ${`var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`};
10
- box-sizing: border-box;
11
- padding: ${"var(--ds-space-050, 4px)"} 0;
12
- `;
4
+ export const dropdown = css({
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ background: "var(--ds-surface-overlay, white)",
8
+ borderRadius: `${borderRadius()}px`,
9
+ boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`,
10
+ boxSizing: 'border-box',
11
+ padding: `${"var(--ds-space-050, 4px)"} 0`
12
+ });
@@ -1,18 +1,17 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N20, N800 } from '@atlaskit/theme/colors';
3
- export const dropdownItem = css`
4
- display: flex;
5
- align-items: center;
6
- cursor: pointer;
7
- text-decoration: none;
8
- padding: ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-400, 32px)"}
9
- ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-150, 12px)"};
10
- color: ${`var(--ds-text, ${N800})`};
11
- > span {
12
- display: flex;
13
- margin-right: ${"var(--ds-space-100, 8px)"};
3
+ export const dropdownItem = css({
4
+ display: 'flex',
5
+ alignItems: 'center',
6
+ cursor: 'pointer',
7
+ textDecoration: 'none',
8
+ padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-400, 32px)"} ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-150, 12px)"}`,
9
+ color: `var(--ds-text, ${N800})`,
10
+ '> span': {
11
+ display: 'flex',
12
+ marginRight: "var(--ds-space-100, 8px)"
13
+ },
14
+ '&:hover': {
15
+ backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N20})`
14
16
  }
15
- &:hover {
16
- background-color: ${`var(--ds-background-neutral-subtle-hovered, ${N20})`};
17
- }
18
- `;
17
+ });
@@ -8,28 +8,26 @@ import { createEditorContentStyle } from '../ContentStyles';
8
8
  import PluginSlot from '../PluginSlot';
9
9
  import { scrollbarStyles } from '../styles';
10
10
  import WithFlash from '../WithFlash';
11
- const chromelessEditor = css`
12
- line-height: 20px;
13
- height: auto;
14
-
15
- overflow-x: hidden;
16
- overflow-y: auto;
17
- ${scrollbarStyles};
18
- max-width: inherit;
19
- box-sizing: border-box;
20
- word-wrap: break-word;
21
-
22
- div > .ProseMirror {
23
- outline: none;
24
- white-space: pre-wrap;
25
- padding: 0;
26
- margin: 0;
27
-
28
- & > :last-child {
29
- padding-bottom: 0.5em;
11
+ const chromelessEditor = css({
12
+ lineHeight: '20px',
13
+ height: 'auto',
14
+ overflowX: 'hidden',
15
+ overflowY: 'auto'
16
+ }, scrollbarStyles, {
17
+ maxWidth: 'inherit',
18
+ boxSizing: 'border-box',
19
+ wordWrap: 'break-word',
20
+ 'div > .ProseMirror': {
21
+ outline: 'none',
22
+ whiteSpace: 'pre-wrap',
23
+ padding: 0,
24
+ margin: 0,
25
+ '& > :last-child': {
26
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
27
+ paddingBottom: '0.5em'
30
28
  }
31
29
  }
32
- `;
30
+ });
33
31
  const ContentArea = createEditorContentStyle();
34
32
  ContentArea.displayName = 'ContentArea';
35
33
  export default class Editor extends React.Component {
@@ -62,11 +60,11 @@ export default class Editor extends React.Component {
62
60
  return jsx(WithFlash, {
63
61
  animate: maxContentSizeReached
64
62
  }, jsx("div", {
65
- css: [chromelessEditor, maxHeight && css`
66
- max-height: ${maxHeight}px;
67
- `, css`
68
- min-height: ${minHeight}px;
69
- `],
63
+ css: [chromelessEditor, maxHeight && css({
64
+ maxHeight: `${maxHeight}px`
65
+ }), css({
66
+ minHeight: `${minHeight}px`
67
+ })],
70
68
  "data-testid": "chromeless-editor",
71
69
  ref: ref => this.containerElement = ref
72
70
  }, jsx(ContentArea, {
@@ -75,18 +75,23 @@ const StickyToolbar = props => {
75
75
  setTop(props.offsetTop || 0);
76
76
  }
77
77
  }, [props.externalToolbarRef, props.offsetTop]);
78
- return jsx("div", {
79
- css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle]
80
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
81
- ,
82
- style: {
83
- top: `${top}px`
84
- },
85
- "data-testid": "ak-editor-main-toolbar",
86
- className: 'show-keyline'
87
- }, props.children);
78
+ return (
79
+ // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
80
+ jsx("div", {
81
+ css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle]
82
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
83
+ ,
84
+ style: {
85
+ top: `${top}px`
86
+ },
87
+ "data-testid": "ak-editor-main-toolbar",
88
+ className: 'show-keyline'
89
+ }, props.children)
90
+ );
88
91
  };
89
- const FixedToolbar = props => jsx("div", {
92
+ const FixedToolbar = props =>
93
+ // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
94
+ jsx("div", {
90
95
  css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
91
96
  "data-testid": "ak-editor-main-toolbar"
92
97
  }, props.children);
@@ -4,93 +4,80 @@ export const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
4
4
  const toolbarLineHeight = 56;
5
5
 
6
6
  // box-shadow is overriden by the mainToolbar
7
- const mainToolbarWithKeyline = css`
8
- box-shadow: 0 ${akEditorToolbarKeylineHeight}px 0 0
9
- ${"var(--ds-background-accent-gray-subtlest, #F1F2F4)"};
10
- `;
11
- const mainToolbarTwoLineStyle = css`
12
- @media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
13
- flex-wrap: wrap;
14
- height: calc(${toolbarLineHeight}px * 2);
7
+ const mainToolbarWithKeyline = css({
8
+ boxShadow: `0 ${akEditorToolbarKeylineHeight}px 0 0 ${"var(--ds-background-accent-gray-subtlest, #F1F2F4)"}`
9
+ });
10
+ const mainToolbarTwoLineStyle = css({
11
+ [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
12
+ flexWrap: 'wrap',
13
+ height: `calc(${toolbarLineHeight}px * 2)`
15
14
  }
16
- `;
17
- const mainToolbar = css`
18
- position: relative;
19
- align-items: center;
20
- box-shadow: none;
21
- transition: box-shadow 200ms ${akEditorSwoopCubicBezier};
22
- z-index: ${akEditorFloatingDialogZIndex};
23
- display: flex;
24
- height: ${toolbarLineHeight}px;
25
- flex-shrink: 0;
26
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4456
27
- background-color: ${"var(--ds-surface, white)"};
28
-
29
- & object {
30
- height: 0 !important;
31
- }
32
-
33
- @media (max-width: ${akEditorMobileMaxWidth}px) {
34
- display: grid;
35
- height: calc(${toolbarLineHeight}px * 2);
15
+ });
16
+ const mainToolbar = css({
17
+ position: 'relative',
18
+ alignItems: 'center',
19
+ boxShadow: 'none',
20
+ transition: `box-shadow 200ms ${akEditorSwoopCubicBezier}`,
21
+ zIndex: akEditorFloatingDialogZIndex,
22
+ display: 'flex',
23
+ height: `${toolbarLineHeight}px`,
24
+ flexShrink: 0,
25
+ backgroundColor: "var(--ds-surface, white)",
26
+ '& object': {
27
+ height: '0 !important'
28
+ },
29
+ [`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
30
+ display: 'grid',
31
+ height: `calc(${toolbarLineHeight}px * 2)`
36
32
  }
37
- `;
33
+ });
38
34
  export const mainToolbarStyle = (showKeyline, twoLineEditorToolbar) => [mainToolbar, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle];
39
- export const mainToolbarIconBeforeStyle = css`
40
- margin: ${"var(--ds-space-200, 16px)"};
41
- height: ${"var(--ds-space-400, 32px)"};
42
- width: ${"var(--ds-space-400, 32px)"};
43
- @media (max-width: ${akEditorMobileMaxWidth}px) {
44
- grid-column: 1;
45
- grid-row: 1;
35
+ export const mainToolbarIconBeforeStyle = css({
36
+ margin: "var(--ds-space-200, 16px)",
37
+ height: "var(--ds-space-400, 32px)",
38
+ width: "var(--ds-space-400, 32px)",
39
+ [`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
40
+ gridColumn: 1,
41
+ gridRow: 1
46
42
  }
47
- `;
48
- const mainToolbarFirstChild = css`
49
- display: flex;
50
- flex-grow: 1;
51
-
52
- @media (max-width: ${akEditorMobileMaxWidth}px) {
53
- grid-column: 1;
54
- grid-row: 1;
43
+ });
44
+ const mainToolbarFirstChild = css({
45
+ display: 'flex',
46
+ flexGrow: 1,
47
+ [`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
48
+ gridColumn: 1,
49
+ gridRow: 1
55
50
  }
56
- `;
57
- const mainToolbarFirstChildTowLine = css`
58
- @media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
59
- flex: 1 1 100%;
60
- height: ${toolbarLineHeight}px;
61
- justify-content: flex-end;
62
- // ED-10241: We add fit-content to ensure that MainToolbar does not
63
- // shrink more than the size of its contents. This will prevent the
64
- // find/replace icon from being overlapped during a confluence
65
- // publish operation
66
- min-width: fit-content;
51
+ });
52
+ const mainToolbarFirstChildTowLine = css({
53
+ [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
54
+ flex: '1 1 100%',
55
+ height: `${toolbarLineHeight}px`,
56
+ justifyContent: 'flex-end',
57
+ minWidth: 'fit-content'
67
58
  }
68
- `;
59
+ });
69
60
  export const mainToolbarFirstChildStyle = twoLineEditorToolbar => [mainToolbarFirstChild, twoLineEditorToolbar && mainToolbarFirstChildTowLine];
70
- const mainToolbarSecondChild = css`
71
- // ED-10241: We add fit-content to ensure that MainToolbar does not
72
- // shrink more than the size of its contents. This will prevent the
73
- // find/replace icon from being overlapped during a confluence
74
- // publish operation
75
- min-width: fit-content;
76
- `;
77
- const mainToolbarSecondChildTwoLine = css`
78
- @media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
79
- display: flex;
80
- flex-grow: 1;
81
- flex: 1 1 100%;
82
- margin: auto;
83
- height: ${toolbarLineHeight}px;
84
- min-width: 0;
61
+ const mainToolbarSecondChild = css({
62
+ minWidth: 'fit-content'
63
+ });
64
+ const mainToolbarSecondChildTwoLine = css({
65
+ [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
66
+ display: 'flex',
67
+ flexGrow: 1,
68
+ flex: '1 1 100%',
69
+ margin: 'auto',
70
+ height: `${toolbarLineHeight}px`,
71
+ minWidth: 0
85
72
  }
86
- `;
73
+ });
87
74
  export const mainToolbarSecondChildStyle = twoLineEditorToolbar => [mainToolbarSecondChild, twoLineEditorToolbar && mainToolbarSecondChildTwoLine];
88
- export const nonCustomToolbarWrapperStyle = css`
89
- align-items: center;
90
- display: flex;
91
- flex-grow: 1;
92
- `;
93
- export const customToolbarWrapperStyle = css`
94
- align-items: center;
95
- display: flex;
96
- `;
75
+ export const nonCustomToolbarWrapperStyle = css({
76
+ alignItems: 'center',
77
+ display: 'flex',
78
+ flexGrow: 1
79
+ });
80
+ export const customToolbarWrapperStyle = css({
81
+ alignItems: 'center',
82
+ display: 'flex'
83
+ });
@@ -12,20 +12,19 @@ import WithFlash from '../WithFlash';
12
12
 
13
13
  // Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
14
14
 
15
- const mobileEditor = css`
16
- min-height: 30px;
17
- width: 100%;
18
- max-width: inherit;
19
- box-sizing: border-box;
20
- word-wrap: break-word;
21
-
22
- div > .ProseMirror {
23
- outline: none;
24
- white-space: pre-wrap;
25
- padding: 0;
26
- margin: 0;
15
+ const mobileEditor = css({
16
+ minHeight: '30px',
17
+ width: '100%',
18
+ maxWidth: 'inherit',
19
+ boxSizing: 'border-box',
20
+ wordWrap: 'break-word',
21
+ 'div > .ProseMirror': {
22
+ outline: 'none',
23
+ whiteSpace: 'pre-wrap',
24
+ padding: 0,
25
+ margin: 0
27
26
  }
28
- `;
27
+ });
29
28
  const ContentArea = createEditorContentStyle();
30
29
  ContentArea.displayName = 'ContentArea';
31
30
  export const MobileAppearance = /*#__PURE__*/forwardRef(function MobileAppearance({