@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#89840](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89840) [`9f256dde75e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f256dde75e9) - [ux] Implement onClickCallback plugin option to editor-plugin-card, allowing a callback to be executed when a smartlink is clicked, used by CCFE for live view to open smartlinks on-click
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106) [`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) - Bump ADF-schema package to version 35.0.0
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 1.7.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#89386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89386) [`91d0fdc31828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/91d0fdc31828) - Updates card plugin to leverage hyperlink plugins addToolbarItems action in order to inject link preferences button into the hyperlink floating toolbar. Also adds support to configure the link via card plugin options (smart links). Requires platform feature flag `platform.editor.card.inject-settings-button`.
|
|
19
|
+
|
|
20
|
+
Example usage:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Editor
|
|
24
|
+
linking={{ smartLinks: { userPreferencesLink: 'https://example.com' } }}
|
|
25
|
+
{...restProps}
|
|
26
|
+
/>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 1.6.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -35,7 +35,6 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
|
|
|
35
35
|
args[_key] = arguments[_key];
|
|
36
36
|
}
|
|
37
37
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function () {});
|
|
39
38
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onResolve", function (data) {
|
|
40
39
|
var _this$props = _this.props,
|
|
41
40
|
getPos = _this$props.getPos,
|
|
@@ -96,7 +95,8 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
|
|
|
96
95
|
cardContext = _this$props2.cardContext,
|
|
97
96
|
platform = _this$props2.platform,
|
|
98
97
|
actionOptions = _this$props2.actionOptions,
|
|
99
|
-
showServerActions = _this$props2.showServerActions
|
|
98
|
+
showServerActions = _this$props2.showServerActions,
|
|
99
|
+
onClick = _this$props2.onClick;
|
|
100
100
|
var _node$attrs = node.attrs,
|
|
101
101
|
url = _node$attrs.url,
|
|
102
102
|
data = _node$attrs.data;
|
|
@@ -106,7 +106,7 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
|
|
|
106
106
|
data: data,
|
|
107
107
|
container: this.scrollContainer,
|
|
108
108
|
appearance: "block",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: onClick,
|
|
110
110
|
onResolve: this.onResolve,
|
|
111
111
|
onError: this.onError,
|
|
112
112
|
platform: platform,
|
|
@@ -170,14 +170,18 @@ var BlockCard = exports.BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
170
170
|
var _this$reactComponentP = this.reactComponentProps,
|
|
171
171
|
platform = _this$reactComponentP.platform,
|
|
172
172
|
actionOptions = _this$reactComponentP.actionOptions,
|
|
173
|
-
showServerActions = _this$reactComponentP.showServerActions
|
|
173
|
+
showServerActions = _this$reactComponentP.showServerActions,
|
|
174
|
+
pluginInjectionApi = _this$reactComponentP.pluginInjectionApi,
|
|
175
|
+
onClickCallback = _this$reactComponentP.onClickCallback;
|
|
174
176
|
return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
|
|
175
177
|
node: this.node,
|
|
176
178
|
view: this.view,
|
|
177
179
|
getPos: this.getPos,
|
|
178
180
|
platform: platform,
|
|
179
181
|
actionOptions: actionOptions,
|
|
180
|
-
showServerActions: showServerActions
|
|
182
|
+
showServerActions: showServerActions,
|
|
183
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
184
|
+
onClickCallback: onClickCallback
|
|
181
185
|
});
|
|
182
186
|
}
|
|
183
187
|
}]);
|
|
@@ -111,7 +111,6 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
|
|
|
111
111
|
}
|
|
112
112
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
113
113
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "embedIframeRef", /*#__PURE__*/_react.default.createRef());
|
|
114
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function () {});
|
|
115
114
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
116
115
|
hasPreview: true
|
|
117
116
|
});
|
|
@@ -272,7 +271,8 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
|
|
|
272
271
|
getPos = _this$props.getPos,
|
|
273
272
|
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
274
273
|
actionOptions = _this$props.actionOptions,
|
|
275
|
-
showServerActions = _this$props.showServerActions
|
|
274
|
+
showServerActions = _this$props.showServerActions,
|
|
275
|
+
onClick = _this$props.onClick;
|
|
276
276
|
var _node$attrs = node.attrs,
|
|
277
277
|
url = _node$attrs.url,
|
|
278
278
|
pctWidth = _node$attrs.width,
|
|
@@ -303,7 +303,7 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
|
|
|
303
303
|
key: url,
|
|
304
304
|
url: url,
|
|
305
305
|
appearance: "embed",
|
|
306
|
-
onClick:
|
|
306
|
+
onClick: onClick,
|
|
307
307
|
onResolve: this.onResolve,
|
|
308
308
|
onError: this.onError,
|
|
309
309
|
frameStyle: "show",
|
|
@@ -389,7 +389,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
389
389
|
platform = _this$reactComponentP.platform,
|
|
390
390
|
fullWidthMode = _this$reactComponentP.fullWidthMode,
|
|
391
391
|
dispatchAnalyticsEvent = _this$reactComponentP.dispatchAnalyticsEvent,
|
|
392
|
-
pluginInjectionApi = _this$reactComponentP.pluginInjectionApi
|
|
392
|
+
pluginInjectionApi = _this$reactComponentP.pluginInjectionApi,
|
|
393
|
+
onClickCallback = _this$reactComponentP.onClickCallback;
|
|
393
394
|
return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
|
|
394
395
|
node: this.node,
|
|
395
396
|
view: this.view,
|
|
@@ -399,7 +400,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
399
400
|
platform: platform,
|
|
400
401
|
fullWidthMode: fullWidthMode,
|
|
401
402
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
402
|
-
pluginInjectionApi: pluginInjectionApi
|
|
403
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
404
|
+
onClickCallback: onClickCallback
|
|
403
405
|
});
|
|
404
406
|
}
|
|
405
407
|
}]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -13,16 +14,45 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _react =
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
19
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
19
20
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
21
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
20
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
23
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
24
|
var _doc = require("../pm-plugins/doc");
|
|
22
25
|
var _state = require("../pm-plugins/util/state");
|
|
23
26
|
var _utils2 = require("../utils");
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
+
var WithClickHandler = function WithClickHandler(_ref) {
|
|
32
|
+
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
33
|
+
url = _ref.url,
|
|
34
|
+
onClickCallback = _ref.onClickCallback,
|
|
35
|
+
children = _ref.children;
|
|
36
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['editorViewMode']),
|
|
37
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
38
|
+
var onClick = (0, _react.useCallback)(function (event) {
|
|
39
|
+
if (typeof onClickCallback === 'function') {
|
|
40
|
+
try {
|
|
41
|
+
onClickCallback({
|
|
42
|
+
event: event,
|
|
43
|
+
url: url
|
|
44
|
+
});
|
|
45
|
+
} catch (_unused) {}
|
|
46
|
+
}
|
|
47
|
+
}, [url, onClickCallback]);
|
|
48
|
+
|
|
49
|
+
// Setting `onClick` to `undefined` ensures clicks on smartcards navigate to the URL.
|
|
50
|
+
// If in view mode and not overriding with onClickCallback option, then allow smartlinks to navigate on click.
|
|
51
|
+
var allowNavigation = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' && !onClickCallback;
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children({
|
|
53
|
+
onClick: allowNavigation ? undefined : onClick
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
26
56
|
function Card(SmartCardComponent, UnsupportedComponent) {
|
|
27
57
|
var _class;
|
|
28
58
|
return _class = /*#__PURE__*/function (_React$Component) {
|
|
@@ -38,12 +68,17 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
38
68
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
39
69
|
isError: false
|
|
40
70
|
});
|
|
71
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function () {});
|
|
41
72
|
return _this;
|
|
42
73
|
}
|
|
43
74
|
(0, _createClass2.default)(_class, [{
|
|
44
75
|
key: "render",
|
|
45
76
|
value: function render() {
|
|
46
|
-
var _getPluginState
|
|
77
|
+
var _getPluginState,
|
|
78
|
+
_this2 = this;
|
|
79
|
+
var _this$props = this.props,
|
|
80
|
+
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
81
|
+
onClickCallback = _this$props.onClickCallback;
|
|
47
82
|
var _titleUrlPairFromNode = (0, _utils2.titleUrlPairFromNode)(this.props.node),
|
|
48
83
|
url = _titleUrlPairFromNode.url;
|
|
49
84
|
if (url && !(0, _adfSchema.isSafeUrl)(url)) {
|
|
@@ -72,10 +107,24 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
72
107
|
// Below is added for the future implementation of Linking Platform namespaced analytics context
|
|
73
108
|
location: analyticsEditorAppearance
|
|
74
109
|
}
|
|
75
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
110
|
+
}, (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.on-click-callback') ? /*#__PURE__*/_react.default.createElement(WithClickHandler, {
|
|
111
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
112
|
+
onClickCallback: onClickCallback,
|
|
113
|
+
url: url
|
|
114
|
+
}, function (_ref2) {
|
|
115
|
+
var onClick = _ref2.onClick;
|
|
116
|
+
return /*#__PURE__*/_react.default.createElement(SmartCardComponent, (0, _extends2.default)({
|
|
117
|
+
key: url,
|
|
118
|
+
cardContext: cardContext
|
|
119
|
+
}, _this2.props, {
|
|
120
|
+
onClick: onClick
|
|
121
|
+
}));
|
|
122
|
+
}) : /*#__PURE__*/_react.default.createElement(SmartCardComponent, (0, _extends2.default)({
|
|
76
123
|
key: url,
|
|
77
124
|
cardContext: cardContext
|
|
78
|
-
}, this.props
|
|
125
|
+
}, this.props, {
|
|
126
|
+
onClick: this.onClick
|
|
127
|
+
})));
|
|
79
128
|
}
|
|
80
129
|
}, {
|
|
81
130
|
key: "componentDidCatch",
|
|
@@ -91,11 +140,11 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
91
140
|
this.setState({
|
|
92
141
|
isError: true
|
|
93
142
|
});
|
|
94
|
-
var _this$
|
|
95
|
-
view = _this$
|
|
96
|
-
node = _this$
|
|
97
|
-
getPos = _this$
|
|
98
|
-
pluginInjectionApi = _this$
|
|
143
|
+
var _this$props2 = this.props,
|
|
144
|
+
view = _this$props2.view,
|
|
145
|
+
node = _this$props2.node,
|
|
146
|
+
getPos = _this$props2.getPos,
|
|
147
|
+
pluginInjectionApi = _this$props2.pluginInjectionApi;
|
|
99
148
|
var _titleUrlPairFromNode2 = (0, _utils2.titleUrlPairFromNode)(node),
|
|
100
149
|
url = _titleUrlPairFromNode2.url;
|
|
101
150
|
if (!getPos || typeof getPos === 'boolean') {
|
|
@@ -38,7 +38,6 @@ var InlineCardComponent = exports.InlineCardComponent = /*#__PURE__*/function (_
|
|
|
38
38
|
args[_key] = arguments[_key];
|
|
39
39
|
}
|
|
40
40
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function () {});
|
|
42
41
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onResolve", function (data) {
|
|
43
42
|
var _this$props = _this.props,
|
|
44
43
|
getPos = _this$props.getPos,
|
|
@@ -92,7 +91,8 @@ var InlineCardComponent = exports.InlineCardComponent = /*#__PURE__*/function (_
|
|
|
92
91
|
cardContext = _this$props2.cardContext,
|
|
93
92
|
actionOptions = _this$props2.actionOptions,
|
|
94
93
|
showServerActions = _this$props2.showServerActions,
|
|
95
|
-
useAlternativePreloader = _this$props2.useAlternativePreloader
|
|
94
|
+
useAlternativePreloader = _this$props2.useAlternativePreloader,
|
|
95
|
+
onClick = _this$props2.onClick;
|
|
96
96
|
var _node$attrs = node.attrs,
|
|
97
97
|
url = _node$attrs.url,
|
|
98
98
|
data = _node$attrs.data;
|
|
@@ -103,7 +103,7 @@ var InlineCardComponent = exports.InlineCardComponent = /*#__PURE__*/function (_
|
|
|
103
103
|
url: url,
|
|
104
104
|
data: data,
|
|
105
105
|
appearance: "inline",
|
|
106
|
-
onClick:
|
|
106
|
+
onClick: onClick,
|
|
107
107
|
container: this.scrollContainer,
|
|
108
108
|
onResolve: this.onResolve,
|
|
109
109
|
onError: this.onError,
|
|
@@ -135,7 +135,8 @@ function InlineCardNodeView(props) {
|
|
|
135
135
|
allowEmbeds = props.allowEmbeds,
|
|
136
136
|
allowBlockCards = props.allowBlockCards,
|
|
137
137
|
enableInlineUpgradeFeatures = props.enableInlineUpgradeFeatures,
|
|
138
|
-
pluginInjectionApi = props.pluginInjectionApi
|
|
138
|
+
pluginInjectionApi = props.pluginInjectionApi,
|
|
139
|
+
onClickCallback = props.onClickCallback;
|
|
139
140
|
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.inline-switcher')) {
|
|
140
141
|
return /*#__PURE__*/_react.default.createElement(WrappedInlineCard, {
|
|
141
142
|
node: node,
|
|
@@ -143,7 +144,9 @@ function InlineCardNodeView(props) {
|
|
|
143
144
|
getPos: getPos,
|
|
144
145
|
actionOptions: actionOptions,
|
|
145
146
|
showServerActions: showServerActions,
|
|
146
|
-
useAlternativePreloader: useAlternativePreloader
|
|
147
|
+
useAlternativePreloader: useAlternativePreloader,
|
|
148
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
149
|
+
onClickCallback: onClickCallback
|
|
147
150
|
});
|
|
148
151
|
}
|
|
149
152
|
return /*#__PURE__*/_react.default.createElement(WrappedInlineCardWithAwareness, (0, _extends2.default)({
|
|
@@ -153,7 +156,8 @@ function InlineCardNodeView(props) {
|
|
|
153
156
|
actionOptions: actionOptions,
|
|
154
157
|
showServerActions: showServerActions,
|
|
155
158
|
useAlternativePreloader: useAlternativePreloader,
|
|
156
|
-
pluginInjectionApi: pluginInjectionApi
|
|
159
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
160
|
+
onClickCallback: onClickCallback
|
|
157
161
|
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards)));
|
|
158
162
|
}
|
|
159
163
|
var getAwarenessProps = function getAwarenessProps(editorState, getPos, allowEmbeds, allowBlockCards) {
|
|
@@ -27,7 +27,8 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
27
27
|
isPulseEnabled = _ref.isPulseEnabled,
|
|
28
28
|
pluginInjectionApi = _ref.pluginInjectionApi,
|
|
29
29
|
_ref$isSelected = _ref.isSelected,
|
|
30
|
-
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected
|
|
30
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
31
|
+
onClick = _ref.onClick;
|
|
31
32
|
var _node$attrs = node.attrs,
|
|
32
33
|
url = _node$attrs.url,
|
|
33
34
|
data = _node$attrs.data;
|
|
@@ -105,7 +106,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
105
106
|
url: url,
|
|
106
107
|
data: data,
|
|
107
108
|
appearance: "inline",
|
|
108
|
-
onClick:
|
|
109
|
+
onClick: onClick,
|
|
109
110
|
container: scrollContainer,
|
|
110
111
|
onResolve: onResolve,
|
|
111
112
|
onError: onError,
|
|
@@ -114,7 +115,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
114
115
|
showServerActions: showServerActions,
|
|
115
116
|
isHovered: isHovered
|
|
116
117
|
});
|
|
117
|
-
}, [data, isHovered, onError, onResolve, scrollContainer, url, useAlternativePreloader, actionOptions, showServerActions]);
|
|
118
|
+
}, [data, isHovered, onError, onResolve, scrollContainer, url, useAlternativePreloader, actionOptions, showServerActions, onClick]);
|
|
118
119
|
var card = (0, _react.useMemo)(function () {
|
|
119
120
|
return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/_react.default.createElement(_AwarenessWrapper.AwarenessWrapper, {
|
|
120
121
|
isOverlayEnabled: isOverlayEnabled,
|
|
@@ -59,7 +59,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
59
59
|
cardPluginEvents = options.cardPluginEvents,
|
|
60
60
|
showUpgradeDiscoverability = options.showUpgradeDiscoverability,
|
|
61
61
|
allowEmbeds = options.allowEmbeds,
|
|
62
|
-
allowBlockCards = options.allowBlockCards
|
|
62
|
+
allowBlockCards = options.allowBlockCards,
|
|
63
|
+
onClickCallback = options.onClickCallback;
|
|
63
64
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability && platform !== 'mobile';
|
|
64
65
|
var shouldUseUpgradeFeatures = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.inline-switcher') && enableInlineUpgradeFeatures;
|
|
65
66
|
var inlineCardViewProducer = (0, _reactNodeView.getInlineNodeViewProducer)({
|
|
@@ -72,7 +73,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
72
73
|
enableInlineUpgradeFeatures: enableInlineUpgradeFeatures,
|
|
73
74
|
allowEmbeds: allowEmbeds,
|
|
74
75
|
allowBlockCards: allowBlockCards,
|
|
75
|
-
pluginInjectionApi: pluginInjectionApi
|
|
76
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
77
|
+
onClickCallback: onClickCallback
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
80
|
return new _safePlugin.SafePlugin({
|
|
@@ -234,7 +236,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
234
236
|
var reactComponentProps = {
|
|
235
237
|
platform: platform,
|
|
236
238
|
actionOptions: actionOptions,
|
|
237
|
-
showServerActions: showServerActions
|
|
239
|
+
showServerActions: showServerActions,
|
|
240
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
241
|
+
onClickCallback: options.onClickCallback
|
|
238
242
|
};
|
|
239
243
|
var hasIntlContext = true;
|
|
240
244
|
var isDatasource = !!(node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.datasource);
|
|
@@ -272,7 +276,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
272
276
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
273
277
|
pluginInjectionApi: pluginInjectionApi,
|
|
274
278
|
actionOptions: actionOptions,
|
|
275
|
-
showServerActions: showServerActions
|
|
279
|
+
showServerActions: showServerActions,
|
|
280
|
+
onClickCallback: options.onClickCallback
|
|
276
281
|
};
|
|
277
282
|
var hasIntlContext = true;
|
|
278
283
|
return new _embedCard.EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
|
|
@@ -8,6 +8,8 @@ exports.mountHyperlinkPlugin = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
+
var _toolbar = require("../toolbar");
|
|
11
13
|
var _HyperlinkToolbarAppearance = require("../ui/HyperlinkToolbarAppearance");
|
|
12
14
|
var _ToolbarViewedEvent = require("../ui/ToolbarViewedEvent");
|
|
13
15
|
var getToolbarViewedItem = function getToolbarViewedItem(link) {
|
|
@@ -56,6 +58,25 @@ var mountHyperlinkPlugin = exports.mountHyperlinkPlugin = function mountHyperlin
|
|
|
56
58
|
view: editorView,
|
|
57
59
|
skipAnalytics: true
|
|
58
60
|
});
|
|
61
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button')) {
|
|
62
|
+
/**
|
|
63
|
+
* Require either provider to be supplied (controls link preferences)
|
|
64
|
+
* Or explicit user preferences config in order to enable button
|
|
65
|
+
*/
|
|
66
|
+
if (options.provider || options.userPreferencesLink) {
|
|
67
|
+
var _pluginInjectionApi$h2;
|
|
68
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$h2 = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h2 === void 0 || _pluginInjectionApi$h2.actions.addToolbarItems({
|
|
69
|
+
items: function items(_, intl) {
|
|
70
|
+
var _pluginInjectionApi$a2;
|
|
71
|
+
return [{
|
|
72
|
+
type: 'separator'
|
|
73
|
+
}, (0, _toolbar.getHyperlinkToolbarSettingsButton)(intl, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions, options.userPreferencesLink)];
|
|
74
|
+
},
|
|
75
|
+
placement: 'end',
|
|
76
|
+
view: editorView
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
59
80
|
});
|
|
60
81
|
return {};
|
|
61
82
|
}
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.visitCardLink = exports.shouldRenderToolbarPulse = exports.removeCard = exports.openLinkSettings = exports.floatingToolbar = void 0;
|
|
8
|
+
exports.visitCardLink = exports.shouldRenderToolbarPulse = exports.removeCard = exports.openLinkSettings = exports.getSettingsButtonGroup = exports.getSettingsButton = exports.getHyperlinkToolbarSettingsButton = exports.floatingToolbar = void 0;
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -83,12 +83,12 @@ var visitCardLink = exports.visitCardLink = function visitCardLink(editorAnalyti
|
|
|
83
83
|
return true;
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
var openLinkSettings = exports.openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
86
|
+
var openLinkSettings = exports.openLinkSettings = function openLinkSettings(editorAnalyticsApi, userPreferencesLink) {
|
|
87
87
|
return function (state, dispatch) {
|
|
88
88
|
if (!(state.selection instanceof _state.NodeSelection)) {
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
|
-
window.open((0, _link.getLinkPreferencesURLFromENV)());
|
|
91
|
+
window.open(userPreferencesLink || (0, _link.getLinkPreferencesURLFromENV)());
|
|
92
92
|
if (dispatch) {
|
|
93
93
|
var tr = state.tr,
|
|
94
94
|
type = state.selection.node.type;
|
|
@@ -255,7 +255,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
255
255
|
}, {
|
|
256
256
|
type: 'separator'
|
|
257
257
|
}]
|
|
258
|
-
}], (0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi)), [{
|
|
258
|
+
}], (0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions.userPreferencesLink)), [{
|
|
259
259
|
id: 'editor.link.delete',
|
|
260
260
|
focusEditoronEnter: true,
|
|
261
261
|
type: 'button',
|
|
@@ -355,14 +355,28 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
355
355
|
type: 'separator'
|
|
356
356
|
}] : [];
|
|
357
357
|
};
|
|
358
|
-
var
|
|
359
|
-
return
|
|
358
|
+
var getHyperlinkToolbarSettingsButton = exports.getHyperlinkToolbarSettingsButton = function getHyperlinkToolbarSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
359
|
+
return {
|
|
360
360
|
id: 'editor.link.settings',
|
|
361
361
|
type: 'button',
|
|
362
362
|
icon: _settings.default,
|
|
363
363
|
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
364
|
-
onClick: openLinkSettings(editorAnalyticsApi)
|
|
365
|
-
|
|
364
|
+
onClick: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined),
|
|
365
|
+
href: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button') ? userPreferencesLink || (0, _link.getLinkPreferencesURLFromENV)() : (0, _link.getLinkPreferencesURLFromENV)(),
|
|
366
|
+
target: '_blank'
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
var getSettingsButton = exports.getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
370
|
+
return {
|
|
371
|
+
id: 'editor.link.settings',
|
|
372
|
+
type: 'button',
|
|
373
|
+
icon: _settings.default,
|
|
374
|
+
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
375
|
+
onClick: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined)
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
var getSettingsButtonGroup = exports.getSettingsButtonGroup = function getSettingsButtonGroup(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
379
|
+
return [getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink), {
|
|
366
380
|
type: 'separator'
|
|
367
381
|
}];
|
|
368
382
|
};
|
|
@@ -458,7 +472,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
458
472
|
}, {
|
|
459
473
|
type: 'separator'
|
|
460
474
|
}]
|
|
461
|
-
}].concat((0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi)), [{
|
|
475
|
+
}].concat((0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.userPreferencesLink)), [{
|
|
462
476
|
id: 'editor.link.delete',
|
|
463
477
|
focusEditoronEnter: true,
|
|
464
478
|
type: 'button',
|
|
@@ -13,7 +13,6 @@ import { Card } from './genericCard';
|
|
|
13
13
|
export class BlockCardComponent extends React.PureComponent {
|
|
14
14
|
constructor(...args) {
|
|
15
15
|
super(...args);
|
|
16
|
-
_defineProperty(this, "onClick", () => {});
|
|
17
16
|
_defineProperty(this, "onResolve", data => {
|
|
18
17
|
const {
|
|
19
18
|
getPos,
|
|
@@ -75,7 +74,8 @@ export class BlockCardComponent extends React.PureComponent {
|
|
|
75
74
|
cardContext,
|
|
76
75
|
platform,
|
|
77
76
|
actionOptions,
|
|
78
|
-
showServerActions
|
|
77
|
+
showServerActions,
|
|
78
|
+
onClick
|
|
79
79
|
} = this.props;
|
|
80
80
|
const {
|
|
81
81
|
url,
|
|
@@ -87,7 +87,7 @@ export class BlockCardComponent extends React.PureComponent {
|
|
|
87
87
|
data: data,
|
|
88
88
|
container: this.scrollContainer,
|
|
89
89
|
appearance: "block",
|
|
90
|
-
onClick:
|
|
90
|
+
onClick: onClick,
|
|
91
91
|
onResolve: this.onResolve,
|
|
92
92
|
onError: this.onError,
|
|
93
93
|
platform: platform,
|
|
@@ -135,7 +135,9 @@ export class BlockCard extends ReactNodeView {
|
|
|
135
135
|
const {
|
|
136
136
|
platform,
|
|
137
137
|
actionOptions,
|
|
138
|
-
showServerActions
|
|
138
|
+
showServerActions,
|
|
139
|
+
pluginInjectionApi,
|
|
140
|
+
onClickCallback
|
|
139
141
|
} = this.reactComponentProps;
|
|
140
142
|
return /*#__PURE__*/React.createElement(WrappedBlockCard, {
|
|
141
143
|
node: this.node,
|
|
@@ -143,7 +145,9 @@ export class BlockCard extends ReactNodeView {
|
|
|
143
145
|
getPos: this.getPos,
|
|
144
146
|
platform: platform,
|
|
145
147
|
actionOptions: actionOptions,
|
|
146
|
-
showServerActions: showServerActions
|
|
148
|
+
showServerActions: showServerActions,
|
|
149
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
150
|
+
onClickCallback: onClickCallback
|
|
147
151
|
});
|
|
148
152
|
}
|
|
149
153
|
}
|
|
@@ -88,7 +88,6 @@ export class EmbedCardComponent extends React.PureComponent {
|
|
|
88
88
|
constructor(...args) {
|
|
89
89
|
super(...args);
|
|
90
90
|
_defineProperty(this, "embedIframeRef", /*#__PURE__*/React.createRef());
|
|
91
|
-
_defineProperty(this, "onClick", () => {});
|
|
92
91
|
_defineProperty(this, "state", {
|
|
93
92
|
hasPreview: true
|
|
94
93
|
});
|
|
@@ -258,7 +257,8 @@ export class EmbedCardComponent extends React.PureComponent {
|
|
|
258
257
|
getPos,
|
|
259
258
|
pluginInjectionApi,
|
|
260
259
|
actionOptions,
|
|
261
|
-
showServerActions
|
|
260
|
+
showServerActions,
|
|
261
|
+
onClick
|
|
262
262
|
} = this.props;
|
|
263
263
|
let {
|
|
264
264
|
url,
|
|
@@ -292,7 +292,7 @@ export class EmbedCardComponent extends React.PureComponent {
|
|
|
292
292
|
key: url,
|
|
293
293
|
url: url,
|
|
294
294
|
appearance: "embed",
|
|
295
|
-
onClick:
|
|
295
|
+
onClick: onClick,
|
|
296
296
|
onResolve: this.onResolve,
|
|
297
297
|
onError: this.onError,
|
|
298
298
|
frameStyle: "show",
|
|
@@ -364,7 +364,8 @@ export class EmbedCard extends ReactNodeView {
|
|
|
364
364
|
platform,
|
|
365
365
|
fullWidthMode,
|
|
366
366
|
dispatchAnalyticsEvent,
|
|
367
|
-
pluginInjectionApi
|
|
367
|
+
pluginInjectionApi,
|
|
368
|
+
onClickCallback
|
|
368
369
|
} = this.reactComponentProps;
|
|
369
370
|
return /*#__PURE__*/React.createElement(WrappedBlockCard, {
|
|
370
371
|
node: this.node,
|
|
@@ -375,7 +376,8 @@ export class EmbedCard extends ReactNodeView {
|
|
|
375
376
|
platform: platform,
|
|
376
377
|
fullWidthMode: fullWidthMode,
|
|
377
378
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
378
|
-
pluginInjectionApi: pluginInjectionApi
|
|
379
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
380
|
+
onClickCallback: onClickCallback
|
|
379
381
|
});
|
|
380
382
|
}
|
|
381
383
|
}
|
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
6
6
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
7
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
7
8
|
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
|
|
9
11
|
import { getPluginState } from '../pm-plugins/util/state';
|
|
10
12
|
import { titleUrlPairFromNode } from '../utils';
|
|
13
|
+
const WithClickHandler = ({
|
|
14
|
+
pluginInjectionApi,
|
|
15
|
+
url,
|
|
16
|
+
onClickCallback,
|
|
17
|
+
children
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
editorViewModeState
|
|
21
|
+
} = useSharedPluginState(pluginInjectionApi, ['editorViewMode']);
|
|
22
|
+
const onClick = useCallback(event => {
|
|
23
|
+
if (typeof onClickCallback === 'function') {
|
|
24
|
+
try {
|
|
25
|
+
onClickCallback({
|
|
26
|
+
event,
|
|
27
|
+
url
|
|
28
|
+
});
|
|
29
|
+
} catch {}
|
|
30
|
+
}
|
|
31
|
+
}, [url, onClickCallback]);
|
|
32
|
+
|
|
33
|
+
// Setting `onClick` to `undefined` ensures clicks on smartcards navigate to the URL.
|
|
34
|
+
// If in view mode and not overriding with onClickCallback option, then allow smartlinks to navigate on click.
|
|
35
|
+
const allowNavigation = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' && !onClickCallback;
|
|
36
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children({
|
|
37
|
+
onClick: allowNavigation ? undefined : onClick
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
11
40
|
export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
12
41
|
var _class;
|
|
13
42
|
return _class = class extends React.Component {
|
|
@@ -16,9 +45,14 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
16
45
|
_defineProperty(this, "state", {
|
|
17
46
|
isError: false
|
|
18
47
|
});
|
|
48
|
+
_defineProperty(this, "onClick", () => {});
|
|
19
49
|
}
|
|
20
50
|
render() {
|
|
21
51
|
var _getPluginState;
|
|
52
|
+
const {
|
|
53
|
+
pluginInjectionApi,
|
|
54
|
+
onClickCallback
|
|
55
|
+
} = this.props;
|
|
22
56
|
const {
|
|
23
57
|
url
|
|
24
58
|
} = titleUrlPairFromNode(this.props.node);
|
|
@@ -48,10 +82,23 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
48
82
|
// Below is added for the future implementation of Linking Platform namespaced analytics context
|
|
49
83
|
location: analyticsEditorAppearance
|
|
50
84
|
}
|
|
51
|
-
}, /*#__PURE__*/React.createElement(
|
|
85
|
+
}, getBooleanFF('platform.linking-platform.smart-card.on-click-callback') ? /*#__PURE__*/React.createElement(WithClickHandler, {
|
|
86
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
87
|
+
onClickCallback: onClickCallback,
|
|
88
|
+
url: url
|
|
89
|
+
}, ({
|
|
90
|
+
onClick
|
|
91
|
+
}) => /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
92
|
+
key: url,
|
|
93
|
+
cardContext: cardContext
|
|
94
|
+
}, this.props, {
|
|
95
|
+
onClick: onClick
|
|
96
|
+
}))) : /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
52
97
|
key: url,
|
|
53
98
|
cardContext: cardContext
|
|
54
|
-
}, this.props
|
|
99
|
+
}, this.props, {
|
|
100
|
+
onClick: this.onClick
|
|
101
|
+
})));
|
|
55
102
|
}
|
|
56
103
|
componentDidCatch(error) {
|
|
57
104
|
const maybeAPIError = error;
|