@atlaskit/editor-plugin-card 7.6.0 → 7.7.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 +21 -0
- package/dist/cjs/nodeviews/blockCard.js +3 -0
- package/dist/cjs/nodeviews/embedCard.js +4 -4
- package/dist/cjs/nodeviews/inlineCard.js +1 -1
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +9 -4
- package/dist/cjs/ui/AwarenessWrapper/index.js +1 -2
- package/dist/cjs/ui/toolbar.js +3 -1
- package/dist/es2019/nodeviews/blockCard.js +3 -0
- package/dist/es2019/nodeviews/embedCard.js +4 -4
- package/dist/es2019/nodeviews/inlineCard.js +1 -1
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +9 -4
- package/dist/es2019/ui/AwarenessWrapper/index.js +1 -2
- package/dist/es2019/ui/toolbar.js +3 -1
- package/dist/esm/nodeviews/blockCard.js +3 -0
- package/dist/esm/nodeviews/embedCard.js +4 -4
- package/dist/esm/nodeviews/inlineCard.js +1 -1
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +9 -4
- package/dist/esm/ui/AwarenessWrapper/index.js +1 -2
- package/dist/esm/ui/toolbar.js +3 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 7.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bfec478c9e91b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bfec478c9e91b) -
|
|
8
|
+
Splits platform_editor_preview_panel_linking_exp into one for Jira and one for Confluence and
|
|
9
|
+
switches to editorExperiment util.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 7.7.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`f1c44645de4a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1c44645de4a1) -
|
|
17
|
+
[https://product-fabric.atlassian.net/browse/ED-29133](ED-29133) - editor smart cards hydration
|
|
18
|
+
was improved
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 7.6.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -90,6 +90,9 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
_this.scrollContainer = (0, _ui.findOverflowScrollParent)(props.view.dom) || undefined;
|
|
93
|
+
_this.state = {
|
|
94
|
+
isSSRDataAvailable: (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
95
|
+
};
|
|
93
96
|
return _this;
|
|
94
97
|
}
|
|
95
98
|
(0, _inherits2.default)(BlockCardComponent, _React$PureComponent);
|
|
@@ -141,10 +141,6 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
|
|
|
141
141
|
// Ignored via go/ees005
|
|
142
142
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
143
143
|
(0, _defineProperty2.default)(_this, "embedIframeRef", /*#__PURE__*/_react.default.createRef());
|
|
144
|
-
(0, _defineProperty2.default)(_this, "state", {
|
|
145
|
-
hasPreview: true,
|
|
146
|
-
isSSRDataAvailable: false
|
|
147
|
-
});
|
|
148
144
|
(0, _defineProperty2.default)(_this, "getPosSafely", function () {
|
|
149
145
|
var getPos = _this.props.getPos;
|
|
150
146
|
if (!getPos || typeof getPos === 'boolean') {
|
|
@@ -282,6 +278,10 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
|
|
|
282
278
|
});
|
|
283
279
|
(0, _defineProperty2.default)(_this, "removeCardDispatched", false);
|
|
284
280
|
_this.scrollContainer = (0, _ui.findOverflowScrollParent)(props.view.dom) || undefined;
|
|
281
|
+
_this.state = {
|
|
282
|
+
hasPreview: true,
|
|
283
|
+
isSSRDataAvailable: (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
284
|
+
};
|
|
285
285
|
return _this;
|
|
286
286
|
}
|
|
287
287
|
(0, _inherits2.default)(EmbedCardComponent, _React$PureComponent);
|
|
@@ -60,7 +60,7 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
|
|
|
60
60
|
view.dispatch(tr);
|
|
61
61
|
};
|
|
62
62
|
}, [getPos, view]);
|
|
63
|
-
var _useState = (0, _react.useState)(
|
|
63
|
+
var _useState = (0, _react.useState)((0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed),
|
|
64
64
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
65
65
|
isSSRDataAvailable = _useState2[0],
|
|
66
66
|
setIsSSRDataAvailable = _useState2[1];
|
|
@@ -12,7 +12,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
12
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _smartCard = require("@atlaskit/smart-card");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
16
|
var _actions = require("../pm-plugins/actions");
|
|
18
17
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
@@ -97,7 +96,9 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
97
96
|
selection = _useSharedState.selection;
|
|
98
97
|
var floatingToolbarNode = selection instanceof _state.NodeSelection && selection.node;
|
|
99
98
|
// This is a prop to show Hover card, Hover card should be shown only in Live View and Classic Renderer (note when only Editor controls enabled we don't show in Live view)
|
|
100
|
-
var showHoverPreview = floatingToolbarNode !== node && (0,
|
|
99
|
+
var showHoverPreview = floatingToolbarNode !== node && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
100
|
+
exposure: true
|
|
101
|
+
});
|
|
101
102
|
var innerCardWithOpenButtonOverlay = (0, _react.useMemo)(function () {
|
|
102
103
|
var _pluginInjectionApi$a;
|
|
103
104
|
return /*#__PURE__*/_react.default.createElement(_ui.HoverLinkOverlay, {
|
|
@@ -141,10 +142,14 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
141
142
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, provider, pluginInjectionApi]);
|
|
142
143
|
var shouldShowOpenButtonOverlay = (0, _react.useMemo)(function () {
|
|
143
144
|
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
144
|
-
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || (0,
|
|
145
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
146
|
+
exposure: true
|
|
147
|
+
}));
|
|
145
148
|
}, [mode, editorAppearance]);
|
|
146
149
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
147
|
-
if (mode === 'view' && (0,
|
|
150
|
+
if (mode === 'view' && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
151
|
+
exposure: true
|
|
152
|
+
})) {
|
|
148
153
|
var _cardContext$value;
|
|
149
154
|
var url = node.attrs.url;
|
|
150
155
|
var cardState = cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 || (_cardContext$value = _cardContext$value.store) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.getState()[url];
|
|
@@ -9,7 +9,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
13
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var _utils = require("../../pm-plugins/utils");
|
|
15
14
|
var _useLinkUpgradeDiscoverability = _interopRequireDefault(require("../hooks/useLinkUpgradeDiscoverability"));
|
|
@@ -86,7 +85,7 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
|
|
|
86
85
|
setOverlayHoveredStyles(isHovered);
|
|
87
86
|
}, [setOverlayHoveredStyles]);
|
|
88
87
|
var cardWithOverlay = (0, _react.useMemo)(function () {
|
|
89
|
-
if (shouldShowLinkOverlay && !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && !(0,
|
|
88
|
+
if (shouldShowLinkOverlay && !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && !(0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true)) {
|
|
90
89
|
return (0, _react2.jsx)(_InlineCardOverlay.default, {
|
|
91
90
|
isSelected: isSelected,
|
|
92
91
|
isVisible: isResolvedViewRendered && (isInserted || isHovered || isSelected),
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -331,7 +331,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
331
331
|
testId: 'link-toolbar-edit-link-button',
|
|
332
332
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
333
333
|
}];
|
|
334
|
-
var openPreviewPanelItems = (0,
|
|
334
|
+
var openPreviewPanelItems = (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
335
|
+
exposure: true
|
|
336
|
+
}) ? [{
|
|
335
337
|
type: 'custom',
|
|
336
338
|
fallback: [],
|
|
337
339
|
render: function render() {
|
|
@@ -72,6 +72,9 @@ export class BlockCardComponent extends React.PureComponent {
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
|
|
75
|
+
this.state = {
|
|
76
|
+
isSSRDataAvailable: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
77
|
+
};
|
|
75
78
|
}
|
|
76
79
|
componentDidMount() {
|
|
77
80
|
if (!expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
@@ -122,10 +122,6 @@ export class EmbedCardComponent extends React.PureComponent {
|
|
|
122
122
|
// Ignored via go/ees005
|
|
123
123
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
124
124
|
_defineProperty(this, "embedIframeRef", /*#__PURE__*/React.createRef());
|
|
125
|
-
_defineProperty(this, "state", {
|
|
126
|
-
hasPreview: true,
|
|
127
|
-
isSSRDataAvailable: false
|
|
128
|
-
});
|
|
129
125
|
_defineProperty(this, "getPosSafely", () => {
|
|
130
126
|
const {
|
|
131
127
|
getPos
|
|
@@ -275,6 +271,10 @@ export class EmbedCardComponent extends React.PureComponent {
|
|
|
275
271
|
});
|
|
276
272
|
_defineProperty(this, "removeCardDispatched", false);
|
|
277
273
|
this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
|
|
274
|
+
this.state = {
|
|
275
|
+
hasPreview: true,
|
|
276
|
+
isSSRDataAvailable: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
277
|
+
};
|
|
278
278
|
}
|
|
279
279
|
componentDidMount() {
|
|
280
280
|
if (!expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
@@ -50,7 +50,7 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
50
50
|
view.dispatch(tr);
|
|
51
51
|
};
|
|
52
52
|
}, [getPos, view]);
|
|
53
|
-
const [isSSRDataAvailable, setIsSSRDataAvailable] = useState(
|
|
53
|
+
const [isSSRDataAvailable, setIsSSRDataAvailable] = useState(expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed);
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
if (!expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
56
56
|
return;
|
|
@@ -3,7 +3,6 @@ import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPl
|
|
|
3
3
|
import { HoverLinkOverlay } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { getObjectAri, getObjectName, getObjectIconUrl } from '@atlaskit/smart-card';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { registerRemoveOverlay } from '../pm-plugins/actions';
|
|
9
8
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -77,7 +76,9 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
77
76
|
} = useSharedState(pluginInjectionApi);
|
|
78
77
|
const floatingToolbarNode = selection instanceof NodeSelection && selection.node;
|
|
79
78
|
// This is a prop to show Hover card, Hover card should be shown only in Live View and Classic Renderer (note when only Editor controls enabled we don't show in Live view)
|
|
80
|
-
const showHoverPreview = floatingToolbarNode !== node &&
|
|
79
|
+
const showHoverPreview = floatingToolbarNode !== node && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
80
|
+
exposure: true
|
|
81
|
+
});
|
|
81
82
|
const innerCardWithOpenButtonOverlay = useMemo(() => {
|
|
82
83
|
var _pluginInjectionApi$a;
|
|
83
84
|
return /*#__PURE__*/React.createElement(HoverLinkOverlay, {
|
|
@@ -119,10 +120,14 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
119
120
|
}), [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, provider, pluginInjectionApi]);
|
|
120
121
|
const shouldShowOpenButtonOverlay = useMemo(() => {
|
|
121
122
|
const shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
122
|
-
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') ||
|
|
123
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') || editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
124
|
+
exposure: true
|
|
125
|
+
}));
|
|
123
126
|
}, [mode, editorAppearance]);
|
|
124
127
|
let innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
125
|
-
if (mode === 'view' &&
|
|
128
|
+
if (mode === 'view' && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
129
|
+
exposure: true
|
|
130
|
+
})) {
|
|
126
131
|
var _cardContext$value, _cardContext$value$st;
|
|
127
132
|
const url = node.attrs.url;
|
|
128
133
|
const cardState = cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : (_cardContext$value$st = _cardContext$value.store) === null || _cardContext$value$st === void 0 ? void 0 : _cardContext$value$st.getState()[url];
|
|
@@ -7,7 +7,6 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
10
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
11
|
import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
|
|
13
12
|
import useLinkUpgradeDiscoverability from '../hooks/useLinkUpgradeDiscoverability';
|
|
@@ -76,7 +75,7 @@ export const AwarenessWrapper = ({
|
|
|
76
75
|
setOverlayHoveredStyles(isHovered);
|
|
77
76
|
}, [setOverlayHoveredStyles]);
|
|
78
77
|
const cardWithOverlay = useMemo(() => {
|
|
79
|
-
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !
|
|
78
|
+
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !editorExperiment('platform_editor_preview_panel_linking_exp', true)) {
|
|
80
79
|
return jsx(InlineCardOverlay, {
|
|
81
80
|
isSelected: isSelected,
|
|
82
81
|
isVisible: isResolvedViewRendered && (isInserted || isHovered || isSelected),
|
|
@@ -321,7 +321,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
321
321
|
testId: 'link-toolbar-edit-link-button',
|
|
322
322
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
323
323
|
}];
|
|
324
|
-
const openPreviewPanelItems =
|
|
324
|
+
const openPreviewPanelItems = editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
325
|
+
exposure: true
|
|
326
|
+
}) ? [{
|
|
325
327
|
type: 'custom',
|
|
326
328
|
fallback: [],
|
|
327
329
|
render: () => /*#__PURE__*/React.createElement(OpenPreviewPanelToolbarButton, {
|
|
@@ -83,6 +83,9 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
_this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
|
|
86
|
+
_this.state = {
|
|
87
|
+
isSSRDataAvailable: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
88
|
+
};
|
|
86
89
|
return _this;
|
|
87
90
|
}
|
|
88
91
|
_inherits(BlockCardComponent, _React$PureComponent);
|
|
@@ -134,10 +134,6 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
134
134
|
// Ignored via go/ees005
|
|
135
135
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
136
136
|
_defineProperty(_this, "embedIframeRef", /*#__PURE__*/React.createRef());
|
|
137
|
-
_defineProperty(_this, "state", {
|
|
138
|
-
hasPreview: true,
|
|
139
|
-
isSSRDataAvailable: false
|
|
140
|
-
});
|
|
141
137
|
_defineProperty(_this, "getPosSafely", function () {
|
|
142
138
|
var getPos = _this.props.getPos;
|
|
143
139
|
if (!getPos || typeof getPos === 'boolean') {
|
|
@@ -275,6 +271,10 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
275
271
|
});
|
|
276
272
|
_defineProperty(_this, "removeCardDispatched", false);
|
|
277
273
|
_this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
|
|
274
|
+
_this.state = {
|
|
275
|
+
hasPreview: true,
|
|
276
|
+
isSSRDataAvailable: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
277
|
+
};
|
|
278
278
|
return _this;
|
|
279
279
|
}
|
|
280
280
|
_inherits(EmbedCardComponent, _React$PureComponent);
|
|
@@ -49,7 +49,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
49
49
|
view.dispatch(tr);
|
|
50
50
|
};
|
|
51
51
|
}, [getPos, view]);
|
|
52
|
-
var _useState = useState(
|
|
52
|
+
var _useState = useState(expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed),
|
|
53
53
|
_useState2 = _slicedToArray(_useState, 2),
|
|
54
54
|
isSSRDataAvailable = _useState2[0],
|
|
55
55
|
setIsSSRDataAvailable = _useState2[1];
|
|
@@ -4,7 +4,6 @@ import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPl
|
|
|
4
4
|
import { HoverLinkOverlay } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { getObjectAri, getObjectName, getObjectIconUrl } from '@atlaskit/smart-card';
|
|
7
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
8
|
import { registerRemoveOverlay } from '../pm-plugins/actions';
|
|
10
9
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -88,7 +87,9 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
88
87
|
selection = _useSharedState.selection;
|
|
89
88
|
var floatingToolbarNode = selection instanceof NodeSelection && selection.node;
|
|
90
89
|
// This is a prop to show Hover card, Hover card should be shown only in Live View and Classic Renderer (note when only Editor controls enabled we don't show in Live view)
|
|
91
|
-
var showHoverPreview = floatingToolbarNode !== node &&
|
|
90
|
+
var showHoverPreview = floatingToolbarNode !== node && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
91
|
+
exposure: true
|
|
92
|
+
});
|
|
92
93
|
var innerCardWithOpenButtonOverlay = useMemo(function () {
|
|
93
94
|
var _pluginInjectionApi$a;
|
|
94
95
|
return /*#__PURE__*/React.createElement(HoverLinkOverlay, {
|
|
@@ -132,10 +133,14 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
132
133
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, provider, pluginInjectionApi]);
|
|
133
134
|
var shouldShowOpenButtonOverlay = useMemo(function () {
|
|
134
135
|
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
135
|
-
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') ||
|
|
136
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') || editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
137
|
+
exposure: true
|
|
138
|
+
}));
|
|
136
139
|
}, [mode, editorAppearance]);
|
|
137
140
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
138
|
-
if (mode === 'view' &&
|
|
141
|
+
if (mode === 'view' && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
142
|
+
exposure: true
|
|
143
|
+
})) {
|
|
139
144
|
var _cardContext$value;
|
|
140
145
|
var url = node.attrs.url;
|
|
141
146
|
var cardState = cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 || (_cardContext$value = _cardContext$value.store) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.getState()[url];
|
|
@@ -8,7 +8,6 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
11
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
12
|
import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
|
|
14
13
|
import useLinkUpgradeDiscoverability from '../hooks/useLinkUpgradeDiscoverability';
|
|
@@ -78,7 +77,7 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
|
|
|
78
77
|
setOverlayHoveredStyles(isHovered);
|
|
79
78
|
}, [setOverlayHoveredStyles]);
|
|
80
79
|
var cardWithOverlay = useMemo(function () {
|
|
81
|
-
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !
|
|
80
|
+
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !editorExperiment('platform_editor_preview_panel_linking_exp', true)) {
|
|
82
81
|
return jsx(InlineCardOverlay, {
|
|
83
82
|
isSelected: isSelected,
|
|
84
83
|
isVisible: isResolvedViewRendered && (isInserted || isHovered || isSelected),
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -322,7 +322,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
322
322
|
testId: 'link-toolbar-edit-link-button',
|
|
323
323
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
324
324
|
}];
|
|
325
|
-
var openPreviewPanelItems =
|
|
325
|
+
var openPreviewPanelItems = editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
326
|
+
exposure: true
|
|
327
|
+
}) ? [{
|
|
326
328
|
type: 'custom',
|
|
327
329
|
fallback: [],
|
|
328
330
|
render: function render() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.1",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
59
59
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
60
60
|
"@atlaskit/primitives": "^14.12.0",
|
|
61
|
-
"@atlaskit/smart-card": "^40.
|
|
61
|
+
"@atlaskit/smart-card": "^40.15.0",
|
|
62
62
|
"@atlaskit/theme": "^20.0.0",
|
|
63
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
63
|
+
"@atlaskit/tmp-editor-statsig": "^11.10.0",
|
|
64
64
|
"@atlaskit/tokens": "^6.1.0",
|
|
65
65
|
"@babel/runtime": "^7.0.0",
|
|
66
66
|
"@emotion/react": "^11.7.1",
|