@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.
- package/CHANGELOG.md +12 -0
- package/cardPlugin/package.json +1 -8
- package/cardPluginType/package.json +1 -8
- package/package.json +3 -3
- 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
package/CHANGELOG.md
CHANGED
package/cardPlugin/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/cardPlugin.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/cardPlugin.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/cardPlugin.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/cardPluginType.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/cardPluginType.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/cardPluginType.d.ts"
|
|
17
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "17.4.
|
|
3
|
+
"version": "17.4.12",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@atlaskit/platform-feature-flags-react": "^0.5.0",
|
|
66
66
|
"@atlaskit/primitives": "^19.0.0",
|
|
67
67
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
68
|
-
"@atlaskit/smart-card": "^44.
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
68
|
+
"@atlaskit/smart-card": "^44.29.0",
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
70
70
|
"@atlaskit/tokens": "^13.4.0",
|
|
71
71
|
"@babel/runtime": "^7.0.0",
|
|
72
72
|
"@emotion/react": "^11.7.1",
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import type { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { CardPluginActions, CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
4
|
-
import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
7
|
-
import type { InlineCommentPluginState } from '@atlaskit/editor-plugin-annotation';
|
|
8
|
-
import type { BasePlugin } from '@atlaskit/editor-plugin-base';
|
|
9
|
-
import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
|
|
10
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
11
|
-
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
12
|
-
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
13
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
14
|
-
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
15
|
-
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
16
|
-
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
17
|
-
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
18
|
-
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
|
|
19
|
-
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
20
|
-
import type { CardPluginOptions, CardPluginState } from './types';
|
|
21
|
-
type DummyAnnotationPlugin = NextEditorPlugin<'annotation', {
|
|
22
|
-
actions: {
|
|
23
|
-
setInlineCommentDraftState: (isDraft: boolean, inputMethod: INPUT_METHOD) => Command;
|
|
24
|
-
};
|
|
25
|
-
sharedState: InlineCommentPluginState;
|
|
26
|
-
}>;
|
|
27
|
-
export type CardPluginDependencies = [
|
|
28
|
-
OptionalPlugin<FeatureFlagsPlugin>,
|
|
29
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
30
|
-
OptionalPlugin<EditorViewModePlugin>,
|
|
31
|
-
WidthPlugin,
|
|
32
|
-
DecorationsPlugin,
|
|
33
|
-
GridPlugin,
|
|
34
|
-
FloatingToolbarPlugin,
|
|
35
|
-
OptionalPlugin<EditorDisabledPlugin>,
|
|
36
|
-
OptionalPlugin<SelectionPlugin>,
|
|
37
|
-
OptionalPlugin<DummyAnnotationPlugin>,
|
|
38
|
-
OptionalPlugin<ConnectivityPlugin>,
|
|
39
|
-
OptionalPlugin<BasePlugin>,
|
|
40
|
-
OptionalPlugin<ToolbarPlugin>,
|
|
41
|
-
OptionalPlugin<UiControlRegistryPlugin>
|
|
42
|
-
];
|
|
43
|
-
export type CardPlugin = NextEditorPlugin<'card', {
|
|
44
|
-
actions: CardPluginActions;
|
|
45
|
-
commands: {
|
|
46
|
-
/** EditorCommand form of `queueCardsFromRange`. Prefer over the action. */
|
|
47
|
-
queueCardsFromRange: (from: number, to: number, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null, appearance?: CardAppearance) => EditorCommand;
|
|
48
|
-
};
|
|
49
|
-
dependencies: CardPluginDependencies;
|
|
50
|
-
pluginConfiguration: CardPluginOptions | undefined;
|
|
51
|
-
sharedState: CardPluginState | null;
|
|
52
|
-
}>;
|
|
53
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { cardPlugin } from '../cardPlugin';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CardPlugin, CardPluginDependencies } from '../cardPluginType';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { Request, CardPluginOptions, CardPluginState } from '../types/index';
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IntlShape } from 'react-intl';
|
|
3
|
-
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
4
|
-
import type { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
5
|
-
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { CardContext } from '@atlaskit/link-provider';
|
|
9
|
-
import { Datasource } from '../nodeviews/datasource';
|
|
10
|
-
import type { SmartCardProps } from './genericCard';
|
|
11
|
-
export declare class BlockCardComponent extends React.PureComponent<SmartCardProps & {
|
|
12
|
-
id?: string;
|
|
13
|
-
}, unknown> {
|
|
14
|
-
private scrollContainer?;
|
|
15
|
-
constructor(props: SmartCardProps & {
|
|
16
|
-
id?: string;
|
|
17
|
-
});
|
|
18
|
-
onResolve: (data: {
|
|
19
|
-
title?: string;
|
|
20
|
-
url?: string;
|
|
21
|
-
}) => void;
|
|
22
|
-
componentWillUnmount(): void;
|
|
23
|
-
private removeCardDispatched;
|
|
24
|
-
private removeCard;
|
|
25
|
-
gapCursorSpan: () => React.JSX.Element | undefined;
|
|
26
|
-
onError: ({ err }: {
|
|
27
|
-
err?: Error;
|
|
28
|
-
}) => void;
|
|
29
|
-
render(): React.JSX.Element;
|
|
30
|
-
}
|
|
31
|
-
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'provider' | 'CompetitorPrompt' | 'intl' | 'smartCardContext'>;
|
|
32
|
-
export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
33
|
-
private id;
|
|
34
|
-
unsubscribe: (() => void) | undefined;
|
|
35
|
-
createDomRef(): HTMLElement;
|
|
36
|
-
private updateContentEditable;
|
|
37
|
-
validUpdate(currentNode: Node, newNode: Node): boolean;
|
|
38
|
-
update(node: Node, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource): boolean;
|
|
39
|
-
render(): React.JSX.Element;
|
|
40
|
-
/**
|
|
41
|
-
* Prevent ProseMirror from handling drag events on the smart-element-link,
|
|
42
|
-
* allowing native drag to work so SmartLinkDraggable can intercept it.
|
|
43
|
-
* @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
|
|
44
|
-
*/
|
|
45
|
-
stopEvent(event: Event): boolean;
|
|
46
|
-
destroy(): void;
|
|
47
|
-
}
|
|
48
|
-
export interface BlockCardNodeViewProperties {
|
|
49
|
-
actionOptions: BlockCardNodeViewProps['actionOptions'];
|
|
50
|
-
allowDatasource: boolean | undefined;
|
|
51
|
-
CompetitorPrompt?: React.ComponentType<{
|
|
52
|
-
linkType?: string;
|
|
53
|
-
sourceUrl: string;
|
|
54
|
-
}>;
|
|
55
|
-
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
56
|
-
intl?: IntlShape;
|
|
57
|
-
isPageSSRed: BlockCardNodeViewProps['isPageSSRed'];
|
|
58
|
-
onClickCallback: BlockCardNodeViewProps['onClickCallback'];
|
|
59
|
-
pluginInjectionApi: BlockCardNodeViewProps['pluginInjectionApi'];
|
|
60
|
-
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
61
|
-
provider: BlockCardNodeViewProps['provider'];
|
|
62
|
-
smartCardContext?: CardContext;
|
|
63
|
-
}
|
|
64
|
-
export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, isPageSSRed, provider, intl, smartCardContext, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => BlockCard | Datasource | NodeView;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
9
|
-
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
10
|
-
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
11
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
12
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
13
|
-
import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
-
import type { cardPlugin } from '../index';
|
|
15
|
-
export interface DatasourceProps extends ReactComponentProps {
|
|
16
|
-
eventDispatcher: EventDispatcher;
|
|
17
|
-
getPos: getPosHandler;
|
|
18
|
-
isNodeNested?: boolean;
|
|
19
|
-
node: PMNode;
|
|
20
|
-
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
21
|
-
portalProviderAPI: PortalProviderAPI;
|
|
22
|
-
view: EditorView;
|
|
23
|
-
}
|
|
24
|
-
interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
|
|
25
|
-
}
|
|
26
|
-
export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
|
|
27
|
-
constructor(props: DatasourceComponentProps);
|
|
28
|
-
private getDatasource;
|
|
29
|
-
private getTableView;
|
|
30
|
-
private updateTableProperties;
|
|
31
|
-
handleColumnChange: (columnKeys: string[]) => void;
|
|
32
|
-
handleColumnResize: (key: string, width: number) => void;
|
|
33
|
-
handleWrappedColumnChange: (key: string, shouldWrap: boolean) => void;
|
|
34
|
-
onError: ({ err }: {
|
|
35
|
-
err?: Error;
|
|
36
|
-
}) => void;
|
|
37
|
-
private getColumnsInfo;
|
|
38
|
-
render(): jsx.JSX.Element | null;
|
|
39
|
-
}
|
|
40
|
-
export declare class Datasource extends ReactNodeView<DatasourceProps> {
|
|
41
|
-
private tableWidth;
|
|
42
|
-
private isNodeNested;
|
|
43
|
-
constructor(props: DatasourceProps);
|
|
44
|
-
validUpdate(_: PMNode, newNode: PMNode): boolean;
|
|
45
|
-
update(node: PMNode, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource): boolean;
|
|
46
|
-
createDomRef(): HTMLElement;
|
|
47
|
-
/**
|
|
48
|
-
* Node views may render interactive elements that should not have their events reach editor
|
|
49
|
-
*
|
|
50
|
-
* We should the stop editor from handling events from following elements:
|
|
51
|
-
* - typing in input
|
|
52
|
-
* - activating buttons via spacebar
|
|
53
|
-
*
|
|
54
|
-
* Can be used to prevent the editor view from trying to handle some or all DOM events that bubble up from the node view.
|
|
55
|
-
* Events for which this returns true are not handled by the editor.
|
|
56
|
-
* @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
|
|
57
|
-
*/
|
|
58
|
-
stopEvent(event: Event): boolean;
|
|
59
|
-
render(): jsx.JSX.Element;
|
|
60
|
-
}
|
|
61
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
import type { IntlShape } from 'react-intl';
|
|
4
|
-
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
5
|
-
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
6
|
-
import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
7
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { CardContext } from '@atlaskit/link-provider';
|
|
10
|
-
import type { cardPlugin } from '../index';
|
|
11
|
-
import type { SmartCardProps } from './genericCard';
|
|
12
|
-
/**
|
|
13
|
-
* Returns a forced aspect ratio for URLs that have a known canvas shape,
|
|
14
|
-
* overriding the generic value returned by the link resolver.
|
|
15
|
-
* Add new URL checks here as more content types get fixed aspect ratios.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Returns a forced aspect ratio for URLs that have a known canvas shape,
|
|
19
|
-
* or `undefined` to use the default resolver-provided ratio.
|
|
20
|
-
*
|
|
21
|
-
* @internal Exported for testing only.
|
|
22
|
-
*/
|
|
23
|
-
export declare const getAspectRatioForUrl: (url: string | undefined) => number | undefined;
|
|
24
|
-
export type EmbedCardState = {
|
|
25
|
-
hasPreview: boolean;
|
|
26
|
-
initialAspectRatio?: number;
|
|
27
|
-
liveHeight?: number;
|
|
28
|
-
};
|
|
29
|
-
export declare class EmbedCardComponent extends React.PureComponent<SmartCardProps & {
|
|
30
|
-
id?: string;
|
|
31
|
-
}, EmbedCardState> {
|
|
32
|
-
private scrollContainer?;
|
|
33
|
-
private embedIframeRef;
|
|
34
|
-
constructor(props: SmartCardProps & {
|
|
35
|
-
id?: string;
|
|
36
|
-
});
|
|
37
|
-
state: EmbedCardState;
|
|
38
|
-
private getPosSafely;
|
|
39
|
-
onResolve: (data: {
|
|
40
|
-
aspectRatio?: number;
|
|
41
|
-
title?: string;
|
|
42
|
-
url?: string;
|
|
43
|
-
}) => void;
|
|
44
|
-
updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Defers line-length measurement until the embed card DOM has fully rendered.
|
|
47
|
-
*
|
|
48
|
-
* When put embed in the expand, reload the page and open that expand, the embed was collapsed.
|
|
49
|
-
* Because the `.rich-media-item` can temporarily report `offsetWidth = 1`, as proportional width styles have not been applied yet.
|
|
50
|
-
* Measuring at that moment would cache the bogus width and break resize calculations.
|
|
51
|
-
* Scheduling a measurement on the next animation frame ensures layout has
|
|
52
|
-
* settled. We then force the node view to re-render so `getLineLength`
|
|
53
|
-
* re-runs and captures the correct width.
|
|
54
|
-
*/
|
|
55
|
-
private scheduleLineLengthRemeasureRaf;
|
|
56
|
-
private getLineLength;
|
|
57
|
-
/**
|
|
58
|
-
* Even though render is capable of listening and reacting to iframely wrapper iframe sent `resize` events
|
|
59
|
-
* it's good idea to store latest actual height in ADF, so that when renderer (well, editor as well) is loading
|
|
60
|
-
* we will show embed window of appropriate size and avoid unnecessary content jumping.
|
|
61
|
-
*/
|
|
62
|
-
saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
|
|
63
|
-
onHeightUpdate: (height: number) => void;
|
|
64
|
-
onError: ({ err }: {
|
|
65
|
-
err?: Error;
|
|
66
|
-
}) => void;
|
|
67
|
-
componentWillUnmount(): void;
|
|
68
|
-
private removeCardDispatched;
|
|
69
|
-
private removeCard;
|
|
70
|
-
render(): React.JSX.Element;
|
|
71
|
-
}
|
|
72
|
-
export declare const EmbedOrBlockCardComponent: (props: ComponentProps<typeof EmbedCardComponent>) => React.JSX.Element;
|
|
73
|
-
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'onClickCallback' | 'isPageSSRed' | 'provider' | 'CompetitorPrompt' | 'intl' | 'smartCardContext'>;
|
|
74
|
-
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
75
|
-
private id;
|
|
76
|
-
unsubscribe: (() => void) | undefined;
|
|
77
|
-
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
78
|
-
createDomRef(): HTMLElement;
|
|
79
|
-
private updateContentEditable;
|
|
80
|
-
render(): React.JSX.Element;
|
|
81
|
-
/**
|
|
82
|
-
* Prevent ProseMirror from handling drag events on the smart-element-link,
|
|
83
|
-
* allowing native drag to work so SmartLinkDraggable can intercept it.
|
|
84
|
-
* @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
|
|
85
|
-
*/
|
|
86
|
-
stopEvent(event: Event): boolean;
|
|
87
|
-
destroy(): void;
|
|
88
|
-
}
|
|
89
|
-
export interface EmbedCardNodeViewProperties {
|
|
90
|
-
actionOptions: EmbedCardNodeViewProps['actionOptions'];
|
|
91
|
-
allowResizing: EmbedCardNodeViewProps['allowResizing'];
|
|
92
|
-
CompetitorPrompt?: EmbedCardNodeViewProps['CompetitorPrompt'];
|
|
93
|
-
fullWidthMode: EmbedCardNodeViewProps['fullWidthMode'];
|
|
94
|
-
intl?: IntlShape;
|
|
95
|
-
isPageSSRed: EmbedCardNodeViewProps['isPageSSRed'];
|
|
96
|
-
onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
|
|
97
|
-
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
98
|
-
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
99
|
-
provider: EmbedCardNodeViewProps['provider'];
|
|
100
|
-
smartCardContext?: CardContext;
|
|
101
|
-
}
|
|
102
|
-
export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, onClickCallback, CompetitorPrompt, isPageSSRed, provider, intl, smartCardContext, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { EventHandler, KeyboardEvent, MouseEvent } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { IntlShape } from 'react-intl';
|
|
4
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import type { OnClickCallback } from '@atlaskit/editor-common/card';
|
|
6
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
7
|
-
import type { ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import type { ReactComponentProps, getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
9
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
10
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
13
|
-
import type { CardContext } from '@atlaskit/link-provider';
|
|
14
|
-
import type { CardProps as BaseCardProps } from '@atlaskit/smart-card';
|
|
15
|
-
import type { cardPlugin } from '../index';
|
|
16
|
-
export type EditorContext<T> = React.Context<T> & {
|
|
17
|
-
value: T;
|
|
18
|
-
};
|
|
19
|
-
export interface CardNodeViewProps extends ReactComponentProps {
|
|
20
|
-
eventDispatcher?: EventDispatcher;
|
|
21
|
-
providerFactory?: ProviderFactory;
|
|
22
|
-
}
|
|
23
|
-
export interface CardProps extends CardNodeViewProps {
|
|
24
|
-
__livePage?: boolean;
|
|
25
|
-
actionOptions?: BaseCardProps['actionOptions'];
|
|
26
|
-
allowResizing?: boolean;
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
29
|
-
eventDispatcher?: EventDispatcher;
|
|
30
|
-
fullWidthMode?: boolean;
|
|
31
|
-
getPos: getPosHandler;
|
|
32
|
-
hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
|
|
33
|
-
node: PMNode;
|
|
34
|
-
onClickCallback?: OnClickCallback;
|
|
35
|
-
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
36
|
-
showHoverPreview?: BaseCardProps['showHoverPreview'];
|
|
37
|
-
useAlternativePreloader?: boolean;
|
|
38
|
-
view: EditorView;
|
|
39
|
-
}
|
|
40
|
-
export interface SmartCardProps extends CardProps {
|
|
41
|
-
allowBlockCards?: boolean;
|
|
42
|
-
allowEmbeds?: boolean;
|
|
43
|
-
cardContext?: EditorContext<CardContext | undefined>;
|
|
44
|
-
CompetitorPrompt?: React.ComponentType<{
|
|
45
|
-
linkType?: string;
|
|
46
|
-
sourceUrl: string;
|
|
47
|
-
}>;
|
|
48
|
-
disablePreviewPanel?: BaseCardProps['disablePreviewPanel'];
|
|
49
|
-
enableInlineUpgradeFeatures?: boolean;
|
|
50
|
-
intl?: IntlShape;
|
|
51
|
-
isHovered?: boolean;
|
|
52
|
-
isPageSSRed?: boolean;
|
|
53
|
-
onClick?: EventHandler<MouseEvent | KeyboardEvent> | undefined;
|
|
54
|
-
onResolve?: (tr: Transaction, title?: string) => void;
|
|
55
|
-
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
56
|
-
provider?: Providers['cardProvider'];
|
|
57
|
-
smartCardContext?: CardContext;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @param SmartCardComponent
|
|
62
|
-
* @param UnsupportedComponent
|
|
63
|
-
* @example
|
|
64
|
-
*/
|
|
65
|
-
export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps & {
|
|
66
|
-
id?: string;
|
|
67
|
-
}>>, UnsupportedComponent: React.ComponentType<React.PropsWithChildren<unknown>>): React.ComponentType<React.PropsWithChildren<CardProps>>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { InlineNodeViewComponentProps, getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
3
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { SmartCardProps } from './genericCard';
|
|
6
|
-
import type { InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
7
|
-
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
|
|
8
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt' | 'provider' | 'intl' | 'smartCardContext'>;
|
|
9
|
-
/**
|
|
10
|
-
* Inline card node view component that renders a Smart Link inline card within the editor.
|
|
11
|
-
*
|
|
12
|
-
* @param props
|
|
13
|
-
* @example
|
|
14
|
-
*/
|
|
15
|
-
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
|
|
16
|
-
export interface InlineCardNodeViewProperties {
|
|
17
|
-
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
18
|
-
isPageSSRed: InlineCardNodeViewProps['isPageSSRed'];
|
|
19
|
-
}
|
|
20
|
-
export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => NodeView;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SmartCardProps } from './genericCard';
|
|
3
|
-
export type InlineCardWithAwarenessProps = {
|
|
4
|
-
isOverlayEnabled?: boolean;
|
|
5
|
-
isPulseEnabled?: boolean;
|
|
6
|
-
isSelected?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, pluginInjectionApi, onClick, isPulseEnabled, isOverlayEnabled, isSelected, isPageSSRed, provider, appearance, }: SmartCardProps & InlineCardWithAwarenessProps) => React.JSX.Element>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
export declare const blockCardSpecWithFixedToDOM: () => {
|
|
4
|
-
atom?: boolean;
|
|
5
|
-
attrs?: {
|
|
6
|
-
[name: string]: AttributeSpec;
|
|
7
|
-
};
|
|
8
|
-
code?: boolean;
|
|
9
|
-
content?: string;
|
|
10
|
-
defining?: boolean;
|
|
11
|
-
definingAsContext?: boolean;
|
|
12
|
-
definingForContent?: boolean;
|
|
13
|
-
disableDropCursor?: boolean | ((view: EditorView, pos: {
|
|
14
|
-
inside: number;
|
|
15
|
-
pos: number;
|
|
16
|
-
}, event: DragEvent) => boolean);
|
|
17
|
-
draggable?: boolean;
|
|
18
|
-
group?: string;
|
|
19
|
-
inline?: boolean;
|
|
20
|
-
isolating?: boolean;
|
|
21
|
-
leafText?: (node: PMNode) => string;
|
|
22
|
-
linebreakReplacement?: boolean;
|
|
23
|
-
marks?: string;
|
|
24
|
-
parseDOM?: readonly TagParseRule[];
|
|
25
|
-
selectable?: boolean;
|
|
26
|
-
toDebugString?: (node: PMNode) => string;
|
|
27
|
-
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
28
|
-
whitespace?: "pre" | "normal";
|
|
29
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
export declare const embedCardSpecWithFixedToDOM: () => {
|
|
4
|
-
atom?: boolean;
|
|
5
|
-
attrs?: {
|
|
6
|
-
[name: string]: AttributeSpec;
|
|
7
|
-
};
|
|
8
|
-
code?: boolean;
|
|
9
|
-
content?: string;
|
|
10
|
-
defining?: boolean;
|
|
11
|
-
definingAsContext?: boolean;
|
|
12
|
-
definingForContent?: boolean;
|
|
13
|
-
disableDropCursor?: boolean | ((view: EditorView, pos: {
|
|
14
|
-
inside: number;
|
|
15
|
-
pos: number;
|
|
16
|
-
}, event: DragEvent) => boolean);
|
|
17
|
-
draggable?: boolean;
|
|
18
|
-
group?: string;
|
|
19
|
-
inline?: boolean;
|
|
20
|
-
isolating?: boolean;
|
|
21
|
-
leafText?: (node: PMNode) => string;
|
|
22
|
-
linebreakReplacement?: boolean;
|
|
23
|
-
marks?: string;
|
|
24
|
-
parseDOM?: readonly TagParseRule[];
|
|
25
|
-
selectable?: boolean;
|
|
26
|
-
toDebugString?: (node: PMNode) => string;
|
|
27
|
-
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
28
|
-
whitespace?: "pre" | "normal";
|
|
29
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
export declare const inlineCardSpecWithFixedToDOM: () => {
|
|
4
|
-
atom?: boolean;
|
|
5
|
-
attrs?: {
|
|
6
|
-
[name: string]: AttributeSpec;
|
|
7
|
-
};
|
|
8
|
-
code?: boolean;
|
|
9
|
-
content?: string;
|
|
10
|
-
defining?: boolean;
|
|
11
|
-
definingAsContext?: boolean;
|
|
12
|
-
definingForContent?: boolean;
|
|
13
|
-
disableDropCursor?: boolean | ((view: EditorView, pos: {
|
|
14
|
-
inside: number;
|
|
15
|
-
pos: number;
|
|
16
|
-
}, event: DragEvent) => boolean);
|
|
17
|
-
draggable?: boolean;
|
|
18
|
-
group?: string;
|
|
19
|
-
inline?: boolean;
|
|
20
|
-
isolating?: boolean;
|
|
21
|
-
leafText?: (node: PMNode) => string;
|
|
22
|
-
linebreakReplacement?: boolean;
|
|
23
|
-
marks?: string;
|
|
24
|
-
parseDOM?: readonly TagParseRule[];
|
|
25
|
-
selectable?: boolean;
|
|
26
|
-
toDebugString?: (node: PMNode) => string;
|
|
27
|
-
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
28
|
-
whitespace?: "pre" | "normal";
|
|
29
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { DatasourceModalType } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { DatasourceAdfView } from '@atlaskit/linking-common';
|
|
5
|
-
import type { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
6
|
-
import type { CardInfo, CardPluginAction, Request, ToolbarResolvedAttributes } from '../types';
|
|
7
|
-
import type { DatasourceTableLayout } from '../ui/LayoutButton/types';
|
|
8
|
-
export declare const cardAction: (tr: Transaction, action: CardPluginAction) => Transaction;
|
|
9
|
-
export declare const resolveCard: (url: string) => (tr: Transaction) => Transaction;
|
|
10
|
-
export declare const queueCards: (requests: Request[]) => (tr: Transaction) => Transaction;
|
|
11
|
-
export declare const registerCard: (info: CardInfo) => (tr: Transaction) => Transaction;
|
|
12
|
-
export declare const removeCard: (info: Partial<CardInfo>) => (tr: Transaction) => Transaction;
|
|
13
|
-
export declare const registerRemoveOverlay: (callback: () => void, info?: CardInfo) => (tr: Transaction) => Transaction;
|
|
14
|
-
export declare const registerSmartCardEvents: (smartLinkEvents: SmartLinkEvents) => (tr: Transaction) => Transaction;
|
|
15
|
-
export declare const setProvider: (cardProvider: CardProvider | null) => (tr: Transaction) => Transaction;
|
|
16
|
-
export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) => (tr: Transaction) => Transaction;
|
|
17
|
-
export declare const setResolvedToolbarAttributes: (url: string, attributes: ToolbarResolvedAttributes) => (tr: Transaction) => Transaction;
|
|
18
|
-
export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
|
|
19
|
-
export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
|
|
20
|
-
datasourceTableRef?: HTMLElement;
|
|
21
|
-
layout: DatasourceTableLayout;
|
|
22
|
-
}) => (tr: Transaction) => Transaction;
|
|
23
|
-
export declare const showLinkToolbar: (tr: Transaction) => Transaction;
|
|
24
|
-
export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
|
|
25
|
-
export declare const showDatasourceModal: (modalType: DatasourceModalType) => (tr: Transaction) => Transaction;
|
|
26
|
-
export declare const hideDatasourceModal: (tr: Transaction) => Transaction;
|
|
27
|
-
export declare const clearOverlayCandidate: (tr: Transaction) => Transaction;
|
|
28
|
-
export declare const setDatasourceStash: (tr: Transaction, datasourceStash: {
|
|
29
|
-
url: string;
|
|
30
|
-
views: DatasourceAdfView[];
|
|
31
|
-
}) => Transaction;
|
|
32
|
-
export declare const removeDatasourceStash: (tr: Transaction, url: string) => Transaction;
|