@atlaskit/editor-common 120.1.0 → 120.3.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,27 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 120.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e62dacf4416fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e62dacf4416fd) -
8
+ Add the shared popup-anchor contract, registry-backed drag handle, and menu integrations behind
9
+ `platform_editor_block_control_migration`.
10
+
11
+ ## 120.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`36fe288d5a58f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36fe288d5a58f) -
16
+ [ux] Suggested Edits: map AI review failures to templated error screens in the thinking bar (rate
17
+ limit, Acceptable Use Policy, token limit and unknown), mirroring Rovo inline chat's copy, links
18
+ and retry rules. Non-retryable errors (rate limit, AUP) hide the "Try again" action, and the
19
+ Close/Try again buttons are ordered Close first.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 120.1.0
4
26
 
5
27
  ### Minor Changes
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/block-controls/surface-drag-handle-element",
3
+ "main": "../../dist/cjs/block-controls/surface-drag-handle-element.js",
4
+ "module": "../../dist/esm/block-controls/surface-drag-handle-element.js",
5
+ "module:es2019": "../../dist/es2019/block-controls/surface-drag-handle-element.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/block-controls/surface-drag-handle-element.d.ts"
10
+ }
@@ -336,6 +336,11 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
336
336
  defaultMessage: 'Close',
337
337
  description: 'Accessible label for the close button on the thinking complete bar'
338
338
  },
339
+ thinkingErrorTokenLimitExceeded: {
340
+ id: 'fabric.editor.ai.suggestions.thinkingError.tokenLimitExceeded.non-final',
341
+ defaultMessage: 'There’s too much content to process.',
342
+ description: 'Error shown on the suggested-edits thinking bar when the request exceeds the maximum content limit.'
343
+ },
339
344
  sourceLabel: {
340
345
  id: 'fabric.editor.ai.suggestions.sourceLabel.non-final',
341
346
  defaultMessage: 'Source',
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.surfaceDragHandleElementStore = void 0;
7
+ /**
8
+ * Publishes the drag handle rendered into the block controls UI control surface, so popup consumers
9
+ * outside Block Controls can anchor themselves to it without introducing a package cycle.
10
+ * Entries are keyed by editor view so editors on the same page cannot interfere with each other.
11
+ */
12
+
13
+ var elementByView = new WeakMap();
14
+ var listenersByView = new WeakMap();
15
+ var surfaceDragHandleElementStore = exports.surfaceDragHandleElementStore = {
16
+ get: function get(view) {
17
+ var element = view && elementByView.get(view) || null;
18
+ return element !== null && element !== void 0 && element.isConnected ? element : null;
19
+ },
20
+ release: function release(view, element) {
21
+ if (!view || !element || elementByView.get(view) !== element) {
22
+ return;
23
+ }
24
+ surfaceDragHandleElementStore.set(view, null);
25
+ },
26
+ set: function set(view, element) {
27
+ var _elementByView$get, _listenersByView$get;
28
+ if (!view) {
29
+ return;
30
+ }
31
+ var current = (_elementByView$get = elementByView.get(view)) !== null && _elementByView$get !== void 0 ? _elementByView$get : null;
32
+ if (current === element) {
33
+ return;
34
+ }
35
+ if (element) {
36
+ elementByView.set(view, element);
37
+ } else {
38
+ elementByView.delete(view);
39
+ }
40
+ (_listenersByView$get = listenersByView.get(view)) === null || _listenersByView$get === void 0 || _listenersByView$get.forEach(function (listener) {
41
+ return listener();
42
+ });
43
+ },
44
+ subscribe: function subscribe(view, listener) {
45
+ var _listenersByView$get2;
46
+ if (!view) {
47
+ return function () {};
48
+ }
49
+ var listeners = (_listenersByView$get2 = listenersByView.get(view)) !== null && _listenersByView$get2 !== void 0 ? _listenersByView$get2 : new Set();
50
+ listeners.add(listener);
51
+ listenersByView.set(view, listeners);
52
+ return function () {
53
+ listeners.delete(listener);
54
+ };
55
+ }
56
+ };
@@ -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 = "120.0.2";
31
+ var packageVersion = "120.2.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 = "120.0.2";
27
+ var packageVersion = "120.2.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -330,6 +330,11 @@ export const aiSuggestionsMessages = defineMessages({
330
330
  defaultMessage: 'Close',
331
331
  description: 'Accessible label for the close button on the thinking complete bar'
332
332
  },
333
+ thinkingErrorTokenLimitExceeded: {
334
+ id: 'fabric.editor.ai.suggestions.thinkingError.tokenLimitExceeded.non-final',
335
+ defaultMessage: 'There’s too much content to process.',
336
+ description: 'Error shown on the suggested-edits thinking bar when the request exceeds the maximum content limit.'
337
+ },
333
338
  sourceLabel: {
334
339
  id: 'fabric.editor.ai.suggestions.sourceLabel.non-final',
335
340
  defaultMessage: 'Source',
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Publishes the drag handle rendered into the block controls UI control surface, so popup consumers
3
+ * outside Block Controls can anchor themselves to it without introducing a package cycle.
4
+ * Entries are keyed by editor view so editors on the same page cannot interfere with each other.
5
+ */
6
+
7
+ const elementByView = new WeakMap();
8
+ const listenersByView = new WeakMap();
9
+ export const surfaceDragHandleElementStore = {
10
+ get: view => {
11
+ const element = view && elementByView.get(view) || null;
12
+ return element !== null && element !== void 0 && element.isConnected ? element : null;
13
+ },
14
+ release: (view, element) => {
15
+ if (!view || !element || elementByView.get(view) !== element) {
16
+ return;
17
+ }
18
+ surfaceDragHandleElementStore.set(view, null);
19
+ },
20
+ set: (view, element) => {
21
+ var _elementByView$get, _listenersByView$get;
22
+ if (!view) {
23
+ return;
24
+ }
25
+ const current = (_elementByView$get = elementByView.get(view)) !== null && _elementByView$get !== void 0 ? _elementByView$get : null;
26
+ if (current === element) {
27
+ return;
28
+ }
29
+ if (element) {
30
+ elementByView.set(view, element);
31
+ } else {
32
+ elementByView.delete(view);
33
+ }
34
+ (_listenersByView$get = listenersByView.get(view)) === null || _listenersByView$get === void 0 ? void 0 : _listenersByView$get.forEach(listener => listener());
35
+ },
36
+ subscribe: (view, listener) => {
37
+ var _listenersByView$get2;
38
+ if (!view) {
39
+ return () => {};
40
+ }
41
+ const listeners = (_listenersByView$get2 = listenersByView.get(view)) !== null && _listenersByView$get2 !== void 0 ? _listenersByView$get2 : new Set();
42
+ listeners.add(listener);
43
+ listenersByView.set(view, listeners);
44
+ return () => {
45
+ listeners.delete(listener);
46
+ };
47
+ }
48
+ };
@@ -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 = "120.0.2";
17
+ const packageVersion = "120.2.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/fg';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "120.0.2";
17
+ const packageVersion = "120.2.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -330,6 +330,11 @@ export var aiSuggestionsMessages = defineMessages({
330
330
  defaultMessage: 'Close',
331
331
  description: 'Accessible label for the close button on the thinking complete bar'
332
332
  },
333
+ thinkingErrorTokenLimitExceeded: {
334
+ id: 'fabric.editor.ai.suggestions.thinkingError.tokenLimitExceeded.non-final',
335
+ defaultMessage: 'There’s too much content to process.',
336
+ description: 'Error shown on the suggested-edits thinking bar when the request exceeds the maximum content limit.'
337
+ },
333
338
  sourceLabel: {
334
339
  id: 'fabric.editor.ai.suggestions.sourceLabel.non-final',
335
340
  defaultMessage: 'Source',
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Publishes the drag handle rendered into the block controls UI control surface, so popup consumers
3
+ * outside Block Controls can anchor themselves to it without introducing a package cycle.
4
+ * Entries are keyed by editor view so editors on the same page cannot interfere with each other.
5
+ */
6
+
7
+ var elementByView = new WeakMap();
8
+ var listenersByView = new WeakMap();
9
+ export var surfaceDragHandleElementStore = {
10
+ get: function get(view) {
11
+ var element = view && elementByView.get(view) || null;
12
+ return element !== null && element !== void 0 && element.isConnected ? element : null;
13
+ },
14
+ release: function release(view, element) {
15
+ if (!view || !element || elementByView.get(view) !== element) {
16
+ return;
17
+ }
18
+ surfaceDragHandleElementStore.set(view, null);
19
+ },
20
+ set: function set(view, element) {
21
+ var _elementByView$get, _listenersByView$get;
22
+ if (!view) {
23
+ return;
24
+ }
25
+ var current = (_elementByView$get = elementByView.get(view)) !== null && _elementByView$get !== void 0 ? _elementByView$get : null;
26
+ if (current === element) {
27
+ return;
28
+ }
29
+ if (element) {
30
+ elementByView.set(view, element);
31
+ } else {
32
+ elementByView.delete(view);
33
+ }
34
+ (_listenersByView$get = listenersByView.get(view)) === null || _listenersByView$get === void 0 || _listenersByView$get.forEach(function (listener) {
35
+ return listener();
36
+ });
37
+ },
38
+ subscribe: function subscribe(view, listener) {
39
+ var _listenersByView$get2;
40
+ if (!view) {
41
+ return function () {};
42
+ }
43
+ var listeners = (_listenersByView$get2 = listenersByView.get(view)) !== null && _listenersByView$get2 !== void 0 ? _listenersByView$get2 : new Set();
44
+ listeners.add(listener);
45
+ listenersByView.set(view, listeners);
46
+ return function () {
47
+ listeners.delete(listener);
48
+ };
49
+ }
50
+ };
@@ -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 = "120.0.2";
23
+ var packageVersion = "120.2.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/fg';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "120.0.2";
24
+ var packageVersion = "120.2.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -274,6 +274,11 @@ export declare const aiSuggestionsMessages: {
274
274
  description: string;
275
275
  id: string;
276
276
  };
277
+ thinkingErrorTokenLimitExceeded: {
278
+ defaultMessage: string;
279
+ description: string;
280
+ id: string;
281
+ };
277
282
  thinkingEscHint: {
278
283
  defaultMessage: string;
279
284
  description: string;
@@ -0,0 +1,19 @@
1
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
+ /**
3
+ * Publishes the drag handle rendered into the block controls UI control surface, so popup consumers
4
+ * outside Block Controls can anchor themselves to it without introducing a package cycle.
5
+ * Entries are keyed by editor view so editors on the same page cannot interfere with each other.
6
+ */
7
+ type Listener = () => void;
8
+ type SurfaceDragHandleElementStore = {
9
+ /** Never returns an element that has left the document. */
10
+ get: (view: EditorView | undefined) => HTMLElement | null;
11
+ /** Clears only when the supplied element is still the current one. */
12
+ release: (view: EditorView | undefined, element: HTMLElement | null) => void;
13
+ /** Publishes the currently rendered surface drag handle. */
14
+ set: (view: EditorView | undefined, element: HTMLElement | null) => void;
15
+ /** Subscribes to handle replacement for one editor instance. */
16
+ subscribe: (view: EditorView | undefined, listener: Listener) => () => void;
17
+ };
18
+ export declare const surfaceDragHandleElementStore: SurfaceDragHandleElementStore;
19
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "120.1.0",
3
+ "version": "120.3.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/"
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/afm-i18n-platform-editor-editor-common": "2.200.0",
35
35
  "@atlaskit/analytics-listeners": "^11.1.0",
36
36
  "@atlaskit/analytics-namespaced-context": "^8.1.0",
37
- "@atlaskit/analytics-next": "^12.3.0",
37
+ "@atlaskit/analytics-next": "^12.4.0",
38
38
  "@atlaskit/atlassian-context": "^1.1.0",
39
39
  "@atlaskit/browser-apis": "^1.2.0",
40
40
  "@atlaskit/button": "^25.2.0",
@@ -60,7 +60,7 @@
60
60
  "@atlaskit/media-client": "^37.5.0",
61
61
  "@atlaskit/media-client-react": "^6.2.0",
62
62
  "@atlaskit/media-common": "^14.5.0",
63
- "@atlaskit/media-file-preview": "^1.2.0",
63
+ "@atlaskit/media-file-preview": "^1.3.0",
64
64
  "@atlaskit/media-picker": "^72.3.0",
65
65
  "@atlaskit/media-ui": "^30.13.0",
66
66
  "@atlaskit/media-viewer": "^54.6.0",
@@ -84,7 +84,7 @@
84
84
  "@atlaskit/task-decision": "^21.8.0",
85
85
  "@atlaskit/teams-app-config": "^3.0.0",
86
86
  "@atlaskit/textfield": "^10.1.0",
87
- "@atlaskit/tmp-editor-statsig": "^161.0.0",
87
+ "@atlaskit/tmp-editor-statsig": "^162.0.0",
88
88
  "@atlaskit/tokens": "^16.8.0",
89
89
  "@atlaskit/tooltip": "^24.2.0",
90
90
  "@atlaskit/width-detector": "^7.1.0",