@atlaskit/editor-common 93.1.5 → 93.2.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 (62) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/afm-post-office/tsconfig.json +3 -0
  5. package/dist/cjs/analytics/types/engagement-platform-events.js +5 -0
  6. package/dist/cjs/analytics/types/enums.js +2 -0
  7. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +1 -2
  8. package/dist/cjs/extensibility/ExtensionComponent.js +263 -10
  9. package/dist/cjs/monitoring/error.js +1 -1
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/cjs/ui/FloatingToolbar/Button.js +6 -2
  12. package/dist/cjs/ui/Mention/index.js +15 -3
  13. package/dist/cjs/ui/Mention/mention-with-providers.js +58 -8
  14. package/dist/cjs/ui/Pulse/Pulse.js +36 -0
  15. package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -11
  16. package/dist/cjs/ui-menu/DropdownMenu/index.js +5 -20
  17. package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -9
  18. package/dist/es2019/analytics/types/engagement-platform-events.js +1 -0
  19. package/dist/es2019/analytics/types/enums.js +2 -0
  20. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +1 -2
  21. package/dist/es2019/extensibility/ExtensionComponent.js +231 -3
  22. package/dist/es2019/monitoring/error.js +1 -1
  23. package/dist/es2019/ui/DropList/index.js +1 -1
  24. package/dist/es2019/ui/FloatingToolbar/Button.js +6 -2
  25. package/dist/es2019/ui/Mention/index.js +15 -2
  26. package/dist/es2019/ui/Mention/mention-with-providers.js +49 -2
  27. package/dist/es2019/ui/Pulse/Pulse.js +29 -0
  28. package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -11
  29. package/dist/es2019/ui-menu/DropdownMenu/index.js +5 -20
  30. package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -9
  31. package/dist/esm/analytics/types/engagement-platform-events.js +1 -0
  32. package/dist/esm/analytics/types/enums.js +2 -0
  33. package/dist/esm/element-browser/components/StatelessElementBrowser.js +1 -2
  34. package/dist/esm/extensibility/ExtensionComponent.js +266 -9
  35. package/dist/esm/monitoring/error.js +1 -1
  36. package/dist/esm/ui/DropList/index.js +1 -1
  37. package/dist/esm/ui/FloatingToolbar/Button.js +6 -2
  38. package/dist/esm/ui/Mention/index.js +15 -2
  39. package/dist/esm/ui/Mention/mention-with-providers.js +59 -10
  40. package/dist/esm/ui/Pulse/Pulse.js +29 -0
  41. package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -11
  42. package/dist/esm/ui-menu/DropdownMenu/index.js +5 -20
  43. package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -9
  44. package/dist/types/analytics/types/engagement-platform-events.d.ts +20 -0
  45. package/dist/types/analytics/types/enums.d.ts +3 -1
  46. package/dist/types/analytics/types/events.d.ts +2 -1
  47. package/dist/types/analytics/types/general-events.d.ts +7 -1
  48. package/dist/types/extensibility/ExtensionComponent.d.ts +7 -1
  49. package/dist/types/types/floating-toolbar.d.ts +4 -0
  50. package/dist/types/ui/FloatingToolbar/Button.d.ts +3 -1
  51. package/dist/types/ui/Mention/mention-with-providers.d.ts +2 -1
  52. package/dist/types/ui/Pulse/Pulse.d.ts +18 -0
  53. package/dist/types-ts4.5/analytics/types/engagement-platform-events.d.ts +20 -0
  54. package/dist/types-ts4.5/analytics/types/enums.d.ts +3 -1
  55. package/dist/types-ts4.5/analytics/types/events.d.ts +2 -1
  56. package/dist/types-ts4.5/analytics/types/general-events.d.ts +7 -1
  57. package/dist/types-ts4.5/extensibility/ExtensionComponent.d.ts +7 -1
  58. package/dist/types-ts4.5/types/floating-toolbar.d.ts +4 -0
  59. package/dist/types-ts4.5/ui/FloatingToolbar/Button.d.ts +3 -1
  60. package/dist/types-ts4.5/ui/Mention/mention-with-providers.d.ts +2 -1
  61. package/dist/types-ts4.5/ui/Pulse/Pulse.d.ts +18 -0
  62. package/package.json +11 -10
@@ -1,6 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  var hasEnabledItems = function hasEnabledItems(list) {
5
4
  return list.some(function (item) {
6
5
  return item.getAttribute('aria-disabled') !== 'true';
@@ -121,11 +120,7 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
121
120
  if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
122
121
  return;
123
122
  }
124
- if (fg('platform-editor-a11y-image-border-options-dropdown')) {
125
- if (!disableCloseOnArrowClick) {
126
- handleClose(event);
127
- }
128
- } else {
123
+ if (!disableCloseOnArrowClick) {
129
124
  handleClose(event);
130
125
  }
131
126
  if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
@@ -136,11 +131,7 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
136
131
  if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
137
132
  return;
138
133
  }
139
- if (fg('platform-editor-a11y-image-border-options-dropdown')) {
140
- if (!disableCloseOnArrowClick) {
141
- handleClose(event);
142
- }
143
- } else {
134
+ if (!disableCloseOnArrowClick) {
144
135
  handleClose(event);
145
136
  }
146
137
  if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
@@ -182,9 +182,9 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
182
182
  shouldFitContainer: true,
183
183
  isTriggerNotTabbable: true,
184
184
  handleClickOutside: this.handleClose,
185
- handleEscapeKeydown: fg('platform-editor-a11y-image-border-options-dropdown') ? handleEscapeKeydown || this.handleCloseAndFocus : this.handleCloseAndFocus,
185
+ handleEscapeKeydown: handleEscapeKeydown || this.handleCloseAndFocus,
186
186
  handleEnterKeydown: function handleEnterKeydown(e) {
187
- if (fg('platform_editor_a11y_table_context_menu') || fg('platform-editor-a11y-image-border-options-dropdown')) {
187
+ if (fg('platform_editor_a11y_table_context_menu')) {
188
188
  if (!allowEnterDefaultBehavior) {
189
189
  e.preventDefault();
190
190
  }
@@ -299,27 +299,12 @@ export function DropdownMenuItem(_ref) {
299
299
  var _handleSubmenuActive = function _handleSubmenuActive(event) {
300
300
  setSubmenuActive(Boolean(event.target instanceof HTMLElement && event.target.closest(".".concat(DropdownMenuSharedCssClassName.SUBMENU))));
301
301
  };
302
- var ariaLabel;
303
- if (fg('platform-editor-a11y-image-border-options-dropdown')) {
304
- ariaLabel = item['aria-label'] === '' ? undefined : item['aria-label'] || String(item.content);
305
- } else {
306
- ariaLabel = item['aria-label'] || String(item.content);
307
- }
308
- var testId;
309
- if (fg('platform-editor-a11y-image-border-options-dropdown')) {
310
- testId = item['data-testid'] || "dropdown-item__".concat(item.content);
311
- } else {
312
- testId = "dropdown-item__".concat(String(item.content));
313
- }
302
+ var ariaLabel = item['aria-label'] === '' ? undefined : item['aria-label'] || String(item.content);
303
+ var testId = item['data-testid'] || "dropdown-item__".concat(item.content);
314
304
 
315
305
  // From time to time we don't want to have any tabIndex on item wrapper
316
306
  // especially when we pass any interactive element as a item.content
317
- var tabIndex;
318
- if (fg('platform-editor-a11y-image-border-options-dropdown')) {
319
- tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
320
- } else {
321
- tabIndex = -1;
322
- }
307
+ var tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
323
308
  var dropListItem = jsx("div", {
324
309
  css: function css() {
325
310
  return buttonStyles(item.isActive, submenuActive);
@@ -8,7 +8,6 @@ import React, { useCallback, useLayoutEffect, useRef } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { ELEMENT_BROWSER_ID } from '../../element-browser';
13
12
  import { fullPageMessages as messages } from '../../messages';
14
13
  import { EDIT_AREA_ID } from '../../ui';
@@ -113,7 +112,7 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
113
112
  * @param event
114
113
  */
115
114
  var handleKeyDown = function handleKeyDown(event) {
116
- var _document$querySelect, _document$querySelect2, _wrapperRef$current2;
115
+ var _document$querySelect, _document$querySelect2, _wrapperRef$current, _wrapperRef$current2;
117
116
  // To trap the focus inside the horizontal toolbar for left and right arrow keys
118
117
  var targetElement = event.target;
119
118
  if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
@@ -127,13 +126,10 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
127
126
  // if menu wrapper exists, then a menu is open and arrow keys will be handled by MenuArrowKeyNavigationProvider
128
127
  return;
129
128
  }
130
- if (fg('editor-fix-esc-main-toolbar-navigation')) {
131
- var _wrapperRef$current;
132
- var elementBrowser = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelector("#".concat(ELEMENT_BROWSER_ID));
133
- if (elementBrowser) {
134
- // if element browser is open, then arrow keys will be handled by MenuArrowKeyNavigationProvider
135
- return;
136
- }
129
+ var elementBrowser = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelector("#".concat(ELEMENT_BROWSER_ID));
130
+ if (elementBrowser) {
131
+ // if element browser is open, then arrow keys will be handled by MenuArrowKeyNavigationProvider
132
+ return;
137
133
  }
138
134
  var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
139
135
  if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
@@ -0,0 +1,20 @@
1
+ import type { ACTION, ACTION_SUBJECT } from './enums';
2
+ import type { UIAEP } from './utils';
3
+ /**
4
+ * Payload of an engagement platform event that is sent when an error occurs.
5
+ *
6
+ * It's used by `@atlassian/editor-plugin-engagement-platform` plugin.
7
+ */
8
+ type EngagementPlatformErroredAEP = UIAEP<ACTION.ERRORED, ACTION_SUBJECT.ENGAGEMENT_PLATFORM, undefined, {
9
+ /** The error message. */
10
+ error: string;
11
+ /** The error stack trace. */
12
+ errorStack?: string;
13
+ }, undefined>;
14
+ /**
15
+ * Payload of an engagement platform event.
16
+ *
17
+ * It's used by `@atlassian/editor-plugin-engagement-platform` plugin.
18
+ */
19
+ export type EngagementPlatformEventPayload = EngagementPlatformErroredAEP;
20
+ export {};
@@ -255,7 +255,8 @@ export declare enum ACTION_SUBJECT {
255
255
  DRAG = "drag",
256
256
  ELEMENT = "element",
257
257
  CONTEXT_MENU = "contextMenu",
258
- INLINE_DIALOG = "inlineDialog"
258
+ INLINE_DIALOG = "inlineDialog",
259
+ ENGAGEMENT_PLATFORM = "engagementPlatform"
259
260
  }
260
261
  export declare enum ACTION_SUBJECT_ID {
261
262
  ACTION = "action",
@@ -276,6 +277,7 @@ export declare enum ACTION_SUBJECT_ID {
276
277
  CODE_BLOCK = "codeBlock",
277
278
  CODEBLOCK_COPY = "codeBlockCopy",
278
279
  CODEBLOCK_WRAP = "codeBlockWrap",
280
+ COPY_LINK_TO_ANCHOR = "copyLinkToAnchor",
279
281
  CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU = "createInlineCommentFromHighlightActionsMenu",
280
282
  DATE = "date",
281
283
  DATE_DAY = "day",
@@ -11,6 +11,7 @@ import type { DatasourceClickedPayload } from './datasource-clicked-events';
11
11
  import type { DateEventPayload } from './date-events';
12
12
  import type { ElementBrowserEventPayload } from './element-browser-events';
13
13
  import type { ElementEventPayload } from './element-events';
14
+ import type { EngagementPlatformEventPayload } from './engagement-platform-events';
14
15
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, FLOATING_CONTROLS_TITLE } from './enums';
15
16
  import type { ExperimentalEventPayload } from './experimental-events';
16
17
  import type { ExtensionEventPayload } from './extension-events';
@@ -44,7 +45,7 @@ export type SimplifiedNode = {
44
45
  marks?: string[];
45
46
  content?: SimplifiedNode[];
46
47
  };
47
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | 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 | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload;
48
+ export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | 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 | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | EngagementPlatformEventPayload;
48
49
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
49
50
  previousColor: string;
50
51
  newColor: string;
@@ -195,5 +195,11 @@ export type RequestToEditAEP = UIAEP<ACTION.REQUEST_TO_EDIT | ACTION.DISMISSED,
195
195
  platform: PLATFORMS;
196
196
  mode: MODE;
197
197
  }, undefined>;
198
- export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP;
198
+ type CopyLinkToAnchorButtonAEP = ButtonAEP<ACTION_SUBJECT_ID.COPY_LINK_TO_ANCHOR, {
199
+ inputMethod: INPUT_METHOD;
200
+ extensionKey?: string;
201
+ extensionType?: string;
202
+ isLivePage?: boolean;
203
+ }>;
204
+ export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | CopyLinkToAnchorButtonAEP;
199
205
  export {};
@@ -29,7 +29,11 @@ export interface State {
29
29
  activeChildIndex?: number;
30
30
  isNodeHovered?: boolean;
31
31
  }
32
- export declare class ExtensionComponent extends Component<Props, State> {
32
+ export type PropsNew = Omit<Props, 'extensionProvider'> & {
33
+ extensionProvider?: ExtensionProvider;
34
+ };
35
+ export type StateNew = Omit<State, 'extensionProvider'>;
36
+ export declare class ExtensionComponentOld extends Component<Props, State> {
33
37
  private privatePropsParsed;
34
38
  state: State;
35
39
  mounted: boolean;
@@ -54,3 +58,5 @@ export declare class ExtensionComponent extends Component<Props, State> {
54
58
  private tryExtensionHandler;
55
59
  private handleExtension;
56
60
  }
61
+ export declare const ExtensionComponentNew: (props: Props) => JSX.Element;
62
+ export declare const ExtensionComponent: (props: Props) => JSX.Element;
@@ -131,6 +131,8 @@ export type FloatingToolbarButton<T extends {}> = {
131
131
  tabIndex?: number | null | undefined;
132
132
  focusEditoronEnter?: boolean;
133
133
  supportsViewMode?: boolean;
134
+ /** If true, the component will have pulse onboarding effect around it. */
135
+ pulse?: boolean;
134
136
  };
135
137
  export type FloatingToolbarInput<T extends {}> = {
136
138
  id: string;
@@ -217,6 +219,8 @@ export type FloatingToolbarDropdown<T extends {}> = {
217
219
  alignDropdownWithToolbar?: boolean;
218
220
  onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
219
221
  footer?: React.ReactNode;
222
+ /** If true, the component will have pulse onboarding effect around it. */
223
+ pulse?: boolean;
220
224
  };
221
225
  type FloatingToolbarExtensionsPlaceholder = {
222
226
  type: 'extensions-placeholder';
@@ -29,6 +29,8 @@ export interface Props {
29
29
  tabIndex?: number | null | undefined;
30
30
  areaControls?: string;
31
31
  isRadioButton?: boolean;
32
+ /** If true, the component will have pulse onboarding effect around it. */
33
+ pulse?: boolean;
32
34
  }
33
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onMount, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
35
+ declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onMount, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, pulse, }: Props) => JSX.Element;
34
36
  export default _default;
@@ -14,7 +14,8 @@ export interface Props {
14
14
  export interface State {
15
15
  profilecardProvider: ProfilecardProvider | null;
16
16
  }
17
- export default class MentionWithProviders extends PureComponent<Props, State> {
17
+ export declare const MentionWithProviders: ({ accessLevel, eventHandlers, id, mentionProvider, profilecardProvider: profilecardProviderResolver, text, localId, }: Props) => JSX.Element;
18
+ export declare class MentionWithProvidersOld extends PureComponent<Props, State> {
18
19
  state: State;
19
20
  UNSAFE_componentWillMount(): void;
20
21
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
@@ -0,0 +1,18 @@
1
+ import { type ReactNode } from 'react';
2
+ interface Props {
3
+ /** If true, the component will have pulse onboarding effect around it. */
4
+ pulse?: boolean;
5
+ /** The radius of the pulse effect. */
6
+ radius?: number;
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * Wraps children with {@link SpotlightPulse} component.
11
+ *
12
+ * It adds pulse effect to children if `pulse` is `true`.
13
+ *
14
+ * This custom component exists because the {@link SpotlightPulse} with `pulse={false}` renders extra `div` around `children`.
15
+ * We want to keep `children` as it is if there is no `pulse`.
16
+ */
17
+ export declare function Pulse({ pulse, radius, children }: Props): JSX.Element;
18
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { ACTION, ACTION_SUBJECT } from './enums';
2
+ import type { UIAEP } from './utils';
3
+ /**
4
+ * Payload of an engagement platform event that is sent when an error occurs.
5
+ *
6
+ * It's used by `@atlassian/editor-plugin-engagement-platform` plugin.
7
+ */
8
+ type EngagementPlatformErroredAEP = UIAEP<ACTION.ERRORED, ACTION_SUBJECT.ENGAGEMENT_PLATFORM, undefined, {
9
+ /** The error message. */
10
+ error: string;
11
+ /** The error stack trace. */
12
+ errorStack?: string;
13
+ }, undefined>;
14
+ /**
15
+ * Payload of an engagement platform event.
16
+ *
17
+ * It's used by `@atlassian/editor-plugin-engagement-platform` plugin.
18
+ */
19
+ export type EngagementPlatformEventPayload = EngagementPlatformErroredAEP;
20
+ export {};
@@ -255,7 +255,8 @@ export declare enum ACTION_SUBJECT {
255
255
  DRAG = "drag",
256
256
  ELEMENT = "element",
257
257
  CONTEXT_MENU = "contextMenu",
258
- INLINE_DIALOG = "inlineDialog"
258
+ INLINE_DIALOG = "inlineDialog",
259
+ ENGAGEMENT_PLATFORM = "engagementPlatform"
259
260
  }
260
261
  export declare enum ACTION_SUBJECT_ID {
261
262
  ACTION = "action",
@@ -276,6 +277,7 @@ export declare enum ACTION_SUBJECT_ID {
276
277
  CODE_BLOCK = "codeBlock",
277
278
  CODEBLOCK_COPY = "codeBlockCopy",
278
279
  CODEBLOCK_WRAP = "codeBlockWrap",
280
+ COPY_LINK_TO_ANCHOR = "copyLinkToAnchor",
279
281
  CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU = "createInlineCommentFromHighlightActionsMenu",
280
282
  DATE = "date",
281
283
  DATE_DAY = "day",
@@ -11,6 +11,7 @@ import type { DatasourceClickedPayload } from './datasource-clicked-events';
11
11
  import type { DateEventPayload } from './date-events';
12
12
  import type { ElementBrowserEventPayload } from './element-browser-events';
13
13
  import type { ElementEventPayload } from './element-events';
14
+ import type { EngagementPlatformEventPayload } from './engagement-platform-events';
14
15
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, FLOATING_CONTROLS_TITLE } from './enums';
15
16
  import type { ExperimentalEventPayload } from './experimental-events';
16
17
  import type { ExtensionEventPayload } from './extension-events';
@@ -44,7 +45,7 @@ export type SimplifiedNode = {
44
45
  marks?: string[];
45
46
  content?: SimplifiedNode[];
46
47
  };
47
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | 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 | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload;
48
+ export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | 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 | DatasourceClickedPayload | ElementEventPayload | ContextMenuEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | EngagementPlatformEventPayload;
48
49
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
49
50
  previousColor: string;
50
51
  newColor: string;
@@ -195,5 +195,11 @@ export type RequestToEditAEP = UIAEP<ACTION.REQUEST_TO_EDIT | ACTION.DISMISSED,
195
195
  platform: PLATFORMS;
196
196
  mode: MODE;
197
197
  }, undefined>;
198
- export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP;
198
+ type CopyLinkToAnchorButtonAEP = ButtonAEP<ACTION_SUBJECT_ID.COPY_LINK_TO_ANCHOR, {
199
+ inputMethod: INPUT_METHOD;
200
+ extensionKey?: string;
201
+ extensionType?: string;
202
+ isLivePage?: boolean;
203
+ }>;
204
+ export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | CopyLinkToAnchorButtonAEP;
199
205
  export {};
@@ -29,7 +29,11 @@ export interface State {
29
29
  activeChildIndex?: number;
30
30
  isNodeHovered?: boolean;
31
31
  }
32
- export declare class ExtensionComponent extends Component<Props, State> {
32
+ export type PropsNew = Omit<Props, 'extensionProvider'> & {
33
+ extensionProvider?: ExtensionProvider;
34
+ };
35
+ export type StateNew = Omit<State, 'extensionProvider'>;
36
+ export declare class ExtensionComponentOld extends Component<Props, State> {
33
37
  private privatePropsParsed;
34
38
  state: State;
35
39
  mounted: boolean;
@@ -54,3 +58,5 @@ export declare class ExtensionComponent extends Component<Props, State> {
54
58
  private tryExtensionHandler;
55
59
  private handleExtension;
56
60
  }
61
+ export declare const ExtensionComponentNew: (props: Props) => JSX.Element;
62
+ export declare const ExtensionComponent: (props: Props) => JSX.Element;
@@ -131,6 +131,8 @@ export type FloatingToolbarButton<T extends {}> = {
131
131
  tabIndex?: number | null | undefined;
132
132
  focusEditoronEnter?: boolean;
133
133
  supportsViewMode?: boolean;
134
+ /** If true, the component will have pulse onboarding effect around it. */
135
+ pulse?: boolean;
134
136
  };
135
137
  export type FloatingToolbarInput<T extends {}> = {
136
138
  id: string;
@@ -217,6 +219,8 @@ export type FloatingToolbarDropdown<T extends {}> = {
217
219
  alignDropdownWithToolbar?: boolean;
218
220
  onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
219
221
  footer?: React.ReactNode;
222
+ /** If true, the component will have pulse onboarding effect around it. */
223
+ pulse?: boolean;
220
224
  };
221
225
  type FloatingToolbarExtensionsPlaceholder = {
222
226
  type: 'extensions-placeholder';
@@ -29,6 +29,8 @@ export interface Props {
29
29
  tabIndex?: number | null | undefined;
30
30
  areaControls?: string;
31
31
  isRadioButton?: boolean;
32
+ /** If true, the component will have pulse onboarding effect around it. */
33
+ pulse?: boolean;
32
34
  }
33
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onMount, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
35
+ declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onMount, selected, disabled, href, target, appearance, children, className, tooltipContent, tooltipStyle, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, pulse, }: Props) => JSX.Element;
34
36
  export default _default;
@@ -14,7 +14,8 @@ export interface Props {
14
14
  export interface State {
15
15
  profilecardProvider: ProfilecardProvider | null;
16
16
  }
17
- export default class MentionWithProviders extends PureComponent<Props, State> {
17
+ export declare const MentionWithProviders: ({ accessLevel, eventHandlers, id, mentionProvider, profilecardProvider: profilecardProviderResolver, text, localId, }: Props) => JSX.Element;
18
+ export declare class MentionWithProvidersOld extends PureComponent<Props, State> {
18
19
  state: State;
19
20
  UNSAFE_componentWillMount(): void;
20
21
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
@@ -0,0 +1,18 @@
1
+ import { type ReactNode } from 'react';
2
+ interface Props {
3
+ /** If true, the component will have pulse onboarding effect around it. */
4
+ pulse?: boolean;
5
+ /** The radius of the pulse effect. */
6
+ radius?: number;
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * Wraps children with {@link SpotlightPulse} component.
11
+ *
12
+ * It adds pulse effect to children if `pulse` is `true`.
13
+ *
14
+ * This custom component exists because the {@link SpotlightPulse} with `pulse={false}` renders extra `div` around `children`.
15
+ * We want to keep `children` as it is if there is no `pulse`.
16
+ */
17
+ export declare function Pulse({ pulse, radius, children }: Props): JSX.Element;
18
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "93.1.5",
3
+ "version": "93.2.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -137,19 +137,20 @@
137
137
  "@atlaskit/media-file-preview": "^0.9.0",
138
138
  "@atlaskit/media-picker": "^66.7.0",
139
139
  "@atlaskit/media-ui": "^25.15.0",
140
- "@atlaskit/media-viewer": "49.0.0",
140
+ "@atlaskit/media-viewer": "49.0.1",
141
141
  "@atlaskit/mention": "^23.3.0",
142
142
  "@atlaskit/menu": "^2.12.0",
143
+ "@atlaskit/onboarding": "^11.2.0",
143
144
  "@atlaskit/platform-feature-flags": "^0.3.0",
144
145
  "@atlaskit/primitives": "^12.2.0",
145
146
  "@atlaskit/profilecard": "^20.4.0",
146
147
  "@atlaskit/section-message": "^6.6.0",
147
- "@atlaskit/smart-card": "^29.1.0",
148
+ "@atlaskit/smart-card": "^29.2.0",
148
149
  "@atlaskit/smart-user-picker": "^6.10.0",
149
150
  "@atlaskit/spinner": "^16.3.0",
150
151
  "@atlaskit/task-decision": "^17.11.0",
151
152
  "@atlaskit/textfield": "^6.5.0",
152
- "@atlaskit/tmp-editor-statsig": "*",
153
+ "@atlaskit/tmp-editor-statsig": "^2.2.0",
153
154
  "@atlaskit/tokens": "^2.0.0",
154
155
  "@atlaskit/tooltip": "^18.8.0",
155
156
  "@atlaskit/ufo": "^0.3.0",
@@ -249,30 +250,30 @@
249
250
  "annotations_align_editor_and_renderer_styles": {
250
251
  "type": "boolean"
251
252
  },
252
- "platform-editor-a11y-image-border-options-dropdown": {
253
- "type": "boolean"
254
- },
255
253
  "platform_editor_a11y_table_context_menu": {
256
254
  "type": "boolean"
257
255
  },
258
256
  "editor_inline_comments_paste_insert_nodes": {
259
257
  "type": "boolean"
260
258
  },
261
- "editor-fix-esc-main-toolbar-navigation": {
262
- "type": "boolean"
263
- },
264
259
  "editor_support_code_block_wrapping": {
265
260
  "type": "boolean"
266
261
  },
267
262
  "editor_code_block_wrapping_language_change_bug": {
268
263
  "type": "boolean"
269
264
  },
265
+ "platform_editor_react18_mention_with_provider": {
266
+ "type": "boolean"
267
+ },
270
268
  "cc_page_experiences_live_search_wysiwyg": {
271
269
  "type": "boolean"
272
270
  },
273
271
  "use-effect-in-use-previous-props": {
274
272
  "type": "boolean"
275
273
  },
274
+ "platform_editor_react18_extension_component": {
275
+ "type": "boolean"
276
+ },
276
277
  "platform-datasources-enable-two-way-sync": {
277
278
  "type": "boolean"
278
279
  },