@atlaskit/editor-plugin-card 7.3.0 → 7.4.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 +20 -0
- package/dist/cjs/nodeviews/blockCard.js +24 -6
- package/dist/cjs/nodeviews/embedCard.js +30 -8
- package/dist/cjs/nodeviews/inlineCard.js +1 -3
- package/dist/cjs/ui/OpenPreviewButton/index.js +78 -0
- package/dist/cjs/ui/toolbar.js +14 -2
- package/dist/es2019/nodeviews/blockCard.js +24 -6
- package/dist/es2019/nodeviews/embedCard.js +30 -8
- package/dist/es2019/nodeviews/inlineCard.js +1 -3
- package/dist/es2019/ui/OpenPreviewButton/index.js +73 -0
- package/dist/es2019/ui/toolbar.js +12 -2
- package/dist/esm/nodeviews/blockCard.js +24 -6
- package/dist/esm/nodeviews/embedCard.js +30 -8
- package/dist/esm/nodeviews/inlineCard.js +1 -3
- package/dist/esm/ui/OpenPreviewButton/index.js +71 -0
- package/dist/esm/ui/toolbar.js +14 -2
- package/dist/types/nodeviews/blockCard.d.ts +4 -4
- package/dist/types/nodeviews/datasource.d.ts +1 -1
- package/dist/types/nodeviews/embedCard.d.ts +5 -5
- 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 +4 -4
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +5 -5
- 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 -6
|
@@ -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,15 +13,15 @@ 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
|
}
|
|
@@ -49,4 +49,4 @@ export interface BlockCardNodeViewProperties {
|
|
|
49
49
|
linkType?: string;
|
|
50
50
|
}>;
|
|
51
51
|
}
|
|
52
|
-
export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView | Datasource | BlockCard;
|
|
52
|
+
export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, isPageSSRed, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView | Datasource | BlockCard;
|
|
@@ -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;
|
|
@@ -64,4 +64,4 @@ export interface EmbedCardNodeViewProperties {
|
|
|
64
64
|
isPageSSRed: EmbedCardNodeViewProps['isPageSSRed'];
|
|
65
65
|
CompetitorPrompt?: EmbedCardNodeViewProps['CompetitorPrompt'];
|
|
66
66
|
}
|
|
67
|
-
export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, onClickCallback, CompetitorPrompt, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
|
|
67
|
+
export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, onClickCallback, CompetitorPrompt, isPageSSRed, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
|
|
@@ -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 {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,20 +49,20 @@
|
|
|
49
49
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
50
50
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
51
51
|
"@atlaskit/frontend-utilities": "^3.1.0",
|
|
52
|
-
"@atlaskit/icon": "^27.
|
|
52
|
+
"@atlaskit/icon": "^27.12.0",
|
|
53
53
|
"@atlaskit/link": "^3.2.0",
|
|
54
54
|
"@atlaskit/link-analytics": "^10.0.0",
|
|
55
55
|
"@atlaskit/link-client-extension": "^5.0.0",
|
|
56
56
|
"@atlaskit/link-datasource": "^4.19.0",
|
|
57
57
|
"@atlaskit/linking-common": "^9.2.0",
|
|
58
58
|
"@atlaskit/linking-types": "^14.0.0",
|
|
59
|
-
"@atlaskit/menu": "^8.
|
|
59
|
+
"@atlaskit/menu": "^8.3.0",
|
|
60
60
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
62
62
|
"@atlaskit/primitives": "^14.11.0",
|
|
63
|
-
"@atlaskit/smart-card": "^40.
|
|
63
|
+
"@atlaskit/smart-card": "^40.10.0",
|
|
64
64
|
"@atlaskit/theme": "^19.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^9.27.0",
|
|
66
66
|
"@atlaskit/tokens": "^6.0.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^107.
|
|
75
|
+
"@atlaskit/editor-common": "^107.23.0",
|
|
76
76
|
"@atlaskit/link-provider": "^3.4.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
78
78
|
"react-intl-next": "npm:react-intl@^5.18.1"
|