@atlaskit/editor-common 88.5.0 → 88.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 88.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ed9e420d175b8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ed9e420d175b8) -
8
+ New entry-point for intl-error-boundary component on editor-common. Further sharedExpandStyles is
9
+ now available on editor-common/styles entry-point. These are to remove `editor-common/ui`
10
+ entry-point from the critical path in editor-core.
11
+
12
+ ## 88.5.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [`cbe3b04ebb0b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cbe3b04ebb0b6) -
17
+ ED-24730 tweak transferCodeBlockWrappedValue to handle nodes being swapped by drag and drop.
18
+
3
19
  ## 88.5.0
4
20
 
5
21
  ### Minor Changes
@@ -23,9 +23,13 @@ var transferCodeBlockWrappedValue = exports.transferCodeBlockWrappedValue = func
23
23
  if (!(0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
24
24
  return;
25
25
  }
26
- var previousValue = codeBlockWrappedStates.get(oldCodeBlockNode);
27
- if (previousValue !== undefined) {
28
- codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
29
- codeBlockWrappedStates.delete(oldCodeBlockNode);
26
+
27
+ // Don't overwrite the value for the new node if it already exists.
28
+ // This can happen when a drag&drop is swapping nodes.
29
+ if (codeBlockWrappedStates.has(newCodeBlockNode)) {
30
+ return;
30
31
  }
32
+ var previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
33
+ codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
34
+ codeBlockWrappedStates.delete(oldCodeBlockNode);
31
35
  };
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "88.5.0";
20
+ var packageVersion = "88.6.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -333,6 +333,12 @@ Object.defineProperty(exports, "shadowSharedStyle", {
333
333
  return _shadow.shadowSharedStyle;
334
334
  }
335
335
  });
336
+ Object.defineProperty(exports, "sharedExpandStyles", {
337
+ enumerable: true,
338
+ get: function get() {
339
+ return _sharedStyles.sharedExpandStyles;
340
+ }
341
+ });
336
342
  Object.defineProperty(exports, "smartCardSharedStyles", {
337
343
  enumerable: true,
338
344
  get: function get() {
@@ -473,5 +479,6 @@ var _embedCard = require("./shared/embedCard");
473
479
  var _plugins = require("./shared/plugins");
474
480
  var _unsupportedContent = require("./shared/unsupported-content");
475
481
  var _expand = require("./shared/expand");
482
+ var _sharedStyles = require("../ui/Expand/sharedStyles");
476
483
  var _media = require("./shared/media");
477
484
  var _breakout = require("./shared/breakout");
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "88.5.0";
26
+ var packageVersion = "88.6.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  var DropList = /*#__PURE__*/function (_Component) {
@@ -5,8 +5,13 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.sharedExpandStyles = exports.messages = exports.expandLayoutWrapperStyle = exports.ExpandLayoutWrapperWithRef = exports.ExpandIconWrapper = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
8
+ exports.messages = exports.expandLayoutWrapperStyle = exports.ExpandLayoutWrapperWithRef = exports.ExpandIconWrapper = void 0;
9
+ Object.defineProperty(exports, "sharedExpandStyles", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _sharedStyles.sharedExpandStyles;
13
+ }
14
+ });
10
15
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
16
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
17
  var _react = _interopRequireWildcard(require("react"));
@@ -14,15 +19,13 @@ var _react2 = require("@emotion/react");
14
19
  var _reactIntlNext = require("react-intl-next");
15
20
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
16
21
  var _colors = require("@atlaskit/theme/colors");
17
- var _constants = require("@atlaskit/theme/constants");
18
- var _templateObject;
22
+ var _sharedStyles = require("./sharedStyles");
19
23
  var _excluded = ["children"];
20
24
  /**
21
25
  * @jsxRuntime classic
22
26
  * @jsx jsx
23
27
  */
24
28
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
26
29
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
30
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
31
  var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
@@ -47,12 +50,6 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
47
50
  description: 'Placeholder text for an expand node title input field'
48
51
  }
49
52
  });
50
- var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
51
- var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
52
- var EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
53
- var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(_colors.B300, ")");
54
- var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
55
- var EXPAND_EXPANDED_BORDER_COLOR = "var(--ds-border, ".concat(_colors.N40A, ")");
56
53
  var ExpandIconWrapper = exports.ExpandIconWrapper = function ExpandIconWrapper(_ref) {
57
54
  var children = _ref.children,
58
55
  expanded = _ref.expanded;
@@ -100,94 +97,4 @@ var ExpandLayoutWrapperWithRef = exports.ExpandLayoutWrapperWithRef = /*#__PURE_
100
97
  }, rest, {
101
98
  ref: ref
102
99
  }), children);
103
- });
104
- var containerStyles = function containerStyles(styleProps) {
105
- var expanded = styleProps.expanded,
106
- focused = styleProps.focused;
107
- var marginTop = "var(--ds-space-050, 0.25rem)";
108
- var marginBottom = 0;
109
- // Only only these margins if the expand isn't editable
110
- // and is the root level expand.
111
- var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(_editorSharedStyles.akLayoutGutterOffset, "px") : 0;
112
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
113
- var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
114
- return function () {
115
- return (0, _react2.css)({
116
- borderWidth: '1px',
117
- borderStyle: 'solid',
118
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
119
- borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
120
- borderRadius: BORDER_RADIUS,
121
- minHeight: '25px',
122
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
123
- background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
124
- margin: margin,
125
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
126
- transition: "background 0.3s ".concat(_editorSharedStyles.akEditorSwoopCubicBezier, ", border-color 0.3s ").concat(_editorSharedStyles.akEditorSwoopCubicBezier),
127
- padding: "var(--ds-space-100, 8px)",
128
- '&:hover': {
129
- // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
130
- // This is because the default state already uses the same token and, as such, the hover style won't change anything.
131
- // https://product-fabric.atlassian.net/browse/DSP-4152
132
- border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N50A, ")")),
133
- background: EXPAND_SELECTED_BACKGROUND
134
- },
135
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
136
- 'td > :not(style):first-child, td > style:first-child + *': {
137
- marginTop: 0
138
- }
139
- });
140
- };
141
- };
142
- var contentStyles = function contentStyles(styleProps) {
143
- return function () {
144
- return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
145
- (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\tpadding-top: ", ";\n\t\tpadding-right: ", ";\n\t\tpadding-left: ", ";\n\t\tmargin-left: ", ";\n\t\tdisplay: flow-root;\n\n\t\t// The follow rules inside @supports block are added as a part of ED-8893\n\t\t// The fix is targeting mobile bridge on iOS 12 or below,\n\t\t// We should consider remove this fix when we no longer support iOS 12\n\t\t@supports not (display: flow-root) {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t", "\n\t"])), styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)", "var(--ds-space-100, 8px)", "var(--ds-space-300, 24px)", "var(--ds-space-050, 4px)", !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n /* Do not add text nowrap here because inline comment navigation depends on the location of the text */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n user-select: none;\n }\n " : '')
146
- );
147
- };
148
- };
149
- var titleInputStyles = function titleInputStyles() {
150
- return (0, _react2.css)({
151
- outline: 'none',
152
- border: 'none',
153
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
154
- fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()),
155
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
156
- lineHeight: _editorSharedStyles.akEditorLineHeight,
157
- fontWeight: 'normal',
158
- color: "var(--ds-text-subtlest, ".concat(_colors.N200A, ")"),
159
- background: 'transparent',
160
- display: 'flex',
161
- flex: 1,
162
- padding: "0 0 0 ".concat("var(--ds-space-050, 4px)"),
163
- width: '100%',
164
- '&::placeholder': {
165
- opacity: 1,
166
- color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
167
- }
168
- });
169
- };
170
- var titleContainerStyles = function titleContainerStyles() {
171
- return (0, _react2.css)({
172
- padding: 0,
173
- display: 'flex',
174
- alignItems: 'flex-start',
175
- background: 'none',
176
- border: 'none',
177
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
178
- fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()),
179
- width: '100%',
180
- color: "var(--ds-text-subtle, ".concat(_colors.N300A, ")"),
181
- overflow: 'hidden',
182
- cursor: 'pointer',
183
- '&:focus': {
184
- outline: 0
185
- }
186
- });
187
- };
188
- var sharedExpandStyles = exports.sharedExpandStyles = {
189
- titleInputStyles: titleInputStyles,
190
- titleContainerStyles: titleContainerStyles,
191
- containerStyles: containerStyles,
192
- contentStyles: contentStyles
193
- };
100
+ });
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.sharedExpandStyles = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _react = require("@emotion/react");
10
+ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
+ var _colors = require("@atlaskit/theme/colors");
12
+ var _constants = require("@atlaskit/theme/constants");
13
+ var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
15
+ var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
16
+ var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
17
+ var EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
18
+ var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(_colors.B300, ")");
19
+ var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
20
+ var EXPAND_EXPANDED_BORDER_COLOR = "var(--ds-border, ".concat(_colors.N40A, ")");
21
+ var containerStyles = function containerStyles(styleProps) {
22
+ var expanded = styleProps.expanded,
23
+ focused = styleProps.focused;
24
+ var marginTop = "var(--ds-space-050, 0.25rem)";
25
+ var marginBottom = 0;
26
+ // Only only these margins if the expand isn't editable
27
+ // and is the root level expand.
28
+ var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(_editorSharedStyles.akLayoutGutterOffset, "px") : 0;
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
+ var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
31
+ return function () {
32
+ return (0, _react.css)({
33
+ borderWidth: '1px',
34
+ borderStyle: 'solid',
35
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
36
+ borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
37
+ borderRadius: BORDER_RADIUS,
38
+ minHeight: '25px',
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
40
+ background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
41
+ margin: margin,
42
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
43
+ transition: "background 0.3s ".concat(_editorSharedStyles.akEditorSwoopCubicBezier, ", border-color 0.3s ").concat(_editorSharedStyles.akEditorSwoopCubicBezier),
44
+ padding: "var(--ds-space-100, 8px)",
45
+ '&:hover': {
46
+ // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
47
+ // This is because the default state already uses the same token and, as such, the hover style won't change anything.
48
+ // https://product-fabric.atlassian.net/browse/DSP-4152
49
+ border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N50A, ")")),
50
+ background: EXPAND_SELECTED_BACKGROUND
51
+ },
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
53
+ 'td > :not(style):first-child, td > style:first-child + *': {
54
+ marginTop: 0
55
+ }
56
+ });
57
+ };
58
+ };
59
+ var contentStyles = function contentStyles(styleProps) {
60
+ return function () {
61
+ return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
62
+ (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\tpadding-top: ", ";\n\t\tpadding-right: ", ";\n\t\tpadding-left: ", ";\n\t\tmargin-left: ", ";\n\t\tdisplay: flow-root;\n\n\t\t// The follow rules inside @supports block are added as a part of ED-8893\n\t\t// The fix is targeting mobile bridge on iOS 12 or below,\n\t\t// We should consider remove this fix when we no longer support iOS 12\n\t\t@supports not (display: flow-root) {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t", "\n\t"])), styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)", "var(--ds-space-100, 8px)", "var(--ds-space-300, 24px)", "var(--ds-space-050, 4px)", !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n /* Do not add text nowrap here because inline comment navigation depends on the location of the text */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n user-select: none;\n }\n " : '')
63
+ );
64
+ };
65
+ };
66
+ var titleInputStyles = function titleInputStyles() {
67
+ return (0, _react.css)({
68
+ outline: 'none',
69
+ border: 'none',
70
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
71
+ fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()),
72
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
73
+ lineHeight: _editorSharedStyles.akEditorLineHeight,
74
+ fontWeight: 'normal',
75
+ color: "var(--ds-text-subtlest, ".concat(_colors.N200A, ")"),
76
+ background: 'transparent',
77
+ display: 'flex',
78
+ flex: 1,
79
+ padding: "0 0 0 ".concat("var(--ds-space-050, 4px)"),
80
+ width: '100%',
81
+ '&::placeholder': {
82
+ opacity: 1,
83
+ color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
84
+ }
85
+ });
86
+ };
87
+ var titleContainerStyles = function titleContainerStyles() {
88
+ return (0, _react.css)({
89
+ padding: 0,
90
+ display: 'flex',
91
+ alignItems: 'flex-start',
92
+ background: 'none',
93
+ border: 'none',
94
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
95
+ fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()),
96
+ width: '100%',
97
+ color: "var(--ds-text-subtle, ".concat(_colors.N300A, ")"),
98
+ overflow: 'hidden',
99
+ cursor: 'pointer',
100
+ '&:focus': {
101
+ outline: 0
102
+ }
103
+ });
104
+ };
105
+ var sharedExpandStyles = exports.sharedExpandStyles = {
106
+ titleInputStyles: titleInputStyles,
107
+ titleContainerStyles: titleContainerStyles,
108
+ containerStyles: containerStyles,
109
+ contentStyles: contentStyles
110
+ };
@@ -17,9 +17,13 @@ export const transferCodeBlockWrappedValue = (oldCodeBlockNode, newCodeBlockNode
17
17
  if (!fg('editor_support_code_block_wrapping')) {
18
18
  return;
19
19
  }
20
- const previousValue = codeBlockWrappedStates.get(oldCodeBlockNode);
21
- if (previousValue !== undefined) {
22
- codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
23
- codeBlockWrappedStates.delete(oldCodeBlockNode);
20
+
21
+ // Don't overwrite the value for the new node if it already exists.
22
+ // This can happen when a drag&drop is swapping nodes.
23
+ if (codeBlockWrappedStates.has(newCodeBlockNode)) {
24
+ return;
24
25
  }
26
+ const previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
27
+ codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
28
+ codeBlockWrappedStates.delete(oldCodeBlockNode);
25
29
  };
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "88.5.0";
4
+ const packageVersion = "88.6.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -30,6 +30,7 @@ export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
30
30
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles } from './shared/plugins';
31
31
  export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
32
32
  export { expandIconWrapperStyle, expandClassNames, expandIconContainerStyle } from './shared/expand';
33
+ export { sharedExpandStyles } from '../ui/Expand/sharedStyles';
33
34
  export { ClassNames as MediaSharedClassNames } from './shared/media';
34
35
  export { BreakoutCssClassName } from './shared/breakout';
35
36
  export { BODIED_EXT_MBE_MARGIN_TOP } from './shared/extension';
@@ -12,7 +12,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
12
12
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
13
13
  import Layer from '../Layer';
14
14
  const packageName = "@atlaskit/editor-common";
15
- const packageVersion = "88.5.0";
15
+ const packageVersion = "88.6.0";
16
16
  const halfFocusRing = 1;
17
17
  const dropOffset = '0, 8';
18
18
  class DropList extends Component {
@@ -9,10 +9,8 @@ import React, { forwardRef } from 'react';
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { defineMessages } from 'react-intl-next';
12
- import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
13
- import { B300, N200, N200A, N300A, N30A, N40A, N50A, N90 } from '@atlaskit/theme/colors';
14
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
15
- import { fontSize } from '@atlaskit/theme/constants';
12
+ import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
13
+ import { N30A, N90 } from '@atlaskit/theme/colors';
16
14
  export const messages = defineMessages({
17
15
  collapseNode: {
18
16
  id: 'fabric.editor.collapseNode',
@@ -35,12 +33,6 @@ export const messages = defineMessages({
35
33
  description: 'Placeholder text for an expand node title input field'
36
34
  }
37
35
  });
38
- const BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
39
- const EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
40
- const EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
41
- const EXPAND_FOCUSED_BORDER_COLOR = `var(--ds-border-focused, ${B300})`;
42
- const EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
43
- const EXPAND_EXPANDED_BORDER_COLOR = `var(--ds-border, ${N40A})`;
44
36
  export const ExpandIconWrapper = ({
45
37
  children,
46
38
  expanded
@@ -88,112 +80,4 @@ export const ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef((props, ref) =
88
80
  ref: ref
89
81
  }), children);
90
82
  });
91
- const containerStyles = styleProps => {
92
- const {
93
- expanded,
94
- focused
95
- } = styleProps;
96
- const marginTop = "var(--ds-space-050, 0.25rem)";
97
- const marginBottom = 0;
98
- // Only only these margins if the expand isn't editable
99
- // and is the root level expand.
100
- const marginHorizontal = styleProps['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : 0;
101
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
102
- const margin = `${marginTop} ${marginHorizontal} ${marginBottom}`;
103
- return () => css({
104
- borderWidth: '1px',
105
- borderStyle: 'solid',
106
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
107
- borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
108
- borderRadius: BORDER_RADIUS,
109
- minHeight: '25px',
110
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
111
- background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
112
- margin: margin,
113
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
114
- transition: `background 0.3s ${akEditorSwoopCubicBezier}, border-color 0.3s ${akEditorSwoopCubicBezier}`,
115
- padding: "var(--ds-space-100, 8px)",
116
- '&:hover': {
117
- // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
118
- // This is because the default state already uses the same token and, as such, the hover style won't change anything.
119
- // https://product-fabric.atlassian.net/browse/DSP-4152
120
- border: `1px solid ${`var(--ds-border, ${N50A})`}`,
121
- background: EXPAND_SELECTED_BACKGROUND
122
- },
123
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
124
- 'td > :not(style):first-child, td > style:first-child + *': {
125
- marginTop: 0
126
- }
127
- });
128
- };
129
- const contentStyles = styleProps => () =>
130
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
131
- css`
132
- padding-top: ${styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)"};
133
- padding-right: ${"var(--ds-space-100, 8px)"};
134
- padding-left: ${"var(--ds-space-300, 24px)"};
135
- margin-left: ${"var(--ds-space-050, 4px)"};
136
- display: flow-root;
137
-
138
- // The follow rules inside @supports block are added as a part of ED-8893
139
- // The fix is targeting mobile bridge on iOS 12 or below,
140
- // We should consider remove this fix when we no longer support iOS 12
141
- @supports not (display: flow-root) {
142
- width: 100%;
143
- box-sizing: border-box;
144
- }
145
-
146
- ${!styleProps.expanded ? `
147
- .expand-content-wrapper, .nestedExpand-content-wrapper {
148
- /* We visually hide the content here to preserve the content during copy+paste */
149
- /* Do not add text nowrap here because inline comment navigation depends on the location of the text */
150
- width: 100%;
151
- display: block;
152
- height: 0;
153
- overflow: hidden;
154
- clip: rect(1px, 1px, 1px, 1px);
155
- user-select: none;
156
- }
157
- ` : ''}
158
- `;
159
- const titleInputStyles = () => css({
160
- outline: 'none',
161
- border: 'none',
162
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
163
- fontSize: relativeFontSizeToBase16(fontSize()),
164
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
165
- lineHeight: akEditorLineHeight,
166
- fontWeight: 'normal',
167
- color: `var(--ds-text-subtlest, ${N200A})`,
168
- background: 'transparent',
169
- display: 'flex',
170
- flex: 1,
171
- padding: `0 0 0 ${"var(--ds-space-050, 4px)"}`,
172
- width: '100%',
173
- '&::placeholder': {
174
- opacity: 1,
175
- color: `var(--ds-text-subtlest, ${N200})`
176
- }
177
- });
178
- const titleContainerStyles = () => css({
179
- padding: 0,
180
- display: 'flex',
181
- alignItems: 'flex-start',
182
- background: 'none',
183
- border: 'none',
184
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
185
- fontSize: relativeFontSizeToBase16(fontSize()),
186
- width: '100%',
187
- color: `var(--ds-text-subtle, ${N300A})`,
188
- overflow: 'hidden',
189
- cursor: 'pointer',
190
- '&:focus': {
191
- outline: 0
192
- }
193
- });
194
- export const sharedExpandStyles = {
195
- titleInputStyles,
196
- titleContainerStyles,
197
- containerStyles,
198
- contentStyles
199
- };
83
+ export { sharedExpandStyles } from './sharedStyles';
@@ -0,0 +1,121 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
+ import { css } from '@emotion/react';
3
+ import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
4
+ import { B300, N200, N200A, N300A, N40A, N50A } from '@atlaskit/theme/colors';
5
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
6
+ import { fontSize } from '@atlaskit/theme/constants';
7
+ const BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
8
+ const EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
9
+ const EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
10
+ const EXPAND_FOCUSED_BORDER_COLOR = `var(--ds-border-focused, ${B300})`;
11
+ const EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
12
+ const EXPAND_EXPANDED_BORDER_COLOR = `var(--ds-border, ${N40A})`;
13
+ const containerStyles = styleProps => {
14
+ const {
15
+ expanded,
16
+ focused
17
+ } = styleProps;
18
+ const marginTop = "var(--ds-space-050, 0.25rem)";
19
+ const marginBottom = 0;
20
+ // Only only these margins if the expand isn't editable
21
+ // and is the root level expand.
22
+ const marginHorizontal = styleProps['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : 0;
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
24
+ const margin = `${marginTop} ${marginHorizontal} ${marginBottom}`;
25
+ return () => css({
26
+ borderWidth: '1px',
27
+ borderStyle: 'solid',
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
29
+ borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
30
+ borderRadius: BORDER_RADIUS,
31
+ minHeight: '25px',
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
33
+ background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
34
+ margin: margin,
35
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
36
+ transition: `background 0.3s ${akEditorSwoopCubicBezier}, border-color 0.3s ${akEditorSwoopCubicBezier}`,
37
+ padding: "var(--ds-space-100, 8px)",
38
+ '&:hover': {
39
+ // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
40
+ // This is because the default state already uses the same token and, as such, the hover style won't change anything.
41
+ // https://product-fabric.atlassian.net/browse/DSP-4152
42
+ border: `1px solid ${`var(--ds-border, ${N50A})`}`,
43
+ background: EXPAND_SELECTED_BACKGROUND
44
+ },
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
46
+ 'td > :not(style):first-child, td > style:first-child + *': {
47
+ marginTop: 0
48
+ }
49
+ });
50
+ };
51
+ const contentStyles = styleProps => () =>
52
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
53
+ css`
54
+ padding-top: ${styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)"};
55
+ padding-right: ${"var(--ds-space-100, 8px)"};
56
+ padding-left: ${"var(--ds-space-300, 24px)"};
57
+ margin-left: ${"var(--ds-space-050, 4px)"};
58
+ display: flow-root;
59
+
60
+ // The follow rules inside @supports block are added as a part of ED-8893
61
+ // The fix is targeting mobile bridge on iOS 12 or below,
62
+ // We should consider remove this fix when we no longer support iOS 12
63
+ @supports not (display: flow-root) {
64
+ width: 100%;
65
+ box-sizing: border-box;
66
+ }
67
+
68
+ ${!styleProps.expanded ? `
69
+ .expand-content-wrapper, .nestedExpand-content-wrapper {
70
+ /* We visually hide the content here to preserve the content during copy+paste */
71
+ /* Do not add text nowrap here because inline comment navigation depends on the location of the text */
72
+ width: 100%;
73
+ display: block;
74
+ height: 0;
75
+ overflow: hidden;
76
+ clip: rect(1px, 1px, 1px, 1px);
77
+ user-select: none;
78
+ }
79
+ ` : ''}
80
+ `;
81
+ const titleInputStyles = () => css({
82
+ outline: 'none',
83
+ border: 'none',
84
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
85
+ fontSize: relativeFontSizeToBase16(fontSize()),
86
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
87
+ lineHeight: akEditorLineHeight,
88
+ fontWeight: 'normal',
89
+ color: `var(--ds-text-subtlest, ${N200A})`,
90
+ background: 'transparent',
91
+ display: 'flex',
92
+ flex: 1,
93
+ padding: `0 0 0 ${"var(--ds-space-050, 4px)"}`,
94
+ width: '100%',
95
+ '&::placeholder': {
96
+ opacity: 1,
97
+ color: `var(--ds-text-subtlest, ${N200})`
98
+ }
99
+ });
100
+ const titleContainerStyles = () => css({
101
+ padding: 0,
102
+ display: 'flex',
103
+ alignItems: 'flex-start',
104
+ background: 'none',
105
+ border: 'none',
106
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
107
+ fontSize: relativeFontSizeToBase16(fontSize()),
108
+ width: '100%',
109
+ color: `var(--ds-text-subtle, ${N300A})`,
110
+ overflow: 'hidden',
111
+ cursor: 'pointer',
112
+ '&:focus': {
113
+ outline: 0
114
+ }
115
+ });
116
+ export const sharedExpandStyles = {
117
+ titleInputStyles,
118
+ titleContainerStyles,
119
+ containerStyles,
120
+ contentStyles
121
+ };
@@ -17,9 +17,13 @@ export var transferCodeBlockWrappedValue = function transferCodeBlockWrappedValu
17
17
  if (!fg('editor_support_code_block_wrapping')) {
18
18
  return;
19
19
  }
20
- var previousValue = codeBlockWrappedStates.get(oldCodeBlockNode);
21
- if (previousValue !== undefined) {
22
- codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
23
- codeBlockWrappedStates.delete(oldCodeBlockNode);
20
+
21
+ // Don't overwrite the value for the new node if it already exists.
22
+ // This can happen when a drag&drop is swapping nodes.
23
+ if (codeBlockWrappedStates.has(newCodeBlockNode)) {
24
+ return;
24
25
  }
26
+ var previousValue = isCodeBlockWordWrapEnabled(oldCodeBlockNode);
27
+ codeBlockWrappedStates.set(newCodeBlockNode, previousValue);
28
+ codeBlockWrappedStates.delete(oldCodeBlockNode);
25
29
  };
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "88.5.0";
10
+ var packageVersion = "88.6.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -30,6 +30,7 @@ export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
30
30
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles } from './shared/plugins';
31
31
  export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
32
32
  export { expandIconWrapperStyle, expandClassNames, expandIconContainerStyle } from './shared/expand';
33
+ export { sharedExpandStyles } from '../ui/Expand/sharedStyles';
33
34
  export { ClassNames as MediaSharedClassNames } from './shared/media';
34
35
  export { BreakoutCssClassName } from './shared/breakout';
35
36
  export { BODIED_EXT_MBE_MARGIN_TOP } from './shared/extension';
@@ -20,7 +20,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
20
20
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "88.5.0";
23
+ var packageVersion = "88.6.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,7 +1,5 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
1
  import _extends from "@babel/runtime/helpers/extends";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _templateObject;
5
3
  var _excluded = ["children"];
6
4
  /**
7
5
  * @jsxRuntime classic
@@ -13,10 +11,8 @@ import React, { forwardRef } from 'react';
13
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
12
  import { css, jsx } from '@emotion/react';
15
13
  import { defineMessages } from 'react-intl-next';
16
- import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
17
- import { B300, N200, N200A, N300A, N30A, N40A, N50A, N90 } from '@atlaskit/theme/colors';
18
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
19
- import { fontSize } from '@atlaskit/theme/constants';
14
+ import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
15
+ import { N30A, N90 } from '@atlaskit/theme/colors';
20
16
  export var messages = defineMessages({
21
17
  collapseNode: {
22
18
  id: 'fabric.editor.collapseNode',
@@ -39,12 +35,6 @@ export var messages = defineMessages({
39
35
  description: 'Placeholder text for an expand node title input field'
40
36
  }
41
37
  });
42
- var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
43
- var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
44
- var EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
45
- var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(B300, ")");
46
- var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
47
- var EXPAND_EXPANDED_BORDER_COLOR = "var(--ds-border, ".concat(N40A, ")");
48
38
  export var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
49
39
  var children = _ref.children,
50
40
  expanded = _ref.expanded;
@@ -93,93 +83,4 @@ export var ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef(function (props,
93
83
  ref: ref
94
84
  }), children);
95
85
  });
96
- var containerStyles = function containerStyles(styleProps) {
97
- var expanded = styleProps.expanded,
98
- focused = styleProps.focused;
99
- var marginTop = "var(--ds-space-050, 0.25rem)";
100
- var marginBottom = 0;
101
- // Only only these margins if the expand isn't editable
102
- // and is the root level expand.
103
- var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(akLayoutGutterOffset, "px") : 0;
104
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
105
- var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
106
- return function () {
107
- return css({
108
- borderWidth: '1px',
109
- borderStyle: 'solid',
110
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
111
- borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
112
- borderRadius: BORDER_RADIUS,
113
- minHeight: '25px',
114
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
115
- background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
116
- margin: margin,
117
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
118
- transition: "background 0.3s ".concat(akEditorSwoopCubicBezier, ", border-color 0.3s ").concat(akEditorSwoopCubicBezier),
119
- padding: "var(--ds-space-100, 8px)",
120
- '&:hover': {
121
- // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
122
- // This is because the default state already uses the same token and, as such, the hover style won't change anything.
123
- // https://product-fabric.atlassian.net/browse/DSP-4152
124
- border: "1px solid ".concat("var(--ds-border, ".concat(N50A, ")")),
125
- background: EXPAND_SELECTED_BACKGROUND
126
- },
127
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
128
- 'td > :not(style):first-child, td > style:first-child + *': {
129
- marginTop: 0
130
- }
131
- });
132
- };
133
- };
134
- var contentStyles = function contentStyles(styleProps) {
135
- return function () {
136
- return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
137
- css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\tpadding-top: ", ";\n\t\tpadding-right: ", ";\n\t\tpadding-left: ", ";\n\t\tmargin-left: ", ";\n\t\tdisplay: flow-root;\n\n\t\t// The follow rules inside @supports block are added as a part of ED-8893\n\t\t// The fix is targeting mobile bridge on iOS 12 or below,\n\t\t// We should consider remove this fix when we no longer support iOS 12\n\t\t@supports not (display: flow-root) {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t", "\n\t"])), styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)", "var(--ds-space-100, 8px)", "var(--ds-space-300, 24px)", "var(--ds-space-050, 4px)", !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n /* Do not add text nowrap here because inline comment navigation depends on the location of the text */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n user-select: none;\n }\n " : '')
138
- );
139
- };
140
- };
141
- var titleInputStyles = function titleInputStyles() {
142
- return css({
143
- outline: 'none',
144
- border: 'none',
145
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
146
- fontSize: relativeFontSizeToBase16(fontSize()),
147
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
148
- lineHeight: akEditorLineHeight,
149
- fontWeight: 'normal',
150
- color: "var(--ds-text-subtlest, ".concat(N200A, ")"),
151
- background: 'transparent',
152
- display: 'flex',
153
- flex: 1,
154
- padding: "0 0 0 ".concat("var(--ds-space-050, 4px)"),
155
- width: '100%',
156
- '&::placeholder': {
157
- opacity: 1,
158
- color: "var(--ds-text-subtlest, ".concat(N200, ")")
159
- }
160
- });
161
- };
162
- var titleContainerStyles = function titleContainerStyles() {
163
- return css({
164
- padding: 0,
165
- display: 'flex',
166
- alignItems: 'flex-start',
167
- background: 'none',
168
- border: 'none',
169
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
170
- fontSize: relativeFontSizeToBase16(fontSize()),
171
- width: '100%',
172
- color: "var(--ds-text-subtle, ".concat(N300A, ")"),
173
- overflow: 'hidden',
174
- cursor: 'pointer',
175
- '&:focus': {
176
- outline: 0
177
- }
178
- });
179
- };
180
- export var sharedExpandStyles = {
181
- titleInputStyles: titleInputStyles,
182
- titleContainerStyles: titleContainerStyles,
183
- containerStyles: containerStyles,
184
- contentStyles: contentStyles
185
- };
86
+ export { sharedExpandStyles } from './sharedStyles';
@@ -0,0 +1,104 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
+ import { css } from '@emotion/react';
5
+ import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
6
+ import { B300, N200, N200A, N300A, N40A, N50A } from '@atlaskit/theme/colors';
7
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
8
+ import { fontSize } from '@atlaskit/theme/constants';
9
+ var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
10
+ var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
11
+ var EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
12
+ var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(B300, ")");
13
+ var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
14
+ var EXPAND_EXPANDED_BORDER_COLOR = "var(--ds-border, ".concat(N40A, ")");
15
+ var containerStyles = function containerStyles(styleProps) {
16
+ var expanded = styleProps.expanded,
17
+ focused = styleProps.focused;
18
+ var marginTop = "var(--ds-space-050, 0.25rem)";
19
+ var marginBottom = 0;
20
+ // Only only these margins if the expand isn't editable
21
+ // and is the root level expand.
22
+ var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(akLayoutGutterOffset, "px") : 0;
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
24
+ var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
25
+ return function () {
26
+ return css({
27
+ borderWidth: '1px',
28
+ borderStyle: 'solid',
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
+ borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
31
+ borderRadius: BORDER_RADIUS,
32
+ minHeight: '25px',
33
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
34
+ background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
35
+ margin: margin,
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
37
+ transition: "background 0.3s ".concat(akEditorSwoopCubicBezier, ", border-color 0.3s ").concat(akEditorSwoopCubicBezier),
38
+ padding: "var(--ds-space-100, 8px)",
39
+ '&:hover': {
40
+ // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
41
+ // This is because the default state already uses the same token and, as such, the hover style won't change anything.
42
+ // https://product-fabric.atlassian.net/browse/DSP-4152
43
+ border: "1px solid ".concat("var(--ds-border, ".concat(N50A, ")")),
44
+ background: EXPAND_SELECTED_BACKGROUND
45
+ },
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
47
+ 'td > :not(style):first-child, td > style:first-child + *': {
48
+ marginTop: 0
49
+ }
50
+ });
51
+ };
52
+ };
53
+ var contentStyles = function contentStyles(styleProps) {
54
+ return function () {
55
+ return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
56
+ css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\tpadding-top: ", ";\n\t\tpadding-right: ", ";\n\t\tpadding-left: ", ";\n\t\tmargin-left: ", ";\n\t\tdisplay: flow-root;\n\n\t\t// The follow rules inside @supports block are added as a part of ED-8893\n\t\t// The fix is targeting mobile bridge on iOS 12 or below,\n\t\t// We should consider remove this fix when we no longer support iOS 12\n\t\t@supports not (display: flow-root) {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t", "\n\t"])), styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)", "var(--ds-space-100, 8px)", "var(--ds-space-300, 24px)", "var(--ds-space-050, 4px)", !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n /* Do not add text nowrap here because inline comment navigation depends on the location of the text */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n user-select: none;\n }\n " : '')
57
+ );
58
+ };
59
+ };
60
+ var titleInputStyles = function titleInputStyles() {
61
+ return css({
62
+ outline: 'none',
63
+ border: 'none',
64
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
65
+ fontSize: relativeFontSizeToBase16(fontSize()),
66
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
67
+ lineHeight: akEditorLineHeight,
68
+ fontWeight: 'normal',
69
+ color: "var(--ds-text-subtlest, ".concat(N200A, ")"),
70
+ background: 'transparent',
71
+ display: 'flex',
72
+ flex: 1,
73
+ padding: "0 0 0 ".concat("var(--ds-space-050, 4px)"),
74
+ width: '100%',
75
+ '&::placeholder': {
76
+ opacity: 1,
77
+ color: "var(--ds-text-subtlest, ".concat(N200, ")")
78
+ }
79
+ });
80
+ };
81
+ var titleContainerStyles = function titleContainerStyles() {
82
+ return css({
83
+ padding: 0,
84
+ display: 'flex',
85
+ alignItems: 'flex-start',
86
+ background: 'none',
87
+ border: 'none',
88
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
89
+ fontSize: relativeFontSizeToBase16(fontSize()),
90
+ width: '100%',
91
+ color: "var(--ds-text-subtle, ".concat(N300A, ")"),
92
+ overflow: 'hidden',
93
+ cursor: 'pointer',
94
+ '&:focus': {
95
+ outline: 0
96
+ }
97
+ });
98
+ };
99
+ export var sharedExpandStyles = {
100
+ titleInputStyles: titleInputStyles,
101
+ titleContainerStyles: titleContainerStyles,
102
+ containerStyles: containerStyles,
103
+ contentStyles: contentStyles
104
+ };
@@ -30,6 +30,7 @@ export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
30
30
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles, } from './shared/plugins';
31
31
  export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
32
32
  export { expandIconWrapperStyle, expandClassNames, expandIconContainerStyle, } from './shared/expand';
33
+ export { sharedExpandStyles } from '../ui/Expand/sharedStyles';
33
34
  export { ClassNames as MediaSharedClassNames } from './shared/media';
34
35
  export { BreakoutCssClassName } from './shared/breakout';
35
36
  export { BODIED_EXT_MBE_MARGIN_TOP } from './shared/extension';
@@ -22,20 +22,9 @@ export declare const messages: {
22
22
  description: string;
23
23
  };
24
24
  };
25
- export interface StyleProps {
26
- expanded?: boolean;
27
- focused?: boolean;
28
- 'data-node-type'?: 'expand' | 'nestedExpand';
29
- 'data-title'?: string;
30
- }
31
25
  export declare const ExpandIconWrapper: ({ children, expanded, }: React.HTMLAttributes<HTMLDivElement> & {
32
26
  expanded: boolean;
33
27
  }) => jsx.JSX.Element;
34
28
  export declare const expandLayoutWrapperStyle: import("@emotion/react").SerializedStyles;
35
29
  export declare const ExpandLayoutWrapperWithRef: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<any>>;
36
- export declare const sharedExpandStyles: {
37
- titleInputStyles: () => import("@emotion/react").SerializedStyles;
38
- titleContainerStyles: () => import("@emotion/react").SerializedStyles;
39
- containerStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
40
- contentStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
41
- };
30
+ export { sharedExpandStyles, type StyleProps } from './sharedStyles';
@@ -0,0 +1,12 @@
1
+ export interface StyleProps {
2
+ expanded?: boolean;
3
+ focused?: boolean;
4
+ 'data-node-type'?: 'expand' | 'nestedExpand';
5
+ 'data-title'?: string;
6
+ }
7
+ export declare const sharedExpandStyles: {
8
+ titleInputStyles: () => import("@emotion/react").SerializedStyles;
9
+ titleContainerStyles: () => import("@emotion/react").SerializedStyles;
10
+ containerStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
11
+ contentStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
12
+ };
@@ -30,6 +30,7 @@ export { embedCardStyles, embedSpacingStyles } from './shared/embedCard';
30
30
  export { buttonGroupStyle, separatorStyles, wrapperStyle, triggerWrapperStyles, } from './shared/plugins';
31
31
  export { UnsupportedSharedCssClassName, unsupportedStyles } from './shared/unsupported-content';
32
32
  export { expandIconWrapperStyle, expandClassNames, expandIconContainerStyle, } from './shared/expand';
33
+ export { sharedExpandStyles } from '../ui/Expand/sharedStyles';
33
34
  export { ClassNames as MediaSharedClassNames } from './shared/media';
34
35
  export { BreakoutCssClassName } from './shared/breakout';
35
36
  export { BODIED_EXT_MBE_MARGIN_TOP } from './shared/extension';
@@ -22,20 +22,9 @@ export declare const messages: {
22
22
  description: string;
23
23
  };
24
24
  };
25
- export interface StyleProps {
26
- expanded?: boolean;
27
- focused?: boolean;
28
- 'data-node-type'?: 'expand' | 'nestedExpand';
29
- 'data-title'?: string;
30
- }
31
25
  export declare const ExpandIconWrapper: ({ children, expanded, }: React.HTMLAttributes<HTMLDivElement> & {
32
26
  expanded: boolean;
33
27
  }) => jsx.JSX.Element;
34
28
  export declare const expandLayoutWrapperStyle: import("@emotion/react").SerializedStyles;
35
29
  export declare const ExpandLayoutWrapperWithRef: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<any>>;
36
- export declare const sharedExpandStyles: {
37
- titleInputStyles: () => import("@emotion/react").SerializedStyles;
38
- titleContainerStyles: () => import("@emotion/react").SerializedStyles;
39
- containerStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
40
- contentStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
41
- };
30
+ export { sharedExpandStyles, type StyleProps } from './sharedStyles';
@@ -0,0 +1,12 @@
1
+ export interface StyleProps {
2
+ expanded?: boolean;
3
+ focused?: boolean;
4
+ 'data-node-type'?: 'expand' | 'nestedExpand';
5
+ 'data-title'?: string;
6
+ }
7
+ export declare const sharedExpandStyles: {
8
+ titleInputStyles: () => import("@emotion/react").SerializedStyles;
9
+ titleContainerStyles: () => import("@emotion/react").SerializedStyles;
10
+ containerStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
11
+ contentStyles: (styleProps: StyleProps) => () => import("@emotion/react").SerializedStyles;
12
+ };
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/intl-error-boundary",
3
+ "main": "../dist/cjs/ui/IntlErrorBoundary/index.js",
4
+ "module": "../dist/esm/ui/IntlErrorBoundary/index.js",
5
+ "module:es2019": "../dist/es2019/ui/IntlErrorBoundary/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/ui/IntlErrorBoundary/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/ui/IntlErrorBoundary/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "88.5.0",
3
+ "version": "88.6.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,9 +24,7 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Editor",
27
- "inPublicMirror": true,
28
27
  "singleton": true,
29
- "releaseModel": "continuous",
30
28
  "runReact18": true
31
29
  },
32
30
  "af:exports": {
@@ -93,6 +91,7 @@
93
91
  "./constants": "./src/link/constants.ts",
94
92
  "./doc-utils": "./src/doc-utils/index.ts",
95
93
  "./expand": "./src/expand/index.ts",
94
+ "./intl-error-boundary": "./src/ui/IntlErrorBoundary/index.tsx",
96
95
  "./code-block": "./src/code-block/index.ts",
97
96
  "./table": "./src/table/index.ts",
98
97
  "./lazy-node-view": "./src/lazy-node-view/index.ts"
@@ -131,7 +130,7 @@
131
130
  "@atlaskit/mention": "^23.2.0",
132
131
  "@atlaskit/menu": "^2.12.0",
133
132
  "@atlaskit/platform-feature-flags": "^0.3.0",
134
- "@atlaskit/primitives": "^12.0.0",
133
+ "@atlaskit/primitives": "^12.1.0",
135
134
  "@atlaskit/profilecard": "^19.24.0",
136
135
  "@atlaskit/section-message": "^6.6.0",
137
136
  "@atlaskit/smart-card": "^27.19.0",