@atlaskit/editor-plugin-card 13.0.0 → 13.0.2

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 (65) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/nodeviews/datasource.js +1 -1
  3. package/dist/cjs/nodeviews/inlineCard.js +8 -1
  4. package/dist/cjs/pm-plugins/utils.js +3 -1
  5. package/dist/cjs/ui/AwarenessWrapper/index.js +1 -1
  6. package/dist/cjs/ui/ConfigureOverlay/index.js +1 -1
  7. package/dist/cjs/ui/DatasourceAppearanceButton.js +1 -1
  8. package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
  9. package/dist/cjs/ui/EditToolbarButton/index.js +1 -1
  10. package/dist/cjs/ui/InlineCardOverlay/index.js +1 -1
  11. package/dist/cjs/ui/LayoutButton/index.js +3 -2
  12. package/dist/cjs/ui/ResizableEmbedCard.js +1 -1
  13. package/dist/es2019/nodeviews/datasource.js +1 -1
  14. package/dist/es2019/nodeviews/inlineCard.js +9 -2
  15. package/dist/es2019/pm-plugins/utils.js +3 -1
  16. package/dist/es2019/ui/AwarenessWrapper/index.js +1 -1
  17. package/dist/es2019/ui/ConfigureOverlay/index.js +1 -1
  18. package/dist/es2019/ui/DatasourceAppearanceButton.js +1 -1
  19. package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
  20. package/dist/es2019/ui/EditToolbarButton/index.js +1 -1
  21. package/dist/es2019/ui/InlineCardOverlay/index.js +1 -1
  22. package/dist/es2019/ui/LayoutButton/index.js +3 -2
  23. package/dist/es2019/ui/ResizableEmbedCard.js +1 -1
  24. package/dist/esm/nodeviews/datasource.js +1 -1
  25. package/dist/esm/nodeviews/inlineCard.js +9 -2
  26. package/dist/esm/pm-plugins/utils.js +3 -1
  27. package/dist/esm/ui/AwarenessWrapper/index.js +1 -1
  28. package/dist/esm/ui/ConfigureOverlay/index.js +1 -1
  29. package/dist/esm/ui/DatasourceAppearanceButton.js +1 -1
  30. package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
  31. package/dist/esm/ui/EditToolbarButton/index.js +1 -1
  32. package/dist/esm/ui/InlineCardOverlay/index.js +1 -1
  33. package/dist/esm/ui/LayoutButton/index.js +3 -2
  34. package/dist/esm/ui/ResizableEmbedCard.js +1 -1
  35. package/dist/types/nodeviews/blockCard.d.ts +2 -2
  36. package/dist/types/nodeviews/inlineCard.d.ts +4 -3
  37. package/dist/types/nodeviews/lazy-inline-card.d.ts +2 -1
  38. package/dist/types/nodeviews/toDOM-fixes/blockCard.d.ts +18 -17
  39. package/dist/types/nodeviews/toDOM-fixes/embedCard.d.ts +18 -17
  40. package/dist/types/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -17
  41. package/dist/types/pm-plugins/doc.d.ts +2 -2
  42. package/dist/types/pm-plugins/util/resolve.d.ts +2 -2
  43. package/dist/types/pm-plugins/util/state.d.ts +28 -20
  44. package/dist/types/ui/DatasourceDropdownOption.d.ts +8 -7
  45. package/dist/types/ui/LayoutButton/index.d.ts +9 -4
  46. package/dist/types/ui/LayoutButton/utils.d.ts +3 -2
  47. package/dist/types/ui/ResizableEmbedCard.d.ts +3 -2
  48. package/dist/types/ui/analytics/utils.d.ts +2 -1
  49. package/dist/types/ui/datasourceErrorBoundary.d.ts +1 -1
  50. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +2 -2
  51. package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +4 -3
  52. package/dist/types-ts4.5/nodeviews/lazy-inline-card.d.ts +2 -1
  53. package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +18 -17
  54. package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +18 -17
  55. package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -17
  56. package/dist/types-ts4.5/pm-plugins/doc.d.ts +2 -2
  57. package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +2 -2
  58. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +28 -20
  59. package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +8 -7
  60. package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +9 -4
  61. package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +3 -2
  62. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +3 -2
  63. package/dist/types-ts4.5/ui/analytics/utils.d.ts +2 -1
  64. package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +1 -1
  65. package/package.json +3 -3
@@ -1,28 +1,29 @@
1
- import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
3
  export declare const embedCardSpecWithFixedToDOM: () => {
3
- toDOM: (node: PMNode) => DOMOutputSpec;
4
- content?: string;
5
- marks?: string;
6
- group?: string;
7
- inline?: boolean;
8
4
  atom?: boolean;
9
5
  attrs?: {
10
- [name: string]: import("prosemirror-model").AttributeSpec;
6
+ [name: string]: AttributeSpec;
11
7
  };
12
- selectable?: boolean;
13
- draggable?: boolean;
14
8
  code?: boolean;
15
- whitespace?: "pre" | "normal";
9
+ content?: string;
10
+ defining?: boolean;
16
11
  definingAsContext?: boolean;
17
12
  definingForContent?: boolean;
18
- defining?: boolean;
13
+ disableDropCursor?: boolean | ((view: EditorView, pos: {
14
+ inside: number;
15
+ pos: number;
16
+ }, event: DragEvent) => boolean);
17
+ draggable?: boolean;
18
+ group?: string;
19
+ inline?: boolean;
19
20
  isolating?: boolean;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[];
21
- toDebugString?: (node: PMNode) => string;
22
21
  leafText?: (node: PMNode) => string;
23
22
  linebreakReplacement?: boolean;
24
- disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
25
- pos: number;
26
- inside: number;
27
- }, event: DragEvent) => boolean);
23
+ marks?: string;
24
+ parseDOM?: readonly TagParseRule[];
25
+ selectable?: boolean;
26
+ toDebugString?: (node: PMNode) => string;
27
+ toDOM: (node: PMNode) => DOMOutputSpec;
28
+ whitespace?: "pre" | "normal";
28
29
  };
@@ -1,28 +1,29 @@
1
- import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
3
  export declare const inlineCardSpecWithFixedToDOM: () => {
3
- toDOM: (node: PMNode) => DOMOutputSpec;
4
- content?: string;
5
- marks?: string;
6
- group?: string;
7
- inline?: boolean;
8
4
  atom?: boolean;
9
5
  attrs?: {
10
- [name: string]: import("prosemirror-model").AttributeSpec;
6
+ [name: string]: AttributeSpec;
11
7
  };
12
- selectable?: boolean;
13
- draggable?: boolean;
14
8
  code?: boolean;
15
- whitespace?: "pre" | "normal";
9
+ content?: string;
10
+ defining?: boolean;
16
11
  definingAsContext?: boolean;
17
12
  definingForContent?: boolean;
18
- defining?: boolean;
13
+ disableDropCursor?: boolean | ((view: EditorView, pos: {
14
+ inside: number;
15
+ pos: number;
16
+ }, event: DragEvent) => boolean);
17
+ draggable?: boolean;
18
+ group?: string;
19
+ inline?: boolean;
19
20
  isolating?: boolean;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[];
21
- toDebugString?: (node: PMNode) => string;
22
21
  leafText?: (node: PMNode) => string;
23
22
  linebreakReplacement?: boolean;
24
- disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
25
- pos: number;
26
- inside: number;
27
- }, event: DragEvent) => boolean);
23
+ marks?: string;
24
+ parseDOM?: readonly TagParseRule[];
25
+ selectable?: boolean;
26
+ toDebugString?: (node: PMNode) => string;
27
+ toDOM: (node: PMNode) => DOMOutputSpec;
28
+ whitespace?: "pre" | "normal";
28
29
  };
@@ -4,7 +4,7 @@ import { ACTION } from '@atlaskit/editor-common/analytics';
4
4
  import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
5
5
  import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
6
6
  import type { Command } from '@atlaskit/editor-common/types';
7
- import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
7
+ import type { Attrs, Node, NodeType } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { CardAdf, DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
@@ -37,5 +37,5 @@ export declare const insertDatasource: (state: EditorState, adf: DatasourceAdf |
37
37
  /**
38
38
  * Get attributes for new Card Appearance
39
39
  */
40
- export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node, isInsideBodiedSyncBlock?: boolean) => import("prosemirror-model").Attrs;
40
+ export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node, isInsideBodiedSyncBlock?: boolean) => Attrs;
41
41
  export {};
@@ -3,7 +3,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { CardOptions } from '@atlaskit/editor-common/card';
4
4
  import type { CardProvider } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { DatasourceAdf } from '@atlaskit/linking-common';
6
+ import type { BlockCardAdf, DatasourceAdf, EmbedCardAdf, InlineCardAdf } from '@atlaskit/linking-common';
7
7
  import type { Request } from '../../types';
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>;
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>> | InlineCardAdf | BlockCardAdf | EmbedCardAdf>;
9
9
  export declare const handleProvider: (_: "cardProvider", provider: Promise<CardProvider> | undefined, view: EditorView) => void;
@@ -1,42 +1,50 @@
1
+ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import type { ACTION } from '@atlaskit/editor-common/analytics';
3
+ import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
4
+ import type { CardAppearance, CardProvider } from '@atlaskit/editor-common/provider-factory';
5
+ import type { DatasourceModalType, EditorAppearance } from '@atlaskit/editor-common/types';
1
6
  import { type EditorState, type ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
7
+ import type { DatasourceAdfView } from '@atlaskit/linking-common';
8
+ import type { SmartLinkEvents } from '@atlaskit/smart-card';
2
9
  import { type CardPluginState, type Request } from '../../types';
10
+ import type { DatasourceTableLayout } from '../../ui/LayoutButton/types';
3
11
  export declare const getPluginState: (editorState: EditorState) => CardPluginState | undefined;
4
12
  export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState, tr: ReadonlyTransaction) => {
5
- requests: {
6
- pos: number;
7
- analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION;
8
- appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
9
- compareLinkText: boolean;
10
- previousAppearance?: import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
11
- shouldReplaceLink?: boolean;
12
- source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
13
- sourceEvent?: import("@atlaskit/analytics-next").UIAnalyticsEvent | null | undefined;
14
- url: string;
15
- }[];
13
+ allowBlockCards?: boolean;
14
+ allowEmbeds?: boolean;
16
15
  cards: {
17
- pos: number;
18
16
  id?: string;
17
+ pos: number;
19
18
  title?: string;
20
19
  url?: string;
21
20
  }[];
22
- allowBlockCards?: boolean;
23
- allowEmbeds?: boolean;
24
- datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType;
21
+ datasourceModalType?: DatasourceModalType;
25
22
  datasourceStash: {
26
23
  [x: string]: {
27
- views: import("@atlaskit/linking-common").DatasourceAdfView[];
24
+ views: DatasourceAdfView[];
28
25
  };
29
26
  };
30
27
  datasourceTableRef?: HTMLElement;
31
- editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance;
28
+ editorAppearance?: EditorAppearance;
32
29
  inlineCardAwarenessCandidatePosition?: number;
33
- layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout;
30
+ layout?: DatasourceTableLayout;
34
31
  overlayCandidatePosition?: number;
35
- provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
32
+ provider: CardProvider | null;
36
33
  removeOverlay?: () => void;
34
+ requests: {
35
+ analyticsAction?: ACTION;
36
+ appearance: CardAppearance;
37
+ compareLinkText: boolean;
38
+ pos: number;
39
+ previousAppearance?: CardAppearance | "url";
40
+ shouldReplaceLink?: boolean;
41
+ source: CardReplacementInputMethod;
42
+ sourceEvent?: UIAnalyticsEvent | null | undefined;
43
+ url: string;
44
+ }[];
37
45
  selectedInlineLinkPosition?: number;
38
46
  showDatasourceModal: boolean;
39
47
  showLinkingToolbar: boolean;
40
- smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents;
48
+ smartLinkEvents?: SmartLinkEvents;
41
49
  };
42
50
  export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { IntlShape } from 'react-intl-next';
3
3
  import type { Command } from '@atlaskit/editor-common/types';
4
+ import type { NewCoreIconProps } from '@atlaskit/icon';
4
5
  interface Props {
5
6
  allowDatasource?: boolean;
6
7
  dispatchCommand: (command: Command) => void;
@@ -10,19 +11,19 @@ interface Props {
10
11
  url: string;
11
12
  }
12
13
  export declare const datasourceDisplayInformation: {
13
- title: {
14
- id: string;
15
- defaultMessage: string;
16
- description: string;
17
- };
18
14
  icon: {
19
- (props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
15
+ (props: NewCoreIconProps): JSX.Element;
20
16
  displayName: string;
21
17
  };
22
18
  iconFallback: {
23
- (props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
19
+ (props: NewCoreIconProps): JSX.Element;
24
20
  displayName: string;
25
21
  };
22
+ title: {
23
+ defaultMessage: string;
24
+ description: string;
25
+ id: string;
26
+ };
26
27
  };
27
28
  export declare const DatasourceDropdownOption: ({ allowDatasource, intl, url, selected, inputMethod, dispatchCommand, }: Props) => React.JSX.Element | null;
28
29
  export {};
@@ -1,8 +1,13 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentType, type FC } from 'react';
1
6
  import { jsx } from '@emotion/react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
7
+ import type { WithIntlProps, WrappedComponentProps } from 'react-intl-next';
3
8
  import type { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
4
9
  export declare const LayoutButton: ({ onLayoutChange, layout, intl: { formatMessage }, mountPoint, boundariesElement, scrollableElement, targetElement, testId, }: LayoutButtonProps) => jsx.JSX.Element | null;
5
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<LayoutButtonWrapperProps & WrappedComponentProps>> & {
6
- WrappedComponent: import("react").ComponentType<LayoutButtonWrapperProps & WrappedComponentProps>;
10
+ declare const _default_1: FC<WithIntlProps<LayoutButtonWrapperProps & WrappedComponentProps>> & {
11
+ WrappedComponent: ComponentType<LayoutButtonWrapperProps & WrappedComponentProps>;
7
12
  };
8
- export default _default;
13
+ export default _default_1;
@@ -1,10 +1,11 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
+ import type { DatasourceNode } from '../../types';
2
3
  import { type DatasourceTableLayout } from './types';
3
4
  export declare const getDatasource: (editorView: EditorView | undefined) => {
4
- node: import("../../types").DatasourceNode;
5
- start: number;
6
5
  depth: number;
6
+ node: DatasourceNode;
7
7
  pos: number;
8
+ start: number;
8
9
  } | {
9
10
  node: undefined;
10
11
  pos: undefined;
@@ -6,6 +6,7 @@ import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import type { RichMediaLayout } from '@atlaskit/adf-schema';
8
8
  import type { ResizerProps } from '@atlaskit/editor-common/ui';
9
+ import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
9
10
  type State = {
10
11
  offsetLeft: number;
11
12
  resizedPctWidth?: number;
@@ -29,11 +30,11 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
29
30
  */
30
31
  checkLayout(oldLayout: RichMediaLayout, newLayout: RichMediaLayout): void;
31
32
  calcNewSize: (newWidth: number, stop: boolean) => {
32
- width: number | null;
33
33
  layout: RichMediaLayout;
34
+ width: number | null;
34
35
  };
35
36
  calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
36
- get $pos(): import("prosemirror-model").ResolvedPos | null;
37
+ get $pos(): ResolvedPos | null;
37
38
  /**
38
39
  * The maxmimum number of grid columns this node can resize to.
39
40
  */
@@ -1,3 +1,4 @@
1
+ import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
1
2
  import { type Node } from '@atlaskit/editor-prosemirror/model';
2
3
  import { type ReadonlyTransaction, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
4
  import { type Entity, EVENT_SUBJECT } from './types';
@@ -10,7 +11,7 @@ export declare function getNodeSubject(node: Node): EVENT_SUBJECT | null;
10
11
  /**
11
12
  * Analytics appearance for link object
12
13
  */
13
- export declare function appearanceForLink(node: Node): import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
14
+ export declare function appearanceForLink(node: Node): 'url' | CardAppearance;
14
15
  export declare function getUrl(node: Node): string | undefined;
15
16
  export declare const getNodeContext: (doc: Node, pos: number) => string;
16
17
  export declare const findAtPositions: (tr: Transaction | ReadonlyTransaction, positions: number[]) => Entity[];
@@ -20,5 +20,5 @@ export declare class DatasourceErrorBoundary extends React.Component<DatasourceE
20
20
  error: Error | APIError;
21
21
  };
22
22
  componentDidCatch(error: Error | APIError): void;
23
- render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
23
+ render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
24
24
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import ReactNodeView, { type getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
3
3
  import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
4
4
  import type { Node } from '@atlaskit/editor-prosemirror/model';
5
- import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
6
6
  import { Datasource } from '../nodeviews/datasource';
7
7
  import type { SmartCardProps } from './genericCard';
8
8
  export declare class BlockCardComponent extends React.PureComponent<SmartCardProps & {
@@ -50,4 +50,4 @@ export interface BlockCardNodeViewProperties {
50
50
  pmPluginFactoryParams: PMPluginFactoryParams;
51
51
  provider: BlockCardNodeViewProps['provider'];
52
52
  }
53
- export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, isPageSSRed, provider, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView | Datasource | BlockCard;
53
+ export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, isPageSSRed, provider, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => BlockCard | Datasource | NodeView;
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { InlineNodeViewComponentProps, getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
3
3
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { SmartCardProps } from './genericCard';
6
6
  import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
7
- export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick: propsOnClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
7
+ export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
8
8
  export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt' | 'provider'>;
9
9
  /**
10
+ * Inline card node view component that renders a Smart Link inline card within the editor.
10
11
  *
11
12
  * @param props
12
13
  * @example
@@ -16,4 +17,4 @@ export interface InlineCardNodeViewProperties {
16
17
  inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
17
18
  isPageSSRed: InlineCardNodeViewProps['isPageSSRed'];
18
19
  }
19
- export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView;
20
+ export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => NodeView;
@@ -1,2 +1,3 @@
1
+ import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
1
2
  import { type InlineCardNodeViewProperties } from './inlineCard';
2
- export declare const lazyInlineCardView: (props: InlineCardNodeViewProperties) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
3
+ export declare const lazyInlineCardView: (props: InlineCardNodeViewProperties) => NodeViewConstructor;
@@ -1,28 +1,29 @@
1
- import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
3
  export declare const blockCardSpecWithFixedToDOM: () => {
3
- toDOM: (node: PMNode) => DOMOutputSpec;
4
- content?: string;
5
- marks?: string;
6
- group?: string;
7
- inline?: boolean;
8
4
  atom?: boolean;
9
5
  attrs?: {
10
- [name: string]: import("prosemirror-model").AttributeSpec;
6
+ [name: string]: AttributeSpec;
11
7
  };
12
- selectable?: boolean;
13
- draggable?: boolean;
14
8
  code?: boolean;
15
- whitespace?: "pre" | "normal";
9
+ content?: string;
10
+ defining?: boolean;
16
11
  definingAsContext?: boolean;
17
12
  definingForContent?: boolean;
18
- defining?: boolean;
13
+ disableDropCursor?: boolean | ((view: EditorView, pos: {
14
+ inside: number;
15
+ pos: number;
16
+ }, event: DragEvent) => boolean);
17
+ draggable?: boolean;
18
+ group?: string;
19
+ inline?: boolean;
19
20
  isolating?: boolean;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[];
21
- toDebugString?: (node: PMNode) => string;
22
21
  leafText?: (node: PMNode) => string;
23
22
  linebreakReplacement?: boolean;
24
- disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
25
- pos: number;
26
- inside: number;
27
- }, event: DragEvent) => boolean);
23
+ marks?: string;
24
+ parseDOM?: readonly TagParseRule[];
25
+ selectable?: boolean;
26
+ toDebugString?: (node: PMNode) => string;
27
+ toDOM: (node: PMNode) => DOMOutputSpec;
28
+ whitespace?: "pre" | "normal";
28
29
  };
@@ -1,28 +1,29 @@
1
- import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
3
  export declare const embedCardSpecWithFixedToDOM: () => {
3
- toDOM: (node: PMNode) => DOMOutputSpec;
4
- content?: string;
5
- marks?: string;
6
- group?: string;
7
- inline?: boolean;
8
4
  atom?: boolean;
9
5
  attrs?: {
10
- [name: string]: import("prosemirror-model").AttributeSpec;
6
+ [name: string]: AttributeSpec;
11
7
  };
12
- selectable?: boolean;
13
- draggable?: boolean;
14
8
  code?: boolean;
15
- whitespace?: "pre" | "normal";
9
+ content?: string;
10
+ defining?: boolean;
16
11
  definingAsContext?: boolean;
17
12
  definingForContent?: boolean;
18
- defining?: boolean;
13
+ disableDropCursor?: boolean | ((view: EditorView, pos: {
14
+ inside: number;
15
+ pos: number;
16
+ }, event: DragEvent) => boolean);
17
+ draggable?: boolean;
18
+ group?: string;
19
+ inline?: boolean;
19
20
  isolating?: boolean;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[];
21
- toDebugString?: (node: PMNode) => string;
22
21
  leafText?: (node: PMNode) => string;
23
22
  linebreakReplacement?: boolean;
24
- disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
25
- pos: number;
26
- inside: number;
27
- }, event: DragEvent) => boolean);
23
+ marks?: string;
24
+ parseDOM?: readonly TagParseRule[];
25
+ selectable?: boolean;
26
+ toDebugString?: (node: PMNode) => string;
27
+ toDOM: (node: PMNode) => DOMOutputSpec;
28
+ whitespace?: "pre" | "normal";
28
29
  };
@@ -1,28 +1,29 @@
1
- import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
3
  export declare const inlineCardSpecWithFixedToDOM: () => {
3
- toDOM: (node: PMNode) => DOMOutputSpec;
4
- content?: string;
5
- marks?: string;
6
- group?: string;
7
- inline?: boolean;
8
4
  atom?: boolean;
9
5
  attrs?: {
10
- [name: string]: import("prosemirror-model").AttributeSpec;
6
+ [name: string]: AttributeSpec;
11
7
  };
12
- selectable?: boolean;
13
- draggable?: boolean;
14
8
  code?: boolean;
15
- whitespace?: "pre" | "normal";
9
+ content?: string;
10
+ defining?: boolean;
16
11
  definingAsContext?: boolean;
17
12
  definingForContent?: boolean;
18
- defining?: boolean;
13
+ disableDropCursor?: boolean | ((view: EditorView, pos: {
14
+ inside: number;
15
+ pos: number;
16
+ }, event: DragEvent) => boolean);
17
+ draggable?: boolean;
18
+ group?: string;
19
+ inline?: boolean;
19
20
  isolating?: boolean;
20
- parseDOM?: readonly import("prosemirror-model").TagParseRule[];
21
- toDebugString?: (node: PMNode) => string;
22
21
  leafText?: (node: PMNode) => string;
23
22
  linebreakReplacement?: boolean;
24
- disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
25
- pos: number;
26
- inside: number;
27
- }, event: DragEvent) => boolean);
23
+ marks?: string;
24
+ parseDOM?: readonly TagParseRule[];
25
+ selectable?: boolean;
26
+ toDebugString?: (node: PMNode) => string;
27
+ toDOM: (node: PMNode) => DOMOutputSpec;
28
+ whitespace?: "pre" | "normal";
28
29
  };
@@ -4,7 +4,7 @@ import { ACTION } from '@atlaskit/editor-common/analytics';
4
4
  import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
5
5
  import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
6
6
  import type { Command } from '@atlaskit/editor-common/types';
7
- import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
7
+ import type { Attrs, Node, NodeType } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { CardAdf, DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
@@ -37,5 +37,5 @@ export declare const insertDatasource: (state: EditorState, adf: DatasourceAdf |
37
37
  /**
38
38
  * Get attributes for new Card Appearance
39
39
  */
40
- export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node, isInsideBodiedSyncBlock?: boolean) => import("prosemirror-model").Attrs;
40
+ export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node, isInsideBodiedSyncBlock?: boolean) => Attrs;
41
41
  export {};
@@ -3,7 +3,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { CardOptions } from '@atlaskit/editor-common/card';
4
4
  import type { CardProvider } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { DatasourceAdf } from '@atlaskit/linking-common';
6
+ import type { BlockCardAdf, DatasourceAdf, EmbedCardAdf, InlineCardAdf } from '@atlaskit/linking-common';
7
7
  import type { Request } from '../../types';
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>;
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>> | InlineCardAdf | BlockCardAdf | EmbedCardAdf>;
9
9
  export declare const handleProvider: (_: "cardProvider", provider: Promise<CardProvider> | undefined, view: EditorView) => void;
@@ -1,42 +1,50 @@
1
+ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import type { ACTION } from '@atlaskit/editor-common/analytics';
3
+ import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
4
+ import type { CardAppearance, CardProvider } from '@atlaskit/editor-common/provider-factory';
5
+ import type { DatasourceModalType, EditorAppearance } from '@atlaskit/editor-common/types';
1
6
  import { type EditorState, type ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
7
+ import type { DatasourceAdfView } from '@atlaskit/linking-common';
8
+ import type { SmartLinkEvents } from '@atlaskit/smart-card';
2
9
  import { type CardPluginState, type Request } from '../../types';
10
+ import type { DatasourceTableLayout } from '../../ui/LayoutButton/types';
3
11
  export declare const getPluginState: (editorState: EditorState) => CardPluginState | undefined;
4
12
  export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState, tr: ReadonlyTransaction) => {
5
- requests: {
6
- pos: number;
7
- analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION;
8
- appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
9
- compareLinkText: boolean;
10
- previousAppearance?: import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
11
- shouldReplaceLink?: boolean;
12
- source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
13
- sourceEvent?: import("@atlaskit/analytics-next").UIAnalyticsEvent | null | undefined;
14
- url: string;
15
- }[];
13
+ allowBlockCards?: boolean;
14
+ allowEmbeds?: boolean;
16
15
  cards: {
17
- pos: number;
18
16
  id?: string;
17
+ pos: number;
19
18
  title?: string;
20
19
  url?: string;
21
20
  }[];
22
- allowBlockCards?: boolean;
23
- allowEmbeds?: boolean;
24
- datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType;
21
+ datasourceModalType?: DatasourceModalType;
25
22
  datasourceStash: {
26
23
  [x: string]: {
27
- views: import("@atlaskit/linking-common").DatasourceAdfView[];
24
+ views: DatasourceAdfView[];
28
25
  };
29
26
  };
30
27
  datasourceTableRef?: HTMLElement;
31
- editorAppearance?: import("@atlaskit/editor-common/types").EditorAppearance;
28
+ editorAppearance?: EditorAppearance;
32
29
  inlineCardAwarenessCandidatePosition?: number;
33
- layout?: import("../../ui/LayoutButton/types").DatasourceTableLayout;
30
+ layout?: DatasourceTableLayout;
34
31
  overlayCandidatePosition?: number;
35
- provider: import("@atlaskit/editor-common/provider-factory").CardProvider | null;
32
+ provider: CardProvider | null;
36
33
  removeOverlay?: () => void;
34
+ requests: {
35
+ analyticsAction?: ACTION;
36
+ appearance: CardAppearance;
37
+ compareLinkText: boolean;
38
+ pos: number;
39
+ previousAppearance?: CardAppearance | "url";
40
+ shouldReplaceLink?: boolean;
41
+ source: CardReplacementInputMethod;
42
+ sourceEvent?: UIAnalyticsEvent | null | undefined;
43
+ url: string;
44
+ }[];
37
45
  selectedInlineLinkPosition?: number;
38
46
  showDatasourceModal: boolean;
39
47
  showLinkingToolbar: boolean;
40
- smartLinkEvents?: import("@atlaskit/smart-card").SmartLinkEvents;
48
+ smartLinkEvents?: SmartLinkEvents;
41
49
  };
42
50
  export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { IntlShape } from 'react-intl-next';
3
3
  import type { Command } from '@atlaskit/editor-common/types';
4
+ import type { NewCoreIconProps } from '@atlaskit/icon';
4
5
  interface Props {
5
6
  allowDatasource?: boolean;
6
7
  dispatchCommand: (command: Command) => void;
@@ -10,19 +11,19 @@ interface Props {
10
11
  url: string;
11
12
  }
12
13
  export declare const datasourceDisplayInformation: {
13
- title: {
14
- id: string;
15
- defaultMessage: string;
16
- description: string;
17
- };
18
14
  icon: {
19
- (props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
15
+ (props: NewCoreIconProps): JSX.Element;
20
16
  displayName: string;
21
17
  };
22
18
  iconFallback: {
23
- (props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
19
+ (props: NewCoreIconProps): JSX.Element;
24
20
  displayName: string;
25
21
  };
22
+ title: {
23
+ defaultMessage: string;
24
+ description: string;
25
+ id: string;
26
+ };
26
27
  };
27
28
  export declare const DatasourceDropdownOption: ({ allowDatasource, intl, url, selected, inputMethod, dispatchCommand, }: Props) => React.JSX.Element | null;
28
29
  export {};