@atlaskit/editor-common 111.2.0 → 111.2.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 +7 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/experiences/experience-utils.js +22 -1
- package/dist/cjs/experiences/index.js +6 -0
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/experiences/experience-utils.js +21 -0
- package/dist/es2019/experiences/index.js +1 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/experiences/experience-utils.js +21 -0
- package/dist/esm/experiences/index.js +1 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/experiences/experience-utils.d.ts +8 -0
- package/dist/types/experiences/index.d.ts +1 -1
- package/dist/types/types/type-ahead.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/experiences/experience-utils.d.ts +8 -0
- package/dist/types-ts4.5/experiences/index.d.ts +1 -1
- package/dist/types-ts4.5/types/type-ahead.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`656adaeec9d0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/656adaeec9d0b) -
|
|
8
|
+
[ux] EDITOR-1665 add experience tracking for create sync block
|
|
9
|
+
|
|
3
10
|
## 111.2.0
|
|
4
11
|
|
|
5
12
|
### 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");
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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.
|
|
3
|
+
"version": "111.2.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/"
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"@atlaskit/react-ufo": "^4.16.0",
|
|
76
76
|
"@atlaskit/section-message": "^8.11.0",
|
|
77
77
|
"@atlaskit/smart-card": "^43.18.0",
|
|
78
|
-
"@atlaskit/smart-user-picker": "^8.
|
|
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.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^16.4.0",
|
|
85
85
|
"@atlaskit/tokens": "^9.0.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.11.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|