@atlaskit/editor-common 110.50.3 → 111.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/monitoring/error.js +1 -1
  3. package/dist/cjs/panel.js +0 -6
  4. package/dist/cjs/styles/shared/panel.js +1 -68
  5. package/dist/cjs/ui/DropList/index.js +1 -1
  6. package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +0 -2
  7. package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +23 -168
  8. package/dist/cjs/ui-color/index.js +0 -6
  9. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +17 -10
  10. package/dist/es2019/monitoring/error.js +1 -1
  11. package/dist/es2019/panel.js +1 -1
  12. package/dist/es2019/styles/shared/panel.js +0 -70
  13. package/dist/es2019/ui/DropList/index.js +1 -1
  14. package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +0 -2
  15. package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +21 -167
  16. package/dist/es2019/ui-color/index.js +1 -1
  17. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +15 -8
  18. package/dist/esm/monitoring/error.js +1 -1
  19. package/dist/esm/panel.js +1 -1
  20. package/dist/esm/styles/shared/panel.js +0 -65
  21. package/dist/esm/ui/DropList/index.js +1 -1
  22. package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +0 -2
  23. package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +21 -168
  24. package/dist/esm/ui-color/index.js +1 -1
  25. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +17 -10
  26. package/dist/types/panel.d.ts +1 -1
  27. package/dist/types/styles/shared/panel.d.ts +0 -49
  28. package/dist/types/ui-color/ColorPalette/Palettes/panelBackgroundPalette.d.ts +1 -3
  29. package/dist/types/ui-color/index.d.ts +1 -1
  30. package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
  31. package/dist/types-ts4.5/panel.d.ts +1 -1
  32. package/dist/types-ts4.5/styles/shared/panel.d.ts +0 -49
  33. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/panelBackgroundPalette.d.ts +1 -3
  34. package/dist/types-ts4.5/ui-color/index.d.ts +1 -1
  35. package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
  36. package/package.json +1 -1
@@ -6,7 +6,7 @@ export { default as Color } from './ColorPalette/Color';
6
6
  export { DEFAULT_COLOR_PICKER_COLUMNS, getColorsPerRowFromPalette, getSelectedRowAndColumn, getSelectedRowAndColumnFromPalette } from './ColorPalette/utils';
7
7
  export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/cellBackgroundColorPalette';
8
8
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
9
- export { panelBackgroundPalette, panelDarkModeBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
9
+ export { panelBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
10
10
  export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
11
11
  export { highlightColorPalette, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
12
12
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
@@ -6,10 +6,11 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "handleBackspaceDeleteKeydown", "closeOnTab", "captureClick"];
9
+ var _excluded = ["captureClick", "closeOnTab", "handleBackspaceDeleteKeydown", "handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "handleKeyDown"];
10
10
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  import React, { PureComponent, useCallback, useEffect, useRef, useState } from 'react';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
15
  import ReactEditorViewContext from './ReactEditorViewContext';
15
16
  // Use this context to pass in the reference of the element that should be considered as the outside click target
@@ -45,7 +46,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
45
46
  }
46
47
  }
47
48
  });
48
- _defineProperty(_this, "handleKeydown", function (evt) {
49
+ _defineProperty(_this, "handleKeyDown", function (evt) {
49
50
  if (!_this.props.isActiveComponent) {
50
51
  return;
51
52
  }
@@ -63,6 +64,10 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
63
64
  } else if ((evt.code === 'Delete' || evt.code === 'Backspace') && _this.props.handleBackspaceDeleteKeydown) {
64
65
  _this.props.handleBackspaceDeleteKeydown(evt);
65
66
  }
67
+ if (expValEquals('platform_editor_block_menu', 'isEnabled', true)) {
68
+ var _this$props$handleKey, _this$props;
69
+ (_this$props$handleKey = (_this$props = _this.props).handleKeyDown) === null || _this$props$handleKey === void 0 || _this$props$handleKey.call(_this$props, evt);
70
+ }
66
71
  });
67
72
  return _this;
68
73
  }
@@ -78,7 +83,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
78
83
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
79
84
  document.addEventListener('click', this.handleClick, options);
80
85
  }
81
- if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
86
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown || this.props.handleKeyDown && expValEquals('platform_editor_block_menu', 'isEnabled', true)) {
82
87
  var _this$props$editorRef;
83
88
  // Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
84
89
  // Ignored via go/ees005
@@ -89,7 +94,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
89
94
 
90
95
  // Ignored via go/ees005
91
96
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
- ).addEventListener('keydown', this.handleKeydown, false);
97
+ ).addEventListener('keydown', this.handleKeyDown, false);
93
98
  }
94
99
  }
95
100
  }, {
@@ -103,7 +108,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
103
108
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
104
109
  document.removeEventListener('click', this.handleClick, options);
105
110
  }
106
- if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
111
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown || this.props.handleKeyDown && expValEquals('platform_editor_block_menu', 'isEnabled', true)) {
107
112
  var _this$props$editorRef2;
108
113
  // Ignored via go/ees005
109
114
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
@@ -113,7 +118,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
113
118
 
114
119
  // Ignored via go/ees005
115
120
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
- ).removeEventListener('keydown', this.handleKeydown, false);
121
+ ).removeEventListener('keydown', this.handleKeyDown, false);
117
122
  }
118
123
  }
119
124
  }, {
@@ -130,12 +135,13 @@ function hasIsOpen(props) {
130
135
  }
131
136
  export default function withReactEditorViewOuterListeners(Component) {
132
137
  return function (_ref) {
133
- var handleClickOutside = _ref.handleClickOutside,
138
+ var captureClick = _ref.captureClick,
139
+ closeOnTab = _ref.closeOnTab,
140
+ handleBackspaceDeleteKeydown = _ref.handleBackspaceDeleteKeydown,
141
+ handleClickOutside = _ref.handleClickOutside,
134
142
  handleEnterKeydown = _ref.handleEnterKeydown,
135
143
  handleEscapeKeydown = _ref.handleEscapeKeydown,
136
- handleBackspaceDeleteKeydown = _ref.handleBackspaceDeleteKeydown,
137
- closeOnTab = _ref.closeOnTab,
138
- captureClick = _ref.captureClick,
144
+ handleKeyDown = _ref.handleKeyDown,
139
145
  props = _objectWithoutProperties(_ref, _excluded);
140
146
  var isActiveProp = hasIsOpen(props) ? props.isOpen : true;
141
147
  var _useState = useState(false),
@@ -168,6 +174,7 @@ export default function withReactEditorViewOuterListeners(Component) {
168
174
  handleEnterKeydown: handleEnterKeydown,
169
175
  handleEscapeKeydown: handleEscapeKeydown,
170
176
  handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
177
+ handleKeyDown: handleKeyDown,
171
178
  closeOnTab: closeOnTab,
172
179
  captureClick: captureClick
173
180
  }, /*#__PURE__*/React.createElement(Component
@@ -1 +1 @@
1
- export { getPanelTypeBackground, getPanelTypeBackgroundNoTokens, darkPanelColors, PanelSharedCssClassName, PanelSharedSelectors, } from './styles/shared/panel';
1
+ export { getPanelTypeBackground, getPanelTypeBackgroundNoTokens, PanelSharedCssClassName, PanelSharedSelectors, } from './styles/shared/panel';
@@ -1,53 +1,4 @@
1
1
  import { PanelType } from '@atlaskit/adf-schema';
2
- export declare const darkPanelColors: {
3
- info: string;
4
- error: string;
5
- warning: string;
6
- tip: string;
7
- success: string;
8
- note: string;
9
- R900: string;
10
- R100S: string;
11
- R300S: string;
12
- R500S: string;
13
- R800S: string;
14
- R1200S: string;
15
- Y900: string;
16
- Y100S: string;
17
- Y300S: string;
18
- Y500S: string;
19
- Y800S: string;
20
- Y1200S: string;
21
- G900: string;
22
- G100S: string;
23
- G300S: string;
24
- G400S: string;
25
- G900S: string;
26
- G1200S: string;
27
- B900: string;
28
- B100S: string;
29
- B300S: string;
30
- B500S: string;
31
- B800S: string;
32
- B1200S: string;
33
- P900: string;
34
- P100S: string;
35
- P300S: string;
36
- P500S: string;
37
- P800S: string;
38
- P1200S: string;
39
- T900: string;
40
- T100S: string;
41
- T300S: string;
42
- T400S: string;
43
- T900S: string;
44
- T1200S: string;
45
- DarkGray: string;
46
- Gray: string;
47
- LightGray: string;
48
- TextColor: string;
49
- };
50
- export declare function getPanelDarkModeCSS(colorName: string, colorValue: string): string;
51
2
  export declare const PanelSharedCssClassName: {
52
3
  prefix: string;
53
4
  content: string;
@@ -1,4 +1,2 @@
1
- import { type PaletteColor } from './type';
2
- /** this is not new usage - old code extracted from editor-core */
1
+ import type { PaletteColor } from './type';
3
2
  export declare const panelBackgroundPalette: PaletteColor[];
4
- export declare const panelDarkModeBackgroundPalette: PaletteColor[];
@@ -3,7 +3,7 @@ export { default as Color } from './ColorPalette/Color';
3
3
  export { DEFAULT_COLOR_PICKER_COLUMNS, getColorsPerRowFromPalette, getSelectedRowAndColumn, getSelectedRowAndColumnFromPalette, } from './ColorPalette/utils';
4
4
  export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/cellBackgroundColorPalette';
5
5
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
6
- export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
6
+ export { panelBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
7
7
  export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
8
8
  export { highlightColorPalette, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
9
9
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
@@ -13,6 +13,7 @@ export interface WithOutsideClickProps {
13
13
  handleClickOutside?: SimpleEventHandler<MouseEvent>;
14
14
  handleEnterKeydown?: SimpleEventHandler<KeyboardEvent>;
15
15
  handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
16
+ handleKeyDown?: SimpleEventHandler<KeyboardEvent>;
16
17
  targetRef?: any;
17
18
  }
18
19
  export default function withReactEditorViewOuterListeners<P extends Object>(Component: React.ComponentType<React.PropsWithChildren<P>>): React.ComponentType<React.PropsWithChildren<P & WithOutsideClickProps>>;
@@ -1 +1 @@
1
- export { getPanelTypeBackground, getPanelTypeBackgroundNoTokens, darkPanelColors, PanelSharedCssClassName, PanelSharedSelectors, } from './styles/shared/panel';
1
+ export { getPanelTypeBackground, getPanelTypeBackgroundNoTokens, PanelSharedCssClassName, PanelSharedSelectors, } from './styles/shared/panel';
@@ -1,53 +1,4 @@
1
1
  import { PanelType } from '@atlaskit/adf-schema';
2
- export declare const darkPanelColors: {
3
- info: string;
4
- error: string;
5
- warning: string;
6
- tip: string;
7
- success: string;
8
- note: string;
9
- R900: string;
10
- R100S: string;
11
- R300S: string;
12
- R500S: string;
13
- R800S: string;
14
- R1200S: string;
15
- Y900: string;
16
- Y100S: string;
17
- Y300S: string;
18
- Y500S: string;
19
- Y800S: string;
20
- Y1200S: string;
21
- G900: string;
22
- G100S: string;
23
- G300S: string;
24
- G400S: string;
25
- G900S: string;
26
- G1200S: string;
27
- B900: string;
28
- B100S: string;
29
- B300S: string;
30
- B500S: string;
31
- B800S: string;
32
- B1200S: string;
33
- P900: string;
34
- P100S: string;
35
- P300S: string;
36
- P500S: string;
37
- P800S: string;
38
- P1200S: string;
39
- T900: string;
40
- T100S: string;
41
- T300S: string;
42
- T400S: string;
43
- T900S: string;
44
- T1200S: string;
45
- DarkGray: string;
46
- Gray: string;
47
- LightGray: string;
48
- TextColor: string;
49
- };
50
- export declare function getPanelDarkModeCSS(colorName: string, colorValue: string): string;
51
2
  export declare const PanelSharedCssClassName: {
52
3
  prefix: string;
53
4
  content: string;
@@ -1,4 +1,2 @@
1
- import { type PaletteColor } from './type';
2
- /** this is not new usage - old code extracted from editor-core */
1
+ import type { PaletteColor } from './type';
3
2
  export declare const panelBackgroundPalette: PaletteColor[];
4
- export declare const panelDarkModeBackgroundPalette: PaletteColor[];
@@ -3,7 +3,7 @@ export { default as Color } from './ColorPalette/Color';
3
3
  export { DEFAULT_COLOR_PICKER_COLUMNS, getColorsPerRowFromPalette, getSelectedRowAndColumn, getSelectedRowAndColumnFromPalette, } from './ColorPalette/utils';
4
4
  export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/cellBackgroundColorPalette';
5
5
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
6
- export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
6
+ export { panelBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
7
7
  export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
8
8
  export { highlightColorPalette, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
9
9
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
@@ -13,6 +13,7 @@ export interface WithOutsideClickProps {
13
13
  handleClickOutside?: SimpleEventHandler<MouseEvent>;
14
14
  handleEnterKeydown?: SimpleEventHandler<KeyboardEvent>;
15
15
  handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
16
+ handleKeyDown?: SimpleEventHandler<KeyboardEvent>;
16
17
  targetRef?: any;
17
18
  }
18
19
  export default function withReactEditorViewOuterListeners<P extends Object>(Component: React.ComponentType<React.PropsWithChildren<P>>): React.ComponentType<React.PropsWithChildren<P & WithOutsideClickProps>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "110.50.3",
3
+ "version": "111.0.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/"