@atlaskit/editor-common 70.1.2 → 70.2.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 +40 -0
- package/dist/cjs/__tests_external__/index.js +1 -9
- package/dist/cjs/__tests_external__/page-objects/Editor.js +0 -7
- package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +7 -1
- package/dist/cjs/__tests_external__/page-objects/Renderer.js +0 -9
- package/dist/cjs/in-product.js +0 -6
- package/dist/cjs/react-node-view/index.js +19 -17
- package/dist/cjs/styles/index.js +12 -0
- package/dist/cjs/styles/shared/code-block.js +5 -3
- package/dist/cjs/styles/shared/lists.js +4 -2
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Expand/index.js +2 -2
- package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +33 -0
- package/dist/cjs/ui/Popup/index.js +2 -2
- package/dist/cjs/ui/PortalProvider/index.js +62 -47
- package/dist/cjs/ui/index.js +8 -0
- package/dist/cjs/utils/breakout.js +53 -2
- package/dist/cjs/utils/collab.js +22 -0
- package/dist/cjs/utils/dom.js +16 -0
- package/dist/cjs/utils/get-performance-options.js +70 -0
- package/dist/cjs/utils/index.js +57 -1
- package/dist/cjs/utils/outdated-browsers.js +41 -0
- package/dist/cjs/utils/referentiality.js +49 -0
- package/dist/cjs/utils/sendLogs.js +19 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/with-plugin-state/index.js +61 -54
- package/dist/es2019/__tests_external__/index.js +1 -2
- package/dist/es2019/__tests_external__/page-objects/Editor.js +0 -6
- package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +4 -1
- package/dist/es2019/__tests_external__/page-objects/Renderer.js +0 -6
- package/dist/es2019/in-product.js +1 -1
- package/dist/es2019/react-node-view/index.js +19 -24
- package/dist/es2019/styles/index.js +2 -2
- package/dist/es2019/styles/shared/code-block.js +13 -1
- package/dist/es2019/styles/shared/lists.js +2 -1
- package/dist/es2019/styles/shared/table.js +4 -2
- package/dist/es2019/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Expand/index.js +17 -15
- package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +18 -0
- package/dist/es2019/ui/Popup/index.js +2 -1
- package/dist/es2019/ui/PortalProvider/index.js +33 -14
- package/dist/es2019/ui/index.js +2 -1
- package/dist/es2019/utils/breakout.js +47 -1
- package/dist/es2019/utils/collab.js +13 -0
- package/dist/es2019/utils/dom.js +16 -0
- package/dist/es2019/utils/get-performance-options.js +57 -0
- package/dist/es2019/utils/index.js +6 -2
- package/dist/es2019/utils/outdated-browsers.js +32 -0
- package/dist/es2019/utils/referentiality.js +34 -0
- package/dist/es2019/utils/sendLogs.js +8 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/with-plugin-state/index.js +55 -52
- package/dist/esm/__tests_external__/index.js +1 -2
- package/dist/esm/__tests_external__/page-objects/Editor.js +0 -7
- package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +7 -1
- package/dist/esm/__tests_external__/page-objects/Renderer.js +0 -9
- package/dist/esm/in-product.js +1 -1
- package/dist/esm/react-node-view/index.js +19 -22
- package/dist/esm/styles/index.js +2 -2
- package/dist/esm/styles/shared/code-block.js +4 -3
- package/dist/esm/styles/shared/lists.js +2 -1
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Expand/index.js +2 -2
- package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +19 -0
- package/dist/esm/ui/Popup/index.js +2 -2
- package/dist/esm/ui/PortalProvider/index.js +59 -48
- package/dist/esm/ui/index.js +2 -1
- package/dist/esm/utils/breakout.js +46 -1
- package/dist/esm/utils/collab.js +13 -0
- package/dist/esm/utils/dom.js +16 -0
- package/dist/esm/utils/get-performance-options.js +55 -0
- package/dist/esm/utils/index.js +6 -2
- package/dist/esm/utils/outdated-browsers.js +32 -0
- package/dist/esm/utils/referentiality.js +40 -0
- package/dist/esm/utils/sendLogs.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/with-plugin-state/index.js +59 -54
- package/dist/types/__tests_external__/index.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types/analytics/types/events.d.ts +1 -0
- package/dist/types/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types/in-product.d.ts +1 -1
- package/dist/types/styles/index.d.ts +2 -2
- package/dist/types/styles/shared/code-block.d.ts +1 -0
- package/dist/types/styles/shared/lists.d.ts +1 -0
- package/dist/types/types/copy-button.d.ts +20 -0
- package/dist/types/types/editor-actions.d.ts +1 -0
- package/dist/types/types/editor-container-width.d.ts +14 -0
- package/dist/types/types/feature-flags.d.ts +0 -6
- package/dist/types/types/floating-toolbar.d.ts +23 -2
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types/ui/Popup/index.d.ts +1 -0
- package/dist/types/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types/utils/breakout.d.ts +25 -0
- package/dist/types/utils/collab.d.ts +2 -0
- package/dist/types/utils/dom.d.ts +15 -1
- package/dist/types/utils/get-performance-options.d.ts +18 -0
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types/utils/index.d.ts +5 -1
- package/dist/types/utils/outdated-browsers.d.ts +1 -0
- package/dist/types/utils/referentiality.d.ts +3 -0
- package/dist/types/utils/sendLogs.d.ts +1 -0
- package/dist/types/with-plugin-state/index.d.ts +4 -2
- package/dist/types-ts4.0/__tests_external__/index.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types-ts4.0/analytics/types/events.d.ts +1 -0
- package/dist/types-ts4.0/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types-ts4.0/in-product.d.ts +1 -1
- package/dist/types-ts4.0/styles/index.d.ts +2 -2
- package/dist/types-ts4.0/styles/shared/code-block.d.ts +1 -0
- package/dist/types-ts4.0/styles/shared/lists.d.ts +1 -0
- package/dist/types-ts4.0/types/copy-button.d.ts +20 -0
- package/dist/types-ts4.0/types/editor-actions.d.ts +1 -0
- package/dist/types-ts4.0/types/editor-container-width.d.ts +14 -0
- package/dist/types-ts4.0/types/feature-flags.d.ts +0 -6
- package/dist/types-ts4.0/types/floating-toolbar.d.ts +23 -2
- package/dist/types-ts4.0/types/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types-ts4.0/ui/Popup/index.d.ts +1 -0
- package/dist/types-ts4.0/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/index.d.ts +1 -0
- package/dist/types-ts4.0/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types-ts4.0/utils/breakout.d.ts +25 -0
- package/dist/types-ts4.0/utils/collab.d.ts +2 -0
- package/dist/types-ts4.0/utils/dom.d.ts +15 -1
- package/dist/types-ts4.0/utils/get-performance-options.d.ts +18 -0
- package/dist/types-ts4.0/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types-ts4.0/utils/index.d.ts +5 -1
- package/dist/types-ts4.0/utils/outdated-browsers.d.ts +1 -0
- package/dist/types-ts4.0/utils/referentiality.d.ts +3 -0
- package/dist/types-ts4.0/utils/sendLogs.d.ts +1 -0
- package/dist/types-ts4.0/with-plugin-state/index.d.ts +4 -2
- package/package.json +12 -10
- package/report.api.md +7 -3
- package/tsconfig.json +2 -1
- package/dist/cjs/__tests_external__/cases/media/test-cases/alt-text.js +0 -45
- package/dist/cjs/__tests_external__/cases/media/test-cases/caption.js +0 -44
- package/dist/cjs/__tests_external__/cases/media/test-cases/index.js +0 -23
- package/dist/cjs/__tests_external__/cases/media/test-cases/upload.js +0 -38
- package/dist/cjs/__tests_external__/page-objects/EditorMedia.js +0 -98
- package/dist/cjs/cypress-config.js +0 -3
- package/dist/es2019/__tests_external__/cases/media/test-cases/alt-text.js +0 -29
- package/dist/es2019/__tests_external__/cases/media/test-cases/caption.js +0 -28
- package/dist/es2019/__tests_external__/cases/media/test-cases/index.js +0 -8
- package/dist/es2019/__tests_external__/cases/media/test-cases/upload.js +0 -23
- package/dist/es2019/__tests_external__/page-objects/EditorMedia.js +0 -51
- package/dist/es2019/cypress-config.js +0 -1
- package/dist/esm/__tests_external__/cases/media/test-cases/alt-text.js +0 -32
- package/dist/esm/__tests_external__/cases/media/test-cases/caption.js +0 -31
- package/dist/esm/__tests_external__/cases/media/test-cases/index.js +0 -10
- package/dist/esm/__tests_external__/cases/media/test-cases/upload.js +0 -26
- package/dist/esm/__tests_external__/page-objects/EditorMedia.js +0 -83
- package/dist/esm/cypress-config.js +0 -1
- package/dist/types/__tests_external__/cases/media/test-cases/alt-text.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/caption.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/index.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/types.d.ts +0 -4
- package/dist/types/__tests_external__/cases/media/test-cases/upload.d.ts +0 -7
- package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +0 -19
- package/dist/types/cypress-config.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/alt-text.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/caption.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/index.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/types.d.ts +0 -4
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/upload.d.ts +0 -7
- package/dist/types-ts4.0/__tests_external__/page-objects/EditorMedia.d.ts +0 -19
- package/dist/types-ts4.0/cypress-config.d.ts +0 -1
|
@@ -9,7 +9,7 @@ export { ruleSharedStyles } from './shared/rule';
|
|
|
9
9
|
export { whitespaceSharedStyles } from './shared/whitespace';
|
|
10
10
|
export { paragraphSharedStyles } from './shared/paragraph';
|
|
11
11
|
export { linkSharedStyle } from './shared/link';
|
|
12
|
-
export { listsSharedStyles } from './shared/lists';
|
|
12
|
+
export { listsSharedStyles, listPaddingLeftMarkerSpace } from './shared/lists';
|
|
13
13
|
export { indentationSharedStyles } from './shared/indentation';
|
|
14
14
|
export { blockMarksSharedStyles } from './shared/block-marks';
|
|
15
15
|
export { codeMarkSharedStyles } from './shared/code-mark';
|
|
@@ -18,6 +18,6 @@ export { dateSharedStyle, DateSharedCssClassName } from './shared/date';
|
|
|
18
18
|
export { tasksAndDecisionsStyles, TaskDecisionSharedCssClassName, } from './shared/task-decision';
|
|
19
19
|
export { StatusSharedCssClassName } from './shared/status';
|
|
20
20
|
export { smartCardSharedStyles, SmartCardSharedCssClassName, } from './shared/smart-card';
|
|
21
|
-
export { CodeBlockSharedCssClassName, codeBlockSharedStyles, } from './shared/code-block';
|
|
21
|
+
export { CodeBlockSharedCssClassName, codeBlockSharedStyles, codeBlockInListSafariFix, } from './shared/code-block';
|
|
22
22
|
export { LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from './shared/layout';
|
|
23
23
|
export { EXTENSION_PADDING, BODIED_EXT_PADDING } from './shared/extension';
|
|
@@ -8,3 +8,4 @@ export declare const CodeBlockSharedCssClassName: {
|
|
|
8
8
|
DS_CODEBLOCK: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const codeBlockSharedStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
11
|
+
export declare const codeBlockInListSafariFix: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MarkType, NodeType } from 'prosemirror-model';
|
|
2
|
+
import { EditorState } from 'prosemirror-state';
|
|
3
|
+
import { IntlShape } from 'react-intl-next';
|
|
4
|
+
import { Command } from './command';
|
|
5
|
+
export declare type MarkOptions = {
|
|
6
|
+
state: EditorState;
|
|
7
|
+
formatMessage: IntlShape['formatMessage'];
|
|
8
|
+
nodeType?: undefined;
|
|
9
|
+
markType: MarkType;
|
|
10
|
+
onMouseEnter?: undefined;
|
|
11
|
+
onMouseLeave?: undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare type NodeOptions = {
|
|
14
|
+
state: EditorState;
|
|
15
|
+
formatMessage: IntlShape['formatMessage'];
|
|
16
|
+
nodeType: NodeType | Array<NodeType>;
|
|
17
|
+
markType?: undefined;
|
|
18
|
+
onMouseEnter?: Command;
|
|
19
|
+
onMouseLeave?: Command;
|
|
20
|
+
};
|
|
@@ -10,6 +10,7 @@ export interface EditorActionsOptions<T = any> {
|
|
|
10
10
|
clear(): boolean;
|
|
11
11
|
getValue(): Promise<T | JSONDocNode | undefined>;
|
|
12
12
|
getNodeByLocalId(id: string): Node | undefined;
|
|
13
|
+
getNodeByFragmentLocalId(id: string): Node | undefined;
|
|
13
14
|
getSelectedNode(): Node | undefined;
|
|
14
15
|
replaceDocument(rawValue: any): boolean;
|
|
15
16
|
replaceSelection(rawValue: Node | Object | string): boolean;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
export declare type EditorContainerWidth = {
|
|
2
|
+
/**
|
|
3
|
+
* Starts as offsetWidth of document body, and then
|
|
4
|
+
* updates to the editors content areas offsetWidth
|
|
5
|
+
* via the use of a contentComponent (via the
|
|
6
|
+
* container element prop).
|
|
7
|
+
*/
|
|
2
8
|
width: number;
|
|
3
9
|
containerWidth?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Starts as undefined, and then updates to the
|
|
12
|
+
* clientWidth of the dom element the EditorView
|
|
13
|
+
* is attached to.
|
|
14
|
+
*
|
|
15
|
+
* Then the WidthEmitter updates this whenever the
|
|
16
|
+
* context panel or editor widths change.
|
|
17
|
+
*/
|
|
4
18
|
lineLength?: number;
|
|
5
19
|
};
|
|
6
20
|
export declare type GetEditorContainerWidth = () => EditorContainerWidth;
|
|
@@ -185,12 +185,6 @@ export declare type FeatureFlags = {
|
|
|
185
185
|
* @default false
|
|
186
186
|
*/
|
|
187
187
|
extendFloatingToolbar?: boolean;
|
|
188
|
-
/**
|
|
189
|
-
* Set editor to use the input rule with unpredictable undo results
|
|
190
|
-
* @see https://product-fabric.atlassian.net/browse/ED-12676
|
|
191
|
-
* @default true
|
|
192
|
-
*/
|
|
193
|
-
useUnpredictableInputRule?: boolean;
|
|
194
188
|
/**
|
|
195
189
|
* Show the avatar group as a plugin
|
|
196
190
|
* @see https://product-fabric.atlassian.net/browse/CERN-747
|
|
@@ -8,6 +8,7 @@ import type { DispatchAnalyticsEvent } from '../analytics/types/dispatch-analyti
|
|
|
8
8
|
import type { ProviderFactory } from '../provider-factory';
|
|
9
9
|
import type { PaletteColor } from '../ui-color/ColorPalette/Palettes/type';
|
|
10
10
|
import type { Command } from './command';
|
|
11
|
+
import type { MarkOptions, NodeOptions } from './copy-button';
|
|
11
12
|
export interface RenderOptionsPropsT<T> {
|
|
12
13
|
hide: () => void;
|
|
13
14
|
dispatchCommand: (command: T) => void;
|
|
@@ -54,6 +55,11 @@ export interface ConfirmDialogOptions {
|
|
|
54
55
|
okButtonLabel?: string;
|
|
55
56
|
cancelButtonLabel?: string;
|
|
56
57
|
}
|
|
58
|
+
export declare type FloatingToolbarCopyButton = {
|
|
59
|
+
type: 'copy-button';
|
|
60
|
+
items: Array<FloatingToolbarSeparator | MarkOptions | NodeOptions>;
|
|
61
|
+
hidden?: boolean;
|
|
62
|
+
};
|
|
57
63
|
export declare type FloatingToolbarButton<T> = {
|
|
58
64
|
id?: string;
|
|
59
65
|
type: 'button';
|
|
@@ -95,6 +101,17 @@ export declare type FloatingToolbarInput<T> = {
|
|
|
95
101
|
};
|
|
96
102
|
export declare type FloatingToolbarCustom<T> = {
|
|
97
103
|
type: 'custom';
|
|
104
|
+
/**
|
|
105
|
+
* By default -- the floating toolbar supports navigating between
|
|
106
|
+
* items using arrow keys (to meet aria guidelines).
|
|
107
|
+
* In some cases the floating toolbar is being used to present
|
|
108
|
+
* non toolbar content -- such as the link editing experience.
|
|
109
|
+
* In these cases you can opt out of arrow navigation using the
|
|
110
|
+
* this property.
|
|
111
|
+
*
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
disableArrowNavigation?: boolean;
|
|
98
115
|
fallback: Array<FloatingToolbarFallbackItem<T>>;
|
|
99
116
|
render: (view?: EditorView, idx?: number, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => React.ComponentClass | React.SFC | React.ReactElement<any> | null;
|
|
100
117
|
hidden?: boolean;
|
|
@@ -159,8 +176,8 @@ declare type FloatingToolbarExtensionsPlaceholder = {
|
|
|
159
176
|
* This type is restricted with the items that can be used for fallback.
|
|
160
177
|
* Make sure that this type is not a FloatingToolbarCustom type.
|
|
161
178
|
*/
|
|
162
|
-
export declare type FloatingToolbarFallbackItem<T> = FloatingToolbarButton<T> | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarSeparator;
|
|
163
|
-
export declare type FloatingToolbarItem<T> = FloatingToolbarButton<T> | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder;
|
|
179
|
+
export declare type FloatingToolbarFallbackItem<T> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarSeparator;
|
|
180
|
+
export declare type FloatingToolbarItem<T> = FloatingToolbarButton<T> | FloatingToolbarCopyButton | FloatingToolbarDropdown<T> | FloatingToolbarSelect<T> | FloatingToolbarInput<T> | FloatingToolbarCustom<T> | FloatingToolbarSeparator | FloatingToolbarExtensionsPlaceholder;
|
|
164
181
|
export interface FloatingToolbarConfig {
|
|
165
182
|
title: string;
|
|
166
183
|
/**
|
|
@@ -172,6 +189,9 @@ export interface FloatingToolbarConfig {
|
|
|
172
189
|
*/
|
|
173
190
|
getDomRef?: (view: EditorView) => HTMLElement | undefined;
|
|
174
191
|
visible?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* nodeType or list of `nodeType`s this floating toolbar should be shown for.
|
|
194
|
+
**/
|
|
175
195
|
nodeType: NodeType | NodeType[];
|
|
176
196
|
items: Array<FloatingToolbarItem<Command>> | ((node: Node) => Array<FloatingToolbarItem<Command>>);
|
|
177
197
|
align?: AlignType;
|
|
@@ -184,6 +204,7 @@ export interface FloatingToolbarConfig {
|
|
|
184
204
|
];
|
|
185
205
|
forcePlacement?: boolean;
|
|
186
206
|
onPositionCalculated?: (editorView: EditorView, nextPos: Position) => Position;
|
|
207
|
+
scrollable?: boolean;
|
|
187
208
|
}
|
|
188
209
|
export declare type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory) => FloatingToolbarConfig | undefined;
|
|
189
210
|
export {};
|
|
@@ -18,7 +18,8 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags, } from './fea
|
|
|
18
18
|
export type { Browsers, Range, DisableSpellcheckByBrowser, } from './supported-browsers';
|
|
19
19
|
export type { EditorContainerWidth, GetEditorContainerWidth, } from './editor-container-width';
|
|
20
20
|
export type { EmptyStateHandler, EmptyStateHandlerParams, } from './empty-state-handler';
|
|
21
|
-
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogOptions, FloatingToolbarButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, } from './floating-toolbar';
|
|
21
|
+
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogOptions, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, } from './floating-toolbar';
|
|
22
|
+
export type { MarkOptions, NodeOptions } from './copy-button';
|
|
22
23
|
export type { ContextPanelHandler } from './context-panel';
|
|
23
24
|
export type { EditorAppearance } from './editor-appearance';
|
|
24
25
|
export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory, } from './toolbar';
|
|
@@ -37,7 +37,8 @@ export declare class PortalProviderAPI extends EventDispatcher {
|
|
|
37
37
|
export declare const PortalProvider: React.FC<import("react-intl-next").WithIntlProps<BasePortalProviderProps>> & {
|
|
38
38
|
WrappedComponent: React.ComponentType<BasePortalProviderProps>;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
declare type PortalProviderWithThemeProvidersProps = Omit<BasePortalProviderProps, 'intl' | 'themeMode'>;
|
|
41
|
+
export declare const PortalProviderWithThemeProviders: ({ onAnalyticsEvent, useAnalyticsContext, render, }: PortalProviderWithThemeProvidersProps) => JSX.Element;
|
|
41
42
|
export declare class PortalRenderer extends React.Component<{
|
|
42
43
|
portalProviderAPI: PortalProviderAPI;
|
|
43
44
|
}, PortalRendererState> {
|
|
@@ -23,3 +23,4 @@ export type { StyleProps as ExpandStyleProps } from './Expand';
|
|
|
23
23
|
export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
|
|
24
24
|
export { clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle, } from './clear-next-sibling-margin-top';
|
|
25
25
|
export { IntlErrorBoundary, REACT_INTL_ERROR_MESSAGE, } from './IntlErrorBoundary';
|
|
26
|
+
export { default as IntlProviderIfMissingWrapper } from './IntlProviderIfMissingWrapper';
|
|
@@ -39,7 +39,7 @@ declare const ToolbarButton: React.ForwardRefExoticComponent<{
|
|
|
39
39
|
onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
40
40
|
onItemClick?: ((item: MenuItem) => void) | undefined;
|
|
41
41
|
selected?: boolean | undefined;
|
|
42
|
-
spacing?: "
|
|
42
|
+
spacing?: "none" | "default" | "compact" | undefined;
|
|
43
43
|
target?: string | undefined;
|
|
44
44
|
title?: React.ReactNode;
|
|
45
45
|
titlePosition?: PositionType | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BreakoutMarkAttrs } from '@atlaskit/adf-schema';
|
|
1
2
|
/**
|
|
2
3
|
* Variables required to construct a context for breakout ssr inline script.
|
|
3
4
|
*
|
|
@@ -8,3 +9,27 @@ export declare const absoluteBreakoutWidth: (layout: 'full-width' | 'wide' | str
|
|
|
8
9
|
export { breakoutConsts };
|
|
9
10
|
export declare const calcWideWidth: any;
|
|
10
11
|
export declare const calcBreakoutWidth: any;
|
|
12
|
+
export declare function calculateBreakoutStyles({ mode, widthStateLineLength, widthStateWidth, }: {
|
|
13
|
+
mode: BreakoutMarkAttrs['mode'];
|
|
14
|
+
/**
|
|
15
|
+
* offsetWidth of the content the editor is attached to.
|
|
16
|
+
* Expected to be retrieved via `WidthState.lineLength`.
|
|
17
|
+
*/
|
|
18
|
+
widthStateWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* clientWidth of the content area in the editor (ie. EditorPlugin contentComponents).
|
|
21
|
+
* Expected to be retrieved via `WidthState.width`.
|
|
22
|
+
*/
|
|
23
|
+
widthStateLineLength?: number;
|
|
24
|
+
}): {
|
|
25
|
+
type: "line-length-unknown";
|
|
26
|
+
width: any;
|
|
27
|
+
transform: string;
|
|
28
|
+
marginLeft: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: "line-length-known";
|
|
31
|
+
width: any;
|
|
32
|
+
marginLeft: string;
|
|
33
|
+
transform?: undefined;
|
|
34
|
+
};
|
|
35
|
+
export declare function calcBreakoutWidthPx(mode: BreakoutMarkAttrs['mode'], widthStateWidth?: number): number;
|
|
@@ -20,7 +20,21 @@ export declare function removeNestedEmptyEls(el: HTMLElement): void;
|
|
|
20
20
|
export declare const containsClassName: (node: HTMLElement | SVGElement | null, className: string) => boolean;
|
|
21
21
|
export declare function closest(node: HTMLElement | null | undefined, s: string): HTMLElement | null;
|
|
22
22
|
export declare function closestElement(node: HTMLElement | null | undefined, s: string): HTMLElement | null;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Util for converting a css pixel size value to a number (of pixels).
|
|
25
|
+
*
|
|
26
|
+
* ie.
|
|
27
|
+
* ```ts
|
|
28
|
+
* const pixels = parsePx('10px')
|
|
29
|
+
* // ^$ const pixels: number
|
|
30
|
+
* ```
|
|
31
|
+
* * ```ts
|
|
32
|
+
* const pixels = parsePx('10')
|
|
33
|
+
* // ^$ const pixels: number | undefined
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function parsePx<PXString extends `${number}px`>(pxStr: PXString): number;
|
|
37
|
+
export declare function parsePx<PXString extends string>(pxStr: PXString): number | undefined;
|
|
24
38
|
export declare type MapCallback<T, S> = (elem: S, idx: number, parent: Element) => T;
|
|
25
39
|
export declare function mapElem<T>(elem: Element, callback: MapCallback<T, Element>): Array<T>;
|
|
26
40
|
export declare function maphElem<T, U extends HTMLElement>(elem: U, callback: MapCallback<T, U>): Array<T>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EditorState } from 'prosemirror-state';
|
|
2
|
+
import type { EditorView } from 'prosemirror-view';
|
|
3
|
+
import { AnalyticsEventPayload } from '../analytics';
|
|
4
|
+
export declare function getPerformanceOptions(view: EditorView): {
|
|
5
|
+
trackingEnabled: boolean;
|
|
6
|
+
samplingRate: number;
|
|
7
|
+
slowThreshold: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function startMeasureReactNodeViewRendered({ nodeTypeName, }: {
|
|
10
|
+
nodeTypeName: string;
|
|
11
|
+
}): void;
|
|
12
|
+
export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, editorState, samplingRate, slowThreshold, }: {
|
|
13
|
+
nodeTypeName: string;
|
|
14
|
+
dispatchAnalyticsEvent(payload: AnalyticsEventPayload): void;
|
|
15
|
+
editorState: EditorState;
|
|
16
|
+
samplingRate: number;
|
|
17
|
+
slowThreshold: number;
|
|
18
|
+
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getModeFromTheme(theme: string): "
|
|
1
|
+
export declare function getModeFromTheme(theme: string): "light" | "dark";
|
|
@@ -9,7 +9,7 @@ export type { Date } from './date';
|
|
|
9
9
|
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, } from './editor-core-utils';
|
|
10
10
|
export { withImageLoader } from './imageLoader';
|
|
11
11
|
export type { ImageLoaderProps, ImageLoaderState, ImageStatus, } from './imageLoader';
|
|
12
|
-
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, } from './breakout';
|
|
12
|
+
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, } from './breakout';
|
|
13
13
|
export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, } from './nodes';
|
|
14
14
|
export type { Reducer } from './plugin-state-factory';
|
|
15
15
|
export { pluginFactory } from './plugin-state-factory';
|
|
@@ -35,6 +35,7 @@ export { ZERO_WIDTH_SPACE, ZERO_WIDTH_JOINER } from './whitespace';
|
|
|
35
35
|
export type { Diff } from './types';
|
|
36
36
|
export { shouldForceTracking } from './should-force-tracking';
|
|
37
37
|
export { getModeFromTheme } from './getModeFromTheme';
|
|
38
|
+
export { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered, } from './get-performance-options';
|
|
38
39
|
export type { UserBrowserExtensionResults } from './browser-extensions';
|
|
39
40
|
export { sniffUserBrowserExtensions } from './browser-extensions';
|
|
40
41
|
export { RenderCountProfiler } from './profiler/render-count';
|
|
@@ -43,3 +44,6 @@ export { getShallowPropsDifference, getPropsDifference } from './compare-props';
|
|
|
43
44
|
export type { ShallowPropsDifference, PropsDifference } from './compare-props';
|
|
44
45
|
export { useComponentRenderTracking } from './performance/hooks/use-component-render-tracking';
|
|
45
46
|
export type { UseComponentRenderTrackingArgs } from './performance/hooks/use-component-render-tracking';
|
|
47
|
+
export { isOutdatedBrowser } from './outdated-browsers';
|
|
48
|
+
export { isReferencedSource } from './referentiality';
|
|
49
|
+
export { sendLogs } from './sendLogs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isOutdatedBrowser: (userAgent: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sendLogs: (body: any) => Promise<Response>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { PluginKey } from 'prosemirror-state';
|
|
4
4
|
import { EditorView } from 'prosemirror-view';
|
|
5
|
-
import
|
|
5
|
+
import { EventDispatcher } from '../event-dispatcher';
|
|
6
6
|
import type { NamedPluginKeys, NamedPluginStates } from './types';
|
|
7
7
|
export declare type PerformanceOptions = {
|
|
8
8
|
samplingRate: number;
|
|
@@ -13,7 +13,7 @@ export interface State {
|
|
|
13
13
|
[name: string]: any;
|
|
14
14
|
}
|
|
15
15
|
declare type ContextUpdateHandler = (editorView: EditorView, eventDispatcher: EventDispatcher) => void;
|
|
16
|
-
declare type EditorActionsPrivateAccess = {
|
|
16
|
+
export declare type EditorActionsPrivateAccess = {
|
|
17
17
|
_privateGetEditorView: () => EditorView;
|
|
18
18
|
_privateGetEventDispatcher: () => EventDispatcher;
|
|
19
19
|
_privateSubscribe: (cb: ContextUpdateHandler) => void;
|
|
@@ -59,6 +59,7 @@ declare class WithPluginState<P extends NamedPluginKeys> extends React.Component
|
|
|
59
59
|
private debounce;
|
|
60
60
|
private notAppliedState;
|
|
61
61
|
private isSubscribed;
|
|
62
|
+
private callsCount;
|
|
62
63
|
static contextTypes: {
|
|
63
64
|
editorActions: PropTypes.Requireable<object>;
|
|
64
65
|
editorSharedConfig: PropTypes.Requireable<object>;
|
|
@@ -72,6 +73,7 @@ declare class WithPluginState<P extends NamedPluginKeys> extends React.Component
|
|
|
72
73
|
* Debounces setState calls in order to reduce number of re-renders caused by several plugin state changes.
|
|
73
74
|
*/
|
|
74
75
|
private updateState;
|
|
76
|
+
private dispatchAnalyticsEvent;
|
|
75
77
|
private getPluginsStates;
|
|
76
78
|
private subscribe;
|
|
77
79
|
private unsubscribe;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "70.
|
|
3
|
+
"version": "70.2.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/"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"typesVersions": {
|
|
16
16
|
">=4.0 <4.5": {
|
|
17
17
|
"*": [
|
|
18
|
-
"dist/types-ts4.0/*"
|
|
18
|
+
"dist/types-ts4.0/*",
|
|
19
|
+
"dist/types-ts4.0/index.d.ts"
|
|
19
20
|
]
|
|
20
21
|
}
|
|
21
22
|
},
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"@atlaskit/analytics-namespaced-context": "^6.5.0",
|
|
71
72
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
72
73
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
73
|
-
"@atlaskit/button": "^16.
|
|
74
|
+
"@atlaskit/button": "^16.4.0",
|
|
74
75
|
"@atlaskit/code": "^14.4.0",
|
|
75
76
|
"@atlaskit/codemod-utils": "^4.1.0",
|
|
76
77
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
@@ -78,13 +79,13 @@
|
|
|
78
79
|
"@atlaskit/emoji": "^66.0.0",
|
|
79
80
|
"@atlaskit/icon": "^21.11.0",
|
|
80
81
|
"@atlaskit/in-product-testing": "^0.1.0",
|
|
81
|
-
"@atlaskit/media-card": "^74.
|
|
82
|
-
"@atlaskit/media-client": "^18.
|
|
82
|
+
"@atlaskit/media-card": "^74.2.0",
|
|
83
|
+
"@atlaskit/media-client": "^18.1.0",
|
|
83
84
|
"@atlaskit/media-picker": "^64.0.0",
|
|
84
85
|
"@atlaskit/mention": "^21.0.0",
|
|
85
|
-
"@atlaskit/menu": "^1.
|
|
86
|
+
"@atlaskit/menu": "^1.4.0",
|
|
86
87
|
"@atlaskit/profilecard": "^17.2.0",
|
|
87
|
-
"@atlaskit/smart-card": "^23.
|
|
88
|
+
"@atlaskit/smart-card": "^23.1.0",
|
|
88
89
|
"@atlaskit/smart-user-picker": "^6.0.0",
|
|
89
90
|
"@atlaskit/task-decision": "^17.5.0",
|
|
90
91
|
"@atlaskit/theme": "^12.2.0",
|
|
@@ -100,7 +101,6 @@
|
|
|
100
101
|
"@types/prosemirror-view": "^1.9.0",
|
|
101
102
|
"chromatism": "^2.6.0",
|
|
102
103
|
"classnames": "^2.2.5",
|
|
103
|
-
"cypress-file-upload": "^5.0.2",
|
|
104
104
|
"date-fns": "^2.17.0",
|
|
105
105
|
"lodash": "^4.17.21",
|
|
106
106
|
"popper.js": "^1.14.1",
|
|
@@ -129,7 +129,6 @@
|
|
|
129
129
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
130
130
|
"@testing-library/react": "^12.1.5",
|
|
131
131
|
"@types/raf-schd": "^4.0.1",
|
|
132
|
-
"cypress-file-upload": "^5.0.2",
|
|
133
132
|
"enzyme": "^3.10.0",
|
|
134
133
|
"raf-stub": "^2.0.1",
|
|
135
134
|
"react": "^16.8.0",
|
|
@@ -146,7 +145,10 @@
|
|
|
146
145
|
},
|
|
147
146
|
"@repo/internal": {
|
|
148
147
|
"deprecation": "no-deprecated-imports",
|
|
149
|
-
"theming": "tokens"
|
|
148
|
+
"theming": "tokens",
|
|
149
|
+
"styling": [
|
|
150
|
+
"emotion"
|
|
151
|
+
]
|
|
150
152
|
}
|
|
151
153
|
},
|
|
152
154
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
package/report.api.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/editor-common"
|
|
1
|
+
## API Report File for "@atlaskit/editor-common"
|
|
2
2
|
|
|
3
|
-
> Do not edit this file.
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
<!--
|
|
6
|
+
Generated API Report version: 2.0
|
|
7
|
+
-->
|
|
4
8
|
|
|
5
9
|
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
6
10
|
|
|
7
11
|
```ts
|
|
8
|
-
|
|
12
|
+
// (No @packageDocumentation comment for this package)
|
|
9
13
|
```
|
package/tsconfig.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.addAltTextMediaTestCase = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _inProduct = require("@atlaskit/media-card/in-product");
|
|
11
|
-
|
|
12
|
-
var _Editor = require("../../../page-objects/Editor");
|
|
13
|
-
|
|
14
|
-
var _EditorMedia = require("../../../page-objects/EditorMedia");
|
|
15
|
-
|
|
16
|
-
var addAltTextMediaTestCase = function addAltTextMediaTestCase(_ref) {
|
|
17
|
-
var ui = _ref.ui,
|
|
18
|
-
fixtures = _ref.fixtures;
|
|
19
|
-
return new _inProductTesting.InProductTestCase({
|
|
20
|
-
title: 'adding alt text to Media works',
|
|
21
|
-
id: 'media-alt-text',
|
|
22
|
-
precondition: function precondition() {
|
|
23
|
-
return fixtures.length > 0;
|
|
24
|
-
},
|
|
25
|
-
assertions: function assertions(cy) {
|
|
26
|
-
var editor = new _Editor.EditorPageObject(cy);
|
|
27
|
-
var editorMedia = new _EditorMedia.EditorMediaPageObject(cy);
|
|
28
|
-
var mediaCard = new _inProduct.MediaCardPageObject(cy);
|
|
29
|
-
editor.upload(fixtures);
|
|
30
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
31
|
-
var altText = 'Corne **loves** avocados';
|
|
32
|
-
editorMedia.addAltTextToImage(altText);
|
|
33
|
-
editorMedia.assertAltText(altText);
|
|
34
|
-
|
|
35
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
36
|
-
var renderer = editor.publish(ui);
|
|
37
|
-
renderer.expectContentReady();
|
|
38
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
39
|
-
mediaCard.assertAltText(altText);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
exports.addAltTextMediaTestCase = addAltTextMediaTestCase;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.addCaptionMediaTestCase = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _inProduct = require("@atlaskit/media-card/in-product");
|
|
11
|
-
|
|
12
|
-
var _Editor = require("../../../page-objects/Editor");
|
|
13
|
-
|
|
14
|
-
var _EditorMedia = require("../../../page-objects/EditorMedia");
|
|
15
|
-
|
|
16
|
-
var addCaptionMediaTestCase = function addCaptionMediaTestCase(_ref) {
|
|
17
|
-
var ui = _ref.ui,
|
|
18
|
-
fixtures = _ref.fixtures;
|
|
19
|
-
return new _inProductTesting.InProductTestCase({
|
|
20
|
-
title: 'adding caption to Media works',
|
|
21
|
-
id: 'media-caption',
|
|
22
|
-
precondition: function precondition() {
|
|
23
|
-
return fixtures.length > 0;
|
|
24
|
-
},
|
|
25
|
-
assertions: function assertions(cy) {
|
|
26
|
-
var editor = new _Editor.EditorPageObject(cy);
|
|
27
|
-
var editorMedia = new _EditorMedia.EditorMediaPageObject(cy);
|
|
28
|
-
var mediaCard = new _inProduct.MediaCardPageObject(cy);
|
|
29
|
-
editor.upload(fixtures);
|
|
30
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
31
|
-
var captionText = 'Corne loves avocados';
|
|
32
|
-
editorMedia.addCaptionToImage(captionText);
|
|
33
|
-
|
|
34
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
35
|
-
var renderer = editor.publish(ui);
|
|
36
|
-
renderer.expectContentReady();
|
|
37
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
38
|
-
editorMedia.assertCaptionText(captionText);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
exports.addCaptionMediaTestCase = addCaptionMediaTestCase;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mediaTestCollection = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _altText = require("./alt-text");
|
|
11
|
-
|
|
12
|
-
var _caption = require("./caption");
|
|
13
|
-
|
|
14
|
-
var _upload = require("./upload");
|
|
15
|
-
|
|
16
|
-
var mediaTestCollection = function mediaTestCollection(opts) {
|
|
17
|
-
return new _inProductTesting.InProductTestCollection({
|
|
18
|
-
title: '@atlaskit/editor-core -> Media, happy paths',
|
|
19
|
-
testCases: [(0, _upload.uploadMediaTestCase)(opts), (0, _altText.addAltTextMediaTestCase)(opts), (0, _caption.addCaptionMediaTestCase)(opts)]
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
exports.mediaTestCollection = mediaTestCollection;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.uploadMediaTestCase = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _inProduct = require("@atlaskit/media-card/in-product");
|
|
11
|
-
|
|
12
|
-
var _Editor = require("../../../page-objects/Editor");
|
|
13
|
-
|
|
14
|
-
var uploadMediaTestCase = function uploadMediaTestCase(_ref) {
|
|
15
|
-
var ui = _ref.ui,
|
|
16
|
-
fixtures = _ref.fixtures;
|
|
17
|
-
return new _inProductTesting.InProductTestCase({
|
|
18
|
-
title: 'media upload and publish works',
|
|
19
|
-
id: 'media-file-upload',
|
|
20
|
-
precondition: function precondition() {
|
|
21
|
-
return fixtures.length > 0;
|
|
22
|
-
},
|
|
23
|
-
assertions: function assertions(cy) {
|
|
24
|
-
var editor = new _Editor.EditorPageObject(cy);
|
|
25
|
-
var mediaCard = new _inProduct.MediaCardPageObject(cy);
|
|
26
|
-
editor.upload(fixtures);
|
|
27
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
28
|
-
|
|
29
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
30
|
-
var renderer = editor.publish(ui);
|
|
31
|
-
renderer.expectContentReady();
|
|
32
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
exports.uploadMediaTestCase = uploadMediaTestCase;
|