@atlaskit/editor-core 207.21.2 → 207.22.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 (35) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +77 -2
  3. package/dist/cjs/ui/Appearance/Comment/Comment.js +29 -5
  4. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +64 -12
  5. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +1 -2
  6. package/dist/cjs/ui/ContentStyles/index.js +3 -10
  7. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +4 -4
  8. package/dist/cjs/ui/EditorContentContainer/styles/list.js +2 -11
  9. package/dist/cjs/ui/EditorContentContainer/styles/placeholderStyles.js +16 -1
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/es2019/create-editor/ReactEditorView.js +53 -0
  12. package/dist/es2019/ui/Appearance/Comment/Comment.js +43 -2
  13. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +70 -24
  14. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -2
  15. package/dist/es2019/ui/ContentStyles/index.js +3 -9
  16. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +6 -6
  17. package/dist/es2019/ui/EditorContentContainer/styles/list.js +0 -9
  18. package/dist/es2019/ui/EditorContentContainer/styles/placeholderStyles.js +15 -0
  19. package/dist/es2019/version-wrapper.js +1 -1
  20. package/dist/esm/create-editor/ReactEditorView.js +77 -2
  21. package/dist/esm/ui/Appearance/Comment/Comment.js +29 -2
  22. package/dist/esm/ui/Appearance/Comment/Toolbar.js +62 -10
  23. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -2
  24. package/dist/esm/ui/ContentStyles/index.js +4 -11
  25. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +6 -6
  26. package/dist/esm/ui/EditorContentContainer/styles/list.js +1 -10
  27. package/dist/esm/ui/EditorContentContainer/styles/placeholderStyles.js +15 -0
  28. package/dist/esm/version-wrapper.js +1 -1
  29. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +0 -1
  30. package/dist/types/ui/EditorContentContainer/styles/list.d.ts +0 -1
  31. package/dist/types/ui/EditorContentContainer/styles/placeholderStyles.d.ts +1 -0
  32. package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +0 -1
  33. package/dist/types-ts4.5/ui/EditorContentContainer/styles/list.d.ts +0 -1
  34. package/dist/types-ts4.5/ui/EditorContentContainer/styles/placeholderStyles.d.ts +1 -0
  35. package/package.json +10 -38
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 207.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#170958](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170958)
8
+ [`0b7ee494d452a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0b7ee494d452a) -
9
+ [ux] Update fake text-selection styles to use system highlight colours (behind feature gate)
10
+
11
+ ### Patch Changes
12
+
13
+ - [#167340](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/167340)
14
+ [`c56340c1e531b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c56340c1e531b) -
15
+ [ED-28168] Refactor dynamic styles in comment toolbar to static emotion
16
+ - Updated dependencies
17
+
18
+ ## 207.21.3
19
+
20
+ ### Patch Changes
21
+
22
+ - [#172260](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172260)
23
+ [`ab178138e93db`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab178138e93db) -
24
+ revert list layout shift fix
25
+ - Updated dependencies
26
+
3
27
  ## 207.21.2
4
28
 
5
29
  ### Patch Changes
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.ReactEditorView = ReactEditorView;
9
9
  exports.default = void 0;
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
13
  var _react = _interopRequireWildcard(require("react"));
@@ -27,6 +28,7 @@ var _document = require("@atlaskit/editor-common/utils/document");
27
28
  var _state2 = require("@atlaskit/editor-prosemirror/state");
28
29
  var _view = require("@atlaskit/editor-prosemirror/view");
29
30
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
31
+ var _interactionMetrics = require("@atlaskit/react-ufo/interaction-metrics");
30
32
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
31
33
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
32
34
  var _useProviders = require("../composable-editor/hooks/useProviders");
@@ -45,6 +47,9 @@ var _handleEditorFocus = require("./ReactEditorView/handleEditorFocus");
45
47
  var _useDispatchTransaction = require("./ReactEditorView/useDispatchTransaction");
46
48
  var _useFireFullWidthEvent = require("./ReactEditorView/useFireFullWidthEvent");
47
49
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
50
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
51
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
52
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
48
53
  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; }
49
54
  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; }
50
55
  var EDIT_AREA_ID = 'ak-editor-textarea';
@@ -498,7 +503,77 @@ function ReactEditorView(props) {
498
503
  }
499
504
  }
500
505
  }, [editorView, shouldFocus, __livePage, mitigateScrollJump]);
506
+ var scrollElement = _react.default.useRef();
507
+ var possibleListeners = _react.default.useRef([]);
508
+ _react.default.useEffect(function () {
509
+ return function () {
510
+ if ((0, _platformFeatureFlags.fg)('cc_editor_abort_ufo_load_on_editor_scroll')) {
511
+ if (scrollElement.current) {
512
+ // eslint-disable-next-line react-hooks/exhaustive-deps
513
+ var _iterator = _createForOfIteratorHelper(possibleListeners.current),
514
+ _step;
515
+ try {
516
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
517
+ var _scrollElement$curren;
518
+ var possibleListener = _step.value;
519
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
520
+ (_scrollElement$curren = scrollElement.current) === null || _scrollElement$curren === void 0 || _scrollElement$curren.removeEventListener.apply(_scrollElement$curren, (0, _toConsumableArray2.default)(possibleListener));
521
+ }
522
+ } catch (err) {
523
+ _iterator.e(err);
524
+ } finally {
525
+ _iterator.f();
526
+ }
527
+ }
528
+ scrollElement.current = null;
529
+ }
530
+ };
531
+ }, []);
501
532
  var handleEditorViewRef = (0, _react.useCallback)(function (node) {
533
+ if ((0, _platformFeatureFlags.fg)('cc_editor_abort_ufo_load_on_editor_scroll')) {
534
+ if (node) {
535
+ scrollElement.current = document.querySelector('[data-editor-scroll-container]');
536
+ var cleanupListeners = function cleanupListeners() {
537
+ // eslint-disable-next-line react-hooks/exhaustive-deps
538
+ var _iterator2 = _createForOfIteratorHelper(possibleListeners.current),
539
+ _step2;
540
+ try {
541
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
542
+ var _scrollElement$curren2;
543
+ var possibleListener = _step2.value;
544
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
545
+ (_scrollElement$curren2 = scrollElement.current) === null || _scrollElement$curren2 === void 0 || _scrollElement$curren2.removeEventListener.apply(_scrollElement$curren2, (0, _toConsumableArray2.default)(possibleListener));
546
+ }
547
+ } catch (err) {
548
+ _iterator2.e(err);
549
+ } finally {
550
+ _iterator2.f();
551
+ }
552
+ };
553
+ if (scrollElement.current) {
554
+ var wheelAbortHandler = function wheelAbortHandler() {
555
+ var activeInteraction = (0, _interactionMetrics.getActiveInteraction)();
556
+ if (activeInteraction && ['edit-page', 'live-edit'].includes(activeInteraction.ufoName)) {
557
+ (0, _interactionMetrics.abortAll)('new_interaction', "wheel-on-editor-element");
558
+ }
559
+ cleanupListeners();
560
+ };
561
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
562
+ scrollElement.current.addEventListener('wheel', wheelAbortHandler);
563
+ possibleListeners.current.push(['wheel', wheelAbortHandler]);
564
+ var scrollAbortHandler = function scrollAbortHandler() {
565
+ var activeInteraction = (0, _interactionMetrics.getActiveInteraction)();
566
+ if (activeInteraction && ['edit-page', 'live-edit'].includes(activeInteraction.ufoName)) {
567
+ (0, _interactionMetrics.abortAll)('new_interaction', "scroll-on-editor-element");
568
+ }
569
+ cleanupListeners();
570
+ };
571
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
572
+ scrollElement.current.addEventListener('scroll', scrollAbortHandler);
573
+ possibleListeners.current.push(['scroll', scrollAbortHandler]);
574
+ }
575
+ }
576
+ }
502
577
  if (!viewRef.current && node) {
503
578
  // make sure this doesn't expose the experiment
504
579
  if ((0, _experiments.editorExperiment)('platform_editor_nodevisibility', true, {
@@ -509,8 +584,8 @@ function ReactEditorView(props) {
509
584
  var view = createEditorView(node);
510
585
  if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
511
586
  if (mitigateScrollJump) {
512
- var scrollElement = document.querySelector('[data-editor-scroll-container]');
513
- scrollElement === null || scrollElement === void 0 || scrollElement.scrollTo({
587
+ var _scrollElement = document.querySelector('[data-editor-scroll-container]');
588
+ _scrollElement === null || _scrollElement === void 0 || _scrollElement.scrollTo({
514
589
  top: originalScrollToRestore.current,
515
590
  behavior: 'instant'
516
591
  });
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.CommentEditorWithIntl = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
12
  var _react = _interopRequireWildcard(require("react"));
11
13
  var _react2 = require("@emotion/react");
12
14
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -22,6 +24,7 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
22
24
  var _commonStyles = require("@atlaskit/editor-plugins/table/ui/common-styles");
23
25
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
26
  var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
27
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
25
28
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
26
29
  var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
27
30
  var _contentComponentWrapper = require("../../Addon/ClickAreaBlock/contentComponentWrapper");
@@ -32,18 +35,17 @@ var _getPrimaryToolbarComponents = require("../../Toolbar/getPrimaryToolbarCompo
32
35
  var _ToolbarWithSizeDetector = require("../../Toolbar/ToolbarWithSizeDetector");
33
36
  var _WithFlash = _interopRequireDefault(require("../../WithFlash"));
34
37
  var _Toolbar = require("./Toolbar");
35
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
38
+ var _templateObject;
36
39
  /**
37
40
  * @jsxRuntime classic
38
41
  * @jsx jsx
39
42
  */
40
-
41
43
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
42
-
43
44
  // Ignored via go/ees005
44
45
  // eslint-disable-next-line import/no-named-as-default
45
-
46
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
46
47
  var CommentEditorMargin = 14;
48
+ var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
47
49
  var commentEditorStyles = (0, _react2.css)({
48
50
  display: 'flex',
49
51
  flexDirection: 'column',
@@ -89,6 +91,27 @@ var secondaryToolbarStyles = (0, _react2.css)({
89
91
  display: 'flex',
90
92
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
91
93
  });
94
+ var mainToolbarCustomComponentsSlotStyle = function mainToolbarCustomComponentsSlotStyle() {
95
+ var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
96
+ return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
97
+ (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\tdisplay: flex;\n\t\tjustify-content: flex-end;\n\t\talign-items: center;\n\t\tflex-grow: 1;\n\t\tpadding-right: ", ";\n\t\t> div {\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t", "\n\t"])), "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 "))
98
+ );
99
+ };
100
+ var mainToolbarCustomComponentsSlotStyleNew = (0, _react2.css)({
101
+ display: 'flex',
102
+ justifyContent: 'flex-end',
103
+ alignItems: 'center',
104
+ flexGrow: 1,
105
+ paddingRight: "var(--ds-space-250, 20px)",
106
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
107
+ '> div': {
108
+ display: 'flex',
109
+ flexShrink: 0
110
+ }
111
+ });
112
+ var mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew = (0, _react2.css)((0, _defineProperty2.default)({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
113
+ paddingRight: 0
114
+ }));
92
115
  var appearance = 'comment';
93
116
  var EditorContainer = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
94
117
  return (0, _experiments.editorExperiment)('platform_editor_core_static_emotion', true, {
@@ -243,7 +266,8 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
243
266
  containerElement: containerElement.current,
244
267
  twoLineEditorToolbar: isTwoLineToolbarEnabled
245
268
  }), (0, _react2.jsx)("div", {
246
- css: (0, _Toolbar.mainToolbarCustomComponentsSlotStyle)(isTwoLineToolbarEnabled)
269
+ css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew] : /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
270
+ mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
247
271
  }, customPrimaryToolbarComponents))), (0, _react2.jsx)(_ClickAreaBlock.default, {
248
272
  editorView: editorView,
249
273
  editorDisabled: disabled
@@ -5,16 +5,17 @@ var _typeof3 = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.mainToolbarCustomComponentsSlotStyle = exports.MainToolbar = void 0;
8
+ exports.MainToolbar = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
13
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
14
  var _react = _interopRequireWildcard(require("react"));
14
15
  var _react2 = require("@emotion/react");
15
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _templateObject, _templateObject2, _templateObject3;
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
+ var _templateObject, _templateObject2;
18
19
  /**
19
20
  * @jsxRuntime classic
20
21
  * @jsx jsx
@@ -22,6 +23,8 @@ var _templateObject, _templateObject2, _templateObject3;
22
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
23
24
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
25
  var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
26
+ var akEditorMenuZIndex = 500;
27
+ var akEditorToolbarKeylineHeight = 2;
25
28
 
26
29
  /* eslint-disable @atlaskit/platform/ensure-feature-flag-registration */
27
30
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
@@ -29,10 +32,63 @@ var mainToolbarWrapperStyle = function mainToolbarWrapperStyle() {
29
32
  var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
30
33
  return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tposition: relative;\n\talign-items: center;\n\tpadding: ", " ", " 0;\n\tdisplay: flex;\n\theight: auto;\n\tbackground-color: ", ";\n\tbox-shadow: none;\n\tpadding-left: ", ";\n\n\t& > div {\n\t\t> :first-child:not(style),\n\t\t> style:first-child + * {\n\t\t\tmargin-left: 0;\n\t\t}\n\t\t", "\n\t}\n\n\t.block-type-btn {\n\t\tpadding-left: 0;\n\t}\n\n\t", "\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 "), (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && 'span svg { max-width: 100%; }');
31
34
  };
35
+ var mainToolbarWrapperStyleNew = (0, _react2.css)({
36
+ position: 'relative',
37
+ alignItems: 'center',
38
+ padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " 0"),
39
+ display: 'flex',
40
+ height: 'auto',
41
+ backgroundColor: "var(--ds-surface, white)",
42
+ boxShadow: 'none',
43
+ paddingLeft: "var(--ds-space-250, 20px)",
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
45
+ '> div': {
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
47
+ '> div:first-of-type:not(style), > style:first-of-type + *': {
48
+ marginLeft: 0
49
+ }
50
+ },
51
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
52
+ '.block-type-btn': {
53
+ paddingLeft: 0
54
+ }
55
+ });
56
+ var mainToolbarTwoLineStylesNew = (0, _react2.css)({
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
58
+ '& > div': (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
59
+ flexDirection: 'column-reverse',
60
+ alignItems: 'end',
61
+ display: 'flex',
62
+ justifyContent: 'flex-end'
63
+ }), '> div:first-of-type', (0, _defineProperty2.default)({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
64
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
65
+ '> div:nth-of-type(2)': {
66
+ justifyContent: 'flex-end',
67
+ display: 'flex'
68
+ }
69
+ }))
70
+ });
71
+ var mainToolbarWrapperStylesVisualRefresh = (0, _react2.css)({
72
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
73
+ 'span svg': {
74
+ maxWidth: '100%'
75
+ }
76
+ });
77
+
32
78
  /* eslint-enable @atlaskit/platform/ensure-feature-flag-registration */
33
79
 
34
80
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
35
- var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t/* stylelint-disable declaration-block-no-duplicate-properties */\n\tposition: relative;\n\tposition: sticky;\n\t/* stylelint-enable declaration-block-no-duplicate-properties */\n\tpadding-bottom: ", ";\n\tz-index: ", ";\n\ttransition: box-shadow ease-in-out 0.2s;\n\t&.show-keyline {\n\t\tbox-shadow: 0 ", "px 0 0\n\t\t\t", ";\n\t}\n"])), "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorMenuZIndex, _editorSharedStyles.akEditorToolbarKeylineHeight, "var(--ds-background-accent-gray-subtlest, #F1F2F4)");
81
+ var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t/* stylelint-disable declaration-block-no-duplicate-properties */\n\tposition: relative;\n\tposition: sticky;\n\t/* stylelint-enable declaration-block-no-duplicate-properties */\n\tpadding-bottom: ", ";\n\tz-index: ", ";\n\ttransition: box-shadow ease-in-out 0.2s;\n\t&.show-keyline {\n\t\tbox-shadow: 0 ", "px 0 0\n\t\t\t", ";\n\t}\n"])), "var(--ds-space-100, 8px)", akEditorMenuZIndex, akEditorToolbarKeylineHeight, "var(--ds-background-accent-gray-subtlest, #F1F2F4)");
82
+ var stickyToolbarWrapperStyleNew = (0, _react2.css)({
83
+ position: 'sticky',
84
+ paddingBottom: "var(--ds-space-100, 8px)",
85
+ zIndex: akEditorMenuZIndex,
86
+ transition: 'box-shadow ease-in-out 0.2s',
87
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
88
+ '&.show-keyline': {
89
+ boxShadow: "0 ".concat(akEditorToolbarKeylineHeight, "px 0 0 ", "var(--ds-background-accent-gray-subtlest, #F1F2F4)")
90
+ }
91
+ });
36
92
  var StickyToolbar = function StickyToolbar(props) {
37
93
  var _useState = (0, _react.useState)(0),
38
94
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -53,8 +109,9 @@ var StickyToolbar = function StickyToolbar(props) {
53
109
  return (
54
110
  // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
55
111
  (0, _react2.jsx)("div", {
112
+ css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew] :
56
113
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
57
- css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle]
114
+ [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle]
58
115
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
59
116
  ,
60
117
  style: {
@@ -71,8 +128,9 @@ var FixedToolbar = function FixedToolbar(props) {
71
128
  return (
72
129
  // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
73
130
  (0, _react2.jsx)("div", {
131
+ css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh] :
74
132
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
75
- css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
133
+ mainToolbarWrapperStyle(props.twoLineEditorToolbar),
76
134
  "data-testid": "ak-editor-main-toolbar"
77
135
  }, props.children)
78
136
  );
@@ -120,10 +178,4 @@ var MainToolbar = exports.MainToolbar = function MainToolbar(_ref) {
120
178
  return (0, _react2.jsx)(FixedToolbar, {
121
179
  twoLineEditorToolbar: twoLineEditorToolbar
122
180
  }, children);
123
- };
124
- var mainToolbarCustomComponentsSlotStyle = exports.mainToolbarCustomComponentsSlotStyle = function mainToolbarCustomComponentsSlotStyle() {
125
- var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
126
- return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
127
- (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\tdisplay: flex;\n\t\tjustify-content: flex-end;\n\t\talign-items: center;\n\t\tflex-grow: 1;\n\t\tpadding-right: ", ";\n\t\t> div {\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t", "\n\t"])), "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 "))
128
- );
129
181
  };
@@ -13,7 +13,6 @@ var _reactIntlNext = require("react-intl-next");
13
13
  var _messages = require("@atlaskit/editor-common/messages");
14
14
  var _ui = require("@atlaskit/editor-common/ui");
15
15
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
16
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
17
  var _ToolbarPortal = require("../../Toolbar/ToolbarPortal");
19
18
  var _ToolbarWithSizeDetector = require("../../Toolbar/ToolbarWithSizeDetector");
@@ -74,7 +73,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
74
73
  css: _MainToolbar.customToolbarWrapperStyle
75
74
  }, !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? (0, _react2.jsx)(_BeforeWrapper.BeforePrimaryToolbarWrapper, {
76
75
  beforePrimaryToolbarComponents: (_props$customPrimaryT = props.customPrimaryToolbarComponents) === null || _props$customPrimaryT === void 0 ? void 0 : _props$customPrimaryT.before
77
- }) : null, !((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_find_and_replace_duplication')) && editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.findReplace.actions.registerToolbarButton({
76
+ }) : null, !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.findReplace.actions.registerToolbarButton({
78
77
  popupsBoundariesElement: props.popupsBoundariesElement,
79
78
  popupsMountPoint: popupsMountPoint,
80
79
  popupsScrollableElement: props.popupsScrollableElement,
@@ -152,9 +152,9 @@ var akEditorBreakpointForSmallDevice = "1266px";
152
152
  // Under editor experiment platform_editor_core_static_emotion
153
153
  // If you are making changes to this file, please make sure to update in EditorContentContainer.tsx as well
154
154
  var legacyContentStyles = function legacyContentStyles(props) {
155
- return (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n /* Switch between the two icons based on the visual refresh feature gate */\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t/* For FullPage only when inside a table\n\tRelated code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\tIn the \"editorContentAreaContainerStyle\" function */\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), _editorSharedStyles.akEditorGutterPadding, (0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), _editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth, _editorSharedStyles.akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, _editorSharedStyles.akEditorCalculatedWideLayoutWidth, (0, _editorSharedStyles.editorFontSize)({
155
+ return (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n /* Switch between the two icons based on the visual refresh feature gate */\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t/* For FullPage only when inside a table\n\tRelated code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\tIn the \"editorContentAreaContainerStyle\" function */\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), _editorSharedStyles.akEditorGutterPadding, (0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), _editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth, _editorSharedStyles.akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, _editorSharedStyles.akEditorCalculatedWideLayoutWidth, (0, _editorSharedStyles.editorFontSize)({
156
156
  theme: props.theme
157
- }), _styles.whitespaceSharedStyles, (0, _styles.paragraphSharedStyles)(props.typographyTheme), _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject0 || (_templateObject0 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject1 || (_templateObject1 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", (0, _platformFeatureFlags.fg)('platform_editor_fix_floating_toolbar_focus') ? firstFloatingToolbarButtonStyles : null, _styles5.placeholderTextStyles, placeholderStyles, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(props.typographyTheme), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), (0, _media.mediaStyles)(), (0, _layout.layoutStyles)(props.viewMode), (0, _platformFeatureFlags.fg)('confluence_team_presence_scroll_to_pointer') ? _collab.telepointerStyle : _collab.telepointerStyleWithInitialOnly, _selection.gapCursorStyles, (0, _panel2.panelStyles)(), mentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
157
+ }), _styles.whitespaceSharedStyles, (0, _styles.paragraphSharedStyles)(props.typographyTheme), _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject0 || (_templateObject0 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject1 || (_templateObject1 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", (0, _platformFeatureFlags.fg)('platform_editor_fix_floating_toolbar_focus') ? firstFloatingToolbarButtonStyles : null, _styles5.placeholderTextStyles, (0, _platformFeatureFlags.fg)('platform_editor_system_fake_text_highlight_colour') && _styles5.placeholderTextStyles_fg_platform_editor_system_fake_text_highlight_colour, placeholderStyles, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(props.typographyTheme), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), (0, _media.mediaStyles)(), (0, _layout.layoutStyles)(props.viewMode), (0, _platformFeatureFlags.fg)('confluence_team_presence_scroll_to_pointer') ? _collab.telepointerStyle : _collab.telepointerStyleWithInitialOnly, _selection.gapCursorStyles, (0, _panel2.panelStyles)(), mentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
158
158
  exposure: false
159
159
  }) && vanillaMentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
160
160
  exposure: false
@@ -170,13 +170,6 @@ var legacyContentStyles = function legacyContentStyles(props) {
170
170
  exposure: false
171
171
  }) && !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithoutVisualRefresh, _status.statusStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? (0, _status.vanillaStatusStyles)() : null, (0, _styles.annotationSharedStyles)(), (0, _styles.smartCardStyles)(), (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? (0, _styles.getSmartCardSharedStyles)() : _styles.smartCardSharedStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? _date.dateVanillaStyles : null, _date.dateStyles, (0, _styles.embedCardStyles)(), _styles.unsupportedStyles, _styles.resizerStyles, (0, _styles.pragmaticResizerStyles)(), (0, _styles.pragmaticStylesLayoutFirstNodeResizeHandleFix)(), (0, _styles.pragmaticResizerStylesForTooltip)(), (0, _aiPanels.aiPanelStyles)(props.colorMode), firstBlockNodeStylesNew, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT, !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? (0, _react2.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
172
172
  };
173
- var listLayoutShiftFix = (0, _react2.css)({
174
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
175
- '.ProseMirror ul, .ProseMirror ol': {
176
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
177
- marginTop: '10px'
178
- }
179
- });
180
173
  var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
181
174
  return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
182
175
  var className = props.className,
@@ -209,7 +202,7 @@ var createEditorContentStyle = exports.createEditorContentStyle = function creat
209
202
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
210
203
  className: className,
211
204
  ref: ref,
212
- css: [memoizedStyle, styles, (0, _platformFeatureFlags.fg)('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
205
+ css: [memoizedStyle, styles],
213
206
  "data-testid": "editor-content-container"
214
207
  }, children);
215
208
  });
@@ -112,7 +112,9 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
112
112
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
113
113
  (0, _platformFeatureFlags.fg)('platform_editor_fix_floating_toolbar_focus') && _floatingToolbarStyles.firstFloatingToolbarButtonStyles,
114
114
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
115
- _placeholderStyles.placeholderTextStyles,
115
+ _placeholderStyles.placeholderTextStyles, (0, _platformFeatureFlags.fg)('platform_editor_system_fake_text_highlight_colour') &&
116
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
117
+ _placeholderStyles.placeholderTextStylesMixin_fg_platform_editor_system_fake_text_highlight_colour,
116
118
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
117
119
  _placeholderStyles.placeholderStyles,
118
120
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
@@ -306,9 +308,7 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
306
308
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
307
309
  isFullPage && _fullPageEditorStyles.fullPageEditorStyles,
308
310
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
309
- isFullPage && _scrollbarStyles.scrollbarStyles,
310
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
311
- (0, _platformFeatureFlags.fg)('platform_editor_ssr_fix_lists') && _list.listLayoutShiftFix, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ?
311
+ isFullPage && _scrollbarStyles.scrollbarStyles, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ?
312
312
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
313
313
  _codeBlockStyles.firstCodeBlockWithNoMargin :
314
314
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.listsStylesSafariFix = exports.listsStyles = exports.listLayoutShiftFix = void 0;
7
+ exports.listsStylesSafariFix = exports.listsStyles = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
10
  // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
@@ -147,13 +147,4 @@ var listsStylesSafariFix = exports.listsStylesSafariFix = (0, _react.css)((0, _d
147
147
  }), ".ProseMirror:not(.".concat(BLOCK_CARD_CONTAINER, ") > li > p:first-child, .ProseMirror:not(.").concat(BLOCK_CARD_CONTAINER, ") > li > .code-block:first-child, .ProseMirror:not(.").concat(BLOCK_CARD_CONTAINER, ") > li > .ProseMirror-gapcursor:first-child + .code-block"), {
148
148
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
149
149
  marginTop: "-".concat(akEditorLineHeight, "em !important")
150
- }));
151
-
152
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
153
- var listLayoutShiftFix = exports.listLayoutShiftFix = (0, _react.css)({
154
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
155
- '.ProseMirror ul, .ProseMirror ol': {
156
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
157
- marginTop: '10px'
158
- }
159
- });
150
+ }));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.placeholderWrapStyles = exports.placeholderTextStyles = exports.placeholderStyles = exports.placeholderOverflowStyles = void 0;
6
+ exports.placeholderWrapStyles = exports.placeholderTextStylesMixin_fg_platform_editor_system_fake_text_highlight_colour = exports.placeholderTextStyles = exports.placeholderStyles = exports.placeholderOverflowStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
9
9
 
@@ -71,6 +71,21 @@ var placeholderTextStyles = exports.placeholderTextStyles = (0, _react.css)({
71
71
  }
72
72
  });
73
73
 
74
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
75
+ var placeholderTextStylesMixin_fg_platform_editor_system_fake_text_highlight_colour = exports.placeholderTextStylesMixin_fg_platform_editor_system_fake_text_highlight_colour = (0, _react.css)({
76
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
77
+ '.ProseMirror': {
78
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
79
+ '.ProseMirror-fake-text-selection': {
80
+ // Follow the system highlight colour to match native text selection
81
+ backgroundColor: 'Highlight',
82
+ // We should also match the text colour to the system highlight text colour.
83
+ // That way if the system highlight background is dark, the text will still be readable.
84
+ color: 'HighlightText'
85
+ }
86
+ }
87
+ });
88
+
74
89
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
75
90
  var placeholderStyles = exports.placeholderStyles = (0, _react.css)({
76
91
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
@@ -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 = "207.21.1";
8
+ var version = exports.version = "207.22.0";
@@ -16,6 +16,7 @@ import { isEmptyDocument } from '@atlaskit/editor-common/utils/document';
16
16
  import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
17
17
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
18
18
  import { fg } from '@atlaskit/platform-feature-flags';
19
+ import { abortAll, getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
19
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
20
21
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
22
  import { useProviders } from '../composable-editor/hooks/useProviders';
@@ -469,7 +470,59 @@ export function ReactEditorView(props) {
469
470
  }
470
471
  }
471
472
  }, [editorView, shouldFocus, __livePage, mitigateScrollJump]);
473
+ const scrollElement = React.useRef();
474
+ const possibleListeners = React.useRef([]);
475
+ React.useEffect(() => {
476
+ return () => {
477
+ if (fg('cc_editor_abort_ufo_load_on_editor_scroll')) {
478
+ if (scrollElement.current) {
479
+ // eslint-disable-next-line react-hooks/exhaustive-deps
480
+ for (const possibleListener of possibleListeners.current) {
481
+ var _scrollElement$curren;
482
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
483
+ (_scrollElement$curren = scrollElement.current) === null || _scrollElement$curren === void 0 ? void 0 : _scrollElement$curren.removeEventListener(...possibleListener);
484
+ }
485
+ }
486
+ scrollElement.current = null;
487
+ }
488
+ };
489
+ }, []);
472
490
  const handleEditorViewRef = useCallback(node => {
491
+ if (fg('cc_editor_abort_ufo_load_on_editor_scroll')) {
492
+ if (node) {
493
+ scrollElement.current = document.querySelector('[data-editor-scroll-container]');
494
+ const cleanupListeners = () => {
495
+ // eslint-disable-next-line react-hooks/exhaustive-deps
496
+ for (const possibleListener of possibleListeners.current) {
497
+ var _scrollElement$curren2;
498
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
499
+ (_scrollElement$curren2 = scrollElement.current) === null || _scrollElement$curren2 === void 0 ? void 0 : _scrollElement$curren2.removeEventListener(...possibleListener);
500
+ }
501
+ };
502
+ if (scrollElement.current) {
503
+ const wheelAbortHandler = () => {
504
+ const activeInteraction = getActiveInteraction();
505
+ if (activeInteraction && ['edit-page', 'live-edit'].includes(activeInteraction.ufoName)) {
506
+ abortAll('new_interaction', `wheel-on-editor-element`);
507
+ }
508
+ cleanupListeners();
509
+ };
510
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
511
+ scrollElement.current.addEventListener('wheel', wheelAbortHandler);
512
+ possibleListeners.current.push(['wheel', wheelAbortHandler]);
513
+ const scrollAbortHandler = () => {
514
+ const activeInteraction = getActiveInteraction();
515
+ if (activeInteraction && ['edit-page', 'live-edit'].includes(activeInteraction.ufoName)) {
516
+ abortAll('new_interaction', `scroll-on-editor-element`);
517
+ }
518
+ cleanupListeners();
519
+ };
520
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
521
+ scrollElement.current.addEventListener('scroll', scrollAbortHandler);
522
+ possibleListeners.current.push(['scroll', scrollAbortHandler]);
523
+ }
524
+ }
525
+ }
473
526
  if (!viewRef.current && node) {
474
527
  // make sure this doesn't expose the experiment
475
528
  if (editorExperiment('platform_editor_nodevisibility', true, {