@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.
Files changed (71) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/nodeviews/inlineCard.js +3 -1
  3. package/dist/cjs/nodeviews/lazy-block-card.js +3 -1
  4. package/dist/cjs/nodeviews/lazy-embed-card.js +3 -1
  5. package/dist/cjs/nodeviews/lazy-inline-card.js +2 -1
  6. package/dist/cjs/pm-plugins/main.js +2 -0
  7. package/dist/cjs/ui/OpenPreviewButton/index.js +78 -0
  8. package/dist/cjs/ui/toolbar.js +14 -2
  9. package/dist/es2019/nodeviews/inlineCard.js +3 -1
  10. package/dist/es2019/nodeviews/lazy-block-card.js +5 -1
  11. package/dist/es2019/nodeviews/lazy-embed-card.js +5 -1
  12. package/dist/es2019/nodeviews/lazy-inline-card.js +3 -1
  13. package/dist/es2019/pm-plugins/main.js +2 -0
  14. package/dist/es2019/ui/OpenPreviewButton/index.js +73 -0
  15. package/dist/es2019/ui/toolbar.js +12 -2
  16. package/dist/esm/nodeviews/inlineCard.js +3 -1
  17. package/dist/esm/nodeviews/lazy-block-card.js +3 -1
  18. package/dist/esm/nodeviews/lazy-embed-card.js +3 -1
  19. package/dist/esm/nodeviews/lazy-inline-card.js +2 -1
  20. package/dist/esm/pm-plugins/main.js +2 -0
  21. package/dist/esm/ui/OpenPreviewButton/index.js +71 -0
  22. package/dist/esm/ui/toolbar.js +14 -2
  23. package/dist/types/nodeviews/blockCard.d.ts +5 -4
  24. package/dist/types/nodeviews/datasource.d.ts +1 -1
  25. package/dist/types/nodeviews/embedCard.d.ts +6 -5
  26. package/dist/types/nodeviews/inlineCard.d.ts +1 -1
  27. package/dist/types/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
  28. package/dist/types/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
  29. package/dist/types/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
  30. package/dist/types/pm-plugins/actions.d.ts +1 -1
  31. package/dist/types/pm-plugins/doc.d.ts +1 -1
  32. package/dist/types/pm-plugins/util/resolve.d.ts +1 -1
  33. package/dist/types/pm-plugins/util/state.d.ts +18 -18
  34. package/dist/types/pm-plugins/utils.d.ts +2 -5
  35. package/dist/types/types/index.d.ts +0 -1
  36. package/dist/types/ui/AwarenessWrapper/index.d.ts +0 -1
  37. package/dist/types/ui/ConfigureOverlay/index.d.ts +0 -1
  38. package/dist/types/ui/EditLinkToolbar.d.ts +1 -1
  39. package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
  40. package/dist/types/ui/InlineCardOverlay/types.d.ts +0 -1
  41. package/dist/types/ui/LayoutButton/index.d.ts +0 -1
  42. package/dist/types/ui/LayoutButton/utils.d.ts +2 -1
  43. package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
  44. package/dist/types/ui/OpenPreviewButton/index.d.ts +11 -0
  45. package/dist/types/ui/ResizableEmbedCard.d.ts +1 -1
  46. package/dist/types/ui/ToolbarViewedEvent.d.ts +1 -1
  47. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +5 -4
  48. package/dist/types-ts4.5/nodeviews/datasource.d.ts +1 -1
  49. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +6 -5
  50. package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -1
  51. package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
  52. package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
  53. package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
  54. package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
  55. package/dist/types-ts4.5/pm-plugins/doc.d.ts +1 -1
  56. package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +1 -1
  57. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +18 -18
  58. package/dist/types-ts4.5/pm-plugins/utils.d.ts +2 -5
  59. package/dist/types-ts4.5/types/index.d.ts +0 -1
  60. package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +0 -1
  61. package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +0 -1
  62. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +1 -1
  63. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
  64. package/dist/types-ts4.5/ui/InlineCardOverlay/types.d.ts +0 -1
  65. package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +0 -1
  66. package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +2 -1
  67. package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
  68. package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +11 -0
  69. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +1 -1
  70. package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +1 -1
  71. 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 | undefined;
26
- title?: string | undefined;
27
- aspectRatio?: number | undefined;
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 | undefined;
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?: boolean;
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 | undefined;
5
- marks?: string | undefined;
6
- group?: string | undefined;
7
- inline?: boolean | undefined;
8
- atom?: boolean | undefined;
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
- } | undefined;
12
- selectable?: boolean | undefined;
13
- draggable?: boolean | undefined;
14
- code?: boolean | undefined;
15
- whitespace?: "pre" | "normal" | undefined;
16
- definingAsContext?: boolean | undefined;
17
- definingForContent?: boolean | undefined;
18
- defining?: boolean | undefined;
19
- isolating?: boolean | undefined;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[] | undefined;
21
- toDebugString?: ((node: PMNode) => string) | undefined;
22
- leafText?: ((node: PMNode) => string) | undefined;
23
- linebreakReplacement?: boolean | undefined;
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 | undefined;
5
- marks?: string | undefined;
6
- group?: string | undefined;
7
- inline?: boolean | undefined;
8
- atom?: boolean | undefined;
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
- } | undefined;
12
- selectable?: boolean | undefined;
13
- draggable?: boolean | undefined;
14
- code?: boolean | undefined;
15
- whitespace?: "pre" | "normal" | undefined;
16
- definingAsContext?: boolean | undefined;
17
- definingForContent?: boolean | undefined;
18
- defining?: boolean | undefined;
19
- isolating?: boolean | undefined;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[] | undefined;
21
- toDebugString?: ((node: PMNode) => string) | undefined;
22
- leafText?: ((node: PMNode) => string) | undefined;
23
- linebreakReplacement?: boolean | undefined;
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 | undefined;
5
- marks?: string | undefined;
6
- group?: string | undefined;
7
- inline?: boolean | undefined;
8
- atom?: boolean | undefined;
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
- } | undefined;
12
- selectable?: boolean | undefined;
13
- draggable?: boolean | undefined;
14
- code?: boolean | undefined;
15
- whitespace?: "pre" | "normal" | undefined;
16
- definingAsContext?: boolean | undefined;
17
- definingForContent?: boolean | undefined;
18
- defining?: boolean | undefined;
19
- isolating?: boolean | undefined;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[] | undefined;
21
- toDebugString?: ((node: PMNode) => string) | undefined;
22
- leafText?: ((node: PMNode) => string) | undefined;
23
- linebreakReplacement?: boolean | undefined;
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 | undefined;
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 | 'url') => Transaction;
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: (_: 'cardProvider', provider: Promise<CardProvider> | undefined, view: EditorView) => void;
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?: "url" | import("@atlaskit/editor-common/provider-factory").CardAppearance | undefined;
12
- analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION | undefined;
13
- shouldReplaceLink?: boolean | undefined;
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 | undefined;
19
- url?: string | undefined;
20
- id?: string | undefined;
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").DatasourceAdfTableView[];
25
+ views: import("@atlaskit/linking-common").DatasourceAdfView[];
26
26
  };
27
27
  };
28
28
  showLinkingToolbar: boolean;
29
- smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents | undefined;
30
- editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance | undefined;
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 | undefined;
33
- datasourceTableRef?: HTMLElement | undefined;
34
- layout?: "center" | "wide" | "full-width" | undefined;
35
- inlineCardAwarenessCandidatePosition?: number | undefined;
36
- overlayCandidatePosition?: number | undefined;
37
- removeOverlay?: (() => void) | undefined;
38
- selectedInlineLinkPosition?: number | undefined;
39
- allowEmbeds?: boolean | undefined;
40
- allowBlockCards?: boolean | undefined;
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['store']) => {};
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
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { RichMediaAttributes } from '@atlaskit/adf-schema';
3
2
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
4
3
  import type { ACTION } from '@atlaskit/editor-common/analytics';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { jsx } from '@emotion/react';
3
2
  import type { SmartCardProps } from '../../nodeviews/genericCard';
4
3
  type AwarenessWrapperProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { jsx } from '@emotion/react';
3
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
4
3
  declare const OverlayWrapper: ({ view, targetElementPos, children, isHoveredCallback: hoverCallback, onOpenLinkClick, }: {
@@ -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?: Partial<import("packages/linking-platform/link-picker/dist/types").LinkPickerProps> | undefined;
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 | undefined;
6
- isDatasourceView?: boolean | undefined;
5
+ allowDatasource?: boolean;
6
+ isDatasourceView?: boolean;
7
7
  }) => FloatingToolbarCustom<Command>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type InlineCardOverlayProps = React.HTMLAttributes<HTMLSpanElement> & {
3
2
  isSelected?: boolean;
4
3
  isVisible?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { jsx } from '@emotion/react';
3
2
  import type { WrappedComponentProps } from 'react-intl-next';
4
3
  import type { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
@@ -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 "center" | "wide" | "full-width";
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 | undefined;
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) => 'center' | 'wide' | 'full-width';
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, 'children'>) => React.JSX.Element;
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 | undefined;
17
- title?: string | undefined;
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 | undefined;
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 | undefined;
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 | undefined;
26
- title?: string | undefined;
27
- aspectRatio?: number | undefined;
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 | undefined;
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?: boolean;
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 | undefined;
5
- marks?: string | undefined;
6
- group?: string | undefined;
7
- inline?: boolean | undefined;
8
- atom?: boolean | undefined;
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
- } | undefined;
12
- selectable?: boolean | undefined;
13
- draggable?: boolean | undefined;
14
- code?: boolean | undefined;
15
- whitespace?: "pre" | "normal" | undefined;
16
- definingAsContext?: boolean | undefined;
17
- definingForContent?: boolean | undefined;
18
- defining?: boolean | undefined;
19
- isolating?: boolean | undefined;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[] | undefined;
21
- toDebugString?: ((node: PMNode) => string) | undefined;
22
- leafText?: ((node: PMNode) => string) | undefined;
23
- linebreakReplacement?: boolean | undefined;
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 | undefined;
5
- marks?: string | undefined;
6
- group?: string | undefined;
7
- inline?: boolean | undefined;
8
- atom?: boolean | undefined;
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
- } | undefined;
12
- selectable?: boolean | undefined;
13
- draggable?: boolean | undefined;
14
- code?: boolean | undefined;
15
- whitespace?: "pre" | "normal" | undefined;
16
- definingAsContext?: boolean | undefined;
17
- definingForContent?: boolean | undefined;
18
- defining?: boolean | undefined;
19
- isolating?: boolean | undefined;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[] | undefined;
21
- toDebugString?: ((node: PMNode) => string) | undefined;
22
- leafText?: ((node: PMNode) => string) | undefined;
23
- linebreakReplacement?: boolean | undefined;
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 | undefined;
5
- marks?: string | undefined;
6
- group?: string | undefined;
7
- inline?: boolean | undefined;
8
- atom?: boolean | undefined;
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
- } | undefined;
12
- selectable?: boolean | undefined;
13
- draggable?: boolean | undefined;
14
- code?: boolean | undefined;
15
- whitespace?: "pre" | "normal" | undefined;
16
- definingAsContext?: boolean | undefined;
17
- definingForContent?: boolean | undefined;
18
- defining?: boolean | undefined;
19
- isolating?: boolean | undefined;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[] | undefined;
21
- toDebugString?: ((node: PMNode) => string) | undefined;
22
- leafText?: ((node: PMNode) => string) | undefined;
23
- linebreakReplacement?: boolean | undefined;
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 | undefined;
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;