@atlaskit/editor-common 111.2.0 → 111.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,24 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`77df724ec737e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/77df724ec737e) -
8
+ [https://product-fabric.atlassian.net/browse/ED-28631](ED-28631) - cleanup the
9
+ platform_editor_smart_card_otp Statsig experiment
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 111.2.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [`656adaeec9d0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/656adaeec9d0b) -
20
+ [ux] EDITOR-1665 add experience tracking for create sync block
21
+
3
22
  ## 111.2.0
4
23
 
5
24
  ### Minor Changes
@@ -531,6 +531,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
531
531
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
532
532
  ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
533
533
  ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
534
+ ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
534
535
  ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
535
536
  ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
536
537
  ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getPopupContainerFromEditorView = exports.containsPopupWithNestedElement = void 0;
6
+ exports.popupWithNestedElement = exports.getPopupContainerFromEditorView = exports.containsPopupWithNestedElement = void 0;
7
7
  /**
8
8
  * Checks if a given node contains a popup with a nested element identified by a specific test ID.
9
9
  *
@@ -25,6 +25,27 @@ var containsPopupWithNestedElement = exports.containsPopupWithNestedElement = fu
25
25
  return !!node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
26
26
  };
27
27
 
28
+ /**
29
+ * Returns the popup with a nested element identified by a specific test ID if it exists.
30
+ *
31
+ * @param node - The node to check.
32
+ * @param nestedElementQuery - The query to look for the nested element.
33
+ * @returns Element if the node contains the popup, undefined otherwise.
34
+ */
35
+ var popupWithNestedElement = exports.popupWithNestedElement = function popupWithNestedElement(node, nestedElementQuery) {
36
+ if (!(node instanceof HTMLElement)) {
37
+ return undefined;
38
+ }
39
+
40
+ // Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
41
+ if (node.matches('[data-editor-popup="true"]')) {
42
+ return node.querySelector(nestedElementQuery);
43
+ }
44
+
45
+ // Check if any direct child with popup attribute contains the element matching the nestedElementQuery
46
+ return node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
47
+ };
48
+
28
49
  /**
29
50
  * Searches for the popup container element relative to the provided editor view element.
30
51
  *
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "getPopupContainerFromEditorView", {
51
51
  return _experienceUtils.getPopupContainerFromEditorView;
52
52
  }
53
53
  });
54
+ Object.defineProperty(exports, "popupWithNestedElement", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _experienceUtils.popupWithNestedElement;
58
+ }
59
+ });
54
60
  var _Experience = require("./Experience");
55
61
  var _consts = require("./consts");
56
62
  var _ExperienceCheckComposite = require("./ExperienceCheckComposite");
@@ -15,7 +15,6 @@ var _react = _interopRequireDefault(require("react"));
15
15
  var _classnames = _interopRequireDefault(require("classnames"));
16
16
  var _reResizable = require("re-resizable");
17
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
18
  var _analytics = require("../../analytics");
20
19
  var _styles = require("../../styles");
21
20
  var _utils = require("../../utils");
@@ -190,8 +189,7 @@ var Resizer = exports.default = /*#__PURE__*/function (_React$Component) {
190
189
  pointerEvents: 'none'
191
190
  };
192
191
  }
193
- var nonZeroWidth = (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) ? width || '100%' // In SSR width could be 0 initially
194
- : width;
192
+ var nonZeroWidth = width || '100%'; // In SSR width could be 0 initially
195
193
 
196
194
  // Ideally, Resizable would let you pass in the component rather than
197
195
  // the div. For now, we just apply the same styles using CSS
@@ -525,6 +525,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
525
525
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
526
526
  ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
527
527
  ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
528
+ ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
528
529
  ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
529
530
  ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
530
531
  ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
@@ -19,6 +19,27 @@ export const containsPopupWithNestedElement = (node, nestedElementQuery) => {
19
19
  return !!node.querySelector(`:scope > [data-editor-popup="true"] ${nestedElementQuery}`);
20
20
  };
21
21
 
22
+ /**
23
+ * Returns the popup with a nested element identified by a specific test ID if it exists.
24
+ *
25
+ * @param node - The node to check.
26
+ * @param nestedElementQuery - The query to look for the nested element.
27
+ * @returns Element if the node contains the popup, undefined otherwise.
28
+ */
29
+ export const popupWithNestedElement = (node, nestedElementQuery) => {
30
+ if (!(node instanceof HTMLElement)) {
31
+ return undefined;
32
+ }
33
+
34
+ // Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
35
+ if (node.matches('[data-editor-popup="true"]')) {
36
+ return node.querySelector(nestedElementQuery);
37
+ }
38
+
39
+ // Check if any direct child with popup attribute contains the element matching the nestedElementQuery
40
+ return node.querySelector(`:scope > [data-editor-popup="true"] ${nestedElementQuery}`);
41
+ };
42
+
22
43
  /**
23
44
  * Searches for the popup container element relative to the provided editor view element.
24
45
  *
@@ -6,4 +6,4 @@ export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON } from './consts';
6
6
  export { ExperienceCheckComposite } from './ExperienceCheckComposite';
7
7
  export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
8
8
  export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
9
- export { containsPopupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
9
+ export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
@@ -3,7 +3,6 @@ import React from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { Resizable } from 're-resizable';
5
5
  import { akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
8
7
  import { richMediaClassName } from '../../styles';
9
8
  import { gridTypeForLayout } from '../../utils';
@@ -181,8 +180,7 @@ export default class Resizer extends React.Component {
181
180
  pointerEvents: 'none'
182
181
  };
183
182
  }
184
- const nonZeroWidth = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) ? width || '100%' // In SSR width could be 0 initially
185
- : width;
183
+ const nonZeroWidth = width || '100%'; // In SSR width could be 0 initially
186
184
 
187
185
  // Ideally, Resizable would let you pass in the component rather than
188
186
  // the div. For now, we just apply the same styles using CSS
@@ -525,6 +525,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
525
525
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
526
526
  ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
527
527
  ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
528
+ ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
528
529
  ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
529
530
  ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
530
531
  ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
@@ -19,6 +19,27 @@ export var containsPopupWithNestedElement = function containsPopupWithNestedElem
19
19
  return !!node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
20
20
  };
21
21
 
22
+ /**
23
+ * Returns the popup with a nested element identified by a specific test ID if it exists.
24
+ *
25
+ * @param node - The node to check.
26
+ * @param nestedElementQuery - The query to look for the nested element.
27
+ * @returns Element if the node contains the popup, undefined otherwise.
28
+ */
29
+ export var popupWithNestedElement = function popupWithNestedElement(node, nestedElementQuery) {
30
+ if (!(node instanceof HTMLElement)) {
31
+ return undefined;
32
+ }
33
+
34
+ // Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
35
+ if (node.matches('[data-editor-popup="true"]')) {
36
+ return node.querySelector(nestedElementQuery);
37
+ }
38
+
39
+ // Check if any direct child with popup attribute contains the element matching the nestedElementQuery
40
+ return node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
41
+ };
42
+
22
43
  /**
23
44
  * Searches for the popup container element relative to the provided editor view element.
24
45
  *
@@ -6,4 +6,4 @@ export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON } from './consts';
6
6
  export { ExperienceCheckComposite } from './ExperienceCheckComposite';
7
7
  export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
8
8
  export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
9
- export { containsPopupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
9
+ export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
@@ -12,7 +12,6 @@ import React from 'react';
12
12
  import classnames from 'classnames';
13
13
  import { Resizable } from 're-resizable';
14
14
  import { akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
15
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
15
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
17
16
  import { richMediaClassName } from '../../styles';
18
17
  import { gridTypeForLayout } from '../../utils';
@@ -183,8 +182,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
183
182
  pointerEvents: 'none'
184
183
  };
185
184
  }
186
- var nonZeroWidth = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) ? width || '100%' // In SSR width could be 0 initially
187
- : width;
185
+ var nonZeroWidth = width || '100%'; // In SSR width could be 0 initially
188
186
 
189
187
  // Ideally, Resizable would let you pass in the component rather than
190
188
  // the div. For now, we just apply the same styles using CSS
@@ -517,6 +517,7 @@ export declare enum ACTION_SUBJECT_ID {
517
517
  SYNCED_BLOCK_UPDATE = "syncedBlockUpdate",
518
518
  REFERENCE_SYNCED_BLOCK_UPDATE = "referenceSyncedBlockUpdate",
519
519
  SYNCED_BLOCK_CREATE = "syncedBlockCreate",
520
+ REFERENCE_SYNCED_BLOCK_CREATE = "referenceSyncedBlockCreate",
520
521
  SYNCED_BLOCK_DELETE = "syncedBlockDelete",
521
522
  SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
522
523
  SYNCED_BLOCK_FETCH = "syncedBlockFetch"
@@ -6,6 +6,14 @@
6
6
  * @returns True if the node contains the popup, false otherwise.
7
7
  */
8
8
  export declare const containsPopupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => boolean;
9
+ /**
10
+ * Returns the popup with a nested element identified by a specific test ID if it exists.
11
+ *
12
+ * @param node - The node to check.
13
+ * @param nestedElementQuery - The query to look for the nested element.
14
+ * @returns Element if the node contains the popup, undefined otherwise.
15
+ */
16
+ export declare const popupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => Element | null | undefined;
9
17
  /**
10
18
  * Searches for the popup container element relative to the provided editor view element.
11
19
  *
@@ -5,4 +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';
8
+ export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
@@ -41,6 +41,7 @@ export type TypeAheadItem = {
41
41
  keyshortcut?: string;
42
42
  lozenge?: ReactNode;
43
43
  render?: (props: TypeAheadItemRenderProps) => React.ReactElement<TypeAheadItemRenderProps> | null;
44
+ testId?: string;
44
45
  title: string;
45
46
  };
46
47
  export type TypeAheadForceSelect = (props: TypeAheadForceSelectProps) => TypeAheadItem | undefined;
@@ -517,6 +517,7 @@ export declare enum ACTION_SUBJECT_ID {
517
517
  SYNCED_BLOCK_UPDATE = "syncedBlockUpdate",
518
518
  REFERENCE_SYNCED_BLOCK_UPDATE = "referenceSyncedBlockUpdate",
519
519
  SYNCED_BLOCK_CREATE = "syncedBlockCreate",
520
+ REFERENCE_SYNCED_BLOCK_CREATE = "referenceSyncedBlockCreate",
520
521
  SYNCED_BLOCK_DELETE = "syncedBlockDelete",
521
522
  SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
522
523
  SYNCED_BLOCK_FETCH = "syncedBlockFetch"
@@ -6,6 +6,14 @@
6
6
  * @returns True if the node contains the popup, false otherwise.
7
7
  */
8
8
  export declare const containsPopupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => boolean;
9
+ /**
10
+ * Returns the popup with a nested element identified by a specific test ID if it exists.
11
+ *
12
+ * @param node - The node to check.
13
+ * @param nestedElementQuery - The query to look for the nested element.
14
+ * @returns Element if the node contains the popup, undefined otherwise.
15
+ */
16
+ export declare const popupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => Element | null | undefined;
9
17
  /**
10
18
  * Searches for the popup container element relative to the provided editor view element.
11
19
  *
@@ -5,4 +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';
8
+ export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
@@ -41,6 +41,7 @@ export type TypeAheadItem = {
41
41
  keyshortcut?: string;
42
42
  lozenge?: ReactNode;
43
43
  render?: (props: TypeAheadItemRenderProps) => React.ReactElement<TypeAheadItemRenderProps> | null;
44
+ testId?: string;
44
45
  title: string;
45
46
  };
46
47
  export type TypeAheadForceSelect = (props: TypeAheadForceSelectProps) => TypeAheadItem | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.2.0",
3
+ "version": "111.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/"
@@ -74,15 +74,15 @@
74
74
  "@atlaskit/prosemirror-history": "^0.2.0",
75
75
  "@atlaskit/react-ufo": "^4.16.0",
76
76
  "@atlaskit/section-message": "^8.11.0",
77
- "@atlaskit/smart-card": "^43.18.0",
78
- "@atlaskit/smart-user-picker": "^8.5.0",
77
+ "@atlaskit/smart-card": "^43.19.0",
78
+ "@atlaskit/smart-user-picker": "^8.6.0",
79
79
  "@atlaskit/spinner": "^19.0.0",
80
80
  "@atlaskit/status": "^3.0.0",
81
81
  "@atlaskit/task-decision": "^19.2.0",
82
82
  "@atlaskit/textfield": "^8.2.0",
83
83
  "@atlaskit/theme": "^21.0.0",
84
- "@atlaskit/tmp-editor-statsig": "^16.3.0",
85
- "@atlaskit/tokens": "^9.0.0",
84
+ "@atlaskit/tmp-editor-statsig": "^16.6.0",
85
+ "@atlaskit/tokens": "^9.1.0",
86
86
  "@atlaskit/tooltip": "^20.11.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",
88
88
  "@babel/runtime": "^7.0.0",