@atlaskit/editor-plugin-card 7.4.7 → 7.4.9

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 (86) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/nodeviews/inlineCard.js +7 -4
  3. package/dist/cjs/nodeviews/inlineCardWithAwareness.js +4 -2
  4. package/dist/es2019/nodeviews/inlineCard.js +7 -4
  5. package/dist/es2019/nodeviews/inlineCardWithAwareness.js +4 -2
  6. package/dist/esm/nodeviews/inlineCard.js +7 -4
  7. package/dist/esm/nodeviews/inlineCardWithAwareness.js +4 -2
  8. package/dist/types/cardPluginType.d.ts +3 -3
  9. package/dist/types/nodeviews/blockCard.d.ts +7 -7
  10. package/dist/types/nodeviews/datasource.d.ts +5 -5
  11. package/dist/types/nodeviews/embedCard.d.ts +8 -8
  12. package/dist/types/nodeviews/genericCard.d.ts +20 -19
  13. package/dist/types/nodeviews/inlineCard.d.ts +1 -1
  14. package/dist/types/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  15. package/dist/types/pm-plugins/actions.d.ts +1 -1
  16. package/dist/types/pm-plugins/doc.d.ts +5 -5
  17. package/dist/types/pm-plugins/util/state.d.ts +13 -13
  18. package/dist/types/types/index.d.ts +48 -48
  19. package/dist/types/ui/AwarenessWrapper/index.d.ts +4 -4
  20. package/dist/types/ui/ConfigureOverlay/index.d.ts +2 -2
  21. package/dist/types/ui/DatasourceAppearanceButton.d.ts +5 -5
  22. package/dist/types/ui/DatasourceDropdownOption.d.ts +3 -3
  23. package/dist/types/ui/DatasourceModal/index.d.ts +2 -2
  24. package/dist/types/ui/EditLinkToolbar.d.ts +10 -10
  25. package/dist/types/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
  26. package/dist/types/ui/EditToolbarButton/types.d.ts +4 -4
  27. package/dist/types/ui/EditorAnalyticsContext.d.ts +1 -1
  28. package/dist/types/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  29. package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +4 -4
  30. package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -1
  31. package/dist/types/ui/LayoutButton/types.d.ts +4 -4
  32. package/dist/types/ui/LinkToolbarAppearance.d.ts +6 -6
  33. package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +2 -2
  34. package/dist/types/ui/OpenPreviewButton/index.d.ts +2 -2
  35. package/dist/types/ui/Pulse/index.d.ts +6 -6
  36. package/dist/types/ui/ResizableEmbedCard.d.ts +2 -2
  37. package/dist/types/ui/ToolbarViewedEvent.d.ts +1 -1
  38. package/dist/types/ui/analytics/create-events-queue.d.ts +2 -2
  39. package/dist/types/ui/analytics/events-from-tr.d.ts +1 -1
  40. package/dist/types/ui/analytics/types.d.ts +11 -11
  41. package/dist/types/ui/analytics/utils.d.ts +1 -1
  42. package/dist/types/ui/datasourceErrorBoundary.d.ts +4 -4
  43. package/dist/types/ui/hooks/useLinkUpgradeDiscoverability.d.ts +4 -4
  44. package/dist/types/ui/preview/PreviewInvoker.d.ts +1 -1
  45. package/dist/types/ui/toolbar.d.ts +1 -1
  46. package/dist/types/ui/useFetchDatasourceInfo.d.ts +2 -2
  47. package/dist/types-ts4.5/cardPluginType.d.ts +3 -3
  48. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +7 -7
  49. package/dist/types-ts4.5/nodeviews/datasource.d.ts +5 -5
  50. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +8 -8
  51. package/dist/types-ts4.5/nodeviews/genericCard.d.ts +20 -19
  52. package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -1
  53. package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  54. package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
  55. package/dist/types-ts4.5/pm-plugins/doc.d.ts +5 -5
  56. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +13 -13
  57. package/dist/types-ts4.5/types/index.d.ts +48 -48
  58. package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +4 -4
  59. package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +2 -2
  60. package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +5 -5
  61. package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +3 -3
  62. package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +2 -2
  63. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +10 -10
  64. package/dist/types-ts4.5/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
  65. package/dist/types-ts4.5/ui/EditToolbarButton/types.d.ts +4 -4
  66. package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +1 -1
  67. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  68. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +4 -4
  69. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -1
  70. package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +4 -4
  71. package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +6 -6
  72. package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +2 -2
  73. package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +2 -2
  74. package/dist/types-ts4.5/ui/Pulse/index.d.ts +6 -6
  75. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +2 -2
  76. package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +1 -1
  77. package/dist/types-ts4.5/ui/analytics/create-events-queue.d.ts +2 -2
  78. package/dist/types-ts4.5/ui/analytics/events-from-tr.d.ts +1 -1
  79. package/dist/types-ts4.5/ui/analytics/types.d.ts +11 -11
  80. package/dist/types-ts4.5/ui/analytics/utils.d.ts +1 -1
  81. package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +4 -4
  82. package/dist/types-ts4.5/ui/hooks/useLinkUpgradeDiscoverability.d.ts +4 -4
  83. package/dist/types-ts4.5/ui/preview/PreviewInvoker.d.ts +1 -1
  84. package/dist/types-ts4.5/ui/toolbar.d.ts +1 -1
  85. package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +2 -2
  86. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 7.4.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ffc3ef708967c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ffc3ef708967c) -
8
+ [ux] Adds an optional disablePreviewPanel prop on a smartcard to allow consumers opt out of
9
+ opening Preview Panel by default when a smartlink is clicked.
10
+ - Updated dependencies
11
+
12
+ ## 7.4.8
13
+
14
+ ### Patch Changes
15
+
16
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
17
+ Sorted type and interface props to improve Atlaskit docs
18
+ - Updated dependencies
19
+
3
20
  ## 7.4.7
4
21
 
5
22
  ### Patch Changes
@@ -38,7 +38,8 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
38
38
  showHoverPreview = _ref.showHoverPreview,
39
39
  hoverPreviewOptions = _ref.hoverPreviewOptions,
40
40
  isPageSSRed = _ref.isPageSSRed,
41
- pluginInjectionApi = _ref.pluginInjectionApi;
41
+ pluginInjectionApi = _ref.pluginInjectionApi,
42
+ disablePreviewPanel = _ref.disablePreviewPanel;
42
43
  var _node$attrs = node.attrs,
43
44
  url = _node$attrs.url,
44
45
  data = _node$attrs.data;
@@ -123,7 +124,8 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
123
124
  actionOptions: actionOptions,
124
125
  isHovered: isHovered,
125
126
  showHoverPreview: showHoverPreview,
126
- hoverPreviewOptions: hoverPreviewOptions
127
+ hoverPreviewOptions: hoverPreviewOptions,
128
+ disablePreviewPanel: disablePreviewPanel
127
129
  });
128
130
  }
129
131
  return /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
@@ -138,9 +140,10 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
138
140
  actionOptions: actionOptions,
139
141
  isHovered: isHovered,
140
142
  showHoverPreview: showHoverPreview,
141
- hoverPreviewOptions: hoverPreviewOptions
143
+ hoverPreviewOptions: hoverPreviewOptions,
144
+ disablePreviewPanel: disablePreviewPanel
142
145
  });
143
- }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed]);
146
+ }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel]);
144
147
 
145
148
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
146
149
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -116,7 +116,8 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
116
116
  cardContext: cardContext,
117
117
  isHovered: isHovered,
118
118
  isPageSSRed: isPageSSRed,
119
- pluginInjectionApi: pluginInjectionApi
119
+ pluginInjectionApi: pluginInjectionApi,
120
+ disablePreviewPanel: true
120
121
  }));
121
122
  }, [isResolvedViewRendered, node, editorAppearance, view, getPos, useAlternativePreloader, actionOptions, onResolve, onClick, cardContext, isHovered, isPageSSRed, pluginInjectionApi]);
122
123
  var innerCardOriginal = (0, _react.useMemo)(function () {
@@ -200,7 +201,8 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
200
201
  isHovered: isHovered,
201
202
  isPageSSRed: isPageSSRed,
202
203
  pluginInjectionApi: pluginInjectionApi,
203
- showHoverPreview: mode === 'view' && showHoverPreview
204
+ showHoverPreview: mode === 'view' && showHoverPreview,
205
+ disablePreviewPanel: true
204
206
  }));
205
207
  } else {
206
208
  return /*#__PURE__*/_react.default.createElement(_inlineCard.InlineCard, {
@@ -27,7 +27,8 @@ export const InlineCard = /*#__PURE__*/memo(({
27
27
  showHoverPreview,
28
28
  hoverPreviewOptions,
29
29
  isPageSSRed,
30
- pluginInjectionApi
30
+ pluginInjectionApi,
31
+ disablePreviewPanel
31
32
  }) => {
32
33
  const {
33
34
  url,
@@ -119,7 +120,8 @@ export const InlineCard = /*#__PURE__*/memo(({
119
120
  actionOptions: actionOptions,
120
121
  isHovered: isHovered,
121
122
  showHoverPreview: showHoverPreview,
122
- hoverPreviewOptions: hoverPreviewOptions
123
+ hoverPreviewOptions: hoverPreviewOptions,
124
+ disablePreviewPanel: disablePreviewPanel
123
125
  });
124
126
  }
125
127
  return /*#__PURE__*/React.createElement(SmartCard, {
@@ -134,9 +136,10 @@ export const InlineCard = /*#__PURE__*/memo(({
134
136
  actionOptions: actionOptions,
135
137
  isHovered: isHovered,
136
138
  showHoverPreview: showHoverPreview,
137
- hoverPreviewOptions: hoverPreviewOptions
139
+ hoverPreviewOptions: hoverPreviewOptions,
140
+ disablePreviewPanel: disablePreviewPanel
138
141
  });
139
- }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed]);
142
+ }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel]);
140
143
 
141
144
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
142
145
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -96,7 +96,8 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
96
96
  cardContext: cardContext,
97
97
  isHovered: isHovered,
98
98
  isPageSSRed: isPageSSRed,
99
- pluginInjectionApi: pluginInjectionApi
99
+ pluginInjectionApi: pluginInjectionApi,
100
+ disablePreviewPanel: true
100
101
  }));
101
102
  }, [isResolvedViewRendered, node, editorAppearance, view, getPos, useAlternativePreloader, actionOptions, onResolve, onClick, cardContext, isHovered, isPageSSRed, pluginInjectionApi]);
102
103
  const innerCardOriginal = useMemo(() => /*#__PURE__*/React.createElement(InlineCard, {
@@ -179,7 +180,8 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
179
180
  isHovered: isHovered,
180
181
  isPageSSRed: isPageSSRed,
181
182
  pluginInjectionApi: pluginInjectionApi,
182
- showHoverPreview: mode === 'view' && showHoverPreview
183
+ showHoverPreview: mode === 'view' && showHoverPreview,
184
+ disablePreviewPanel: true
183
185
  }));
184
186
  } else {
185
187
  return /*#__PURE__*/React.createElement(InlineCard, {
@@ -27,7 +27,8 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
27
27
  showHoverPreview = _ref.showHoverPreview,
28
28
  hoverPreviewOptions = _ref.hoverPreviewOptions,
29
29
  isPageSSRed = _ref.isPageSSRed,
30
- pluginInjectionApi = _ref.pluginInjectionApi;
30
+ pluginInjectionApi = _ref.pluginInjectionApi,
31
+ disablePreviewPanel = _ref.disablePreviewPanel;
31
32
  var _node$attrs = node.attrs,
32
33
  url = _node$attrs.url,
33
34
  data = _node$attrs.data;
@@ -112,7 +113,8 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
112
113
  actionOptions: actionOptions,
113
114
  isHovered: isHovered,
114
115
  showHoverPreview: showHoverPreview,
115
- hoverPreviewOptions: hoverPreviewOptions
116
+ hoverPreviewOptions: hoverPreviewOptions,
117
+ disablePreviewPanel: disablePreviewPanel
116
118
  });
117
119
  }
118
120
  return /*#__PURE__*/React.createElement(SmartCard, {
@@ -127,9 +129,10 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
127
129
  actionOptions: actionOptions,
128
130
  isHovered: isHovered,
129
131
  showHoverPreview: showHoverPreview,
130
- hoverPreviewOptions: hoverPreviewOptions
132
+ hoverPreviewOptions: hoverPreviewOptions,
133
+ disablePreviewPanel: disablePreviewPanel
131
134
  });
132
- }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed]);
135
+ }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel]);
133
136
 
134
137
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
135
138
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -107,7 +107,8 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
107
107
  cardContext: cardContext,
108
108
  isHovered: isHovered,
109
109
  isPageSSRed: isPageSSRed,
110
- pluginInjectionApi: pluginInjectionApi
110
+ pluginInjectionApi: pluginInjectionApi,
111
+ disablePreviewPanel: true
111
112
  }));
112
113
  }, [isResolvedViewRendered, node, editorAppearance, view, getPos, useAlternativePreloader, actionOptions, onResolve, onClick, cardContext, isHovered, isPageSSRed, pluginInjectionApi]);
113
114
  var innerCardOriginal = useMemo(function () {
@@ -191,7 +192,8 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
191
192
  isHovered: isHovered,
192
193
  isPageSSRed: isPageSSRed,
193
194
  pluginInjectionApi: pluginInjectionApi,
194
- showHoverPreview: mode === 'view' && showHoverPreview
195
+ showHoverPreview: mode === 'view' && showHoverPreview,
196
+ disablePreviewPanel: true
195
197
  }));
196
198
  } else {
197
199
  return /*#__PURE__*/React.createElement(InlineCard, {
@@ -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,41 @@ 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
+ disablePreviewPanel?: BaseCardProps['disablePreviewPanel'];
48
+ enableInlineUpgradeFeatures?: boolean;
49
+ isHovered?: boolean;
50
+ isPageSSRed?: boolean;
51
+ onClick?: EventHandler<MouseEvent | KeyboardEvent> | undefined;
52
+ onResolve?: (tr: Transaction, title?: string) => void;
53
+ pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
53
54
  }
54
55
  /**
55
56
  *
@@ -4,7 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Decoration, EditorView } 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, }: SmartCardProps) => React.JSX.Element | null>;
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>;
8
8
  export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt'>;
9
9
  /**
10
10
  *
@@ -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[];