@atlaskit/editor-common 82.4.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 (59) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/cjs/analytics/types/element-events.js +5 -0
  3. package/dist/cjs/analytics/types/enums.js +8 -0
  4. package/dist/cjs/extensions/module-helpers.js +4 -0
  5. package/dist/cjs/keymaps/keymap.js +46 -13
  6. package/dist/cjs/monitoring/error.js +1 -1
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/ui/FloatingToolbar/Button.js +2 -0
  9. package/dist/cjs/ui-color/ColorPalette/Color/index.js +8 -3
  10. package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +9 -3
  11. package/dist/cjs/ui-color/ColorPalette/Palettes/textColorPalette.js +10 -1
  12. package/dist/cjs/ui-color/index.js +12 -0
  13. package/dist/es2019/analytics/types/element-events.js +1 -0
  14. package/dist/es2019/analytics/types/enums.js +8 -0
  15. package/dist/es2019/extensions/module-helpers.js +4 -0
  16. package/dist/es2019/keymaps/keymap.js +46 -13
  17. package/dist/es2019/monitoring/error.js +1 -1
  18. package/dist/es2019/ui/DropList/index.js +1 -1
  19. package/dist/es2019/ui/FloatingToolbar/Button.js +2 -0
  20. package/dist/es2019/ui-color/ColorPalette/Color/index.js +8 -3
  21. package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +5 -1
  22. package/dist/es2019/ui-color/ColorPalette/Palettes/textColorPalette.js +6 -1
  23. package/dist/es2019/ui-color/index.js +2 -2
  24. package/dist/esm/analytics/types/element-events.js +1 -0
  25. package/dist/esm/analytics/types/enums.js +8 -0
  26. package/dist/esm/extensions/module-helpers.js +4 -0
  27. package/dist/esm/keymaps/keymap.js +46 -13
  28. package/dist/esm/monitoring/error.js +1 -1
  29. package/dist/esm/ui/DropList/index.js +1 -1
  30. package/dist/esm/ui/FloatingToolbar/Button.js +2 -0
  31. package/dist/esm/ui-color/ColorPalette/Color/index.js +8 -3
  32. package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +8 -0
  33. package/dist/esm/ui-color/ColorPalette/Palettes/textColorPalette.js +9 -0
  34. package/dist/esm/ui-color/index.js +2 -2
  35. package/dist/types/analytics/types/element-events.d.ts +10 -0
  36. package/dist/types/analytics/types/enums.d.ts +9 -1
  37. package/dist/types/analytics/types/events.d.ts +2 -1
  38. package/dist/types/analytics/types/index.d.ts +1 -0
  39. package/dist/types/extensions/types/extension-manifest-toolbar-item.d.ts +17 -2
  40. package/dist/types/types/annotation/index.d.ts +2 -0
  41. package/dist/types/types/feature-flags.d.ts +8 -0
  42. package/dist/types/ui/FloatingToolbar/Button.d.ts +2 -1
  43. package/dist/types/ui-color/ColorPalette/Color/index.d.ts +2 -8
  44. package/dist/types/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +1 -0
  45. package/dist/types/ui-color/ColorPalette/Palettes/textColorPalette.d.ts +2 -0
  46. package/dist/types/ui-color/index.d.ts +2 -2
  47. package/dist/types-ts4.5/analytics/types/element-events.d.ts +10 -0
  48. package/dist/types-ts4.5/analytics/types/enums.d.ts +9 -1
  49. package/dist/types-ts4.5/analytics/types/events.d.ts +2 -1
  50. package/dist/types-ts4.5/analytics/types/index.d.ts +1 -0
  51. package/dist/types-ts4.5/extensions/types/extension-manifest-toolbar-item.d.ts +17 -2
  52. package/dist/types-ts4.5/types/annotation/index.d.ts +2 -0
  53. package/dist/types-ts4.5/types/feature-flags.d.ts +8 -0
  54. package/dist/types-ts4.5/ui/FloatingToolbar/Button.d.ts +2 -1
  55. package/dist/types-ts4.5/ui-color/ColorPalette/Color/index.d.ts +2 -8
  56. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +1 -0
  57. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/textColorPalette.d.ts +2 -0
  58. package/dist/types-ts4.5/ui-color/index.d.ts +2 -2
  59. package/package.json +260 -263
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
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
+
26
+ ## 82.5.0
27
+
28
+ ### Minor Changes
29
+
30
+ - [#108718](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108718)
31
+ [`1aad4f15416c2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1aad4f15416c2) -
32
+ [EDF-737] Add content warning to the floating toolbar of the ai panels, extended extensions
33
+ floating toolbar API to allow custom JSX
34
+ - [#108805](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108805)
35
+ [`5c0926002a5ac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c0926002a5ac) -
36
+ Add new element drag and drop analytic events
37
+
38
+ ### Patch Changes
39
+
40
+ - [#110426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110426)
41
+ [`f423990451a12`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f423990451a12) -
42
+ [ED-23348] Fixed the feature flag set-up for the text highlight decorator
43
+
3
44
  ## 82.4.0
4
45
 
5
46
  ### Minor Changes
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -15,6 +15,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
15
15
  ACTION["ACTIVATED"] = "activated";
16
16
  ACTION["ADDED"] = "added";
17
17
  ACTION["BROWSER_FREEZE"] = "browserFreeze";
18
+ ACTION["CANCELLED"] = "cancelled";
18
19
  ACTION["CAUGHT_DOM_ERROR"] = "caughtDomError";
19
20
  ACTION["CHANGED_BACKGROUND_COLOR"] = "changedBackgroundColor";
20
21
  ACTION["CHANGED_ICON"] = "changedIcon";
@@ -40,6 +41,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
40
41
  ACTION["DISMISSED"] = "dismissed";
41
42
  ACTION["DISPATCHED_INVALID_TRANSACTION"] = "dispatchedInvalidTransaction";
42
43
  ACTION["DISPATCHED_VALID_TRANSACTION"] = "dispatchedValidTransaction";
44
+ ACTION["DRAGGED"] = "dragged";
43
45
  ACTION["EDITED"] = "edited";
44
46
  ACTION["EDITOR_CRASHED"] = "unhandledErrorCaught";
45
47
  ACTION["EDITOR_CRASHED_ADDITIONAL_INFORMATION"] = "unhandledErrorCaughtAdditionalInfov2";
@@ -154,6 +156,7 @@ var INPUT_METHOD = exports.INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
154
156
  INPUT_METHOD["CONFIG_PANEL"] = "configPanel";
155
157
  INPUT_METHOD["CONTEXT_MENU"] = "contextMenu";
156
158
  INPUT_METHOD["DRAG_AND_DROP"] = "dragAndDrop";
159
+ INPUT_METHOD["DRAG"] = "drag";
157
160
  INPUT_METHOD["EXTERNAL"] = "external";
158
161
  INPUT_METHOD["EXTENSION_API"] = "extensionApi";
159
162
  INPUT_METHOD["FLOATING_TB"] = "floatingToolbar";
@@ -231,6 +234,9 @@ var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJ
231
234
  ACTION_SUBJECT["LOOM"] = "loom";
232
235
  ACTION_SUBJECT["MULTI_BODIED_EXTENSION"] = "multiBodiedExtension";
233
236
  ACTION_SUBJECT["BODIED_EXTENSION"] = "bodiedExtension";
237
+ ACTION_SUBJECT["DROP_TARGET"] = "dropTarget";
238
+ ACTION_SUBJECT["DRAG"] = "drag";
239
+ ACTION_SUBJECT["ELEMENT"] = "element";
234
240
  return ACTION_SUBJECT;
235
241
  }({});
236
242
  var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
@@ -260,6 +266,8 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
260
266
  ACTION_SUBJECT_ID["DECISION"] = "decision";
261
267
  ACTION_SUBJECT_ID["DIVIDER"] = "divider";
262
268
  ACTION_SUBJECT_ID["EDIT_LINK"] = "editLink";
269
+ ACTION_SUBJECT_ID["ELEMENT_DRAG_HANDLE"] = "elementDragHandle";
270
+ ACTION_SUBJECT_ID["ELEMENT_DROP_TARGET"] = "elementDropTarget";
263
271
  ACTION_SUBJECT_ID["EMBEDS"] = "embeds";
264
272
  ACTION_SUBJECT_ID["EMOJI"] = "emoji";
265
273
  ACTION_SUBJECT_ID["EXPAND"] = "expand";
@@ -158,8 +158,10 @@ var logError = function logError(msg) {
158
158
  };
159
159
  var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(toolbarItem, parentKey) {
160
160
  var tooltip = toolbarItem.tooltip,
161
+ tooltipStyle = toolbarItem.tooltipStyle,
161
162
  key = toolbarItem.key,
162
163
  label = toolbarItem.label,
164
+ ariaLabel = toolbarItem.ariaLabel,
163
165
  icon = toolbarItem.icon,
164
166
  action = toolbarItem.action,
165
167
  disabled = toolbarItem.disabled;
@@ -197,7 +199,9 @@ var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(toolbarItem,
197
199
  }
198
200
  return _objectSpread({
199
201
  key: itemKey,
202
+ ariaLabel: ariaLabel,
200
203
  tooltip: tooltip,
204
+ tooltipStyle: tooltipStyle,
201
205
  action: action,
202
206
  disabled: disabled
203
207
  }, labelAndIcon);
@@ -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.4.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.4.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) {
@@ -34,6 +34,7 @@ var _default = exports.default = function _default(_ref) {
34
34
  children = _ref.children,
35
35
  className = _ref.className,
36
36
  tooltipContent = _ref.tooltipContent,
37
+ tooltipStyle = _ref.tooltipStyle,
37
38
  testId = _ref.testId,
38
39
  _ref$hideTooltipOnCli = _ref.hideTooltipOnClick,
39
40
  hideTooltipOnClick = _ref$hideTooltipOnCli === void 0 ? true : _ref$hideTooltipOnCli,
@@ -54,6 +55,7 @@ var _default = exports.default = function _default(_ref) {
54
55
  // Only fallback to title for tooltip if title is not shown
55
56
  , {
56
57
  content: tooltipContent || (iconOnly ? title : undefined),
58
+ component: tooltipStyle,
57
59
  hideTooltipOnClick: hideTooltipOnClick,
58
60
  position: "top"
59
61
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -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
@@ -140,5 +140,10 @@ var ClassComponentColor = /*#__PURE__*/function (_PureComponent) {
140
140
  }]);
141
141
  return ClassComponentColor;
142
142
  }(_react.PureComponent);
143
- var Color = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.transparent-diagonal-decorator') ? FunctionalComponentColor : ClassComponentColor;
143
+ var Color = function Color(props) {
144
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.transparent-diagonal-decorator')) {
145
+ return (0, _react2.jsx)(FunctionalComponentColor, props);
146
+ }
147
+ return (0, _react2.jsx)(ClassComponentColor, props);
148
+ };
144
149
  var _default = exports.default = Color;
@@ -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() {
@@ -0,0 +1 @@
1
+ export {};
@@ -9,6 +9,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
9
9
  ACTION["ACTIVATED"] = "activated";
10
10
  ACTION["ADDED"] = "added";
11
11
  ACTION["BROWSER_FREEZE"] = "browserFreeze";
12
+ ACTION["CANCELLED"] = "cancelled";
12
13
  ACTION["CAUGHT_DOM_ERROR"] = "caughtDomError";
13
14
  ACTION["CHANGED_BACKGROUND_COLOR"] = "changedBackgroundColor";
14
15
  ACTION["CHANGED_ICON"] = "changedIcon";
@@ -34,6 +35,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
34
35
  ACTION["DISMISSED"] = "dismissed";
35
36
  ACTION["DISPATCHED_INVALID_TRANSACTION"] = "dispatchedInvalidTransaction";
36
37
  ACTION["DISPATCHED_VALID_TRANSACTION"] = "dispatchedValidTransaction";
38
+ ACTION["DRAGGED"] = "dragged";
37
39
  ACTION["EDITED"] = "edited";
38
40
  ACTION["EDITOR_CRASHED"] = "unhandledErrorCaught";
39
41
  ACTION["EDITOR_CRASHED_ADDITIONAL_INFORMATION"] = "unhandledErrorCaughtAdditionalInfov2";
@@ -148,6 +150,7 @@ export let INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
148
150
  INPUT_METHOD["CONFIG_PANEL"] = "configPanel";
149
151
  INPUT_METHOD["CONTEXT_MENU"] = "contextMenu";
150
152
  INPUT_METHOD["DRAG_AND_DROP"] = "dragAndDrop";
153
+ INPUT_METHOD["DRAG"] = "drag";
151
154
  INPUT_METHOD["EXTERNAL"] = "external";
152
155
  INPUT_METHOD["EXTENSION_API"] = "extensionApi";
153
156
  INPUT_METHOD["FLOATING_TB"] = "floatingToolbar";
@@ -225,6 +228,9 @@ export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
225
228
  ACTION_SUBJECT["LOOM"] = "loom";
226
229
  ACTION_SUBJECT["MULTI_BODIED_EXTENSION"] = "multiBodiedExtension";
227
230
  ACTION_SUBJECT["BODIED_EXTENSION"] = "bodiedExtension";
231
+ ACTION_SUBJECT["DROP_TARGET"] = "dropTarget";
232
+ ACTION_SUBJECT["DRAG"] = "drag";
233
+ ACTION_SUBJECT["ELEMENT"] = "element";
228
234
  return ACTION_SUBJECT;
229
235
  }({});
230
236
  export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
@@ -254,6 +260,8 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
254
260
  ACTION_SUBJECT_ID["DECISION"] = "decision";
255
261
  ACTION_SUBJECT_ID["DIVIDER"] = "divider";
256
262
  ACTION_SUBJECT_ID["EDIT_LINK"] = "editLink";
263
+ ACTION_SUBJECT_ID["ELEMENT_DRAG_HANDLE"] = "elementDragHandle";
264
+ ACTION_SUBJECT_ID["ELEMENT_DROP_TARGET"] = "elementDropTarget";
257
265
  ACTION_SUBJECT_ID["EMBEDS"] = "embeds";
258
266
  ACTION_SUBJECT_ID["EMOJI"] = "emoji";
259
267
  ACTION_SUBJECT_ID["EXPAND"] = "expand";
@@ -62,8 +62,10 @@ const logError = (msg, ...args) => {
62
62
  const toolbarItemToButtonConfig = (toolbarItem, parentKey) => {
63
63
  const {
64
64
  tooltip,
65
+ tooltipStyle,
65
66
  key,
66
67
  label,
68
+ ariaLabel,
67
69
  icon,
68
70
  action,
69
71
  disabled
@@ -102,7 +104,9 @@ const toolbarItemToButtonConfig = (toolbarItem, parentKey) => {
102
104
  }
103
105
  return {
104
106
  key: itemKey,
107
+ ariaLabel,
105
108
  tooltip,
109
+ tooltipStyle,
106
110
  action,
107
111
  disabled,
108
112
  ...labelAndIcon
@@ -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.4.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.4.0";
10
+ const packageVersion = "82.6.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -21,6 +21,7 @@ export default (({
21
21
  children,
22
22
  className,
23
23
  tooltipContent,
24
+ tooltipStyle,
24
25
  testId,
25
26
  hideTooltipOnClick = true,
26
27
  ariaHasPopup,
@@ -41,6 +42,7 @@ export default (({
41
42
  // Only fallback to title for tooltip if title is not shown
42
43
  , {
43
44
  content: tooltipContent || (iconOnly ? title : undefined),
45
+ component: tooltipStyle,
44
46
  hideTooltipOnClick: hideTooltipOnClick,
45
47
  position: "top"
46
48
  }, /*#__PURE__*/React.createElement("div", {
@@ -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
@@ -129,5 +129,10 @@ class ClassComponentColor extends PureComponent {
129
129
  }))));
130
130
  }
131
131
  }
132
- const Color = getBooleanFF('platform.editor.transparent-diagonal-decorator') ? FunctionalComponentColor : ClassComponentColor;
132
+ const Color = props => {
133
+ if (getBooleanFF('platform.editor.transparent-diagonal-decorator')) {
134
+ return jsx(FunctionalComponentColor, props);
135
+ }
136
+ return jsx(ClassComponentColor, props);
137
+ };
133
138
  export default Color;
@@ -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';
@@ -0,0 +1 @@
1
+ export {};