@atlaskit/editor-plugin-card 17.4.11 → 18.0.0
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.
- package/CHANGELOG.md +32 -0
- package/cardPlugin/package.json +1 -8
- package/cardPluginType/package.json +1 -8
- package/package.json +42 -50
- package/types/package.json +1 -8
- package/dist/types-ts4.5/cardPlugin.d.ts +0 -2
- package/dist/types-ts4.5/cardPluginType.d.ts +0 -53
- package/dist/types-ts4.5/entry-points/cardPlugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/cardPluginType.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +0 -64
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +0 -61
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +0 -102
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +0 -67
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +0 -20
- package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +0 -8
- package/dist/types-ts4.5/nodeviews/lazy-block-card.d.ts +0 -3
- package/dist/types-ts4.5/nodeviews/lazy-embed-card.d.ts +0 -3
- package/dist/types-ts4.5/nodeviews/lazy-inline-card.d.ts +0 -3
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +0 -29
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +0 -29
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +0 -29
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -32
- package/dist/types-ts4.5/pm-plugins/doc.d.ts +0 -50
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/reducers.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/shouldReplaceLink.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +0 -9
- package/dist/types-ts4.5/pm-plugins/util/state.d.ts +0 -56
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -48
- package/dist/types-ts4.5/types/index.d.ts +0 -208
- package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +0 -15
- package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +0 -11
- package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +0 -18
- package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +0 -29
- package/dist/types-ts4.5/ui/DatasourceIcon/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +0 -20
- package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +0 -12
- package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +0 -37
- package/dist/types-ts4.5/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +0 -9
- package/dist/types-ts4.5/ui/EditToolbarButton/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/EditToolbarButton/types.d.ts +0 -31
- package/dist/types-ts4.5/ui/EditorAnalyticsContext.d.ts +0 -10
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.d.ts +0 -6
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/LinkEvents.d.ts +0 -6
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +0 -20
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/index.d.ts +0 -5
- package/dist/types-ts4.5/ui/EditorSmartCardEvents.d.ts +0 -4
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +0 -18
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +0 -7
- package/dist/types-ts4.5/ui/InlineCardOverlay/index.d.ts +0 -9
- package/dist/types-ts4.5/ui/InlineCardOverlay/types.d.ts +0 -6
- package/dist/types-ts4.5/ui/InlineCardOverlay/utils.d.ts +0 -20
- package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +0 -9
- package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +0 -24
- package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +0 -13
- package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +0 -25
- package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +0 -14
- package/dist/types-ts4.5/ui/OpenLinkToolbarButton/index.d.ts +0 -20
- package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +0 -14
- package/dist/types-ts4.5/ui/PasteDisplayAsMenu.d.ts +0 -25
- package/dist/types-ts4.5/ui/Pulse/index.d.ts +0 -25
- package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +0 -66
- package/dist/types-ts4.5/ui/SmartCardSSRReactContextsProvider.d.ts +0 -10
- package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +0 -11
- package/dist/types-ts4.5/ui/WithCardContext.d.ts +0 -5
- package/dist/types-ts4.5/ui/analytics/create-events-queue.d.ts +0 -21
- package/dist/types-ts4.5/ui/analytics/events-from-tr.d.ts +0 -19
- package/dist/types-ts4.5/ui/analytics/types.d.ts +0 -66
- package/dist/types-ts4.5/ui/analytics/utils.d.ts +0 -24
- package/dist/types-ts4.5/ui/currentPastedSmartLink.d.ts +0 -2
- package/dist/types-ts4.5/ui/datasourceErrorBoundary.d.ts +0 -24
- package/dist/types-ts4.5/ui/editDatasourceAction.d.ts +0 -4
- package/dist/types-ts4.5/ui/hooks/useLinkUpgradeDiscoverability.d.ts +0 -18
- package/dist/types-ts4.5/ui/local-storage.d.ts +0 -7
- package/dist/types-ts4.5/ui/pasteDisplayAsUtils.d.ts +0 -12
- package/dist/types-ts4.5/ui/preview/PreviewInvoker.d.ts +0 -12
- package/dist/types-ts4.5/ui/toolbar.d.ts +0 -19
- package/dist/types-ts4.5/ui/useFetchDatasourceDataInfo.d.ts +0 -10
- package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +0 -15
|
@@ -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,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,20 +0,0 @@
|
|
|
1
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
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';
|
|
5
|
-
export type AnalyticsBindingsProps = {
|
|
6
|
-
cardPluginEvents: EditorCardPluginEvents<CardPluginEvent>;
|
|
7
|
-
editorView: EditorView;
|
|
8
|
-
};
|
|
9
|
-
type EventMetadata = {
|
|
10
|
-
action?: string;
|
|
11
|
-
inputMethod?: string;
|
|
12
|
-
isRedo?: boolean;
|
|
13
|
-
isUndo?: boolean;
|
|
14
|
-
sourceEvent?: unknown;
|
|
15
|
-
};
|
|
16
|
-
export declare const getMethod: (metadata: EventMetadata) => string | undefined;
|
|
17
|
-
export declare const getUpdateType: (metadata: EventMetadata) => string | undefined;
|
|
18
|
-
export declare const getDeleteType: (metadata: EventMetadata) => string | undefined;
|
|
19
|
-
export declare const getSourceEventFromMetadata: (metadata: EventMetadata) => UIAnalyticsEvent | null;
|
|
20
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IntlShape } from 'react-intl';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
5
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { CardPlugin } from '../cardPluginType';
|
|
9
|
-
export interface HyperlinkToolbarAppearanceProps {
|
|
10
|
-
cardOptions?: CardOptions;
|
|
11
|
-
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
12
|
-
editorPluginApi: ExtractInjectionAPI<CardPlugin> | undefined;
|
|
13
|
-
editorState: EditorState;
|
|
14
|
-
editorView?: EditorView;
|
|
15
|
-
intl: IntlShape;
|
|
16
|
-
url: string;
|
|
17
|
-
}
|
|
18
|
-
export declare function HyperlinkToolbarAppearance(props: HyperlinkToolbarAppearanceProps): React.JSX.Element | null;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
3
|
-
export declare const getCustomHyperlinkAppearanceDropdown: ({ url, intl, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
4
|
-
allowDatasource?: boolean;
|
|
5
|
-
isDatasourceView?: boolean;
|
|
6
|
-
settingsConfig: FloatingToolbarItem<Command>;
|
|
7
|
-
}) => FloatingToolbarCustom<Command>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
import type { InlineCardOverlayProps } from './types';
|
|
8
|
-
declare const InlineCardOverlay: ({ children, isSelected, isVisible, testId, url, ...props }: React.PropsWithChildren<InlineCardOverlayProps>) => jsx.JSX.Element;
|
|
9
|
-
export default InlineCardOverlay;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Size } from '@atlaskit/icon';
|
|
2
|
-
/**
|
|
3
|
-
* Find a child element inside a ref.
|
|
4
|
-
*/
|
|
5
|
-
export declare const getChildElement: (ref: React.RefObject<HTMLElement>, selector: string) => HTMLElement | null | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Get the available width of the inline card.
|
|
8
|
-
* (Mainly here to make the component unit testable.)
|
|
9
|
-
*/
|
|
10
|
-
export declare const getInlineCardAvailableWidth: (startEl: HTMLElement, endEl: HTMLElement) => number;
|
|
11
|
-
export declare const isOneLine: (startEl: HTMLElement, endEl: HTMLElement) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Get max and min width of an overlay.
|
|
14
|
-
* (Mainly here to make the component unit testable.)
|
|
15
|
-
*/
|
|
16
|
-
export declare const getOverlayWidths: (overlayEl: HTMLElement, labelEl: HTMLElement) => {
|
|
17
|
-
max: number;
|
|
18
|
-
min: number;
|
|
19
|
-
};
|
|
20
|
-
export declare const getIconSize: (labelEl: HTMLElement) => Size;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ComponentType, FC } from 'react';
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
4
|
-
import type { LayoutButtonProps, LayoutButtonWrapperProps } from './types';
|
|
5
|
-
export declare const LayoutButton: ({ onLayoutChange, layout, intl: { formatMessage }, mountPoint, boundariesElement, scrollableElement, targetElement, testId, }: LayoutButtonProps) => jsx.JSX.Element | null;
|
|
6
|
-
declare const _default_1: FC<WithIntlProps<LayoutButtonWrapperProps & WrappedComponentProps>> & {
|
|
7
|
-
WrappedComponent: ComponentType<LayoutButtonWrapperProps & WrappedComponentProps>;
|
|
8
|
-
};
|
|
9
|
-
export default _default_1;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { cardPlugin } from '../../index';
|
|
5
|
-
export declare const DATASOURCE_TABLE_LAYOUTS: readonly [
|
|
6
|
-
"full-width",
|
|
7
|
-
"center",
|
|
8
|
-
"wide"
|
|
9
|
-
];
|
|
10
|
-
export type DatasourceTableLayout = (typeof DATASOURCE_TABLE_LAYOUTS)[number];
|
|
11
|
-
export type LayoutButtonProps = {
|
|
12
|
-
boundariesElement?: HTMLElement;
|
|
13
|
-
intl: IntlShape;
|
|
14
|
-
layout?: DatasourceTableLayout;
|
|
15
|
-
mountPoint?: HTMLElement;
|
|
16
|
-
onLayoutChange?: (layout: DatasourceTableLayout) => void;
|
|
17
|
-
scrollableElement?: HTMLElement;
|
|
18
|
-
targetElement?: HTMLElement;
|
|
19
|
-
testId?: string;
|
|
20
|
-
};
|
|
21
|
-
export interface LayoutButtonWrapperProps extends Pick<LayoutButtonProps, 'mountPoint' | 'boundariesElement' | 'scrollableElement'> {
|
|
22
|
-
api: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
23
|
-
editorView: EditorView;
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { DatasourceNode } from '../../types';
|
|
3
|
-
import type { DatasourceTableLayout } from './types';
|
|
4
|
-
export declare const getDatasource: (editorView: EditorView | undefined) => {
|
|
5
|
-
depth: number;
|
|
6
|
-
node: DatasourceNode;
|
|
7
|
-
pos: number;
|
|
8
|
-
start: number;
|
|
9
|
-
} | {
|
|
10
|
-
node: undefined;
|
|
11
|
-
pos: undefined;
|
|
12
|
-
};
|
|
13
|
-
export declare const isDatasourceTableLayout: (layout: unknown) => layout is DatasourceTableLayout;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IntlShape } from 'react-intl';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import type { CardContext } from '@atlaskit/link-provider';
|
|
8
|
-
export interface LinkToolbarAppearanceProps {
|
|
9
|
-
allowBlockCards?: boolean;
|
|
10
|
-
allowEmbeds?: boolean;
|
|
11
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
12
|
-
currentAppearance?: CardAppearance;
|
|
13
|
-
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
14
|
-
editorState: EditorState;
|
|
15
|
-
editorView?: EditorView;
|
|
16
|
-
intl: IntlShape;
|
|
17
|
-
isDatasourceView?: boolean;
|
|
18
|
-
showUpgradeDiscoverability?: boolean;
|
|
19
|
-
url?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, Object> {
|
|
22
|
-
renderDropdown: (view?: EditorView, cardContext?: CardContext) => React.JSX.Element | null;
|
|
23
|
-
render(): React.JSX.Element;
|
|
24
|
-
}
|
|
25
|
-
export declare const getUnavailableMessage: (state: EditorState, intl: IntlShape) => string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { LinkToolbarAppearanceProps } from './LinkToolbarAppearance';
|
|
4
|
-
type Props = LinkToolbarAppearanceProps & {
|
|
5
|
-
allowDatasource?: boolean;
|
|
6
|
-
dispatchCommand: (command: Command) => void;
|
|
7
|
-
settingsConfig: FloatingToolbarItem<Command>;
|
|
8
|
-
};
|
|
9
|
-
export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
|
|
10
|
-
export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, areAnyNewToolbarFlagsEnabled, }: LinkToolbarAppearanceProps & {
|
|
11
|
-
allowDatasource?: boolean;
|
|
12
|
-
settingsConfig: FloatingToolbarItem<Command>;
|
|
13
|
-
}) => FloatingToolbarDropdown<Command>;
|
|
14
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
type OpenLinkToolbarButtonProps = {
|
|
5
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
6
|
-
editorView: EditorView;
|
|
7
|
-
onClick: Command;
|
|
8
|
-
title: string;
|
|
9
|
-
url: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Toolbar button that opens a Smart Link URL in a new tab, with the XPC-wrapped destination URL.
|
|
13
|
-
*
|
|
14
|
-
* This component is only rendered when `fg('platform_smartlink_xpc_url_wrapping')` is ON.
|
|
15
|
-
* It wraps `FloatingToolbarButton` and replaces `href` with the resolved destination URL
|
|
16
|
-
* (cross-product analytics parameters appended), falling back to the raw `url` when the
|
|
17
|
-
* link is unresolved or not a first-party Atlassian link.
|
|
18
|
-
*/
|
|
19
|
-
export declare const OpenLinkToolbarButton: ({ url, areAnyNewToolbarFlagsEnabled, editorView, onClick, title, }: OpenLinkToolbarButtonProps) => React.JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IntlShape } from 'react-intl';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
type OpenPreviewPanelToolbarButtonProps = {
|
|
7
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
8
|
-
editorAnalyticsApi?: EditorAnalyticsAPI;
|
|
9
|
-
editorView?: EditorView;
|
|
10
|
-
intl: IntlShape;
|
|
11
|
-
node: PMNode;
|
|
12
|
-
};
|
|
13
|
-
export declare const OpenPreviewPanelToolbarButton: ({ node, intl, areAnyNewToolbarFlagsEnabled, editorAnalyticsApi, editorView, }: OpenPreviewPanelToolbarButtonProps) => React.JSX.Element | null;
|
|
14
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { RegisterComponent } from '@atlaskit/editor-ui-control-model';
|
|
4
|
-
import type { CardPlugin } from '../cardPluginType';
|
|
5
|
-
export declare const SMART_LINK_DISPLAY_AS_PASTE_MENU_SECTION_KEY = "smart-link-display-as-paste-menu-section";
|
|
6
|
-
export declare const setAppearanceSelection: ({ editorView, pasteStartPos, pasteEndPos, targetPos, }: {
|
|
7
|
-
editorView: EditorView;
|
|
8
|
-
pasteEndPos: number;
|
|
9
|
-
pasteStartPos: number;
|
|
10
|
-
targetPos: number | undefined;
|
|
11
|
-
}) => boolean;
|
|
12
|
-
export declare const getFirstLinkRangeInSelection: (editorView: EditorView) => {
|
|
13
|
-
from: number;
|
|
14
|
-
to: number;
|
|
15
|
-
} | undefined;
|
|
16
|
-
export declare const normalizeSelectionToLinkRangeForUrlAppearance: ({ editorView, targetPos, }: {
|
|
17
|
-
editorView: EditorView;
|
|
18
|
-
targetPos: number | undefined;
|
|
19
|
-
}) => void;
|
|
20
|
-
export declare const getPasteDisplayAsMenuComponents: ({ api, allowBlockCards, allowEmbeds, getEditorView, }: {
|
|
21
|
-
allowBlockCards: boolean;
|
|
22
|
-
allowEmbeds?: boolean;
|
|
23
|
-
api: ExtractInjectionAPI<CardPlugin> | undefined;
|
|
24
|
-
getEditorView: () => EditorView | undefined;
|
|
25
|
-
}) => RegisterComponent[];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type PulseDiscoveryMode = 'start' | 'iteration';
|
|
3
|
-
export interface PulseProps {
|
|
4
|
-
/**
|
|
5
|
-
* The component around which the Pulse should be displayed
|
|
6
|
-
*/
|
|
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;
|
|
14
|
-
/**
|
|
15
|
-
* The key that is used in local storage to identify the descoverability of a feature where the Pulse is used
|
|
16
|
-
*/
|
|
17
|
-
localStorageKey: string;
|
|
18
|
-
/**
|
|
19
|
-
* The time in ms after which the key in local storage will be considered expired and the Pulse will be shown again
|
|
20
|
-
*/
|
|
21
|
-
localStorageKeyExpirationInMs?: number;
|
|
22
|
-
shouldShowPulse?: boolean;
|
|
23
|
-
testId?: string;
|
|
24
|
-
}
|
|
25
|
-
export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, isInline, }: PulseProps) => React.JSX.Element;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
8
|
-
import type { ResizerProps } from '@atlaskit/editor-common/ui';
|
|
9
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
10
|
-
type State = {
|
|
11
|
-
offsetLeft: number;
|
|
12
|
-
resizedPctWidth?: number;
|
|
13
|
-
};
|
|
14
|
-
export type Props = Omit<ResizerProps, 'height' | 'width'> & {
|
|
15
|
-
aspectRatio: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
isResizeDisabled?: boolean;
|
|
18
|
-
width?: number;
|
|
19
|
-
};
|
|
20
|
-
export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
21
|
-
static defaultProps: {
|
|
22
|
-
aspectRatio: number;
|
|
23
|
-
};
|
|
24
|
-
state: State;
|
|
25
|
-
componentDidUpdate(prevProps: Props): void;
|
|
26
|
-
get wrappedLayout(): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* When returning to center layout from a wrapped/aligned layout, it might actually
|
|
29
|
-
* be wide or full-width
|
|
30
|
-
*/
|
|
31
|
-
checkLayout(oldLayout: RichMediaLayout, newLayout: RichMediaLayout): void;
|
|
32
|
-
calcNewSize: (newWidth: number, stop: boolean) => {
|
|
33
|
-
layout: RichMediaLayout;
|
|
34
|
-
width: number | null;
|
|
35
|
-
};
|
|
36
|
-
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
37
|
-
get $pos(): ResolvedPos | null;
|
|
38
|
-
/**
|
|
39
|
-
* The maxmimum number of grid columns this node can resize to.
|
|
40
|
-
*/
|
|
41
|
-
get gridWidth(): number;
|
|
42
|
-
calcOffsetLeft(): number;
|
|
43
|
-
calcColumnLeftOffset: () => number;
|
|
44
|
-
wrapper?: HTMLElement;
|
|
45
|
-
get wideLayoutWidth(): number;
|
|
46
|
-
isNestedInTable(): boolean;
|
|
47
|
-
calcSnapPoints(): number[];
|
|
48
|
-
calcPxWidth: (useLayout?: RichMediaLayout) => number;
|
|
49
|
-
get insideInlineLike(): boolean;
|
|
50
|
-
private handleResizeStart;
|
|
51
|
-
highlights: (newWidth: number, snapPoints: number[]) => string[] | number[];
|
|
52
|
-
/**
|
|
53
|
-
* Previously height of the box was controlled with paddingTop/paddingBottom trick inside Wrapper.
|
|
54
|
-
* It allowed height to be defined by a given percent ratio and so absolute value was defined by actual width.
|
|
55
|
-
* Also, it was part of styled component, which was fine because it was static through out life time of component.
|
|
56
|
-
*
|
|
57
|
-
* Now, two things changed:
|
|
58
|
-
* 1. If `height` is present we take it as actual height of the box, and hence we don't need
|
|
59
|
-
* (or even can't have, due to lack of width value) paddingTop trick.
|
|
60
|
-
* 2. Since `height` can be changing through out life time of a component, we can't have it as part of styled component,
|
|
61
|
-
* and hence we use `style` prop.
|
|
62
|
-
*/
|
|
63
|
-
private getHeightDefiningComponent;
|
|
64
|
-
render(): jsx.JSX.Element;
|
|
65
|
-
}
|
|
66
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type IntlShape } from 'react-intl';
|
|
3
|
-
import { type CardContext } from '@atlaskit/link-provider';
|
|
4
|
-
interface Props {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
intl: IntlShape | undefined;
|
|
7
|
-
smartCardContext: CardContext | undefined;
|
|
8
|
-
}
|
|
9
|
-
export declare function SmartCardSSRReactContextsProvider({ smartCardContext, children, intl, }: Props): ReactNode;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { EditorAnalyticsContextProps } from './EditorAnalyticsContext';
|
|
3
|
-
type ToolbarViewedEventProps = {
|
|
4
|
-
display: string | null;
|
|
5
|
-
url?: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Provides analytics context and card context
|
|
9
|
-
*/
|
|
10
|
-
export declare const ToolbarViewedEvent: ({ url, display, editorView, }: ToolbarViewedEventProps & Omit<EditorAnalyticsContextProps, "children">) => React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type Subscriber<T> = (event: T) => void;
|
|
2
|
-
export type EditorCardPluginEvents<T> = {
|
|
3
|
-
flush: () => void;
|
|
4
|
-
getSize: () => number;
|
|
5
|
-
push: (...events: T[]) => void;
|
|
6
|
-
subscribe: (listener: Subscriber<T>) => () => void;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Simple mechanism to defer event related callbacks
|
|
10
|
-
*
|
|
11
|
-
* Probably think twice whether your event should use this instead of
|
|
12
|
-
* editor's built-in `editor-plugin-analytics`
|
|
13
|
-
*
|
|
14
|
-
* Editor-Plugin-Analytics provides methods methods to dispatch events, and attach events into prosemiror transactions
|
|
15
|
-
* However we do not have access to the smart card context in prosemirror
|
|
16
|
-
*
|
|
17
|
-
* We are using this queue to relay events occurring in prosemirror (which does not have access to the react context)
|
|
18
|
-
* to be subscribed to elsewhere where the react context is available (contentComponent or otherwise) (smart card context)
|
|
19
|
-
* in order to be able to annotate events with additional attributes to events
|
|
20
|
-
*/
|
|
21
|
-
export declare const createEventsQueue: <T extends unknown>() => EditorCardPluginEvents<T>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { CardPluginEvent, Entity } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Find the links, smartLinks, datasources that were changed in a transaction
|
|
5
|
-
*/
|
|
6
|
-
export declare const findChanged: (tr: Transaction | ReadonlyTransaction, state: EditorState) => {
|
|
7
|
-
inserted: Entity[];
|
|
8
|
-
removed: Entity[];
|
|
9
|
-
updated: ({
|
|
10
|
-
inserted: Entity;
|
|
11
|
-
removed: Entity;
|
|
12
|
-
} | {
|
|
13
|
-
inserted: Entity;
|
|
14
|
-
previous: {
|
|
15
|
-
display?: string;
|
|
16
|
-
};
|
|
17
|
-
})[];
|
|
18
|
-
};
|
|
19
|
-
export declare function eventsFromTransaction(tr: ReadonlyTransaction, state: EditorState): CardPluginEvent[];
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export type Entity = {
|
|
3
|
-
node: Node;
|
|
4
|
-
nodeContext: string;
|
|
5
|
-
pos: number;
|
|
6
|
-
};
|
|
7
|
-
type Metadata<T = Object> = {
|
|
8
|
-
action?: string;
|
|
9
|
-
inputMethod?: string;
|
|
10
|
-
isRedo?: boolean;
|
|
11
|
-
isUndo?: boolean;
|
|
12
|
-
node: Node;
|
|
13
|
-
nodeContext?: string;
|
|
14
|
-
sourceEvent?: unknown;
|
|
15
|
-
} & T;
|
|
16
|
-
type UpdateMetadata = {
|
|
17
|
-
previousDisplay?: string;
|
|
18
|
-
};
|
|
19
|
-
export declare enum EVENT {
|
|
20
|
-
CREATED = "created",
|
|
21
|
-
UPDATED = "updated",
|
|
22
|
-
DELETED = "deleted"
|
|
23
|
-
}
|
|
24
|
-
export declare enum EVENT_SUBJECT {
|
|
25
|
-
LINK = "link",
|
|
26
|
-
DATASOURCE = "datasource"
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* These are not GASv3 events
|
|
30
|
-
* But they share a similar in shape so that GASv3
|
|
31
|
-
* events can be derived from them / think of them in the same way
|
|
32
|
-
*/
|
|
33
|
-
export type LinkCreatedEvent = {
|
|
34
|
-
data: Metadata;
|
|
35
|
-
event: EVENT.CREATED;
|
|
36
|
-
subject: EVENT_SUBJECT.LINK;
|
|
37
|
-
};
|
|
38
|
-
export type LinkUpdatedEvent = {
|
|
39
|
-
data: Metadata<UpdateMetadata>;
|
|
40
|
-
event: EVENT.UPDATED;
|
|
41
|
-
subject: EVENT_SUBJECT.LINK;
|
|
42
|
-
};
|
|
43
|
-
export type LinkDeletedEvent = {
|
|
44
|
-
data: Metadata;
|
|
45
|
-
event: EVENT.DELETED;
|
|
46
|
-
subject: EVENT_SUBJECT.LINK;
|
|
47
|
-
};
|
|
48
|
-
export type DatasourceCreatedEvent = {
|
|
49
|
-
data: Metadata;
|
|
50
|
-
event: EVENT.CREATED;
|
|
51
|
-
subject: EVENT_SUBJECT.DATASOURCE;
|
|
52
|
-
};
|
|
53
|
-
export type DatasourceUpdatedEvent = {
|
|
54
|
-
data: Metadata<UpdateMetadata>;
|
|
55
|
-
event: EVENT.UPDATED;
|
|
56
|
-
subject: EVENT_SUBJECT.DATASOURCE;
|
|
57
|
-
};
|
|
58
|
-
export type DatasourceDeletedEvent = {
|
|
59
|
-
data: Metadata;
|
|
60
|
-
event: EVENT.DELETED;
|
|
61
|
-
subject: EVENT_SUBJECT.DATASOURCE;
|
|
62
|
-
};
|
|
63
|
-
export type LinkEvent = LinkCreatedEvent | LinkUpdatedEvent | LinkDeletedEvent;
|
|
64
|
-
export type DatasourceEvent = DatasourceCreatedEvent | DatasourceUpdatedEvent | DatasourceDeletedEvent;
|
|
65
|
-
export type CardPluginEvent = LinkEvent | DatasourceEvent;
|
|
66
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { EVENT_SUBJECT } from './types';
|
|
5
|
-
import type { Entity } from './types';
|
|
6
|
-
export declare function isDatasourceNode(node: Node): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Determine if a node is considered to be a link
|
|
9
|
-
*/
|
|
10
|
-
export declare const isLinkNode: (node: Node) => boolean;
|
|
11
|
-
export declare function getNodeSubject(node: Node): EVENT_SUBJECT | null;
|
|
12
|
-
/**
|
|
13
|
-
* Analytics appearance for link object
|
|
14
|
-
*/
|
|
15
|
-
export declare function appearanceForLink(node: Node): 'url' | CardAppearance;
|
|
16
|
-
export declare function getUrl(node: Node): string | undefined;
|
|
17
|
-
export declare const getNodeContext: (doc: Node, pos: number) => string;
|
|
18
|
-
export declare const findAtPositions: (tr: Transaction | ReadonlyTransaction, positions: number[]) => Entity[];
|
|
19
|
-
export declare const findInNodeRange: (doc: Node, from: number, to: number, predicate: (node: Node) => boolean) => Entity[];
|
|
20
|
-
/**
|
|
21
|
-
* Returns whether or not two sets of links appear to likely be the same set of links
|
|
22
|
-
* That they are in the same order and that both their hrefs and appearances match
|
|
23
|
-
*/
|
|
24
|
-
export declare const areSameNodes: (setA: Entity[], setB: Entity[]) => boolean;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DatasourceModalType } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { APIError } from '@atlaskit/linking-common';
|
|
4
|
-
import type { DatasourceProps } from '../nodeviews/datasource';
|
|
5
|
-
export type DatasourceErrorBoundaryProps = React.PropsWithChildren<{
|
|
6
|
-
datasourceId?: string;
|
|
7
|
-
datasourceModalType?: DatasourceModalType;
|
|
8
|
-
handleError?: () => void;
|
|
9
|
-
unsupportedComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
10
|
-
url?: string;
|
|
11
|
-
view: DatasourceProps['view'];
|
|
12
|
-
}>;
|
|
13
|
-
export declare class DatasourceErrorBoundary extends React.Component<DatasourceErrorBoundaryProps> {
|
|
14
|
-
state: {
|
|
15
|
-
isError: boolean;
|
|
16
|
-
error: null;
|
|
17
|
-
};
|
|
18
|
-
static getDerivedStateFromError(error: Error | APIError): {
|
|
19
|
-
error: Error | APIError;
|
|
20
|
-
isError: boolean;
|
|
21
|
-
};
|
|
22
|
-
componentDidCatch(error: Error | APIError): void;
|
|
23
|
-
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
24
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { CardType } from '../types';
|
|
4
|
-
export declare const editDatasource: (datasourceId: string, editorAnalyticsApi?: EditorAnalyticsAPI, appearance?: CardType, extensionKey?: string) => Command;
|