@atlaskit/editor-plugin-card 6.0.2 → 6.1.1
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 +18 -0
- package/dist/cjs/nodeviews/genericCard.js +7 -0
- package/dist/cjs/nodeviews/inlineCard.js +17 -6
- package/dist/cjs/pm-plugins/main.js +4 -2
- package/dist/es2019/nodeviews/genericCard.js +7 -0
- package/dist/es2019/nodeviews/inlineCard.js +17 -6
- package/dist/es2019/pm-plugins/main.js +4 -2
- package/dist/esm/nodeviews/genericCard.js +7 -0
- package/dist/esm/nodeviews/inlineCard.js +17 -6
- package/dist/esm/pm-plugins/main.js +4 -2
- package/dist/types/nodeviews/genericCard.d.ts +9 -0
- package/dist/types/nodeviews/inlineCard.d.ts +6 -1
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +9 -0
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +6 -1
- package/dist/types-ts4.5/types/index.d.ts +4 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 6.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#151988](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/151988)
|
|
14
|
+
[`40cc12e3c4d9a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/40cc12e3c4d9a) -
|
|
15
|
+
[ux] Add optional CompetitorPrompt component for experiment
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 6.0.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -81,6 +81,13 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
81
81
|
onClick: allowNavigation ? undefined : onClick
|
|
82
82
|
}));
|
|
83
83
|
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param SmartCardComponent
|
|
88
|
+
* @param UnsupportedComponent
|
|
89
|
+
* @example
|
|
90
|
+
*/
|
|
84
91
|
function Card(SmartCardComponent, UnsupportedComponent) {
|
|
85
92
|
return /*#__PURE__*/function (_React$Component) {
|
|
86
93
|
function _class() {
|
|
@@ -154,6 +154,12 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
154
154
|
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
155
155
|
};
|
|
156
156
|
});
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
*
|
|
160
|
+
* @param props
|
|
161
|
+
* @example
|
|
162
|
+
*/
|
|
157
163
|
function InlineCardNodeView(props) {
|
|
158
164
|
var useAlternativePreloader = props.useAlternativePreloader,
|
|
159
165
|
node = props.node,
|
|
@@ -166,7 +172,8 @@ function InlineCardNodeView(props) {
|
|
|
166
172
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
167
173
|
onClickCallback = props.onClickCallback,
|
|
168
174
|
__livePage = props.__livePage,
|
|
169
|
-
isPageSSRed = props.isPageSSRed
|
|
175
|
+
isPageSSRed = props.isPageSSRed,
|
|
176
|
+
CompetitorPrompt = props.CompetitorPrompt;
|
|
170
177
|
var _useState = (0, _react.useState)(false),
|
|
171
178
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
172
179
|
isOverlayHovered = _useState2[0],
|
|
@@ -175,6 +182,10 @@ function InlineCardNodeView(props) {
|
|
|
175
182
|
mode = _useSharedState.mode,
|
|
176
183
|
selection = _useSharedState.selection;
|
|
177
184
|
var floatingToolbarNode = selection instanceof _state.NodeSelection && selection.node;
|
|
185
|
+
var url = node.attrs.url;
|
|
186
|
+
var CompetitorPromptComponent = CompetitorPrompt && url ? /*#__PURE__*/_react.default.createElement(CompetitorPrompt, {
|
|
187
|
+
sourceUrl: url
|
|
188
|
+
}) : null;
|
|
178
189
|
if (__livePage && (0, _platformFeatureFlags.fg)('linking_platform_smart_links_in_live_pages')) {
|
|
179
190
|
var showHoverPreview = floatingToolbarNode !== node;
|
|
180
191
|
var livePagesHoverCardFadeInDelay = 800;
|
|
@@ -192,7 +203,7 @@ function InlineCardNodeView(props) {
|
|
|
192
203
|
},
|
|
193
204
|
isPageSSRed: isPageSSRed
|
|
194
205
|
});
|
|
195
|
-
return mode === 'view' ? inlineCard : /*#__PURE__*/_react.default.createElement(_ConfigureOverlay.default, {
|
|
206
|
+
return mode === 'view' ? inlineCard : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ConfigureOverlay.default, {
|
|
196
207
|
targetElementPos: getPos(),
|
|
197
208
|
view: view,
|
|
198
209
|
isHoveredCallback: setIsOverlayHovered,
|
|
@@ -201,13 +212,13 @@ function InlineCardNodeView(props) {
|
|
|
201
212
|
(0, _link.handleNavigation)({
|
|
202
213
|
fireAnalyticsEvent: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent,
|
|
203
214
|
onClickCallback: onClickCallback,
|
|
204
|
-
url:
|
|
215
|
+
url: url,
|
|
205
216
|
event: event
|
|
206
217
|
});
|
|
207
218
|
}
|
|
208
|
-
}, inlineCard);
|
|
219
|
+
}, inlineCard), (0, _platformFeatureFlags.fg)('prompt_whiteboard_competitor_link_gate') && CompetitorPromptComponent);
|
|
209
220
|
}
|
|
210
|
-
return /*#__PURE__*/_react.default.createElement(WrappedInlineCardWithAwareness, (0, _extends2.default)({
|
|
221
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(WrappedInlineCardWithAwareness, (0, _extends2.default)({
|
|
211
222
|
node: node,
|
|
212
223
|
view: view,
|
|
213
224
|
getPos: getPos,
|
|
@@ -219,7 +230,7 @@ function InlineCardNodeView(props) {
|
|
|
219
230
|
appearance: "inline"
|
|
220
231
|
// Ignored via go/ees005
|
|
221
232
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
222
|
-
}, enableInlineUpgradeFeatures && (0, _utils.getAwarenessProps)(view.state, getPos, allowEmbeds, allowBlockCards, !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') ? true : mode === 'view')));
|
|
233
|
+
}, enableInlineUpgradeFeatures && (0, _utils.getAwarenessProps)(view.state, getPos, allowEmbeds, allowBlockCards, !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') ? true : mode === 'view'))), (0, _platformFeatureFlags.fg)('prompt_whiteboard_competitor_link_gate') && CompetitorPromptComponent);
|
|
223
234
|
}
|
|
224
235
|
var inlineCardNodeView = exports.inlineCardNodeView = function inlineCardNodeView(_ref2) {
|
|
225
236
|
var inlineCardViewProducer = _ref2.inlineCardViewProducer;
|
|
@@ -68,7 +68,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
68
68
|
allowBlockCards = options.allowBlockCards,
|
|
69
69
|
onClickCallback = options.onClickCallback,
|
|
70
70
|
__livePage = options.__livePage,
|
|
71
|
-
isPageSSRed = options.isPageSSRed
|
|
71
|
+
isPageSSRed = options.isPageSSRed,
|
|
72
|
+
CompetitorPrompt = options.CompetitorPrompt;
|
|
72
73
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability;
|
|
73
74
|
var inlineCardViewProducer = (0, _reactNodeView.getInlineNodeViewProducer)(_objectSpread({
|
|
74
75
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
@@ -82,7 +83,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
82
83
|
pluginInjectionApi: pluginInjectionApi,
|
|
83
84
|
onClickCallback: onClickCallback,
|
|
84
85
|
__livePage: __livePage,
|
|
85
|
-
isPageSSRed: isPageSSRed
|
|
86
|
+
isPageSSRed: isPageSSRed,
|
|
87
|
+
CompetitorPrompt: CompetitorPrompt
|
|
86
88
|
}
|
|
87
89
|
}, __livePage && (0, _platformFeatureFlags.fg)('linking_platform_smart_links_in_live_pages') && {
|
|
88
90
|
extraNodeViewProps: {
|
|
@@ -67,6 +67,13 @@ const WithClickHandler = ({
|
|
|
67
67
|
onClick: allowNavigation ? undefined : onClick
|
|
68
68
|
}));
|
|
69
69
|
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param SmartCardComponent
|
|
74
|
+
* @param UnsupportedComponent
|
|
75
|
+
* @example
|
|
76
|
+
*/
|
|
70
77
|
export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
71
78
|
return class extends React.Component {
|
|
72
79
|
constructor(...args) {
|
|
@@ -148,6 +148,12 @@ const useSharedState = sharedPluginStateHookMigratorFactory(pluginInjectionApi =
|
|
|
148
148
|
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
149
149
|
};
|
|
150
150
|
});
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
* @param props
|
|
155
|
+
* @example
|
|
156
|
+
*/
|
|
151
157
|
export function InlineCardNodeView(props) {
|
|
152
158
|
const {
|
|
153
159
|
useAlternativePreloader,
|
|
@@ -161,7 +167,8 @@ export function InlineCardNodeView(props) {
|
|
|
161
167
|
pluginInjectionApi,
|
|
162
168
|
onClickCallback,
|
|
163
169
|
__livePage,
|
|
164
|
-
isPageSSRed
|
|
170
|
+
isPageSSRed,
|
|
171
|
+
CompetitorPrompt
|
|
165
172
|
} = props;
|
|
166
173
|
const [isOverlayHovered, setIsOverlayHovered] = useState(false);
|
|
167
174
|
const {
|
|
@@ -169,6 +176,10 @@ export function InlineCardNodeView(props) {
|
|
|
169
176
|
selection
|
|
170
177
|
} = useSharedState(pluginInjectionApi);
|
|
171
178
|
const floatingToolbarNode = selection instanceof NodeSelection && selection.node;
|
|
179
|
+
const url = node.attrs.url;
|
|
180
|
+
const CompetitorPromptComponent = CompetitorPrompt && url ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
181
|
+
sourceUrl: url
|
|
182
|
+
}) : null;
|
|
172
183
|
if (__livePage && fg('linking_platform_smart_links_in_live_pages')) {
|
|
173
184
|
const showHoverPreview = floatingToolbarNode !== node;
|
|
174
185
|
const livePagesHoverCardFadeInDelay = 800;
|
|
@@ -186,7 +197,7 @@ export function InlineCardNodeView(props) {
|
|
|
186
197
|
},
|
|
187
198
|
isPageSSRed: isPageSSRed
|
|
188
199
|
});
|
|
189
|
-
return mode === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
200
|
+
return mode === 'view' ? inlineCard : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
190
201
|
targetElementPos: getPos(),
|
|
191
202
|
view: view,
|
|
192
203
|
isHoveredCallback: setIsOverlayHovered,
|
|
@@ -195,13 +206,13 @@ export function InlineCardNodeView(props) {
|
|
|
195
206
|
handleNavigation({
|
|
196
207
|
fireAnalyticsEvent: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent,
|
|
197
208
|
onClickCallback,
|
|
198
|
-
url
|
|
209
|
+
url,
|
|
199
210
|
event
|
|
200
211
|
});
|
|
201
212
|
}
|
|
202
|
-
}, inlineCard);
|
|
213
|
+
}, inlineCard), fg('prompt_whiteboard_competitor_link_gate') && CompetitorPromptComponent);
|
|
203
214
|
}
|
|
204
|
-
return /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
|
|
215
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
|
|
205
216
|
node: node,
|
|
206
217
|
view: view,
|
|
207
218
|
getPos: getPos,
|
|
@@ -213,7 +224,7 @@ export function InlineCardNodeView(props) {
|
|
|
213
224
|
appearance: "inline"
|
|
214
225
|
// Ignored via go/ees005
|
|
215
226
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
216
|
-
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, !editorExperiment('live_pages_graceful_edit', 'control') ? true : mode === 'view')));
|
|
227
|
+
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, !editorExperiment('live_pages_graceful_edit', 'control') ? true : mode === 'view'))), fg('prompt_whiteboard_competitor_link_gate') && CompetitorPromptComponent);
|
|
217
228
|
}
|
|
218
229
|
export const inlineCardNodeView = ({
|
|
219
230
|
inlineCardViewProducer
|
|
@@ -58,7 +58,8 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
58
58
|
onClickCallback,
|
|
59
59
|
// @ts-ignore Temporary solution to check for Live Page editor.
|
|
60
60
|
__livePage,
|
|
61
|
-
isPageSSRed
|
|
61
|
+
isPageSSRed,
|
|
62
|
+
CompetitorPrompt
|
|
62
63
|
} = options;
|
|
63
64
|
const enableInlineUpgradeFeatures = !!showUpgradeDiscoverability;
|
|
64
65
|
const inlineCardViewProducer = getInlineNodeViewProducer({
|
|
@@ -73,7 +74,8 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
73
74
|
pluginInjectionApi,
|
|
74
75
|
onClickCallback,
|
|
75
76
|
__livePage,
|
|
76
|
-
isPageSSRed
|
|
77
|
+
isPageSSRed,
|
|
78
|
+
CompetitorPrompt
|
|
77
79
|
},
|
|
78
80
|
...(__livePage && fg('linking_platform_smart_links_in_live_pages') && {
|
|
79
81
|
extraNodeViewProps: {
|
|
@@ -71,6 +71,13 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
71
71
|
onClick: allowNavigation ? undefined : onClick
|
|
72
72
|
}));
|
|
73
73
|
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @param SmartCardComponent
|
|
78
|
+
* @param UnsupportedComponent
|
|
79
|
+
* @example
|
|
80
|
+
*/
|
|
74
81
|
export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
75
82
|
return /*#__PURE__*/function (_React$Component) {
|
|
76
83
|
function _class() {
|
|
@@ -142,6 +142,12 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (pluginInject
|
|
|
142
142
|
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
143
143
|
};
|
|
144
144
|
});
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
* @param props
|
|
149
|
+
* @example
|
|
150
|
+
*/
|
|
145
151
|
export function InlineCardNodeView(props) {
|
|
146
152
|
var useAlternativePreloader = props.useAlternativePreloader,
|
|
147
153
|
node = props.node,
|
|
@@ -154,7 +160,8 @@ export function InlineCardNodeView(props) {
|
|
|
154
160
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
155
161
|
onClickCallback = props.onClickCallback,
|
|
156
162
|
__livePage = props.__livePage,
|
|
157
|
-
isPageSSRed = props.isPageSSRed
|
|
163
|
+
isPageSSRed = props.isPageSSRed,
|
|
164
|
+
CompetitorPrompt = props.CompetitorPrompt;
|
|
158
165
|
var _useState = useState(false),
|
|
159
166
|
_useState2 = _slicedToArray(_useState, 2),
|
|
160
167
|
isOverlayHovered = _useState2[0],
|
|
@@ -163,6 +170,10 @@ export function InlineCardNodeView(props) {
|
|
|
163
170
|
mode = _useSharedState.mode,
|
|
164
171
|
selection = _useSharedState.selection;
|
|
165
172
|
var floatingToolbarNode = selection instanceof NodeSelection && selection.node;
|
|
173
|
+
var url = node.attrs.url;
|
|
174
|
+
var CompetitorPromptComponent = CompetitorPrompt && url ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
175
|
+
sourceUrl: url
|
|
176
|
+
}) : null;
|
|
166
177
|
if (__livePage && fg('linking_platform_smart_links_in_live_pages')) {
|
|
167
178
|
var showHoverPreview = floatingToolbarNode !== node;
|
|
168
179
|
var livePagesHoverCardFadeInDelay = 800;
|
|
@@ -180,7 +191,7 @@ export function InlineCardNodeView(props) {
|
|
|
180
191
|
},
|
|
181
192
|
isPageSSRed: isPageSSRed
|
|
182
193
|
});
|
|
183
|
-
return mode === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
194
|
+
return mode === 'view' ? inlineCard : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
184
195
|
targetElementPos: getPos(),
|
|
185
196
|
view: view,
|
|
186
197
|
isHoveredCallback: setIsOverlayHovered,
|
|
@@ -189,13 +200,13 @@ export function InlineCardNodeView(props) {
|
|
|
189
200
|
handleNavigation({
|
|
190
201
|
fireAnalyticsEvent: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent,
|
|
191
202
|
onClickCallback: onClickCallback,
|
|
192
|
-
url:
|
|
203
|
+
url: url,
|
|
193
204
|
event: event
|
|
194
205
|
});
|
|
195
206
|
}
|
|
196
|
-
}, inlineCard);
|
|
207
|
+
}, inlineCard), fg('prompt_whiteboard_competitor_link_gate') && CompetitorPromptComponent);
|
|
197
208
|
}
|
|
198
|
-
return /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
|
|
209
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
|
|
199
210
|
node: node,
|
|
200
211
|
view: view,
|
|
201
212
|
getPos: getPos,
|
|
@@ -207,7 +218,7 @@ export function InlineCardNodeView(props) {
|
|
|
207
218
|
appearance: "inline"
|
|
208
219
|
// Ignored via go/ees005
|
|
209
220
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
210
|
-
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, !editorExperiment('live_pages_graceful_edit', 'control') ? true : mode === 'view')));
|
|
221
|
+
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, !editorExperiment('live_pages_graceful_edit', 'control') ? true : mode === 'view'))), fg('prompt_whiteboard_competitor_link_gate') && CompetitorPromptComponent);
|
|
211
222
|
}
|
|
212
223
|
export var inlineCardNodeView = function inlineCardNodeView(_ref2) {
|
|
213
224
|
var inlineCardViewProducer = _ref2.inlineCardViewProducer;
|
|
@@ -61,7 +61,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
61
61
|
allowBlockCards = options.allowBlockCards,
|
|
62
62
|
onClickCallback = options.onClickCallback,
|
|
63
63
|
__livePage = options.__livePage,
|
|
64
|
-
isPageSSRed = options.isPageSSRed
|
|
64
|
+
isPageSSRed = options.isPageSSRed,
|
|
65
|
+
CompetitorPrompt = options.CompetitorPrompt;
|
|
65
66
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability;
|
|
66
67
|
var inlineCardViewProducer = getInlineNodeViewProducer(_objectSpread({
|
|
67
68
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
@@ -75,7 +76,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
75
76
|
pluginInjectionApi: pluginInjectionApi,
|
|
76
77
|
onClickCallback: onClickCallback,
|
|
77
78
|
__livePage: __livePage,
|
|
78
|
-
isPageSSRed: isPageSSRed
|
|
79
|
+
isPageSSRed: isPageSSRed,
|
|
80
|
+
CompetitorPrompt: CompetitorPrompt
|
|
79
81
|
}
|
|
80
82
|
}, __livePage && fg('linking_platform_smart_links_in_live_pages') && {
|
|
81
83
|
extraNodeViewProps: {
|
|
@@ -46,7 +46,16 @@ export interface SmartCardProps extends CardProps {
|
|
|
46
46
|
allowBlockCards?: boolean;
|
|
47
47
|
enableInlineUpgradeFeatures?: boolean;
|
|
48
48
|
isPageSSRed?: boolean;
|
|
49
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
50
|
+
sourceUrl: string;
|
|
51
|
+
}>;
|
|
49
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param SmartCardComponent
|
|
56
|
+
* @param UnsupportedComponent
|
|
57
|
+
* @example
|
|
58
|
+
*/
|
|
50
59
|
export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps & {
|
|
51
60
|
id?: string;
|
|
52
61
|
}>>, UnsupportedComponent: React.ComponentType<React.PropsWithChildren<unknown>>): React.ComponentType<React.PropsWithChildren<CardProps>>;
|
|
@@ -5,7 +5,12 @@ import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { SmartCardProps } from './genericCard';
|
|
6
6
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
7
7
|
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, }: SmartCardProps) => React.JSX.Element | null>;
|
|
8
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage' | 'isPageSSRed'>;
|
|
8
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage' | 'isPageSSRed' | 'CompetitorPrompt'>;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param props
|
|
12
|
+
* @example
|
|
13
|
+
*/
|
|
9
14
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
|
|
10
15
|
export interface InlineCardNodeViewProperties {
|
|
11
16
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { RichMediaAttributes } from '@atlaskit/adf-schema';
|
|
2
3
|
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
import type { ACTION } from '@atlaskit/editor-common/analytics';
|
|
@@ -108,6 +109,9 @@ export type CardPluginOptions = CardOptions & {
|
|
|
108
109
|
disableFloatingToolbar?: boolean;
|
|
109
110
|
onClickCallback?: OnClickCallback;
|
|
110
111
|
isPageSSRed?: boolean;
|
|
112
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
113
|
+
sourceUrl: string;
|
|
114
|
+
}>;
|
|
111
115
|
};
|
|
112
116
|
export type SetProvider = {
|
|
113
117
|
type: 'SET_PROVIDER';
|
|
@@ -46,7 +46,16 @@ export interface SmartCardProps extends CardProps {
|
|
|
46
46
|
allowBlockCards?: boolean;
|
|
47
47
|
enableInlineUpgradeFeatures?: boolean;
|
|
48
48
|
isPageSSRed?: boolean;
|
|
49
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
50
|
+
sourceUrl: string;
|
|
51
|
+
}>;
|
|
49
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param SmartCardComponent
|
|
56
|
+
* @param UnsupportedComponent
|
|
57
|
+
* @example
|
|
58
|
+
*/
|
|
50
59
|
export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps & {
|
|
51
60
|
id?: string;
|
|
52
61
|
}>>, UnsupportedComponent: React.ComponentType<React.PropsWithChildren<unknown>>): React.ComponentType<React.PropsWithChildren<CardProps>>;
|
|
@@ -5,7 +5,12 @@ import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { SmartCardProps } from './genericCard';
|
|
6
6
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
7
7
|
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, }: SmartCardProps) => React.JSX.Element | null>;
|
|
8
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage' | 'isPageSSRed'>;
|
|
8
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage' | 'isPageSSRed' | 'CompetitorPrompt'>;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param props
|
|
12
|
+
* @example
|
|
13
|
+
*/
|
|
9
14
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
|
|
10
15
|
export interface InlineCardNodeViewProperties {
|
|
11
16
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { RichMediaAttributes } from '@atlaskit/adf-schema';
|
|
2
3
|
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
import type { ACTION } from '@atlaskit/editor-common/analytics';
|
|
@@ -108,6 +109,9 @@ export type CardPluginOptions = CardOptions & {
|
|
|
108
109
|
disableFloatingToolbar?: boolean;
|
|
109
110
|
onClickCallback?: OnClickCallback;
|
|
110
111
|
isPageSSRed?: boolean;
|
|
112
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
113
|
+
sourceUrl: string;
|
|
114
|
+
}>;
|
|
111
115
|
};
|
|
112
116
|
export type SetProvider = {
|
|
113
117
|
type: 'SET_PROVIDER';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
38
38
|
"@atlaskit/button": "^23.0.0",
|
|
39
39
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
40
|
-
"@atlaskit/editor-common": "^105.
|
|
40
|
+
"@atlaskit/editor-common": "^105.5.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
42
42
|
"@atlaskit/editor-plugin-base": "^3.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"@atlaskit/link-datasource": "^4.10.0",
|
|
58
58
|
"@atlaskit/linking-common": "^9.0.0",
|
|
59
59
|
"@atlaskit/linking-types": "^9.10.0",
|
|
60
|
-
"@atlaskit/menu": "^
|
|
60
|
+
"@atlaskit/menu": "^6.0.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
62
|
"@atlaskit/primitives": "^14.7.0",
|
|
63
63
|
"@atlaskit/smart-card": "^38.1.0",
|
|
64
64
|
"@atlaskit/theme": "^18.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^4.22.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.8.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -154,6 +154,9 @@
|
|
|
154
154
|
},
|
|
155
155
|
"platform_editor_controls_patch_8": {
|
|
156
156
|
"type": "boolean"
|
|
157
|
+
},
|
|
158
|
+
"prompt_whiteboard_competitor_link_gate": {
|
|
159
|
+
"type": "boolean"
|
|
157
160
|
}
|
|
158
161
|
},
|
|
159
162
|
"stricter": {
|