@atlaskit/editor-common 110.18.8 → 110.19.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 (40) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/experiences/Experience.js +1 -1
  3. package/dist/cjs/experiences/experience-utils.js +38 -0
  4. package/dist/cjs/experiences/index.js +14 -1
  5. package/dist/cjs/messages/track-changes.js +5 -0
  6. package/dist/cjs/monitoring/error.js +1 -1
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/user-intent/UserIntentPopupWrapper.js +5 -2
  9. package/dist/cjs/user-intent/types.js +1 -0
  10. package/dist/es2019/experiences/Experience.js +1 -1
  11. package/dist/es2019/experiences/experience-utils.js +32 -0
  12. package/dist/es2019/experiences/index.js +2 -1
  13. package/dist/es2019/messages/track-changes.js +5 -0
  14. package/dist/es2019/monitoring/error.js +1 -1
  15. package/dist/es2019/ui/DropList/index.js +1 -1
  16. package/dist/es2019/user-intent/UserIntentPopupWrapper.js +3 -1
  17. package/dist/es2019/user-intent/types.js +0 -0
  18. package/dist/esm/experiences/Experience.js +1 -1
  19. package/dist/esm/experiences/experience-utils.js +32 -0
  20. package/dist/esm/experiences/index.js +2 -1
  21. package/dist/esm/messages/track-changes.js +5 -0
  22. package/dist/esm/monitoring/error.js +1 -1
  23. package/dist/esm/ui/DropList/index.js +1 -1
  24. package/dist/esm/user-intent/UserIntentPopupWrapper.js +5 -2
  25. package/dist/esm/user-intent/types.js +0 -0
  26. package/dist/types/experiences/experience-utils.d.ts +15 -0
  27. package/dist/types/experiences/index.d.ts +1 -0
  28. package/dist/types/messages/track-changes.d.ts +5 -0
  29. package/dist/types/types/floating-toolbar.d.ts +2 -1
  30. package/dist/types/user-intent/UserIntentPopupWrapper.d.ts +3 -1
  31. package/dist/types/user-intent/index.d.ts +1 -0
  32. package/dist/types/user-intent/types.d.ts +1 -0
  33. package/dist/types-ts4.5/experiences/experience-utils.d.ts +15 -0
  34. package/dist/types-ts4.5/experiences/index.d.ts +1 -0
  35. package/dist/types-ts4.5/messages/track-changes.d.ts +5 -0
  36. package/dist/types-ts4.5/types/floating-toolbar.d.ts +2 -1
  37. package/dist/types-ts4.5/user-intent/UserIntentPopupWrapper.d.ts +3 -1
  38. package/dist/types-ts4.5/user-intent/index.d.ts +1 -0
  39. package/dist/types-ts4.5/user-intent/types.d.ts +1 -0
  40. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 110.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`28ba94dae8f9a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28ba94dae8f9a) -
8
+ [ux] EDITOR-2458 Replace usage of \_\_suppressAllToolbars with userIntentPlugin
9
+ - [`68caaf98e8f89`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/68caaf98e8f89) -
10
+ [ux] [EDITOR-1628] Added "Removed" Lozenge and gray border decorations to deleted block nodes in
11
+ show diff view
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 110.18.9
18
+
19
+ ### Patch Changes
20
+
21
+ - [`610bf07ab4a4f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/610bf07ab4a4f) -
22
+ ED-29611 Editor quick insert experience tracking
23
+ - Updated dependencies
24
+
3
25
  ## 110.18.8
4
26
 
5
27
  ### Patch Changes
@@ -88,7 +88,7 @@ var Experience = exports.Experience = /*#__PURE__*/function () {
88
88
  }, {
89
89
  key: "start",
90
90
  value: function start(options) {
91
- this.startOptions = options === null || options === void 0 ? void 0 : options.metadata;
91
+ this.startOptions = options;
92
92
  this.ufoExperience.start();
93
93
  if (this.isInProgress()) {
94
94
  this.startCheck();
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getPopupContainerFromEditorView = exports.containsPopupWithNestedElement = void 0;
7
+ /**
8
+ * Checks if a given node contains a popup with a nested element identified by a specific test ID.
9
+ *
10
+ * @param node - The node to check.
11
+ * @param nestedElementQuery - The query to look for the nested element.
12
+ * @returns True if the node contains the popup, false otherwise.
13
+ */
14
+ var containsPopupWithNestedElement = exports.containsPopupWithNestedElement = function containsPopupWithNestedElement(node, nestedElementQuery) {
15
+ if (!(node instanceof HTMLElement)) {
16
+ return false;
17
+ }
18
+
19
+ // Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
20
+ if (node.matches('[data-editor-popup="true"]')) {
21
+ return !!node.querySelector(nestedElementQuery);
22
+ }
23
+
24
+ // Check if any direct child with popup attribute contains the element matching the nestedElementQuery
25
+ return !!node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
26
+ };
27
+
28
+ /**
29
+ * Searches for the popup container element relative to the provided editor view element.
30
+ *
31
+ * @param editorViewEl - The editor view HTMLElement.
32
+ * @returns The popup container HTMLElement if found, otherwise undefined.
33
+ */
34
+ var getPopupContainerFromEditorView = exports.getPopupContainerFromEditorView = function getPopupContainerFromEditorView(editorViewEl) {
35
+ var editorContentArea = editorViewEl === null || editorViewEl === void 0 ? void 0 : editorViewEl.closest('.ak-editor-content-area');
36
+ var pluginsComponentsWrapper = editorContentArea === null || editorContentArea === void 0 ? void 0 : editorContentArea.querySelector(':scope > [data-testid="plugins-components-wrapper"]');
37
+ return pluginsComponentsWrapper || undefined;
38
+ };
@@ -33,8 +33,21 @@ Object.defineProperty(exports, "ExperienceCheckTimeout", {
33
33
  return _ExperienceCheckTimeout.ExperienceCheckTimeout;
34
34
  }
35
35
  });
36
+ Object.defineProperty(exports, "containsPopupWithNestedElement", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _experienceUtils.containsPopupWithNestedElement;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "getPopupContainerFromEditorView", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _experienceUtils.getPopupContainerFromEditorView;
46
+ }
47
+ });
36
48
  var _Experience = require("./Experience");
37
49
  var _consts = require("./consts");
38
50
  var _ExperienceCheckComposite = require("./ExperienceCheckComposite");
39
51
  var _ExperienceCheckDomMutation = require("./ExperienceCheckDomMutation");
40
- var _ExperienceCheckTimeout = require("./ExperienceCheckTimeout");
52
+ var _ExperienceCheckTimeout = require("./ExperienceCheckTimeout");
53
+ var _experienceUtils = require("./experience-utils");
@@ -10,5 +10,10 @@ var trackChangesMessages = exports.trackChangesMessages = (0, _reactIntlNext.def
10
10
  id: 'editor.trackChanges.toolbarIconLabel',
11
11
  defaultMessage: 'Track Changes',
12
12
  description: 'Label for the track changes toolbar icon'
13
+ },
14
+ removed: {
15
+ id: 'editor.trackChanges.removed',
16
+ defaultMessage: 'Removed',
17
+ description: 'Label for content that has been removed in track changes'
13
18
  }
14
19
  });
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "110.18.7";
19
+ var packageVersion = "110.18.9";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // 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 = "110.18.7";
27
+ var packageVersion = "110.18.9";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -5,16 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.UserIntentPopupWrapper = void 0;
7
7
  var _react = require("react");
8
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
8
9
  /**
9
10
  *
10
11
  * A wrapper for popups to signal popupOpen user intent
11
12
  */
12
13
  var UserIntentPopupWrapper = exports.UserIntentPopupWrapper = function UserIntentPopupWrapper(_ref) {
13
- var children = _ref.children,
14
+ var _ref$userIntent = _ref.userIntent,
15
+ userIntent = _ref$userIntent === void 0 ? 'popupOpen' : _ref$userIntent,
16
+ children = _ref.children,
14
17
  api = _ref.api;
15
18
  (0, _react.useEffect)(function () {
16
19
  var _api$userIntent;
17
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('popupOpen'));
20
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true) ? userIntent : 'popupOpen'));
18
21
  return function () {
19
22
  var _api$userIntent2;
20
23
  api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.commands.setCurrentUserIntent('default'));
@@ -0,0 +1 @@
1
+ "use strict";
@@ -66,7 +66,7 @@ export class Experience {
66
66
  * @param options.metadata - Optional metadata attached to all subsequent events for this started experience
67
67
  */
68
68
  start(options) {
69
- this.startOptions = options === null || options === void 0 ? void 0 : options.metadata;
69
+ this.startOptions = options;
70
70
  this.ufoExperience.start();
71
71
  if (this.isInProgress()) {
72
72
  this.startCheck();
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Checks if a given node contains a popup with a nested element identified by a specific test ID.
3
+ *
4
+ * @param node - The node to check.
5
+ * @param nestedElementQuery - The query to look for the nested element.
6
+ * @returns True if the node contains the popup, false otherwise.
7
+ */
8
+ export const containsPopupWithNestedElement = (node, nestedElementQuery) => {
9
+ if (!(node instanceof HTMLElement)) {
10
+ return false;
11
+ }
12
+
13
+ // Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
14
+ if (node.matches('[data-editor-popup="true"]')) {
15
+ return !!node.querySelector(nestedElementQuery);
16
+ }
17
+
18
+ // Check if any direct child with popup attribute contains the element matching the nestedElementQuery
19
+ return !!node.querySelector(`:scope > [data-editor-popup="true"] ${nestedElementQuery}`);
20
+ };
21
+
22
+ /**
23
+ * Searches for the popup container element relative to the provided editor view element.
24
+ *
25
+ * @param editorViewEl - The editor view HTMLElement.
26
+ * @returns The popup container HTMLElement if found, otherwise undefined.
27
+ */
28
+ export const getPopupContainerFromEditorView = editorViewEl => {
29
+ const editorContentArea = editorViewEl === null || editorViewEl === void 0 ? void 0 : editorViewEl.closest('.ak-editor-content-area');
30
+ const pluginsComponentsWrapper = editorContentArea === null || editorContentArea === void 0 ? void 0 : editorContentArea.querySelector(':scope > [data-testid="plugins-components-wrapper"]');
31
+ return pluginsComponentsWrapper || undefined;
32
+ };
@@ -5,4 +5,5 @@ export { Experience } from './Experience';
5
5
  export { EXPERIENCE_FAILURE_REASON } from './consts';
6
6
  export { ExperienceCheckComposite } from './ExperienceCheckComposite';
7
7
  export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
8
- export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
8
+ export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
9
+ export { containsPopupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
@@ -4,5 +4,10 @@ export const trackChangesMessages = defineMessages({
4
4
  id: 'editor.trackChanges.toolbarIconLabel',
5
5
  defaultMessage: 'Track Changes',
6
6
  description: 'Label for the track changes toolbar icon'
7
+ },
8
+ removed: {
9
+ id: 'editor.trackChanges.removed',
10
+ defaultMessage: 'Removed',
11
+ description: 'Label for content that has been removed in track changes'
7
12
  }
8
13
  });
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "110.18.7";
4
+ const packageVersion = "110.18.9";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // 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 = "110.18.7";
17
+ const packageVersion = "110.18.9";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,15 +1,17 @@
1
1
  import { useEffect } from 'react';
2
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
2
3
  /**
3
4
  *
4
5
  * A wrapper for popups to signal popupOpen user intent
5
6
  */
6
7
  export const UserIntentPopupWrapper = ({
8
+ userIntent = 'popupOpen',
7
9
  children,
8
10
  api
9
11
  }) => {
10
12
  useEffect(() => {
11
13
  var _api$userIntent;
12
- api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('popupOpen'));
14
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent(expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? userIntent : 'popupOpen'));
13
15
  return () => {
14
16
  var _api$userIntent2;
15
17
  api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.commands.setCurrentUserIntent('default'));
File without changes
@@ -81,7 +81,7 @@ export var Experience = /*#__PURE__*/function () {
81
81
  }, {
82
82
  key: "start",
83
83
  value: function start(options) {
84
- this.startOptions = options === null || options === void 0 ? void 0 : options.metadata;
84
+ this.startOptions = options;
85
85
  this.ufoExperience.start();
86
86
  if (this.isInProgress()) {
87
87
  this.startCheck();
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Checks if a given node contains a popup with a nested element identified by a specific test ID.
3
+ *
4
+ * @param node - The node to check.
5
+ * @param nestedElementQuery - The query to look for the nested element.
6
+ * @returns True if the node contains the popup, false otherwise.
7
+ */
8
+ export var containsPopupWithNestedElement = function containsPopupWithNestedElement(node, nestedElementQuery) {
9
+ if (!(node instanceof HTMLElement)) {
10
+ return false;
11
+ }
12
+
13
+ // Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
14
+ if (node.matches('[data-editor-popup="true"]')) {
15
+ return !!node.querySelector(nestedElementQuery);
16
+ }
17
+
18
+ // Check if any direct child with popup attribute contains the element matching the nestedElementQuery
19
+ return !!node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
20
+ };
21
+
22
+ /**
23
+ * Searches for the popup container element relative to the provided editor view element.
24
+ *
25
+ * @param editorViewEl - The editor view HTMLElement.
26
+ * @returns The popup container HTMLElement if found, otherwise undefined.
27
+ */
28
+ export var getPopupContainerFromEditorView = function getPopupContainerFromEditorView(editorViewEl) {
29
+ var editorContentArea = editorViewEl === null || editorViewEl === void 0 ? void 0 : editorViewEl.closest('.ak-editor-content-area');
30
+ var pluginsComponentsWrapper = editorContentArea === null || editorContentArea === void 0 ? void 0 : editorContentArea.querySelector(':scope > [data-testid="plugins-components-wrapper"]');
31
+ return pluginsComponentsWrapper || undefined;
32
+ };
@@ -5,4 +5,5 @@ export { Experience } from './Experience';
5
5
  export { EXPERIENCE_FAILURE_REASON } from './consts';
6
6
  export { ExperienceCheckComposite } from './ExperienceCheckComposite';
7
7
  export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
8
- export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
8
+ export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
9
+ export { containsPopupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
@@ -4,5 +4,10 @@ export var trackChangesMessages = defineMessages({
4
4
  id: 'editor.trackChanges.toolbarIconLabel',
5
5
  defaultMessage: 'Track Changes',
6
6
  description: 'Label for the track changes toolbar icon'
7
+ },
8
+ removed: {
9
+ id: 'editor.trackChanges.removed',
10
+ defaultMessage: 'Removed',
11
+ description: 'Label for content that has been removed in track changes'
7
12
  }
8
13
  });
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "110.18.7";
10
+ var packageVersion = "110.18.9";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // 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 = "110.18.7";
24
+ var packageVersion = "110.18.9";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -1,14 +1,17 @@
1
1
  import { useEffect } from 'react';
2
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
2
3
  /**
3
4
  *
4
5
  * A wrapper for popups to signal popupOpen user intent
5
6
  */
6
7
  export var UserIntentPopupWrapper = function UserIntentPopupWrapper(_ref) {
7
- var children = _ref.children,
8
+ var _ref$userIntent = _ref.userIntent,
9
+ userIntent = _ref$userIntent === void 0 ? 'popupOpen' : _ref$userIntent,
10
+ children = _ref.children,
8
11
  api = _ref.api;
9
12
  useEffect(function () {
10
13
  var _api$userIntent;
11
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('popupOpen'));
14
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent(expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? userIntent : 'popupOpen'));
12
15
  return function () {
13
16
  var _api$userIntent2;
14
17
  api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.commands.setCurrentUserIntent('default'));
File without changes
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if a given node contains a popup with a nested element identified by a specific test ID.
3
+ *
4
+ * @param node - The node to check.
5
+ * @param nestedElementQuery - The query to look for the nested element.
6
+ * @returns True if the node contains the popup, false otherwise.
7
+ */
8
+ export declare const containsPopupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => boolean;
9
+ /**
10
+ * Searches for the popup container element relative to the provided editor view element.
11
+ *
12
+ * @param editorViewEl - The editor view HTMLElement.
13
+ * @returns The popup container HTMLElement if found, otherwise undefined.
14
+ */
15
+ export declare const getPopupContainerFromEditorView: (editorViewEl?: HTMLElement | null) => HTMLElement | undefined;
@@ -5,3 +5,4 @@ export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
5
5
  export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
6
6
  export type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult, } from './ExperienceCheck';
7
7
  export type { ExperienceCheckDomMutationConfig, ExperienceCheckDomMutationObserveConfig, ExperienceDomMutationCheckOptions, } from './ExperienceCheckDomMutation';
8
+ export { containsPopupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
@@ -4,4 +4,9 @@ export declare const trackChangesMessages: {
4
4
  defaultMessage: string;
5
5
  description: string;
6
6
  };
7
+ removed: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
7
12
  };
@@ -295,12 +295,13 @@ export type FloatingToolbarFallbackItem<T extends Object> = FloatingToolbarButto
295
295
  export type FloatingToolbarItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder | FloatingToolbarOverflowDropdown<T>;
296
296
  export interface FloatingToolbarConfig {
297
297
  /**
298
- * For internal use only, we will be depricating this API soon.
298
+ * [DO NOT USE] we are deprecating this API, changes replacing this state is under platform_editor_lovability_user_intent.
299
299
  * If any config has __suppressAllToolbars set to true, no floating toolbar will be rendered.
300
300
  * Use case:
301
301
  * When a node is nested inside a table and the cursor is inside of the nested node.
302
302
  * Nested node's toolbar is active. When table's menu opens, we provide table's config with
303
303
  * __suppressAllToolbars set to true.
304
+ * To hide floating toolbar, use user intent API instead.
304
305
  */
305
306
  __suppressAllToolbars?: boolean;
306
307
  /** Absolute offset of the toolbar */
@@ -1,9 +1,11 @@
1
1
  import type { ExtractInjectionAPI, NextEditorPlugin } from '../types';
2
+ import type { PopupUserIntent } from './types';
2
3
  /**
3
4
  *
4
5
  * A wrapper for popups to signal popupOpen user intent
5
6
  */
6
- export declare const UserIntentPopupWrapper: ({ children, api, }: {
7
+ export declare const UserIntentPopupWrapper: ({ userIntent, children, api, }: {
7
8
  api: ExtractInjectionAPI<NextEditorPlugin<any, any>> | undefined | null;
8
9
  children: React.ReactNode;
10
+ userIntent?: PopupUserIntent;
9
11
  }) => import("react").ReactNode;
@@ -1 +1,2 @@
1
1
  export { UserIntentPopupWrapper } from './UserIntentPopupWrapper';
2
+ export { type PopupUserIntent } from './types';
@@ -0,0 +1 @@
1
+ export type PopupUserIntent = 'popupOpen' | 'tablePopupOpen';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if a given node contains a popup with a nested element identified by a specific test ID.
3
+ *
4
+ * @param node - The node to check.
5
+ * @param nestedElementQuery - The query to look for the nested element.
6
+ * @returns True if the node contains the popup, false otherwise.
7
+ */
8
+ export declare const containsPopupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => boolean;
9
+ /**
10
+ * Searches for the popup container element relative to the provided editor view element.
11
+ *
12
+ * @param editorViewEl - The editor view HTMLElement.
13
+ * @returns The popup container HTMLElement if found, otherwise undefined.
14
+ */
15
+ export declare const getPopupContainerFromEditorView: (editorViewEl?: HTMLElement | null) => HTMLElement | undefined;
@@ -5,3 +5,4 @@ export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
5
5
  export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
6
6
  export type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult, } from './ExperienceCheck';
7
7
  export type { ExperienceCheckDomMutationConfig, ExperienceCheckDomMutationObserveConfig, ExperienceDomMutationCheckOptions, } from './ExperienceCheckDomMutation';
8
+ export { containsPopupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
@@ -4,4 +4,9 @@ export declare const trackChangesMessages: {
4
4
  defaultMessage: string;
5
5
  description: string;
6
6
  };
7
+ removed: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
7
12
  };
@@ -295,12 +295,13 @@ export type FloatingToolbarFallbackItem<T extends Object> = FloatingToolbarButto
295
295
  export type FloatingToolbarItem<T extends Object> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder | FloatingToolbarOverflowDropdown<T>;
296
296
  export interface FloatingToolbarConfig {
297
297
  /**
298
- * For internal use only, we will be depricating this API soon.
298
+ * [DO NOT USE] we are deprecating this API, changes replacing this state is under platform_editor_lovability_user_intent.
299
299
  * If any config has __suppressAllToolbars set to true, no floating toolbar will be rendered.
300
300
  * Use case:
301
301
  * When a node is nested inside a table and the cursor is inside of the nested node.
302
302
  * Nested node's toolbar is active. When table's menu opens, we provide table's config with
303
303
  * __suppressAllToolbars set to true.
304
+ * To hide floating toolbar, use user intent API instead.
304
305
  */
305
306
  __suppressAllToolbars?: boolean;
306
307
  /** Absolute offset of the toolbar */
@@ -1,9 +1,11 @@
1
1
  import type { ExtractInjectionAPI, NextEditorPlugin } from '../types';
2
+ import type { PopupUserIntent } from './types';
2
3
  /**
3
4
  *
4
5
  * A wrapper for popups to signal popupOpen user intent
5
6
  */
6
- export declare const UserIntentPopupWrapper: ({ children, api, }: {
7
+ export declare const UserIntentPopupWrapper: ({ userIntent, children, api, }: {
7
8
  api: ExtractInjectionAPI<NextEditorPlugin<any, any>> | undefined | null;
8
9
  children: React.ReactNode;
10
+ userIntent?: PopupUserIntent;
9
11
  }) => import("react").ReactNode;
@@ -1 +1,2 @@
1
1
  export { UserIntentPopupWrapper } from './UserIntentPopupWrapper';
2
+ export { type PopupUserIntent } from './types';
@@ -0,0 +1 @@
1
+ export type PopupUserIntent = 'popupOpen' | 'tablePopupOpen';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "110.18.8",
3
+ "version": "110.19.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/"
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/primitives": "^16.1.0",
74
74
  "@atlaskit/profilecard": "^24.20.0",
75
75
  "@atlaskit/prosemirror-history": "^0.2.0",
76
- "@atlaskit/react-ufo": "^4.12.0",
76
+ "@atlaskit/react-ufo": "^4.13.0",
77
77
  "@atlaskit/section-message": "^8.8.0",
78
78
  "@atlaskit/smart-card": "^43.4.0",
79
79
  "@atlaskit/smart-user-picker": "^8.4.0",
@@ -82,9 +82,9 @@
82
82
  "@atlaskit/task-decision": "^19.2.0",
83
83
  "@atlaskit/textfield": "^8.0.0",
84
84
  "@atlaskit/theme": "^21.0.0",
85
- "@atlaskit/tmp-editor-statsig": "^13.20.0",
85
+ "@atlaskit/tmp-editor-statsig": "^13.21.0",
86
86
  "@atlaskit/tokens": "^7.0.0",
87
- "@atlaskit/tooltip": "^20.6.0",
87
+ "@atlaskit/tooltip": "^20.7.0",
88
88
  "@atlaskit/ufo": "^0.4.0",
89
89
  "@atlaskit/width-detector": "^5.0.0",
90
90
  "@babel/runtime": "^7.0.0",