@atlaskit/editor-plugin-card 1.6.2 → 1.8.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 +30 -0
- package/dist/cjs/nodeviews/blockCard.js +9 -5
- package/dist/cjs/nodeviews/embedCard.js +7 -5
- package/dist/cjs/nodeviews/genericCard.js +58 -9
- package/dist/cjs/nodeviews/inlineCard.js +10 -6
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +4 -3
- package/dist/cjs/pm-plugins/main.js +9 -4
- package/dist/cjs/pm-plugins/mountHyperlink.js +21 -0
- package/dist/cjs/toolbar.js +23 -9
- package/dist/es2019/nodeviews/blockCard.js +9 -5
- package/dist/es2019/nodeviews/embedCard.js +7 -5
- package/dist/es2019/nodeviews/genericCard.js +50 -3
- package/dist/es2019/nodeviews/inlineCard.js +10 -6
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +4 -3
- package/dist/es2019/pm-plugins/main.js +9 -4
- package/dist/es2019/pm-plugins/mountHyperlink.js +21 -0
- package/dist/es2019/toolbar.js +22 -8
- package/dist/esm/nodeviews/blockCard.js +9 -5
- package/dist/esm/nodeviews/embedCard.js +7 -5
- package/dist/esm/nodeviews/genericCard.js +55 -9
- package/dist/esm/nodeviews/inlineCard.js +10 -6
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +4 -3
- package/dist/esm/pm-plugins/main.js +9 -4
- package/dist/esm/pm-plugins/mountHyperlink.js +21 -0
- package/dist/esm/toolbar.js +22 -8
- package/dist/types/nodeviews/blockCard.d.ts +1 -2
- package/dist/types/nodeviews/embedCard.d.ts +1 -2
- package/dist/types/nodeviews/genericCard.d.ts +6 -1
- package/dist/types/nodeviews/inlineCard.d.ts +1 -2
- package/dist/types/nodeviews/inlineCardWithAwareness.d.ts +1 -1
- package/dist/types/plugin.d.ts +2 -0
- package/dist/types/toolbar.d.ts +6 -2
- package/dist/types/types.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +6 -1
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +1 -1
- package/dist/types-ts4.5/plugin.d.ts +2 -0
- package/dist/types-ts4.5/toolbar.d.ts +6 -2
- package/dist/types-ts4.5/types.d.ts +2 -1
- package/package.json +13 -6
|
@@ -6,7 +6,6 @@ import type { Decoration, DecorationSource } from '@atlaskit/editor-prosemirror/
|
|
|
6
6
|
import type { SmartCardProps } from './genericCard';
|
|
7
7
|
export declare class BlockCardComponent extends React.PureComponent<SmartCardProps> {
|
|
8
8
|
private scrollContainer?;
|
|
9
|
-
onClick: () => void;
|
|
10
9
|
static contextTypes: {
|
|
11
10
|
contextAdapter: PropTypes.Requireable<object>;
|
|
12
11
|
};
|
|
@@ -21,7 +20,7 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
21
20
|
}) => void;
|
|
22
21
|
render(): JSX.Element;
|
|
23
22
|
}
|
|
24
|
-
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'actionOptions' | 'showServerActions'>;
|
|
23
|
+
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'actionOptions' | 'showServerActions' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
25
24
|
export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
26
25
|
createDomRef(): HTMLElement;
|
|
27
26
|
validUpdate(currentNode: Node, newNode: Node): boolean;
|
|
@@ -13,7 +13,6 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
13
13
|
private scrollContainer?;
|
|
14
14
|
private embedIframeRef;
|
|
15
15
|
context: any;
|
|
16
|
-
onClick: () => void;
|
|
17
16
|
static contextTypes: {
|
|
18
17
|
contextAdapter: PropTypes.Requireable<object>;
|
|
19
18
|
};
|
|
@@ -39,7 +38,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
39
38
|
}) => void;
|
|
40
39
|
render(): JSX.Element;
|
|
41
40
|
}
|
|
42
|
-
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions'>;
|
|
41
|
+
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions' | 'onClickCallback'>;
|
|
43
42
|
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
44
43
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
45
44
|
createDomRef(): HTMLElement;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { EventHandler, KeyboardEvent, MouseEvent } from 'react';
|
|
2
3
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { OnClickCallback } from '@atlaskit/editor-common/card';
|
|
3
5
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
6
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
7
|
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
6
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
10
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type
|
|
11
|
+
import { type CardContext } from '@atlaskit/link-provider';
|
|
10
12
|
import type { CardProps as BaseCardProps, CardPlatform } from '@atlaskit/smart-card';
|
|
11
13
|
import type { cardPlugin } from '../index';
|
|
12
14
|
export type EditorContext<T> = React.Context<T> & {
|
|
@@ -40,8 +42,11 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
40
42
|
isPulseEnabled?: boolean;
|
|
41
43
|
linkPosition?: number;
|
|
42
44
|
isSelected?: boolean;
|
|
45
|
+
onClickCallback?: OnClickCallback;
|
|
43
46
|
}
|
|
44
47
|
export interface SmartCardProps extends CardProps {
|
|
48
|
+
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
45
49
|
cardContext?: EditorContext<CardContext | undefined>;
|
|
50
|
+
onClick?: EventHandler<MouseEvent | KeyboardEvent> | undefined;
|
|
46
51
|
}
|
|
47
52
|
export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps>>, UnsupportedComponent: React.ComponentType<React.PropsWithChildren<unknown>>): React.ComponentType<React.PropsWithChildren<CardProps>>;
|
|
@@ -4,7 +4,6 @@ import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react
|
|
|
4
4
|
import type { SmartCardProps } from './genericCard';
|
|
5
5
|
export declare class InlineCardComponent extends React.PureComponent<SmartCardProps> {
|
|
6
6
|
private scrollContainer?;
|
|
7
|
-
private onClick;
|
|
8
7
|
static contextTypes: {
|
|
9
8
|
contextAdapter: PropTypes.Requireable<object>;
|
|
10
9
|
};
|
|
@@ -19,7 +18,7 @@ export declare class InlineCardComponent extends React.PureComponent<SmartCardPr
|
|
|
19
18
|
}) => void;
|
|
20
19
|
render(): JSX.Element | null;
|
|
21
20
|
}
|
|
22
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi'>;
|
|
21
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
23
22
|
type InlineCardWithAwarenessProps = {
|
|
24
23
|
allowEmbeds?: boolean;
|
|
25
24
|
allowBlockCards?: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SmartCardProps } from './genericCard';
|
|
3
|
-
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, }: SmartCardProps) => JSX.Element | null>;
|
|
3
|
+
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, onClick, }: SmartCardProps) => JSX.Element | null>;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
5
6
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
7
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
7
8
|
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
@@ -13,6 +14,7 @@ export type CardPlugin = NextEditorPlugin<'card', {
|
|
|
13
14
|
dependencies: [
|
|
14
15
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
15
16
|
OptionalPlugin<AnalyticsPlugin>,
|
|
17
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
16
18
|
WidthPlugin,
|
|
17
19
|
DecorationsPlugin,
|
|
18
20
|
GridPlugin,
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
|
-
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
5
|
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
5
6
|
import type { cardPlugin } from './index';
|
|
6
7
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
7
8
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
8
|
-
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
9
|
+
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => Command;
|
|
9
10
|
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, platform?: CardPlatform, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
11
|
+
export declare const getHyperlinkToolbarSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
|
12
|
+
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>;
|
|
13
|
+
export declare const getSettingsButtonGroup: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>[];
|
|
10
14
|
export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearance: string, status: string, isDiscoverabilityEnabled: boolean) => boolean;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import type { ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { CardOptions, CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
3
|
+
import type { CardOptions, CardReplacementInputMethod, OnClickCallback } from '@atlaskit/editor-common/card';
|
|
4
4
|
import type { CardAppearance, CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { DatasourceModalType, EditorAppearance, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { DatasourceAdfView } from '@atlaskit/linking-common';
|
|
@@ -100,6 +100,7 @@ export type CardPluginOptions = CardOptions & {
|
|
|
100
100
|
cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
|
|
101
101
|
lpLinkPicker?: boolean;
|
|
102
102
|
disableFloatingToolbar?: boolean;
|
|
103
|
+
onClickCallback?: OnClickCallback;
|
|
103
104
|
};
|
|
104
105
|
export type SetProvider = {
|
|
105
106
|
type: 'SET_PROVIDER';
|
|
@@ -6,7 +6,6 @@ import type { Decoration, DecorationSource } from '@atlaskit/editor-prosemirror/
|
|
|
6
6
|
import type { SmartCardProps } from './genericCard';
|
|
7
7
|
export declare class BlockCardComponent extends React.PureComponent<SmartCardProps> {
|
|
8
8
|
private scrollContainer?;
|
|
9
|
-
onClick: () => void;
|
|
10
9
|
static contextTypes: {
|
|
11
10
|
contextAdapter: PropTypes.Requireable<object>;
|
|
12
11
|
};
|
|
@@ -21,7 +20,7 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
21
20
|
}) => void;
|
|
22
21
|
render(): JSX.Element;
|
|
23
22
|
}
|
|
24
|
-
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'actionOptions' | 'showServerActions'>;
|
|
23
|
+
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'actionOptions' | 'showServerActions' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
25
24
|
export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
26
25
|
createDomRef(): HTMLElement;
|
|
27
26
|
validUpdate(currentNode: Node, newNode: Node): boolean;
|
|
@@ -13,7 +13,6 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
13
13
|
private scrollContainer?;
|
|
14
14
|
private embedIframeRef;
|
|
15
15
|
context: any;
|
|
16
|
-
onClick: () => void;
|
|
17
16
|
static contextTypes: {
|
|
18
17
|
contextAdapter: PropTypes.Requireable<object>;
|
|
19
18
|
};
|
|
@@ -39,7 +38,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
39
38
|
}) => void;
|
|
40
39
|
render(): JSX.Element;
|
|
41
40
|
}
|
|
42
|
-
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions'>;
|
|
41
|
+
export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi' | 'actionOptions' | 'showServerActions' | 'onClickCallback'>;
|
|
43
42
|
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
44
43
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
45
44
|
createDomRef(): HTMLElement;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { EventHandler, KeyboardEvent, MouseEvent } from 'react';
|
|
2
3
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { OnClickCallback } from '@atlaskit/editor-common/card';
|
|
3
5
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
6
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
7
|
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
6
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
10
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type
|
|
11
|
+
import { type CardContext } from '@atlaskit/link-provider';
|
|
10
12
|
import type { CardProps as BaseCardProps, CardPlatform } from '@atlaskit/smart-card';
|
|
11
13
|
import type { cardPlugin } from '../index';
|
|
12
14
|
export type EditorContext<T> = React.Context<T> & {
|
|
@@ -40,8 +42,11 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
40
42
|
isPulseEnabled?: boolean;
|
|
41
43
|
linkPosition?: number;
|
|
42
44
|
isSelected?: boolean;
|
|
45
|
+
onClickCallback?: OnClickCallback;
|
|
43
46
|
}
|
|
44
47
|
export interface SmartCardProps extends CardProps {
|
|
48
|
+
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
45
49
|
cardContext?: EditorContext<CardContext | undefined>;
|
|
50
|
+
onClick?: EventHandler<MouseEvent | KeyboardEvent> | undefined;
|
|
46
51
|
}
|
|
47
52
|
export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps>>, UnsupportedComponent: React.ComponentType<React.PropsWithChildren<unknown>>): React.ComponentType<React.PropsWithChildren<CardProps>>;
|
|
@@ -4,7 +4,6 @@ import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react
|
|
|
4
4
|
import type { SmartCardProps } from './genericCard';
|
|
5
5
|
export declare class InlineCardComponent extends React.PureComponent<SmartCardProps> {
|
|
6
6
|
private scrollContainer?;
|
|
7
|
-
private onClick;
|
|
8
7
|
static contextTypes: {
|
|
9
8
|
contextAdapter: PropTypes.Requireable<object>;
|
|
10
9
|
};
|
|
@@ -19,7 +18,7 @@ export declare class InlineCardComponent extends React.PureComponent<SmartCardPr
|
|
|
19
18
|
}) => void;
|
|
20
19
|
render(): JSX.Element | null;
|
|
21
20
|
}
|
|
22
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi'>;
|
|
21
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
23
22
|
type InlineCardWithAwarenessProps = {
|
|
24
23
|
allowEmbeds?: boolean;
|
|
25
24
|
allowBlockCards?: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SmartCardProps } from './genericCard';
|
|
3
|
-
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, }: SmartCardProps) => JSX.Element | null>;
|
|
3
|
+
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, isOverlayEnabled, isPulseEnabled, pluginInjectionApi, isSelected, onClick, }: SmartCardProps) => JSX.Element | null>;
|
|
@@ -2,6 +2,7 @@ import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
4
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
5
6
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
7
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
7
8
|
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
@@ -13,6 +14,7 @@ export type CardPlugin = NextEditorPlugin<'card', {
|
|
|
13
14
|
dependencies: [
|
|
14
15
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
15
16
|
OptionalPlugin<AnalyticsPlugin>,
|
|
17
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
16
18
|
WidthPlugin,
|
|
17
19
|
DecorationsPlugin,
|
|
18
20
|
GridPlugin,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
|
-
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
5
|
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
5
6
|
import type { cardPlugin } from './index';
|
|
6
7
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
7
8
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
8
|
-
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
9
|
+
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => Command;
|
|
9
10
|
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, platform?: CardPlatform, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
11
|
+
export declare const getHyperlinkToolbarSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
|
12
|
+
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>;
|
|
13
|
+
export declare const getSettingsButtonGroup: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>[];
|
|
10
14
|
export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearance: string, status: string, isDiscoverabilityEnabled: boolean) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import type { ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { CardOptions, CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
3
|
+
import type { CardOptions, CardReplacementInputMethod, OnClickCallback } from '@atlaskit/editor-common/card';
|
|
4
4
|
import type { CardAppearance, CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { DatasourceModalType, EditorAppearance, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { DatasourceAdfView } from '@atlaskit/linking-common';
|
|
@@ -100,6 +100,7 @@ export type CardPluginOptions = CardOptions & {
|
|
|
100
100
|
cardPluginEvents?: EditorCardPluginEvents<CardPluginEvent>;
|
|
101
101
|
lpLinkPicker?: boolean;
|
|
102
102
|
disableFloatingToolbar?: boolean;
|
|
103
|
+
onClickCallback?: OnClickCallback;
|
|
103
104
|
};
|
|
104
105
|
export type SetProvider = {
|
|
105
106
|
type: 'SET_PROVIDER';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,16 +32,17 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^35.
|
|
35
|
+
"@atlaskit/adf-schema": "^35.9.0",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
37
|
-
"@atlaskit/custom-steps": "^0.0.
|
|
38
|
-
"@atlaskit/editor-common": "^78.
|
|
37
|
+
"@atlaskit/custom-steps": "^0.0.18",
|
|
38
|
+
"@atlaskit/editor-common": "^78.28.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^1.0.0",
|
|
41
42
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
42
43
|
"@atlaskit/editor-plugin-floating-toolbar": "^1.2.0",
|
|
43
44
|
"@atlaskit/editor-plugin-grid": "^1.0.0",
|
|
44
|
-
"@atlaskit/editor-plugin-hyperlink": "^1.
|
|
45
|
+
"@atlaskit/editor-plugin-hyperlink": "^1.5.0",
|
|
45
46
|
"@atlaskit/editor-plugin-width": "^1.0.0",
|
|
46
47
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
47
48
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"@atlaskit/linking-types": "^8.8.0",
|
|
55
56
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
56
57
|
"@atlaskit/primitives": "^5.5.0",
|
|
57
|
-
"@atlaskit/smart-card": "^26.
|
|
58
|
+
"@atlaskit/smart-card": "^26.56.0",
|
|
58
59
|
"@atlaskit/theme": "^12.7.0",
|
|
59
60
|
"@atlaskit/tokens": "^1.43.0",
|
|
60
61
|
"@babel/runtime": "^7.0.0",
|
|
@@ -124,6 +125,12 @@
|
|
|
124
125
|
},
|
|
125
126
|
"platform.linking-platform.datasource-assets_objects_remove_beta": {
|
|
126
127
|
"type": "boolean"
|
|
128
|
+
},
|
|
129
|
+
"platform.editor.card.inject-settings-button": {
|
|
130
|
+
"type": "boolean"
|
|
131
|
+
},
|
|
132
|
+
"platform.linking-platform.smart-card.on-click-callback": {
|
|
133
|
+
"type": "boolean"
|
|
127
134
|
}
|
|
128
135
|
},
|
|
129
136
|
"stricter": {
|