@atlaskit/editor-common 119.14.0 → 119.15.1

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,35 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 119.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e4462b86bc887`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e4462b86bc887) -
8
+ [ux] [ux] Add analytics tracking for the "Try again" retry button on the AI suggested edits error
9
+ screen. Clicking retry now fires an `ai suggestions clicked` track event with
10
+ `actionSubjectId: suggestionsErrorRetry`.
11
+ - Updated dependencies
12
+
13
+ ## 119.15.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [`5ce0f8e29f818`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5ce0f8e29f818) -
18
+ EDITOR-8535
19
+
20
+ Added `UnsupportedBlockNodeView` to `@atlaskit/editor-plugin-unsupported-content`, switching the
21
+ `unsupportedBlock` and `confluenceUnsupportedBlock` node views to vanilla DOM under the
22
+ `platform_editor_vanilla_node_views_phase1` experiment. Also added vanilla unsupported block CSS
23
+ to `@atlaskit/editor-core`'s `EditorContentContainer`.
24
+
25
+ `VanillaTooltip` accepts an optional `onShow` callback, called once the tooltip has become visible
26
+ after its delay has elapsed. It is not called when the pointer leaves beforehand, matching the
27
+ `onShow` semantics of `@atlaskit/tooltip`.
28
+
29
+ `VanillaTooltip.destroy()` now cancels any pending show/hide timeout. Previously a pending timeout
30
+ could run after destruction, writing styles to detached DOM and invoking callbacks for an owner
31
+ that no longer exists.
32
+
3
33
  ## 119.14.0
4
34
 
5
35
  ### Minor Changes
@@ -447,6 +447,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
447
447
  ACTION_SUBJECT_ID["CODEBLOCK_WRAP"] = "codeBlockWrap";
448
448
  ACTION_SUBJECT_ID["CONVERSATION_ERROR"] = "conversationError";
449
449
  ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION_ERROR"] = "suggestionsRegenerationError";
450
+ ACTION_SUBJECT_ID["SUGGESTIONS_ERROR_RETRY"] = "suggestionsErrorRetry";
450
451
  ACTION_SUBJECT_ID["COPY_BUTTON"] = "copyButton";
451
452
  ACTION_SUBJECT_ID["COPY_LINK_TO_ANCHOR"] = "copyLinkToAnchor";
452
453
  ACTION_SUBJECT_ID["COPY_BLOCK"] = "copyBlock";
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
28
28
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
29
29
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
30
30
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
31
- var packageVersion = "119.13.1";
31
+ var packageVersion = "119.15.0";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "119.13.1";
27
+ var packageVersion = "119.15.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -58,12 +58,20 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
58
58
  * where ancestor CSS selectors cannot reach it.
59
59
  */
60
60
  styles = arguments.length > 5 ? arguments[5] : undefined;
61
+ var
62
+ /**
63
+ * Called when the tooltip has become visible, after `timeout` has elapsed.
64
+ * Not called when the pointer leaves before the tooltip is shown, matching
65
+ * the `onShow` semantics of "@atlaskit/tooltip".
66
+ */
67
+ onShow = arguments.length > 6 ? arguments[6] : undefined;
61
68
  (0, _classCallCheck2.default)(this, VanillaTooltip);
62
69
  (0, _defineProperty2.default)(this, "listeners", []);
63
70
  (0, _defineProperty2.default)(this, "shouldHidePopover", false);
64
71
  (0, _defineProperty2.default)(this, "isDisplayed", false);
65
72
  this.button = button;
66
73
  this.timeout = timeout;
74
+ this.onShow = onShow;
67
75
  var tooltip = document.createElement('span');
68
76
  tooltip.role = 'tooltip';
69
77
  tooltip.popover = 'hint';
@@ -126,6 +134,9 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
126
134
  key: "destroy",
127
135
  value: function destroy() {
128
136
  var _this$popperInstance;
137
+ // Cancels any pending show/hide, which would otherwise run against detached DOM and
138
+ // invoke `onShow` after the owner has gone away.
139
+ clearTimeout(this.currentTimeoutId);
129
140
  (_this$popperInstance = this.popperInstance) === null || _this$popperInstance === void 0 || _this$popperInstance.destroy();
130
141
  this.listeners.forEach(function (listener) {
131
142
  listener();
@@ -180,7 +191,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
180
191
 
181
192
  // Enable the event listeners
182
193
  this.currentTimeoutId = setTimeout(function () {
183
- var _this3$popperInstance;
194
+ var _this3$popperInstance, _this3$onShow;
184
195
  _this3.tooltip.style.opacity = '1';
185
196
  _this3.tooltip.style.visibility = 'visible';
186
197
  (_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.setOptions(function (options) {
@@ -192,6 +203,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
192
203
  });
193
204
  });
194
205
  _this3.isDisplayed = true;
206
+ (_this3$onShow = _this3.onShow) === null || _this3$onShow === void 0 || _this3$onShow.call(_this3);
195
207
  }, this.timeout);
196
208
  }
197
209
  }]);
@@ -455,6 +455,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
455
455
  ACTION_SUBJECT_ID["CODEBLOCK_WRAP"] = "codeBlockWrap";
456
456
  ACTION_SUBJECT_ID["CONVERSATION_ERROR"] = "conversationError";
457
457
  ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION_ERROR"] = "suggestionsRegenerationError";
458
+ ACTION_SUBJECT_ID["SUGGESTIONS_ERROR_RETRY"] = "suggestionsErrorRetry";
458
459
  ACTION_SUBJECT_ID["COPY_BUTTON"] = "copyButton";
459
460
  ACTION_SUBJECT_ID["COPY_LINK_TO_ANCHOR"] = "copyLinkToAnchor";
460
461
  ACTION_SUBJECT_ID["COPY_BLOCK"] = "copyBlock";
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
14
14
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
15
15
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
16
16
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
17
- const packageVersion = "119.13.1";
17
+ const packageVersion = "119.15.0";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "119.13.1";
17
+ const packageVersion = "119.15.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -43,12 +43,19 @@ export class VanillaTooltip {
43
43
  * Useful when the tooltip is rendered in the browser's top layer (via Popover API),
44
44
  * where ancestor CSS selectors cannot reach it.
45
45
  */
46
- styles) {
46
+ styles,
47
+ /**
48
+ * Called when the tooltip has become visible, after `timeout` has elapsed.
49
+ * Not called when the pointer leaves before the tooltip is shown, matching
50
+ * the `onShow` semantics of "@atlaskit/tooltip".
51
+ */
52
+ onShow) {
47
53
  _defineProperty(this, "listeners", []);
48
54
  _defineProperty(this, "shouldHidePopover", false);
49
55
  _defineProperty(this, "isDisplayed", false);
50
56
  this.button = button;
51
57
  this.timeout = timeout;
58
+ this.onShow = onShow;
52
59
  const tooltip = document.createElement('span');
53
60
  tooltip.role = 'tooltip';
54
61
  tooltip.popover = 'hint';
@@ -103,6 +110,9 @@ export class VanillaTooltip {
103
110
  }
104
111
  destroy() {
105
112
  var _this$popperInstance;
113
+ // Cancels any pending show/hide, which would otherwise run against detached DOM and
114
+ // invoke `onShow` after the owner has gone away.
115
+ clearTimeout(this.currentTimeoutId);
106
116
  (_this$popperInstance = this.popperInstance) === null || _this$popperInstance === void 0 ? void 0 : _this$popperInstance.destroy();
107
117
  this.listeners.forEach(listener => {
108
118
  listener();
@@ -149,7 +159,7 @@ export class VanillaTooltip {
149
159
 
150
160
  // Enable the event listeners
151
161
  this.currentTimeoutId = setTimeout(() => {
152
- var _this$popperInstance3;
162
+ var _this$popperInstance3, _this$onShow;
153
163
  this.tooltip.style.opacity = '1';
154
164
  this.tooltip.style.visibility = 'visible';
155
165
  (_this$popperInstance3 = this.popperInstance) === null || _this$popperInstance3 === void 0 ? void 0 : _this$popperInstance3.setOptions(options => ({
@@ -160,6 +170,7 @@ export class VanillaTooltip {
160
170
  }]
161
171
  }));
162
172
  this.isDisplayed = true;
173
+ (_this$onShow = this.onShow) === null || _this$onShow === void 0 ? void 0 : _this$onShow.call(this);
163
174
  }, this.timeout);
164
175
  }
165
176
  }
@@ -455,6 +455,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
455
455
  ACTION_SUBJECT_ID["CODEBLOCK_WRAP"] = "codeBlockWrap";
456
456
  ACTION_SUBJECT_ID["CONVERSATION_ERROR"] = "conversationError";
457
457
  ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION_ERROR"] = "suggestionsRegenerationError";
458
+ ACTION_SUBJECT_ID["SUGGESTIONS_ERROR_RETRY"] = "suggestionsErrorRetry";
458
459
  ACTION_SUBJECT_ID["COPY_BUTTON"] = "copyButton";
459
460
  ACTION_SUBJECT_ID["COPY_LINK_TO_ANCHOR"] = "copyLinkToAnchor";
460
461
  ACTION_SUBJECT_ID["COPY_BLOCK"] = "copyBlock";
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
20
20
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
21
21
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
22
22
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
23
- var packageVersion = "119.13.1";
23
+ var packageVersion = "119.15.0";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "119.13.1";
24
+ var packageVersion = "119.15.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -51,12 +51,20 @@ export var VanillaTooltip = /*#__PURE__*/function () {
51
51
  * where ancestor CSS selectors cannot reach it.
52
52
  */
53
53
  styles = arguments.length > 5 ? arguments[5] : undefined;
54
+ var
55
+ /**
56
+ * Called when the tooltip has become visible, after `timeout` has elapsed.
57
+ * Not called when the pointer leaves before the tooltip is shown, matching
58
+ * the `onShow` semantics of "@atlaskit/tooltip".
59
+ */
60
+ onShow = arguments.length > 6 ? arguments[6] : undefined;
54
61
  _classCallCheck(this, VanillaTooltip);
55
62
  _defineProperty(this, "listeners", []);
56
63
  _defineProperty(this, "shouldHidePopover", false);
57
64
  _defineProperty(this, "isDisplayed", false);
58
65
  this.button = button;
59
66
  this.timeout = timeout;
67
+ this.onShow = onShow;
60
68
  var tooltip = document.createElement('span');
61
69
  tooltip.role = 'tooltip';
62
70
  tooltip.popover = 'hint';
@@ -119,6 +127,9 @@ export var VanillaTooltip = /*#__PURE__*/function () {
119
127
  key: "destroy",
120
128
  value: function destroy() {
121
129
  var _this$popperInstance;
130
+ // Cancels any pending show/hide, which would otherwise run against detached DOM and
131
+ // invoke `onShow` after the owner has gone away.
132
+ clearTimeout(this.currentTimeoutId);
122
133
  (_this$popperInstance = this.popperInstance) === null || _this$popperInstance === void 0 || _this$popperInstance.destroy();
123
134
  this.listeners.forEach(function (listener) {
124
135
  listener();
@@ -173,7 +184,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
173
184
 
174
185
  // Enable the event listeners
175
186
  this.currentTimeoutId = setTimeout(function () {
176
- var _this3$popperInstance;
187
+ var _this3$popperInstance, _this3$onShow;
177
188
  _this3.tooltip.style.opacity = '1';
178
189
  _this3.tooltip.style.visibility = 'visible';
179
190
  (_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.setOptions(function (options) {
@@ -185,6 +196,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
185
196
  });
186
197
  });
187
198
  _this3.isDisplayed = true;
199
+ (_this3$onShow = _this3.onShow) === null || _this3$onShow === void 0 || _this3$onShow.call(_this3);
188
200
  }, this.timeout);
189
201
  }
190
202
  }]);
@@ -38,6 +38,12 @@ type RegenerateSuggestionsErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJE
38
38
  type EntryPointClickedAEP = TrackAEP<ACTION.CLICKED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
39
39
  entryPoint: AiSuggestionsEntryPoint;
40
40
  }, undefined>;
41
+ /**
42
+ * Fired when the user clicks the "Try again" / retry button on the suggested
43
+ * edits error screen (the thinking bar's error state). Lets us measure how
44
+ * often users attempt to recover from a suggestions failure.
45
+ */
46
+ type SuggestionsErrorRetryClickedAEP = TrackAEP<ACTION.CLICKED, ACTION_SUBJECT.AI_SUGGESTIONS, ACTION_SUBJECT_ID.SUGGESTIONS_ERROR_RETRY, undefined, undefined>;
41
47
  type EntryPointExposureAEP = TrackAEP<ACTION.EXPOSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
42
48
  entryPoint: AiSuggestionsEntryPoint;
43
49
  }, undefined>;
@@ -84,5 +90,5 @@ type ViewSuggestionReasoningAEP = TrackAEP<ACTION.REASONING_VIEWED, ACTION_SUBJE
84
90
  reasoningCharacterCount: number;
85
91
  suggestionType: string;
86
92
  }, undefined>;
87
- export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | ConversationErrorAEP | RegenerateSuggestionsErrorAEP | EntryPointClickedAEP | EntryPointExposureAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | DismissSuggestionAEP | ViewSuggestionAEP | RightRailViewedAEP | ViewSuggestionReasoningAEP;
93
+ export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | ConversationErrorAEP | RegenerateSuggestionsErrorAEP | EntryPointClickedAEP | SuggestionsErrorRetryClickedAEP | EntryPointExposureAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | DismissSuggestionAEP | ViewSuggestionAEP | RightRailViewedAEP | ViewSuggestionReasoningAEP;
88
94
  export {};
@@ -429,6 +429,7 @@ export declare enum ACTION_SUBJECT_ID {
429
429
  CODEBLOCK_WRAP = "codeBlockWrap",
430
430
  CONVERSATION_ERROR = "conversationError",
431
431
  SUGGESTIONS_REGENERATION_ERROR = "suggestionsRegenerationError",
432
+ SUGGESTIONS_ERROR_RETRY = "suggestionsErrorRetry",
432
433
  COPY_BUTTON = "copyButton",
433
434
  COPY_LINK_TO_ANCHOR = "copyLinkToAnchor",
434
435
  COPY_BLOCK = "copyBlock",
@@ -7,6 +7,12 @@
7
7
  export declare class VanillaTooltip {
8
8
  private button;
9
9
  private timeout;
10
+ /**
11
+ * Called when the tooltip has become visible, after `timeout` has elapsed.
12
+ * Not called when the pointer leaves before the tooltip is shown, matching
13
+ * the `onShow` semantics of "@atlaskit/tooltip".
14
+ */
15
+ private onShow?;
10
16
  private popperInstance;
11
17
  private listeners;
12
18
  private currentTimeoutId;
@@ -27,7 +33,13 @@ export declare class VanillaTooltip {
27
33
  * Useful when the tooltip is rendered in the browser's top layer (via Popover API),
28
34
  * where ancestor CSS selectors cannot reach it.
29
35
  */
30
- styles?: Record<string, string>);
36
+ styles?: Record<string, string>,
37
+ /**
38
+ * Called when the tooltip has become visible, after `timeout` has elapsed.
39
+ * Not called when the pointer leaves before the tooltip is shown, matching
40
+ * the `onShow` semantics of "@atlaskit/tooltip".
41
+ */
42
+ onShow?: (() => void) | undefined);
31
43
  private createPopperInstance;
32
44
  destroy(): void;
33
45
  private hide;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "119.14.0",
3
+ "version": "119.15.1",
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/"
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/media-common": "^14.5.0",
63
63
  "@atlaskit/media-file-preview": "^1.2.0",
64
64
  "@atlaskit/media-picker": "^72.3.0",
65
- "@atlaskit/media-ui": "^30.12.0",
65
+ "@atlaskit/media-ui": "^30.13.0",
66
66
  "@atlaskit/media-viewer": "^54.6.0",
67
67
  "@atlaskit/mention": "^27.18.0",
68
68
  "@atlaskit/menu": "^10.1.0",
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/platform-feature-flags-react": "^1.1.0",
74
74
  "@atlaskit/popper": "^9.3.0",
75
75
  "@atlaskit/primitives": "^22.4.0",
76
- "@atlaskit/profilecard": "^26.18.0",
76
+ "@atlaskit/profilecard": "^26.19.0",
77
77
  "@atlaskit/prosemirror-history": "^1.2.0",
78
78
  "@atlaskit/react-compiler-gating": "^0.2.0",
79
79
  "@atlaskit/react-ufo": "^7.7.0",