@atlaskit/editor-plugin-card 7.4.7 → 7.4.8

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 (78) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/types/cardPluginType.d.ts +3 -3
  3. package/dist/types/nodeviews/blockCard.d.ts +7 -7
  4. package/dist/types/nodeviews/datasource.d.ts +5 -5
  5. package/dist/types/nodeviews/embedCard.d.ts +8 -8
  6. package/dist/types/nodeviews/genericCard.d.ts +19 -19
  7. package/dist/types/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  8. package/dist/types/pm-plugins/actions.d.ts +1 -1
  9. package/dist/types/pm-plugins/doc.d.ts +5 -5
  10. package/dist/types/pm-plugins/util/state.d.ts +13 -13
  11. package/dist/types/types/index.d.ts +48 -48
  12. package/dist/types/ui/AwarenessWrapper/index.d.ts +4 -4
  13. package/dist/types/ui/ConfigureOverlay/index.d.ts +2 -2
  14. package/dist/types/ui/DatasourceAppearanceButton.d.ts +5 -5
  15. package/dist/types/ui/DatasourceDropdownOption.d.ts +3 -3
  16. package/dist/types/ui/DatasourceModal/index.d.ts +2 -2
  17. package/dist/types/ui/EditLinkToolbar.d.ts +10 -10
  18. package/dist/types/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
  19. package/dist/types/ui/EditToolbarButton/types.d.ts +4 -4
  20. package/dist/types/ui/EditorAnalyticsContext.d.ts +1 -1
  21. package/dist/types/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  22. package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +4 -4
  23. package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -1
  24. package/dist/types/ui/LayoutButton/types.d.ts +4 -4
  25. package/dist/types/ui/LinkToolbarAppearance.d.ts +6 -6
  26. package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +2 -2
  27. package/dist/types/ui/OpenPreviewButton/index.d.ts +2 -2
  28. package/dist/types/ui/Pulse/index.d.ts +6 -6
  29. package/dist/types/ui/ResizableEmbedCard.d.ts +2 -2
  30. package/dist/types/ui/ToolbarViewedEvent.d.ts +1 -1
  31. package/dist/types/ui/analytics/create-events-queue.d.ts +2 -2
  32. package/dist/types/ui/analytics/events-from-tr.d.ts +1 -1
  33. package/dist/types/ui/analytics/types.d.ts +11 -11
  34. package/dist/types/ui/analytics/utils.d.ts +1 -1
  35. package/dist/types/ui/datasourceErrorBoundary.d.ts +4 -4
  36. package/dist/types/ui/hooks/useLinkUpgradeDiscoverability.d.ts +4 -4
  37. package/dist/types/ui/preview/PreviewInvoker.d.ts +1 -1
  38. package/dist/types/ui/toolbar.d.ts +1 -1
  39. package/dist/types/ui/useFetchDatasourceInfo.d.ts +2 -2
  40. package/dist/types-ts4.5/cardPluginType.d.ts +3 -3
  41. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +7 -7
  42. package/dist/types-ts4.5/nodeviews/datasource.d.ts +5 -5
  43. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +8 -8
  44. package/dist/types-ts4.5/nodeviews/genericCard.d.ts +19 -19
  45. package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  46. package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
  47. package/dist/types-ts4.5/pm-plugins/doc.d.ts +5 -5
  48. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +13 -13
  49. package/dist/types-ts4.5/types/index.d.ts +48 -48
  50. package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +4 -4
  51. package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +2 -2
  52. package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +5 -5
  53. package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +3 -3
  54. package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +2 -2
  55. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +10 -10
  56. package/dist/types-ts4.5/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
  57. package/dist/types-ts4.5/ui/EditToolbarButton/types.d.ts +4 -4
  58. package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +1 -1
  59. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  60. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +4 -4
  61. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -1
  62. package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +4 -4
  63. package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +6 -6
  64. package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +2 -2
  65. package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +2 -2
  66. package/dist/types-ts4.5/ui/Pulse/index.d.ts +6 -6
  67. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +2 -2
  68. package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +1 -1
  69. package/dist/types-ts4.5/ui/analytics/create-events-queue.d.ts +2 -2
  70. package/dist/types-ts4.5/ui/analytics/events-from-tr.d.ts +1 -1
  71. package/dist/types-ts4.5/ui/analytics/types.d.ts +11 -11
  72. package/dist/types-ts4.5/ui/analytics/utils.d.ts +1 -1
  73. package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +4 -4
  74. package/dist/types-ts4.5/ui/hooks/useLinkUpgradeDiscoverability.d.ts +4 -4
  75. package/dist/types-ts4.5/ui/preview/PreviewInvoker.d.ts +1 -1
  76. package/dist/types-ts4.5/ui/toolbar.d.ts +1 -1
  77. package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +2 -2
  78. package/package.json +5 -5
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  export type EditorAnalyticsContextProps = {
4
- editorView?: EditorView;
5
4
  children: React.ReactNode;
5
+ editorView?: EditorView;
6
6
  };
7
7
  /**
8
8
  * Provides location attribute to child events
@@ -3,15 +3,15 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { EditorCardPluginEvents } from '../analytics/create-events-queue';
4
4
  import type { CardPluginEvent } from '../analytics/types';
5
5
  export type AnalyticsBindingsProps = {
6
- editorView: EditorView;
7
6
  cardPluginEvents: EditorCardPluginEvents<CardPluginEvent>;
7
+ editorView: EditorView;
8
8
  };
9
9
  type EventMetadata = {
10
10
  action?: string;
11
11
  inputMethod?: string;
12
- sourceEvent?: unknown;
13
12
  isRedo?: boolean;
14
13
  isUndo?: boolean;
14
+ sourceEvent?: unknown;
15
15
  };
16
16
  export declare const getMethod: (metadata: EventMetadata) => string | undefined;
17
17
  export declare const getUpdateType: (metadata: EventMetadata) => string | undefined;
@@ -7,12 +7,12 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import { type CardPlugin } from '../cardPluginType';
9
9
  export interface HyperlinkToolbarAppearanceProps {
10
- intl: IntlShape;
11
- editorState: EditorState;
12
- url: string;
13
- editorView?: EditorView;
14
10
  cardOptions?: CardOptions;
15
11
  editorAnalyticsApi: EditorAnalyticsAPI | undefined;
16
12
  editorPluginApi: ExtractInjectionAPI<CardPlugin> | undefined;
13
+ editorState: EditorState;
14
+ editorView?: EditorView;
15
+ intl: IntlShape;
16
+ url: string;
17
17
  }
18
18
  export declare function HyperlinkToolbarAppearance(props: HyperlinkToolbarAppearanceProps): React.JSX.Element | null;
@@ -1,7 +1,7 @@
1
1
  import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlaskit/editor-common/types';
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
- settingsConfig: FloatingToolbarItem<Command>;
5
4
  allowDatasource?: boolean;
6
5
  isDatasourceView?: boolean;
6
+ settingsConfig: FloatingToolbarItem<Command>;
7
7
  }) => FloatingToolbarCustom<Command>;
@@ -5,14 +5,14 @@ import type { cardPlugin } from '../../index';
5
5
  export declare const DATASOURCE_TABLE_LAYOUTS: readonly ["full-width", "center", "wide"];
6
6
  export type DatasourceTableLayout = (typeof DATASOURCE_TABLE_LAYOUTS)[number];
7
7
  export type LayoutButtonProps = {
8
- mountPoint?: HTMLElement;
9
8
  boundariesElement?: HTMLElement;
10
- scrollableElement?: HTMLElement;
11
- targetElement?: HTMLElement;
9
+ intl: IntlShape;
12
10
  layout?: DatasourceTableLayout;
11
+ mountPoint?: HTMLElement;
13
12
  onLayoutChange?: (layout: DatasourceTableLayout) => void;
13
+ scrollableElement?: HTMLElement;
14
+ targetElement?: HTMLElement;
14
15
  testId?: string;
15
- intl: IntlShape;
16
16
  };
17
17
  export interface LayoutButtonWrapperProps extends Pick<LayoutButtonProps, 'mountPoint' | 'boundariesElement' | 'scrollableElement'> {
18
18
  api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
@@ -6,16 +6,16 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
6
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
7
  import type { CardContext } from '@atlaskit/link-provider';
8
8
  export interface LinkToolbarAppearanceProps {
9
- intl: IntlShape;
10
- editorAnalyticsApi: EditorAnalyticsAPI | undefined;
9
+ allowBlockCards?: boolean;
10
+ allowEmbeds?: boolean;
11
11
  currentAppearance?: CardAppearance;
12
+ editorAnalyticsApi: EditorAnalyticsAPI | undefined;
12
13
  editorState: EditorState;
13
14
  editorView?: EditorView;
14
- url?: string;
15
- allowEmbeds?: boolean;
16
- allowBlockCards?: boolean;
17
- showUpgradeDiscoverability?: boolean;
15
+ intl: IntlShape;
18
16
  isDatasourceView?: boolean;
17
+ showUpgradeDiscoverability?: boolean;
18
+ url?: string;
19
19
  }
20
20
  export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, Object> {
21
21
  renderDropdown: (view?: EditorView, cardContext?: CardContext) => React.JSX.Element | null;
@@ -2,13 +2,13 @@ import React from 'react';
2
2
  import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types';
3
3
  import { type LinkToolbarAppearanceProps } from './LinkToolbarAppearance';
4
4
  type Props = LinkToolbarAppearanceProps & {
5
+ allowDatasource?: boolean;
5
6
  dispatchCommand: (command: Command) => void;
6
7
  settingsConfig: FloatingToolbarItem<Command>;
7
- allowDatasource?: boolean;
8
8
  };
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
- settingsConfig: FloatingToolbarItem<Command>;
12
11
  allowDatasource?: boolean;
12
+ settingsConfig: FloatingToolbarItem<Command>;
13
13
  }) => FloatingToolbarDropdown<Command>;
14
14
  export {};
@@ -3,9 +3,9 @@ import { type IntlShape } from 'react-intl-next';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
5
  type OpenPreviewPanelToolbarButtonProps = {
6
- node: PMNode;
7
- intl: IntlShape;
8
6
  editorAnalyticsApi?: EditorAnalyticsAPI;
7
+ intl: IntlShape;
8
+ node: PMNode;
9
9
  };
10
10
  export declare const OpenPreviewPanelToolbarButton: ({ node, intl, }: OpenPreviewPanelToolbarButtonProps) => React.JSX.Element | null;
11
11
  export {};
@@ -5,6 +5,12 @@ export interface PulseProps {
5
5
  * The component around which the Pulse should be displayed
6
6
  */
7
7
  children: JSX.Element;
8
+ /**
9
+ * Indicates when the feature is considered discovered. If "start" is passed, local storage key will be invalidated
10
+ * as soon as the animation starts. If "iteration" is passed (the default one), it will be invalidated after the first iteration
11
+ */
12
+ discoveryMode?: PulseDiscoveryMode;
13
+ isInline?: boolean;
8
14
  /**
9
15
  * The key that is used in local storage to identify the descoverability of a feature where the Pulse is used
10
16
  */
@@ -13,13 +19,7 @@ export interface PulseProps {
13
19
  * The time in ms after which the key in local storage will be considered expired and the Pulse will be shown again
14
20
  */
15
21
  localStorageKeyExpirationInMs?: number;
16
- /**
17
- * Indicates when the feature is considered discovered. If "start" is passed, local storage key will be invalidated
18
- * as soon as the animation starts. If "iteration" is passed (the default one), it will be invalidated after the first iteration
19
- */
20
- discoveryMode?: PulseDiscoveryMode;
21
22
  shouldShowPulse?: boolean;
22
23
  testId?: string;
23
- isInline?: boolean;
24
24
  }
25
25
  export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, isInline, }: PulseProps) => React.JSX.Element;
@@ -11,10 +11,10 @@ type State = {
11
11
  resizedPctWidth?: number;
12
12
  };
13
13
  export type Props = Omit<ResizerProps, 'height' | 'width'> & {
14
- width?: number;
15
- height?: number;
16
14
  aspectRatio: number;
15
+ height?: number;
17
16
  isResizeDisabled?: boolean;
17
+ width?: number;
18
18
  };
19
19
  export default class ResizableEmbedCard extends React.Component<Props, State> {
20
20
  static defaultProps: {
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { EditorAnalyticsContextProps } from './EditorAnalyticsContext';
3
3
  type ToolbarViewedEventProps = {
4
- url?: string;
5
4
  display: string | null;
5
+ url?: string;
6
6
  };
7
7
  /**
8
8
  * Provides analytics context and card context
@@ -1,9 +1,9 @@
1
1
  export type Subscriber<T> = (event: T) => void;
2
2
  export type EditorCardPluginEvents<T> = {
3
- push: (...events: T[]) => void;
4
- subscribe: (listener: Subscriber<T>) => () => void;
5
3
  flush: () => void;
6
4
  getSize: () => number;
5
+ push: (...events: T[]) => void;
6
+ subscribe: (listener: Subscriber<T>) => () => void;
7
7
  };
8
8
  /**
9
9
  * Simple mechanism to defer event related callbacks
@@ -7,8 +7,8 @@ export declare const findChanged: (tr: Transaction | ReadonlyTransaction, state:
7
7
  removed: Entity[];
8
8
  inserted: Entity[];
9
9
  updated: ({
10
- removed: Entity;
11
10
  inserted: Entity;
11
+ removed: Entity;
12
12
  } | {
13
13
  inserted: Entity;
14
14
  previous: {
@@ -1,17 +1,17 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  export type Entity = {
3
- pos: number;
4
3
  node: Node;
5
4
  nodeContext: string;
5
+ pos: number;
6
6
  };
7
7
  type Metadata<T = Object> = {
8
- node: Node;
9
- isUndo?: boolean;
10
- isRedo?: boolean;
11
8
  action?: string;
12
9
  inputMethod?: string;
13
- sourceEvent?: unknown;
10
+ isRedo?: boolean;
11
+ isUndo?: boolean;
12
+ node: Node;
14
13
  nodeContext?: string;
14
+ sourceEvent?: unknown;
15
15
  } & T;
16
16
  type UpdateMetadata = {
17
17
  previousDisplay?: string;
@@ -31,34 +31,34 @@ export declare enum EVENT_SUBJECT {
31
31
  * events can be derived from them / think of them in the same way
32
32
  */
33
33
  export type LinkCreatedEvent = {
34
+ data: Metadata;
34
35
  event: EVENT.CREATED;
35
36
  subject: EVENT_SUBJECT.LINK;
36
- data: Metadata;
37
37
  };
38
38
  export type LinkUpdatedEvent = {
39
+ data: Metadata<UpdateMetadata>;
39
40
  event: EVENT.UPDATED;
40
41
  subject: EVENT_SUBJECT.LINK;
41
- data: Metadata<UpdateMetadata>;
42
42
  };
43
43
  export type LinkDeletedEvent = {
44
+ data: Metadata;
44
45
  event: EVENT.DELETED;
45
46
  subject: EVENT_SUBJECT.LINK;
46
- data: Metadata;
47
47
  };
48
48
  export type DatasourceCreatedEvent = {
49
+ data: Metadata;
49
50
  event: EVENT.CREATED;
50
51
  subject: EVENT_SUBJECT.DATASOURCE;
51
- data: Metadata;
52
52
  };
53
53
  export type DatasourceUpdatedEvent = {
54
+ data: Metadata<UpdateMetadata>;
54
55
  event: EVENT.UPDATED;
55
56
  subject: EVENT_SUBJECT.DATASOURCE;
56
- data: Metadata<UpdateMetadata>;
57
57
  };
58
58
  export type DatasourceDeletedEvent = {
59
+ data: Metadata;
59
60
  event: EVENT.DELETED;
60
61
  subject: EVENT_SUBJECT.DATASOURCE;
61
- data: Metadata;
62
62
  };
63
63
  export type LinkEvent = LinkCreatedEvent | LinkUpdatedEvent | LinkDeletedEvent;
64
64
  export type DatasourceEvent = DatasourceCreatedEvent | DatasourceUpdatedEvent | DatasourceDeletedEvent;
@@ -10,7 +10,7 @@ export declare function getNodeSubject(node: Node): EVENT_SUBJECT | null;
10
10
  /**
11
11
  * Analytics appearance for link object
12
12
  */
13
- export declare function appearanceForLink(node: Node): "url" | import("@atlaskit/editor-common/provider-factory").CardAppearance;
13
+ export declare function appearanceForLink(node: Node): import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
14
14
  export declare function getUrl(node: Node): string | undefined;
15
15
  export declare const getNodeContext: (doc: Node, pos: number) => string;
16
16
  export declare const findAtPositions: (tr: Transaction | ReadonlyTransaction, positions: number[]) => Entity[];
@@ -3,12 +3,12 @@ import type { DatasourceModalType } from '@atlaskit/editor-common/types';
3
3
  import type { APIError } from '@atlaskit/linking-common';
4
4
  import type { DatasourceProps } from '../nodeviews/datasource';
5
5
  export type DatasourceErrorBoundaryProps = React.PropsWithChildren<{
6
- url?: string;
7
- unsupportedComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
6
+ datasourceId?: string;
7
+ datasourceModalType?: DatasourceModalType;
8
8
  handleError?: () => void;
9
+ unsupportedComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
10
+ url?: string;
9
11
  view: DatasourceProps['view'];
10
- datasourceModalType?: DatasourceModalType;
11
- datasourceId?: string;
12
12
  }>;
13
13
  export declare class DatasourceErrorBoundary extends React.Component<DatasourceErrorBoundaryProps> {
14
14
  state: {
@@ -2,12 +2,12 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { CardContext } from '@atlaskit/link-provider';
3
3
  import type { cardPlugin } from '../../cardPlugin';
4
4
  export type LinkUpgradeDiscoverabilityProps = {
5
- url: string;
6
- linkPosition: number;
7
5
  cardContext?: CardContext;
8
- pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
9
- isPulseEnabled?: boolean;
10
6
  isOverlayEnabled?: boolean;
7
+ isPulseEnabled?: boolean;
8
+ linkPosition: number;
9
+ pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
10
+ url: string;
11
11
  };
12
12
  declare const useLinkUpgradeDiscoverability: ({ url, linkPosition, cardContext, pluginInjectionApi, isPulseEnabled, isOverlayEnabled, }: LinkUpgradeDiscoverabilityProps) => {
13
13
  shouldShowToolbarPulse: boolean | undefined;
@@ -1,12 +1,12 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  type PreviewInvokerProps = {
4
- url: string;
5
4
  appearance: 'inline' | 'block' | 'embed';
6
5
  children: (api: {
7
6
  canPreview: boolean;
8
7
  invokePreview?: () => void;
9
8
  }) => ReactNode;
9
+ url: string;
10
10
  };
11
11
  export declare const PreviewInvoker: ({ url, appearance, children }: PreviewInvokerProps) => React.JSX.Element;
12
12
  export {};
@@ -13,7 +13,7 @@ export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: b
13
13
  export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
14
14
  export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearance: string, status: string, isDiscoverabilityEnabled: boolean) => boolean;
15
15
  export declare const getStartingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string, onEditLink: Command, metadata: {
16
- url: string;
17
16
  title: string;
17
+ url: string;
18
18
  }, state?: EditorState) => FloatingToolbarItem<Command>[];
19
19
  export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string) => FloatingToolbarItem<Command>[];
@@ -2,10 +2,10 @@ import type { JiraIssueDatasourceParameters } from '@atlaskit/link-datasource';
2
2
  import type { CardContext } from '@atlaskit/link-provider';
3
3
  import type { DatasourceParameters } from '@atlaskit/linking-types';
4
4
  export interface useFetchDatasourceInfoProps {
5
- isRegularCardNode: boolean;
6
- url?: string;
7
5
  cardContext?: CardContext;
6
+ isRegularCardNode: boolean;
8
7
  nodeParameters?: DatasourceParameters | JiraIssueDatasourceParameters;
8
+ url?: string;
9
9
  }
10
10
  export declare const useFetchDatasourceInfo: ({ isRegularCardNode, url, cardContext, nodeParameters, }: useFetchDatasourceInfoProps) => {
11
11
  datasourceId: string | undefined;
@@ -15,10 +15,10 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
15
15
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
16
16
  import type { CardPluginOptions, CardPluginState } from './types';
17
17
  type DummyAnnotationPlugin = NextEditorPlugin<'annotation', {
18
- sharedState: InlineCommentPluginState;
19
18
  actions: {
20
19
  setInlineCommentDraftState: (isDraft: boolean, inputMethod: INPUT_METHOD) => Command;
21
20
  };
21
+ sharedState: InlineCommentPluginState;
22
22
  }>;
23
23
  export type CardPluginDependencies = [
24
24
  OptionalPlugin<FeatureFlagsPlugin>,
@@ -35,9 +35,9 @@ export type CardPluginDependencies = [
35
35
  OptionalPlugin<BasePlugin>
36
36
  ];
37
37
  export type CardPlugin = NextEditorPlugin<'card', {
38
- pluginConfiguration: CardPluginOptions | undefined;
38
+ actions: CardPluginActions;
39
39
  dependencies: CardPluginDependencies;
40
+ pluginConfiguration: CardPluginOptions | undefined;
40
41
  sharedState: CardPluginState | null;
41
- actions: CardPluginActions;
42
42
  }>;
43
43
  export {};
@@ -13,8 +13,8 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
13
13
  id?: string;
14
14
  });
15
15
  onResolve: (data: {
16
- url?: string;
17
16
  title?: string;
17
+ url?: string;
18
18
  }) => void;
19
19
  componentWillUnmount(): void;
20
20
  private removeCardDispatched;
@@ -37,16 +37,16 @@ export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
37
37
  destroy(): void;
38
38
  }
39
39
  export interface BlockCardNodeViewProperties {
40
- pmPluginFactoryParams: PMPluginFactoryParams;
41
40
  actionOptions: BlockCardNodeViewProps['actionOptions'];
42
- pluginInjectionApi: BlockCardNodeViewProps['pluginInjectionApi'];
43
- onClickCallback: BlockCardNodeViewProps['onClickCallback'];
44
41
  allowDatasource: boolean | undefined;
45
- inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
46
- isPageSSRed: BlockCardNodeViewProps['isPageSSRed'];
47
42
  CompetitorPrompt?: React.ComponentType<{
48
- sourceUrl: string;
49
43
  linkType?: string;
44
+ sourceUrl: string;
50
45
  }>;
46
+ inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
47
+ isPageSSRed: BlockCardNodeViewProps['isPageSSRed'];
48
+ onClickCallback: BlockCardNodeViewProps['onClickCallback'];
49
+ pluginInjectionApi: BlockCardNodeViewProps['pluginInjectionApi'];
50
+ pmPluginFactoryParams: PMPluginFactoryParams;
51
51
  }
52
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;
@@ -13,13 +13,13 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
13
13
  import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
14
14
  import type { cardPlugin } from '../index';
15
15
  export interface DatasourceProps extends ReactComponentProps {
16
- node: PMNode;
17
- view: EditorView;
18
- getPos: getPosHandler;
19
- portalProviderAPI: PortalProviderAPI;
20
16
  eventDispatcher: EventDispatcher;
21
- pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
17
+ getPos: getPosHandler;
22
18
  isNodeNested?: boolean;
19
+ node: PMNode;
20
+ pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
21
+ portalProviderAPI: PortalProviderAPI;
22
+ view: EditorView;
23
23
  }
24
24
  interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
25
25
  }
@@ -8,8 +8,8 @@ import type { cardPlugin } from '../index';
8
8
  import type { SmartCardProps } from './genericCard';
9
9
  export type EmbedCardState = {
10
10
  hasPreview: boolean;
11
- liveHeight?: number;
12
11
  initialAspectRatio?: number;
12
+ liveHeight?: number;
13
13
  };
14
14
  export declare class EmbedCardComponent extends React.PureComponent<SmartCardProps & {
15
15
  id?: string;
@@ -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
25
  aspectRatio?: number;
26
+ title?: string;
27
+ url?: string;
28
28
  }) => void;
29
29
  updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
30
30
  private getLineLength;
@@ -55,13 +55,13 @@ export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
55
55
  destroy(): void;
56
56
  }
57
57
  export interface EmbedCardNodeViewProperties {
58
+ actionOptions: EmbedCardNodeViewProps['actionOptions'];
58
59
  allowResizing: EmbedCardNodeViewProps['allowResizing'];
60
+ CompetitorPrompt?: EmbedCardNodeViewProps['CompetitorPrompt'];
59
61
  fullWidthMode: EmbedCardNodeViewProps['fullWidthMode'];
60
- pmPluginFactoryParams: PMPluginFactoryParams;
61
- pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
62
- actionOptions: EmbedCardNodeViewProps['actionOptions'];
63
- onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
64
62
  isPageSSRed: EmbedCardNodeViewProps['isPageSSRed'];
65
- CompetitorPrompt?: EmbedCardNodeViewProps['CompetitorPrompt'];
63
+ onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
64
+ pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
65
+ pmPluginFactoryParams: PMPluginFactoryParams;
66
66
  }
67
67
  export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, onClickCallback, CompetitorPrompt, isPageSSRed, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
@@ -16,40 +16,40 @@ export type EditorContext<T> = React.Context<T> & {
16
16
  value: T;
17
17
  };
18
18
  export interface CardNodeViewProps extends ReactComponentProps {
19
- providerFactory?: ProviderFactory;
20
19
  eventDispatcher?: EventDispatcher;
20
+ providerFactory?: ProviderFactory;
21
21
  }
22
22
  export interface CardProps extends CardNodeViewProps {
23
+ __livePage?: boolean;
24
+ actionOptions?: BaseCardProps['actionOptions'];
25
+ allowResizing?: boolean;
23
26
  children?: React.ReactNode;
24
- node: PMNode;
25
- view: EditorView;
26
- getPos: getPosHandler;
27
27
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
28
28
  eventDispatcher?: EventDispatcher;
29
- allowResizing?: boolean;
30
29
  fullWidthMode?: boolean;
31
- useAlternativePreloader?: boolean;
32
- actionOptions?: BaseCardProps['actionOptions'];
33
- pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
30
+ getPos: getPosHandler;
31
+ hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
32
+ node: PMNode;
34
33
  onClickCallback?: OnClickCallback;
34
+ pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
35
35
  showHoverPreview?: BaseCardProps['showHoverPreview'];
36
- hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
37
- __livePage?: boolean;
36
+ useAlternativePreloader?: boolean;
37
+ view: EditorView;
38
38
  }
39
39
  export interface SmartCardProps extends CardProps {
40
- pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
41
- cardContext?: EditorContext<CardContext | undefined>;
42
- onClick?: EventHandler<MouseEvent | KeyboardEvent> | undefined;
43
- onResolve?: (tr: Transaction, title?: string) => void;
44
- isHovered?: boolean;
45
- allowEmbeds?: boolean;
46
40
  allowBlockCards?: boolean;
47
- enableInlineUpgradeFeatures?: boolean;
48
- isPageSSRed?: boolean;
41
+ allowEmbeds?: boolean;
42
+ cardContext?: EditorContext<CardContext | undefined>;
49
43
  CompetitorPrompt?: React.ComponentType<{
50
- sourceUrl: string;
51
44
  linkType?: string;
45
+ sourceUrl: string;
52
46
  }>;
47
+ enableInlineUpgradeFeatures?: boolean;
48
+ isHovered?: boolean;
49
+ isPageSSRed?: boolean;
50
+ onClick?: EventHandler<MouseEvent | KeyboardEvent> | undefined;
51
+ onResolve?: (tr: Transaction, title?: string) => void;
52
+ pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
53
53
  }
54
54
  /**
55
55
  *
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { SmartCardProps } from './genericCard';
3
3
  export type InlineCardWithAwarenessProps = {
4
- isPulseEnabled?: boolean;
5
4
  isOverlayEnabled?: boolean;
5
+ isPulseEnabled?: boolean;
6
6
  isSelected?: boolean;
7
7
  };
8
8
  export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, pluginInjectionApi, onClick, isPulseEnabled, isOverlayEnabled, isSelected, isPageSSRed, appearance, }: SmartCardProps & InlineCardWithAwarenessProps) => React.JSX.Element>;
@@ -16,8 +16,8 @@ export declare const setProvider: (cardProvider: CardProvider | null) => (tr: Tr
16
16
  export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) => (tr: Transaction) => Transaction;
17
17
  export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
18
18
  export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
19
- layout: DatasourceTableLayout;
20
19
  datasourceTableRef?: HTMLElement;
20
+ layout: DatasourceTableLayout;
21
21
  }) => (tr: Transaction) => Transaction;
22
22
  export declare const showLinkToolbar: (tr: Transaction) => Transaction;
23
23
  export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
@@ -24,13 +24,13 @@ export type LinkNodes = {
24
24
  };
25
25
  export declare const getLinkNodeType: (appearance: CardAppearance, linkNodes: LinkNodes) => NodeType;
26
26
  type UpdateCardArgs = {
27
- state: EditorState;
28
- node: Node;
27
+ inputMethod?: string;
28
+ isDeletingConfig?: boolean;
29
29
  newAdf: DatasourceAdf | InlineCardAdf;
30
- view: EditorView;
30
+ node: Node;
31
31
  sourceEvent?: UIAnalyticsEvent;
32
- isDeletingConfig?: boolean;
33
- inputMethod?: string;
32
+ state: EditorState;
33
+ view: EditorView;
34
34
  };
35
35
  export declare const updateCardViaDatasource: (args: UpdateCardArgs) => void;
36
36
  export declare const insertDatasource: (state: EditorState, adf: DatasourceAdf | InlineCardAdf, view: EditorView, sourceEvent?: UIAnalyticsEvent) => void;
@@ -4,39 +4,39 @@ export declare const getPluginState: (editorState: EditorState) => CardPluginSta
4
4
  export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState, tr: ReadonlyTransaction) => {
5
5
  requests: {
6
6
  pos: number;
7
- url: string;
7
+ analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION;
8
8
  appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
9
9
  compareLinkText: boolean;
10
- source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
11
10
  previousAppearance?: import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
12
- analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION;
13
11
  shouldReplaceLink?: boolean;
12
+ source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
14
13
  sourceEvent?: import("@atlaskit/analytics-next").UIAnalyticsEvent | null | undefined;
14
+ url: string;
15
15
  }[];
16
16
  cards: {
17
17
  pos: number;
18
+ id?: string;
18
19
  title?: string;
19
20
  url?: string;
20
- id?: string;
21
21
  }[];
22
- provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
22
+ allowBlockCards?: boolean;
23
+ allowEmbeds?: boolean;
24
+ datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType;
23
25
  datasourceStash: {
24
26
  [x: string]: {
25
27
  views: import("@atlaskit/linking-common").DatasourceAdfView[];
26
28
  };
27
29
  };
28
- showLinkingToolbar: boolean;
29
- smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents;
30
- editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance;
31
- showDatasourceModal: boolean;
32
- datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType;
33
30
  datasourceTableRef?: HTMLElement;
34
- layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout;
31
+ editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance;
35
32
  inlineCardAwarenessCandidatePosition?: number;
33
+ layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout;
36
34
  overlayCandidatePosition?: number;
35
+ provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
37
36
  removeOverlay?: () => void;
38
37
  selectedInlineLinkPosition?: number;
39
- allowEmbeds?: boolean;
40
- allowBlockCards?: boolean;
38
+ showDatasourceModal: boolean;
39
+ showLinkingToolbar: boolean;
40
+ smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents;
41
41
  };
42
42
  export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];