@atlaskit/editor-plugin-card 2.6.3 → 2.6.4
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 +8 -0
- package/dist/cjs/nodeviews/genericCard.js +5 -3
- package/dist/cjs/nodeviews/inlineCard.js +15 -10
- package/dist/cjs/pm-plugins/main.js +9 -6
- package/dist/es2019/nodeviews/genericCard.js +5 -3
- package/dist/es2019/nodeviews/inlineCard.js +16 -10
- package/dist/es2019/pm-plugins/main.js +10 -5
- package/dist/esm/nodeviews/genericCard.js +5 -3
- package/dist/esm/nodeviews/inlineCard.js +15 -10
- package/dist/esm/pm-plugins/main.js +9 -6
- package/dist/types/nodeviews/genericCard.d.ts +1 -0
- package/dist/types/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 2.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122063](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122063)
|
|
8
|
+
[`c136e556d086d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c136e556d086d) -
|
|
9
|
+
[ux] Apply live page and check for live view in card and hyperlink plugin
|
|
10
|
+
|
|
3
11
|
## 2.6.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -32,7 +32,8 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
32
32
|
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
33
33
|
url = _ref.url,
|
|
34
34
|
onClickCallback = _ref.onClickCallback,
|
|
35
|
-
children = _ref.children
|
|
35
|
+
children = _ref.children,
|
|
36
|
+
__livePage = _ref.__livePage;
|
|
36
37
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['editorViewMode']),
|
|
37
38
|
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
38
39
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
@@ -53,7 +54,7 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
53
54
|
*
|
|
54
55
|
* const allowNavigation = isLivePage && !onClickCallback;
|
|
55
56
|
*/
|
|
56
|
-
var _allowNavigation = !onClickCallback;
|
|
57
|
+
var _allowNavigation = __livePage && !onClickCallback;
|
|
57
58
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children({
|
|
58
59
|
onClick: _allowNavigation ? undefined : onClick
|
|
59
60
|
}));
|
|
@@ -122,7 +123,8 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
122
123
|
}, /*#__PURE__*/_react.default.createElement(WithClickHandler, {
|
|
123
124
|
pluginInjectionApi: pluginInjectionApi,
|
|
124
125
|
onClickCallback: onClickCallback,
|
|
125
|
-
url: url
|
|
126
|
+
url: url,
|
|
127
|
+
__livePage: this.props.__livePage
|
|
126
128
|
}, function (_ref2) {
|
|
127
129
|
var onClick = _ref2.onClick;
|
|
128
130
|
return /*#__PURE__*/_react.default.createElement(SmartCardComponent, (0, _extends2.default)({
|
|
@@ -103,7 +103,7 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
|
|
|
103
103
|
var WrappedInlineCardWithAwareness = (0, _genericCard.Card)(_inlineCardWithAwareness.InlineCardWithAwareness, _ui.UnsupportedInline);
|
|
104
104
|
var WrappedInlineCard = (0, _genericCard.Card)(InlineCard, _ui.UnsupportedInline);
|
|
105
105
|
function InlineCardNodeView(props) {
|
|
106
|
-
var
|
|
106
|
+
var _floatingToolbarState;
|
|
107
107
|
var useAlternativePreloader = props.useAlternativePreloader,
|
|
108
108
|
node = props.node,
|
|
109
109
|
view = props.view,
|
|
@@ -114,20 +114,20 @@ function InlineCardNodeView(props) {
|
|
|
114
114
|
allowBlockCards = props.allowBlockCards,
|
|
115
115
|
enableInlineUpgradeFeatures = props.enableInlineUpgradeFeatures,
|
|
116
116
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
117
|
-
onClickCallback = props.onClickCallback
|
|
117
|
+
onClickCallback = props.onClickCallback,
|
|
118
|
+
__livePage = props.__livePage;
|
|
118
119
|
var _useState = (0, _react.useState)(false),
|
|
119
120
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
120
121
|
isOverlayHovered = _useState2[0],
|
|
121
122
|
setIsOverlayHovered = _useState2[1];
|
|
122
|
-
var
|
|
123
|
-
|
|
123
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['floatingToolbar', 'editorViewMode']),
|
|
124
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
125
|
+
floatingToolbarState = _useSharedPluginState.floatingToolbarState;
|
|
126
|
+
var floatingToolbarNode = floatingToolbarState === null || floatingToolbarState === void 0 || (_floatingToolbarState = floatingToolbarState.configWithNodeInfo) === null || _floatingToolbarState === void 0 ? void 0 : _floatingToolbarState.node;
|
|
127
|
+
if (__livePage && (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages')) {
|
|
124
128
|
var showHoverPreview = floatingToolbarNode !== node;
|
|
125
129
|
var livePagesHoverCardFadeInDelay = 800;
|
|
126
|
-
|
|
127
|
-
targetElementPos: getPos(),
|
|
128
|
-
view: view,
|
|
129
|
-
isHoveredCallback: setIsOverlayHovered
|
|
130
|
-
}, /*#__PURE__*/_react.default.createElement(WrappedInlineCard, {
|
|
130
|
+
var inlineCard = /*#__PURE__*/_react.default.createElement(WrappedInlineCard, {
|
|
131
131
|
isHovered: isOverlayHovered,
|
|
132
132
|
node: node,
|
|
133
133
|
view: view,
|
|
@@ -140,7 +140,12 @@ function InlineCardNodeView(props) {
|
|
|
140
140
|
hoverPreviewOptions: {
|
|
141
141
|
fadeInDelay: livePagesHoverCardFadeInDelay
|
|
142
142
|
}
|
|
143
|
-
})
|
|
143
|
+
});
|
|
144
|
+
return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/_react.default.createElement(_ConfigureOverlay.default, {
|
|
145
|
+
targetElementPos: getPos(),
|
|
146
|
+
view: view,
|
|
147
|
+
isHoveredCallback: setIsOverlayHovered
|
|
148
|
+
}, inlineCard);
|
|
144
149
|
}
|
|
145
150
|
return /*#__PURE__*/_react.default.createElement(WrappedInlineCardWithAwareness, (0, _extends2.default)({
|
|
146
151
|
node: node,
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "pluginKey", {
|
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
exports.stopEvent = void 0;
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
15
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
18
18
|
var _reactNodeView = require("@atlaskit/editor-common/react-node-view");
|
|
19
19
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
@@ -76,9 +76,10 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
76
76
|
showUpgradeDiscoverability = options.showUpgradeDiscoverability,
|
|
77
77
|
allowEmbeds = options.allowEmbeds,
|
|
78
78
|
allowBlockCards = options.allowBlockCards,
|
|
79
|
-
onClickCallback = options.onClickCallback
|
|
79
|
+
onClickCallback = options.onClickCallback,
|
|
80
|
+
__livePage = options.__livePage;
|
|
80
81
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability && platform !== 'mobile';
|
|
81
|
-
var inlineCardViewProducer = (0, _reactNodeView.getInlineNodeViewProducer)({
|
|
82
|
+
var inlineCardViewProducer = (0, _reactNodeView.getInlineNodeViewProducer)(_objectSpread({
|
|
82
83
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
83
84
|
Component: _inlineCard.InlineCardNodeView,
|
|
84
85
|
extraComponentProps: {
|
|
@@ -89,12 +90,14 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
89
90
|
allowEmbeds: allowEmbeds,
|
|
90
91
|
allowBlockCards: allowBlockCards,
|
|
91
92
|
pluginInjectionApi: pluginInjectionApi,
|
|
92
|
-
onClickCallback: onClickCallback
|
|
93
|
-
|
|
93
|
+
onClickCallback: onClickCallback,
|
|
94
|
+
__livePage: __livePage
|
|
95
|
+
}
|
|
96
|
+
}, __livePage && (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages') && {
|
|
94
97
|
extraNodeViewProps: {
|
|
95
98
|
stopEvent: stopEvent
|
|
96
99
|
}
|
|
97
|
-
});
|
|
100
|
+
}));
|
|
98
101
|
return new _safePlugin.SafePlugin({
|
|
99
102
|
state: {
|
|
100
103
|
init: function init() {
|
|
@@ -14,7 +14,8 @@ const WithClickHandler = ({
|
|
|
14
14
|
pluginInjectionApi,
|
|
15
15
|
url,
|
|
16
16
|
onClickCallback,
|
|
17
|
-
children
|
|
17
|
+
children,
|
|
18
|
+
__livePage
|
|
18
19
|
}) => {
|
|
19
20
|
const {
|
|
20
21
|
editorViewModeState
|
|
@@ -37,7 +38,7 @@ const WithClickHandler = ({
|
|
|
37
38
|
*
|
|
38
39
|
* const allowNavigation = isLivePage && !onClickCallback;
|
|
39
40
|
*/
|
|
40
|
-
const allowNavigation = !onClickCallback;
|
|
41
|
+
const allowNavigation = __livePage && !onClickCallback;
|
|
41
42
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children({
|
|
42
43
|
onClick: allowNavigation ? undefined : onClick
|
|
43
44
|
}));
|
|
@@ -97,7 +98,8 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
97
98
|
}, /*#__PURE__*/React.createElement(WithClickHandler, {
|
|
98
99
|
pluginInjectionApi: pluginInjectionApi,
|
|
99
100
|
onClickCallback: onClickCallback,
|
|
100
|
-
url: url
|
|
101
|
+
url: url,
|
|
102
|
+
__livePage: this.props.__livePage
|
|
101
103
|
}, ({
|
|
102
104
|
onClick
|
|
103
105
|
}) => /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
@@ -93,7 +93,7 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
93
93
|
const WrappedInlineCardWithAwareness = Card(InlineCardWithAwareness, UnsupportedInline);
|
|
94
94
|
const WrappedInlineCard = Card(InlineCard, UnsupportedInline);
|
|
95
95
|
export function InlineCardNodeView(props) {
|
|
96
|
-
var
|
|
96
|
+
var _floatingToolbarState;
|
|
97
97
|
const {
|
|
98
98
|
useAlternativePreloader,
|
|
99
99
|
node,
|
|
@@ -105,18 +105,19 @@ export function InlineCardNodeView(props) {
|
|
|
105
105
|
allowBlockCards,
|
|
106
106
|
enableInlineUpgradeFeatures,
|
|
107
107
|
pluginInjectionApi,
|
|
108
|
-
onClickCallback
|
|
108
|
+
onClickCallback,
|
|
109
|
+
__livePage
|
|
109
110
|
} = props;
|
|
110
111
|
const [isOverlayHovered, setIsOverlayHovered] = useState(false);
|
|
111
|
-
const
|
|
112
|
-
|
|
112
|
+
const {
|
|
113
|
+
editorViewModeState,
|
|
114
|
+
floatingToolbarState
|
|
115
|
+
} = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorViewMode']);
|
|
116
|
+
const floatingToolbarNode = floatingToolbarState === null || floatingToolbarState === void 0 ? void 0 : (_floatingToolbarState = floatingToolbarState.configWithNodeInfo) === null || _floatingToolbarState === void 0 ? void 0 : _floatingToolbarState.node;
|
|
117
|
+
if (__livePage && fg('platform.linking-platform.smart-links-in-live-pages')) {
|
|
113
118
|
const showHoverPreview = floatingToolbarNode !== node;
|
|
114
119
|
const livePagesHoverCardFadeInDelay = 800;
|
|
115
|
-
|
|
116
|
-
targetElementPos: getPos(),
|
|
117
|
-
view: view,
|
|
118
|
-
isHoveredCallback: setIsOverlayHovered
|
|
119
|
-
}, /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
120
|
+
const inlineCard = /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
120
121
|
isHovered: isOverlayHovered,
|
|
121
122
|
node: node,
|
|
122
123
|
view: view,
|
|
@@ -129,7 +130,12 @@ export function InlineCardNodeView(props) {
|
|
|
129
130
|
hoverPreviewOptions: {
|
|
130
131
|
fadeInDelay: livePagesHoverCardFadeInDelay
|
|
131
132
|
}
|
|
132
|
-
})
|
|
133
|
+
});
|
|
134
|
+
return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
135
|
+
targetElementPos: getPos(),
|
|
136
|
+
view: view,
|
|
137
|
+
isHoveredCallback: setIsOverlayHovered
|
|
138
|
+
}, inlineCard);
|
|
133
139
|
}
|
|
134
140
|
return /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
|
|
135
141
|
node: node,
|
|
@@ -59,7 +59,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
59
59
|
showUpgradeDiscoverability,
|
|
60
60
|
allowEmbeds,
|
|
61
61
|
allowBlockCards,
|
|
62
|
-
onClickCallback
|
|
62
|
+
onClickCallback,
|
|
63
|
+
// @ts-ignore Temporary solution to check for Live Page editor.
|
|
64
|
+
__livePage
|
|
63
65
|
} = options;
|
|
64
66
|
const enableInlineUpgradeFeatures = !!showUpgradeDiscoverability && platform !== 'mobile';
|
|
65
67
|
const inlineCardViewProducer = getInlineNodeViewProducer({
|
|
@@ -73,11 +75,14 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
73
75
|
allowEmbeds,
|
|
74
76
|
allowBlockCards,
|
|
75
77
|
pluginInjectionApi,
|
|
76
|
-
onClickCallback
|
|
78
|
+
onClickCallback,
|
|
79
|
+
__livePage
|
|
77
80
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
...(__livePage && fg('platform.linking-platform.smart-links-in-live-pages') && {
|
|
82
|
+
extraNodeViewProps: {
|
|
83
|
+
stopEvent
|
|
84
|
+
}
|
|
85
|
+
})
|
|
81
86
|
});
|
|
82
87
|
return new SafePlugin({
|
|
83
88
|
state: {
|
|
@@ -22,7 +22,8 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
22
22
|
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
23
23
|
url = _ref.url,
|
|
24
24
|
onClickCallback = _ref.onClickCallback,
|
|
25
|
-
children = _ref.children
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
__livePage = _ref.__livePage;
|
|
26
27
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['editorViewMode']),
|
|
27
28
|
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
28
29
|
var onClick = useCallback(function (event) {
|
|
@@ -43,7 +44,7 @@ var WithClickHandler = function WithClickHandler(_ref) {
|
|
|
43
44
|
*
|
|
44
45
|
* const allowNavigation = isLivePage && !onClickCallback;
|
|
45
46
|
*/
|
|
46
|
-
var _allowNavigation = !onClickCallback;
|
|
47
|
+
var _allowNavigation = __livePage && !onClickCallback;
|
|
47
48
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children({
|
|
48
49
|
onClick: _allowNavigation ? undefined : onClick
|
|
49
50
|
}));
|
|
@@ -112,7 +113,8 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
112
113
|
}, /*#__PURE__*/React.createElement(WithClickHandler, {
|
|
113
114
|
pluginInjectionApi: pluginInjectionApi,
|
|
114
115
|
onClickCallback: onClickCallback,
|
|
115
|
-
url: url
|
|
116
|
+
url: url,
|
|
117
|
+
__livePage: this.props.__livePage
|
|
116
118
|
}, function (_ref2) {
|
|
117
119
|
var onClick = _ref2.onClick;
|
|
118
120
|
return /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
@@ -92,7 +92,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
92
92
|
var WrappedInlineCardWithAwareness = Card(InlineCardWithAwareness, UnsupportedInline);
|
|
93
93
|
var WrappedInlineCard = Card(InlineCard, UnsupportedInline);
|
|
94
94
|
export function InlineCardNodeView(props) {
|
|
95
|
-
var
|
|
95
|
+
var _floatingToolbarState;
|
|
96
96
|
var useAlternativePreloader = props.useAlternativePreloader,
|
|
97
97
|
node = props.node,
|
|
98
98
|
view = props.view,
|
|
@@ -103,20 +103,20 @@ export function InlineCardNodeView(props) {
|
|
|
103
103
|
allowBlockCards = props.allowBlockCards,
|
|
104
104
|
enableInlineUpgradeFeatures = props.enableInlineUpgradeFeatures,
|
|
105
105
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
106
|
-
onClickCallback = props.onClickCallback
|
|
106
|
+
onClickCallback = props.onClickCallback,
|
|
107
|
+
__livePage = props.__livePage;
|
|
107
108
|
var _useState = useState(false),
|
|
108
109
|
_useState2 = _slicedToArray(_useState, 2),
|
|
109
110
|
isOverlayHovered = _useState2[0],
|
|
110
111
|
setIsOverlayHovered = _useState2[1];
|
|
111
|
-
var
|
|
112
|
-
|
|
112
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorViewMode']),
|
|
113
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
114
|
+
floatingToolbarState = _useSharedPluginState.floatingToolbarState;
|
|
115
|
+
var floatingToolbarNode = floatingToolbarState === null || floatingToolbarState === void 0 || (_floatingToolbarState = floatingToolbarState.configWithNodeInfo) === null || _floatingToolbarState === void 0 ? void 0 : _floatingToolbarState.node;
|
|
116
|
+
if (__livePage && fg('platform.linking-platform.smart-links-in-live-pages')) {
|
|
113
117
|
var showHoverPreview = floatingToolbarNode !== node;
|
|
114
118
|
var livePagesHoverCardFadeInDelay = 800;
|
|
115
|
-
|
|
116
|
-
targetElementPos: getPos(),
|
|
117
|
-
view: view,
|
|
118
|
-
isHoveredCallback: setIsOverlayHovered
|
|
119
|
-
}, /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
119
|
+
var inlineCard = /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
120
120
|
isHovered: isOverlayHovered,
|
|
121
121
|
node: node,
|
|
122
122
|
view: view,
|
|
@@ -129,7 +129,12 @@ export function InlineCardNodeView(props) {
|
|
|
129
129
|
hoverPreviewOptions: {
|
|
130
130
|
fadeInDelay: livePagesHoverCardFadeInDelay
|
|
131
131
|
}
|
|
132
|
-
})
|
|
132
|
+
});
|
|
133
|
+
return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
134
|
+
targetElementPos: getPos(),
|
|
135
|
+
view: view,
|
|
136
|
+
isHoveredCallback: setIsOverlayHovered
|
|
137
|
+
}, inlineCard);
|
|
133
138
|
}
|
|
134
139
|
return /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
|
|
135
140
|
node: node,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
import rafSchedule from 'raf-schd';
|
|
@@ -63,9 +63,10 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
63
63
|
showUpgradeDiscoverability = options.showUpgradeDiscoverability,
|
|
64
64
|
allowEmbeds = options.allowEmbeds,
|
|
65
65
|
allowBlockCards = options.allowBlockCards,
|
|
66
|
-
onClickCallback = options.onClickCallback
|
|
66
|
+
onClickCallback = options.onClickCallback,
|
|
67
|
+
__livePage = options.__livePage;
|
|
67
68
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability && platform !== 'mobile';
|
|
68
|
-
var inlineCardViewProducer = getInlineNodeViewProducer({
|
|
69
|
+
var inlineCardViewProducer = getInlineNodeViewProducer(_objectSpread({
|
|
69
70
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
70
71
|
Component: InlineCardNodeView,
|
|
71
72
|
extraComponentProps: {
|
|
@@ -76,12 +77,14 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
76
77
|
allowEmbeds: allowEmbeds,
|
|
77
78
|
allowBlockCards: allowBlockCards,
|
|
78
79
|
pluginInjectionApi: pluginInjectionApi,
|
|
79
|
-
onClickCallback: onClickCallback
|
|
80
|
-
|
|
80
|
+
onClickCallback: onClickCallback,
|
|
81
|
+
__livePage: __livePage
|
|
82
|
+
}
|
|
83
|
+
}, __livePage && fg('platform.linking-platform.smart-links-in-live-pages') && {
|
|
81
84
|
extraNodeViewProps: {
|
|
82
85
|
stopEvent: stopEvent
|
|
83
86
|
}
|
|
84
|
-
});
|
|
87
|
+
}));
|
|
85
88
|
return new SafePlugin({
|
|
86
89
|
state: {
|
|
87
90
|
init: function init() {
|
|
@@ -42,6 +42,7 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
42
42
|
onClickCallback?: OnClickCallback;
|
|
43
43
|
showHoverPreview?: BaseCardProps['showHoverPreview'];
|
|
44
44
|
hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
|
|
45
|
+
__livePage?: boolean;
|
|
45
46
|
}
|
|
46
47
|
export interface SmartCardProps extends CardProps {
|
|
47
48
|
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
@@ -3,5 +3,5 @@ import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react
|
|
|
3
3
|
import type { SmartCardProps } from './genericCard';
|
|
4
4
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
5
5
|
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, }: SmartCardProps) => JSX.Element | null>;
|
|
6
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
6
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage'>;
|
|
7
7
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): JSX.Element;
|
|
@@ -42,6 +42,7 @@ export interface CardProps extends CardNodeViewProps {
|
|
|
42
42
|
onClickCallback?: OnClickCallback;
|
|
43
43
|
showHoverPreview?: BaseCardProps['showHoverPreview'];
|
|
44
44
|
hoverPreviewOptions?: BaseCardProps['hoverPreviewOptions'];
|
|
45
|
+
__livePage?: boolean;
|
|
45
46
|
}
|
|
46
47
|
export interface SmartCardProps extends CardProps {
|
|
47
48
|
pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
|
|
@@ -3,5 +3,5 @@ import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react
|
|
|
3
3
|
import type { SmartCardProps } from './genericCard';
|
|
4
4
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
5
5
|
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, showServerActions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, }: SmartCardProps) => JSX.Element | null>;
|
|
6
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback'>;
|
|
6
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'showServerActions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage'>;
|
|
7
7
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/adf-schema": "^39.0.3",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
37
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
38
|
-
"@atlaskit/editor-common": "^86.
|
|
38
|
+
"@atlaskit/editor-common": "^86.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|