@atlaskit/editor-plugin-card 7.2.7 → 7.3.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 +20 -0
- package/dist/cjs/nodeviews/inlineCard.js +3 -1
- package/dist/cjs/nodeviews/lazy-block-card.js +3 -1
- package/dist/cjs/nodeviews/lazy-embed-card.js +3 -1
- package/dist/cjs/nodeviews/lazy-inline-card.js +2 -1
- package/dist/cjs/pm-plugins/main.js +2 -0
- package/dist/cjs/ui/OpenPreviewButton/index.js +78 -0
- package/dist/cjs/ui/toolbar.js +14 -2
- package/dist/es2019/nodeviews/inlineCard.js +3 -1
- package/dist/es2019/nodeviews/lazy-block-card.js +5 -1
- package/dist/es2019/nodeviews/lazy-embed-card.js +5 -1
- package/dist/es2019/nodeviews/lazy-inline-card.js +3 -1
- package/dist/es2019/pm-plugins/main.js +2 -0
- package/dist/es2019/ui/OpenPreviewButton/index.js +73 -0
- package/dist/es2019/ui/toolbar.js +12 -2
- package/dist/esm/nodeviews/inlineCard.js +3 -1
- package/dist/esm/nodeviews/lazy-block-card.js +3 -1
- package/dist/esm/nodeviews/lazy-embed-card.js +3 -1
- package/dist/esm/nodeviews/lazy-inline-card.js +2 -1
- package/dist/esm/pm-plugins/main.js +2 -0
- package/dist/esm/ui/OpenPreviewButton/index.js +71 -0
- package/dist/esm/ui/toolbar.js +14 -2
- package/dist/types/nodeviews/blockCard.d.ts +5 -4
- package/dist/types/nodeviews/datasource.d.ts +1 -1
- package/dist/types/nodeviews/embedCard.d.ts +6 -5
- package/dist/types/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
- package/dist/types/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
- package/dist/types/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
- package/dist/types/pm-plugins/actions.d.ts +1 -1
- package/dist/types/pm-plugins/doc.d.ts +1 -1
- package/dist/types/pm-plugins/util/resolve.d.ts +1 -1
- package/dist/types/pm-plugins/util/state.d.ts +18 -18
- package/dist/types/pm-plugins/utils.d.ts +2 -5
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/ui/AwarenessWrapper/index.d.ts +0 -1
- package/dist/types/ui/ConfigureOverlay/index.d.ts +0 -1
- package/dist/types/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
- package/dist/types/ui/InlineCardOverlay/types.d.ts +0 -1
- package/dist/types/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/ui/LayoutButton/utils.d.ts +2 -1
- package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types/ui/OpenPreviewButton/index.d.ts +11 -0
- package/dist/types/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types/ui/ToolbarViewedEvent.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +5 -4
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +6 -5
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/doc.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/util/state.d.ts +18 -18
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +2 -5
- package/dist/types-ts4.5/types/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
- package/dist/types-ts4.5/ui/InlineCardOverlay/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +2 -1
- package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +11 -0
- package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +1 -1
- package/package.json +6 -9
|
@@ -22,9 +22,9 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
22
22
|
state: EmbedCardState;
|
|
23
23
|
private getPosSafely;
|
|
24
24
|
onResolve: (data: {
|
|
25
|
-
url?: string
|
|
26
|
-
title?: string
|
|
27
|
-
aspectRatio?: number
|
|
25
|
+
url?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
aspectRatio?: number;
|
|
28
28
|
}) => void;
|
|
29
29
|
updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
|
|
30
30
|
private getLineLength;
|
|
@@ -36,7 +36,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
36
36
|
saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
|
|
37
37
|
onHeightUpdate: (height: number) => void;
|
|
38
38
|
onError: ({ err }: {
|
|
39
|
-
err?: Error
|
|
39
|
+
err?: Error;
|
|
40
40
|
}) => void;
|
|
41
41
|
componentWillUnmount(): void;
|
|
42
42
|
private removeCardDispatched;
|
|
@@ -44,7 +44,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
44
44
|
render(): React.JSX.Element;
|
|
45
45
|
}
|
|
46
46
|
export declare const EmbedOrBlockCardComponent: (props: ComponentProps<typeof EmbedCardComponent>) => React.JSX.Element;
|
|
47
|
-
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'onClickCallback' | 'CompetitorPrompt'>;
|
|
47
|
+
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt'>;
|
|
48
48
|
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
49
49
|
private id;
|
|
50
50
|
unsubscribe: (() => void) | undefined;
|
|
@@ -61,6 +61,7 @@ export interface EmbedCardNodeViewProperties {
|
|
|
61
61
|
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
62
62
|
actionOptions: EmbedCardNodeViewProps['actionOptions'];
|
|
63
63
|
onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
|
|
64
|
+
isPageSSRed: EmbedCardNodeViewProps['isPageSSRed'];
|
|
64
65
|
CompetitorPrompt?: EmbedCardNodeViewProps['CompetitorPrompt'];
|
|
65
66
|
}
|
|
66
67
|
export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, onClickCallback, CompetitorPrompt, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
|
|
@@ -14,6 +14,6 @@ export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloa
|
|
|
14
14
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
|
|
15
15
|
export interface InlineCardNodeViewProperties {
|
|
16
16
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
17
|
-
isPageSSRed
|
|
17
|
+
isPageSSRed: InlineCardNodeViewProps['isPageSSRed'];
|
|
18
18
|
}
|
|
19
19
|
export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const blockCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const embedCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const inlineCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -17,7 +17,7 @@ export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) =
|
|
|
17
17
|
export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
|
|
18
18
|
export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
|
|
19
19
|
layout: DatasourceTableLayout;
|
|
20
|
-
datasourceTableRef?: HTMLElement
|
|
20
|
+
datasourceTableRef?: HTMLElement;
|
|
21
21
|
}) => (tr: Transaction) => Transaction;
|
|
22
22
|
export declare const showLinkToolbar: (tr: Transaction) => Transaction;
|
|
23
23
|
export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
|
|
@@ -12,7 +12,7 @@ import type { Request } from '../types';
|
|
|
12
12
|
export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf | DatasourceAdf, analyticsAction?: ACTION, editorAnalyticsApi?: EditorAnalyticsAPI, createAnalyticsEvent?: CreateUIAnalyticsEvent) => Command;
|
|
13
13
|
export declare const handleFallbackWithAnalytics: (request: Request, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
14
14
|
export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
|
|
15
|
-
export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: CardAppearance |
|
|
15
|
+
export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: CardAppearance | "url") => Transaction;
|
|
16
16
|
export declare const convertHyperlinkToSmartCard: (state: EditorState, source: CardReplacementInputMethod, appearance: CardAppearance, normalizeLinkText?: boolean) => Transaction;
|
|
17
17
|
export declare const changeSelectedCardToLink: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
18
18
|
export declare const changeSelectedCardToLinkFallback: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
@@ -6,4 +6,4 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
import type { DatasourceAdf } from '@atlaskit/linking-common';
|
|
7
7
|
import type { Request } from '../../types';
|
|
8
8
|
export declare const resolveWithProvider: (view: EditorView, provider: CardProvider, request: Request, options: CardOptions, editorAnalyticsApi: EditorAnalyticsAPI | undefined, createAnalyticsEvent: CreateUIAnalyticsEvent | undefined) => Promise<void | DatasourceAdf<Record<string, unknown>> | import("@atlaskit/linking-common").InlineCardAdf | import("@atlaskit/linking-common").BlockCardAdf | import("@atlaskit/linking-common").EmbedCardAdf>;
|
|
9
|
-
export declare const handleProvider: (_:
|
|
9
|
+
export declare const handleProvider: (_: "cardProvider", provider: Promise<CardProvider> | undefined, view: EditorView) => void;
|
|
@@ -8,35 +8,35 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
|
|
|
8
8
|
appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
|
|
9
9
|
compareLinkText: boolean;
|
|
10
10
|
source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
|
|
11
|
-
previousAppearance?:
|
|
12
|
-
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION
|
|
13
|
-
shouldReplaceLink?: boolean
|
|
11
|
+
previousAppearance?: import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
|
|
12
|
+
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION;
|
|
13
|
+
shouldReplaceLink?: boolean;
|
|
14
14
|
sourceEvent?: import("@atlaskit/analytics-next").UIAnalyticsEvent | null | undefined;
|
|
15
15
|
}[];
|
|
16
16
|
cards: {
|
|
17
17
|
pos: number;
|
|
18
|
-
title?: string
|
|
19
|
-
url?: string
|
|
20
|
-
id?: string
|
|
18
|
+
title?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
id?: string;
|
|
21
21
|
}[];
|
|
22
22
|
provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
|
|
23
23
|
datasourceStash: {
|
|
24
24
|
[x: string]: {
|
|
25
|
-
views: import("@atlaskit/linking-common").
|
|
25
|
+
views: import("@atlaskit/linking-common").DatasourceAdfView[];
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
showLinkingToolbar: boolean;
|
|
29
|
-
smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents
|
|
30
|
-
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance
|
|
29
|
+
smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents;
|
|
30
|
+
editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance;
|
|
31
31
|
showDatasourceModal: boolean;
|
|
32
|
-
datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType
|
|
33
|
-
datasourceTableRef?: HTMLElement
|
|
34
|
-
layout?: "
|
|
35
|
-
inlineCardAwarenessCandidatePosition?: number
|
|
36
|
-
overlayCandidatePosition?: number
|
|
37
|
-
removeOverlay?: (
|
|
38
|
-
selectedInlineLinkPosition?: number
|
|
39
|
-
allowEmbeds?: boolean
|
|
40
|
-
allowBlockCards?: boolean
|
|
32
|
+
datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType;
|
|
33
|
+
datasourceTableRef?: HTMLElement;
|
|
34
|
+
layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout;
|
|
35
|
+
inlineCardAwarenessCandidatePosition?: number;
|
|
36
|
+
overlayCandidatePosition?: number;
|
|
37
|
+
removeOverlay?: () => void;
|
|
38
|
+
selectedInlineLinkPosition?: number;
|
|
39
|
+
allowEmbeds?: boolean;
|
|
40
|
+
allowBlockCards?: boolean;
|
|
41
41
|
};
|
|
42
42
|
export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];
|
|
@@ -22,17 +22,14 @@ export declare const displayInfoForCard: (node: Node, info?: CardInfo) => TitleU
|
|
|
22
22
|
export declare const findCardInfo: (state: EditorState) => CardInfo | undefined;
|
|
23
23
|
export declare const isEmbedSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
|
|
24
24
|
export declare const isBlockSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
|
|
25
|
-
export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext[
|
|
25
|
+
export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext["store"]) => {};
|
|
26
26
|
export declare const isDatasourceConfigEditable: (datasourceId: string) => boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Typeguard that checks node attributes are datasource node attributes
|
|
29
29
|
* ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
|
|
30
30
|
* this function will not be updated automatically
|
|
31
31
|
*/
|
|
32
|
-
export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is
|
|
33
|
-
url?: string | undefined;
|
|
34
|
-
datasource: import("@atlaskit/linking-common").Datasource<Record<string, unknown>>;
|
|
35
|
-
} & Partial<import("@atlaskit/adf-schema").RichMediaAttributes>;
|
|
32
|
+
export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is DatasourceNode["attrs"];
|
|
36
33
|
/**
|
|
37
34
|
* Typeguard that checks a node is a datasource node (blockCard and has datasource attributes)
|
|
38
35
|
* ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
|
|
@@ -31,7 +31,7 @@ export declare const buildEditLinkToolbar: ({ providerFactory, node, pluginInjec
|
|
|
31
31
|
providerFactory: ProviderFactory;
|
|
32
32
|
node: Node;
|
|
33
33
|
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
34
|
-
linkPicker?:
|
|
34
|
+
linkPicker?: LinkPickerOptions;
|
|
35
35
|
lpLinkPicker: boolean;
|
|
36
36
|
}) => FloatingToolbarItem<Command>;
|
|
37
37
|
export declare const editLinkToolbarConfig: (showLinkingToolbar: boolean, lpLinkPicker?: boolean) => Partial<FloatingToolbarConfig>;
|
|
@@ -2,6 +2,6 @@ import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlas
|
|
|
2
2
|
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
3
3
|
export declare const getCustomHyperlinkAppearanceDropdown: ({ url, intl, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
4
4
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
5
|
-
allowDatasource?: boolean
|
|
6
|
-
isDatasourceView?: boolean
|
|
5
|
+
allowDatasource?: boolean;
|
|
6
|
+
isDatasourceView?: boolean;
|
|
7
7
|
}) => FloatingToolbarCustom<Command>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import { type DatasourceTableLayout } from './types';
|
|
2
3
|
export declare const getDatasource: (editorView: EditorView) => {
|
|
3
4
|
node: import("../../types").DatasourceNode;
|
|
4
5
|
start: number;
|
|
@@ -8,4 +9,4 @@ export declare const getDatasource: (editorView: EditorView) => {
|
|
|
8
9
|
node: undefined;
|
|
9
10
|
pos: undefined;
|
|
10
11
|
};
|
|
11
|
-
export declare const isDatasourceTableLayout: (layout: unknown) => layout is
|
|
12
|
+
export declare const isDatasourceTableLayout: (layout: unknown) => layout is DatasourceTableLayout;
|
|
@@ -9,6 +9,6 @@ type Props = LinkToolbarAppearanceProps & {
|
|
|
9
9
|
export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
|
|
10
10
|
export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
|
|
11
11
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
12
|
-
allowDatasource?: boolean
|
|
12
|
+
allowDatasource?: boolean;
|
|
13
13
|
}) => FloatingToolbarDropdown<Command>;
|
|
14
14
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
type OpenPreviewPanelToolbarButtonProps = {
|
|
6
|
+
node: PMNode;
|
|
7
|
+
intl: IntlShape;
|
|
8
|
+
editorAnalyticsApi?: EditorAnalyticsAPI;
|
|
9
|
+
};
|
|
10
|
+
export declare const OpenPreviewPanelToolbarButton: ({ node, intl, }: OpenPreviewPanelToolbarButtonProps) => React.JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -32,7 +32,7 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
32
32
|
width: number | null;
|
|
33
33
|
layout: RichMediaLayout;
|
|
34
34
|
};
|
|
35
|
-
calcUnwrappedLayout: (pct: number, width: number) =>
|
|
35
|
+
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
36
36
|
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
37
37
|
/**
|
|
38
38
|
* The maxmimum number of grid columns this node can resize to.
|
|
@@ -7,5 +7,5 @@ type ToolbarViewedEventProps = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Provides analytics context and card context
|
|
9
9
|
*/
|
|
10
|
-
export declare const ToolbarViewedEvent: ({ url, display, editorView, }: ToolbarViewedEventProps & Omit<EditorAnalyticsContextProps,
|
|
10
|
+
export declare const ToolbarViewedEvent: ({ url, display, editorView, }: ToolbarViewedEventProps & Omit<EditorAnalyticsContextProps, "children">) => React.JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -13,19 +13,19 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
13
13
|
id?: string;
|
|
14
14
|
});
|
|
15
15
|
onResolve: (data: {
|
|
16
|
-
url?: string
|
|
17
|
-
title?: string
|
|
16
|
+
url?: string;
|
|
17
|
+
title?: string;
|
|
18
18
|
}) => void;
|
|
19
19
|
componentWillUnmount(): void;
|
|
20
20
|
private removeCardDispatched;
|
|
21
21
|
private removeCard;
|
|
22
22
|
gapCursorSpan: () => React.JSX.Element | undefined;
|
|
23
23
|
onError: ({ err }: {
|
|
24
|
-
err?: Error
|
|
24
|
+
err?: Error;
|
|
25
25
|
}) => void;
|
|
26
26
|
render(): React.JSX.Element;
|
|
27
27
|
}
|
|
28
|
-
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'pluginInjectionApi' | 'onClickCallback' | 'CompetitorPrompt'>;
|
|
28
|
+
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt'>;
|
|
29
29
|
export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
30
30
|
private id;
|
|
31
31
|
unsubscribe: (() => void) | undefined;
|
|
@@ -43,6 +43,7 @@ export interface BlockCardNodeViewProperties {
|
|
|
43
43
|
onClickCallback: BlockCardNodeViewProps['onClickCallback'];
|
|
44
44
|
allowDatasource: boolean | undefined;
|
|
45
45
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
46
|
+
isPageSSRed: BlockCardNodeViewProps['isPageSSRed'];
|
|
46
47
|
CompetitorPrompt?: React.ComponentType<{
|
|
47
48
|
sourceUrl: string;
|
|
48
49
|
linkType?: string;
|
|
@@ -32,7 +32,7 @@ export declare class DatasourceComponent extends React.PureComponent<DatasourceC
|
|
|
32
32
|
handleColumnResize: (key: string, width: number) => void;
|
|
33
33
|
handleWrappedColumnChange: (key: string, shouldWrap: boolean) => void;
|
|
34
34
|
onError: ({ err }: {
|
|
35
|
-
err?: Error
|
|
35
|
+
err?: Error;
|
|
36
36
|
}) => void;
|
|
37
37
|
private getColumnsInfo;
|
|
38
38
|
render(): jsx.JSX.Element | null;
|
|
@@ -22,9 +22,9 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
22
22
|
state: EmbedCardState;
|
|
23
23
|
private getPosSafely;
|
|
24
24
|
onResolve: (data: {
|
|
25
|
-
url?: string
|
|
26
|
-
title?: string
|
|
27
|
-
aspectRatio?: number
|
|
25
|
+
url?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
aspectRatio?: number;
|
|
28
28
|
}) => void;
|
|
29
29
|
updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
|
|
30
30
|
private getLineLength;
|
|
@@ -36,7 +36,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
36
36
|
saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
|
|
37
37
|
onHeightUpdate: (height: number) => void;
|
|
38
38
|
onError: ({ err }: {
|
|
39
|
-
err?: Error
|
|
39
|
+
err?: Error;
|
|
40
40
|
}) => void;
|
|
41
41
|
componentWillUnmount(): void;
|
|
42
42
|
private removeCardDispatched;
|
|
@@ -44,7 +44,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
44
44
|
render(): React.JSX.Element;
|
|
45
45
|
}
|
|
46
46
|
export declare const EmbedOrBlockCardComponent: (props: ComponentProps<typeof EmbedCardComponent>) => React.JSX.Element;
|
|
47
|
-
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'onClickCallback' | 'CompetitorPrompt'>;
|
|
47
|
+
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt'>;
|
|
48
48
|
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
49
49
|
private id;
|
|
50
50
|
unsubscribe: (() => void) | undefined;
|
|
@@ -61,6 +61,7 @@ export interface EmbedCardNodeViewProperties {
|
|
|
61
61
|
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
62
62
|
actionOptions: EmbedCardNodeViewProps['actionOptions'];
|
|
63
63
|
onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
|
|
64
|
+
isPageSSRed: EmbedCardNodeViewProps['isPageSSRed'];
|
|
64
65
|
CompetitorPrompt?: EmbedCardNodeViewProps['CompetitorPrompt'];
|
|
65
66
|
}
|
|
66
67
|
export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, onClickCallback, CompetitorPrompt, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
|
|
@@ -14,6 +14,6 @@ export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloa
|
|
|
14
14
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
|
|
15
15
|
export interface InlineCardNodeViewProperties {
|
|
16
16
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
17
|
-
isPageSSRed
|
|
17
|
+
isPageSSRed: InlineCardNodeViewProps['isPageSSRed'];
|
|
18
18
|
}
|
|
19
19
|
export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const blockCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const embedCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const inlineCardSpecWithFixedToDOM: () => {
|
|
3
3
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string
|
|
5
|
-
marks?: string
|
|
6
|
-
group?: string
|
|
7
|
-
inline?: boolean
|
|
8
|
-
atom?: boolean
|
|
4
|
+
content?: string;
|
|
5
|
+
marks?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
atom?: boolean;
|
|
9
9
|
attrs?: {
|
|
10
10
|
[name: string]: import("prosemirror-model").AttributeSpec;
|
|
11
|
-
}
|
|
12
|
-
selectable?: boolean
|
|
13
|
-
draggable?: boolean
|
|
14
|
-
code?: boolean
|
|
15
|
-
whitespace?: "pre" | "normal"
|
|
16
|
-
definingAsContext?: boolean
|
|
17
|
-
definingForContent?: boolean
|
|
18
|
-
defining?: boolean
|
|
19
|
-
isolating?: boolean
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[]
|
|
21
|
-
toDebugString?: (
|
|
22
|
-
leafText?: (
|
|
23
|
-
linebreakReplacement?: boolean
|
|
11
|
+
};
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
code?: boolean;
|
|
15
|
+
whitespace?: "pre" | "normal";
|
|
16
|
+
definingAsContext?: boolean;
|
|
17
|
+
definingForContent?: boolean;
|
|
18
|
+
defining?: boolean;
|
|
19
|
+
isolating?: boolean;
|
|
20
|
+
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
+
toDebugString?: (node: PMNode) => string;
|
|
22
|
+
leafText?: (node: PMNode) => string;
|
|
23
|
+
linebreakReplacement?: boolean;
|
|
24
24
|
};
|
|
@@ -17,7 +17,7 @@ export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) =
|
|
|
17
17
|
export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
|
|
18
18
|
export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
|
|
19
19
|
layout: DatasourceTableLayout;
|
|
20
|
-
datasourceTableRef?: HTMLElement
|
|
20
|
+
datasourceTableRef?: HTMLElement;
|
|
21
21
|
}) => (tr: Transaction) => Transaction;
|
|
22
22
|
export declare const showLinkToolbar: (tr: Transaction) => Transaction;
|
|
23
23
|
export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
|