@atlaskit/editor-common 110.15.0 → 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 +19 -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/HoverLinkOverlay/index.js +192 -14
- 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/HoverLinkOverlay/index.js +176 -14
- 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/HoverLinkOverlay/index.js +192 -14
- 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/ui/HoverLinkOverlay/index.d.ts +13 -3
- 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/dist/types-ts4.5/ui/HoverLinkOverlay/index.d.ts +13 -3
- package/experiences/package.json +17 -0
- package/package.json +4 -3
|
@@ -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';
|
|
@@ -3,7 +3,17 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { type EditorAnalyticsAPI } from '../../analytics';
|
|
7
|
+
declare const HoverLinkOverlay: React.FC<React.HTMLAttributes<HTMLSpanElement> & {
|
|
8
|
+
compactPadding?: boolean;
|
|
9
|
+
editorAnalyticsApi?: EditorAnalyticsAPI;
|
|
10
|
+
isVisible?: boolean;
|
|
11
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
12
|
+
showPanelButton?: boolean;
|
|
13
|
+
showPanelButtonIcon?: "panel" | "modal";
|
|
14
|
+
url: string;
|
|
15
|
+
view?: import("prosemirror-view").EditorView;
|
|
16
|
+
} & {
|
|
17
|
+
children?: React.ReactNode | undefined;
|
|
18
|
+
}>;
|
|
9
19
|
export default HoverLinkOverlay;
|
|
@@ -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",
|