@atlaskit/editor-core 191.0.9 → 191.1.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 (85) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/afm-cc/tsconfig.json +3 -6
  3. package/dist/cjs/plugins/index.js +1 -8
  4. package/dist/cjs/presets/universal.js +10 -13
  5. package/dist/cjs/ui/Addon/click-area-helper.js +2 -0
  6. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -3
  7. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +19 -6
  8. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +6 -12
  9. package/dist/cjs/version-wrapper.js +1 -1
  10. package/dist/es2019/plugins/index.js +1 -2
  11. package/dist/es2019/presets/universal.js +11 -14
  12. package/dist/es2019/ui/Addon/click-area-helper.js +2 -0
  13. package/dist/es2019/ui/Appearance/Comment/Comment.js +6 -3
  14. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +38 -6
  15. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -10
  16. package/dist/es2019/version-wrapper.js +1 -1
  17. package/dist/esm/plugins/index.js +1 -2
  18. package/dist/esm/presets/universal.js +11 -14
  19. package/dist/esm/ui/Addon/click-area-helper.js +2 -0
  20. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -3
  21. package/dist/esm/ui/Appearance/Comment/Toolbar.js +19 -6
  22. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -10
  23. package/dist/esm/version-wrapper.js +1 -1
  24. package/dist/types/plugins/index.d.ts +0 -1
  25. package/dist/types/presets/default.d.ts +6 -36
  26. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +2 -1
  27. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  28. package/dist/types-ts4.5/presets/default.d.ts +6 -36
  29. package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +2 -1
  30. package/docs/0-intro.tsx +252 -174
  31. package/docs/1-legacy-editor.tsx +268 -0
  32. package/package.json +7 -7
  33. package/dist/cjs/plugins/avatar-group/index.js +0 -40
  34. package/dist/cjs/plugins/avatar-group/messages.js +0 -14
  35. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +0 -49
  36. package/dist/cjs/plugins/avatar-group/ui/avatars-with-plugin-state.js +0 -42
  37. package/dist/cjs/plugins/avatar-group/ui/avatars.js +0 -70
  38. package/dist/cjs/plugins/avatar-group/ui/colored-avatar-item.js +0 -20
  39. package/dist/cjs/plugins/avatar-group/ui/index.js +0 -9
  40. package/dist/cjs/plugins/avatar-group/ui/invite-to-edit.js +0 -45
  41. package/dist/cjs/plugins/avatar-group/ui/styles.js +0 -17
  42. package/dist/cjs/plugins/avatar-group/ui/to-avatar.js +0 -30
  43. package/dist/es2019/plugins/avatar-group/index.js +0 -35
  44. package/dist/es2019/plugins/avatar-group/messages.js +0 -8
  45. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +0 -53
  46. package/dist/es2019/plugins/avatar-group/ui/avatars-with-plugin-state.js +0 -38
  47. package/dist/es2019/plugins/avatar-group/ui/avatars.js +0 -62
  48. package/dist/es2019/plugins/avatar-group/ui/colored-avatar-item.js +0 -13
  49. package/dist/es2019/plugins/avatar-group/ui/index.js +0 -2
  50. package/dist/es2019/plugins/avatar-group/ui/invite-to-edit.js +0 -32
  51. package/dist/es2019/plugins/avatar-group/ui/styles.js +0 -46
  52. package/dist/es2019/plugins/avatar-group/ui/to-avatar.js +0 -16
  53. package/dist/esm/plugins/avatar-group/index.js +0 -33
  54. package/dist/esm/plugins/avatar-group/messages.js +0 -8
  55. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +0 -42
  56. package/dist/esm/plugins/avatar-group/ui/avatars-with-plugin-state.js +0 -35
  57. package/dist/esm/plugins/avatar-group/ui/avatars.js +0 -62
  58. package/dist/esm/plugins/avatar-group/ui/colored-avatar-item.js +0 -13
  59. package/dist/esm/plugins/avatar-group/ui/index.js +0 -2
  60. package/dist/esm/plugins/avatar-group/ui/invite-to-edit.js +0 -34
  61. package/dist/esm/plugins/avatar-group/ui/styles.js +0 -10
  62. package/dist/esm/plugins/avatar-group/ui/to-avatar.js +0 -23
  63. package/dist/types/plugins/avatar-group/index.d.ts +0 -19
  64. package/dist/types/plugins/avatar-group/messages.d.ts +0 -7
  65. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +0 -18
  66. package/dist/types/plugins/avatar-group/ui/avatars-with-plugin-state.d.ts +0 -81
  67. package/dist/types/plugins/avatar-group/ui/avatars.d.ts +0 -17
  68. package/dist/types/plugins/avatar-group/ui/colored-avatar-item.d.ts +0 -10
  69. package/dist/types/plugins/avatar-group/ui/index.d.ts +0 -2
  70. package/dist/types/plugins/avatar-group/ui/invite-to-edit.d.ts +0 -10
  71. package/dist/types/plugins/avatar-group/ui/styles.d.ts +0 -3
  72. package/dist/types/plugins/avatar-group/ui/to-avatar.d.ts +0 -30
  73. package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +0 -19
  74. package/dist/types-ts4.5/plugins/avatar-group/messages.d.ts +0 -7
  75. package/dist/types-ts4.5/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +0 -18
  76. package/dist/types-ts4.5/plugins/avatar-group/ui/avatars-with-plugin-state.d.ts +0 -97
  77. package/dist/types-ts4.5/plugins/avatar-group/ui/avatars.d.ts +0 -19
  78. package/dist/types-ts4.5/plugins/avatar-group/ui/colored-avatar-item.d.ts +0 -12
  79. package/dist/types-ts4.5/plugins/avatar-group/ui/index.d.ts +0 -2
  80. package/dist/types-ts4.5/plugins/avatar-group/ui/invite-to-edit.d.ts +0 -10
  81. package/dist/types-ts4.5/plugins/avatar-group/ui/styles.d.ts +0 -3
  82. package/dist/types-ts4.5/plugins/avatar-group/ui/to-avatar.d.ts +0 -37
  83. /package/docs/{1-labs.tsx → 2-labs.tsx} +0 -0
  84. /package/docs/{2-autoformatting.tsx → 3-autoformatting.tsx} +0 -0
  85. /package/docs/{3-annotations.tsx → 4-annotations.tsx} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 191.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#65788](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65788) [`be744e423e9f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/be744e423e9f) - ED-21700 Extraction of avatar group plugin
8
+ - [#67194](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67194) [`37379761475c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/37379761475c) - [ED-21806] Skip changes from NCS and tinted transactions.
9
+ - Updated dependencies
10
+
11
+ ## 191.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#64683](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64683) [`79c9857b9edb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/79c9857b9edb) - [ux] [EDF-73] - Added ability for products to toggle on two-line toolbar for comment editors
16
+
3
17
  ## 191.0.9
4
18
 
5
19
  ### Patch Changes
@@ -28,12 +28,6 @@
28
28
  {
29
29
  "path": "../../../analytics/analytics-next/afm-cc/tsconfig.json"
30
30
  },
31
- {
32
- "path": "../../../design-system/avatar/afm-cc/tsconfig.json"
33
- },
34
- {
35
- "path": "../../../design-system/avatar-group/afm-cc/tsconfig.json"
36
- },
37
31
  {
38
32
  "path": "../../../design-system/button/afm-cc/tsconfig.json"
39
33
  },
@@ -52,6 +46,9 @@
52
46
  {
53
47
  "path": "../../editor-plugin-annotation/afm-cc/tsconfig.json"
54
48
  },
49
+ {
50
+ "path": "../../editor-plugin-avatar-group/afm-cc/tsconfig.json"
51
+ },
55
52
  {
56
53
  "path": "../../editor-plugin-base/afm-cc/tsconfig.json"
57
54
  },
@@ -4,17 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- Object.defineProperty(exports, "avatarGroupPlugin", {
8
- enumerable: true,
9
- get: function get() {
10
- return _avatarGroup.default;
11
- }
12
- });
13
7
  Object.defineProperty(exports, "jiraIssuePlugin", {
14
8
  enumerable: true,
15
9
  get: function get() {
16
10
  return _jiraIssue.default;
17
11
  }
18
12
  });
19
- var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
20
- var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
13
+ var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
@@ -49,6 +49,7 @@ var _editorPluginDataConsumer = require("@atlaskit/editor-plugin-data-consumer")
49
49
  var _editorPluginAnnotation = require("@atlaskit/editor-plugin-annotation");
50
50
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
51
51
  var _editorPluginCollabEdit = require("@atlaskit/editor-plugin-collab-edit");
52
+ var _editorPluginAvatarGroup = require("@atlaskit/editor-plugin-avatar-group");
52
53
  var _plugins = require("../plugins");
53
54
  var _editorPluginExtension = require("@atlaskit/editor-plugin-extension");
54
55
  var _editorPluginBeforePrimaryToolbar = require("@atlaskit/editor-plugin-before-primary-toolbar");
@@ -386,19 +387,15 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
386
387
  }]);
387
388
  }
388
389
  return builder;
389
- }).maybeAdd(_plugins.avatarGroupPlugin, function (plugin, builder) {
390
- if (!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
391
- // Avatars are moved to Confluence codebase for Edit in Context
392
- // When Edit in Context is enabled primaryToolbarComponents is undefined
393
- // For more details please check
394
- // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
395
- return builder.add([plugin, {
396
- collabEdit: props.collabEdit,
397
- takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
398
- }]);
399
- }
400
- return builder;
401
- }).maybeAdd(_editorPluginFindReplace.findReplacePlugin, function (plugin, builder) {
390
+ }).add([_editorPluginAvatarGroup.avatarGroupPlugin, {
391
+ // Avatars are moved to Confluence codebase for Edit in Context
392
+ // When Edit in Context is enabled primaryToolbarComponents is undefined
393
+ // For more details please check
394
+ // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
395
+ collabEdit: props.collabEdit,
396
+ takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
397
+ showAvatarGroup: !props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
398
+ }]).maybeAdd(_editorPluginFindReplace.findReplacePlugin, function (plugin, builder) {
402
399
  if (props.allowFindReplace) {
403
400
  return builder.add([plugin, {
404
401
  takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
@@ -7,6 +7,7 @@ exports.clickAreaClickHandler = exports.checkForModal = void 0;
7
7
  var _utils = require("@atlaskit/editor-common/utils");
8
8
  var _selection = require("@atlaskit/editor-common/selection");
9
9
  var _commands = require("@atlaskit/editor-common/commands");
10
+ var _collab = require("@atlaskit/editor-common/collab");
10
11
  // we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
11
12
  var insideContentArea = function insideContentArea(ref) {
12
13
  while (ref) {
@@ -101,6 +102,7 @@ var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClic
101
102
  (0, _commands.addParagraphAtEnd)(tr);
102
103
  }
103
104
  (0, _selection.setSelectionTopLevelBlocks)(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
105
+ (0, _collab.tintDirtyTransaction)(tr);
104
106
  if (!tr.docChanged && !tr.selectionSet) {
105
107
  return;
106
108
  }
@@ -103,6 +103,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
103
103
  //Alt + F9 to reach first element in this main toolbar
104
104
  return event.altKey && (event.key === 'F9' || event.keyCode === 120);
105
105
  };
106
+ var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
106
107
  var handleEscape = function handleEscape(event) {
107
108
  if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
108
109
  editorView === null || editorView === void 0 || editorView.focus();
@@ -117,7 +118,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
117
118
  className: "akEditor",
118
119
  ref: _this.wrapperElementRef
119
120
  }, (0, _react2.jsx)(_Toolbar2.MainToolbar, {
120
- useStickyToolbar: useStickyToolbar
121
+ useStickyToolbar: useStickyToolbar,
122
+ twoLineEditorToolbar: isTwoLineToolbarEnabled
121
123
  }, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
122
124
  editorView: editorView,
123
125
  childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
@@ -138,9 +140,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
138
140
  popupsScrollableElement: popupsScrollableElement,
139
141
  disabled: !!disabled,
140
142
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
141
- containerElement: _this.containerElement
143
+ containerElement: _this.containerElement,
144
+ twoLineEditorToolbar: isTwoLineToolbarEnabled
142
145
  }), (0, _react2.jsx)("div", {
143
- css: _Toolbar2.mainToolbarCustomComponentsSlotStyle
146
+ css: (0, _Toolbar2.mainToolbarCustomComponentsSlotStyle)(isTwoLineToolbarEnabled)
144
147
  }, customPrimaryToolbarComponents))), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
145
148
  editorView: editorView,
146
149
  editorDisabled: disabled
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.mainToolbarCustomComponentsSlotStyle = exports.TableControlsPadding = exports.MainToolbar = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
12
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
@@ -18,7 +19,11 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
18
19
  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
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
20
21
  var TableControlsPadding = exports.TableControlsPadding = 20;
21
- var mainToolbarWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n padding: ", " ", " 0;\n display: flex;\n height: auto;\n background-color: ", ";\n box-shadow: none;\n padding-left: ", ";\n\n & > div {\n > :first-child:not(style),\n > style:first-child + * {\n margin-left: 0;\n }\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-surface, white)", "var(--ds-space-250, 20px)");
22
+ var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
23
+ var mainToolbarWrapperStyle = function mainToolbarWrapperStyle() {
24
+ var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
25
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n padding: ", " ", " 0;\n display: flex;\n height: auto;\n background-color: ", ";\n box-shadow: none;\n padding-left: ", ";\n\n & > div {\n > :first-child:not(style),\n > style:first-child + * {\n margin-left: 0;\n }\n ", "\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-surface, white)", "var(--ds-space-250, 20px)", isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n flex-direction: column-reverse;\n align-items: end;\n display: flex;\n justify-content: flex-end;\n }\n\n //make this more explicit for a toolbar\n > *:nth-child(1) {\n @media (max-width: ").concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n > div:nth-child(2) {\n justify-content: flex-end;\n display: flex;\n }\n }\n }\n "));
26
+ };
22
27
  var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: sticky;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n padding-bottom: ", ";\n z-index: ", ";\n transition: box-shadow ease-in-out 0.2s;\n &.show-keyline {\n box-shadow: 0 ", "px 0 0\n ", ";\n }\n"])), "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorMenuZIndex, _editorSharedStyles.akEditorToolbarKeylineHeight, "var(--ds-border, ".concat(_colors.N30, ")"));
23
28
  var StickyToolbar = function StickyToolbar(props) {
24
29
  var _useState = (0, _react.useState)(0),
@@ -38,14 +43,14 @@ var StickyToolbar = function StickyToolbar(props) {
38
43
  }
39
44
  }, [props.externalToolbarRef, props.offsetTop]);
40
45
  return (0, _react2.jsx)("div", {
41
- css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n top: ", "px;\n "])), top)],
46
+ css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle, (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n top: ", "px;\n "])), top)],
42
47
  "data-testid": "ak-editor-main-toolbar",
43
48
  className: 'show-keyline'
44
49
  }, props.children);
45
50
  };
46
51
  var FixedToolbar = function FixedToolbar(props) {
47
52
  return (0, _react2.jsx)("div", {
48
- css: mainToolbarWrapperStyle,
53
+ css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
49
54
  "data-testid": "ak-editor-main-toolbar"
50
55
  }, props.children);
51
56
  };
@@ -79,10 +84,18 @@ var getStickyParameters = function getStickyParameters(configuration) {
79
84
  };
80
85
  var MainToolbar = exports.MainToolbar = function MainToolbar(_ref) {
81
86
  var useStickyToolbar = _ref.useStickyToolbar,
87
+ twoLineEditorToolbar = _ref.twoLineEditorToolbar,
82
88
  children = _ref.children;
83
89
  if (useStickyToolbar) {
84
- return (0, _react2.jsx)(StickyToolbar, getStickyParameters(useStickyToolbar), children);
90
+ return (0, _react2.jsx)(StickyToolbar, (0, _extends2.default)({}, getStickyParameters(useStickyToolbar), {
91
+ twoLineEditorToolbar: twoLineEditorToolbar
92
+ }), children);
85
93
  }
86
- return (0, _react2.jsx)(FixedToolbar, null, children);
94
+ return (0, _react2.jsx)(FixedToolbar, {
95
+ twoLineEditorToolbar: twoLineEditorToolbar
96
+ }, children);
87
97
  };
88
- var mainToolbarCustomComponentsSlotStyle = exports.mainToolbarCustomComponentsSlotStyle = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n padding-right: ", ";\n > div {\n display: flex;\n flex-shrink: 0;\n }\n"])), "var(--ds-space-250, 20px)");
98
+ var mainToolbarCustomComponentsSlotStyle = exports.mainToolbarCustomComponentsSlotStyle = function mainToolbarCustomComponentsSlotStyle() {
99
+ var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
100
+ return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n padding-right: ", ";\n ", "\n > div {\n display: flex;\n flex-shrink: 0;\n }\n"])), "var(--ds-space-250, 20px)", isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n {\n padding-right: 0;\n }\n }\n "));
101
+ };
@@ -10,10 +10,9 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _react2 = require("@emotion/react");
12
12
  var _reactIntlNext = require("react-intl-next");
13
- var _ui = _interopRequireDefault(require("../../../plugins/avatar-group/ui"));
14
13
  var _Toolbar = _interopRequireDefault(require("../../Toolbar"));
15
14
  var _MainToolbar = require("./MainToolbar");
16
- var _ui2 = require("@atlaskit/editor-common/ui");
15
+ var _ui = require("@atlaskit/editor-common/ui");
17
16
  var _messages = require("@atlaskit/editor-common/messages");
18
17
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
19
18
  var _context = require("../../../presets/context");
@@ -23,7 +22,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
22
  /** @jsx jsx */
24
23
 
25
24
  var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
26
- var _props$featureFlags, _props$customPrimaryT, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics;
25
+ var _props$featureFlags, _props$customPrimaryT, _props$featureFlags2, _props$featureFlags3, _editorAPI$avatarGrou, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
27
26
  var _useState = (0, _react.useState)(false),
28
27
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
29
28
  shouldSplitToolbar = _useState2[0],
@@ -56,20 +55,15 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
56
55
  css: _MainToolbar.customToolbarWrapperStyle
57
56
  }, twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? (0, _react2.jsx)(_BeforeWrapper.BeforePrimaryToolbarWrapper, {
58
57
  beforePrimaryToolbarComponents: (_props$customPrimaryT = props.customPrimaryToolbarComponents) === null || _props$customPrimaryT === void 0 ? void 0 : _props$customPrimaryT.before
59
- }) : null, props.hideAvatarGroup || (props === null || props === void 0 || (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null :
60
- // Avatars are moved to Confluence codebase for Edit in Context
58
+ }) : null, props.hideAvatarGroup || (props === null || props === void 0 || (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null : // Avatars are moved to Confluence codebase for Edit in Context
61
59
  // When Edit in Context is enabled customPrimaryToolbarComponents is undefined
62
60
  // For more details please check
63
61
  // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
64
- (0, _react2.jsx)(_ui.default, {
62
+ editorAPI === null || editorAPI === void 0 || (_editorAPI$avatarGrou = editorAPI.avatarGroup) === null || _editorAPI$avatarGrou === void 0 ? void 0 : _editorAPI$avatarGrou.actions.getToolbarItem({
65
63
  editorView: props.editorView,
66
- eventDispatcher: props.eventDispatcher,
67
64
  inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
68
65
  inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
69
- isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
70
- featureFlags: props.featureFlags || {},
71
- editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions,
72
- editorAPI: editorAPI
66
+ isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
73
67
  }), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.findReplace.actions.getToolbarButton({
74
68
  popupsBoundariesElement: props.popupsBoundariesElement,
75
69
  popupsMountPoint: props.popupsMountPoint,
@@ -103,7 +97,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
103
97
  event.preventDefault();
104
98
  event.stopPropagation();
105
99
  };
106
- return (0, _react2.jsx)(_ui2.ContextPanelConsumer, null, function (_ref) {
100
+ return (0, _react2.jsx)(_ui.ContextPanelConsumer, null, function (_ref) {
107
101
  var contextPanelWidth = _ref.width;
108
102
  return (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
109
103
  editorView: props.editorView,
@@ -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 = "191.0.9";
8
+ var version = exports.version = "191.1.3";
@@ -1,2 +1 @@
1
- export { default as jiraIssuePlugin } from './jira-issue';
2
- export { default as avatarGroupPlugin } from './avatar-group';
1
+ export { default as jiraIssuePlugin } from './jira-issue';
@@ -39,7 +39,8 @@ import { dataConsumerPlugin } from '@atlaskit/editor-plugin-data-consumer';
39
39
  import { annotationPlugin } from '@atlaskit/editor-plugin-annotation';
40
40
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
41
41
  import { collabEditPlugin } from '@atlaskit/editor-plugin-collab-edit';
42
- import { avatarGroupPlugin, jiraIssuePlugin } from '../plugins';
42
+ import { avatarGroupPlugin } from '@atlaskit/editor-plugin-avatar-group';
43
+ import { jiraIssuePlugin } from '../plugins';
43
44
  import { extensionPlugin } from '@atlaskit/editor-plugin-extension';
44
45
  import { beforePrimaryToolbarPlugin } from '@atlaskit/editor-plugin-before-primary-toolbar';
45
46
  import { feedbackDialogPlugin } from '@atlaskit/editor-plugin-feedback-dialog';
@@ -384,19 +385,15 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
384
385
  }]);
385
386
  }
386
387
  return builder;
387
- }).maybeAdd(avatarGroupPlugin, (plugin, builder) => {
388
- if (!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
389
- // Avatars are moved to Confluence codebase for Edit in Context
390
- // When Edit in Context is enabled primaryToolbarComponents is undefined
391
- // For more details please check
392
- // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
393
- return builder.add([plugin, {
394
- collabEdit: props.collabEdit,
395
- takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
396
- }]);
397
- }
398
- return builder;
399
- }).maybeAdd(findReplacePlugin, (plugin, builder) => {
388
+ }).add([avatarGroupPlugin, {
389
+ // Avatars are moved to Confluence codebase for Edit in Context
390
+ // When Edit in Context is enabled primaryToolbarComponents is undefined
391
+ // For more details please check
392
+ // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
393
+ collabEdit: props.collabEdit,
394
+ takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
395
+ showAvatarGroup: !props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
396
+ }]).maybeAdd(findReplacePlugin, (plugin, builder) => {
400
397
  if (props.allowFindReplace) {
401
398
  return builder.add([plugin, {
402
399
  takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
@@ -1,6 +1,7 @@
1
1
  import { closestElement } from '@atlaskit/editor-common/utils';
2
2
  import { setSelectionTopLevelBlocks } from '@atlaskit/editor-common/selection';
3
3
  import { addParagraphAtEnd } from '@atlaskit/editor-common/commands';
4
+ import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
4
5
 
5
6
  // we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
6
7
  const insideContentArea = ref => {
@@ -100,6 +101,7 @@ const outsideProsemirrorEditorClickHandler = (view, event) => {
100
101
  addParagraphAtEnd(tr);
101
102
  }
102
103
  setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
104
+ tintDirtyTransaction(tr);
103
105
  if (!tr.docChanged && !tr.selectionSet) {
104
106
  return;
105
107
  }
@@ -128,6 +128,7 @@ class Editor extends React.Component {
128
128
  //Alt + F9 to reach first element in this main toolbar
129
129
  return event.altKey && (event.key === 'F9' || event.keyCode === 120);
130
130
  };
131
+ const isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
131
132
  const handleEscape = event => {
132
133
  if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
133
134
  editorView === null || editorView === void 0 ? void 0 : editorView.focus();
@@ -144,7 +145,8 @@ class Editor extends React.Component {
144
145
  className: "akEditor",
145
146
  ref: this.wrapperElementRef
146
147
  }, jsx(MainToolbar, {
147
- useStickyToolbar: useStickyToolbar
148
+ useStickyToolbar: useStickyToolbar,
149
+ twoLineEditorToolbar: isTwoLineToolbarEnabled
148
150
  }, jsx(ToolbarArrowKeyNavigationProvider, {
149
151
  editorView: editorView,
150
152
  childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
@@ -165,9 +167,10 @@ class Editor extends React.Component {
165
167
  popupsScrollableElement: popupsScrollableElement,
166
168
  disabled: !!disabled,
167
169
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
168
- containerElement: this.containerElement
170
+ containerElement: this.containerElement,
171
+ twoLineEditorToolbar: isTwoLineToolbarEnabled
169
172
  }), jsx("div", {
170
- css: mainToolbarCustomComponentsSlotStyle
173
+ css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
171
174
  }, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
172
175
  editorView: editorView,
173
176
  editorDisabled: disabled
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /** @jsx jsx */
2
3
 
3
4
  import React, { useEffect, useState } from 'react';
@@ -5,7 +6,8 @@ import { css, jsx } from '@emotion/react';
5
6
  import { N30 } from '@atlaskit/theme/colors';
6
7
  import { akEditorToolbarKeylineHeight, akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
7
8
  export const TableControlsPadding = 20;
8
- const mainToolbarWrapperStyle = css`
9
+ const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
10
+ const mainToolbarWrapperStyle = (isTwoLineEditorToolbar = false) => css`
9
11
  position: relative;
10
12
  align-items: center;
11
13
  padding: ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0;
@@ -20,6 +22,24 @@ const mainToolbarWrapperStyle = css`
20
22
  > style:first-child + * {
21
23
  margin-left: 0;
22
24
  }
25
+ ${isTwoLineEditorToolbar && `
26
+ @media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
27
+ flex-direction: column-reverse;
28
+ align-items: end;
29
+ display: flex;
30
+ justify-content: flex-end;
31
+ }
32
+
33
+ //make this more explicit for a toolbar
34
+ > *:nth-child(1) {
35
+ @media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
36
+ > div:nth-child(2) {
37
+ justify-content: flex-end;
38
+ display: flex;
39
+ }
40
+ }
41
+ }
42
+ `}
23
43
  }
24
44
 
25
45
  .block-type-btn {
@@ -54,7 +74,7 @@ const StickyToolbar = props => {
54
74
  }
55
75
  }, [props.externalToolbarRef, props.offsetTop]);
56
76
  return jsx("div", {
57
- css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, css`
77
+ css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle, css`
58
78
  top: ${top}px;
59
79
  `],
60
80
  "data-testid": "ak-editor-main-toolbar",
@@ -62,7 +82,7 @@ const StickyToolbar = props => {
62
82
  }, props.children);
63
83
  };
64
84
  const FixedToolbar = props => jsx("div", {
65
- css: mainToolbarWrapperStyle,
85
+ css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
66
86
  "data-testid": "ak-editor-main-toolbar"
67
87
  }, props.children);
68
88
 
@@ -95,19 +115,31 @@ const getStickyParameters = configuration => {
95
115
  };
96
116
  export const MainToolbar = ({
97
117
  useStickyToolbar,
118
+ twoLineEditorToolbar,
98
119
  children
99
120
  }) => {
100
121
  if (useStickyToolbar) {
101
- return jsx(StickyToolbar, getStickyParameters(useStickyToolbar), children);
122
+ return jsx(StickyToolbar, _extends({}, getStickyParameters(useStickyToolbar), {
123
+ twoLineEditorToolbar: twoLineEditorToolbar
124
+ }), children);
102
125
  }
103
- return jsx(FixedToolbar, null, children);
126
+ return jsx(FixedToolbar, {
127
+ twoLineEditorToolbar: twoLineEditorToolbar
128
+ }, children);
104
129
  };
105
- export const mainToolbarCustomComponentsSlotStyle = css`
130
+ export const mainToolbarCustomComponentsSlotStyle = (isTwoLineEditorToolbar = false) => css`
106
131
  display: flex;
107
132
  justify-content: flex-end;
108
133
  align-items: center;
109
134
  flex-grow: 1;
110
135
  padding-right: ${"var(--ds-space-250, 20px)"};
136
+ ${isTwoLineEditorToolbar && `
137
+ @media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
138
+ {
139
+ padding-right: 0;
140
+ }
141
+ }
142
+ `}
111
143
  > div {
112
144
  display: flex;
113
145
  flex-shrink: 0;
@@ -3,7 +3,6 @@
3
3
  import React, { useState, useEffect } from 'react';
4
4
  import { jsx } from '@emotion/react';
5
5
  import { injectIntl } from 'react-intl-next';
6
- import AvatarsWithPluginState from '../../../plugins/avatar-group/ui';
7
6
  import Toolbar from '../../Toolbar';
8
7
  import { mainToolbarStyle, mainToolbarIconBeforeStyle, mainToolbarFirstChildStyle, mainToolbarSecondChildStyle, nonCustomToolbarWrapperStyle, customToolbarWrapperStyle, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
9
8
  import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
@@ -12,7 +11,7 @@ import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-me
12
11
  import { usePresetContext } from '../../../presets/context';
13
12
  import { BeforePrimaryToolbarWrapper } from './BeforeWrapper';
14
13
  export const EditorToolbar = /*#__PURE__*/React.memo(props => {
15
- var _props$featureFlags, _props$customPrimaryT, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics;
14
+ var _props$featureFlags, _props$customPrimaryT, _props$featureFlags2, _props$featureFlags3, _editorAPI$avatarGrou, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
16
15
  const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
17
16
  const editorAPI = usePresetContext();
18
17
 
@@ -42,20 +41,15 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
42
41
  css: customToolbarWrapperStyle
43
42
  }, twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? jsx(BeforePrimaryToolbarWrapper, {
44
43
  beforePrimaryToolbarComponents: (_props$customPrimaryT = props.customPrimaryToolbarComponents) === null || _props$customPrimaryT === void 0 ? void 0 : _props$customPrimaryT.before
45
- }) : null, props.hideAvatarGroup || (props === null || props === void 0 ? void 0 : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null :
46
- // Avatars are moved to Confluence codebase for Edit in Context
44
+ }) : null, props.hideAvatarGroup || (props === null || props === void 0 ? void 0 : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null : // Avatars are moved to Confluence codebase for Edit in Context
47
45
  // When Edit in Context is enabled customPrimaryToolbarComponents is undefined
48
46
  // For more details please check
49
47
  // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
50
- jsx(AvatarsWithPluginState, {
48
+ editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$avatarGrou = editorAPI.avatarGroup) === null || _editorAPI$avatarGrou === void 0 ? void 0 : _editorAPI$avatarGrou.actions.getToolbarItem({
51
49
  editorView: props.editorView,
52
- eventDispatcher: props.eventDispatcher,
53
50
  inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
54
51
  inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
55
- isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
56
- featureFlags: props.featureFlags || {},
57
- editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions,
58
- editorAPI: editorAPI
52
+ isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
59
53
  }), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.findReplace.actions.getToolbarButton({
60
54
  popupsBoundariesElement: props.popupsBoundariesElement,
61
55
  popupsMountPoint: props.popupsMountPoint,
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "191.0.9";
2
+ export const version = "191.1.3";
@@ -1,2 +1 @@
1
- export { default as jiraIssuePlugin } from './jira-issue';
2
- export { default as avatarGroupPlugin } from './avatar-group';
1
+ export { default as jiraIssuePlugin } from './jira-issue';
@@ -43,7 +43,8 @@ import { dataConsumerPlugin } from '@atlaskit/editor-plugin-data-consumer';
43
43
  import { annotationPlugin } from '@atlaskit/editor-plugin-annotation';
44
44
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
45
45
  import { collabEditPlugin } from '@atlaskit/editor-plugin-collab-edit';
46
- import { avatarGroupPlugin, jiraIssuePlugin } from '../plugins';
46
+ import { avatarGroupPlugin } from '@atlaskit/editor-plugin-avatar-group';
47
+ import { jiraIssuePlugin } from '../plugins';
47
48
  import { extensionPlugin } from '@atlaskit/editor-plugin-extension';
48
49
  import { beforePrimaryToolbarPlugin } from '@atlaskit/editor-plugin-before-primary-toolbar';
49
50
  import { feedbackDialogPlugin } from '@atlaskit/editor-plugin-feedback-dialog';
@@ -378,19 +379,15 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
378
379
  }]);
379
380
  }
380
381
  return builder;
381
- }).maybeAdd(avatarGroupPlugin, function (plugin, builder) {
382
- if (!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
383
- // Avatars are moved to Confluence codebase for Edit in Context
384
- // When Edit in Context is enabled primaryToolbarComponents is undefined
385
- // For more details please check
386
- // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
387
- return builder.add([plugin, {
388
- collabEdit: props.collabEdit,
389
- takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
390
- }]);
391
- }
392
- return builder;
393
- }).maybeAdd(findReplacePlugin, function (plugin, builder) {
382
+ }).add([avatarGroupPlugin, {
383
+ // Avatars are moved to Confluence codebase for Edit in Context
384
+ // When Edit in Context is enabled primaryToolbarComponents is undefined
385
+ // For more details please check
386
+ // https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
387
+ collabEdit: props.collabEdit,
388
+ takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
389
+ showAvatarGroup: !props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
390
+ }]).maybeAdd(findReplacePlugin, function (plugin, builder) {
394
391
  if (props.allowFindReplace) {
395
392
  return builder.add([plugin, {
396
393
  takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
@@ -1,6 +1,7 @@
1
1
  import { closestElement } from '@atlaskit/editor-common/utils';
2
2
  import { setSelectionTopLevelBlocks } from '@atlaskit/editor-common/selection';
3
3
  import { addParagraphAtEnd } from '@atlaskit/editor-common/commands';
4
+ import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
4
5
 
5
6
  // we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
6
7
  var insideContentArea = function insideContentArea(ref) {
@@ -96,6 +97,7 @@ var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClic
96
97
  addParagraphAtEnd(tr);
97
98
  }
98
99
  setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
100
+ tintDirtyTransaction(tr);
99
101
  if (!tr.docChanged && !tr.selectionSet) {
100
102
  return;
101
103
  }
@@ -93,6 +93,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
93
93
  //Alt + F9 to reach first element in this main toolbar
94
94
  return event.altKey && (event.key === 'F9' || event.keyCode === 120);
95
95
  };
96
+ var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
96
97
  var handleEscape = function handleEscape(event) {
97
98
  if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
98
99
  editorView === null || editorView === void 0 || editorView.focus();
@@ -107,7 +108,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
107
108
  className: "akEditor",
108
109
  ref: _this.wrapperElementRef
109
110
  }, jsx(MainToolbar, {
110
- useStickyToolbar: useStickyToolbar
111
+ useStickyToolbar: useStickyToolbar,
112
+ twoLineEditorToolbar: isTwoLineToolbarEnabled
111
113
  }, jsx(ToolbarArrowKeyNavigationProvider, {
112
114
  editorView: editorView,
113
115
  childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
@@ -128,9 +130,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
128
130
  popupsScrollableElement: popupsScrollableElement,
129
131
  disabled: !!disabled,
130
132
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
131
- containerElement: _this.containerElement
133
+ containerElement: _this.containerElement,
134
+ twoLineEditorToolbar: isTwoLineToolbarEnabled
132
135
  }), jsx("div", {
133
- css: mainToolbarCustomComponentsSlotStyle
136
+ css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
134
137
  }, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
135
138
  editorView: editorView,
136
139
  editorDisabled: disabled