@atlaskit/editor-common 66.0.5 → 68.0.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 (83) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/cjs/styles/shared/annotation.js +12 -7
  3. package/dist/cjs/styles/shared/block-marks.js +1 -1
  4. package/dist/cjs/styles/shared/blockquote.js +3 -1
  5. package/dist/cjs/styles/shared/code-mark.js +4 -2
  6. package/dist/cjs/styles/shared/column-layout.js +1 -1
  7. package/dist/cjs/styles/shared/rule.js +4 -2
  8. package/dist/cjs/styles/shared/shadow.js +3 -1
  9. package/dist/cjs/styles/shared/table.js +18 -16
  10. package/dist/cjs/styles/shared/task-decision.js +1 -1
  11. package/dist/cjs/ui/BaseTheme/index.js +4 -21
  12. package/dist/cjs/ui/Caption/index.js +4 -2
  13. package/dist/cjs/ui/Expand/index.js +20 -18
  14. package/dist/cjs/ui/Messages/index.js +5 -3
  15. package/dist/cjs/ui/OverflowShadow/index.js +49 -11
  16. package/dist/cjs/ui/OverflowShadow/shadowObserver.js +107 -0
  17. package/dist/cjs/ui/UnsupportedBlock/index.js +3 -1
  18. package/dist/cjs/ui/UnsupportedInline/index.js +3 -1
  19. package/dist/cjs/ui/index.js +14 -0
  20. package/dist/cjs/utils/breakout.js +2 -2
  21. package/dist/cjs/utils/unsupportedContent/get-unsupported-content-level-data.js +3 -3
  22. package/dist/cjs/utils/validate-using-spec.js +2 -2
  23. package/dist/cjs/version.json +1 -1
  24. package/dist/es2019/styles/shared/annotation.js +17 -7
  25. package/dist/es2019/styles/shared/block-marks.js +1 -1
  26. package/dist/es2019/styles/shared/blockquote.js +3 -1
  27. package/dist/es2019/styles/shared/code-mark.js +3 -2
  28. package/dist/es2019/styles/shared/column-layout.js +1 -0
  29. package/dist/es2019/styles/shared/panel.js +2 -0
  30. package/dist/es2019/styles/shared/rule.js +3 -2
  31. package/dist/es2019/styles/shared/shadow.js +14 -0
  32. package/dist/es2019/styles/shared/table.js +22 -18
  33. package/dist/es2019/styles/shared/task-decision.js +1 -0
  34. package/dist/es2019/ui/BaseTheme/index.js +3 -21
  35. package/dist/es2019/ui/Caption/index.js +3 -2
  36. package/dist/es2019/ui/Expand/index.js +19 -17
  37. package/dist/es2019/ui/Messages/index.js +4 -3
  38. package/dist/es2019/ui/OverflowShadow/index.js +48 -12
  39. package/dist/es2019/ui/OverflowShadow/shadowObserver.js +82 -0
  40. package/dist/es2019/ui/UnsupportedBlock/index.js +3 -2
  41. package/dist/es2019/ui/UnsupportedInline/index.js +3 -2
  42. package/dist/es2019/ui/index.js +1 -0
  43. package/dist/es2019/utils/breakout.js +1 -1
  44. package/dist/es2019/utils/unsupportedContent/get-unsupported-content-level-data.js +1 -1
  45. package/dist/es2019/utils/validate-using-spec.js +1 -1
  46. package/dist/es2019/version.json +1 -1
  47. package/dist/esm/styles/shared/annotation.js +11 -7
  48. package/dist/esm/styles/shared/block-marks.js +1 -1
  49. package/dist/esm/styles/shared/blockquote.js +2 -1
  50. package/dist/esm/styles/shared/code-mark.js +3 -2
  51. package/dist/esm/styles/shared/column-layout.js +1 -1
  52. package/dist/esm/styles/shared/panel.js +2 -0
  53. package/dist/esm/styles/shared/rule.js +3 -2
  54. package/dist/esm/styles/shared/shadow.js +4 -1
  55. package/dist/esm/styles/shared/table.js +20 -16
  56. package/dist/esm/styles/shared/task-decision.js +1 -1
  57. package/dist/esm/ui/BaseTheme/index.js +4 -22
  58. package/dist/esm/ui/Caption/index.js +3 -2
  59. package/dist/esm/ui/Expand/index.js +19 -18
  60. package/dist/esm/ui/Messages/index.js +4 -3
  61. package/dist/esm/ui/OverflowShadow/index.js +50 -11
  62. package/dist/esm/ui/OverflowShadow/shadowObserver.js +98 -0
  63. package/dist/esm/ui/UnsupportedBlock/index.js +2 -1
  64. package/dist/esm/ui/UnsupportedInline/index.js +2 -1
  65. package/dist/esm/ui/index.js +1 -0
  66. package/dist/esm/utils/breakout.js +2 -2
  67. package/dist/esm/utils/unsupportedContent/get-unsupported-content-level-data.js +1 -1
  68. package/dist/esm/utils/validate-using-spec.js +1 -1
  69. package/dist/esm/version.json +1 -1
  70. package/dist/types/extensions/manifest-helpers.d.ts +1 -1
  71. package/dist/types/extensions/module-helpers.d.ts +1 -1
  72. package/dist/types/extensions/types/extension-handler.d.ts +1 -1
  73. package/dist/types/extensions/types/extension-manifest-toolbar-item.d.ts +1 -1
  74. package/dist/types/extensions/types/extension-manifest.d.ts +1 -1
  75. package/dist/types/extensions/types/utils.d.ts +1 -1
  76. package/dist/types/provider-factory/autoformatting-provider.d.ts +1 -1
  77. package/dist/types/ui/BaseTheme/index.d.ts +2 -4
  78. package/dist/types/ui/OverflowShadow/index.d.ts +10 -3
  79. package/dist/types/ui/OverflowShadow/shadowObserver.d.ts +27 -0
  80. package/dist/types/ui/index.d.ts +1 -0
  81. package/dist/types/utils/unsupportedContent/get-unsupported-content-level-data.d.ts +1 -1
  82. package/dist/types/utils/validate-using-spec.d.ts +2 -1
  83. package/package.json +15 -13
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.shadowObserverClassNames = exports.ShadowObserver = exports.ShadowKeys = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _defineProperty3 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
16
+ var ShadowKeys;
17
+ exports.ShadowKeys = ShadowKeys;
18
+
19
+ (function (ShadowKeys) {
20
+ ShadowKeys["SHOW_LEFT_SHADOW"] = "showLeftShadow";
21
+ ShadowKeys["SHOW_RIGHT_SHADOW"] = "showRightShadow";
22
+ })(ShadowKeys || (exports.ShadowKeys = ShadowKeys = {}));
23
+
24
+ var shadowObserverClassNames = {
25
+ SENTINEL_LEFT: 'sentinel-left',
26
+ SENTINEL_RIGHT: 'sentinel-right',
27
+ SHADOW_CONTAINER: 'with-shadow-observer'
28
+ };
29
+ exports.shadowObserverClassNames = shadowObserverClassNames;
30
+
31
+ var requestIdleCallback = function requestIdleCallback(fn) {
32
+ return window.requestIdleCallback ? window.requestIdleCallback(fn) : window.requestAnimationFrame(fn);
33
+ };
34
+
35
+ var cancelIdleCallback = function cancelIdleCallback(id) {
36
+ return window.cancelIdleCallback ? window.cancelIdleCallback(id) : window.cancelAnimationFrame(id);
37
+ };
38
+
39
+ var ShadowObserver = /*#__PURE__*/function () {
40
+ function ShadowObserver(_ref) {
41
+ var _defineProperty2,
42
+ _this = this;
43
+
44
+ var scrollContainer = _ref.scrollContainer,
45
+ onUpdateShadows = _ref.onUpdateShadows;
46
+ (0, _classCallCheck2.default)(this, ShadowObserver);
47
+ (0, _defineProperty3.default)(this, "sentinels", {});
48
+ (0, _defineProperty3.default)(this, "shadowStates", (_defineProperty2 = {}, (0, _defineProperty3.default)(_defineProperty2, ShadowKeys.SHOW_LEFT_SHADOW, false), (0, _defineProperty3.default)(_defineProperty2, ShadowKeys.SHOW_RIGHT_SHADOW, false), _defineProperty2));
49
+ (0, _defineProperty3.default)(this, "init", function () {
50
+ if (!_this.scrollContainer || _this.intersectionObserver) {
51
+ return;
52
+ }
53
+
54
+ _this.sentinels.right = document.createElement('div');
55
+
56
+ _this.sentinels.right.classList.add(shadowObserverClassNames.SENTINEL_RIGHT);
57
+
58
+ _this.scrollContainer.appendChild(_this.sentinels.right);
59
+
60
+ _this.sentinels.left = document.createElement('div');
61
+
62
+ _this.sentinels.left.classList.add(shadowObserverClassNames.SENTINEL_LEFT);
63
+
64
+ _this.scrollContainer.prepend(_this.sentinels.left);
65
+
66
+ _this.intersectionObserver = new IntersectionObserver(function (entries, _) {
67
+ entries.forEach(_this.onIntersect);
68
+ }, {
69
+ root: _this.scrollContainer
70
+ });
71
+
72
+ _this.intersectionObserver.observe(_this.sentinels.left);
73
+
74
+ _this.intersectionObserver.observe(_this.sentinels.right);
75
+ });
76
+ (0, _defineProperty3.default)(this, "onIntersect", function (entry) {
77
+ _this.requestCallbackId = requestIdleCallback(function () {
78
+ if (entry.target.classList.contains(shadowObserverClassNames.SENTINEL_LEFT)) {
79
+ _this.shadowStates[ShadowKeys.SHOW_LEFT_SHADOW] = !entry.isIntersecting;
80
+ }
81
+
82
+ if (entry.target.classList.contains(shadowObserverClassNames.SENTINEL_RIGHT)) {
83
+ _this.shadowStates[ShadowKeys.SHOW_RIGHT_SHADOW] = !entry.isIntersecting;
84
+ }
85
+
86
+ _this.onUpdateShadows(_this.shadowStates);
87
+ });
88
+ });
89
+ this.scrollContainer = scrollContainer;
90
+ this.onUpdateShadows = onUpdateShadows;
91
+ this.init();
92
+ }
93
+
94
+ (0, _createClass2.default)(ShadowObserver, [{
95
+ key: "dispose",
96
+ value: function dispose() {
97
+ if (this.intersectionObserver) {
98
+ this.intersectionObserver.disconnect();
99
+ this.intersectionObserver = undefined;
100
+ this.requestCallbackId && cancelIdleCallback(this.requestCallbackId);
101
+ }
102
+ }
103
+ }]);
104
+ return ShadowObserver;
105
+ }();
106
+
107
+ exports.ShadowObserver = ShadowObserver;
@@ -25,6 +25,8 @@ var _colors = require("@atlaskit/theme/colors");
25
25
 
26
26
  var _constants = require("@atlaskit/theme/constants");
27
27
 
28
+ var _tokens = require("@atlaskit/tokens");
29
+
28
30
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
29
31
 
30
32
  var _unsupportedContent = require("../../messages/unsupportedContent");
@@ -41,7 +43,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
41
43
 
42
44
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
43
45
 
44
- var blockNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: flex;\n font-size: ", ";\n margin: 10px 0;\n min-height: 24px;\n padding: 10px;\n text-align: center;\n vertical-align: text-bottom;\n min-width: 120px;\n align-items: center;\n justify-content: center;\n"])), _colors.N30, _colors.N50, (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
46
+ var blockNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: flex;\n font-size: ", ";\n margin: 10px 0;\n min-height: 24px;\n padding: 10px;\n text-align: center;\n vertical-align: text-bottom;\n min-width: 120px;\n align-items: center;\n justify-content: center;\n"])), (0, _tokens.token)('color.background.disabled', _colors.N30), (0, _tokens.token)('color.border.disabled', _colors.N50), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
45
47
 
46
48
  var UnsupportedBlockNode = function UnsupportedBlockNode(_ref) {
47
49
  var node = _ref.node,
@@ -25,6 +25,8 @@ var _colors = require("@atlaskit/theme/colors");
25
25
 
26
26
  var _constants = require("@atlaskit/theme/constants");
27
27
 
28
+ var _tokens = require("@atlaskit/tokens");
29
+
28
30
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
29
31
 
30
32
  var _unsupportedContent = require("../../messages/unsupportedContent");
@@ -41,7 +43,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
41
43
 
42
44
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
43
45
 
44
- var inlineNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 2px;\n min-height: 24px;\n padding: 0 10px;\n vertical-align: middle;\n white-space: nowrap;\n"])), _colors.N30, _colors.N50, (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
46
+ var inlineNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 2px;\n min-height: 24px;\n padding: 0 10px;\n vertical-align: middle;\n white-space: nowrap;\n"])), (0, _tokens.token)('color.background.disabled', _colors.N30), (0, _tokens.token)('color.border.disabled', _colors.N50), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
45
47
 
46
48
  var UnsupportedInlineNode = function UnsupportedInlineNode(_ref) {
47
49
  var node = _ref.node,
@@ -85,6 +85,12 @@ Object.defineProperty(exports, "REACT_INTL_ERROR_MESSAGE", {
85
85
  return _IntlErrorBoundary.REACT_INTL_ERROR_MESSAGE;
86
86
  }
87
87
  });
88
+ Object.defineProperty(exports, "ShadowObserver", {
89
+ enumerable: true,
90
+ get: function get() {
91
+ return _shadowObserver.ShadowObserver;
92
+ }
93
+ });
88
94
  Object.defineProperty(exports, "UnsupportedBlock", {
89
95
  enumerable: true,
90
96
  get: function get() {
@@ -205,6 +211,12 @@ Object.defineProperty(exports, "shadowClassNames", {
205
211
  return _OverflowShadow.shadowClassNames;
206
212
  }
207
213
  });
214
+ Object.defineProperty(exports, "shadowObserverClassNames", {
215
+ enumerable: true,
216
+ get: function get() {
217
+ return _shadowObserver.shadowObserverClassNames;
218
+ }
219
+ });
208
220
  Object.defineProperty(exports, "sharedExpandStyles", {
209
221
  enumerable: true,
210
222
  get: function get() {
@@ -260,6 +272,8 @@ var _WidthProvider = require("./WidthProvider");
260
272
 
261
273
  var _OverflowShadow = _interopRequireWildcard(require("./OverflowShadow"));
262
274
 
275
+ var _shadowObserver = require("./OverflowShadow/shadowObserver");
276
+
263
277
  var _WithCreateAnalyticsEvent = require("./WithCreateAnalyticsEvent");
264
278
 
265
279
  var _Expand = require("./Expand");
@@ -38,8 +38,8 @@ var breakoutConsts = {
38
38
  return '100%';
39
39
  }
40
40
  },
41
- calcLineLength: function calcLineLength(containerWidth, allowDynamicTextSizing) {
42
- return allowDynamicTextSizing && containerWidth ? breakoutConsts.mapBreakpointToLayoutMaxWidth(breakoutConsts.getBreakpoint(containerWidth)) : breakoutConsts.defaultLayoutWidth;
41
+ calcLineLength: function calcLineLength() {
42
+ return breakoutConsts.defaultLayoutWidth;
43
43
  },
44
44
  calcWideWidth: function calcWideWidth() {
45
45
  var containerWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : breakoutConsts.defaultLayoutWidth;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getUnsupportedContentLevelData = exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS = exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY = void 0;
7
7
 
8
- var _adfUtils = require("@atlaskit/adf-utils");
8
+ var _traverse = require("@atlaskit/adf-utils/traverse");
9
9
 
10
10
  var UNSUPPORTED_CONTENT_LEVEL_SEVERITY;
11
11
  exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY = UNSUPPORTED_CONTENT_LEVEL_SEVERITY;
@@ -32,7 +32,7 @@ var buildUnsupportedContentLevelThresholds = function buildUnsupportedContentLev
32
32
  var countSupportedUnsupportedNodes = function countSupportedUnsupportedNodes(validDocument) {
33
33
  var unsupportedNodes = 0;
34
34
  var supportedNodes = 0;
35
- (0, _adfUtils.traverse)(validDocument, {
35
+ (0, _traverse.traverse)(validDocument, {
36
36
  any: function any(node) {
37
37
  var unsupportedNodeTypes = ['unsupportedInline', 'unsupportedBlock', 'confluenceUnsupportedInline', 'confluenceUnsupportedBlock'];
38
38
 
@@ -45,7 +45,7 @@ var countSupportedUnsupportedNodes = function countSupportedUnsupportedNodes(val
45
45
  // start an independent traversal for the purpose of counting
46
46
  // unsupported content nodes (with nested children contributing towards
47
47
  // that count)
48
- (0, _adfUtils.traverse)(originalNode, {
48
+ (0, _traverse.traverse)(originalNode, {
49
49
  any: function any() {
50
50
  unsupportedNodes++;
51
51
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.validationErrorHandler = exports.validateADFEntity = exports.UNSUPPORTED_NODE_ATTRIBUTE = void 0;
7
7
  exports.wrapWithUnsupported = wrapWithUnsupported;
8
8
 
9
- var _adfUtils = require("@atlaskit/adf-utils");
9
+ var _validator = require("@atlaskit/adf-utils/validator");
10
10
 
11
11
  var _analytics = require("./analytics");
12
12
 
@@ -126,7 +126,7 @@ function trackValidationError(dispatchAnalyticsEvent, error, entity) {
126
126
  var validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyticsEvent) {
127
127
  var nodes = Object.keys(schema.nodes);
128
128
  var marks = Object.keys(schema.marks);
129
- var validate = (0, _adfUtils.validator)(nodes, marks, {
129
+ var validate = (0, _validator.validator)(nodes, marks, {
130
130
  allowPrivateAttributes: true
131
131
  });
132
132
  var emptyDoc = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "66.0.5",
3
+ "version": "68.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,7 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
3
3
  import { themed } from '@atlaskit/theme/components';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const annotationPrefix = 'ak-editor-annotation';
5
6
  export const AnnotationSharedClassNames = {
6
7
  focus: `${annotationPrefix}-focus`,
@@ -14,16 +15,22 @@ const Y200a = 'rgba(255, 196, 0, 0.82)';
14
15
  const DY75a = 'rgba(111, 92, 37, 0.5)';
15
16
  const DY200 = '#82641c';
16
17
  export const AnnotationSharedCSSByState = props => ({
18
+ /* eslint-disable */
17
19
  focus: css`
20
+ // Background is not coming through in confluence, suspecting to be caused by some specific combination of
21
+ // emotion and token look up
22
+
18
23
  background: ${themed({
19
24
  light: Y75,
20
25
  dark: DY75
21
26
  })(props)};
22
- border-bottom: 2px solid ${themed({
23
- light: Y300,
24
- dark: DY300
27
+ border-bottom: 2px solid
28
+ ${themed({
29
+ light: token('color.border.accent.yellow', Y300),
30
+ dark: token('color.border.accent.yellow', DY300)
25
31
  })(props)};
26
- box-shadow: 1px 2px 3px ${N60A}, -1px 2px 3px ${N60A};
32
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4147
33
+ box-shadow: ${token('elevation.shadow.overlay', `1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`)};
27
34
  cursor: pointer;
28
35
  `,
29
36
  blur: css`
@@ -31,12 +38,15 @@ export const AnnotationSharedCSSByState = props => ({
31
38
  light: Y75a,
32
39
  dark: DY75a
33
40
  })(props)};
34
- border-bottom: 2px solid ${themed({
35
- light: Y200a,
36
- dark: DY200
41
+ border-bottom: 2px solid
42
+ ${themed({
43
+ light: token('color.border.accent.yellow', Y200a),
44
+ dark: token('color.border.accent.yellow', DY200)
37
45
  })(props)};
38
46
  cursor: pointer;
39
47
  `
48
+ /* eslint-enable */
49
+
40
50
  });
41
51
  export const annotationSharedStyles = props => css`
42
52
  .ProseMirror {
@@ -6,7 +6,7 @@ export const blockMarksSharedStyles = css`
6
6
  */
7
7
  *:not(.fabric-editor-block-mark) >,
8
8
  /* For nested block marks */
9
- *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-child {
9
+ *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-of-type {
10
10
  p,
11
11
  h1,
12
12
  h2,
@@ -1,11 +1,13 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { akEditorBlockquoteBorderColor, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const blockquoteSharedStyles = css`
5
6
  & blockquote {
6
7
  box-sizing: border-box;
7
8
  padding-left: ${gridSize() * 2}px;
8
- border-left: 2px solid ${akEditorBlockquoteBorderColor};
9
+ border-left: 2px solid
10
+ ${token('color.border', akEditorBlockquoteBorderColor)};
9
11
  margin: ${blockNodesVerticalMargin} 0 0 0;
10
12
  margin-right: 0;
11
13
 
@@ -2,13 +2,14 @@ import { css } from '@emotion/react';
2
2
  import { getCodeStyles } from '@atlaskit/code/inline';
3
3
  import { DN70, N30A } from '@atlaskit/theme/colors';
4
4
  import { getTheme, themed } from '@atlaskit/theme/components';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const codeMarkSharedStyles = props => {
6
7
  const theme = getTheme(props);
7
8
  return css`
8
9
  .code {
9
10
  --ds--code--bg-color: ${themed({
10
- light: N30A,
11
- dark: DN70
11
+ light: token('color.background.neutral', N30A),
12
+ dark: token('color.background.neutral', DN70)
12
13
  })(props)};
13
14
  ${getCodeStyles(theme)}
14
15
  }
@@ -2,6 +2,7 @@ import { css } from '@emotion/react';
2
2
  import { gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
3
3
  const columnLayoutSharedStyle = css`
4
4
  [data-layout-section] {
5
+ position: relative;
5
6
  display: flex;
6
7
  flex-direction: row;
7
8
  & > * {
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
1
3
  import { css } from '@emotion/react';
2
4
  import { PanelType } from '@atlaskit/adf-schema';
3
5
  import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
@@ -2,9 +2,10 @@ import { css } from '@emotion/react';
2
2
  import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
3
3
  import { DN50, N30A } from '@atlaskit/theme/colors';
4
4
  import { themed } from '@atlaskit/theme/components';
5
+ import { token } from '@atlaskit/tokens';
5
6
  const divider = themed({
6
- light: N30A,
7
- dark: DN50
7
+ light: token('color.border', N30A),
8
+ dark: token('color.border', DN50)
8
9
  }); // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
9
10
 
10
11
  export const ruleSharedStyles = props => css`
@@ -1,7 +1,10 @@
1
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4116
1
3
  import { css } from '@emotion/react';
2
4
  import { akEditorShadowZIndex } from '@atlaskit/editor-shared-styles';
3
5
  import { N40A } from '@atlaskit/theme/colors';
4
6
  import { shadowClassNames } from '../../ui/OverflowShadow';
7
+ import { shadowObserverClassNames } from '../../ui/OverflowShadow/shadowObserver';
5
8
  const shadowWidth = 8;
6
9
  /**
7
10
  * TODO: This is close to working and removes a tone of JS from OverflowShadow component
@@ -54,5 +57,16 @@ const shadowSharedStyle = css`
54
57
  top: 0px;
55
58
  display: block;
56
59
  }
60
+ & .${shadowObserverClassNames.SENTINEL_LEFT} {
61
+ height: 100%;
62
+ width: 0px;
63
+ min-width: 0px;
64
+ }
65
+
66
+ & .${shadowObserverClassNames.SENTINEL_RIGHT} {
67
+ height: 100%;
68
+ width: 0px;
69
+ min-width: 0px;
70
+ }
57
71
  `;
58
72
  export { shadowSharedStyle };
@@ -1,9 +1,13 @@
1
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
3
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4153
1
4
  import { css } from '@emotion/react';
2
5
  import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
3
6
  import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
4
7
  import { DN20 } from '@atlaskit/theme/colors';
5
8
  import { themed } from '@atlaskit/theme/components';
6
9
  import { gridSize } from '@atlaskit/theme/constants';
10
+ import { token } from '@atlaskit/tokens';
7
11
  import browser from '../../utils/browser';
8
12
  export const tableMarginTop = 24;
9
13
  export const tableMarginBottom = 16;
@@ -36,7 +40,7 @@ const tableSharedStyle = props => css`
36
40
  /**
37
41
  * Fix block top alignment inside table cells.
38
42
  */
39
- .decisionItemView-content-wrap:first-child > div {
43
+ .decisionItemView-content-wrap:first-of-type > div {
40
44
  margin-top: 0;
41
45
  }
42
46
  }
@@ -60,8 +64,8 @@ const tableSharedStyle = props => css`
60
64
  border-collapse: collapse;
61
65
  border: ${tableCellBorderWidth}px solid
62
66
  ${themed({
63
- light: akEditorTableBorder,
64
- dark: akEditorTableBorderDark
67
+ light: token('color.border', akEditorTableBorder),
68
+ dark: token('color.border', akEditorTableBorderDark)
65
69
  })(props)};
66
70
  table-layout: fixed;
67
71
  font-size: 1em;
@@ -83,7 +87,7 @@ const tableSharedStyle = props => css`
83
87
  border-bottom: none;
84
88
  }
85
89
  th td {
86
- background-color: white;
90
+ background-color: ${token('color.background.neutral.subtle', 'white')};
87
91
  }
88
92
  th,
89
93
  td {
@@ -92,8 +96,8 @@ const tableSharedStyle = props => css`
92
96
  vertical-align: top;
93
97
  border: 1px solid
94
98
  ${themed({
95
- light: akEditorTableBorder,
96
- dark: akEditorTableBorderDark
99
+ light: token('color.border', akEditorTableBorder),
100
+ dark: token('color.border', akEditorTableBorderDark)
97
101
  })(props)};
98
102
  border-right-width: 0;
99
103
  border-bottom-width: 0;
@@ -109,11 +113,11 @@ const tableSharedStyle = props => css`
109
113
  margin-top: 0;
110
114
  }
111
115
 
112
- > .ProseMirror-gapcursor.-right:first-child + * {
116
+ > .ProseMirror-gapcursor.-right:first-of-type + * {
113
117
  margin-top: 0;
114
118
  }
115
119
 
116
- > .ProseMirror-gapcursor:first-child + span + * {
120
+ > .ProseMirror-gapcursor:first-of-type + span + * {
117
121
  margin-top: 0;
118
122
  }
119
123
 
@@ -124,8 +128,8 @@ const tableSharedStyle = props => css`
124
128
  }
125
129
  th {
126
130
  background-color: ${themed({
127
- light: akEditorTableToolbar,
128
- dark: akEditorTableToolbarDark
131
+ light: token('color.background.neutral', akEditorTableToolbar),
132
+ dark: token('color.background.neutral', akEditorTableToolbarDark)
129
133
  })(props)};
130
134
  text-align: left;
131
135
 
@@ -143,14 +147,14 @@ const tableSharedStyle = props => css`
143
147
  background-attachment: local, scroll, scroll;
144
148
  background-position: 100% 0, 100% 0, 0 0;
145
149
  background-color: ${themed({
146
- light: 'rgb(235, 237, 240)',
147
- dark: 'rgb(36, 47, 66)'
150
+ light: token('color.background.neutral', 'rgb(235, 237, 240)'),
151
+ dark: token('color.background.neutral', 'rgb(36, 47, 66)')
148
152
  })(props)};
149
153
 
150
154
  .line-number-gutter {
151
155
  background-color: ${themed({
152
- light: 'rgb(226, 229, 233)',
153
- dark: DN20
156
+ light: token('color.background.neutral', 'rgb(226, 229, 233)'),
157
+ dark: token('color.background.neutral', DN20)
154
158
  })(props)};
155
159
  }
156
160
 
@@ -165,14 +169,14 @@ const tableSharedStyle = props => css`
165
169
  })}!important;
166
170
 
167
171
  background-color: ${themed({
168
- light: 'rgb(235, 237, 240)',
169
- dark: 'rgb(36, 47, 66)'
172
+ light: token('color.background.neutral', 'rgb(235, 237, 240)'),
173
+ dark: token('color.background.neutral', 'rgb(36, 47, 66)')
170
174
  })(props)}!important;
171
175
 
172
176
  // selector lives inside @atlaskit/code
173
177
  --ds--code--line-number-bg-color: ${themed({
174
- light: 'rgb(226, 229, 233)',
175
- dark: DN20
178
+ light: token('color.background.neutral', 'rgb(226, 229, 233)'),
179
+ dark: token('color.background.neutral', DN20)
176
180
  })(props)};
177
181
  }
178
182
  }
@@ -20,6 +20,7 @@ export const tasksAndDecisionsStyles = css`
20
20
  margin: 12px 0 0 0;
21
21
  }
22
22
 
23
+ // If task list is first in the document then set margin top to zero.
23
24
  div[data-task-list-local-id]:first-child {
24
25
  margin-top: 0;
25
26
  }
@@ -4,20 +4,6 @@ import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
4
4
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { CHANNEL, fontSize } from '@atlaskit/theme/constants';
6
6
  import { WidthConsumer } from '../WidthProvider';
7
-
8
- function mapBreakpointToFontSize(breakpoint) {
9
- switch (breakpoint) {
10
- case 'M':
11
- return fontSize() + 2;
12
-
13
- case 'L':
14
- return fontSize() + 4;
15
-
16
- default:
17
- return fontSize();
18
- }
19
- }
20
-
21
7
  export function mapBreakpointToLayoutMaxWidth(breakpoint) {
22
8
  switch (breakpoint) {
23
9
  case 'M':
@@ -31,8 +17,6 @@ export function mapBreakpointToLayoutMaxWidth(breakpoint) {
31
17
  }
32
18
  }
33
19
  export function BaseThemeWrapper({
34
- breakpoint,
35
- dynamicTextSizing,
36
20
  baseFontSize,
37
21
  children
38
22
  }) {
@@ -40,26 +24,24 @@ export function BaseThemeWrapper({
40
24
  mode
41
25
  } = useGlobalTheme();
42
26
  const memoizedTheme = useMemo(() => ({
43
- baseFontSize: dynamicTextSizing ? mapBreakpointToFontSize(breakpoint) : baseFontSize || mapBreakpointToFontSize('S'),
44
- layoutMaxWidth: dynamicTextSizing ? mapBreakpointToLayoutMaxWidth(breakpoint) : akEditorDefaultLayoutWidth,
27
+ baseFontSize: baseFontSize || fontSize(),
28
+ layoutMaxWidth: akEditorDefaultLayoutWidth,
45
29
  // Below is used for editor dark mode.
46
30
  [CHANNEL]: {
47
31
  mode
48
32
  }
49
- }), [breakpoint, dynamicTextSizing, baseFontSize, mode]);
33
+ }), [baseFontSize, mode]);
50
34
  return /*#__PURE__*/React.createElement(ThemeProvider, {
51
35
  theme: memoizedTheme
52
36
  }, children);
53
37
  }
54
38
  export function BaseTheme({
55
39
  children,
56
- dynamicTextSizing,
57
40
  baseFontSize
58
41
  }) {
59
42
  return /*#__PURE__*/React.createElement(WidthConsumer, null, ({
60
43
  breakpoint
61
44
  }) => /*#__PURE__*/React.createElement(BaseThemeWrapper, {
62
- dynamicTextSizing: dynamicTextSizing,
63
45
  breakpoint: breakpoint,
64
46
  baseFontSize: baseFontSize
65
47
  }, /*#__PURE__*/React.createElement(React.Fragment, null, children)));
@@ -5,15 +5,16 @@ import React from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import { injectIntl } from 'react-intl-next';
7
7
  import { N200, N400 } from '@atlaskit/theme/colors';
8
+ import { token } from '@atlaskit/tokens';
8
9
  import { messages } from './messages';
9
10
  const captionWrapperStyle = css`
10
11
  margin-top: 8px;
11
12
  text-align: center;
12
13
  position: relative;
13
- color: ${N400};
14
+ color: ${token('color.text.subtle', N400)};
14
15
  `;
15
16
  const placeholderStyle = css`
16
- color: ${N200};
17
+ color: ${token('color.text.subtlest', N200)};
17
18
  position: absolute;
18
19
  top: 0;
19
20
  width: 100%;