@atlaskit/editor-common 110.15.1 → 110.15.2
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 +10 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-dev-agents/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-passionfruit/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/afm-rovo-extension/tsconfig.json +3 -0
- package/afm-townsquare/tsconfig.json +3 -0
- package/dist/cjs/block-menu/block-link.js +40 -0
- package/dist/cjs/block-menu/index.js +20 -1
- package/dist/cjs/experiences/Experience.js +110 -0
- package/dist/cjs/experiences/ExperienceCheck.js +1 -0
- package/dist/cjs/experiences/ExperienceCheckComposite.js +35 -0
- package/dist/cjs/experiences/ExperienceCheckDomMutation.js +68 -0
- package/dist/cjs/experiences/ExperienceCheckTimeout.js +41 -0
- package/dist/cjs/experiences/consts.js +26 -0
- package/dist/cjs/experiences/index.js +40 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +2 -0
- package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
- package/dist/es2019/block-menu/block-link.js +32 -0
- package/dist/es2019/block-menu/index.js +2 -1
- package/dist/es2019/experiences/Experience.js +80 -0
- package/dist/es2019/experiences/ExperienceCheck.js +0 -0
- package/dist/es2019/experiences/ExperienceCheckComposite.js +16 -0
- package/dist/es2019/experiences/ExperienceCheckDomMutation.js +55 -0
- package/dist/es2019/experiences/ExperienceCheckTimeout.js +26 -0
- package/dist/es2019/experiences/consts.js +20 -0
- package/dist/es2019/experiences/index.js +8 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +2 -0
- package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +2 -0
- package/dist/esm/block-menu/block-link.js +34 -0
- package/dist/esm/block-menu/index.js +2 -1
- package/dist/esm/experiences/Experience.js +103 -0
- package/dist/esm/experiences/ExperienceCheck.js +0 -0
- package/dist/esm/experiences/ExperienceCheckComposite.js +28 -0
- package/dist/esm/experiences/ExperienceCheckDomMutation.js +61 -0
- package/dist/esm/experiences/ExperienceCheckTimeout.js +34 -0
- package/dist/esm/experiences/consts.js +20 -0
- package/dist/esm/experiences/index.js +8 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +2 -0
- package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +2 -0
- package/dist/types/block-menu/block-link.d.ts +17 -0
- package/dist/types/block-menu/index.d.ts +1 -0
- package/dist/types/experiences/Experience.d.ts +41 -0
- package/dist/types/experiences/ExperienceCheck.d.ts +14 -0
- package/dist/types/experiences/ExperienceCheckComposite.d.ts +12 -0
- package/dist/types/experiences/ExperienceCheckDomMutation.d.ts +53 -0
- package/dist/types/experiences/ExperienceCheckTimeout.d.ts +13 -0
- package/dist/types/experiences/consts.d.ts +20 -0
- package/dist/types/experiences/index.d.ts +7 -0
- package/dist/types-ts4.5/block-menu/block-link.d.ts +17 -0
- package/dist/types-ts4.5/block-menu/index.d.ts +1 -0
- package/dist/types-ts4.5/experiences/Experience.d.ts +41 -0
- package/dist/types-ts4.5/experiences/ExperienceCheck.d.ts +14 -0
- package/dist/types-ts4.5/experiences/ExperienceCheckComposite.d.ts +12 -0
- package/dist/types-ts4.5/experiences/ExperienceCheckDomMutation.d.ts +53 -0
- package/dist/types-ts4.5/experiences/ExperienceCheckTimeout.d.ts +13 -0
- package/dist/types-ts4.5/experiences/consts.d.ts +20 -0
- package/dist/types-ts4.5/experiences/index.d.ts +7 -0
- package/experiences/package.json +17 -0
- package/package.json +4 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ExperienceCheck } from './ExperienceCheck';
|
|
2
|
+
type ExperienceOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Checks used to determine experience completion, either success, or failure.
|
|
5
|
+
*/
|
|
6
|
+
checks?: ExperienceCheck[];
|
|
7
|
+
};
|
|
8
|
+
type ExperienceFailureOptions = {
|
|
9
|
+
reason?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare class Experience {
|
|
12
|
+
private readonly id;
|
|
13
|
+
private readonly options;
|
|
14
|
+
private _ufoExperience;
|
|
15
|
+
private check;
|
|
16
|
+
constructor(id: string, options?: ExperienceOptions);
|
|
17
|
+
private get ufoExperience();
|
|
18
|
+
private startCheck;
|
|
19
|
+
private stopCheck;
|
|
20
|
+
private isInProgress;
|
|
21
|
+
/**
|
|
22
|
+
* Starts UFO experience tracking and starts all checks which monitor for completion of the experience.
|
|
23
|
+
*/
|
|
24
|
+
start(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Manually mark the experience as successful and stop any ongoing checks.
|
|
27
|
+
*/
|
|
28
|
+
success(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Manually abort the experience and stop any ongoing checks.
|
|
31
|
+
*
|
|
32
|
+
* Typically used when the experience did not complete due to user action and should not be marked as success or failure,
|
|
33
|
+
* for example on unmount or when navigating away from a page.
|
|
34
|
+
*/
|
|
35
|
+
abort(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Manually mark the experience as failed and stop any ongoing checks.
|
|
38
|
+
*/
|
|
39
|
+
failure({ reason }?: ExperienceFailureOptions): void;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type ExperienceCheckSuccessResult = {
|
|
2
|
+
status: 'success';
|
|
3
|
+
};
|
|
4
|
+
type ExperienceCheckFailureResult = {
|
|
5
|
+
reason?: string;
|
|
6
|
+
status: 'failure';
|
|
7
|
+
};
|
|
8
|
+
export type ExperienceCheckResult = ExperienceCheckSuccessResult | ExperienceCheckFailureResult;
|
|
9
|
+
export type ExperienceCheckCallback = (result: ExperienceCheckResult) => void;
|
|
10
|
+
export interface ExperienceCheck {
|
|
11
|
+
start: (callback: ExperienceCheckCallback) => void;
|
|
12
|
+
stop: () => void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExperienceCheck, ExperienceCheckCallback } from './ExperienceCheck';
|
|
2
|
+
/**
|
|
3
|
+
* Composite check that combines multiple checks.
|
|
4
|
+
*
|
|
5
|
+
* Starts and stops all contained checks.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExperienceCheckComposite implements ExperienceCheck {
|
|
8
|
+
private checks;
|
|
9
|
+
constructor(checks: ExperienceCheck[]);
|
|
10
|
+
start(callback: ExperienceCheckCallback): void;
|
|
11
|
+
stop(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult } from './ExperienceCheck';
|
|
2
|
+
export type ExperienceDomMutationCheckOptions = {
|
|
3
|
+
mutations: MutationRecord[];
|
|
4
|
+
};
|
|
5
|
+
export type ExperienceCheckDomMutationObserveConfig = {
|
|
6
|
+
/**
|
|
7
|
+
* MutationObserver options specifying what types of mutations to observe
|
|
8
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe
|
|
9
|
+
*/
|
|
10
|
+
options: MutationObserverInit;
|
|
11
|
+
/**
|
|
12
|
+
* Target element to observe for mutations
|
|
13
|
+
*/
|
|
14
|
+
target: Node;
|
|
15
|
+
};
|
|
16
|
+
export type ExperienceCheckDomMutationConfig = {
|
|
17
|
+
/**
|
|
18
|
+
* Callback that returns the MutationObserver configuration
|
|
19
|
+
*
|
|
20
|
+
* This is a callback to ensure consumers make explicit, conscious decisions about:
|
|
21
|
+
* - What element to observe (performance: smaller scope = better performance)
|
|
22
|
+
* - What mutations to monitor (performance: fewer types = better performance)
|
|
23
|
+
*
|
|
24
|
+
* IMPORTANT: Return null if the target element cannot be found.
|
|
25
|
+
* This will immediately fail the experience with reason 'target-not-found'.
|
|
26
|
+
*
|
|
27
|
+
* Common patterns:
|
|
28
|
+
* - Safe fallback: { target: document.querySelector('[data-testid="toolbar"]') ?? document.body, options: {...} }
|
|
29
|
+
* - Explicit null: const target = document.querySelector('[data-testid="toolbar"]'); return target ? { target, options: {...} } : null;
|
|
30
|
+
*/
|
|
31
|
+
observeConfig: () => ExperienceCheckDomMutationObserveConfig | null;
|
|
32
|
+
/**
|
|
33
|
+
* Callback invoked when DOM mutations are detected
|
|
34
|
+
* Return a result to complete the experience, or undefined to continue observing
|
|
35
|
+
*/
|
|
36
|
+
onDomMutation: (options: ExperienceDomMutationCheckOptions) => ExperienceCheckResult | undefined;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Check for the completion of an experience based on DOM mutations
|
|
40
|
+
*
|
|
41
|
+
* Uses a MutationObserver to monitor DOM changes and invokes the provided
|
|
42
|
+
* callback when relevant mutations are detected.
|
|
43
|
+
*
|
|
44
|
+
* Will result in success or failure based on the outcome of the callback.
|
|
45
|
+
*/
|
|
46
|
+
export declare class ExperienceCheckDomMutation implements ExperienceCheck {
|
|
47
|
+
private mutationObserver;
|
|
48
|
+
private onDomMutation;
|
|
49
|
+
private observeConfig;
|
|
50
|
+
constructor({ onDomMutation, observeConfig }: ExperienceCheckDomMutationConfig);
|
|
51
|
+
start(callback: ExperienceCheckCallback): void;
|
|
52
|
+
stop(): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ExperienceCheck, ExperienceCheckCallback } from './ExperienceCheck';
|
|
2
|
+
/**
|
|
3
|
+
* Check for the completion of an experience based on a timeout
|
|
4
|
+
*
|
|
5
|
+
* Will always result in failure after the timeout duration
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExperienceCheckTimeout implements ExperienceCheck {
|
|
8
|
+
private timeoutId;
|
|
9
|
+
private maxDurationMs;
|
|
10
|
+
constructor(maxDurationMs: number);
|
|
11
|
+
start(callback: ExperienceCheckCallback): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in failure reasons for experience checks
|
|
3
|
+
*
|
|
4
|
+
* These are used by the various ExperienceCheck implementations to
|
|
5
|
+
* provide consistent, well-known failure reasons for analytics and debugging.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EXPERIENCE_FAILURE_REASON: {
|
|
8
|
+
/**
|
|
9
|
+
* Experience timed out before completion
|
|
10
|
+
*/
|
|
11
|
+
readonly TIMEOUT: "timeout";
|
|
12
|
+
/**
|
|
13
|
+
* Target element could not be found when starting DOM mutation observation
|
|
14
|
+
*/
|
|
15
|
+
readonly DOM_MUTATION_TARGET_NOT_FOUND: "dom-mutation-target-not-found";
|
|
16
|
+
/**
|
|
17
|
+
* Error occurred during DOM mutation check execution
|
|
18
|
+
*/
|
|
19
|
+
readonly DOM_MUTATION_CHECK_ERROR: "dom-mutation-check-error";
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Experience } from './Experience';
|
|
2
|
+
export { EXPERIENCE_FAILURE_REASON } from './consts';
|
|
3
|
+
export { ExperienceCheckComposite } from './ExperienceCheckComposite';
|
|
4
|
+
export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
|
|
5
|
+
export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
|
|
6
|
+
export type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult, } from './ExperienceCheck';
|
|
7
|
+
export type { ExperienceCheckDomMutationConfig, ExperienceCheckDomMutationObserveConfig, ExperienceDomMutationCheckOptions, } from './ExperienceCheckDomMutation';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const DEFAULT_BLOCK_LINK_HASH_PREFIX = "block-";
|
|
2
|
+
/**
|
|
3
|
+
* Matches hashes that start with the block link prefix followed by a UUID
|
|
4
|
+
*
|
|
5
|
+
* @param hash The hash string to check (e.g., '#block-123e4567-e89b-12d3-a456-426614174000' or 'block-123e4567-e89b-12d3-a456-426614174000')
|
|
6
|
+
* @param prefix The prefix to look for (default is 'block-')
|
|
7
|
+
* @returns True if the hash matches the block link pattern, false otherwise
|
|
8
|
+
*/
|
|
9
|
+
export declare const isBlockLinkHash: (hash: string, prefix?: string) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the block ID from a block link hash.
|
|
12
|
+
*
|
|
13
|
+
* @param hash The hash string to extract the block ID from (e.g., '#block-123e4567-e89b-12d3-a456-426614174000' or 'block-123e4567-e89b-12d3-a456-426614174000')
|
|
14
|
+
* @param prefix The prefix to look for (default is 'block-')
|
|
15
|
+
* @returns The extracted block ID if the hash is valid, null otherwise
|
|
16
|
+
*/
|
|
17
|
+
export declare const extractBlockIdFromLinkHash: (hash: string, prefix?: string) => string | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { messages } from './messages';
|
|
2
2
|
export { FORMAT_HEADING_1_MENU_ITEM, FORMAT_HEADING_2_MENU_ITEM, FORMAT_HEADING_3_MENU_ITEM, FORMAT_HEADING_4_MENU_ITEM, FORMAT_HEADING_5_MENU_ITEM, FORMAT_HEADING_6_MENU_ITEM, FORMAT_PARAGRAPH_MENU_ITEM, FORMAT_QUOTE_MENU_ITEM, FORMAT_EXPAND_MENU_ITEM, FORMAT_LAYOUT_MENU_ITEM, FORMAT_PANEL_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_BULLETED_LIST_MENU_ITEM, FORMAT_NUMBERED_LIST_MENU_ITEM, FORMAT_TASK_LIST_MENU_ITEM, NESTED_FORMAT_MENU_SECTION, COPY_MENU_SECTION, DELETE_MENU_SECTION, MOVE_UP_DOWN_MENU_SECTION, FORMAT_MENU_ITEM, COPY_BLOCK_MENU_ITEM, COPY_LINK_MENU_ITEM, MOVE_UP_MENU_ITEM, MOVE_DOWN_MENU_ITEM, DELETE_MENU_ITEM, NESTED_FORMAT_MENU, PRIMARY_MENU_SECTION, ADD_BLOCKS_MENU_SECTION, CREATE_SYNCED_BLOCK_MENU_ITEM, } from './key';
|
|
3
3
|
export { FORMAT_NESTED_MENU_RANK, FORMAT_NESTED_MENU_RANK_REVISED, BLOCK_MENU_SECTION_RANK, PRIMARY_MENU_SECTION_RANK, COPY_MENU_SECTION_RANK, DELETE_SECTION_RANK, MOVE_BLOCK_SECTION_RANK, ADD_BLOCKS_MENU_SECTION_RANK, } from './rank';
|
|
4
|
+
export { DEFAULT_BLOCK_LINK_HASH_PREFIX, isBlockLinkHash, extractBlockIdFromLinkHash, } from './block-link';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ExperienceCheck } from './ExperienceCheck';
|
|
2
|
+
type ExperienceOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Checks used to determine experience completion, either success, or failure.
|
|
5
|
+
*/
|
|
6
|
+
checks?: ExperienceCheck[];
|
|
7
|
+
};
|
|
8
|
+
type ExperienceFailureOptions = {
|
|
9
|
+
reason?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare class Experience {
|
|
12
|
+
private readonly id;
|
|
13
|
+
private readonly options;
|
|
14
|
+
private _ufoExperience;
|
|
15
|
+
private check;
|
|
16
|
+
constructor(id: string, options?: ExperienceOptions);
|
|
17
|
+
private get ufoExperience();
|
|
18
|
+
private startCheck;
|
|
19
|
+
private stopCheck;
|
|
20
|
+
private isInProgress;
|
|
21
|
+
/**
|
|
22
|
+
* Starts UFO experience tracking and starts all checks which monitor for completion of the experience.
|
|
23
|
+
*/
|
|
24
|
+
start(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Manually mark the experience as successful and stop any ongoing checks.
|
|
27
|
+
*/
|
|
28
|
+
success(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Manually abort the experience and stop any ongoing checks.
|
|
31
|
+
*
|
|
32
|
+
* Typically used when the experience did not complete due to user action and should not be marked as success or failure,
|
|
33
|
+
* for example on unmount or when navigating away from a page.
|
|
34
|
+
*/
|
|
35
|
+
abort(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Manually mark the experience as failed and stop any ongoing checks.
|
|
38
|
+
*/
|
|
39
|
+
failure({ reason }?: ExperienceFailureOptions): void;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type ExperienceCheckSuccessResult = {
|
|
2
|
+
status: 'success';
|
|
3
|
+
};
|
|
4
|
+
type ExperienceCheckFailureResult = {
|
|
5
|
+
reason?: string;
|
|
6
|
+
status: 'failure';
|
|
7
|
+
};
|
|
8
|
+
export type ExperienceCheckResult = ExperienceCheckSuccessResult | ExperienceCheckFailureResult;
|
|
9
|
+
export type ExperienceCheckCallback = (result: ExperienceCheckResult) => void;
|
|
10
|
+
export interface ExperienceCheck {
|
|
11
|
+
start: (callback: ExperienceCheckCallback) => void;
|
|
12
|
+
stop: () => void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExperienceCheck, ExperienceCheckCallback } from './ExperienceCheck';
|
|
2
|
+
/**
|
|
3
|
+
* Composite check that combines multiple checks.
|
|
4
|
+
*
|
|
5
|
+
* Starts and stops all contained checks.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExperienceCheckComposite implements ExperienceCheck {
|
|
8
|
+
private checks;
|
|
9
|
+
constructor(checks: ExperienceCheck[]);
|
|
10
|
+
start(callback: ExperienceCheckCallback): void;
|
|
11
|
+
stop(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult } from './ExperienceCheck';
|
|
2
|
+
export type ExperienceDomMutationCheckOptions = {
|
|
3
|
+
mutations: MutationRecord[];
|
|
4
|
+
};
|
|
5
|
+
export type ExperienceCheckDomMutationObserveConfig = {
|
|
6
|
+
/**
|
|
7
|
+
* MutationObserver options specifying what types of mutations to observe
|
|
8
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe
|
|
9
|
+
*/
|
|
10
|
+
options: MutationObserverInit;
|
|
11
|
+
/**
|
|
12
|
+
* Target element to observe for mutations
|
|
13
|
+
*/
|
|
14
|
+
target: Node;
|
|
15
|
+
};
|
|
16
|
+
export type ExperienceCheckDomMutationConfig = {
|
|
17
|
+
/**
|
|
18
|
+
* Callback that returns the MutationObserver configuration
|
|
19
|
+
*
|
|
20
|
+
* This is a callback to ensure consumers make explicit, conscious decisions about:
|
|
21
|
+
* - What element to observe (performance: smaller scope = better performance)
|
|
22
|
+
* - What mutations to monitor (performance: fewer types = better performance)
|
|
23
|
+
*
|
|
24
|
+
* IMPORTANT: Return null if the target element cannot be found.
|
|
25
|
+
* This will immediately fail the experience with reason 'target-not-found'.
|
|
26
|
+
*
|
|
27
|
+
* Common patterns:
|
|
28
|
+
* - Safe fallback: { target: document.querySelector('[data-testid="toolbar"]') ?? document.body, options: {...} }
|
|
29
|
+
* - Explicit null: const target = document.querySelector('[data-testid="toolbar"]'); return target ? { target, options: {...} } : null;
|
|
30
|
+
*/
|
|
31
|
+
observeConfig: () => ExperienceCheckDomMutationObserveConfig | null;
|
|
32
|
+
/**
|
|
33
|
+
* Callback invoked when DOM mutations are detected
|
|
34
|
+
* Return a result to complete the experience, or undefined to continue observing
|
|
35
|
+
*/
|
|
36
|
+
onDomMutation: (options: ExperienceDomMutationCheckOptions) => ExperienceCheckResult | undefined;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Check for the completion of an experience based on DOM mutations
|
|
40
|
+
*
|
|
41
|
+
* Uses a MutationObserver to monitor DOM changes and invokes the provided
|
|
42
|
+
* callback when relevant mutations are detected.
|
|
43
|
+
*
|
|
44
|
+
* Will result in success or failure based on the outcome of the callback.
|
|
45
|
+
*/
|
|
46
|
+
export declare class ExperienceCheckDomMutation implements ExperienceCheck {
|
|
47
|
+
private mutationObserver;
|
|
48
|
+
private onDomMutation;
|
|
49
|
+
private observeConfig;
|
|
50
|
+
constructor({ onDomMutation, observeConfig }: ExperienceCheckDomMutationConfig);
|
|
51
|
+
start(callback: ExperienceCheckCallback): void;
|
|
52
|
+
stop(): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ExperienceCheck, ExperienceCheckCallback } from './ExperienceCheck';
|
|
2
|
+
/**
|
|
3
|
+
* Check for the completion of an experience based on a timeout
|
|
4
|
+
*
|
|
5
|
+
* Will always result in failure after the timeout duration
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExperienceCheckTimeout implements ExperienceCheck {
|
|
8
|
+
private timeoutId;
|
|
9
|
+
private maxDurationMs;
|
|
10
|
+
constructor(maxDurationMs: number);
|
|
11
|
+
start(callback: ExperienceCheckCallback): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in failure reasons for experience checks
|
|
3
|
+
*
|
|
4
|
+
* These are used by the various ExperienceCheck implementations to
|
|
5
|
+
* provide consistent, well-known failure reasons for analytics and debugging.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EXPERIENCE_FAILURE_REASON: {
|
|
8
|
+
/**
|
|
9
|
+
* Experience timed out before completion
|
|
10
|
+
*/
|
|
11
|
+
readonly TIMEOUT: "timeout";
|
|
12
|
+
/**
|
|
13
|
+
* Target element could not be found when starting DOM mutation observation
|
|
14
|
+
*/
|
|
15
|
+
readonly DOM_MUTATION_TARGET_NOT_FOUND: "dom-mutation-target-not-found";
|
|
16
|
+
/**
|
|
17
|
+
* Error occurred during DOM mutation check execution
|
|
18
|
+
*/
|
|
19
|
+
readonly DOM_MUTATION_CHECK_ERROR: "dom-mutation-check-error";
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Experience } from './Experience';
|
|
2
|
+
export { EXPERIENCE_FAILURE_REASON } from './consts';
|
|
3
|
+
export { ExperienceCheckComposite } from './ExperienceCheckComposite';
|
|
4
|
+
export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
|
|
5
|
+
export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
|
|
6
|
+
export type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult, } from './ExperienceCheck';
|
|
7
|
+
export type { ExperienceCheckDomMutationConfig, ExperienceCheckDomMutationObserveConfig, ExperienceDomMutationCheckOptions, } from './ExperienceCheckDomMutation';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/experiences",
|
|
3
|
+
"main": "../dist/cjs/experiences/index.js",
|
|
4
|
+
"module": "../dist/esm/experiences/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/experiences/index.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../dist/types/experiences/index.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../dist/types-ts4.5/experiences/index.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "110.15.
|
|
3
|
+
"version": "110.15.2",
|
|
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/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/icon": "^28.5.0",
|
|
55
55
|
"@atlaskit/icon-object": "^7.3.0",
|
|
56
56
|
"@atlaskit/link": "^3.2.0",
|
|
57
|
-
"@atlaskit/link-datasource": "^4.
|
|
57
|
+
"@atlaskit/link-datasource": "^4.27.0",
|
|
58
58
|
"@atlaskit/link-picker": "^3.16.0",
|
|
59
59
|
"@atlaskit/media-card": "^79.5.0",
|
|
60
60
|
"@atlaskit/media-client": "^35.5.0",
|
|
@@ -82,9 +82,10 @@
|
|
|
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.
|
|
85
|
+
"@atlaskit/tmp-editor-statsig": "^13.16.0",
|
|
86
86
|
"@atlaskit/tokens": "^7.0.0",
|
|
87
87
|
"@atlaskit/tooltip": "^20.6.0",
|
|
88
|
+
"@atlaskit/ufo": "^0.4.0",
|
|
88
89
|
"@atlaskit/width-detector": "^5.0.0",
|
|
89
90
|
"@babel/runtime": "^7.0.0",
|
|
90
91
|
"@compiled/react": "^0.18.6",
|