@atlaskit/editor-plugin-card 4.5.0 → 4.5.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 (184) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/{plugin.js → cardPlugin.js} +6 -10
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/nodeviews/blockCard.js +1 -5
  5. package/dist/cjs/nodeviews/datasource.js +15 -27
  6. package/dist/cjs/nodeviews/embedCard.js +4 -15
  7. package/dist/cjs/nodeviews/genericCard.js +18 -20
  8. package/dist/cjs/nodeviews/inlineCard.js +1 -1
  9. package/dist/cjs/pm-plugins/doc.js +1 -1
  10. package/dist/cjs/pm-plugins/main.js +3 -3
  11. package/dist/cjs/{utils.js → pm-plugins/utils.js} +1 -1
  12. package/dist/cjs/types/index.js +5 -0
  13. package/dist/cjs/ui/AwarenessWrapper/index.js +3 -3
  14. package/dist/cjs/ui/DatasourceAppearanceButton.js +11 -13
  15. package/dist/cjs/ui/DatasourceModal/ModalWithState.js +17 -11
  16. package/dist/cjs/ui/EditLinkToolbar.js +1 -1
  17. package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
  18. package/dist/cjs/ui/EditToolbarButton/index.js +27 -29
  19. package/dist/cjs/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +1 -1
  20. package/dist/cjs/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +2 -2
  21. package/dist/cjs/ui/EditorLinkingPlatformAnalytics/index.js +5 -25
  22. package/dist/cjs/ui/LayoutButton/index.js +1 -1
  23. package/dist/cjs/ui/LayoutButton/utils.js +1 -1
  24. package/dist/cjs/ui/LinkToolbarAppearance.js +8 -9
  25. package/dist/cjs/ui/Pulse/index.js +1 -1
  26. package/dist/cjs/ui/ToolbarViewedEvent.js +8 -10
  27. package/dist/cjs/ui/WithCardContext.js +14 -0
  28. package/dist/cjs/{analytics → ui/analytics}/events-from-tr.js +2 -2
  29. package/dist/cjs/{analytics → ui/analytics}/utils.js +1 -1
  30. package/dist/cjs/{datasourceErrorBoundary.js → ui/datasourceErrorBoundary.js} +1 -1
  31. package/dist/cjs/{toolbar.js → ui/toolbar.js} +9 -9
  32. package/dist/es2019/{plugin.js → cardPlugin.js} +6 -11
  33. package/dist/es2019/index.js +1 -1
  34. package/dist/es2019/nodeviews/blockCard.js +1 -5
  35. package/dist/es2019/nodeviews/datasource.js +15 -27
  36. package/dist/es2019/nodeviews/embedCard.js +4 -16
  37. package/dist/es2019/nodeviews/genericCard.js +6 -10
  38. package/dist/es2019/nodeviews/inlineCard.js +1 -1
  39. package/dist/es2019/pm-plugins/doc.js +1 -1
  40. package/dist/es2019/pm-plugins/main.js +3 -3
  41. package/dist/es2019/{utils.js → pm-plugins/utils.js} +1 -1
  42. package/dist/es2019/ui/AwarenessWrapper/index.js +3 -3
  43. package/dist/es2019/ui/DatasourceAppearanceButton.js +4 -5
  44. package/dist/es2019/ui/DatasourceModal/ModalWithState.js +15 -7
  45. package/dist/es2019/ui/EditLinkToolbar.js +1 -1
  46. package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
  47. package/dist/es2019/ui/EditToolbarButton/index.js +27 -30
  48. package/dist/es2019/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +1 -1
  49. package/dist/es2019/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +2 -2
  50. package/dist/es2019/ui/EditorLinkingPlatformAnalytics/index.js +4 -23
  51. package/dist/es2019/ui/LayoutButton/index.js +1 -1
  52. package/dist/es2019/ui/LayoutButton/utils.js +1 -1
  53. package/dist/es2019/ui/LinkToolbarAppearance.js +6 -9
  54. package/dist/es2019/ui/Pulse/index.js +1 -1
  55. package/dist/es2019/ui/ToolbarViewedEvent.js +5 -6
  56. package/dist/es2019/ui/WithCardContext.js +8 -0
  57. package/dist/es2019/{analytics → ui/analytics}/events-from-tr.js +2 -2
  58. package/dist/es2019/{analytics → ui/analytics}/utils.js +1 -1
  59. package/dist/es2019/{datasourceErrorBoundary.js → ui/datasourceErrorBoundary.js} +1 -1
  60. package/dist/es2019/{toolbar.js → ui/toolbar.js} +9 -9
  61. package/dist/esm/{plugin.js → cardPlugin.js} +6 -11
  62. package/dist/esm/cardPluginType.js +1 -0
  63. package/dist/esm/index.js +1 -1
  64. package/dist/esm/nodeviews/blockCard.js +1 -5
  65. package/dist/esm/nodeviews/datasource.js +15 -27
  66. package/dist/esm/nodeviews/embedCard.js +4 -15
  67. package/dist/esm/nodeviews/genericCard.js +18 -20
  68. package/dist/esm/nodeviews/inlineCard.js +1 -1
  69. package/dist/esm/pm-plugins/doc.js +1 -1
  70. package/dist/esm/pm-plugins/main.js +3 -3
  71. package/dist/esm/{utils.js → pm-plugins/utils.js} +1 -1
  72. package/dist/esm/types/index.js +1 -0
  73. package/dist/esm/ui/AwarenessWrapper/index.js +3 -3
  74. package/dist/esm/ui/DatasourceAppearanceButton.js +11 -13
  75. package/dist/esm/ui/DatasourceModal/ModalWithState.js +17 -11
  76. package/dist/esm/ui/EditLinkToolbar.js +1 -1
  77. package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
  78. package/dist/esm/ui/EditToolbarButton/index.js +27 -29
  79. package/dist/esm/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +1 -1
  80. package/dist/esm/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +2 -2
  81. package/dist/esm/ui/EditorLinkingPlatformAnalytics/index.js +5 -25
  82. package/dist/esm/ui/LayoutButton/index.js +1 -1
  83. package/dist/esm/ui/LayoutButton/utils.js +1 -1
  84. package/dist/esm/ui/LinkToolbarAppearance.js +9 -9
  85. package/dist/esm/ui/Pulse/index.js +1 -1
  86. package/dist/esm/ui/ToolbarViewedEvent.js +8 -10
  87. package/dist/esm/ui/WithCardContext.js +7 -0
  88. package/dist/esm/{analytics → ui/analytics}/events-from-tr.js +2 -2
  89. package/dist/esm/{analytics → ui/analytics}/utils.js +1 -1
  90. package/dist/esm/{datasourceErrorBoundary.js → ui/datasourceErrorBoundary.js} +1 -1
  91. package/dist/esm/{toolbar.js → ui/toolbar.js} +9 -9
  92. package/dist/types/cardPlugin.d.ts +2 -0
  93. package/dist/{types-ts4.5/plugin.d.ts → types/cardPluginType.d.ts} +0 -1
  94. package/dist/types/index.d.ts +2 -2
  95. package/dist/types/nodeviews/blockCard.d.ts +0 -4
  96. package/dist/types/nodeviews/datasource.d.ts +0 -5
  97. package/dist/types/nodeviews/embedCard.d.ts +0 -5
  98. package/dist/types/pm-plugins/util/state.d.ts +1 -1
  99. package/dist/{types-ts4.5 → types/pm-plugins}/utils.d.ts +1 -1
  100. package/dist/types/{types.d.ts → types/index.d.ts} +3 -3
  101. package/dist/types/ui/DatasourceAppearanceButton.d.ts +1 -1
  102. package/dist/types/ui/DatasourceModal/ModalWithState.d.ts +5 -4
  103. package/dist/types/ui/EditLinkToolbar.d.ts +1 -1
  104. package/dist/types/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  105. package/dist/types/ui/EditorLinkingPlatformAnalytics/index.d.ts +1 -6
  106. package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +1 -1
  107. package/dist/types/ui/LayoutButton/utils.d.ts +1 -1
  108. package/dist/types/ui/LinkToolbarAppearance.d.ts +1 -6
  109. package/dist/types/ui/WithCardContext.d.ts +5 -0
  110. package/dist/types/{datasourceErrorBoundary.d.ts → ui/datasourceErrorBoundary.d.ts} +1 -1
  111. package/dist/{types-ts4.5/common → types/ui}/hooks/useLinkUpgradeDiscoverability.d.ts +1 -1
  112. package/dist/types/{toolbar.d.ts → ui/toolbar.d.ts} +2 -2
  113. package/dist/types-ts4.5/cardPlugin.d.ts +2 -0
  114. package/dist/{types/plugin.d.ts → types-ts4.5/cardPluginType.d.ts} +0 -1
  115. package/dist/types-ts4.5/index.d.ts +2 -2
  116. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +0 -4
  117. package/dist/types-ts4.5/nodeviews/datasource.d.ts +0 -5
  118. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +0 -5
  119. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +1 -1
  120. package/dist/{types → types-ts4.5/pm-plugins}/utils.d.ts +1 -1
  121. package/dist/types-ts4.5/{types.d.ts → types/index.d.ts} +3 -3
  122. package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +1 -1
  123. package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +5 -4
  124. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +1 -1
  125. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  126. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/index.d.ts +1 -6
  127. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +1 -1
  128. package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +1 -1
  129. package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +1 -6
  130. package/dist/types-ts4.5/ui/WithCardContext.d.ts +5 -0
  131. package/dist/types-ts4.5/{datasourceErrorBoundary.d.ts → ui/datasourceErrorBoundary.d.ts} +1 -1
  132. package/dist/{types/common → types-ts4.5/ui}/hooks/useLinkUpgradeDiscoverability.d.ts +1 -1
  133. package/dist/types-ts4.5/{toolbar.d.ts → ui/toolbar.d.ts} +2 -2
  134. package/package.json +7 -4
  135. package/dist/cjs/ui/CardContextProvider.js +0 -47
  136. package/dist/es2019/ui/CardContextProvider.js +0 -22
  137. package/dist/esm/ui/CardContextProvider.js +0 -40
  138. package/dist/types/ui/CardContextProvider.d.ts +0 -20
  139. package/dist/types-ts4.5/ui/CardContextProvider.d.ts +0 -20
  140. /package/dist/cjs/{types.js → cardPluginType.js} +0 -0
  141. /package/dist/cjs/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.js +0 -0
  142. /package/dist/cjs/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.js +0 -0
  143. /package/dist/cjs/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.js +0 -0
  144. /package/dist/cjs/{analytics → ui/analytics}/create-events-queue.js +0 -0
  145. /package/dist/cjs/{analytics → ui/analytics}/index.js +0 -0
  146. /package/dist/cjs/{analytics → ui/analytics}/types.js +0 -0
  147. /package/dist/cjs/{common → ui}/hooks/useLinkUpgradeDiscoverability.js +0 -0
  148. /package/dist/cjs/{common → ui}/local-storage.js +0 -0
  149. /package/dist/es2019/{types.js → cardPluginType.js} +0 -0
  150. /package/dist/es2019/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.js +0 -0
  151. /package/dist/es2019/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.js +0 -0
  152. /package/dist/es2019/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.js +0 -0
  153. /package/dist/{esm/types.js → es2019/types/index.js} +0 -0
  154. /package/dist/es2019/{analytics → ui/analytics}/create-events-queue.js +0 -0
  155. /package/dist/es2019/{analytics → ui/analytics}/index.js +0 -0
  156. /package/dist/es2019/{analytics → ui/analytics}/types.js +0 -0
  157. /package/dist/es2019/{common → ui}/hooks/useLinkUpgradeDiscoverability.js +0 -0
  158. /package/dist/es2019/{common → ui}/local-storage.js +0 -0
  159. /package/dist/esm/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.js +0 -0
  160. /package/dist/esm/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.js +0 -0
  161. /package/dist/esm/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.js +0 -0
  162. /package/dist/esm/{analytics → ui/analytics}/create-events-queue.js +0 -0
  163. /package/dist/esm/{analytics → ui/analytics}/index.js +0 -0
  164. /package/dist/esm/{analytics → ui/analytics}/types.js +0 -0
  165. /package/dist/esm/{common → ui}/hooks/useLinkUpgradeDiscoverability.js +0 -0
  166. /package/dist/esm/{common → ui}/local-storage.js +0 -0
  167. /package/dist/types/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.d.ts +0 -0
  168. /package/dist/types/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.d.ts +0 -0
  169. /package/dist/types/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.d.ts +0 -0
  170. /package/dist/types/{analytics → ui/analytics}/create-events-queue.d.ts +0 -0
  171. /package/dist/types/{analytics → ui/analytics}/events-from-tr.d.ts +0 -0
  172. /package/dist/types/{analytics → ui/analytics}/index.d.ts +0 -0
  173. /package/dist/types/{analytics → ui/analytics}/types.d.ts +0 -0
  174. /package/dist/types/{analytics → ui/analytics}/utils.d.ts +0 -0
  175. /package/dist/types/{common → ui}/local-storage.d.ts +0 -0
  176. /package/dist/types-ts4.5/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.d.ts +0 -0
  177. /package/dist/types-ts4.5/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.d.ts +0 -0
  178. /package/dist/types-ts4.5/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.d.ts +0 -0
  179. /package/dist/types-ts4.5/{analytics → ui/analytics}/create-events-queue.d.ts +0 -0
  180. /package/dist/types-ts4.5/{analytics → ui/analytics}/events-from-tr.d.ts +0 -0
  181. /package/dist/types-ts4.5/{analytics → ui/analytics}/index.d.ts +0 -0
  182. /package/dist/types-ts4.5/{analytics → ui/analytics}/types.d.ts +0 -0
  183. /package/dist/types-ts4.5/{analytics → ui/analytics}/utils.d.ts +0 -0
  184. /package/dist/types-ts4.5/{common → ui}/local-storage.d.ts +0 -0
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import ReactNodeView, { type getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
4
3
  import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
5
4
  import type { Node } from '@atlaskit/editor-prosemirror/model';
@@ -8,9 +7,6 @@ import { Datasource } from '../nodeviews/datasource';
8
7
  import type { SmartCardProps } from './genericCard';
9
8
  export declare class BlockCardComponent extends React.PureComponent<SmartCardProps> {
10
9
  private scrollContainer?;
11
- static contextTypes: {
12
- contextAdapter: PropTypes.Requireable<object>;
13
- };
14
10
  constructor(props: SmartCardProps);
15
11
  onResolve: (data: {
16
12
  url?: string | undefined;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
- import PropTypes from 'prop-types';
8
7
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
9
8
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
10
9
  import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
@@ -25,10 +24,6 @@ export interface DatasourceProps extends ReactComponentProps {
25
24
  interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
26
25
  }
27
26
  export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
28
- static contextTypes: {
29
- contextAdapter: PropTypes.Requireable<object>;
30
- };
31
- context: any;
32
27
  constructor(props: DatasourceComponentProps);
33
28
  private getDatasource;
34
29
  private getTableView;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import type { RichMediaLayout } from '@atlaskit/adf-schema';
4
3
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
5
4
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
@@ -16,10 +15,6 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
16
15
  private scrollContainer?;
17
16
  private embedIframeRef;
18
17
  constructor(props: SmartCardProps);
19
- context: any;
20
- static contextTypes: {
21
- contextAdapter: PropTypes.Requireable<object>;
22
- };
23
18
  state: EmbedCardState;
24
19
  private getPosSafely;
25
20
  onResolve: (data: {
@@ -30,7 +30,7 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
30
30
  showDatasourceModal: boolean;
31
31
  datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType | undefined;
32
32
  datasourceTableRef?: HTMLElement | undefined;
33
- layout?: "full-width" | "center" | "wide" | undefined;
33
+ layout?: "center" | "wide" | "full-width" | undefined;
34
34
  inlineCardAwarenessCandidatePosition?: number | undefined;
35
35
  overlayCandidatePosition?: number | undefined;
36
36
  removeOverlay?: (() => void) | undefined;
@@ -4,7 +4,7 @@ import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
5
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { CardContext } from '@atlaskit/link-provider';
7
- import type { CardInfo, DatasourceNode } from './types';
7
+ import type { CardInfo, DatasourceNode } from '../types';
8
8
  export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
9
9
  export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
10
10
  export type TitleUrlPair = {
@@ -7,9 +7,9 @@ import type { DatasourceModalType, EditorAppearance, LinkPickerOptions } from '@
7
7
  import type { Node } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { DatasourceAdf, DatasourceAdfView } from '@atlaskit/linking-common';
9
9
  import type { SmartLinkEvents } from '@atlaskit/smart-card';
10
- import type { EditorCardPluginEvents } from './analytics/create-events-queue';
11
- import type { CardPluginEvent } from './analytics/types';
12
- import type { DatasourceTableLayout } from './ui/LayoutButton/types';
10
+ import type { EditorCardPluginEvents } from '../ui/analytics/create-events-queue';
11
+ import type { CardPluginEvent } from '../ui/analytics/types';
12
+ import type { DatasourceTableLayout } from '../ui/LayoutButton/types';
13
13
  export type CardType = CardAppearance | 'url' | 'datasource';
14
14
  export type DatasourceNode = Omit<Node, 'attrs'> & {
15
15
  readonly attrs: DatasourceAdf['attrs'] & Partial<RichMediaAttributes>;
@@ -3,7 +3,7 @@ import type { IntlShape } from 'react-intl-next';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { CardContext } from '@atlaskit/link-provider';
6
+ import { type CardContext } from '@atlaskit/link-provider';
7
7
  export interface DatasourceAppearanceButtonProps {
8
8
  intl: IntlShape;
9
9
  editorAnalyticsApi?: EditorAnalyticsAPI;
@@ -4,11 +4,12 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { ConfigModalProps } from '@atlaskit/link-datasource';
5
5
  import type { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
6
6
  import type { DatasourceParameters } from '@atlaskit/linking-types';
7
- import type { cardPlugin } from '../../plugin';
8
- declare const ModalWithState: ({ api, editorView, }: {
7
+ import type { cardPlugin } from '../../cardPlugin';
8
+ type ModalWithStateProps = {
9
9
  api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
10
10
  editorView: EditorView;
11
- }) => JSX.Element | null;
11
+ };
12
+ declare const SafeModalWithState: React.MemoExoticComponent<({ api, editorView }: ModalWithStateProps) => JSX.Element>;
12
13
  export type ModalTypeToComponentMap = {
13
14
  componentType: React.ComponentType<ConfigModalProps<InlineCardAdf | DatasourceAdf, DatasourceParameters>>;
14
15
  datasourceId: string;
@@ -16,4 +17,4 @@ export type ModalTypeToComponentMap = {
16
17
  export declare const modalTypeToComponentMap: {
17
18
  [key in DatasourceModalType]: ModalTypeToComponentMap;
18
19
  };
19
- export default ModalWithState;
20
+ export default SafeModalWithState;
@@ -7,7 +7,7 @@ import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolb
7
7
  import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
8
8
  import type { Node } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
- import type { cardPlugin } from '../plugin';
10
+ import type { cardPlugin } from '../cardPlugin';
11
11
  export type EditLinkToolbarProps = {
12
12
  view: EditorView;
13
13
  providerFactory: ProviderFactory;
@@ -1,7 +1,7 @@
1
1
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { EditorCardPluginEvents } from '../../analytics/create-events-queue';
4
- import type { CardPluginEvent } from '../../analytics/types';
3
+ import type { EditorCardPluginEvents } from '../analytics/create-events-queue';
4
+ import type { CardPluginEvent } from '../analytics/types';
5
5
  export type AnalyticsBindingsProps = {
6
6
  editorView: EditorView;
7
7
  cardPluginEvents: EditorCardPluginEvents<CardPluginEvent>;
@@ -1,10 +1,5 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import type { AnalyticsBindingsProps } from './common';
4
3
  export declare class EditorLinkingPlatformAnalytics extends React.PureComponent<AnalyticsBindingsProps> {
5
- static contextTypes: {
6
- contextAdapter: PropTypes.Requireable<object>;
7
- };
8
- context: any;
9
- render(): JSX.Element | null;
4
+ render(): JSX.Element;
10
5
  }
@@ -5,7 +5,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
5
5
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
- import { type CardPlugin } from '../plugin';
8
+ import { type CardPlugin } from '../cardPluginType';
9
9
  export interface HyperlinkToolbarAppearanceProps {
10
10
  intl: IntlShape;
11
11
  editorState: EditorState;
@@ -8,4 +8,4 @@ export declare const getDatasource: (editorView: EditorView) => {
8
8
  node: undefined;
9
9
  pos: undefined;
10
10
  };
11
- export declare const isDatasourceTableLayout: (layout: unknown) => layout is "full-width" | "center" | "wide";
11
+ export declare const isDatasourceTableLayout: (layout: unknown) => layout is "center" | "wide" | "full-width";
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import type { IntlShape } from 'react-intl-next';
4
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
4
  import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
@@ -19,10 +18,6 @@ export interface LinkToolbarAppearanceProps {
19
18
  isDatasourceView?: boolean;
20
19
  }
21
20
  export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, {}> {
22
- static contextTypes: {
23
- contextAdapter: PropTypes.Requireable<object>;
24
- };
25
- context: any;
26
21
  renderDropdown: (view?: EditorView, cardContext?: CardContext) => JSX.Element | null;
27
- render(): JSX.Element | null;
22
+ render(): JSX.Element;
28
23
  }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { useSmartCardContext } from '@atlaskit/link-provider';
3
+ export declare const WithCardContext: ({ children, }: {
4
+ children: (cardContext: ReturnType<typeof useSmartCardContext>) => React.ReactNode;
5
+ }) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { DatasourceModalType } from '@atlaskit/editor-common/types';
3
3
  import type { APIError } from '@atlaskit/smart-card';
4
- import type { DatasourceProps } from './nodeviews/datasource';
4
+ import type { DatasourceProps } from '../nodeviews/datasource';
5
5
  export type DatasourceErrorBoundaryProps = React.PropsWithChildren<{
6
6
  url?: string;
7
7
  unsupportedComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
@@ -1,6 +1,6 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { CardContext } from '@atlaskit/link-provider';
3
- import type { cardPlugin } from '../../plugin';
3
+ import type { cardPlugin } from '../../cardPlugin';
4
4
  export type LinkUpgradeDiscoverabilityProps = {
5
5
  url: string;
6
6
  linkPosition: number;
@@ -2,8 +2,8 @@ import type { IntlShape } from 'react-intl-next';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { CardOptions } from '@atlaskit/editor-common/card';
4
4
  import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
5
- import type { CardPluginOptions } from './types';
6
- import type { cardPlugin } from './index';
5
+ import type { cardPlugin } from '../index';
6
+ import type { CardPluginOptions } from '../types';
7
7
  export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
8
8
  export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
9
9
  export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
@@ -0,0 +1,2 @@
1
+ import type { CardPlugin } from './cardPluginType';
2
+ export declare const cardPlugin: CardPlugin;
@@ -35,5 +35,4 @@ export type CardPlugin = NextEditorPlugin<'card', {
35
35
  sharedState: CardPluginState | null;
36
36
  actions: CardPluginActions;
37
37
  }>;
38
- export declare const cardPlugin: CardPlugin;
39
38
  export {};
@@ -1,3 +1,3 @@
1
- export { cardPlugin } from './plugin';
2
- export type { CardPlugin } from './plugin';
1
+ export { cardPlugin } from './cardPlugin';
2
+ export type { CardPlugin } from './cardPluginType';
3
3
  export type { Request, CardPluginOptions, CardPluginState } from './types';
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import ReactNodeView, { type getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
4
3
  import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
5
4
  import type { Node } from '@atlaskit/editor-prosemirror/model';
@@ -8,9 +7,6 @@ import { Datasource } from '../nodeviews/datasource';
8
7
  import type { SmartCardProps } from './genericCard';
9
8
  export declare class BlockCardComponent extends React.PureComponent<SmartCardProps> {
10
9
  private scrollContainer?;
11
- static contextTypes: {
12
- contextAdapter: PropTypes.Requireable<object>;
13
- };
14
10
  constructor(props: SmartCardProps);
15
11
  onResolve: (data: {
16
12
  url?: string | undefined;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
- import PropTypes from 'prop-types';
8
7
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
9
8
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
10
9
  import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
@@ -25,10 +24,6 @@ export interface DatasourceProps extends ReactComponentProps {
25
24
  interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
26
25
  }
27
26
  export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
28
- static contextTypes: {
29
- contextAdapter: PropTypes.Requireable<object>;
30
- };
31
- context: any;
32
27
  constructor(props: DatasourceComponentProps);
33
28
  private getDatasource;
34
29
  private getTableView;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import type { RichMediaLayout } from '@atlaskit/adf-schema';
4
3
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
5
4
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
@@ -16,10 +15,6 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
16
15
  private scrollContainer?;
17
16
  private embedIframeRef;
18
17
  constructor(props: SmartCardProps);
19
- context: any;
20
- static contextTypes: {
21
- contextAdapter: PropTypes.Requireable<object>;
22
- };
23
18
  state: EmbedCardState;
24
19
  private getPosSafely;
25
20
  onResolve: (data: {
@@ -30,7 +30,7 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
30
30
  showDatasourceModal: boolean;
31
31
  datasourceModalType?: import("@atlaskit/editor-common/types").DatasourceModalType | undefined;
32
32
  datasourceTableRef?: HTMLElement | undefined;
33
- layout?: "full-width" | "center" | "wide" | undefined;
33
+ layout?: "center" | "wide" | "full-width" | undefined;
34
34
  inlineCardAwarenessCandidatePosition?: number | undefined;
35
35
  overlayCandidatePosition?: number | undefined;
36
36
  removeOverlay?: (() => void) | undefined;
@@ -4,7 +4,7 @@ import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
5
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { CardContext } from '@atlaskit/link-provider';
7
- import type { CardInfo, DatasourceNode } from './types';
7
+ import type { CardInfo, DatasourceNode } from '../types';
8
8
  export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
9
9
  export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
10
10
  export type TitleUrlPair = {
@@ -7,9 +7,9 @@ import type { DatasourceModalType, EditorAppearance, LinkPickerOptions } from '@
7
7
  import type { Node } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { DatasourceAdf, DatasourceAdfView } from '@atlaskit/linking-common';
9
9
  import type { SmartLinkEvents } from '@atlaskit/smart-card';
10
- import type { EditorCardPluginEvents } from './analytics/create-events-queue';
11
- import type { CardPluginEvent } from './analytics/types';
12
- import type { DatasourceTableLayout } from './ui/LayoutButton/types';
10
+ import type { EditorCardPluginEvents } from '../ui/analytics/create-events-queue';
11
+ import type { CardPluginEvent } from '../ui/analytics/types';
12
+ import type { DatasourceTableLayout } from '../ui/LayoutButton/types';
13
13
  export type CardType = CardAppearance | 'url' | 'datasource';
14
14
  export type DatasourceNode = Omit<Node, 'attrs'> & {
15
15
  readonly attrs: DatasourceAdf['attrs'] & Partial<RichMediaAttributes>;
@@ -3,7 +3,7 @@ import type { IntlShape } from 'react-intl-next';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { CardContext } from '@atlaskit/link-provider';
6
+ import { type CardContext } from '@atlaskit/link-provider';
7
7
  export interface DatasourceAppearanceButtonProps {
8
8
  intl: IntlShape;
9
9
  editorAnalyticsApi?: EditorAnalyticsAPI;
@@ -4,11 +4,12 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { ConfigModalProps } from '@atlaskit/link-datasource';
5
5
  import type { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
6
6
  import type { DatasourceParameters } from '@atlaskit/linking-types';
7
- import type { cardPlugin } from '../../plugin';
8
- declare const ModalWithState: ({ api, editorView, }: {
7
+ import type { cardPlugin } from '../../cardPlugin';
8
+ type ModalWithStateProps = {
9
9
  api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
10
10
  editorView: EditorView;
11
- }) => JSX.Element | null;
11
+ };
12
+ declare const SafeModalWithState: React.MemoExoticComponent<({ api, editorView }: ModalWithStateProps) => JSX.Element>;
12
13
  export type ModalTypeToComponentMap = {
13
14
  componentType: React.ComponentType<ConfigModalProps<InlineCardAdf | DatasourceAdf, DatasourceParameters>>;
14
15
  datasourceId: string;
@@ -16,4 +17,4 @@ export type ModalTypeToComponentMap = {
16
17
  export declare const modalTypeToComponentMap: {
17
18
  [key in DatasourceModalType]: ModalTypeToComponentMap;
18
19
  };
19
- export default ModalWithState;
20
+ export default SafeModalWithState;
@@ -7,7 +7,7 @@ import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolb
7
7
  import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
8
8
  import type { Node } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
- import type { cardPlugin } from '../plugin';
10
+ import type { cardPlugin } from '../cardPlugin';
11
11
  export type EditLinkToolbarProps = {
12
12
  view: EditorView;
13
13
  providerFactory: ProviderFactory;
@@ -1,7 +1,7 @@
1
1
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { EditorCardPluginEvents } from '../../analytics/create-events-queue';
4
- import type { CardPluginEvent } from '../../analytics/types';
3
+ import type { EditorCardPluginEvents } from '../analytics/create-events-queue';
4
+ import type { CardPluginEvent } from '../analytics/types';
5
5
  export type AnalyticsBindingsProps = {
6
6
  editorView: EditorView;
7
7
  cardPluginEvents: EditorCardPluginEvents<CardPluginEvent>;
@@ -1,10 +1,5 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import type { AnalyticsBindingsProps } from './common';
4
3
  export declare class EditorLinkingPlatformAnalytics extends React.PureComponent<AnalyticsBindingsProps> {
5
- static contextTypes: {
6
- contextAdapter: PropTypes.Requireable<object>;
7
- };
8
- context: any;
9
- render(): JSX.Element | null;
4
+ render(): JSX.Element;
10
5
  }
@@ -5,7 +5,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
5
5
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
- import { type CardPlugin } from '../plugin';
8
+ import { type CardPlugin } from '../cardPluginType';
9
9
  export interface HyperlinkToolbarAppearanceProps {
10
10
  intl: IntlShape;
11
11
  editorState: EditorState;
@@ -8,4 +8,4 @@ export declare const getDatasource: (editorView: EditorView) => {
8
8
  node: undefined;
9
9
  pos: undefined;
10
10
  };
11
- export declare const isDatasourceTableLayout: (layout: unknown) => layout is "full-width" | "center" | "wide";
11
+ export declare const isDatasourceTableLayout: (layout: unknown) => layout is "center" | "wide" | "full-width";
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import type { IntlShape } from 'react-intl-next';
4
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
4
  import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
@@ -19,10 +18,6 @@ export interface LinkToolbarAppearanceProps {
19
18
  isDatasourceView?: boolean;
20
19
  }
21
20
  export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, {}> {
22
- static contextTypes: {
23
- contextAdapter: PropTypes.Requireable<object>;
24
- };
25
- context: any;
26
21
  renderDropdown: (view?: EditorView, cardContext?: CardContext) => JSX.Element | null;
27
- render(): JSX.Element | null;
22
+ render(): JSX.Element;
28
23
  }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { useSmartCardContext } from '@atlaskit/link-provider';
3
+ export declare const WithCardContext: ({ children, }: {
4
+ children: (cardContext: ReturnType<typeof useSmartCardContext>) => React.ReactNode;
5
+ }) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { DatasourceModalType } from '@atlaskit/editor-common/types';
3
3
  import type { APIError } from '@atlaskit/smart-card';
4
- import type { DatasourceProps } from './nodeviews/datasource';
4
+ import type { DatasourceProps } from '../nodeviews/datasource';
5
5
  export type DatasourceErrorBoundaryProps = React.PropsWithChildren<{
6
6
  url?: string;
7
7
  unsupportedComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
@@ -1,6 +1,6 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { CardContext } from '@atlaskit/link-provider';
3
- import type { cardPlugin } from '../../plugin';
3
+ import type { cardPlugin } from '../../cardPlugin';
4
4
  export type LinkUpgradeDiscoverabilityProps = {
5
5
  url: string;
6
6
  linkPosition: number;
@@ -2,8 +2,8 @@ import type { IntlShape } from 'react-intl-next';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { CardOptions } from '@atlaskit/editor-common/card';
4
4
  import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
5
- import type { CardPluginOptions } from './types';
6
- import type { cardPlugin } from './index';
5
+ import type { cardPlugin } from '../index';
6
+ import type { CardPluginOptions } from '../types';
7
7
  export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
8
8
  export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
9
9
  export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/analytics-next": "^10.1.0",
35
+ "@atlaskit/analytics-next": "^10.2.0",
36
36
  "@atlaskit/custom-steps": "^0.9.0",
37
37
  "@atlaskit/editor-common": "^96.3.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
@@ -49,13 +49,13 @@
49
49
  "@atlaskit/icon": "^23.1.0",
50
50
  "@atlaskit/link-analytics": "^8.6.0",
51
51
  "@atlaskit/link-client-extension": "^3.0.0",
52
- "@atlaskit/link-datasource": "^3.13.0",
52
+ "@atlaskit/link-datasource": "^3.14.0",
53
53
  "@atlaskit/linking-common": "^6.0.0",
54
54
  "@atlaskit/linking-types": "^9.5.0",
55
55
  "@atlaskit/menu": "2.13.6",
56
56
  "@atlaskit/platform-feature-flags": "^0.3.0",
57
57
  "@atlaskit/primitives": "^13.3.0",
58
- "@atlaskit/smart-card": "^32.6.0",
58
+ "@atlaskit/smart-card": "^32.7.0",
59
59
  "@atlaskit/theme": "^14.0.0",
60
60
  "@atlaskit/tmp-editor-statsig": "^2.23.0",
61
61
  "@atlaskit/tokens": "^2.4.0",
@@ -75,6 +75,9 @@
75
75
  },
76
76
  "techstack": {
77
77
  "@atlassian/frontend": {
78
+ "code-structure": [
79
+ "editor-plugin"
80
+ ],
78
81
  "import-structure": [
79
82
  "atlassian-conventions"
80
83
  ],
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.CardContextProvider = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
- var _react = _interopRequireDefault(require("react"));
15
- var _propTypes = _interopRequireDefault(require("prop-types"));
16
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
17
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
- /**
19
- * Provides the link provider context via the legacy context adapter
20
- * and children render function
21
- */
22
- // eslint-disable-next-line @repo/internal/react/no-class-components
23
- var CardContextProvider = exports.CardContextProvider = /*#__PURE__*/function (_React$Component) {
24
- (0, _inherits2.default)(CardContextProvider, _React$Component);
25
- var _super = _createSuper(CardContextProvider);
26
- function CardContextProvider() {
27
- (0, _classCallCheck2.default)(this, CardContextProvider);
28
- return _super.apply(this, arguments);
29
- }
30
- (0, _createClass2.default)(CardContextProvider, [{
31
- key: "render",
32
- value:
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
-
35
- function render() {
36
- var _this$context$context;
37
- var cardContext = this.context.contextAdapter ? (_this$context$context = this.context.contextAdapter.card) === null || _this$context$context === void 0 ? void 0 : _this$context$context.value : undefined;
38
- return this.props.children({
39
- cardContext: cardContext
40
- });
41
- }
42
- }]);
43
- return CardContextProvider;
44
- }(_react.default.Component);
45
- (0, _defineProperty2.default)(CardContextProvider, "contextTypes", {
46
- contextAdapter: _propTypes.default.object
47
- });
@@ -1,22 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- /**
5
- * Provides the link provider context via the legacy context adapter
6
- * and children render function
7
- */
8
- // eslint-disable-next-line @repo/internal/react/no-class-components
9
- export class CardContextProvider extends React.Component {
10
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
-
12
- render() {
13
- var _this$context$context;
14
- const cardContext = this.context.contextAdapter ? (_this$context$context = this.context.contextAdapter.card) === null || _this$context$context === void 0 ? void 0 : _this$context$context.value : undefined;
15
- return this.props.children({
16
- cardContext
17
- });
18
- }
19
- }
20
- _defineProperty(CardContextProvider, "contextTypes", {
21
- contextAdapter: PropTypes.object
22
- });