@atlaskit/editor-plugin-card 2.15.2 → 3.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 +20 -0
- package/dist/cjs/analytics/utils.js +6 -6
- package/dist/cjs/datasourceErrorBoundary.js +1 -1
- package/dist/cjs/nodeviews/blockCard.js +15 -22
- package/dist/cjs/nodeviews/datasource.js +1 -1
- package/dist/cjs/nodeviews/embedCard.js +14 -21
- package/dist/cjs/nodeviews/genericCard.js +2 -2
- package/dist/cjs/nodeviews/inlineCard.js +1 -1
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/cjs/nodeviews/lazy-block-card.js +3 -3
- package/dist/cjs/nodeviews/lazy-embed-card.js +3 -3
- package/dist/cjs/plugin.js +3 -2
- package/dist/cjs/pm-plugins/main.js +1 -4
- package/dist/cjs/pm-plugins/reducers.js +1 -1
- package/dist/cjs/toDOM-fixes/blockCard.js +2 -2
- package/dist/cjs/toDOM-fixes/embedCard.js +2 -2
- package/dist/cjs/toolbar.js +12 -19
- package/dist/cjs/ui/CardContextProvider.js +1 -1
- package/dist/cjs/ui/DatasourceModal/index.js +8 -8
- package/dist/cjs/ui/EditLinkToolbar.js +1 -1
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/index.js +1 -1
- package/dist/cjs/ui/HyperlinkToolbarAppearance.js +1 -3
- package/dist/cjs/ui/InlineCardOverlay/index.js +1 -1
- package/dist/cjs/ui/LinkToolbarAppearance.js +3 -4
- package/dist/cjs/ui/Pulse/index.js +1 -1
- package/dist/cjs/ui/ResizableEmbedCard.js +1 -1
- package/dist/cjs/ui/ToolbarViewedEvent.js +1 -1
- package/dist/es2019/nodeviews/blockCard.js +13 -20
- package/dist/es2019/nodeviews/embedCard.js +12 -19
- package/dist/es2019/nodeviews/lazy-block-card.js +2 -2
- package/dist/es2019/nodeviews/lazy-embed-card.js +2 -2
- package/dist/es2019/plugin.js +2 -2
- package/dist/es2019/pm-plugins/main.js +1 -4
- package/dist/es2019/toDOM-fixes/blockCard.js +2 -2
- package/dist/es2019/toDOM-fixes/embedCard.js +2 -2
- package/dist/es2019/toolbar.js +11 -18
- package/dist/es2019/ui/HyperlinkToolbarAppearance.js +0 -2
- package/dist/es2019/ui/LinkToolbarAppearance.js +1 -2
- package/dist/esm/analytics/utils.js +6 -6
- package/dist/esm/datasourceErrorBoundary.js +1 -1
- package/dist/esm/nodeviews/blockCard.js +15 -22
- package/dist/esm/nodeviews/datasource.js +1 -1
- package/dist/esm/nodeviews/embedCard.js +14 -21
- package/dist/esm/nodeviews/genericCard.js +1 -1
- package/dist/esm/nodeviews/lazy-block-card.js +2 -2
- package/dist/esm/nodeviews/lazy-embed-card.js +2 -2
- package/dist/esm/plugin.js +3 -2
- package/dist/esm/pm-plugins/main.js +1 -4
- package/dist/esm/pm-plugins/reducers.js +1 -1
- package/dist/esm/toDOM-fixes/blockCard.js +2 -2
- package/dist/esm/toDOM-fixes/embedCard.js +2 -2
- package/dist/esm/toolbar.js +11 -18
- package/dist/esm/ui/CardContextProvider.js +1 -1
- package/dist/esm/ui/DatasourceModal/index.js +7 -7
- package/dist/esm/ui/EditLinkToolbar.js +1 -1
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/index.js +1 -1
- package/dist/esm/ui/HyperlinkToolbarAppearance.js +0 -2
- package/dist/esm/ui/LinkToolbarAppearance.js +2 -3
- package/dist/esm/ui/ResizableEmbedCard.js +1 -1
- package/dist/types/nodeviews/blockCard.d.ts +2 -3
- package/dist/types/nodeviews/embedCard.d.ts +2 -3
- package/dist/types/nodeviews/genericCard.d.ts +1 -3
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/toolbar.d.ts +1 -2
- package/dist/types/types.d.ts +0 -1
- package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +0 -2
- package/dist/types/ui/LinkToolbarAppearance.d.ts +0 -2
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +2 -3
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +2 -3
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +1 -3
- package/dist/types-ts4.5/plugin.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +1 -2
- package/dist/types-ts4.5/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +0 -2
- package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +0 -2
- package/package.json +4 -6
- package/report.api.md +1 -1
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
function _createSuper(
|
|
10
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
@@ -43,12 +43,11 @@ export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
43
43
|
allowEmbeds = _this$props.allowEmbeds,
|
|
44
44
|
_this$props$allowBloc = _this$props.allowBlockCards,
|
|
45
45
|
allowBlockCards = _this$props$allowBloc === void 0 ? true : _this$props$allowBloc,
|
|
46
|
-
platform = _this$props.platform,
|
|
47
46
|
editorAnalyticsApi = _this$props.editorAnalyticsApi,
|
|
48
47
|
_this$props$showUpgra = _this$props.showUpgradeDiscoverability,
|
|
49
48
|
showUpgradeDiscoverability = _this$props$showUpgra === void 0 ? true : _this$props$showUpgra,
|
|
50
49
|
isDatasourceView = _this$props.isDatasourceView;
|
|
51
|
-
var preview = allowEmbeds && cardContext && url && cardContext.extractors.getPreview(url,
|
|
50
|
+
var preview = allowEmbeds && cardContext && url && cardContext.extractors.getPreview(url, 'web');
|
|
52
51
|
var defaultCommand = function defaultCommand() {
|
|
53
52
|
return false;
|
|
54
53
|
};
|
|
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
function _createSuper(
|
|
11
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/**
|
|
14
14
|
* @jsxRuntime classic
|
|
@@ -22,7 +22,7 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
22
22
|
}) => void;
|
|
23
23
|
render(): JSX.Element;
|
|
24
24
|
}
|
|
25
|
-
export type BlockCardNodeViewProps = Pick<SmartCardProps, '
|
|
25
|
+
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'showServerActions' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
26
26
|
export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
27
27
|
unsubscribe: (() => void) | undefined;
|
|
28
28
|
createDomRef(): HTMLElement;
|
|
@@ -34,7 +34,6 @@ export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
|
34
34
|
}
|
|
35
35
|
export interface BlockCardNodeViewProperties {
|
|
36
36
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
37
|
-
platform: BlockCardNodeViewProps['platform'];
|
|
38
37
|
actionOptions: BlockCardNodeViewProps['actionOptions'];
|
|
39
38
|
showServerActions: BlockCardNodeViewProps['showServerActions'];
|
|
40
39
|
pluginInjectionApi: BlockCardNodeViewProps['pluginInjectionApi'];
|
|
@@ -42,4 +41,4 @@ export interface BlockCardNodeViewProperties {
|
|
|
42
41
|
allowDatasource: boolean | undefined;
|
|
43
42
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
44
43
|
}
|
|
45
|
-
export declare const blockCardNodeView: ({ pmPluginFactoryParams,
|
|
44
|
+
export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, showServerActions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => Datasource | BlockCard | import("prosemirror-view").NodeView;
|
|
@@ -41,7 +41,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
41
41
|
}) => void;
|
|
42
42
|
render(): JSX.Element;
|
|
43
43
|
}
|
|
44
|
-
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | '
|
|
44
|
+
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions' | 'onClickCallback'>;
|
|
45
45
|
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
46
46
|
unsubscribe: (() => void) | undefined;
|
|
47
47
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
@@ -52,7 +52,6 @@ export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
|
52
52
|
}
|
|
53
53
|
export interface EmbedCardNodeViewProperties {
|
|
54
54
|
allowResizing: EmbedCardNodeViewProps['allowResizing'];
|
|
55
|
-
platform: EmbedCardNodeViewProps['platform'];
|
|
56
55
|
fullWidthMode: EmbedCardNodeViewProps['fullWidthMode'];
|
|
57
56
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
58
57
|
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
@@ -60,4 +59,4 @@ export interface EmbedCardNodeViewProperties {
|
|
|
60
59
|
showServerActions: EmbedCardNodeViewProps['showServerActions'];
|
|
61
60
|
onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
|
|
62
61
|
}
|
|
63
|
-
export declare const embedCardNodeView: ({ allowResizing,
|
|
62
|
+
export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, showServerActions, onClickCallback, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
|
|
@@ -10,14 +10,13 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
10
10
|
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
12
12
|
import { type CardContext } from '@atlaskit/link-provider';
|
|
13
|
-
import type { CardProps as BaseCardProps
|
|
13
|
+
import type { CardProps as BaseCardProps } from '@atlaskit/smart-card';
|
|
14
14
|
import type { cardPlugin } from '../index';
|
|
15
15
|
export type EditorContext<T> = React.Context<T> & {
|
|
16
16
|
value: T;
|
|
17
17
|
};
|
|
18
18
|
export interface CardNodeViewProps extends ReactComponentProps {
|
|
19
19
|
providerFactory?: ProviderFactory;
|
|
20
|
-
platform?: CardPlatform;
|
|
21
20
|
eventDispatcher?: EventDispatcher;
|
|
22
21
|
}
|
|
23
22
|
export interface CardProps extends CardNodeViewProps {
|
|
@@ -26,7 +25,6 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
26
25
|
view: EditorView;
|
|
27
26
|
getPos: getPosHandler;
|
|
28
27
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
29
|
-
isMobile?: boolean;
|
|
30
28
|
eventDispatcher?: EventDispatcher;
|
|
31
29
|
allowResizing?: boolean;
|
|
32
30
|
fullWidthMode?: boolean;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
|
10
10
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
11
|
import type { CardPluginOptions, CardPluginState } from './types';
|
|
12
12
|
export type CardPlugin = NextEditorPlugin<'card', {
|
|
13
|
-
pluginConfiguration: CardPluginOptions;
|
|
13
|
+
pluginConfiguration: CardPluginOptions | undefined;
|
|
14
14
|
dependencies: [
|
|
15
15
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
16
16
|
OptionalPlugin<AnalyticsPlugin>,
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -2,13 +2,12 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
4
4
|
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
6
5
|
import type { CardPluginOptions } from './types';
|
|
7
6
|
import type { cardPlugin } from './index';
|
|
8
7
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
9
8
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
10
9
|
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => Command;
|
|
11
|
-
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean,
|
|
10
|
+
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
12
11
|
export declare const getHyperlinkToolbarSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
|
13
12
|
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>;
|
|
14
13
|
export declare const getSettingsButtonGroup: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>[];
|
package/dist/types/types.d.ts
CHANGED
|
@@ -100,7 +100,6 @@ export type CardPluginState = {
|
|
|
100
100
|
};
|
|
101
101
|
export type CardPluginOptions = CardOptions & {
|
|
102
102
|
editorAppearance?: EditorAppearance;
|
|
103
|
-
platform: 'mobile' | 'web';
|
|
104
103
|
fullWidthMode?: boolean;
|
|
105
104
|
linkPicker?: LinkPickerOptions;
|
|
106
105
|
cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
|
|
@@ -5,14 +5,12 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
|
5
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
9
8
|
import { type CardPlugin } from '../plugin';
|
|
10
9
|
export interface HyperlinkToolbarAppearanceProps {
|
|
11
10
|
intl: IntlShape;
|
|
12
11
|
editorState: EditorState;
|
|
13
12
|
url: string;
|
|
14
13
|
editorView?: EditorView;
|
|
15
|
-
platform?: CardPlatform;
|
|
16
14
|
cardOptions?: CardOptions;
|
|
17
15
|
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
18
16
|
editorPluginApi: ExtractInjectionAPI<CardPlugin> | undefined;
|
|
@@ -6,7 +6,6 @@ import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
|
6
6
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import type { CardContext } from '@atlaskit/link-provider';
|
|
9
|
-
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
10
9
|
export interface LinkToolbarAppearanceProps {
|
|
11
10
|
intl: IntlShape;
|
|
12
11
|
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
@@ -16,7 +15,6 @@ export interface LinkToolbarAppearanceProps {
|
|
|
16
15
|
url?: string;
|
|
17
16
|
allowEmbeds?: boolean;
|
|
18
17
|
allowBlockCards?: boolean;
|
|
19
|
-
platform?: CardPlatform;
|
|
20
18
|
showUpgradeDiscoverability?: boolean;
|
|
21
19
|
isDatasourceView?: boolean;
|
|
22
20
|
}
|
|
@@ -22,7 +22,7 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
22
22
|
}) => void;
|
|
23
23
|
render(): JSX.Element;
|
|
24
24
|
}
|
|
25
|
-
export type BlockCardNodeViewProps = Pick<SmartCardProps, '
|
|
25
|
+
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'showServerActions' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
26
26
|
export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
27
27
|
unsubscribe: (() => void) | undefined;
|
|
28
28
|
createDomRef(): HTMLElement;
|
|
@@ -34,7 +34,6 @@ export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
|
34
34
|
}
|
|
35
35
|
export interface BlockCardNodeViewProperties {
|
|
36
36
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
37
|
-
platform: BlockCardNodeViewProps['platform'];
|
|
38
37
|
actionOptions: BlockCardNodeViewProps['actionOptions'];
|
|
39
38
|
showServerActions: BlockCardNodeViewProps['showServerActions'];
|
|
40
39
|
pluginInjectionApi: BlockCardNodeViewProps['pluginInjectionApi'];
|
|
@@ -42,4 +41,4 @@ export interface BlockCardNodeViewProperties {
|
|
|
42
41
|
allowDatasource: boolean | undefined;
|
|
43
42
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
44
43
|
}
|
|
45
|
-
export declare const blockCardNodeView: ({ pmPluginFactoryParams,
|
|
44
|
+
export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, showServerActions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => Datasource | BlockCard | import("prosemirror-view").NodeView;
|
|
@@ -41,7 +41,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
41
41
|
}) => void;
|
|
42
42
|
render(): JSX.Element;
|
|
43
43
|
}
|
|
44
|
-
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | '
|
|
44
|
+
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions' | 'onClickCallback'>;
|
|
45
45
|
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
46
46
|
unsubscribe: (() => void) | undefined;
|
|
47
47
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
@@ -52,7 +52,6 @@ export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
|
52
52
|
}
|
|
53
53
|
export interface EmbedCardNodeViewProperties {
|
|
54
54
|
allowResizing: EmbedCardNodeViewProps['allowResizing'];
|
|
55
|
-
platform: EmbedCardNodeViewProps['platform'];
|
|
56
55
|
fullWidthMode: EmbedCardNodeViewProps['fullWidthMode'];
|
|
57
56
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
58
57
|
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
|
|
@@ -60,4 +59,4 @@ export interface EmbedCardNodeViewProperties {
|
|
|
60
59
|
showServerActions: EmbedCardNodeViewProps['showServerActions'];
|
|
61
60
|
onClickCallback: EmbedCardNodeViewProps['onClickCallback'];
|
|
62
61
|
}
|
|
63
|
-
export declare const embedCardNodeView: ({ allowResizing,
|
|
62
|
+
export declare const embedCardNodeView: ({ allowResizing, fullWidthMode, pmPluginFactoryParams, pluginInjectionApi, actionOptions, showServerActions, onClickCallback, }: EmbedCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => EmbedCard;
|
|
@@ -10,14 +10,13 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
10
10
|
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
12
12
|
import { type CardContext } from '@atlaskit/link-provider';
|
|
13
|
-
import type { CardProps as BaseCardProps
|
|
13
|
+
import type { CardProps as BaseCardProps } from '@atlaskit/smart-card';
|
|
14
14
|
import type { cardPlugin } from '../index';
|
|
15
15
|
export type EditorContext<T> = React.Context<T> & {
|
|
16
16
|
value: T;
|
|
17
17
|
};
|
|
18
18
|
export interface CardNodeViewProps extends ReactComponentProps {
|
|
19
19
|
providerFactory?: ProviderFactory;
|
|
20
|
-
platform?: CardPlatform;
|
|
21
20
|
eventDispatcher?: EventDispatcher;
|
|
22
21
|
}
|
|
23
22
|
export interface CardProps extends CardNodeViewProps {
|
|
@@ -26,7 +25,6 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
26
25
|
view: EditorView;
|
|
27
26
|
getPos: getPosHandler;
|
|
28
27
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
29
|
-
isMobile?: boolean;
|
|
30
28
|
eventDispatcher?: EventDispatcher;
|
|
31
29
|
allowResizing?: boolean;
|
|
32
30
|
fullWidthMode?: boolean;
|
|
@@ -10,7 +10,7 @@ import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
|
10
10
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
11
|
import type { CardPluginOptions, CardPluginState } from './types';
|
|
12
12
|
export type CardPlugin = NextEditorPlugin<'card', {
|
|
13
|
-
pluginConfiguration: CardPluginOptions;
|
|
13
|
+
pluginConfiguration: CardPluginOptions | undefined;
|
|
14
14
|
dependencies: [
|
|
15
15
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
16
16
|
OptionalPlugin<AnalyticsPlugin>,
|
|
@@ -2,13 +2,12 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
4
4
|
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
6
5
|
import type { CardPluginOptions } from './types';
|
|
7
6
|
import type { cardPlugin } from './index';
|
|
8
7
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
9
8
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
10
9
|
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => Command;
|
|
11
|
-
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean,
|
|
10
|
+
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
12
11
|
export declare const getHyperlinkToolbarSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
|
13
12
|
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>;
|
|
14
13
|
export declare const getSettingsButtonGroup: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>[];
|
|
@@ -100,7 +100,6 @@ export type CardPluginState = {
|
|
|
100
100
|
};
|
|
101
101
|
export type CardPluginOptions = CardOptions & {
|
|
102
102
|
editorAppearance?: EditorAppearance;
|
|
103
|
-
platform: 'mobile' | 'web';
|
|
104
103
|
fullWidthMode?: boolean;
|
|
105
104
|
linkPicker?: LinkPickerOptions;
|
|
106
105
|
cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
|
|
@@ -5,14 +5,12 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
|
5
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
9
8
|
import { type CardPlugin } from '../plugin';
|
|
10
9
|
export interface HyperlinkToolbarAppearanceProps {
|
|
11
10
|
intl: IntlShape;
|
|
12
11
|
editorState: EditorState;
|
|
13
12
|
url: string;
|
|
14
13
|
editorView?: EditorView;
|
|
15
|
-
platform?: CardPlatform;
|
|
16
14
|
cardOptions?: CardOptions;
|
|
17
15
|
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
18
16
|
editorPluginApi: ExtractInjectionAPI<CardPlugin> | undefined;
|
|
@@ -6,7 +6,6 @@ import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
|
6
6
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import type { CardContext } from '@atlaskit/link-provider';
|
|
9
|
-
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
10
9
|
export interface LinkToolbarAppearanceProps {
|
|
11
10
|
intl: IntlShape;
|
|
12
11
|
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
@@ -16,7 +15,6 @@ export interface LinkToolbarAppearanceProps {
|
|
|
16
15
|
url?: string;
|
|
17
16
|
allowEmbeds?: boolean;
|
|
18
17
|
allowBlockCards?: boolean;
|
|
19
|
-
platform?: CardPlatform;
|
|
20
18
|
showUpgradeDiscoverability?: boolean;
|
|
21
19
|
isDatasourceView?: boolean;
|
|
22
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
36
36
|
"@atlaskit/custom-steps": "^0.7.0",
|
|
37
|
-
"@atlaskit/editor-common": "^
|
|
37
|
+
"@atlaskit/editor-common": "^89.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -55,8 +55,9 @@
|
|
|
55
55
|
"@atlaskit/menu": "2.12.2",
|
|
56
56
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
57
57
|
"@atlaskit/primitives": "^12.1.0",
|
|
58
|
-
"@atlaskit/smart-card": "^28.
|
|
58
|
+
"@atlaskit/smart-card": "^28.1.0",
|
|
59
59
|
"@atlaskit/theme": "^13.0.0",
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^2.1.8",
|
|
60
61
|
"@atlaskit/tokens": "^1.59.0",
|
|
61
62
|
"@babel/runtime": "^7.0.0",
|
|
62
63
|
"@emotion/react": "^11.7.1",
|
|
@@ -125,9 +126,6 @@
|
|
|
125
126
|
"platform.linking-platform.datasource-enable-toolbar-buttons-for-all-datasources": {
|
|
126
127
|
"type": "boolean"
|
|
127
128
|
},
|
|
128
|
-
"platform_editor_lazy-node-views": {
|
|
129
|
-
"type": "boolean"
|
|
130
|
-
},
|
|
131
129
|
"platform.editor.card.inject-settings-button": {
|
|
132
130
|
"type": "boolean"
|
|
133
131
|
},
|
package/report.api.md
CHANGED
|
@@ -73,7 +73,7 @@ type CardPluginEvent = DatasourceEvent | LinkEvent;
|
|
|
73
73
|
// @public (undocumented)
|
|
74
74
|
type CardPluginOptions = CardOptions & {
|
|
75
75
|
editorAppearance?: EditorAppearance;
|
|
76
|
-
platform: '
|
|
76
|
+
platform: 'web';
|
|
77
77
|
fullWidthMode?: boolean;
|
|
78
78
|
linkPicker?: LinkPickerOptions;
|
|
79
79
|
cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
|