@atlaskit/editor-common 102.18.0 → 102.18.2

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,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 102.18.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136524](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/136524)
8
+ [`d70621353e0f7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d70621353e0f7) -
9
+ [ux] [EDITOR-266] Fix nested panel icon colours in LCM
10
+ - Updated dependencies
11
+
12
+ ## 102.18.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#134366](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134366)
17
+ [`6dc568b170746`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6dc568b170746) -
18
+ updated handling of urls on export to exclude marking data urls as external for images
19
+
3
20
  ## 102.18.0
4
21
 
5
22
  ### Minor Changes
@@ -20,17 +20,23 @@ var baseStyles = (0, _primitives.xcss)({
20
20
  });
21
21
  var NO_EXTERNAL_BADGE_HOSTS = ['atlassian.com'];
22
22
  var isUnbadgedUrl = exports.isUnbadgedUrl = function isUnbadgedUrl(url) {
23
- var hostname;
23
+ if (!url) {
24
+ return false;
25
+ }
26
+ // Check if URL is valid
24
27
  try {
25
- var _URL = new URL(url || '');
26
- hostname = _URL.hostname;
27
- } catch (e) {
28
- // If the URL is invalid (or empty), just carry on showing the badge
28
+ new URL(url);
29
+ } catch (_unused) {
29
30
  return false;
30
31
  }
31
- return Boolean(hostname &&
32
- // Do not show badge for atlassian domains and subdomains
33
- NO_EXTERNAL_BADGE_HOSTS.some(function (host) {
32
+ var parsedUrl = new URL(url || '');
33
+ var hostname = parsedUrl.hostname,
34
+ pathname = parsedUrl.pathname,
35
+ protocol = parsedUrl.protocol;
36
+ if (protocol === 'data:') {
37
+ return pathname === null || pathname === void 0 ? void 0 : pathname.startsWith('image/');
38
+ }
39
+ return Boolean(hostname && NO_EXTERNAL_BADGE_HOSTS.some(function (host) {
34
40
  return hostname === host || hostname.endsWith(".".concat(host));
35
41
  }));
36
42
  };
@@ -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 && {}.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 = "102.18.0";
20
+ var packageVersion = "102.18.2";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // Ignored via go/ees007
@@ -15,6 +15,7 @@ var _editorPalette = require("@atlaskit/editor-palette");
15
15
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
16
16
  var _consts = require("@atlaskit/editor-shared-styles/consts");
17
17
  var _emoji = require("@atlaskit/emoji");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
20
  var _templateObject;
20
21
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
@@ -135,8 +136,12 @@ var PanelSharedSelectors = exports.PanelSharedSelectors = {
135
136
  yellowWarningIcon: "[aria-label=\":warning:\"] span:nth-child(1)",
136
137
  copyButton: "button[aria-label=\"Copy\"]"
137
138
  };
138
- var iconDynamicStyles = function iconDynamicStyles(panelType) {
139
- return "color: ".concat(lightIconColor[panelType], ";");
139
+ var getIconStyles = function getIconStyles(panelType) {
140
+ if ((0, _platformFeatureFlags.fg)('platform_editor_lcm_nested_panel_icon_fix')) {
141
+ return "\n\t\t\t.".concat(PanelSharedCssClassName.icon, "[data-panel-type='").concat(panelType, "'] {\n\t\t\t\tcolor: ").concat(lightIconColor[panelType], ";\n\t\t\t}\n\t\t");
142
+ } else {
143
+ return "\n\t\t\t.".concat(PanelSharedCssClassName.icon, " {\n\t\t\t\tcolor: ").concat(lightIconColor[panelType], ";\n\t\t\t}\n\t\t");
144
+ }
140
145
  };
141
146
 
142
147
  // Provides the color without tokens, used when converting to a custom panel
@@ -152,7 +157,7 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
152
157
 
153
158
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Safe to autofix with a tiny tweak to `mainDynamicStyles` being an object, but holding off…
154
159
  var panelSharedStylesWithoutPrefix = exports.panelSharedStylesWithoutPrefix = function panelSharedStylesWithoutPrefix() {
155
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tborder-radius: ", ";\n\tmargin: ", " 0 0;\n\tpadding-top: ", ";\n\tpadding-right: ", ";\n\tpadding-bottom: ", ";\n\tpadding-left: ", ";\n\tmin-width: ", "px;\n\tdisplay: flex;\n\tposition: relative;\n\talign-items: normal;\n\tword-break: break-word;\n\n\t", "\n\n\t.", " {\n\t\tflex-shrink: 0;\n\t\theight: ", ";\n\t\twidth: ", ";\n\t\tbox-sizing: content-box;\n\t\tpadding-right: ", ";\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t\t-moz-user-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t\tmargin-top: 0.1em;\n\t\t", "\n\n\t\t> span {\n\t\t\tvertical-align: middle;\n\t\t\tdisplay: inline-flex;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\n\t\t\t// Vertical align only works for inline-block elements in Firefox\n\t\t\t@-moz-document url-prefix() {\n\t\t\t\timg {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.ak-editor-panel__content {\n\t\tmargin: ", " 0 ", ";\n\t\tflex: 1 0 0;\n\t\t/*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n\t\tmin-width: 0;\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n"])), "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", iconDynamicStyles(_adfSchema.PanelType.INFO), _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS), (0, _experiments.editorExperiment)('nested-dnd', true) ? "&.".concat(PanelSharedCssClassName.noIcon, " {\n\t\t\tpadding-right: ", "var(--ds-space-150, 12px)", ";\n\t\t\tpadding-left: ", "var(--ds-space-150, 12px)", ";\n\t\t}") : '');
160
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tborder-radius: ", ";\n\tmargin: ", " 0 0;\n\tpadding-top: ", ";\n\tpadding-right: ", ";\n\tpadding-bottom: ", ";\n\tpadding-left: ", ";\n\tmin-width: ", "px;\n\tdisplay: flex;\n\tposition: relative;\n\talign-items: normal;\n\tword-break: break-word;\n\n\t", "\n\n\t.", " {\n\t\tflex-shrink: 0;\n\t\theight: ", ";\n\t\twidth: ", ";\n\t\tbox-sizing: content-box;\n\t\tpadding-right: ", ";\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t\t-moz-user-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t\tmargin-top: 0.1em;\n\n\t\t> span {\n\t\t\tvertical-align: middle;\n\t\t\tdisplay: inline-flex;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\n\t\t\t// Vertical align only works for inline-block elements in Firefox\n\t\t\t@-moz-document url-prefix() {\n\t\t\t\timg {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.ak-editor-panel__content {\n\t\tmargin: ", " 0 ", ";\n\t\tflex: 1 0 0;\n\t\t/*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n\t\tmin-width: 0;\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t", "\n"])), "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", _adfSchema.PanelType.INFO, getIconStyles(_adfSchema.PanelType.INFO), _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), getIconStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), getIconStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), getIconStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), getIconStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), getIconStyles(_adfSchema.PanelType.SUCCESS), (0, _experiments.editorExperiment)('nested-dnd', true) ? "&.".concat(PanelSharedCssClassName.noIcon, " {\n\t\t\tpadding-right: ", "var(--ds-space-150, 12px)", ";\n\t\t\tpadding-left: ", "var(--ds-space-150, 12px)", ";\n\t\t}") : '');
156
161
  };
157
162
  var panelSharedStyles = exports.panelSharedStyles = function panelSharedStyles() {
158
163
  return (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(PanelSharedCssClassName.prefix), panelSharedStylesWithoutPrefix()));
@@ -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 = "102.18.0";
26
+ var packageVersion = "102.18.2";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -13,18 +13,25 @@ const baseStyles = xcss({
13
13
  });
14
14
  const NO_EXTERNAL_BADGE_HOSTS = ['atlassian.com'];
15
15
  export const isUnbadgedUrl = url => {
16
- let hostname;
16
+ if (!url) {
17
+ return false;
18
+ }
19
+ // Check if URL is valid
17
20
  try {
18
- ({
19
- hostname
20
- } = new URL(url || ''));
21
- } catch (e) {
22
- // If the URL is invalid (or empty), just carry on showing the badge
21
+ new URL(url);
22
+ } catch {
23
23
  return false;
24
24
  }
25
- return Boolean(hostname &&
26
- // Do not show badge for atlassian domains and subdomains
27
- NO_EXTERNAL_BADGE_HOSTS.some(host => hostname === host || hostname.endsWith(`.${host}`)));
25
+ const parsedUrl = new URL(url || '');
26
+ const {
27
+ hostname,
28
+ pathname,
29
+ protocol
30
+ } = parsedUrl;
31
+ if (protocol === 'data:') {
32
+ return pathname === null || pathname === void 0 ? void 0 : pathname.startsWith('image/');
33
+ }
34
+ return Boolean(hostname && NO_EXTERNAL_BADGE_HOSTS.some(host => hostname === host || hostname.endsWith(`.${host}`)));
28
35
  };
29
36
  export const ExternalImageBadge = ({
30
37
  type,
@@ -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 = "102.18.0";
4
+ const packageVersion = "102.18.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -6,6 +6,7 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
6
6
  import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
7
7
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
8
8
  import { emojiImage, emojiSprite } from '@atlaskit/emoji';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
11
  const lightPanelColors = {
11
12
  info: '#DEEBFF',
@@ -128,7 +129,21 @@ export const PanelSharedSelectors = {
128
129
  yellowWarningIcon: `[aria-label=":warning:"] span:nth-child(1)`,
129
130
  copyButton: `button[aria-label="Copy"]`
130
131
  };
131
- const iconDynamicStyles = panelType => `color: ${lightIconColor[panelType]};`;
132
+ const getIconStyles = panelType => {
133
+ if (fg('platform_editor_lcm_nested_panel_icon_fix')) {
134
+ return `
135
+ .${PanelSharedCssClassName.icon}[data-panel-type='${panelType}'] {
136
+ color: ${lightIconColor[panelType]};
137
+ }
138
+ `;
139
+ } else {
140
+ return `
141
+ .${PanelSharedCssClassName.icon} {
142
+ color: ${lightIconColor[panelType]};
143
+ }
144
+ `;
145
+ }
146
+ };
132
147
 
133
148
  // Provides the color without tokens, used when converting to a custom panel
134
149
  export const getPanelTypeBackgroundNoTokens = panelType => lightPanelColors[panelType] || 'none';
@@ -168,7 +183,6 @@ export const panelSharedStylesWithoutPrefix = () => css`
168
183
  -webkit-user-select: none;
169
184
  -ms-user-select: none;
170
185
  margin-top: 0.1em;
171
- ${iconDynamicStyles(PanelType.INFO)}
172
186
 
173
187
  > span {
174
188
  vertical-align: middle;
@@ -201,44 +215,33 @@ export const panelSharedStylesWithoutPrefix = () => css`
201
215
  min-width: 0;
202
216
  }
203
217
 
218
+ &[data-panel-type='${PanelType.INFO}'] {
219
+ ${getIconStyles(PanelType.INFO)}
220
+ }
221
+
204
222
  &[data-panel-type='${PanelType.NOTE}'] {
205
223
  ${mainDynamicStyles(PanelType.NOTE)}
206
-
207
- .${PanelSharedCssClassName.icon} {
208
- ${iconDynamicStyles(PanelType.NOTE)}
209
- }
224
+ ${getIconStyles(PanelType.NOTE)}
210
225
  }
211
226
 
212
227
  &[data-panel-type='${PanelType.TIP}'] {
213
228
  ${mainDynamicStyles(PanelType.TIP)}
214
-
215
- .${PanelSharedCssClassName.icon} {
216
- ${iconDynamicStyles(PanelType.TIP)}
217
- }
229
+ ${getIconStyles(PanelType.TIP)}
218
230
  }
219
231
 
220
232
  &[data-panel-type='${PanelType.WARNING}'] {
221
233
  ${mainDynamicStyles(PanelType.WARNING)}
222
-
223
- .${PanelSharedCssClassName.icon} {
224
- ${iconDynamicStyles(PanelType.WARNING)}
225
- }
234
+ ${getIconStyles(PanelType.WARNING)}
226
235
  }
227
236
 
228
237
  &[data-panel-type='${PanelType.ERROR}'] {
229
238
  ${mainDynamicStyles(PanelType.ERROR)}
230
-
231
- .${PanelSharedCssClassName.icon} {
232
- ${iconDynamicStyles(PanelType.ERROR)}
233
- }
239
+ ${getIconStyles(PanelType.ERROR)}
234
240
  }
235
241
 
236
242
  &[data-panel-type='${PanelType.SUCCESS}'] {
237
243
  ${mainDynamicStyles(PanelType.SUCCESS)}
238
-
239
- .${PanelSharedCssClassName.icon} {
240
- ${iconDynamicStyles(PanelType.SUCCESS)}
241
- }
244
+ ${getIconStyles(PanelType.SUCCESS)}
242
245
  }
243
246
 
244
247
  ${editorExperiment('nested-dnd', true) ? `&.${PanelSharedCssClassName.noIcon} {
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "102.18.0";
16
+ const packageVersion = "102.18.2";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -13,17 +13,23 @@ var baseStyles = xcss({
13
13
  });
14
14
  var NO_EXTERNAL_BADGE_HOSTS = ['atlassian.com'];
15
15
  export var isUnbadgedUrl = function isUnbadgedUrl(url) {
16
- var hostname;
16
+ if (!url) {
17
+ return false;
18
+ }
19
+ // Check if URL is valid
17
20
  try {
18
- var _URL = new URL(url || '');
19
- hostname = _URL.hostname;
20
- } catch (e) {
21
- // If the URL is invalid (or empty), just carry on showing the badge
21
+ new URL(url);
22
+ } catch (_unused) {
22
23
  return false;
23
24
  }
24
- return Boolean(hostname &&
25
- // Do not show badge for atlassian domains and subdomains
26
- NO_EXTERNAL_BADGE_HOSTS.some(function (host) {
25
+ var parsedUrl = new URL(url || '');
26
+ var hostname = parsedUrl.hostname,
27
+ pathname = parsedUrl.pathname,
28
+ protocol = parsedUrl.protocol;
29
+ if (protocol === 'data:') {
30
+ return pathname === null || pathname === void 0 ? void 0 : pathname.startsWith('image/');
31
+ }
32
+ return Boolean(hostname && NO_EXTERNAL_BADGE_HOSTS.some(function (host) {
27
33
  return hostname === host || hostname.endsWith(".".concat(host));
28
34
  }));
29
35
  };
@@ -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 = "102.18.0";
10
+ var packageVersion = "102.18.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -9,6 +9,7 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
9
9
  import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
10
10
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
11
11
  import { emojiImage, emojiSprite } from '@atlaskit/emoji';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
14
  var lightPanelColors = {
14
15
  info: '#DEEBFF',
@@ -126,8 +127,12 @@ export var PanelSharedSelectors = {
126
127
  yellowWarningIcon: "[aria-label=\":warning:\"] span:nth-child(1)",
127
128
  copyButton: "button[aria-label=\"Copy\"]"
128
129
  };
129
- var iconDynamicStyles = function iconDynamicStyles(panelType) {
130
- return "color: ".concat(lightIconColor[panelType], ";");
130
+ var getIconStyles = function getIconStyles(panelType) {
131
+ if (fg('platform_editor_lcm_nested_panel_icon_fix')) {
132
+ return "\n\t\t\t.".concat(PanelSharedCssClassName.icon, "[data-panel-type='").concat(panelType, "'] {\n\t\t\t\tcolor: ").concat(lightIconColor[panelType], ";\n\t\t\t}\n\t\t");
133
+ } else {
134
+ return "\n\t\t\t.".concat(PanelSharedCssClassName.icon, " {\n\t\t\t\tcolor: ").concat(lightIconColor[panelType], ";\n\t\t\t}\n\t\t");
135
+ }
131
136
  };
132
137
 
133
138
  // Provides the color without tokens, used when converting to a custom panel
@@ -143,7 +148,7 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
143
148
 
144
149
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Safe to autofix with a tiny tweak to `mainDynamicStyles` being an object, but holding off…
145
150
  export var panelSharedStylesWithoutPrefix = function panelSharedStylesWithoutPrefix() {
146
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tborder-radius: ", ";\n\tmargin: ", " 0 0;\n\tpadding-top: ", ";\n\tpadding-right: ", ";\n\tpadding-bottom: ", ";\n\tpadding-left: ", ";\n\tmin-width: ", "px;\n\tdisplay: flex;\n\tposition: relative;\n\talign-items: normal;\n\tword-break: break-word;\n\n\t", "\n\n\t.", " {\n\t\tflex-shrink: 0;\n\t\theight: ", ";\n\t\twidth: ", ";\n\t\tbox-sizing: content-box;\n\t\tpadding-right: ", ";\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t\t-moz-user-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t\tmargin-top: 0.1em;\n\t\t", "\n\n\t\t> span {\n\t\t\tvertical-align: middle;\n\t\t\tdisplay: inline-flex;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\n\t\t\t// Vertical align only works for inline-block elements in Firefox\n\t\t\t@-moz-document url-prefix() {\n\t\t\t\timg {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.ak-editor-panel__content {\n\t\tmargin: ", " 0 ", ";\n\t\tflex: 1 0 0;\n\t\t/*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n\t\tmin-width: 0;\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n"])), "var(--ds-border-radius, 3px)", blockNodesVerticalMargin, "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", iconDynamicStyles(PanelType.INFO), emojiSprite, panelEmojiSpriteVerticalAlignment, emojiImage, panelEmojiImageVerticalAlignment, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.SUCCESS), editorExperiment('nested-dnd', true) ? "&.".concat(PanelSharedCssClassName.noIcon, " {\n\t\t\tpadding-right: ", "var(--ds-space-150, 12px)", ";\n\t\t\tpadding-left: ", "var(--ds-space-150, 12px)", ";\n\t\t}") : '');
151
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tborder-radius: ", ";\n\tmargin: ", " 0 0;\n\tpadding-top: ", ";\n\tpadding-right: ", ";\n\tpadding-bottom: ", ";\n\tpadding-left: ", ";\n\tmin-width: ", "px;\n\tdisplay: flex;\n\tposition: relative;\n\talign-items: normal;\n\tword-break: break-word;\n\n\t", "\n\n\t.", " {\n\t\tflex-shrink: 0;\n\t\theight: ", ";\n\t\twidth: ", ";\n\t\tbox-sizing: content-box;\n\t\tpadding-right: ", ";\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t\t-moz-user-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t\tmargin-top: 0.1em;\n\n\t\t> span {\n\t\t\tvertical-align: middle;\n\t\t\tdisplay: inline-flex;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\n\t\t\t// Vertical align only works for inline-block elements in Firefox\n\t\t\t@-moz-document url-prefix() {\n\t\t\t\timg {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.ak-editor-panel__content {\n\t\tmargin: ", " 0 ", ";\n\t\tflex: 1 0 0;\n\t\t/*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n\t\tmin-width: 0;\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\t\t", "\n\t}\n\n\t", "\n"])), "var(--ds-border-radius, 3px)", blockNodesVerticalMargin, "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", emojiSprite, panelEmojiSpriteVerticalAlignment, emojiImage, panelEmojiImageVerticalAlignment, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", PanelType.INFO, getIconStyles(PanelType.INFO), PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), getIconStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), getIconStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), getIconStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), getIconStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), getIconStyles(PanelType.SUCCESS), editorExperiment('nested-dnd', true) ? "&.".concat(PanelSharedCssClassName.noIcon, " {\n\t\t\tpadding-right: ", "var(--ds-space-150, 12px)", ";\n\t\t\tpadding-left: ", "var(--ds-space-150, 12px)", ";\n\t\t}") : '');
147
152
  };
148
153
  export var panelSharedStyles = function panelSharedStyles() {
149
154
  return css(_defineProperty({}, ".".concat(PanelSharedCssClassName.prefix), panelSharedStylesWithoutPrefix()));
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "102.18.0";
23
+ var packageVersion = "102.18.2";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "102.18.0",
3
+ "version": "102.18.2",
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/"
@@ -125,7 +125,7 @@
125
125
  "@atlaskit/analytics-next": "^11.0.0",
126
126
  "@atlaskit/atlassian-context": "^0.2.0",
127
127
  "@atlaskit/button": "^23.0.0",
128
- "@atlaskit/code": "^16.2.0",
128
+ "@atlaskit/code": "^16.3.0",
129
129
  "@atlaskit/codemod-utils": "^4.2.0",
130
130
  "@atlaskit/css": "^0.10.0",
131
131
  "@atlaskit/custom-steps": "^0.11.0",
@@ -340,6 +340,9 @@
340
340
  },
341
341
  "platform_editor_controls_patch_2": {
342
342
  "type": "boolean"
343
+ },
344
+ "platform_editor_lcm_nested_panel_icon_fix": {
345
+ "type": "boolean"
343
346
  }
344
347
  }
345
348
  }