@atlaskit/editor-common 133.2.0 → 133.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 133.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`f268dee2526f7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f268dee2526f7) -
8
+ Migrate Smart Card registration and removal from transactions to editor actions behind
9
+ `platform_editor_reduce_forced_layout_2`. Remove unused card overlay registration behind
10
+ `platform_editor_reduce_forced_layout_2`.
11
+
12
+ ## 133.3.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`53facf8e5239c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/53facf8e5239c) -
17
+ Add comment target attribution to editor thread opens and toolbar screen events behind
18
+ cc_maui_annotations_on_extensions.
19
+
20
+ Add a shared analytics payload type for the inline comment toolbar screen event.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+
3
26
  ## 133.2.0
4
27
 
5
28
  ### Minor Changes
@@ -366,6 +366,7 @@ var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJ
366
366
  ACTION_SUBJECT["TYPEAHEAD"] = "typeAhead";
367
367
  ACTION_SUBJECT["TYPEAHEAD_ITEM"] = "typeAheadItem";
368
368
  ACTION_SUBJECT["ANNOTATION"] = "annotation";
369
+ ACTION_SUBJECT["INLINE_COMMENT_TOOLBAR"] = "inlineCommentToolbar";
369
370
  ACTION_SUBJECT["SEARCH_RESULT"] = "searchResult";
370
371
  ACTION_SUBJECT["CREATE_LINK_INLINE_DIALOG"] = "createLinkInlineDialog";
371
372
  ACTION_SUBJECT["CODE_BLOCK"] = "codeBlock";
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
27
27
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
28
28
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
29
29
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
30
- var packageVersion = "133.1.1";
30
+ var packageVersion = "133.4.0";
31
31
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
32
32
  // Remove URL as it has UGC
33
33
  // Ignored via go/ees007
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "133.1.1";
26
+ var packageVersion = "133.4.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -372,6 +372,7 @@ export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
372
372
  ACTION_SUBJECT["TYPEAHEAD"] = "typeAhead";
373
373
  ACTION_SUBJECT["TYPEAHEAD_ITEM"] = "typeAheadItem";
374
374
  ACTION_SUBJECT["ANNOTATION"] = "annotation";
375
+ ACTION_SUBJECT["INLINE_COMMENT_TOOLBAR"] = "inlineCommentToolbar";
375
376
  ACTION_SUBJECT["SEARCH_RESULT"] = "searchResult";
376
377
  ACTION_SUBJECT["CREATE_LINK_INLINE_DIALOG"] = "createLinkInlineDialog";
377
378
  ACTION_SUBJECT["CODE_BLOCK"] = "codeBlock";
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "133.1.1";
16
+ const packageVersion = "133.4.0";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "133.1.1";
16
+ const packageVersion = "133.4.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -372,6 +372,7 @@ export var ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
372
372
  ACTION_SUBJECT["TYPEAHEAD"] = "typeAhead";
373
373
  ACTION_SUBJECT["TYPEAHEAD_ITEM"] = "typeAheadItem";
374
374
  ACTION_SUBJECT["ANNOTATION"] = "annotation";
375
+ ACTION_SUBJECT["INLINE_COMMENT_TOOLBAR"] = "inlineCommentToolbar";
375
376
  ACTION_SUBJECT["SEARCH_RESULT"] = "searchResult";
376
377
  ACTION_SUBJECT["CREATE_LINK_INLINE_DIALOG"] = "createLinkInlineDialog";
377
378
  ACTION_SUBJECT["CODE_BLOCK"] = "codeBlock";
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "133.1.1";
22
+ var packageVersion = "133.4.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "133.1.1";
23
+ var packageVersion = "133.4.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -350,6 +350,7 @@ export declare enum ACTION_SUBJECT {
350
350
  TYPEAHEAD = "typeAhead",
351
351
  TYPEAHEAD_ITEM = "typeAheadItem",
352
352
  ANNOTATION = "annotation",
353
+ INLINE_COMMENT_TOOLBAR = "inlineCommentToolbar",
353
354
  SEARCH_RESULT = "searchResult",
354
355
  CREATE_LINK_INLINE_DIALOG = "createLinkInlineDialog",
355
356
  CODE_BLOCK = "codeBlock",
@@ -39,6 +39,7 @@ import type { FormatEventPayload } from './format-events';
39
39
  import type { GeneralEventPayload } from './general-events';
40
40
  import type { HighlightActionsEventPayload } from './highlight-actions-menu-events';
41
41
  import type { HighlightEventPayload } from './highlight-events';
42
+ import type { InlineCommentToolbarViewedAEP } from './inline-comment-events';
42
43
  import type { InsertEventPayload } from './insert-events';
43
44
  import type { VisitedLinkAEP } from './link-events';
44
45
  import type { CreateLinkInlineDialogEventPayload, EditLinkToolbarAEP, OpenLinkToolbarAEP, PreviewItemClickedAEP, OpenSettingsToolbarAEP, UnlinkToolbarAEP } from './link-tool-bar-events';
@@ -74,7 +75,7 @@ export type SimplifiedNode = {
74
75
  pos: number;
75
76
  type: string;
76
77
  };
77
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | PasteActionsMenuEventPayload | QuickInsertInformationEventPayload | QuickInsertSearchOutcomeEventPayload | CutCopyEventPayload | ErrorEventPayload | TextColorEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | PreviewItemClickedAEP | OpenLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | MentionEventPayload | EngagementPlatformEventPayload | NestedTableActionsEventPayload | ContainerNodeActionsEventPayload | AICommandPaletteEventPayload | AIDefinitionsEventPayload | AIEventPayload | AIStreamingEventPayload | AIProactiveEventPayload | AiAutocompleteEventPayload | AiSuggestionsEventPayload | ContextualTypeaheadEventPayload | AIQuickPromptEventPayload | AIUnifiedEventPayload | BreakoutEventPayload | BlockMenuEventPayload | ActiveSessionEventPayload | AIInlineSuggestionPayload | SelectionExtensionEventPayload | TelepointerClickPayload | SelectionToolbarEventPayload | ExperienceEventPayload | AlignmentEventPayload | UndoRedoAEP | OfflineEditingEventPayload | AgentEditShimmerNotShownAEP | FloatingToolbarOverflowEventPayload | SyncBlockEventPayload | NumberedHeadingsEventPayload | FloatingToolbarEventPayload;
78
+ export type AnalyticsEventPayload<T = void> = InlineCommentToolbarViewedAEP | AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | PasteActionsMenuEventPayload | QuickInsertInformationEventPayload | QuickInsertSearchOutcomeEventPayload | CutCopyEventPayload | ErrorEventPayload | TextColorEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | PreviewItemClickedAEP | OpenLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | MentionEventPayload | EngagementPlatformEventPayload | NestedTableActionsEventPayload | ContainerNodeActionsEventPayload | AICommandPaletteEventPayload | AIDefinitionsEventPayload | AIEventPayload | AIStreamingEventPayload | AIProactiveEventPayload | AiAutocompleteEventPayload | AiSuggestionsEventPayload | ContextualTypeaheadEventPayload | AIQuickPromptEventPayload | AIUnifiedEventPayload | BreakoutEventPayload | BlockMenuEventPayload | ActiveSessionEventPayload | AIInlineSuggestionPayload | SelectionExtensionEventPayload | TelepointerClickPayload | SelectionToolbarEventPayload | ExperienceEventPayload | AlignmentEventPayload | UndoRedoAEP | OfflineEditingEventPayload | AgentEditShimmerNotShownAEP | FloatingToolbarOverflowEventPayload | SyncBlockEventPayload | NumberedHeadingsEventPayload | FloatingToolbarEventPayload;
78
79
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
79
80
  newColor: string;
80
81
  previousColor: string;
@@ -1,5 +1,12 @@
1
1
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
2
- import type { OperationalAEP, TrackAEP } from './utils';
2
+ import type { OperationalAEP, ScreenAEP, TrackAEP } from './utils';
3
+ export type InlineCommentToolbarViewedAEP = ScreenAEP<ACTION.VIEWED, ACTION_SUBJECT.INLINE_COMMENT_TOOLBAR, undefined, {
4
+ commentTargetType: string | undefined;
5
+ hasExistingComments: boolean;
6
+ isCommentButtonEnabled: boolean;
7
+ }, undefined> & {
8
+ name: 'inlineCommentToolbar';
9
+ };
3
10
  export type AnnotationActionType = ACTION.INSERTED | ACTION.CLOSED | ACTION.EDITED | ACTION.DELETED | ACTION.OPENED | ACTION.RESOLVED | ACTION.VIEWED;
4
11
  export type AnnotationErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, {
5
12
  errorReason?: string;
@@ -79,7 +79,19 @@ export interface EmbedCardTransformers {
79
79
  createEmbedCardTransformCommand: CreateEmbedCardTransformCommand;
80
80
  embedCardNodeTransformer: EmbedCardNodeTransformer;
81
81
  }
82
+ /** Resolved card metadata and its live node-view position getter. */
83
+ export type CardRegistration = {
84
+ /** Read the node view's current position after document edits. */
85
+ getPos: () => number | undefined;
86
+ id: string;
87
+ title?: string;
88
+ url?: string;
89
+ };
90
+ /** Immutable registrations keyed by card ID. */
91
+ export type CardRegistrations = Readonly<Record<string, Readonly<CardRegistration>>>;
82
92
  export type CardPluginActions = {
93
+ /** Returns current registrations keyed by card ID. */
94
+ getCardRegistrations: () => CardRegistrations;
83
95
  getEndingToolbarItems: GetEndingToolbarItems;
84
96
  getStartingToolbarItems: GetStartingToolbarItems;
85
97
  hideLinkToolbar: HideLinkToolbarAction;
@@ -94,7 +106,9 @@ export type CardPluginActions = {
94
106
  * `queueCardsFromChangedTr` when unavailable.
95
107
  */
96
108
  queueCardsFromRange?: QueueCardsFromRangeAction;
109
+ registerCard: (info: CardRegistration) => void;
97
110
  registerEmbedCardTransformer: (transformers: EmbedCardTransformers) => void;
111
+ removeRegisteredCard: (id: string) => void;
98
112
  /**
99
113
  * Resolves a URL via the Object Resolver Service and returns the canonical
100
114
  * expanded URL. Useful for expanding Confluence short-link URLs
@@ -105,4 +119,5 @@ export type CardPluginActions = {
105
119
  */
106
120
  resolveShortLinkUrl: (url: string) => Promise<string | undefined>;
107
121
  setProvider: (provider: Promise<CardProvider>) => Promise<boolean>;
122
+ subscribeToCardRegistry: (listener: () => void) => () => void;
108
123
  };
@@ -142,6 +142,8 @@ export type FloatingToolbarButton<T extends object> = {
142
142
  confirmDialog?: ConfirmDialogOptions | (() => ConfirmDialogOptions);
143
143
  disabled?: boolean;
144
144
  focusEditoronEnter?: boolean;
145
+ /** Keep the tooltip open when the button is pressed. Set it when a press changes the tooltip content. */
146
+ hasNewContentOnTriggerClick?: boolean;
145
147
  hidden?: boolean;
146
148
  hideTooltipOnClick?: boolean;
147
149
  href?: string;
@@ -164,8 +166,6 @@ export type FloatingToolbarButton<T extends object> = {
164
166
  /** If true, the component will have pulse onboarding effect around it. */
165
167
  pulse?: boolean;
166
168
  selected?: boolean;
167
- /** Keep the tooltip open when the button is pressed. Set it when a press changes the tooltip content. */
168
- hasNewContentOnTriggerClick?: boolean;
169
169
  showTitle?: boolean;
170
170
  supportsViewMode?: boolean;
171
171
  tabIndex?: number | null | undefined;
@@ -340,6 +340,11 @@ export interface FloatingToolbarConfig {
340
340
  * behind it. Defaults to `'default'` (the wrapper's surface, as today).
341
341
  */
342
342
  containerSurface?: 'default' | 'none';
343
+ /** Refresh items when data outside EditorState changes. Snapshots must be stable between updates. */
344
+ externalStore?: {
345
+ getSnapshot: () => unknown;
346
+ subscribe: (listener: () => void) => () => void;
347
+ };
343
348
  /**
344
349
  * Enable Popup component's focus trap
345
350
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "133.2.0",
3
+ "version": "133.4.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/"
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/editor-json-transformer": "^10.0.0",
46
46
  "@atlaskit/editor-palette": "^3.5.0",
47
47
  "@atlaskit/editor-prosemirror": "^9.0.0",
48
- "@atlaskit/editor-shared-styles": "^4.5.0",
48
+ "@atlaskit/editor-shared-styles": "^4.6.0",
49
49
  "@atlaskit/editor-tables": "^3.2.0",
50
50
  "@atlaskit/editor-toolbar": "^2.8.0",
51
51
  "@atlaskit/editor-toolbar-model": "^1.2.0",