@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
@@ -9,6 +9,7 @@ export var 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 var 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 var 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 var 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 var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
@@ -254,6 +260,8 @@ export var 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";
@@ -146,8 +146,10 @@ var logError = function logError(msg) {
146
146
  };
147
147
  var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(toolbarItem, parentKey) {
148
148
  var tooltip = toolbarItem.tooltip,
149
+ tooltipStyle = toolbarItem.tooltipStyle,
149
150
  key = toolbarItem.key,
150
151
  label = toolbarItem.label,
152
+ ariaLabel = toolbarItem.ariaLabel,
151
153
  icon = toolbarItem.icon,
152
154
  action = toolbarItem.action,
153
155
  disabled = toolbarItem.disabled;
@@ -185,7 +187,9 @@ var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(toolbarItem,
185
187
  }
186
188
  return _objectSpread({
187
189
  key: itemKey,
190
+ ariaLabel: ariaLabel,
188
191
  tooltip: tooltip,
192
+ tooltipStyle: tooltipStyle,
189
193
  action: action,
190
194
  disabled: disabled
191
195
  }, 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: 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.4.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.4.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) {
@@ -27,6 +27,7 @@ export default (function (_ref) {
27
27
  children = _ref.children,
28
28
  className = _ref.className,
29
29
  tooltipContent = _ref.tooltipContent,
30
+ tooltipStyle = _ref.tooltipStyle,
30
31
  testId = _ref.testId,
31
32
  _ref$hideTooltipOnCli = _ref.hideTooltipOnClick,
32
33
  hideTooltipOnClick = _ref$hideTooltipOnCli === void 0 ? true : _ref$hideTooltipOnCli,
@@ -47,6 +48,7 @@ export default (function (_ref) {
47
48
  // Only fallback to title for tooltip if title is not shown
48
49
  , {
49
50
  content: tooltipContent || (iconOnly ? title : undefined),
51
+ component: tooltipStyle,
50
52
  hideTooltipOnClick: hideTooltipOnClick,
51
53
  position: "top"
52
54
  }, /*#__PURE__*/React.createElement("div", {
@@ -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
@@ -131,5 +131,10 @@ var ClassComponentColor = /*#__PURE__*/function (_PureComponent) {
131
131
  }]);
132
132
  return ClassComponentColor;
133
133
  }(PureComponent);
134
- var Color = getBooleanFF('platform.editor.transparent-diagonal-decorator') ? FunctionalComponentColor : ClassComponentColor;
134
+ var Color = function Color(props) {
135
+ if (getBooleanFF('platform.editor.transparent-diagonal-decorator')) {
136
+ return jsx(FunctionalComponentColor, props);
137
+ }
138
+ return jsx(ClassComponentColor, props);
139
+ };
135
140
  export default Color;
@@ -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';
@@ -0,0 +1,10 @@
1
+ import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
2
+ import type { UIAEP } from './utils';
3
+ type ElementAttributes = {
4
+ nodeDepth: number;
5
+ nodeType: string;
6
+ };
7
+ type ElementDragAEP = UIAEP<ACTION.DRAGGED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
8
+ type DragCancelledAEP = UIAEP<ACTION.CANCELLED, ACTION_SUBJECT.DRAG, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
9
+ export type ElementEventPayload = ElementDragAEP | DragCancelledAEP;
10
+ export {};
@@ -8,6 +8,7 @@ export declare enum ACTION {
8
8
  ACTIVATED = "activated",
9
9
  ADDED = "added",
10
10
  BROWSER_FREEZE = "browserFreeze",
11
+ CANCELLED = "cancelled",
11
12
  CAUGHT_DOM_ERROR = "caughtDomError",
12
13
  CHANGED_BACKGROUND_COLOR = "changedBackgroundColor",
13
14
  CHANGED_ICON = "changedIcon",
@@ -36,6 +37,7 @@ export declare enum ACTION {
36
37
  DISMISSED = "dismissed",
37
38
  DISPATCHED_INVALID_TRANSACTION = "dispatchedInvalidTransaction",
38
39
  DISPATCHED_VALID_TRANSACTION = "dispatchedValidTransaction",
40
+ DRAGGED = "dragged",
39
41
  EDITED = "edited",
40
42
  EDITOR_CRASHED = "unhandledErrorCaught",
41
43
  EDITOR_CRASHED_ADDITIONAL_INFORMATION = "unhandledErrorCaughtAdditionalInfov2",
@@ -154,6 +156,7 @@ export declare enum INPUT_METHOD {
154
156
  CONFIG_PANEL = "configPanel",
155
157
  CONTEXT_MENU = "contextMenu",
156
158
  DRAG_AND_DROP = "dragAndDrop",
159
+ DRAG = "drag",
157
160
  EXTERNAL = "external",
158
161
  EXTENSION_API = "extensionApi",
159
162
  FLOATING_TB = "floatingToolbar",
@@ -228,7 +231,10 @@ export declare enum ACTION_SUBJECT {
228
231
  TOOLTIP = "tooltip",
229
232
  LOOM = "loom",
230
233
  MULTI_BODIED_EXTENSION = "multiBodiedExtension",
231
- BODIED_EXTENSION = "bodiedExtension"
234
+ BODIED_EXTENSION = "bodiedExtension",
235
+ DROP_TARGET = "dropTarget",
236
+ DRAG = "drag",
237
+ ELEMENT = "element"
232
238
  }
233
239
  export declare enum ACTION_SUBJECT_ID {
234
240
  ACTION = "action",
@@ -257,6 +263,8 @@ export declare enum ACTION_SUBJECT_ID {
257
263
  DECISION = "decision",
258
264
  DIVIDER = "divider",
259
265
  EDIT_LINK = "editLink",
266
+ ELEMENT_DRAG_HANDLE = "elementDragHandle",
267
+ ELEMENT_DROP_TARGET = "elementDropTarget",
260
268
  EMBEDS = "embeds",
261
269
  EMOJI = "emoji",
262
270
  EXPAND = "expand",
@@ -8,6 +8,7 @@ import type { ConfigPanelEventPayload } from './config-panel-events';
8
8
  import type { CutCopyEventPayload } from './cut-copy-events';
9
9
  import type { DateEventPayload } from './date-events';
10
10
  import type { ElementBrowserEventPayload } from './element-browser-events';
11
+ import type { ElementEventPayload } from './element-events';
11
12
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, FLOATING_CONTROLS_TITLE } from './enums';
12
13
  import type { ExperimentalEventPayload } from './experimental-events';
13
14
  import type { ExtensionEventPayload } from './extension-events';
@@ -37,7 +38,7 @@ export type SimplifiedNode = {
37
38
  marks?: string[];
38
39
  content?: SimplifiedNode[];
39
40
  };
40
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload;
41
+ export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | ElementEventPayload;
41
42
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
42
43
  previousColor: string;
43
44
  newColor: string;
@@ -34,3 +34,4 @@ export { SELECTION_POSITION, SELECTION_TYPE } from './utils';
34
34
  export type { OperationalAEP } from './utils';
35
35
  export type { PluginMethodReport, PluginsReport, NodeCount, PluginPerformanceReportData, } from './performance-report';
36
36
  export type { InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './referentiality-events';
37
+ export type { ElementEventPayload } from './element-events';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
3
  import type { ExtensionAPI } from './extension-handler';
3
4
  import type { ExtensionIconModule } from './extension-manifest-common';
@@ -6,7 +7,14 @@ export type ToolbarButton = ExtensionModuleToolbarButtonLabelOrIcon & {
6
7
  key: string;
7
8
  action: ToolbarButtonAction;
8
9
  label: string;
9
- tooltip?: string;
10
+ ariaLabel?: string;
11
+ tooltip?: React.ReactNode | string;
12
+ /**
13
+ * Tooltip Style
14
+ * This uses the Custom component feature of the Tooltip component.
15
+ * How to use: https://atlassian.design/components/tooltip/examples#custom-component
16
+ */
17
+ tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
10
18
  icon?: () => ExtensionIconModule;
11
19
  display?: 'icon' | 'label' | 'icon-and-label';
12
20
  disabled?: boolean;
@@ -38,7 +46,14 @@ export type StandardNodeContext = {
38
46
  export type ExtensionToolbarButton = {
39
47
  key: string;
40
48
  label?: string;
41
- tooltip?: string;
49
+ ariaLabel?: string;
50
+ tooltip?: React.ReactNode | string;
51
+ /**
52
+ * Tooltip Style
53
+ * This uses the Custom component feature of the Tooltip component.
54
+ * How to use: https://atlassian.design/components/tooltip/examples#custom-component
55
+ */
56
+ tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
42
57
  icon?: () => ExtensionIconModule;
43
58
  action: ToolbarButtonAction;
44
59
  disabled?: boolean;
@@ -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;
@@ -21,11 +21,12 @@ export interface Props {
21
21
  children?: React.ReactNode;
22
22
  className?: string;
23
23
  tooltipContent?: React.ReactNode;
24
+ tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
24
25
  testId?: string;
25
26
  hideTooltipOnClick?: boolean;
26
27
  tabIndex?: number | null | undefined;
27
28
  areaControls?: string;
28
29
  isRadioButton?: boolean;
29
30
  }
30
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
31
+ declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
31
32
  export default _default;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import React, { PureComponent, type ReactElement } from 'react';
2
+ import { type ReactElement } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  export interface Props {
5
5
  value: string;
@@ -13,11 +13,5 @@ export interface Props {
13
13
  hexToPaletteColor?: (hexColor: string) => string | undefined;
14
14
  decorator?: ReactElement;
15
15
  }
16
- declare function FunctionalComponentColor(props: Props): jsx.JSX.Element;
17
- declare class ClassComponentColor extends PureComponent<Props> {
18
- render(): jsx.JSX.Element;
19
- onMouseDown: (e: React.MouseEvent<{}>) => void;
20
- onClick: (e: React.MouseEvent<{}>) => void;
21
- }
22
- declare const Color: typeof ClassComponentColor | typeof FunctionalComponentColor;
16
+ declare const Color: (props: Props) => jsx.JSX.Element;
23
17
  export default Color;
@@ -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';
@@ -0,0 +1,10 @@
1
+ import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
2
+ import type { UIAEP } from './utils';
3
+ type ElementAttributes = {
4
+ nodeDepth: number;
5
+ nodeType: string;
6
+ };
7
+ type ElementDragAEP = UIAEP<ACTION.DRAGGED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
8
+ type DragCancelledAEP = UIAEP<ACTION.CANCELLED, ACTION_SUBJECT.DRAG, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
9
+ export type ElementEventPayload = ElementDragAEP | DragCancelledAEP;
10
+ export {};
@@ -8,6 +8,7 @@ export declare enum ACTION {
8
8
  ACTIVATED = "activated",
9
9
  ADDED = "added",
10
10
  BROWSER_FREEZE = "browserFreeze",
11
+ CANCELLED = "cancelled",
11
12
  CAUGHT_DOM_ERROR = "caughtDomError",
12
13
  CHANGED_BACKGROUND_COLOR = "changedBackgroundColor",
13
14
  CHANGED_ICON = "changedIcon",
@@ -36,6 +37,7 @@ export declare enum ACTION {
36
37
  DISMISSED = "dismissed",
37
38
  DISPATCHED_INVALID_TRANSACTION = "dispatchedInvalidTransaction",
38
39
  DISPATCHED_VALID_TRANSACTION = "dispatchedValidTransaction",
40
+ DRAGGED = "dragged",
39
41
  EDITED = "edited",
40
42
  EDITOR_CRASHED = "unhandledErrorCaught",
41
43
  EDITOR_CRASHED_ADDITIONAL_INFORMATION = "unhandledErrorCaughtAdditionalInfov2",
@@ -154,6 +156,7 @@ export declare enum INPUT_METHOD {
154
156
  CONFIG_PANEL = "configPanel",
155
157
  CONTEXT_MENU = "contextMenu",
156
158
  DRAG_AND_DROP = "dragAndDrop",
159
+ DRAG = "drag",
157
160
  EXTERNAL = "external",
158
161
  EXTENSION_API = "extensionApi",
159
162
  FLOATING_TB = "floatingToolbar",
@@ -228,7 +231,10 @@ export declare enum ACTION_SUBJECT {
228
231
  TOOLTIP = "tooltip",
229
232
  LOOM = "loom",
230
233
  MULTI_BODIED_EXTENSION = "multiBodiedExtension",
231
- BODIED_EXTENSION = "bodiedExtension"
234
+ BODIED_EXTENSION = "bodiedExtension",
235
+ DROP_TARGET = "dropTarget",
236
+ DRAG = "drag",
237
+ ELEMENT = "element"
232
238
  }
233
239
  export declare enum ACTION_SUBJECT_ID {
234
240
  ACTION = "action",
@@ -257,6 +263,8 @@ export declare enum ACTION_SUBJECT_ID {
257
263
  DECISION = "decision",
258
264
  DIVIDER = "divider",
259
265
  EDIT_LINK = "editLink",
266
+ ELEMENT_DRAG_HANDLE = "elementDragHandle",
267
+ ELEMENT_DROP_TARGET = "elementDropTarget",
260
268
  EMBEDS = "embeds",
261
269
  EMOJI = "emoji",
262
270
  EXPAND = "expand",
@@ -8,6 +8,7 @@ import type { ConfigPanelEventPayload } from './config-panel-events';
8
8
  import type { CutCopyEventPayload } from './cut-copy-events';
9
9
  import type { DateEventPayload } from './date-events';
10
10
  import type { ElementBrowserEventPayload } from './element-browser-events';
11
+ import type { ElementEventPayload } from './element-events';
11
12
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, FLOATING_CONTROLS_TITLE } from './enums';
12
13
  import type { ExperimentalEventPayload } from './experimental-events';
13
14
  import type { ExtensionEventPayload } from './extension-events';
@@ -37,7 +38,7 @@ export type SimplifiedNode = {
37
38
  marks?: string[];
38
39
  content?: SimplifiedNode[];
39
40
  };
40
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload;
41
+ export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | ElementEventPayload;
41
42
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
42
43
  previousColor: string;
43
44
  newColor: string;
@@ -34,3 +34,4 @@ export { SELECTION_POSITION, SELECTION_TYPE } from './utils';
34
34
  export type { OperationalAEP } from './utils';
35
35
  export type { PluginMethodReport, PluginsReport, NodeCount, PluginPerformanceReportData, } from './performance-report';
36
36
  export type { InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './referentiality-events';
37
+ export type { ElementEventPayload } from './element-events';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
3
  import type { ExtensionAPI } from './extension-handler';
3
4
  import type { ExtensionIconModule } from './extension-manifest-common';
@@ -6,7 +7,14 @@ export type ToolbarButton = ExtensionModuleToolbarButtonLabelOrIcon & {
6
7
  key: string;
7
8
  action: ToolbarButtonAction;
8
9
  label: string;
9
- tooltip?: string;
10
+ ariaLabel?: string;
11
+ tooltip?: React.ReactNode | string;
12
+ /**
13
+ * Tooltip Style
14
+ * This uses the Custom component feature of the Tooltip component.
15
+ * How to use: https://atlassian.design/components/tooltip/examples#custom-component
16
+ */
17
+ tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
10
18
  icon?: () => ExtensionIconModule;
11
19
  display?: 'icon' | 'label' | 'icon-and-label';
12
20
  disabled?: boolean;
@@ -38,7 +46,14 @@ export type StandardNodeContext = {
38
46
  export type ExtensionToolbarButton = {
39
47
  key: string;
40
48
  label?: string;
41
- tooltip?: string;
49
+ ariaLabel?: string;
50
+ tooltip?: React.ReactNode | string;
51
+ /**
52
+ * Tooltip Style
53
+ * This uses the Custom component feature of the Tooltip component.
54
+ * How to use: https://atlassian.design/components/tooltip/examples#custom-component
55
+ */
56
+ tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
42
57
  icon?: () => ExtensionIconModule;
43
58
  action: ToolbarButtonAction;
44
59
  disabled?: boolean;
@@ -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;
@@ -21,11 +21,12 @@ export interface Props {
21
21
  children?: React.ReactNode;
22
22
  className?: string;
23
23
  tooltipContent?: React.ReactNode;
24
+ tooltipStyle?: React.ForwardRefExoticComponent<any> | React.ComponentType<any>;
24
25
  testId?: string;
25
26
  hideTooltipOnClick?: boolean;
26
27
  tabIndex?: number | null | undefined;
27
28
  areaControls?: string;
28
29
  isRadioButton?: boolean;
29
30
  }
30
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
31
+ declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
31
32
  export default _default;