@atlaskit/editor-common 137.0.0 → 137.1.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,31 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 137.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 137.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`9a4b8cfc2a3c5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9a4b8cfc2a3c5) -
14
+ Expose the optional product credit check through the AI plugin API. Check skill eligibility before
15
+ query removal in the registered menus using `quickInsert-skill` and `elementBrowser-skill`, with
16
+ product-owned recovery content. Respect the existing `confluence_ubp_quick_insert_menu` and
17
+ `jira_ai_ubp_enforcement_messaging` rollouts under `platform_editor_slash_command`.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
23
+ ## 137.0.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
3
29
  ## 137.0.0
4
30
 
5
31
  ### Major Changes
@@ -7,7 +7,12 @@ exports.checkAICreditStatus = void 0;
7
7
  /** Editor consumes cached decisions synchronously; legacy async providers fail open. */
8
8
  var checkAICreditStatus = exports.checkAICreditStatus = function checkAICreditStatus(getAICreditStatus, creditCheck) {
9
9
  try {
10
- var result = getAICreditStatus(creditCheck);
10
+ var result = getAICreditStatus === null || getAICreditStatus === void 0 ? void 0 : getAICreditStatus(creditCheck);
11
+ if (!result) {
12
+ return {
13
+ isBlocked: false
14
+ };
15
+ }
11
16
  if ('then' in result) {
12
17
  // Temporary compatibility: never defer an Editor action or apply a late decision.
13
18
  void result.catch(function () {});
@@ -23,11 +23,11 @@ var useAICreditGuard = exports.useAICreditGuard = function useAICreditGuard(getA
23
23
  return setFeedback(null);
24
24
  }, []);
25
25
  (0, _react.useLayoutEffect)(function () {
26
- if (!isActive) {
26
+ if (!isActive || getAICreditStatus === undefined) {
27
27
  close();
28
28
  setIsBlocked(false);
29
29
  }
30
- }, [isActive, close]);
30
+ }, [getAICreditStatus, isActive, close]);
31
31
  var check = (0, _react.useCallback)(function (creditCheck) {
32
32
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
33
33
  _ref$showFeedback = _ref.showFeedback,
@@ -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 = "136.0.0";
30
+ var packageVersion = "137.1.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 = "136.0.0";
26
+ var packageVersion = "137.1.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -1,7 +1,12 @@
1
1
  /** Editor consumes cached decisions synchronously; legacy async providers fail open. */
2
2
  export const checkAICreditStatus = (getAICreditStatus, creditCheck) => {
3
3
  try {
4
- const result = getAICreditStatus(creditCheck);
4
+ const result = getAICreditStatus === null || getAICreditStatus === void 0 ? void 0 : getAICreditStatus(creditCheck);
5
+ if (!result) {
6
+ return {
7
+ isBlocked: false
8
+ };
9
+ }
5
10
  if ('then' in result) {
6
11
  // Temporary compatibility: never defer an Editor action or apply a late decision.
7
12
  void result.catch(() => {});
@@ -6,11 +6,11 @@ export const useAICreditGuard = (getAICreditStatus, isActive = true) => {
6
6
  const [isBlocked, setIsBlocked] = useState(false);
7
7
  const close = useCallback(() => setFeedback(null), []);
8
8
  useLayoutEffect(() => {
9
- if (!isActive) {
9
+ if (!isActive || getAICreditStatus === undefined) {
10
10
  close();
11
11
  setIsBlocked(false);
12
12
  }
13
- }, [isActive, close]);
13
+ }, [getAICreditStatus, isActive, close]);
14
14
  const check = useCallback((creditCheck, {
15
15
  showFeedback = true
16
16
  } = {}) => {
@@ -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 = "136.0.0";
16
+ const packageVersion = "137.1.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 = "136.0.0";
16
+ const packageVersion = "137.1.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -1,7 +1,12 @@
1
1
  /** Editor consumes cached decisions synchronously; legacy async providers fail open. */
2
2
  export var checkAICreditStatus = function checkAICreditStatus(getAICreditStatus, creditCheck) {
3
3
  try {
4
- var result = getAICreditStatus(creditCheck);
4
+ var result = getAICreditStatus === null || getAICreditStatus === void 0 ? void 0 : getAICreditStatus(creditCheck);
5
+ if (!result) {
6
+ return {
7
+ isBlocked: false
8
+ };
9
+ }
5
10
  if ('then' in result) {
6
11
  // Temporary compatibility: never defer an Editor action or apply a late decision.
7
12
  void result.catch(function () {});
@@ -16,11 +16,11 @@ export var useAICreditGuard = function useAICreditGuard(getAICreditStatus) {
16
16
  return setFeedback(null);
17
17
  }, []);
18
18
  useLayoutEffect(function () {
19
- if (!isActive) {
19
+ if (!isActive || getAICreditStatus === undefined) {
20
20
  close();
21
21
  setIsBlocked(false);
22
22
  }
23
- }, [isActive, close]);
23
+ }, [getAICreditStatus, isActive, close]);
24
24
  var check = useCallback(function (creditCheck) {
25
25
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
26
26
  _ref$showFeedback = _ref.showFeedback,
@@ -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 = "136.0.0";
22
+ var packageVersion = "137.1.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 = "136.0.0";
23
+ var packageVersion = "137.1.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -1,3 +1,4 @@
1
1
  import type { AICreditCheck, AICreditStatus, GetAICreditStatus } from './types';
2
+ export type AICreditStatusReader = (context: AICreditCheck) => ReturnType<GetAICreditStatus> | undefined;
2
3
  /** Editor consumes cached decisions synchronously; legacy async providers fail open. */
3
- export declare const checkAICreditStatus: (getAICreditStatus: GetAICreditStatus, creditCheck: AICreditCheck) => AICreditStatus;
4
+ export declare const checkAICreditStatus: (getAICreditStatus: AICreditStatusReader | undefined, creditCheck: AICreditCheck) => AICreditStatus;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- export type EditorAICreditFeatureName = 'blockMenu-askRovo' | 'blockMenu-remix' | 'selectionToolbar-askRovo' | 'selectionToolbar-remix' | 'commentEditor-askRovo' | 'quickInsert-askRovo' | 'elementBrowser-askRovo' | 'panelFloatingToolbar-remix' | 'primaryToolbar-write' | 'mediaFloatingToolbar-editImage' | 'tableFloatingToolbar-remix' | 'smartLinkFloatingToolbar-askRovo' | 'codeBlockFloatingToolbar-remix' | 'expandFloatingToolbar-remix' | 'layoutFloatingToolbar-remix' | 'nativeTabsFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-askRovo' | 'imageGenerationMediaInsert' | 'blockControls-remix';
2
+ export type EditorAICreditFeatureName = 'blockMenu-askRovo' | 'blockMenu-remix' | 'selectionToolbar-askRovo' | 'selectionToolbar-remix' | 'commentEditor-askRovo' | 'quickInsert-askRovo' | 'quickInsert-skill' | 'elementBrowser-askRovo' | 'elementBrowser-skill' | 'panelFloatingToolbar-remix' | 'primaryToolbar-write' | 'mediaFloatingToolbar-editImage' | 'tableFloatingToolbar-remix' | 'smartLinkFloatingToolbar-askRovo' | 'codeBlockFloatingToolbar-remix' | 'expandFloatingToolbar-remix' | 'layoutFloatingToolbar-remix' | 'nativeTabsFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-askRovo' | 'imageGenerationMediaInsert' | 'blockControls-remix';
3
3
  export type AICreditCheck = {
4
4
  featureName: EditorAICreditFeatureName;
5
5
  };
@@ -1,4 +1,5 @@
1
- import type { AICreditCheck, AICreditStatus, GetAICreditStatus } from './types';
1
+ import type { AICreditStatusReader } from './checkAICreditStatus';
2
+ import type { AICreditCheck, AICreditStatus } from './types';
2
3
  type CreditStatus = AICreditStatus;
3
4
  export type BlockedCreditStatus = Extract<CreditStatus, {
4
5
  isBlocked: true;
@@ -12,5 +13,5 @@ export type AICreditGuard = {
12
13
  isBlocked: boolean;
13
14
  };
14
15
  /** Shares advisory checks and feedback state without owning action execution or selection. */
15
- export declare const useAICreditGuard: (getAICreditStatus: GetAICreditStatus, isActive?: boolean) => AICreditGuard;
16
+ export declare const useAICreditGuard: (getAICreditStatus?: AICreditStatusReader, isActive?: boolean) => AICreditGuard;
16
17
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "137.0.0",
3
+ "version": "137.1.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/"
@@ -81,14 +81,14 @@
81
81
  "@atlaskit/react-compiler-gating": "^0.2.0",
82
82
  "@atlaskit/react-ufo": "^8.5.0",
83
83
  "@atlaskit/section-message": "^10.3.0",
84
- "@atlaskit/smart-card": "^46.18.0",
84
+ "@atlaskit/smart-card": "^46.19.0",
85
85
  "@atlaskit/smart-user-picker": "^12.14.0",
86
86
  "@atlaskit/spinner": "^20.4.0",
87
87
  "@atlaskit/task-decision": "^21.16.0",
88
88
  "@atlaskit/teams-app-config": "^3.1.0",
89
- "@atlaskit/textfield": "^10.3.0",
90
- "@atlaskit/tmp-editor-statsig": "^264.0.0",
91
- "@atlaskit/tokens": "^20.12.0",
89
+ "@atlaskit/textfield": "^11.0.0",
90
+ "@atlaskit/tmp-editor-statsig": "^265.0.0",
91
+ "@atlaskit/tokens": "^20.13.0",
92
92
  "@atlaskit/tooltip": "^24.4.0",
93
93
  "@atlaskit/width-detector": "^7.2.0",
94
94
  "@babel/runtime": "^7.0.0",