@atlaskit/editor-common 82.5.0 → 82.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/keymaps/keymap.js +46 -13
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/ui/DropList/index.js +1 -1
  5. package/dist/cjs/ui-color/ColorPalette/Color/index.js +2 -2
  6. package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +9 -3
  7. package/dist/cjs/ui-color/ColorPalette/Palettes/textColorPalette.js +10 -1
  8. package/dist/cjs/ui-color/index.js +12 -0
  9. package/dist/es2019/keymaps/keymap.js +46 -13
  10. package/dist/es2019/monitoring/error.js +1 -1
  11. package/dist/es2019/ui/DropList/index.js +1 -1
  12. package/dist/es2019/ui-color/ColorPalette/Color/index.js +2 -2
  13. package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +5 -1
  14. package/dist/es2019/ui-color/ColorPalette/Palettes/textColorPalette.js +6 -1
  15. package/dist/es2019/ui-color/index.js +2 -2
  16. package/dist/esm/keymaps/keymap.js +46 -13
  17. package/dist/esm/monitoring/error.js +1 -1
  18. package/dist/esm/ui/DropList/index.js +1 -1
  19. package/dist/esm/ui-color/ColorPalette/Color/index.js +2 -2
  20. package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +8 -0
  21. package/dist/esm/ui-color/ColorPalette/Palettes/textColorPalette.js +9 -0
  22. package/dist/esm/ui-color/index.js +2 -2
  23. package/dist/types/types/annotation/index.d.ts +2 -0
  24. package/dist/types/types/feature-flags.d.ts +8 -0
  25. package/dist/types/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +1 -0
  26. package/dist/types/ui-color/ColorPalette/Palettes/textColorPalette.d.ts +2 -0
  27. package/dist/types/ui-color/index.d.ts +2 -2
  28. package/dist/types-ts4.5/types/annotation/index.d.ts +2 -0
  29. package/dist/types-ts4.5/types/feature-flags.d.ts +8 -0
  30. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +1 -0
  31. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/textColorPalette.d.ts +2 -0
  32. package/dist/types-ts4.5/ui-color/index.d.ts +2 -2
  33. package/package.json +260 -263
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 82.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#110884](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110884)
8
+ [`674f78166705c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/674f78166705c) -
9
+ [ux] [ED-23516] Change border color for highlight and text-color palettes to use tokens.
10
+ Changedefault palette color when undefined
11
+
12
+ ### Patch Changes
13
+
14
+ - [#110390](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110390)
15
+ [`bead123202369`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bead123202369) -
16
+ [ux] [ED-23642] Reordering the typeahead so that date, status, code block & info panel are above
17
+ the fold (in the top 5 results)
18
+ - [#110966](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110966)
19
+ [`31348c335b4b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/31348c335b4b3) -
20
+ ED-23690 - add inlineNodeTypes property to AnnotationComponentProps
21
+ - [#109764](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109764)
22
+ [`0c87bddb30871`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c87bddb30871) -
23
+ ED-23659 - fix keymap plugin `Dead` keys processing.
24
+ - Updated dependencies
25
+
3
26
  ## 82.5.0
4
27
 
5
28
  ### Minor Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.keymap = keymap;
7
7
  var _w3cKeyname = require("w3c-keyname");
8
8
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
9
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
10
  var _safePlugin = require("../safe-plugin");
10
11
  /**
11
12
  * A workaround for mostly Cyrillic but should have a positive affect
@@ -18,20 +19,52 @@ function keymap(bindings) {
18
19
  return new _safePlugin.SafePlugin({
19
20
  props: {
20
21
  handleKeyDown: function handleKeyDown(view, event) {
21
- var name = (0, _w3cKeyname.keyName)(event);
22
- var keyboardEvent = event;
23
- if (event.ctrlKey && name.length === 1 &&
24
- // Check the unicode of the character to
25
- // assert that its not an ASCII character.
26
- // These are characters outside Latin's range.
27
- /[^\u0000-\u007f]/.test(name)) {
28
- keyboardEvent = new KeyboardEvent('keydown', {
29
- key: _w3cKeyname.base[event.keyCode],
30
- code: event.code,
31
- ctrlKey: true
32
- });
22
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.text-alignment-keyboard-shortcuts')) {
23
+ var name = (0, _w3cKeyname.keyName)(event);
24
+ var keyboardEvent = event;
25
+
26
+ // We will try to bypass the keycode only if any of mod keys are pressed,
27
+ // to allow users to use non-latin and Dead characters.
28
+ var isModKeyPressed = event.ctrlKey || event.metaKey;
29
+
30
+ // Check the unicode of the character to assert that it's not an ASCII character.
31
+ // These are characters outside latin's range.
32
+ var isNonLatinKey = name.length === 1 && /[^\u0000-\u007f]/.test(name);
33
+
34
+ // The `Dead` key is a key that combines with a following key to produce a combined character.
35
+ // It will have `even.key === 'Dead'` in some browsers but the `keyCode` will be the same as in a qwerty-keyboard.
36
+ // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key and https://en.wikipedia.org/wiki/Dead_key
37
+ var isDeadKey = name === 'Dead';
38
+ if (isModKeyPressed && (isNonLatinKey || isDeadKey)) {
39
+ keyboardEvent = new KeyboardEvent(event.type, {
40
+ // FIXME: The event.keyCode is deprecated (see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode),
41
+ // and could be removed in any time, but the w3c-keyname library doesn't provide a way to get
42
+ // a key by event.code.
43
+ key: _w3cKeyname.base[event.keyCode],
44
+ code: event.code,
45
+ ctrlKey: event.ctrlKey,
46
+ altKey: event.altKey,
47
+ metaKey: event.metaKey,
48
+ shiftKey: event.shiftKey
49
+ });
50
+ }
51
+ return (0, _keymap.keydownHandler)(bindings)(view, keyboardEvent);
52
+ } else {
53
+ var _name = (0, _w3cKeyname.keyName)(event);
54
+ var _keyboardEvent = event;
55
+ if (event.ctrlKey && _name.length === 1 &&
56
+ // Check the unicode of the character to
57
+ // assert that its not an ASCII character.
58
+ // These are characters outside Latin's range.
59
+ /[^\u0000-\u007f]/.test(_name)) {
60
+ _keyboardEvent = new KeyboardEvent('keydown', {
61
+ key: _w3cKeyname.base[event.keyCode],
62
+ code: event.code,
63
+ ctrlKey: true
64
+ });
65
+ }
66
+ return (0, _keymap.keydownHandler)(bindings)(view, _keyboardEvent);
33
67
  }
34
- return (0, _keymap.keydownHandler)(bindings)(view, keyboardEvent);
35
68
  }
36
69
  }
37
70
  });
@@ -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 = "82.5.0";
20
+ var packageVersion = "82.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
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "82.5.0";
23
+ var packageVersion = "82.6.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -63,7 +63,7 @@ function FunctionalComponentColor(props) {
63
63
  ,
64
64
  className: "".concat(isSelected ? 'selected' : ''),
65
65
  style: {
66
- backgroundColor: colorStyle || 'transparent',
66
+ backgroundColor: colorStyle || ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
67
67
  border: "1px solid ".concat(borderColor)
68
68
  },
69
69
  autoFocus: autoFocus
@@ -128,7 +128,7 @@ var ClassComponentColor = /*#__PURE__*/function (_PureComponent) {
128
128
  ,
129
129
  className: "".concat(isSelected ? 'selected' : ''),
130
130
  style: {
131
- backgroundColor: colorStyle || 'transparent',
131
+ backgroundColor: colorStyle || ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
132
132
  border: "1px solid ".concat(borderColor)
133
133
  },
134
134
  autoFocus: autoFocus
@@ -4,7 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = exports.EditorDiagonalLineIcon = void 0;
7
+ exports.highlightColorPaletteWithTokenBorders = exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = exports.EditorDiagonalLineIcon = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
9
  var _react = require("@emotion/react");
9
10
  var _adfSchema = require("@atlaskit/adf-schema");
10
11
  var _icon = _interopRequireDefault(require("@atlaskit/icon"));
@@ -13,8 +14,8 @@ var _common = require("./common");
13
14
  var _getColorMessage = _interopRequireDefault(require("./getColorMessage"));
14
15
  var _paletteMessages = _interopRequireDefault(require("./paletteMessages"));
15
16
  var _textColorPalette = require("./textColorPalette");
16
- /** @jsx jsx */
17
-
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
18
19
  var REMOVE_HIGHLIGHT_COLOR = exports.REMOVE_HIGHLIGHT_COLOR = '#00000000';
19
20
  var DiagonalLineGlyph = function DiagonalLineGlyph() {
20
21
  return (0, _react.jsx)("svg", {
@@ -56,4 +57,9 @@ var highlightColorPalette = exports.highlightColorPalette = [{
56
57
  }];
57
58
  _adfSchema.backgroundColorPalette.forEach(function (label, color) {
58
59
  highlightColorPalette.push((0, _textColorPalette.mapPaletteColor)(label, color));
60
+ });
61
+ var highlightColorPaletteWithTokenBorders = exports.highlightColorPaletteWithTokenBorders = highlightColorPalette.map(function (paletteColor) {
62
+ return _objectSpread(_objectSpread({}, paletteColor), {}, {
63
+ border: "var(--ds-border, #091E4224)"
64
+ });
59
65
  });
@@ -4,11 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.textColorPalette = exports.mapPaletteColor = void 0;
7
+ exports.textColorPaletteWithTokenBorders = exports.textColorPaletteTokenBorders = exports.textColorPalette = exports.mapPaletteColor = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
9
  var _adfSchema = require("@atlaskit/adf-schema");
9
10
  var _common = require("./common");
10
11
  var _getColorMessage = _interopRequireDefault(require("./getColorMessage"));
11
12
  var _paletteMessages = _interopRequireDefault(require("./paletteMessages"));
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
15
  var mapPaletteColor = exports.mapPaletteColor = function mapPaletteColor(label, color) {
13
16
  var key = label.toLowerCase().replace(' ', '-');
14
17
  var message = (0, _getColorMessage.default)(_paletteMessages.default, key);
@@ -22,6 +25,12 @@ var mapPaletteColor = exports.mapPaletteColor = function mapPaletteColor(label,
22
25
 
23
26
  // row 1
24
27
  var textColorPalette = exports.textColorPalette = [];
28
+ var textColorPaletteTokenBorders = exports.textColorPaletteTokenBorders = [];
25
29
  _adfSchema.colorPalette.forEach(function (label, color) {
26
30
  textColorPalette.push(mapPaletteColor(label, color));
31
+ });
32
+ var textColorPaletteWithTokenBorders = exports.textColorPaletteWithTokenBorders = textColorPalette.map(function (paletteColor) {
33
+ return _objectSpread(_objectSpread({}, paletteColor), {}, {
34
+ border: "var(--ds-border, #091E4224)"
35
+ });
27
36
  });
@@ -100,6 +100,12 @@ Object.defineProperty(exports, "highlightColorPalette", {
100
100
  return _highlightColorPalette.highlightColorPalette;
101
101
  }
102
102
  });
103
+ Object.defineProperty(exports, "highlightColorPaletteWithTokenBorders", {
104
+ enumerable: true,
105
+ get: function get() {
106
+ return _highlightColorPalette.highlightColorPaletteWithTokenBorders;
107
+ }
108
+ });
103
109
  Object.defineProperty(exports, "lightModeStatusColorPalette", {
104
110
  enumerable: true,
105
111
  get: function get() {
@@ -124,6 +130,12 @@ Object.defineProperty(exports, "textColorPalette", {
124
130
  return _textColorPalette.textColorPalette;
125
131
  }
126
132
  });
133
+ Object.defineProperty(exports, "textColorPaletteWithTokenBorders", {
134
+ enumerable: true,
135
+ get: function get() {
136
+ return _textColorPalette.textColorPaletteWithTokenBorders;
137
+ }
138
+ });
127
139
  Object.defineProperty(exports, "textPaletteTooltipMessages", {
128
140
  enumerable: true,
129
141
  get: function get() {
@@ -1,5 +1,6 @@
1
1
  import { base, keyName } from 'w3c-keyname';
2
2
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import { SafePlugin } from '../safe-plugin';
4
5
 
5
6
  /**
@@ -13,20 +14,52 @@ export function keymap(bindings) {
13
14
  return new SafePlugin({
14
15
  props: {
15
16
  handleKeyDown(view, event) {
16
- const name = keyName(event);
17
- let keyboardEvent = event;
18
- if (event.ctrlKey && name.length === 1 &&
19
- // Check the unicode of the character to
20
- // assert that its not an ASCII character.
21
- // These are characters outside Latin's range.
22
- /[^\u0000-\u007f]/.test(name)) {
23
- keyboardEvent = new KeyboardEvent('keydown', {
24
- key: base[event.keyCode],
25
- code: event.code,
26
- ctrlKey: true
27
- });
17
+ if (getBooleanFF('platform.editor.text-alignment-keyboard-shortcuts')) {
18
+ const name = keyName(event);
19
+ let keyboardEvent = event;
20
+
21
+ // We will try to bypass the keycode only if any of mod keys are pressed,
22
+ // to allow users to use non-latin and Dead characters.
23
+ const isModKeyPressed = event.ctrlKey || event.metaKey;
24
+
25
+ // Check the unicode of the character to assert that it's not an ASCII character.
26
+ // These are characters outside latin's range.
27
+ const isNonLatinKey = name.length === 1 && /[^\u0000-\u007f]/.test(name);
28
+
29
+ // The `Dead` key is a key that combines with a following key to produce a combined character.
30
+ // It will have `even.key === 'Dead'` in some browsers but the `keyCode` will be the same as in a qwerty-keyboard.
31
+ // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key and https://en.wikipedia.org/wiki/Dead_key
32
+ const isDeadKey = name === 'Dead';
33
+ if (isModKeyPressed && (isNonLatinKey || isDeadKey)) {
34
+ keyboardEvent = new KeyboardEvent(event.type, {
35
+ // FIXME: The event.keyCode is deprecated (see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode),
36
+ // and could be removed in any time, but the w3c-keyname library doesn't provide a way to get
37
+ // a key by event.code.
38
+ key: base[event.keyCode],
39
+ code: event.code,
40
+ ctrlKey: event.ctrlKey,
41
+ altKey: event.altKey,
42
+ metaKey: event.metaKey,
43
+ shiftKey: event.shiftKey
44
+ });
45
+ }
46
+ return keydownHandler(bindings)(view, keyboardEvent);
47
+ } else {
48
+ const name = keyName(event);
49
+ let keyboardEvent = event;
50
+ if (event.ctrlKey && name.length === 1 &&
51
+ // Check the unicode of the character to
52
+ // assert that its not an ASCII character.
53
+ // These are characters outside Latin's range.
54
+ /[^\u0000-\u007f]/.test(name)) {
55
+ keyboardEvent = new KeyboardEvent('keydown', {
56
+ key: base[event.keyCode],
57
+ code: event.code,
58
+ ctrlKey: true
59
+ });
60
+ }
61
+ return keydownHandler(bindings)(view, keyboardEvent);
28
62
  }
29
- return keydownHandler(bindings)(view, keyboardEvent);
30
63
  }
31
64
  }
32
65
  });
@@ -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 = "82.5.0";
4
+ const packageVersion = "82.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
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "82.5.0";
10
+ const packageVersion = "82.6.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -56,7 +56,7 @@ function FunctionalComponentColor(props) {
56
56
  ,
57
57
  className: `${isSelected ? 'selected' : ''}`,
58
58
  style: {
59
- backgroundColor: colorStyle || 'transparent',
59
+ backgroundColor: colorStyle || (getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
60
60
  border: `1px solid ${borderColor}`
61
61
  },
62
62
  autoFocus: autoFocus
@@ -119,7 +119,7 @@ class ClassComponentColor extends PureComponent {
119
119
  ,
120
120
  className: `${isSelected ? 'selected' : ''}`,
121
121
  style: {
122
- backgroundColor: colorStyle || 'transparent',
122
+ backgroundColor: colorStyle || (getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
123
123
  border: `1px solid ${borderColor}`
124
124
  },
125
125
  autoFocus: autoFocus
@@ -48,4 +48,8 @@ export const highlightColorPalette = [{
48
48
  }];
49
49
  backgroundColorPalette.forEach((label, color) => {
50
50
  highlightColorPalette.push(mapPaletteColor(label, color));
51
- });
51
+ });
52
+ export const highlightColorPaletteWithTokenBorders = highlightColorPalette.map(paletteColor => ({
53
+ ...paletteColor,
54
+ border: "var(--ds-border, #091E4224)"
55
+ }));
@@ -15,6 +15,11 @@ export const mapPaletteColor = (label, color) => {
15
15
 
16
16
  // row 1
17
17
  export const textColorPalette = [];
18
+ export const textColorPaletteTokenBorders = [];
18
19
  colorPalette.forEach((label, color) => {
19
20
  textColorPalette.push(mapPaletteColor(label, color));
20
- });
21
+ });
22
+ export const textColorPaletteWithTokenBorders = textColorPalette.map(paletteColor => ({
23
+ ...paletteColor,
24
+ border: "var(--ds-border, #091E4224)"
25
+ }));
@@ -5,8 +5,8 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
5
5
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
6
6
  export { panelBackgroundPalette, panelDarkModeBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
7
7
  export { lightModeStatusColorPalette, darkModeStatusColorPalette } from './ColorPalette/Palettes/statusColorPalette';
8
- export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
9
- export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
8
+ export { textColorPalette, textColorPaletteWithTokenBorders } from './ColorPalette/Palettes/textColorPalette';
9
+ export { highlightColorPalette, highlightColorPaletteWithTokenBorders, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
10
10
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes';
11
11
  export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
12
12
  export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
@@ -1,5 +1,6 @@
1
1
  import { base, keyName } from 'w3c-keyname';
2
2
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import { SafePlugin } from '../safe-plugin';
4
5
 
5
6
  /**
@@ -13,20 +14,52 @@ export function keymap(bindings) {
13
14
  return new SafePlugin({
14
15
  props: {
15
16
  handleKeyDown: function handleKeyDown(view, event) {
16
- var name = keyName(event);
17
- var keyboardEvent = event;
18
- if (event.ctrlKey && name.length === 1 &&
19
- // Check the unicode of the character to
20
- // assert that its not an ASCII character.
21
- // These are characters outside Latin's range.
22
- /[^\u0000-\u007f]/.test(name)) {
23
- keyboardEvent = new KeyboardEvent('keydown', {
24
- key: base[event.keyCode],
25
- code: event.code,
26
- ctrlKey: true
27
- });
17
+ if (getBooleanFF('platform.editor.text-alignment-keyboard-shortcuts')) {
18
+ var name = keyName(event);
19
+ var keyboardEvent = event;
20
+
21
+ // We will try to bypass the keycode only if any of mod keys are pressed,
22
+ // to allow users to use non-latin and Dead characters.
23
+ var isModKeyPressed = event.ctrlKey || event.metaKey;
24
+
25
+ // Check the unicode of the character to assert that it's not an ASCII character.
26
+ // These are characters outside latin's range.
27
+ var isNonLatinKey = name.length === 1 && /[^\u0000-\u007f]/.test(name);
28
+
29
+ // The `Dead` key is a key that combines with a following key to produce a combined character.
30
+ // It will have `even.key === 'Dead'` in some browsers but the `keyCode` will be the same as in a qwerty-keyboard.
31
+ // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key and https://en.wikipedia.org/wiki/Dead_key
32
+ var isDeadKey = name === 'Dead';
33
+ if (isModKeyPressed && (isNonLatinKey || isDeadKey)) {
34
+ keyboardEvent = new KeyboardEvent(event.type, {
35
+ // FIXME: The event.keyCode is deprecated (see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode),
36
+ // and could be removed in any time, but the w3c-keyname library doesn't provide a way to get
37
+ // a key by event.code.
38
+ key: base[event.keyCode],
39
+ code: event.code,
40
+ ctrlKey: event.ctrlKey,
41
+ altKey: event.altKey,
42
+ metaKey: event.metaKey,
43
+ shiftKey: event.shiftKey
44
+ });
45
+ }
46
+ return keydownHandler(bindings)(view, keyboardEvent);
47
+ } else {
48
+ var _name = keyName(event);
49
+ var _keyboardEvent = event;
50
+ if (event.ctrlKey && _name.length === 1 &&
51
+ // Check the unicode of the character to
52
+ // assert that its not an ASCII character.
53
+ // These are characters outside Latin's range.
54
+ /[^\u0000-\u007f]/.test(_name)) {
55
+ _keyboardEvent = new KeyboardEvent('keydown', {
56
+ key: base[event.keyCode],
57
+ code: event.code,
58
+ ctrlKey: true
59
+ });
60
+ }
61
+ return keydownHandler(bindings)(view, _keyboardEvent);
28
62
  }
29
- return keydownHandler(bindings)(view, keyboardEvent);
30
63
  }
31
64
  }
32
65
  });
@@ -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 = "82.5.0";
10
+ var packageVersion = "82.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
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
15
15
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
16
16
  import Layer from '../Layer';
17
17
  var packageName = "@atlaskit/editor-common";
18
- var packageVersion = "82.5.0";
18
+ var packageVersion = "82.6.0";
19
19
  var halfFocusRing = 1;
20
20
  var dropOffset = '0, 8';
21
21
  var DropList = /*#__PURE__*/function (_Component) {
@@ -54,7 +54,7 @@ function FunctionalComponentColor(props) {
54
54
  ,
55
55
  className: "".concat(isSelected ? 'selected' : ''),
56
56
  style: {
57
- backgroundColor: colorStyle || 'transparent',
57
+ backgroundColor: colorStyle || (getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
58
58
  border: "1px solid ".concat(borderColor)
59
59
  },
60
60
  autoFocus: autoFocus
@@ -119,7 +119,7 @@ var ClassComponentColor = /*#__PURE__*/function (_PureComponent) {
119
119
  ,
120
120
  className: "".concat(isSelected ? 'selected' : ''),
121
121
  style: {
122
- backgroundColor: colorStyle || 'transparent',
122
+ backgroundColor: colorStyle || (getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-background-input, #FFFFFF)" : 'transparent'),
123
123
  border: "1px solid ".concat(borderColor)
124
124
  },
125
125
  autoFocus: autoFocus
@@ -1,3 +1,6 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  /** @jsx jsx */
2
5
 
3
6
  import { jsx } from '@emotion/react';
@@ -49,4 +52,9 @@ export var highlightColorPalette = [{
49
52
  }];
50
53
  backgroundColorPalette.forEach(function (label, color) {
51
54
  highlightColorPalette.push(mapPaletteColor(label, color));
55
+ });
56
+ export var highlightColorPaletteWithTokenBorders = highlightColorPalette.map(function (paletteColor) {
57
+ return _objectSpread(_objectSpread({}, paletteColor), {}, {
58
+ border: "var(--ds-border, #091E4224)"
59
+ });
52
60
  });
@@ -1,3 +1,6 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  import { colorPalette } from '@atlaskit/adf-schema';
2
5
  import { DEFAULT_BORDER_COLOR } from './common';
3
6
  import getColorMessage from './getColorMessage';
@@ -15,6 +18,12 @@ export var mapPaletteColor = function mapPaletteColor(label, color) {
15
18
 
16
19
  // row 1
17
20
  export var textColorPalette = [];
21
+ export var textColorPaletteTokenBorders = [];
18
22
  colorPalette.forEach(function (label, color) {
19
23
  textColorPalette.push(mapPaletteColor(label, color));
24
+ });
25
+ export var textColorPaletteWithTokenBorders = textColorPalette.map(function (paletteColor) {
26
+ return _objectSpread(_objectSpread({}, paletteColor), {}, {
27
+ border: "var(--ds-border, #091E4224)"
28
+ });
20
29
  });
@@ -5,8 +5,8 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
5
5
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
6
6
  export { panelBackgroundPalette, panelDarkModeBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
7
7
  export { lightModeStatusColorPalette, darkModeStatusColorPalette } from './ColorPalette/Palettes/statusColorPalette';
8
- export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
9
- export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
8
+ export { textColorPalette, textColorPaletteWithTokenBorders } from './ColorPalette/Palettes/textColorPalette';
9
+ export { highlightColorPalette, highlightColorPaletteWithTokenBorders, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
10
10
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes';
11
11
  export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
12
12
  export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
@@ -19,6 +19,8 @@ type ActionResult = {
19
19
  export type AnnotationActionResult = ({
20
20
  step: Step;
21
21
  doc: JSONDocNode;
22
+ /** The list of types of all inline nodes, which were wrapped by annotation. */
23
+ inlineNodeTypes?: string[];
22
24
  targetNodeType?: string;
23
25
  } & AnnotationByMatches) | false;
24
26
  export type InlineCommentSelectionComponentProps = {
@@ -293,6 +293,14 @@ export type FeatureFlags = {
293
293
  * @default false
294
294
  */
295
295
  elementDragAndDrop?: boolean;
296
+ /**
297
+ * @description
298
+ * Rearranges the top 5 items in the quick insert menu
299
+ *
300
+ * @see https://product-fabric.atlassian.net/browse/ED-23642
301
+ * @default false
302
+ */
303
+ platformEditorTypeaheadImprovedRelevancy?: boolean;
296
304
  };
297
305
  export type FeatureFlagKey = keyof FeatureFlags;
298
306
  export type GetEditorFeatureFlags = () => FeatureFlags;
@@ -4,3 +4,4 @@ import type { PaletteColor } from './type';
4
4
  export declare const REMOVE_HIGHLIGHT_COLOR = "#00000000";
5
5
  export declare const EditorDiagonalLineIcon: () => jsx.JSX.Element;
6
6
  export declare const highlightColorPalette: Array<PaletteColor>;
7
+ export declare const highlightColorPaletteWithTokenBorders: Array<PaletteColor>;
@@ -6,3 +6,5 @@ export declare const mapPaletteColor: (label: string, color: string) => {
6
6
  message: import("react-intl-next").MessageDescriptor | undefined;
7
7
  };
8
8
  export declare const textColorPalette: Array<PaletteColor>;
9
+ export declare const textColorPaletteTokenBorders: Array<PaletteColor>;
10
+ export declare const textColorPaletteWithTokenBorders: Array<PaletteColor>;
@@ -5,8 +5,8 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
5
5
  export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
6
6
  export { panelBackgroundPalette, panelDarkModeBackgroundPalette, } from './ColorPalette/Palettes/panelBackgroundPalette';
7
7
  export { lightModeStatusColorPalette, darkModeStatusColorPalette, } from './ColorPalette/Palettes/statusColorPalette';
8
- export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
9
- export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
8
+ export { textColorPalette, textColorPaletteWithTokenBorders, } from './ColorPalette/Palettes/textColorPalette';
9
+ export { highlightColorPalette, highlightColorPaletteWithTokenBorders, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
10
10
  export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes';
11
11
  export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
12
12
  export type { PaletteColor, PaletteTooltipMessages } from './ColorPalette/Palettes/type';
@@ -19,6 +19,8 @@ type ActionResult = {
19
19
  export type AnnotationActionResult = ({
20
20
  step: Step;
21
21
  doc: JSONDocNode;
22
+ /** The list of types of all inline nodes, which were wrapped by annotation. */
23
+ inlineNodeTypes?: string[];
22
24
  targetNodeType?: string;
23
25
  } & AnnotationByMatches) | false;
24
26
  export type InlineCommentSelectionComponentProps = {
@@ -293,6 +293,14 @@ export type FeatureFlags = {
293
293
  * @default false
294
294
  */
295
295
  elementDragAndDrop?: boolean;
296
+ /**
297
+ * @description
298
+ * Rearranges the top 5 items in the quick insert menu
299
+ *
300
+ * @see https://product-fabric.atlassian.net/browse/ED-23642
301
+ * @default false
302
+ */
303
+ platformEditorTypeaheadImprovedRelevancy?: boolean;
296
304
  };
297
305
  export type FeatureFlagKey = keyof FeatureFlags;
298
306
  export type GetEditorFeatureFlags = () => FeatureFlags;