@atlaskit/editor-plugin-panel 10.0.19 → 10.0.21

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,19 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 10.0.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 10.0.20
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d3c7e8b3f1a04`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3c7e8b3f1a04) -
14
+ add stricter typecheck for panel color attr to avoid unhandled errors
15
+ - Updated dependencies
16
+
3
17
  ## 10.0.19
4
18
 
5
19
  ### Patch Changes
@@ -27,9 +27,9 @@ var panelAttrsToDom = exports.panelAttrsToDom = function panelAttrsToDom(attrs,
27
27
  panelIconText = attrs.panelIconText;
28
28
  var isCustomPanel = panelType === _adfSchema.PanelType.CUSTOM && allowCustomPanel;
29
29
  var hasIcon = !isCustomPanel || !!panelIcon || !!panelIconId;
30
- var tokenColor = panelColor && (0, _editorPalette.hexToEditorBackgroundPaletteColor)(panelColor);
30
+ var tokenColor = (0, _expValEquals.expValEquals)('platform_editor_stricter_panelcolor_typecheck', 'isEnabled', true) ? typeof panelColor === 'string' && (0, _editorPalette.hexToEditorBackgroundPaletteColor)(panelColor) : panelColor && (0, _editorPalette.hexToEditorBackgroundPaletteColor)(panelColor);
31
31
  var panelBackgroundColor = tokenColor || panelColor;
32
- var style = ["".concat(panelColor && isCustomPanel ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(!hasIcon && !(0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? "padding-left: 12px;padding-right: 12px;" : '')].join('');
32
+ var style = ["".concat(((0, _expValEquals.expValEquals)('platform_editor_stricter_panelcolor_typecheck', 'isEnabled', true) ? typeof panelColor === 'string' && isCustomPanel : panelColor && isCustomPanel) ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(!hasIcon && !(0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? "padding-left: 12px;padding-right: 12px;" : '')].join('');
33
33
  var panelAttrs = {
34
34
  class: "".concat(_panel.PanelSharedCssClassName.prefix).concat(!hasIcon && (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? " ".concat(_panel.PanelSharedCssClassName.noIcon) : ''),
35
35
  'data-panel-type': panelType || _adfSchema.PanelType.INFO,
@@ -21,9 +21,9 @@ export const panelAttrsToDom = (attrs, allowCustomPanel) => {
21
21
  } = attrs;
22
22
  const isCustomPanel = panelType === PanelType.CUSTOM && allowCustomPanel;
23
23
  const hasIcon = !isCustomPanel || !!panelIcon || !!panelIconId;
24
- const tokenColor = panelColor && hexToEditorBackgroundPaletteColor(panelColor);
24
+ const tokenColor = expValEquals('platform_editor_stricter_panelcolor_typecheck', 'isEnabled', true) ? typeof panelColor === 'string' && hexToEditorBackgroundPaletteColor(panelColor) : panelColor && hexToEditorBackgroundPaletteColor(panelColor);
25
25
  const panelBackgroundColor = tokenColor || panelColor;
26
- const style = [`${panelColor && isCustomPanel ? `background-color: ${panelBackgroundColor};` : ''}`, `${!hasIcon && !fg('platform_editor_nested_dnd_styles_changes') ? `padding-left: 12px;padding-right: 12px;` : ''}`].join('');
26
+ const style = [`${(expValEquals('platform_editor_stricter_panelcolor_typecheck', 'isEnabled', true) ? typeof panelColor === 'string' && isCustomPanel : panelColor && isCustomPanel) ? `background-color: ${panelBackgroundColor};` : ''}`, `${!hasIcon && !fg('platform_editor_nested_dnd_styles_changes') ? `padding-left: 12px;padding-right: 12px;` : ''}`].join('');
27
27
  let panelAttrs = {
28
28
  class: `${PanelSharedCssClassName.prefix}${!hasIcon && fg('platform_editor_nested_dnd_styles_changes') ? ` ${PanelSharedCssClassName.noIcon}` : ''}`,
29
29
  'data-panel-type': panelType || PanelType.INFO,
@@ -20,9 +20,9 @@ export var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
20
20
  panelIconText = attrs.panelIconText;
21
21
  var isCustomPanel = panelType === PanelType.CUSTOM && allowCustomPanel;
22
22
  var hasIcon = !isCustomPanel || !!panelIcon || !!panelIconId;
23
- var tokenColor = panelColor && hexToEditorBackgroundPaletteColor(panelColor);
23
+ var tokenColor = expValEquals('platform_editor_stricter_panelcolor_typecheck', 'isEnabled', true) ? typeof panelColor === 'string' && hexToEditorBackgroundPaletteColor(panelColor) : panelColor && hexToEditorBackgroundPaletteColor(panelColor);
24
24
  var panelBackgroundColor = tokenColor || panelColor;
25
- var style = ["".concat(panelColor && isCustomPanel ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(!hasIcon && !fg('platform_editor_nested_dnd_styles_changes') ? "padding-left: 12px;padding-right: 12px;" : '')].join('');
25
+ var style = ["".concat((expValEquals('platform_editor_stricter_panelcolor_typecheck', 'isEnabled', true) ? typeof panelColor === 'string' && isCustomPanel : panelColor && isCustomPanel) ? "background-color: ".concat(panelBackgroundColor, ";") : ''), "".concat(!hasIcon && !fg('platform_editor_nested_dnd_styles_changes') ? "padding-left: 12px;padding-right: 12px;" : '')].join('');
26
26
  var panelAttrs = {
27
27
  class: "".concat(PanelSharedCssClassName.prefix).concat(!hasIcon && fg('platform_editor_nested_dnd_styles_changes') ? " ".concat(PanelSharedCssClassName.noIcon) : ''),
28
28
  'data-panel-type': panelType || PanelType.INFO,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "10.0.19",
3
+ "version": "10.0.21",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/icon": "^33.1.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/theme": "^22.0.0",
45
- "@atlaskit/tmp-editor-statsig": "^51.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^52.0.0",
46
46
  "@atlaskit/tokens": "^11.4.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "uuid": "^3.1.0"