@atlaskit/editor-plugin-card 7.4.7 → 7.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/types/cardPluginType.d.ts +3 -3
  3. package/dist/types/nodeviews/blockCard.d.ts +7 -7
  4. package/dist/types/nodeviews/datasource.d.ts +5 -5
  5. package/dist/types/nodeviews/embedCard.d.ts +8 -8
  6. package/dist/types/nodeviews/genericCard.d.ts +19 -19
  7. package/dist/types/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  8. package/dist/types/pm-plugins/actions.d.ts +1 -1
  9. package/dist/types/pm-plugins/doc.d.ts +5 -5
  10. package/dist/types/pm-plugins/util/state.d.ts +13 -13
  11. package/dist/types/types/index.d.ts +48 -48
  12. package/dist/types/ui/AwarenessWrapper/index.d.ts +4 -4
  13. package/dist/types/ui/ConfigureOverlay/index.d.ts +2 -2
  14. package/dist/types/ui/DatasourceAppearanceButton.d.ts +5 -5
  15. package/dist/types/ui/DatasourceDropdownOption.d.ts +3 -3
  16. package/dist/types/ui/DatasourceModal/index.d.ts +2 -2
  17. package/dist/types/ui/EditLinkToolbar.d.ts +10 -10
  18. package/dist/types/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
  19. package/dist/types/ui/EditToolbarButton/types.d.ts +4 -4
  20. package/dist/types/ui/EditorAnalyticsContext.d.ts +1 -1
  21. package/dist/types/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  22. package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +4 -4
  23. package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -1
  24. package/dist/types/ui/LayoutButton/types.d.ts +4 -4
  25. package/dist/types/ui/LinkToolbarAppearance.d.ts +6 -6
  26. package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +2 -2
  27. package/dist/types/ui/OpenPreviewButton/index.d.ts +2 -2
  28. package/dist/types/ui/Pulse/index.d.ts +6 -6
  29. package/dist/types/ui/ResizableEmbedCard.d.ts +2 -2
  30. package/dist/types/ui/ToolbarViewedEvent.d.ts +1 -1
  31. package/dist/types/ui/analytics/create-events-queue.d.ts +2 -2
  32. package/dist/types/ui/analytics/events-from-tr.d.ts +1 -1
  33. package/dist/types/ui/analytics/types.d.ts +11 -11
  34. package/dist/types/ui/analytics/utils.d.ts +1 -1
  35. package/dist/types/ui/datasourceErrorBoundary.d.ts +4 -4
  36. package/dist/types/ui/hooks/useLinkUpgradeDiscoverability.d.ts +4 -4
  37. package/dist/types/ui/preview/PreviewInvoker.d.ts +1 -1
  38. package/dist/types/ui/toolbar.d.ts +1 -1
  39. package/dist/types/ui/useFetchDatasourceInfo.d.ts +2 -2
  40. package/dist/types-ts4.5/cardPluginType.d.ts +3 -3
  41. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +7 -7
  42. package/dist/types-ts4.5/nodeviews/datasource.d.ts +5 -5
  43. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +8 -8
  44. package/dist/types-ts4.5/nodeviews/genericCard.d.ts +19 -19
  45. package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +1 -1
  46. package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
  47. package/dist/types-ts4.5/pm-plugins/doc.d.ts +5 -5
  48. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +13 -13
  49. package/dist/types-ts4.5/types/index.d.ts +48 -48
  50. package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +4 -4
  51. package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +2 -2
  52. package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +5 -5
  53. package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +3 -3
  54. package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +2 -2
  55. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +10 -10
  56. package/dist/types-ts4.5/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
  57. package/dist/types-ts4.5/ui/EditToolbarButton/types.d.ts +4 -4
  58. package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +1 -1
  59. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
  60. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +4 -4
  61. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -1
  62. package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +4 -4
  63. package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +6 -6
  64. package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +2 -2
  65. package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +2 -2
  66. package/dist/types-ts4.5/ui/Pulse/index.d.ts +6 -6
  67. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +2 -2
  68. package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +1 -1
  69. package/dist/types-ts4.5/ui/analytics/create-events-queue.d.ts +2 -2
  70. package/dist/types-ts4.5/ui/analytics/events-from-tr.d.ts +1 -1
  71. package/dist/types-ts4.5/ui/analytics/types.d.ts +11 -11
  72. package/dist/types-ts4.5/ui/analytics/utils.d.ts +1 -1
  73. package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +4 -4
  74. package/dist/types-ts4.5/ui/hooks/useLinkUpgradeDiscoverability.d.ts +4 -4
  75. package/dist/types-ts4.5/ui/preview/PreviewInvoker.d.ts +1 -1
  76. package/dist/types-ts4.5/ui/toolbar.d.ts +1 -1
  77. package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +2 -2
  78. package/package.json +5 -5
@@ -15,20 +15,19 @@ export type DatasourceNode = Omit<Node, 'attrs'> & {
15
15
  readonly attrs: DatasourceAdf['attrs'] & Partial<RichMediaAttributes>;
16
16
  };
17
17
  export type CardInfo = {
18
- title?: string;
19
- url?: string;
20
18
  id?: string;
21
19
  pos: number;
20
+ title?: string;
21
+ url?: string;
22
22
  };
23
23
  export type Request = {
24
24
  /**
25
- * The position of the link in the doc this request for upgrade is for
26
- */
27
- pos: number;
28
- /**
29
- * The URL of the link being upgraded/resolved
25
+ * Analytics action to be used when disaptching
26
+ * analytics events once the link is successfully/unsuccessfully
27
+ * resolved. Preserves the users "intent" ie was this a link
28
+ * being inserted or updated?
30
29
  */
31
- url: string;
30
+ analyticsAction?: ACTION;
32
31
  /**
33
32
  * The requested appearance to upgrade to
34
33
  */
@@ -40,11 +39,9 @@ export type Request = {
40
39
  */
41
40
  compareLinkText: boolean;
42
41
  /**
43
- * Analytics input method which preserves "how" the change
44
- * has occured. Used when analytics are dispatched after the link
45
- * is successfully/unsuccessfully resolved.
42
+ * The position of the link in the doc this request for upgrade is for
46
43
  */
47
- source: CardReplacementInputMethod;
44
+ pos: number;
48
45
  /**
49
46
  * The previous appearance of the link
50
47
  * This is necessary when tracking an update of a link
@@ -52,13 +49,6 @@ export type Request = {
52
49
  * replacing with a hyperlink and queueing it for upgrade
53
50
  */
54
51
  previousAppearance?: CardAppearance | 'url';
55
- /**
56
- * Analytics action to be used when disaptching
57
- * analytics events once the link is successfully/unsuccessfully
58
- * resolved. Preserves the users "intent" ie was this a link
59
- * being inserted or updated?
60
- */
61
- analyticsAction?: ACTION;
62
52
  /**
63
53
  * Describes if the requested `appearance` MUST be returned by the card provider
64
54
  * when resolving the link, because the request is associated with the user intent
@@ -66,12 +56,22 @@ export type Request = {
66
56
  * should not be affected by "default appearances" or "user preferences"
67
57
  */
68
58
  shouldReplaceLink?: boolean;
59
+ /**
60
+ * Analytics input method which preserves "how" the change
61
+ * has occured. Used when analytics are dispatched after the link
62
+ * is successfully/unsuccessfully resolved.
63
+ */
64
+ source: CardReplacementInputMethod;
69
65
  /**
70
66
  * Source UI that triggered this step if relevant
71
67
  * Primarily for transfering link picker UI event from initial UI action
72
68
  * through to the end of the link queue/request saga
73
69
  */
74
70
  sourceEvent?: UIAnalyticsEvent | null | undefined;
71
+ /**
72
+ * The URL of the link being upgraded/resolved
73
+ */
74
+ url: string;
75
75
  };
76
76
  /**
77
77
  * Each key in the stash is URL.
@@ -81,57 +81,57 @@ type DatasourceStash = Record<string, {
81
81
  views: DatasourceAdfView[];
82
82
  }>;
83
83
  export type CardPluginState = {
84
- requests: Request[];
85
- provider: CardProvider | null;
84
+ allowBlockCards?: boolean;
85
+ allowEmbeds?: boolean;
86
86
  cards: CardInfo[];
87
- datasourceStash: DatasourceStash;
88
- showLinkingToolbar: boolean;
89
- smartLinkEvents?: SmartLinkEvents;
90
- editorAppearance?: EditorAppearance;
91
- showDatasourceModal: boolean;
92
87
  datasourceModalType?: DatasourceModalType;
88
+ datasourceStash: DatasourceStash;
93
89
  datasourceTableRef?: HTMLElement;
94
- layout?: DatasourceTableLayout;
90
+ editorAppearance?: EditorAppearance;
95
91
  inlineCardAwarenessCandidatePosition?: number;
92
+ layout?: DatasourceTableLayout;
96
93
  overlayCandidatePosition?: number;
94
+ provider: CardProvider | null;
97
95
  removeOverlay?: () => void;
96
+ requests: Request[];
98
97
  selectedInlineLinkPosition?: number;
99
- allowEmbeds?: boolean;
100
- allowBlockCards?: boolean;
98
+ showDatasourceModal: boolean;
99
+ showLinkingToolbar: boolean;
100
+ smartLinkEvents?: SmartLinkEvents;
101
101
  };
102
102
  export type CardPluginOptions = CardOptions & {
103
+ cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
104
+ CompetitorPrompt?: React.ComponentType<{
105
+ linkType?: string;
106
+ sourceUrl: string;
107
+ }>;
108
+ disableFloatingToolbar?: boolean;
103
109
  editorAppearance?: EditorAppearance;
104
110
  fullWidthMode?: boolean;
111
+ isPageSSRed?: boolean;
105
112
  linkPicker?: LinkPickerOptions;
106
- cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
107
113
  lpLinkPicker?: boolean;
108
- disableFloatingToolbar?: boolean;
109
114
  onClickCallback?: OnClickCallback;
110
- isPageSSRed?: boolean;
111
- CompetitorPrompt?: React.ComponentType<{
112
- sourceUrl: string;
113
- linkType?: string;
114
- }>;
115
115
  };
116
116
  export type SetProvider = {
117
- type: 'SET_PROVIDER';
118
117
  provider: CardProvider | null;
118
+ type: 'SET_PROVIDER';
119
119
  };
120
120
  export type Queue = {
121
- type: 'QUEUE';
122
121
  requests: Request[];
122
+ type: 'QUEUE';
123
123
  };
124
124
  export type Resolve = {
125
125
  type: 'RESOLVE';
126
126
  url: string;
127
127
  };
128
128
  export type Register = {
129
- type: 'REGISTER';
130
129
  info: CardInfo;
130
+ type: 'REGISTER';
131
131
  };
132
132
  export type RemoveCard = {
133
- type: 'REMOVE_CARD';
134
133
  info: Partial<CardInfo>;
134
+ type: 'REMOVE_CARD';
135
135
  };
136
136
  export type ShowLinkToolbar = {
137
137
  type: 'SHOW_LINK_TOOLBAR';
@@ -140,43 +140,43 @@ export type HideLinkToolbar = {
140
140
  type: 'HIDE_LINK_TOOLBAR';
141
141
  };
142
142
  export type ShowDatasourceModal = {
143
- type: 'SHOW_DATASOURCE_MODAL';
144
143
  modalType: DatasourceModalType;
144
+ type: 'SHOW_DATASOURCE_MODAL';
145
145
  };
146
146
  export type HideDatasourceModal = {
147
147
  type: 'HIDE_DATASOURCE_MODAL';
148
148
  };
149
149
  export type RegisterSmartCardEvents = {
150
- type: 'REGISTER_EVENTS';
151
150
  smartLinkEvents: SmartLinkEvents;
151
+ type: 'REGISTER_EVENTS';
152
152
  };
153
153
  export type SetDatasourceTableRef = {
154
- type: 'SET_DATASOURCE_TABLE_REF';
155
154
  datasourceTableRef?: HTMLElement;
155
+ type: 'SET_DATASOURCE_TABLE_REF';
156
156
  };
157
157
  export type SetCardLayout = {
158
- type: 'SET_CARD_LAYOUT';
159
158
  layout: DatasourceTableLayout;
159
+ type: 'SET_CARD_LAYOUT';
160
160
  };
161
161
  export type SetCardLayoutAndDatasourceTableRef = {
162
- type: 'SET_CARD_LAYOUT_AND_DATASOURCE_TABLE_REF';
163
- layout: DatasourceTableLayout;
164
162
  datasourceTableRef?: HTMLElement;
163
+ layout: DatasourceTableLayout;
164
+ type: 'SET_CARD_LAYOUT_AND_DATASOURCE_TABLE_REF';
165
165
  };
166
166
  type ClearOverlayCandidate = {
167
167
  type: 'CLEAR_OVERLAY_CANDIDATE';
168
168
  };
169
169
  type RegisterRemoveOverlayOnInsertedLink = {
170
- type: 'REGISTER_REMOVE_OVERLAY_ON_INSERTED_LINK';
171
170
  callback: () => void;
172
171
  info?: Register['info'];
172
+ type: 'REGISTER_REMOVE_OVERLAY_ON_INSERTED_LINK';
173
173
  };
174
174
  export type SetDatasourceStash = {
175
- type: 'SET_DATASOURCE_STASH';
176
175
  datasourceStash: {
177
176
  url: string;
178
177
  views: DatasourceAdfView[];
179
178
  };
179
+ type: 'SET_DATASOURCE_STASH';
180
180
  };
181
181
  export type RemoveDatasourceStash = {
182
182
  type: 'REMOVE_DATASOURCE_STASH';
@@ -1,15 +1,15 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import type { SmartCardProps } from '../../nodeviews/genericCard';
3
3
  type AwarenessWrapperProps = {
4
+ children: JSX.Element;
4
5
  isInserted?: boolean;
6
+ isOverlayEnabled?: boolean;
7
+ isPulseEnabled?: boolean;
5
8
  isResolvedViewRendered?: boolean;
6
- children: JSX.Element;
9
+ isSelected?: boolean;
7
10
  markMostRecentlyInsertedLink: (isLinkMostRecentlyInserted: boolean) => void;
8
11
  setOverlayHoveredStyles: (isHovered: boolean) => void;
9
12
  url: string;
10
- isOverlayEnabled?: boolean;
11
- isPulseEnabled?: boolean;
12
- isSelected?: boolean;
13
13
  } & Partial<SmartCardProps>;
14
14
  export declare const AwarenessWrapper: ({ cardContext, children, getPos, isInserted, isOverlayEnabled, isSelected, isResolvedViewRendered, isPulseEnabled, markMostRecentlyInsertedLink, pluginInjectionApi, setOverlayHoveredStyles, url, appearance, }: AwarenessWrapperProps) => jsx.JSX.Element;
15
15
  export {};
@@ -1,11 +1,11 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  declare const OverlayWrapper: ({ view, targetElementPos, children, isHoveredCallback: hoverCallback, onOpenLinkClick, }: {
4
- view: EditorView;
5
- targetElementPos: number | undefined;
6
4
  children: JSX.Element;
7
5
  /** Fired when the mouse enters or leaves the overlay button */
8
6
  isHoveredCallback: (isHovered: boolean) => void;
9
7
  onOpenLinkClick: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
8
+ targetElementPos: number | undefined;
9
+ view: EditorView;
10
10
  }) => jsx.JSX.Element;
11
11
  export default OverlayWrapper;
@@ -5,13 +5,13 @@ 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
7
  export interface DatasourceAppearanceButtonProps {
8
- intl: IntlShape;
8
+ cardContext?: CardContext;
9
9
  editorAnalyticsApi?: EditorAnalyticsAPI;
10
- url: string;
11
- editorView?: EditorView;
12
10
  editorState: EditorState;
13
- cardContext?: CardContext;
14
- selected?: boolean;
11
+ editorView?: EditorView;
15
12
  inputMethod: string;
13
+ intl: IntlShape;
14
+ selected?: boolean;
15
+ url: string;
16
16
  }
17
17
  export declare const DatasourceAppearanceButton: ({ intl, editorAnalyticsApi, url, editorView, editorState, selected, inputMethod, }: DatasourceAppearanceButtonProps) => jsx.JSX.Element;
@@ -3,11 +3,11 @@ import type { IntlShape } from 'react-intl-next';
3
3
  import type { Command } from '@atlaskit/editor-common/types';
4
4
  interface Props {
5
5
  allowDatasource?: boolean;
6
+ dispatchCommand: (command: Command) => void;
7
+ inputMethod: string;
6
8
  intl: IntlShape;
7
- url: string;
8
9
  selected: boolean;
9
- inputMethod: string;
10
- dispatchCommand: (command: Command) => void;
10
+ url: string;
11
11
  }
12
12
  export declare const datasourceDisplayInformation: {
13
13
  title: {
@@ -4,9 +4,9 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { CardContext } from '@atlaskit/link-provider';
5
5
  import type { ModalTypeToComponentMap } from './ModalWithState';
6
6
  type DatasourceModalProps = {
7
- view: EditorView;
8
- editorAnalyticsApi?: EditorAnalyticsAPI;
9
7
  cardContext?: CardContext;
8
+ editorAnalyticsApi?: EditorAnalyticsAPI;
9
+ view: EditorView;
10
10
  } & ModalTypeToComponentMap;
11
11
  export declare const DatasourceModal: ({ view, cardContext, datasourceId: defaultDatasourceId, componentType: Component, }: DatasourceModalProps) => React.JSX.Element | null;
12
12
  export {};
@@ -9,15 +9,15 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { cardPlugin } from '../cardPlugin';
11
11
  export type EditLinkToolbarProps = {
12
- view: EditorView;
13
- providerFactory: ProviderFactory;
14
- url: string | undefined;
15
- text: string;
16
- node: Node;
17
- onSubmit?: (href: string, text?: string, inputMethod?: LinkInputType, analytic?: UIAnalyticsEvent | null | undefined) => void;
18
- linkPickerOptions?: LinkPickerOptions;
19
12
  forceFocusSelector: ForceFocusSelector | undefined;
13
+ linkPickerOptions?: LinkPickerOptions;
20
14
  lpLinkPicker: boolean;
15
+ node: Node;
16
+ onSubmit?: (href: string, text?: string, inputMethod?: LinkInputType, analytic?: UIAnalyticsEvent | null | undefined) => void;
17
+ providerFactory: ProviderFactory;
18
+ text: string;
19
+ url: string | undefined;
20
+ view: EditorView;
21
21
  };
22
22
  export declare function HyperlinkAddToolbarWithState({ linkPickerOptions, onSubmit, displayText, displayUrl, providerFactory, view, onCancel, invokeMethod, lpLinkPicker, onClose, onEscapeCallback, onClickAwayCallback, }: HyperlinkAddToolbarProps): React.JSX.Element;
23
23
  export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProps> {
@@ -28,10 +28,10 @@ export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProp
28
28
  }
29
29
  export declare const getEditLinkCallback: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, scrollIntoView: boolean) => Command;
30
30
  export declare const buildEditLinkToolbar: ({ providerFactory, node, pluginInjectionApi, linkPicker, lpLinkPicker, }: {
31
- providerFactory: ProviderFactory;
32
- node: Node;
33
- pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
34
31
  linkPicker?: LinkPickerOptions;
35
32
  lpLinkPicker: boolean;
33
+ node: Node;
34
+ pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
35
+ providerFactory: ProviderFactory;
36
36
  }) => FloatingToolbarItem<Command>;
37
37
  export declare const editLinkToolbarConfig: (showLinkingToolbar: boolean, lpLinkPicker?: boolean) => Partial<FloatingToolbarConfig>;
@@ -1,9 +1,9 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import type { EditDatasourceToolbarButtonWithCommonProps, EditVariant } from './types';
3
3
  interface EditToolbarPresentationProps extends EditDatasourceToolbarButtonWithCommonProps {
4
- extensionKey?: string;
5
4
  datasourceId?: string;
6
5
  editVariant: EditVariant;
6
+ extensionKey?: string;
7
7
  }
8
8
  declare const EditToolbarButtonPresentation: ({ datasourceId, currentAppearance, editorAnalyticsApi, editVariant, editorView, extensionKey, onLinkEditClick, intl, }: EditToolbarPresentationProps) => jsx.JSX.Element | null;
9
9
  export default EditToolbarButtonPresentation;
@@ -7,11 +7,11 @@ import type { CardContext } from '@atlaskit/link-provider';
7
7
  import { type CardType } from '../../types';
8
8
  export type EditVariant = 'none' | 'edit-link' | 'edit-datasource' | 'edit-dropdown';
9
9
  export interface EditDatasourceToolbarButtonWithCommonProps {
10
- intl: IntlShape;
11
- onLinkEditClick: Command;
10
+ currentAppearance?: CardType;
12
11
  editorAnalyticsApi?: EditorAnalyticsAPI;
13
12
  editorView?: EditorView;
14
- currentAppearance?: CardType;
13
+ intl: IntlShape;
14
+ onLinkEditClick: Command;
15
15
  }
16
16
  export interface EditDatasourceToolbarButtonWithUrlProps extends EditDatasourceToolbarButtonWithCommonProps {
17
17
  cardContext?: CardContext;
@@ -24,7 +24,7 @@ export interface EditDatasourceToolbarButtonWithDatasourceIdProps extends EditDa
24
24
  }
25
25
  export type EditDatasourceToolbarButtonProps = EditDatasourceToolbarButtonWithCommonProps & {
26
26
  cardContext?: CardContext;
27
- url?: string;
28
27
  datasourceId?: string;
29
28
  node?: Node;
29
+ url?: string;
30
30
  };
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  export type EditorAnalyticsContextProps = {
4
- editorView?: EditorView;
5
4
  children: React.ReactNode;
5
+ editorView?: EditorView;
6
6
  };
7
7
  /**
8
8
  * Provides location attribute to child events
@@ -3,15 +3,15 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { EditorCardPluginEvents } from '../analytics/create-events-queue';
4
4
  import type { CardPluginEvent } from '../analytics/types';
5
5
  export type AnalyticsBindingsProps = {
6
- editorView: EditorView;
7
6
  cardPluginEvents: EditorCardPluginEvents<CardPluginEvent>;
7
+ editorView: EditorView;
8
8
  };
9
9
  type EventMetadata = {
10
10
  action?: string;
11
11
  inputMethod?: string;
12
- sourceEvent?: unknown;
13
12
  isRedo?: boolean;
14
13
  isUndo?: boolean;
14
+ sourceEvent?: unknown;
15
15
  };
16
16
  export declare const getMethod: (metadata: EventMetadata) => string | undefined;
17
17
  export declare const getUpdateType: (metadata: EventMetadata) => string | undefined;
@@ -7,12 +7,12 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import { type CardPlugin } from '../cardPluginType';
9
9
  export interface HyperlinkToolbarAppearanceProps {
10
- intl: IntlShape;
11
- editorState: EditorState;
12
- url: string;
13
- editorView?: EditorView;
14
10
  cardOptions?: CardOptions;
15
11
  editorAnalyticsApi: EditorAnalyticsAPI | undefined;
16
12
  editorPluginApi: ExtractInjectionAPI<CardPlugin> | undefined;
13
+ editorState: EditorState;
14
+ editorView?: EditorView;
15
+ intl: IntlShape;
16
+ url: string;
17
17
  }
18
18
  export declare function HyperlinkToolbarAppearance(props: HyperlinkToolbarAppearanceProps): React.JSX.Element | null;
@@ -1,7 +1,7 @@
1
1
  import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlaskit/editor-common/types';
2
2
  import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
3
3
  export declare const getCustomHyperlinkAppearanceDropdown: ({ url, intl, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
4
- settingsConfig: FloatingToolbarItem<Command>;
5
4
  allowDatasource?: boolean;
6
5
  isDatasourceView?: boolean;
6
+ settingsConfig: FloatingToolbarItem<Command>;
7
7
  }) => FloatingToolbarCustom<Command>;
@@ -9,14 +9,14 @@ export declare const DATASOURCE_TABLE_LAYOUTS: readonly [
9
9
  ];
10
10
  export type DatasourceTableLayout = (typeof DATASOURCE_TABLE_LAYOUTS)[number];
11
11
  export type LayoutButtonProps = {
12
- mountPoint?: HTMLElement;
13
12
  boundariesElement?: HTMLElement;
14
- scrollableElement?: HTMLElement;
15
- targetElement?: HTMLElement;
13
+ intl: IntlShape;
16
14
  layout?: DatasourceTableLayout;
15
+ mountPoint?: HTMLElement;
17
16
  onLayoutChange?: (layout: DatasourceTableLayout) => void;
17
+ scrollableElement?: HTMLElement;
18
+ targetElement?: HTMLElement;
18
19
  testId?: string;
19
- intl: IntlShape;
20
20
  };
21
21
  export interface LayoutButtonWrapperProps extends Pick<LayoutButtonProps, 'mountPoint' | 'boundariesElement' | 'scrollableElement'> {
22
22
  api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
@@ -6,16 +6,16 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
6
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
7
  import type { CardContext } from '@atlaskit/link-provider';
8
8
  export interface LinkToolbarAppearanceProps {
9
- intl: IntlShape;
10
- editorAnalyticsApi: EditorAnalyticsAPI | undefined;
9
+ allowBlockCards?: boolean;
10
+ allowEmbeds?: boolean;
11
11
  currentAppearance?: CardAppearance;
12
+ editorAnalyticsApi: EditorAnalyticsAPI | undefined;
12
13
  editorState: EditorState;
13
14
  editorView?: EditorView;
14
- url?: string;
15
- allowEmbeds?: boolean;
16
- allowBlockCards?: boolean;
17
- showUpgradeDiscoverability?: boolean;
15
+ intl: IntlShape;
18
16
  isDatasourceView?: boolean;
17
+ showUpgradeDiscoverability?: boolean;
18
+ url?: string;
19
19
  }
20
20
  export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, Object> {
21
21
  renderDropdown: (view?: EditorView, cardContext?: CardContext) => React.JSX.Element | null;
@@ -2,13 +2,13 @@ import React from 'react';
2
2
  import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types';
3
3
  import { type LinkToolbarAppearanceProps } from './LinkToolbarAppearance';
4
4
  type Props = LinkToolbarAppearanceProps & {
5
+ allowDatasource?: boolean;
5
6
  dispatchCommand: (command: Command) => void;
6
7
  settingsConfig: FloatingToolbarItem<Command>;
7
- allowDatasource?: boolean;
8
8
  };
9
9
  export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
10
10
  export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
11
- settingsConfig: FloatingToolbarItem<Command>;
12
11
  allowDatasource?: boolean;
12
+ settingsConfig: FloatingToolbarItem<Command>;
13
13
  }) => FloatingToolbarDropdown<Command>;
14
14
  export {};
@@ -3,9 +3,9 @@ import { type IntlShape } from 'react-intl-next';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
5
  type OpenPreviewPanelToolbarButtonProps = {
6
- node: PMNode;
7
- intl: IntlShape;
8
6
  editorAnalyticsApi?: EditorAnalyticsAPI;
7
+ intl: IntlShape;
8
+ node: PMNode;
9
9
  };
10
10
  export declare const OpenPreviewPanelToolbarButton: ({ node, intl, }: OpenPreviewPanelToolbarButtonProps) => React.JSX.Element | null;
11
11
  export {};
@@ -5,6 +5,12 @@ export interface PulseProps {
5
5
  * The component around which the Pulse should be displayed
6
6
  */
7
7
  children: JSX.Element;
8
+ /**
9
+ * Indicates when the feature is considered discovered. If "start" is passed, local storage key will be invalidated
10
+ * as soon as the animation starts. If "iteration" is passed (the default one), it will be invalidated after the first iteration
11
+ */
12
+ discoveryMode?: PulseDiscoveryMode;
13
+ isInline?: boolean;
8
14
  /**
9
15
  * The key that is used in local storage to identify the descoverability of a feature where the Pulse is used
10
16
  */
@@ -13,13 +19,7 @@ export interface PulseProps {
13
19
  * The time in ms after which the key in local storage will be considered expired and the Pulse will be shown again
14
20
  */
15
21
  localStorageKeyExpirationInMs?: number;
16
- /**
17
- * Indicates when the feature is considered discovered. If "start" is passed, local storage key will be invalidated
18
- * as soon as the animation starts. If "iteration" is passed (the default one), it will be invalidated after the first iteration
19
- */
20
- discoveryMode?: PulseDiscoveryMode;
21
22
  shouldShowPulse?: boolean;
22
23
  testId?: string;
23
- isInline?: boolean;
24
24
  }
25
25
  export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, isInline, }: PulseProps) => React.JSX.Element;
@@ -11,10 +11,10 @@ type State = {
11
11
  resizedPctWidth?: number;
12
12
  };
13
13
  export type Props = Omit<ResizerProps, 'height' | 'width'> & {
14
- width?: number;
15
- height?: number;
16
14
  aspectRatio: number;
15
+ height?: number;
17
16
  isResizeDisabled?: boolean;
17
+ width?: number;
18
18
  };
19
19
  export default class ResizableEmbedCard extends React.Component<Props, State> {
20
20
  static defaultProps: {
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { EditorAnalyticsContextProps } from './EditorAnalyticsContext';
3
3
  type ToolbarViewedEventProps = {
4
- url?: string;
5
4
  display: string | null;
5
+ url?: string;
6
6
  };
7
7
  /**
8
8
  * Provides analytics context and card context
@@ -1,9 +1,9 @@
1
1
  export type Subscriber<T> = (event: T) => void;
2
2
  export type EditorCardPluginEvents<T> = {
3
- push: (...events: T[]) => void;
4
- subscribe: (listener: Subscriber<T>) => () => void;
5
3
  flush: () => void;
6
4
  getSize: () => number;
5
+ push: (...events: T[]) => void;
6
+ subscribe: (listener: Subscriber<T>) => () => void;
7
7
  };
8
8
  /**
9
9
  * Simple mechanism to defer event related callbacks
@@ -7,8 +7,8 @@ export declare const findChanged: (tr: Transaction | ReadonlyTransaction, state:
7
7
  removed: Entity[];
8
8
  inserted: Entity[];
9
9
  updated: ({
10
- removed: Entity;
11
10
  inserted: Entity;
11
+ removed: Entity;
12
12
  } | {
13
13
  inserted: Entity;
14
14
  previous: {
@@ -1,17 +1,17 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  export type Entity = {
3
- pos: number;
4
3
  node: Node;
5
4
  nodeContext: string;
5
+ pos: number;
6
6
  };
7
7
  type Metadata<T = Object> = {
8
- node: Node;
9
- isUndo?: boolean;
10
- isRedo?: boolean;
11
8
  action?: string;
12
9
  inputMethod?: string;
13
- sourceEvent?: unknown;
10
+ isRedo?: boolean;
11
+ isUndo?: boolean;
12
+ node: Node;
14
13
  nodeContext?: string;
14
+ sourceEvent?: unknown;
15
15
  } & T;
16
16
  type UpdateMetadata = {
17
17
  previousDisplay?: string;
@@ -31,34 +31,34 @@ export declare enum EVENT_SUBJECT {
31
31
  * events can be derived from them / think of them in the same way
32
32
  */
33
33
  export type LinkCreatedEvent = {
34
+ data: Metadata;
34
35
  event: EVENT.CREATED;
35
36
  subject: EVENT_SUBJECT.LINK;
36
- data: Metadata;
37
37
  };
38
38
  export type LinkUpdatedEvent = {
39
+ data: Metadata<UpdateMetadata>;
39
40
  event: EVENT.UPDATED;
40
41
  subject: EVENT_SUBJECT.LINK;
41
- data: Metadata<UpdateMetadata>;
42
42
  };
43
43
  export type LinkDeletedEvent = {
44
+ data: Metadata;
44
45
  event: EVENT.DELETED;
45
46
  subject: EVENT_SUBJECT.LINK;
46
- data: Metadata;
47
47
  };
48
48
  export type DatasourceCreatedEvent = {
49
+ data: Metadata;
49
50
  event: EVENT.CREATED;
50
51
  subject: EVENT_SUBJECT.DATASOURCE;
51
- data: Metadata;
52
52
  };
53
53
  export type DatasourceUpdatedEvent = {
54
+ data: Metadata<UpdateMetadata>;
54
55
  event: EVENT.UPDATED;
55
56
  subject: EVENT_SUBJECT.DATASOURCE;
56
- data: Metadata<UpdateMetadata>;
57
57
  };
58
58
  export type DatasourceDeletedEvent = {
59
+ data: Metadata;
59
60
  event: EVENT.DELETED;
60
61
  subject: EVENT_SUBJECT.DATASOURCE;
61
- data: Metadata;
62
62
  };
63
63
  export type LinkEvent = LinkCreatedEvent | LinkUpdatedEvent | LinkDeletedEvent;
64
64
  export type DatasourceEvent = DatasourceCreatedEvent | DatasourceUpdatedEvent | DatasourceDeletedEvent;
@@ -10,7 +10,7 @@ export declare function getNodeSubject(node: Node): EVENT_SUBJECT | null;
10
10
  /**
11
11
  * Analytics appearance for link object
12
12
  */
13
- export declare function appearanceForLink(node: Node): "url" | import("@atlaskit/editor-common/provider-factory").CardAppearance;
13
+ export declare function appearanceForLink(node: Node): import("@atlaskit/editor-common/provider-factory").CardAppearance | "url";
14
14
  export declare function getUrl(node: Node): string | undefined;
15
15
  export declare const getNodeContext: (doc: Node, pos: number) => string;
16
16
  export declare const findAtPositions: (tr: Transaction | ReadonlyTransaction, positions: number[]) => Entity[];