@atlaskit/editor-plugin-card 17.4.10 → 17.4.12

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 (83) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cardPlugin/package.json +1 -8
  3. package/cardPluginType/package.json +1 -8
  4. package/package.json +3 -3
  5. package/types/package.json +1 -8
  6. package/dist/types-ts4.5/cardPlugin.d.ts +0 -2
  7. package/dist/types-ts4.5/cardPluginType.d.ts +0 -53
  8. package/dist/types-ts4.5/entry-points/cardPlugin.d.ts +0 -1
  9. package/dist/types-ts4.5/entry-points/cardPluginType.d.ts +0 -1
  10. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  11. package/dist/types-ts4.5/index.d.ts +0 -3
  12. package/dist/types-ts4.5/nodeviews/blockCard.d.ts +0 -64
  13. package/dist/types-ts4.5/nodeviews/datasource.d.ts +0 -61
  14. package/dist/types-ts4.5/nodeviews/embedCard.d.ts +0 -102
  15. package/dist/types-ts4.5/nodeviews/genericCard.d.ts +0 -67
  16. package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +0 -20
  17. package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +0 -8
  18. package/dist/types-ts4.5/nodeviews/lazy-block-card.d.ts +0 -3
  19. package/dist/types-ts4.5/nodeviews/lazy-embed-card.d.ts +0 -3
  20. package/dist/types-ts4.5/nodeviews/lazy-inline-card.d.ts +0 -3
  21. package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +0 -29
  22. package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +0 -29
  23. package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +0 -29
  24. package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -32
  25. package/dist/types-ts4.5/pm-plugins/doc.d.ts +0 -50
  26. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -3
  27. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -5
  28. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
  29. package/dist/types-ts4.5/pm-plugins/reducers.d.ts +0 -3
  30. package/dist/types-ts4.5/pm-plugins/shouldReplaceLink.d.ts +0 -2
  31. package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +0 -9
  32. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +0 -56
  33. package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -48
  34. package/dist/types-ts4.5/types/index.d.ts +0 -208
  35. package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +0 -15
  36. package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +0 -11
  37. package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +0 -18
  38. package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +0 -29
  39. package/dist/types-ts4.5/ui/DatasourceIcon/index.d.ts +0 -3
  40. package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +0 -20
  41. package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +0 -12
  42. package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +0 -37
  43. package/dist/types-ts4.5/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +0 -9
  44. package/dist/types-ts4.5/ui/EditToolbarButton/index.d.ts +0 -3
  45. package/dist/types-ts4.5/ui/EditToolbarButton/types.d.ts +0 -31
  46. package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +0 -10
  47. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.d.ts +0 -6
  48. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/LinkEvents.d.ts +0 -6
  49. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +0 -20
  50. package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/index.d.ts +0 -5
  51. package/dist/types-ts4.5/ui/EditorSmartCardEvents.d.ts +0 -4
  52. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +0 -18
  53. package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +0 -7
  54. package/dist/types-ts4.5/ui/InlineCardOverlay/index.d.ts +0 -9
  55. package/dist/types-ts4.5/ui/InlineCardOverlay/types.d.ts +0 -6
  56. package/dist/types-ts4.5/ui/InlineCardOverlay/utils.d.ts +0 -20
  57. package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +0 -9
  58. package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +0 -24
  59. package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +0 -13
  60. package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +0 -25
  61. package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +0 -14
  62. package/dist/types-ts4.5/ui/OpenLinkToolbarButton/index.d.ts +0 -20
  63. package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +0 -14
  64. package/dist/types-ts4.5/ui/PasteDisplayAsMenu.d.ts +0 -25
  65. package/dist/types-ts4.5/ui/Pulse/index.d.ts +0 -25
  66. package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +0 -66
  67. package/dist/types-ts4.5/ui/SmartCardSSRReactContextsProvider.d.ts +0 -10
  68. package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +0 -11
  69. package/dist/types-ts4.5/ui/WithCardContext.d.ts +0 -5
  70. package/dist/types-ts4.5/ui/analytics/create-events-queue.d.ts +0 -21
  71. package/dist/types-ts4.5/ui/analytics/events-from-tr.d.ts +0 -19
  72. package/dist/types-ts4.5/ui/analytics/types.d.ts +0 -66
  73. package/dist/types-ts4.5/ui/analytics/utils.d.ts +0 -24
  74. package/dist/types-ts4.5/ui/currentPastedSmartLink.d.ts +0 -2
  75. package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +0 -24
  76. package/dist/types-ts4.5/ui/editDatasourceAction.d.ts +0 -4
  77. package/dist/types-ts4.5/ui/hooks/useLinkUpgradeDiscoverability.d.ts +0 -18
  78. package/dist/types-ts4.5/ui/local-storage.d.ts +0 -7
  79. package/dist/types-ts4.5/ui/pasteDisplayAsUtils.d.ts +0 -12
  80. package/dist/types-ts4.5/ui/preview/PreviewInvoker.d.ts +0 -12
  81. package/dist/types-ts4.5/ui/toolbar.d.ts +0 -19
  82. package/dist/types-ts4.5/ui/useFetchDatasourceDataInfo.d.ts +0 -10
  83. package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +0 -15
@@ -1,50 +0,0 @@
1
- import type { CreateUIAnalyticsEvent, UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import { ACTION } from '@atlaskit/editor-common/analytics';
4
- import type { CardReplacementInputMethod, EmbedCardNodeTransformer } from '@atlaskit/editor-common/card';
5
- import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
6
- import type { Command } from '@atlaskit/editor-common/types';
7
- import type { Attrs, Node, NodeType } from '@atlaskit/editor-prosemirror/model';
8
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
9
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
- import type { CardAdf, DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
11
- import type { Request } from '../types';
12
- export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf | DatasourceAdf, analyticsAction?: ACTION, editorAnalyticsApi?: EditorAnalyticsAPI, createAnalyticsEvent?: CreateUIAnalyticsEvent, embedCardNodeTransformer?: EmbedCardNodeTransformer) => Command;
13
- export declare const handleFallbackWithAnalytics: (request: Request, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
14
- export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
15
- /**
16
- * Queue link-mark → smart-link resolution for text nodes within an explicit
17
- * document range, rather than the entire step range of the transaction.
18
- *
19
- * Use this instead of `queueCardsFromChangedTr` when you know the exact range
20
- * that was inserted/modified and want to avoid accidentally queuing pre-existing
21
- * links that happen to fall within the broader step range.
22
- */
23
- export declare const queueCardsFromRange: (state: EditorState, tr: Transaction, from: number, to: number, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, appearance?: CardAppearance) => Transaction;
24
- export declare const queueCardFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, previousAppearance?: CardAppearance | "url") => Transaction;
25
- export declare const convertHyperlinkToSmartCard: (state: EditorState, source: CardReplacementInputMethod, appearance: CardAppearance, normalizeLinkText?: boolean) => Transaction;
26
- export declare const changeSelectedCardToLink: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
27
- export declare const changeSelectedCardToLinkFallback: (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
28
- export declare const updateCard: (href: string, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command;
29
- export declare const changeSelectedCardToText: (text: string, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
30
- export declare const setSelectedCardAppearance: (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
31
- export type LinkNodes = {
32
- [key in 'inlineCard' | 'blockCard' | 'embedCard']: NodeType;
33
- };
34
- export declare const getLinkNodeType: (appearance: CardAppearance, linkNodes: LinkNodes) => NodeType;
35
- type UpdateCardArgs = {
36
- inputMethod?: string;
37
- isDeletingConfig?: boolean;
38
- newAdf: DatasourceAdf | InlineCardAdf;
39
- node: Node;
40
- sourceEvent?: UIAnalyticsEvent;
41
- state: EditorState;
42
- view: EditorView;
43
- };
44
- export declare const updateCardViaDatasource: (args: UpdateCardArgs) => void;
45
- export declare const insertDatasource: (state: EditorState, adf: DatasourceAdf | InlineCardAdf, view: EditorView, sourceEvent?: UIAnalyticsEvent) => void;
46
- /**
47
- * Get attributes for new Card Appearance
48
- */
49
- export declare const getAttrsForAppearance: (appearance: CardAppearance, selectedNode: Node, isInsideBodiedSyncBlock?: boolean) => Attrs;
50
- export {};
@@ -1,3 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
3
- export declare function cardKeymap(featureFlags: FeatureFlags): SafePlugin;
@@ -1,5 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
3
- import type { cardPlugin } from '../index';
4
- import type { CardPluginOptions, CardPluginState } from '../types';
5
- export declare const createPlugin: (options: CardPluginOptions, pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (pmPluginFactoryParams: PMPluginFactoryParams) => SafePlugin<CardPluginState>;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { CardPluginState } from '../types';
3
- export declare const pluginKey: PluginKey<CardPluginState>;
@@ -1,3 +0,0 @@
1
- import type { CardPluginAction, CardPluginState } from '../types';
2
- declare const _default: (state: CardPluginState, action: CardPluginAction) => CardPluginState;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- import type { Node } from '@atlaskit/editor-prosemirror/model';
2
- export declare function shouldReplaceLink(node: Node, compareLinkText?: boolean, compareToUrl?: string): boolean;
@@ -1,9 +0,0 @@
1
- import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { CardOptions, EmbedCardNodeTransformer } from '@atlaskit/editor-common/card';
4
- import type { CardProvider } from '@atlaskit/editor-common/provider-factory';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { BlockCardAdf, DatasourceAdf, EmbedCardAdf, InlineCardAdf } from '@atlaskit/linking-common';
7
- import type { Request } from '../../types';
8
- export declare const resolveWithProvider: (view: EditorView, provider: CardProvider, request: Request, options: CardOptions, editorAnalyticsApi: EditorAnalyticsAPI | undefined, createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, embedCardNodeTransformer?: EmbedCardNodeTransformer) => Promise<void | DatasourceAdf<Record<string, unknown>> | InlineCardAdf | BlockCardAdf | EmbedCardAdf>;
9
- export declare const handleProvider: (_: "cardProvider", provider: Promise<CardProvider> | undefined, view: EditorView) => void;
@@ -1,56 +0,0 @@
1
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import type { ACTION } from '@atlaskit/editor-common/analytics';
3
- import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
4
- import type { CardAppearance, CardProvider } from '@atlaskit/editor-common/provider-factory';
5
- import type { DatasourceModalType, EditorAppearance } from '@atlaskit/editor-common/types';
6
- import type { EditorState, ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
7
- import type { DatasourceAdfView } from '@atlaskit/linking-common';
8
- import type { SmartLinkEvents } from '@atlaskit/smart-card';
9
- import type { CardPluginState, Request, ToolbarResolvedAttributes } from '../../types';
10
- import type { DatasourceTableLayout } from '../../ui/LayoutButton/types';
11
- export declare const getPluginState: (editorState: EditorState) => CardPluginState | undefined;
12
- export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState, tr: ReadonlyTransaction) => {
13
- allowBlockCards?: boolean;
14
- allowEmbeds?: boolean;
15
- cards: {
16
- id?: string;
17
- pos: number;
18
- title?: string;
19
- url?: string;
20
- }[];
21
- datasourceModalType?: DatasourceModalType;
22
- datasourceStash: {
23
- [x: string]: {
24
- views: DatasourceAdfView[];
25
- };
26
- };
27
- datasourceTableRef?: HTMLElement;
28
- editorAppearance?: EditorAppearance;
29
- inlineCardAwarenessCandidatePosition?: number;
30
- layout?: DatasourceTableLayout;
31
- overlayCandidatePosition?: number;
32
- provider: CardProvider | null;
33
- removeOverlay?: () => void;
34
- requests: {
35
- analyticsAction?: ACTION;
36
- appearance: CardAppearance;
37
- compareLinkText: boolean;
38
- pos: number;
39
- previousAppearance?: CardAppearance | "url";
40
- shouldReplaceLink?: boolean;
41
- source: CardReplacementInputMethod;
42
- sourceEvent?: UIAnalyticsEvent | null | undefined;
43
- url: string;
44
- }[];
45
- resolvedInlineSmartLinks?: Array<{
46
- pos: number;
47
- source: CardReplacementInputMethod;
48
- url: string;
49
- }>;
50
- resolvedToolbarAttributesByUrl: Record<string, ToolbarResolvedAttributes>;
51
- selectedInlineLinkPosition?: number;
52
- showDatasourceModal: boolean;
53
- showLinkingToolbar: boolean;
54
- smartLinkEvents?: SmartLinkEvents;
55
- };
56
- export declare const getNewRequests: (oldState: CardPluginState | undefined, currentState: CardPluginState) => Request[];
@@ -1,48 +0,0 @@
1
- import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
2
- import type { getPosHandler } from '@atlaskit/editor-common/react-node-view';
3
- import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
4
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { CardContext } from '@atlaskit/link-provider';
7
- import type { CardInfo, DatasourceNode, ToolbarResolvedAttributes } from '../types';
8
- export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
9
- export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
10
- export type TitleUrlPair = {
11
- title?: string;
12
- url?: string;
13
- };
14
- export declare const titleUrlPairFromNode: (node: Node) => TitleUrlPair;
15
- /**
16
- * Merges the title and url from attributes and CardInfo from the resolved view, preferring the CardInfo.
17
- * @param titleUrlPair title and url information from the node attributes
18
- * @param info information stored in state from the resolved UI component view
19
- */
20
- export declare const mergeCardInfo: (titleUrlPair: TitleUrlPair, info?: CardInfo) => TitleUrlPair;
21
- export declare const displayInfoForCard: (node: Node, info?: CardInfo) => TitleUrlPair;
22
- export declare const findCardInfo: (state: EditorState) => CardInfo | undefined;
23
- export declare const isEmbedSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
24
- export declare const isBlockSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
25
- export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext["store"]) => Partial<ToolbarResolvedAttributes>;
26
- export declare const isDatasourceConfigEditable: (datasourceId: string) => boolean;
27
- /**
28
- * Typeguard that checks node attributes are datasource node attributes
29
- * ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
30
- * this function will not be updated automatically
31
- */
32
- export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is DatasourceNode["attrs"];
33
- /**
34
- * Typeguard that checks a node is a datasource node (blockCard and has datasource attributes)
35
- * ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
36
- * this function will not be updated automatically
37
- */
38
- export declare const isDatasourceNode: (node?: Node) => node is DatasourceNode;
39
- /**
40
- * Focuses the editorView if it's not already focused.
41
- * @param editorView The editor view to focus.
42
- */
43
- export declare const focusEditorView: (editorView: EditorView) => void;
44
- export declare const getAwarenessProps: (editorState: EditorState, getPos: getPosHandler, allowEmbeds?: boolean, allowBlockCards?: boolean, disableOverlay?: boolean) => {
45
- isOverlayEnabled: boolean;
46
- isPulseEnabled: boolean;
47
- isSelected: boolean;
48
- };
@@ -1,208 +0,0 @@
1
- import type { RichMediaAttributes } from '@atlaskit/adf-schema';
2
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- import type { ACTION } from '@atlaskit/editor-common/analytics';
4
- import type { CardOptions, CardReplacementInputMethod, EmbedCardTransformers, OnClickCallback } from '@atlaskit/editor-common/card';
5
- import type { CardAppearance, CardProvider } from '@atlaskit/editor-common/provider-factory';
6
- import type { DatasourceModalType, EditorAppearance, LinkPickerOptions } from '@atlaskit/editor-common/types';
7
- import type { Node } from '@atlaskit/editor-prosemirror/model';
8
- import type { CardContext } from '@atlaskit/link-provider';
9
- import type { DatasourceAdf, DatasourceAdfView } from '@atlaskit/linking-common';
10
- import type { SmartLinkEvents } from '@atlaskit/smart-card';
11
- import type { EditorCardPluginEvents } from '../ui/analytics/create-events-queue';
12
- import type { CardPluginEvent } from '../ui/analytics/types';
13
- import type { DatasourceTableLayout } from '../ui/LayoutButton/types';
14
- export type CardType = CardAppearance | 'url' | 'datasource';
15
- export type DatasourceNode = Omit<Node, 'attrs'> & {
16
- readonly attrs: DatasourceAdf['attrs'] & Partial<RichMediaAttributes>;
17
- };
18
- export type CardInfo = {
19
- id?: string;
20
- pos: number;
21
- title?: string;
22
- url?: string;
23
- };
24
- export type ToolbarResolvedAttributes = {
25
- displayCategory?: 'smartLink' | 'link';
26
- extensionKey?: string | null;
27
- status?: string | null;
28
- statusDetails?: string | null;
29
- };
30
- export type Request = {
31
- /**
32
- * Analytics action to be used when disaptching
33
- * analytics events once the link is successfully/unsuccessfully
34
- * resolved. Preserves the users "intent" ie was this a link
35
- * being inserted or updated?
36
- */
37
- analyticsAction?: ACTION;
38
- /**
39
- * The requested appearance to upgrade to
40
- */
41
- appearance: CardAppearance;
42
- /**
43
- * Determines if the link should only be replaced after successful
44
- * resolution if the link's text content still matches its href
45
- * (ie has not been changed by the user since the resolve request).
46
- */
47
- compareLinkText: boolean;
48
- /**
49
- * The position of the link in the doc this request for upgrade is for
50
- */
51
- pos: number;
52
- /**
53
- * The previous appearance of the link
54
- * This is necessary when tracking an update of a link
55
- * where the link begins as a smart card, then is updated by
56
- * replacing with a hyperlink and queueing it for upgrade
57
- */
58
- previousAppearance?: CardAppearance | 'url';
59
- /**
60
- * Describes if the requested `appearance` MUST be returned by the card provider
61
- * when resolving the link, because the request is associated with the user intent
62
- * to explicitly change the link appearance to the target appearance (view switcher), and therefore
63
- * should not be affected by "default appearances" or "user preferences"
64
- */
65
- shouldReplaceLink?: boolean;
66
- /**
67
- * Analytics input method which preserves "how" the change
68
- * has occured. Used when analytics are dispatched after the link
69
- * is successfully/unsuccessfully resolved.
70
- */
71
- source: CardReplacementInputMethod;
72
- /**
73
- * Source UI that triggered this step if relevant
74
- * Primarily for transfering link picker UI event from initial UI action
75
- * through to the end of the link queue/request saga
76
- */
77
- sourceEvent?: UIAnalyticsEvent | null | undefined;
78
- /**
79
- * The URL of the link being upgraded/resolved
80
- */
81
- url: string;
82
- };
83
- /**
84
- * Each key in the stash is URL.
85
- * For any given URL we might temporarily stash some user preferences, like view settings for the datasource.
86
- */
87
- type DatasourceStash = Record<string, {
88
- views: DatasourceAdfView[];
89
- }>;
90
- export type CardPluginState = {
91
- allowBlockCards?: boolean;
92
- allowEmbeds?: boolean;
93
- cards: CardInfo[];
94
- datasourceModalType?: DatasourceModalType;
95
- datasourceStash: DatasourceStash;
96
- datasourceTableRef?: HTMLElement;
97
- editorAppearance?: EditorAppearance;
98
- embedCardTransformers?: EmbedCardTransformers;
99
- inlineCardAwarenessCandidatePosition?: number;
100
- layout?: DatasourceTableLayout;
101
- overlayCandidatePosition?: number;
102
- provider: CardProvider | null;
103
- removeOverlay?: () => void;
104
- requests: Request[];
105
- resolvedInlineSmartLinks?: Array<{
106
- pos: number;
107
- source: CardReplacementInputMethod;
108
- url: string;
109
- }>;
110
- resolvedToolbarAttributesByUrl: Record<string, ToolbarResolvedAttributes>;
111
- selectedInlineLinkPosition?: number;
112
- showDatasourceModal: boolean;
113
- showLinkingToolbar: boolean;
114
- smartLinkEvents?: SmartLinkEvents;
115
- };
116
- export type CardPluginOptions = CardOptions & {
117
- cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
118
- CompetitorPrompt?: React.ComponentType<{
119
- linkType?: string;
120
- sourceUrl: string;
121
- }>;
122
- disableFloatingToolbar?: boolean;
123
- editorAppearance?: EditorAppearance;
124
- embedCardTransformers?: EmbedCardTransformers;
125
- enablePasteDisplayAsMenu?: boolean;
126
- fullWidthMode?: boolean;
127
- isPageSSRed?: boolean;
128
- linkPicker?: LinkPickerOptions;
129
- lpLinkPicker?: boolean;
130
- onClickCallback?: OnClickCallback;
131
- smartCardContext?: CardContext;
132
- };
133
- export type SetProvider = {
134
- provider: CardProvider | null;
135
- type: 'SET_PROVIDER';
136
- };
137
- export type Queue = {
138
- requests: Request[];
139
- type: 'QUEUE';
140
- };
141
- export type Resolve = {
142
- type: 'RESOLVE';
143
- url: string;
144
- };
145
- export type Register = {
146
- info: CardInfo;
147
- type: 'REGISTER';
148
- };
149
- export type RemoveCard = {
150
- info: Partial<CardInfo>;
151
- type: 'REMOVE_CARD';
152
- };
153
- export type ShowLinkToolbar = {
154
- type: 'SHOW_LINK_TOOLBAR';
155
- };
156
- export type HideLinkToolbar = {
157
- type: 'HIDE_LINK_TOOLBAR';
158
- };
159
- export type ShowDatasourceModal = {
160
- modalType: DatasourceModalType;
161
- type: 'SHOW_DATASOURCE_MODAL';
162
- };
163
- export type HideDatasourceModal = {
164
- type: 'HIDE_DATASOURCE_MODAL';
165
- };
166
- export type RegisterSmartCardEvents = {
167
- smartLinkEvents: SmartLinkEvents;
168
- type: 'REGISTER_EVENTS';
169
- };
170
- export type SetDatasourceTableRef = {
171
- datasourceTableRef?: HTMLElement;
172
- type: 'SET_DATASOURCE_TABLE_REF';
173
- };
174
- export type SetResolvedToolbarAttributes = {
175
- attributes: ToolbarResolvedAttributes;
176
- type: 'SET_RESOLVED_TOOLBAR_ATTRIBUTES';
177
- url: string;
178
- };
179
- export type SetCardLayout = {
180
- layout: DatasourceTableLayout;
181
- type: 'SET_CARD_LAYOUT';
182
- };
183
- export type SetCardLayoutAndDatasourceTableRef = {
184
- datasourceTableRef?: HTMLElement;
185
- layout: DatasourceTableLayout;
186
- type: 'SET_CARD_LAYOUT_AND_DATASOURCE_TABLE_REF';
187
- };
188
- type ClearOverlayCandidate = {
189
- type: 'CLEAR_OVERLAY_CANDIDATE';
190
- };
191
- type RegisterRemoveOverlayOnInsertedLink = {
192
- callback: () => void;
193
- info?: Register['info'];
194
- type: 'REGISTER_REMOVE_OVERLAY_ON_INSERTED_LINK';
195
- };
196
- export type SetDatasourceStash = {
197
- datasourceStash: {
198
- url: string;
199
- views: DatasourceAdfView[];
200
- };
201
- type: 'SET_DATASOURCE_STASH';
202
- };
203
- export type RemoveDatasourceStash = {
204
- type: 'REMOVE_DATASOURCE_STASH';
205
- url: string;
206
- };
207
- export type CardPluginAction = SetProvider | Queue | Resolve | Register | RemoveCard | ShowLinkToolbar | HideLinkToolbar | ShowDatasourceModal | HideDatasourceModal | RegisterSmartCardEvents | SetDatasourceTableRef | SetResolvedToolbarAttributes | SetCardLayout | SetCardLayoutAndDatasourceTableRef | ClearOverlayCandidate | RegisterRemoveOverlayOnInsertedLink | SetDatasourceStash | RemoveDatasourceStash;
208
- export {};
@@ -1,15 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { SmartCardProps } from '../../nodeviews/genericCard';
3
- type AwarenessWrapperProps = {
4
- children: JSX.Element;
5
- isInserted?: boolean;
6
- isOverlayEnabled?: boolean;
7
- isPulseEnabled?: boolean;
8
- isResolvedViewRendered?: boolean;
9
- isSelected?: boolean;
10
- markMostRecentlyInsertedLink: (isLinkMostRecentlyInserted: boolean) => void;
11
- setOverlayHoveredStyles: (isHovered: boolean) => void;
12
- url: string;
13
- } & Partial<SmartCardProps>;
14
- export declare const AwarenessWrapper: ({ cardContext, children, getPos, isInserted, isOverlayEnabled, isSelected, isResolvedViewRendered, isPulseEnabled, markMostRecentlyInsertedLink, pluginInjectionApi, setOverlayHoveredStyles, url, appearance, }: AwarenessWrapperProps) => jsx.JSX.Element;
15
- export {};
@@ -1,11 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- declare const OverlayWrapper: ({ view, targetElementPos, children, isHoveredCallback: hoverCallback, onOpenLinkClick, }: {
4
- children: JSX.Element;
5
- /** Fired when the mouse enters or leaves the overlay button */
6
- isHoveredCallback: (isHovered: boolean) => void;
7
- onOpenLinkClick: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
8
- targetElementPos: number | undefined;
9
- view: EditorView;
10
- }) => jsx.JSX.Element;
11
- export default OverlayWrapper;
@@ -1,18 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { IntlShape } from 'react-intl';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { CardContext } from '@atlaskit/link-provider';
7
- export interface DatasourceAppearanceButtonProps {
8
- areAnyNewToolbarFlagsEnabled: boolean;
9
- cardContext?: CardContext;
10
- editorAnalyticsApi?: EditorAnalyticsAPI;
11
- editorState: EditorState;
12
- editorView?: EditorView;
13
- inputMethod: string;
14
- intl: IntlShape;
15
- selected?: boolean;
16
- url: string;
17
- }
18
- export declare const DatasourceAppearanceButton: ({ intl, editorAnalyticsApi, url, editorView, editorState, selected, inputMethod, areAnyNewToolbarFlagsEnabled, }: DatasourceAppearanceButtonProps) => jsx.JSX.Element;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import type { IntlShape } from 'react-intl';
3
- import type { Command } from '@atlaskit/editor-common/types';
4
- import type { NewCoreIconProps } from '@atlaskit/icon';
5
- interface Props {
6
- allowDatasource?: boolean;
7
- dispatchCommand: (command: Command) => void;
8
- inputMethod: string;
9
- intl: IntlShape;
10
- selected: boolean;
11
- url: string;
12
- }
13
- export declare const datasourceDisplayInformation: {
14
- icon: {
15
- (props: NewCoreIconProps): JSX.Element;
16
- displayName: string;
17
- };
18
- iconFallback: {
19
- (props: NewCoreIconProps): JSX.Element;
20
- displayName: string;
21
- };
22
- title: {
23
- defaultMessage: string;
24
- description: string;
25
- id: string;
26
- };
27
- };
28
- export declare const DatasourceDropdownOption: ({ allowDatasource, intl, url, selected, inputMethod, dispatchCommand, }: Props) => React.JSX.Element | null;
29
- export {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { GlyphProps } from '@atlaskit/icon/types';
3
- export declare const DatasourceIcon: (props: GlyphProps) => React.JSX.Element;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import type { DatasourceModalType, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { ConfigModalProps } from '@atlaskit/link-datasource';
5
- import type { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common';
6
- import type { DatasourceParameters } from '@atlaskit/linking-types';
7
- import type { cardPlugin } from '../../cardPlugin';
8
- type ModalWithStateProps = {
9
- api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
10
- editorView: EditorView;
11
- };
12
- declare const SafeModalWithState: React.MemoExoticComponent<({ api, editorView }: ModalWithStateProps) => React.JSX.Element>;
13
- export type ModalTypeToComponentMap = {
14
- componentType: React.ComponentType<ConfigModalProps<InlineCardAdf | DatasourceAdf, DatasourceParameters>>;
15
- datasourceId: string;
16
- };
17
- export declare const modalTypeToComponentMap: {
18
- [key in DatasourceModalType]: ModalTypeToComponentMap;
19
- };
20
- export default SafeModalWithState;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { CardContext } from '@atlaskit/link-provider';
5
- import type { ModalTypeToComponentMap } from './ModalWithState';
6
- type DatasourceModalProps = {
7
- cardContext?: CardContext;
8
- editorAnalyticsApi?: EditorAnalyticsAPI;
9
- view: EditorView;
10
- } & ModalTypeToComponentMap;
11
- export declare const DatasourceModal: ({ view, cardContext, datasourceId: defaultDatasourceId, componentType: Component, }: DatasourceModalProps) => React.JSX.Element | null;
12
- export {};
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import type { HyperlinkAddToolbarProps } from '@atlaskit/editor-common/link';
5
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
- import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolbarItem, LinkInputType, LinkPickerOptions } from '@atlaskit/editor-common/types';
7
- import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
8
- import type { Node } from '@atlaskit/editor-prosemirror/model';
9
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
- import type { cardPlugin } from '../cardPlugin';
11
- export type EditLinkToolbarProps = {
12
- forceFocusSelector: ForceFocusSelector | undefined;
13
- linkPickerOptions?: LinkPickerOptions;
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
- };
22
- export declare function HyperlinkAddToolbarWithState({ linkPickerOptions, onSubmit, displayText, displayUrl, providerFactory, view, onCancel, invokeMethod, lpLinkPicker, onClose, onEscapeCallback, onClickAwayCallback, }: HyperlinkAddToolbarProps): React.JSX.Element;
23
- export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProps> {
24
- componentDidUpdate(prevProps: EditLinkToolbarProps): void;
25
- componentWillUnmount(): void;
26
- private hideLinkToolbar;
27
- render(): React.JSX.Element;
28
- }
29
- export declare const getEditLinkCallback: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, scrollIntoView: boolean) => Command;
30
- export declare const buildEditLinkToolbar: ({ providerFactory, node, pluginInjectionApi, linkPicker, lpLinkPicker, }: {
31
- linkPicker?: LinkPickerOptions;
32
- lpLinkPicker: boolean;
33
- node: Node;
34
- pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
35
- providerFactory: ProviderFactory;
36
- }) => FloatingToolbarItem<Command>;
37
- export declare const editLinkToolbarConfig: (showLinkingToolbar: boolean, lpLinkPicker?: boolean, linkPickerOptions?: LinkPickerOptions) => Partial<FloatingToolbarConfig>;
@@ -1,9 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { EditDatasourceToolbarButtonWithCommonProps, EditVariant } from './types';
3
- interface EditToolbarPresentationProps extends EditDatasourceToolbarButtonWithCommonProps {
4
- datasourceId?: string;
5
- editVariant: EditVariant;
6
- extensionKey?: string;
7
- }
8
- declare const EditToolbarButtonPresentation: ({ datasourceId, currentAppearance, editorAnalyticsApi, editVariant, editorView, extensionKey, onLinkEditClick, intl, areAnyNewToolbarFlagsEnabled, }: EditToolbarPresentationProps) => jsx.JSX.Element | null;
9
- export default EditToolbarButtonPresentation;
@@ -1,3 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { EditDatasourceToolbarButtonProps } from './types';
3
- export declare const EditToolbarButton: (props: EditDatasourceToolbarButtonProps) => jsx.JSX.Element;
@@ -1,31 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { Command } from '@atlaskit/editor-common/types';
4
- import type { Node } from '@atlaskit/editor-prosemirror/model';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { CardContext } from '@atlaskit/link-provider';
7
- import type { CardType } from '../../types';
8
- export type EditVariant = 'none' | 'edit-link' | 'edit-datasource' | 'edit-dropdown';
9
- export interface EditDatasourceToolbarButtonWithCommonProps {
10
- areAnyNewToolbarFlagsEnabled: boolean;
11
- currentAppearance?: CardType;
12
- editorAnalyticsApi?: EditorAnalyticsAPI;
13
- editorView?: EditorView;
14
- intl: IntlShape;
15
- onLinkEditClick: Command;
16
- }
17
- export interface EditDatasourceToolbarButtonWithUrlProps extends EditDatasourceToolbarButtonWithCommonProps {
18
- cardContext?: CardContext;
19
- datasourceId?: string;
20
- url: string;
21
- }
22
- export interface EditDatasourceToolbarButtonWithDatasourceIdProps extends EditDatasourceToolbarButtonWithCommonProps {
23
- datasourceId: string;
24
- node: Node;
25
- }
26
- export type EditDatasourceToolbarButtonProps = EditDatasourceToolbarButtonWithCommonProps & {
27
- cardContext?: CardContext;
28
- datasourceId?: string;
29
- node?: Node;
30
- url?: string;
31
- };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- export type EditorAnalyticsContextProps = {
4
- children: React.ReactNode;
5
- editorView?: EditorView;
6
- };
7
- /**
8
- * Provides location attribute to child events
9
- */
10
- export declare const EditorAnalyticsContext: ({ editorView, children, }: EditorAnalyticsContextProps) => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import type { AnalyticsBindingsProps } from './common';
2
- /**
3
- * Subscribes to the events occuring in the card
4
- * plugin and fires analytics events accordingly
5
- */
6
- export declare const DatasourceEventsBinding: ({ cardPluginEvents }: AnalyticsBindingsProps) => null;
@@ -1,6 +0,0 @@
1
- import type { AnalyticsBindingsProps } from './common';
2
- /**
3
- * Subscribes to the events occuring in the card
4
- * plugin and fires analytics events accordingly
5
- */
6
- export declare const LinkEventsBinding: ({ cardPluginEvents }: AnalyticsBindingsProps) => null;