@atlaskit/editor-plugin-card 7.2.7 → 7.3.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 +20 -0
- package/dist/cjs/nodeviews/inlineCard.js +3 -1
- package/dist/cjs/nodeviews/lazy-block-card.js +3 -1
- package/dist/cjs/nodeviews/lazy-embed-card.js +3 -1
- package/dist/cjs/nodeviews/lazy-inline-card.js +2 -1
- package/dist/cjs/pm-plugins/main.js +2 -0
- package/dist/cjs/ui/OpenPreviewButton/index.js +78 -0
- package/dist/cjs/ui/toolbar.js +14 -2
- package/dist/es2019/nodeviews/inlineCard.js +3 -1
- package/dist/es2019/nodeviews/lazy-block-card.js +5 -1
- package/dist/es2019/nodeviews/lazy-embed-card.js +5 -1
- package/dist/es2019/nodeviews/lazy-inline-card.js +3 -1
- package/dist/es2019/pm-plugins/main.js +2 -0
- package/dist/es2019/ui/OpenPreviewButton/index.js +73 -0
- package/dist/es2019/ui/toolbar.js +12 -2
- package/dist/esm/nodeviews/inlineCard.js +3 -1
- package/dist/esm/nodeviews/lazy-block-card.js +3 -1
- package/dist/esm/nodeviews/lazy-embed-card.js +3 -1
- package/dist/esm/nodeviews/lazy-inline-card.js +2 -1
- package/dist/esm/pm-plugins/main.js +2 -0
- package/dist/esm/ui/OpenPreviewButton/index.js +71 -0
- package/dist/esm/ui/toolbar.js +14 -2
- package/dist/types/nodeviews/blockCard.d.ts +5 -4
- package/dist/types/nodeviews/datasource.d.ts +1 -1
- package/dist/types/nodeviews/embedCard.d.ts +6 -5
- package/dist/types/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
- package/dist/types/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
- package/dist/types/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
- package/dist/types/pm-plugins/actions.d.ts +1 -1
- package/dist/types/pm-plugins/doc.d.ts +1 -1
- package/dist/types/pm-plugins/util/resolve.d.ts +1 -1
- package/dist/types/pm-plugins/util/state.d.ts +18 -18
- package/dist/types/pm-plugins/utils.d.ts +2 -5
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/ui/AwarenessWrapper/index.d.ts +0 -1
- package/dist/types/ui/ConfigureOverlay/index.d.ts +0 -1
- package/dist/types/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
- package/dist/types/ui/InlineCardOverlay/types.d.ts +0 -1
- package/dist/types/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/ui/LayoutButton/utils.d.ts +2 -1
- package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types/ui/OpenPreviewButton/index.d.ts +11 -0
- package/dist/types/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types/ui/ToolbarViewedEvent.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +5 -4
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +6 -5
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/blockCard.d.ts +18 -18
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/embedCard.d.ts +18 -18
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/inlineCard.d.ts +18 -18
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/doc.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/util/state.d.ts +18 -18
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +2 -5
- package/dist/types-ts4.5/types/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/ConfigureOverlay/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +2 -2
- package/dist/types-ts4.5/ui/InlineCardOverlay/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +2 -1
- package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +11 -0
- package/dist/types-ts4.5/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarViewedEvent.d.ts +1 -1
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 7.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a32e07a545f72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a32e07a545f72) -
|
|
8
|
+
[ux] Adds 'Open preview panel' button to the smartlink toolbar when the panel is supported.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.3.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#198611](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/198611)
|
|
16
|
+
[`a608f23cb3d4e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a608f23cb3d4e) -
|
|
17
|
+
[https://product-fabric.atlassian.net/browse/ED-28628](ED-28628) - add SSR support for smart cards
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 7.2.7
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -18,6 +18,7 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
18
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
19
|
var _smartCard = require("@atlaskit/smart-card");
|
|
20
20
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
21
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
21
22
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
23
|
var _actions = require("../pm-plugins/actions");
|
|
23
24
|
var _utils = require("../pm-plugins/utils");
|
|
@@ -110,7 +111,8 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
|
|
|
110
111
|
exposure: true
|
|
111
112
|
}) ? handleOnClick : propsOnClick;
|
|
112
113
|
var card = (0, _react.useMemo)(function () {
|
|
113
|
-
|
|
114
|
+
// Should be removed when the platform_editor_smart_card_otp experiment is rolled out
|
|
115
|
+
if (isPageSSRed && url && !(0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
114
116
|
return /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
|
|
115
117
|
key: url,
|
|
116
118
|
url: url,
|
|
@@ -7,11 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.lazyBlockCardView = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
12
|
var _blockCard = require("./blockCard");
|
|
12
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
14
|
var lazyBlockCardView = exports.lazyBlockCardView = function lazyBlockCardView(props) {
|
|
14
|
-
|
|
15
|
+
var isPageSSRed = props.isPageSSRed;
|
|
16
|
+
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || isPageSSRed && (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
15
17
|
return (0, _blockCard.blockCardNodeView)(props);
|
|
16
18
|
}
|
|
17
19
|
return (0, _lazyNodeView.withLazyLoading)({
|
|
@@ -7,11 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.lazyEmbedCardView = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
12
|
var _embedCard = require("./embedCard");
|
|
12
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
14
|
var lazyEmbedCardView = exports.lazyEmbedCardView = function lazyEmbedCardView(props) {
|
|
14
|
-
|
|
15
|
+
var isPageSSRed = props.isPageSSRed;
|
|
16
|
+
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || isPageSSRed && (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
15
17
|
return (0, _embedCard.embedCardNodeView)(props);
|
|
16
18
|
}
|
|
17
19
|
return (0, _lazyNodeView.withLazyLoading)({
|
|
@@ -11,7 +11,8 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
|
11
11
|
var _inlineCard = require("./inlineCard");
|
|
12
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
13
|
var lazyInlineCardView = exports.lazyInlineCardView = function lazyInlineCardView(props) {
|
|
14
|
-
var isPageSSRed = props.isPageSSRed
|
|
14
|
+
var _props$isPageSSRed = props.isPageSSRed,
|
|
15
|
+
isPageSSRed = _props$isPageSSRed === void 0 ? false : _props$isPageSSRed;
|
|
15
16
|
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
|
|
16
17
|
return (0, _inlineCard.inlineCardNodeView)(props);
|
|
17
18
|
}
|
|
@@ -244,6 +244,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
244
244
|
onClickCallback: onClickCallback,
|
|
245
245
|
allowDatasource: options.allowDatasource,
|
|
246
246
|
inlineCardViewProducer: inlineCardViewProducer,
|
|
247
|
+
isPageSSRed: isPageSSRed,
|
|
247
248
|
CompetitorPrompt: options.CompetitorPrompt
|
|
248
249
|
}),
|
|
249
250
|
embedCard: (0, _lazyEmbedCard.lazyEmbedCardView)({
|
|
@@ -253,6 +254,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
253
254
|
pluginInjectionApi: pluginInjectionApi,
|
|
254
255
|
actionOptions: actionOptions,
|
|
255
256
|
onClickCallback: options.onClickCallback,
|
|
257
|
+
isPageSSRed: isPageSSRed,
|
|
256
258
|
CompetitorPrompt: options.CompetitorPrompt
|
|
257
259
|
})
|
|
258
260
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OpenPreviewPanelToolbarButton = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
10
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
11
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
|
+
var _panelRight = _interopRequireDefault(require("@atlaskit/icon/core/panel-right"));
|
|
13
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
14
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _smartCard = require("@atlaskit/smart-card");
|
|
16
|
+
var OpenPreviewPanelToolbarButton = exports.OpenPreviewPanelToolbarButton = function OpenPreviewPanelToolbarButton(_ref) {
|
|
17
|
+
var node = _ref.node,
|
|
18
|
+
intl = _ref.intl;
|
|
19
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
20
|
+
store = _useSmartLinkContext.store,
|
|
21
|
+
isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
|
|
22
|
+
openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
|
|
23
|
+
var url = node.attrs.url;
|
|
24
|
+
var cardState = store === null || store === void 0 ? void 0 : store.getState()[url];
|
|
25
|
+
if (cardState) {
|
|
26
|
+
var ari = (0, _smartCard.getObjectAri)(cardState.details);
|
|
27
|
+
var name = (0, _smartCard.getObjectName)(cardState.details);
|
|
28
|
+
var iconUrl = (0, _smartCard.getObjectIconUrl)(cardState.details);
|
|
29
|
+
var isPanelAvailable = ari && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
30
|
+
ari: ari
|
|
31
|
+
}));
|
|
32
|
+
var handleOpenGlancePanelClick = function handleOpenGlancePanelClick() {
|
|
33
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
34
|
+
openPreviewPanel({
|
|
35
|
+
url: url,
|
|
36
|
+
ari: ari,
|
|
37
|
+
name: name || '',
|
|
38
|
+
iconUrl: iconUrl
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var title = intl.formatMessage(_messages.linkMessages.openPreviewPanel);
|
|
43
|
+
var icon = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ? /*#__PURE__*/_react.default.createElement(_panelRight.default, {
|
|
44
|
+
label: "",
|
|
45
|
+
spacing: "spacious"
|
|
46
|
+
}) :
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
// This is a hack required for Jira until areToolbarFlagsEnabled are enabled to ensure the icon has padding
|
|
49
|
+
// Padding is removed when areToolbarFlagsEnabed for a button with icon only in platform/packages/editor/editor-common/src/ui/FloatingToolbar/Button.tsx
|
|
50
|
+
_react.default.createElement(_compiled.Inline, {
|
|
51
|
+
as: "span",
|
|
52
|
+
space: "space.050",
|
|
53
|
+
alignBlock: "center"
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
55
|
+
as: "span",
|
|
56
|
+
"aria-hidden": true,
|
|
57
|
+
role: "presentation"
|
|
58
|
+
}), /*#__PURE__*/_react.default.createElement(_panelRight.default, {
|
|
59
|
+
label: "",
|
|
60
|
+
spacing: "spacious"
|
|
61
|
+
}), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
62
|
+
as: "span",
|
|
63
|
+
"aria-hidden": true,
|
|
64
|
+
role: "presentation"
|
|
65
|
+
}));
|
|
66
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
68
|
+
gap: "space.050"
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
70
|
+
testId: "open-preview-panel-floating-toolbar-button",
|
|
71
|
+
onClick: handleOpenGlancePanelClick,
|
|
72
|
+
icon: icon,
|
|
73
|
+
title: title
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
};
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -45,6 +45,7 @@ var _HyperlinkToolbarAppearance = require("./HyperlinkToolbarAppearance");
|
|
|
45
45
|
var _HyperlinkToolbarAppearanceDropdown = require("./HyperlinkToolbarAppearanceDropdown");
|
|
46
46
|
var _LinkToolbarAppearance = require("./LinkToolbarAppearance");
|
|
47
47
|
var _LinkToolbarAppearanceDropdown = require("./LinkToolbarAppearanceDropdown");
|
|
48
|
+
var _OpenPreviewButton = require("./OpenPreviewButton");
|
|
48
49
|
var _ToolbarViewedEvent = require("./ToolbarViewedEvent");
|
|
49
50
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
50
51
|
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; }
|
|
@@ -330,7 +331,18 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
330
331
|
testId: 'link-toolbar-edit-link-button',
|
|
331
332
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
332
333
|
}];
|
|
333
|
-
var
|
|
334
|
+
var openPreviewPanelItems = (0, _platformFeatureFlags.fg)('platform_editor_preview_panel_linking') ? [{
|
|
335
|
+
type: 'custom',
|
|
336
|
+
fallback: [],
|
|
337
|
+
render: function render() {
|
|
338
|
+
return /*#__PURE__*/_react.default.createElement(_OpenPreviewButton.OpenPreviewPanelToolbarButton, {
|
|
339
|
+
node: node,
|
|
340
|
+
intl: intl,
|
|
341
|
+
editorAnalyticsApi: editorAnalyticsApi
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}] : [];
|
|
345
|
+
var toolbarItems = isNewEditorToolbarDisabled ? [].concat(editItems, commentItems, openPreviewPanelItems, [{
|
|
334
346
|
id: 'editor.link.openLink',
|
|
335
347
|
type: 'button',
|
|
336
348
|
icon: _linkExternal.default,
|
|
@@ -367,7 +379,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
367
379
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
368
380
|
title: intl.formatMessage(_messages.default.remove),
|
|
369
381
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
370
|
-
}]) : [].concat(editButtonItems, (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
382
|
+
}]) : [].concat(openPreviewPanelItems, editButtonItems, (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
371
383
|
type: 'separator',
|
|
372
384
|
fullHeight: true
|
|
373
385
|
}]) : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
@@ -8,6 +8,7 @@ import { UnsupportedInline, findOverflowScrollParent } from '@atlaskit/editor-co
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
10
10
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
13
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
13
14
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
@@ -106,7 +107,8 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
106
107
|
exposure: true
|
|
107
108
|
}) ? handleOnClick : propsOnClick;
|
|
108
109
|
const card = useMemo(() => {
|
|
109
|
-
|
|
110
|
+
// Should be removed when the platform_editor_smart_card_otp experiment is rolled out
|
|
111
|
+
if (isPageSSRed && url && !expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
110
112
|
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
111
113
|
key: url,
|
|
112
114
|
url: url,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
4
|
import { blockCardNodeView } from './blockCard';
|
|
4
5
|
export const lazyBlockCardView = props => {
|
|
5
|
-
|
|
6
|
+
const {
|
|
7
|
+
isPageSSRed
|
|
8
|
+
} = props;
|
|
9
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
6
10
|
return blockCardNodeView(props);
|
|
7
11
|
}
|
|
8
12
|
return withLazyLoading({
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
4
|
import { embedCardNodeView } from './embedCard';
|
|
4
5
|
export const lazyEmbedCardView = props => {
|
|
5
|
-
|
|
6
|
+
const {
|
|
7
|
+
isPageSSRed
|
|
8
|
+
} = props;
|
|
9
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
6
10
|
return embedCardNodeView(props);
|
|
7
11
|
}
|
|
8
12
|
return withLazyLoading({
|
|
@@ -2,7 +2,9 @@ import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { inlineCardNodeView } from './inlineCard';
|
|
4
4
|
export const lazyInlineCardView = props => {
|
|
5
|
-
const
|
|
5
|
+
const {
|
|
6
|
+
isPageSSRed = false
|
|
7
|
+
} = props;
|
|
6
8
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
|
|
7
9
|
return inlineCardNodeView(props);
|
|
8
10
|
}
|
|
@@ -241,6 +241,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
241
241
|
onClickCallback,
|
|
242
242
|
allowDatasource: options.allowDatasource,
|
|
243
243
|
inlineCardViewProducer,
|
|
244
|
+
isPageSSRed,
|
|
244
245
|
CompetitorPrompt: options.CompetitorPrompt
|
|
245
246
|
}),
|
|
246
247
|
embedCard: lazyEmbedCardView({
|
|
@@ -250,6 +251,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
250
251
|
pluginInjectionApi,
|
|
251
252
|
actionOptions,
|
|
252
253
|
onClickCallback: options.onClickCallback,
|
|
254
|
+
isPageSSRed,
|
|
253
255
|
CompetitorPrompt: options.CompetitorPrompt
|
|
254
256
|
})
|
|
255
257
|
},
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { linkMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
4
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
6
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
7
|
+
import { Inline, Box, Flex } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
|
|
9
|
+
export const OpenPreviewPanelToolbarButton = ({
|
|
10
|
+
node,
|
|
11
|
+
intl
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
store,
|
|
15
|
+
isPreviewPanelAvailable,
|
|
16
|
+
openPreviewPanel
|
|
17
|
+
} = useSmartLinkContext();
|
|
18
|
+
const url = node.attrs.url;
|
|
19
|
+
const cardState = store === null || store === void 0 ? void 0 : store.getState()[url];
|
|
20
|
+
if (cardState) {
|
|
21
|
+
const ari = getObjectAri(cardState.details);
|
|
22
|
+
const name = getObjectName(cardState.details);
|
|
23
|
+
const iconUrl = getObjectIconUrl(cardState.details);
|
|
24
|
+
const isPanelAvailable = ari && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
25
|
+
ari
|
|
26
|
+
}));
|
|
27
|
+
const handleOpenGlancePanelClick = () => {
|
|
28
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
29
|
+
openPreviewPanel({
|
|
30
|
+
url,
|
|
31
|
+
ari,
|
|
32
|
+
name: name || '',
|
|
33
|
+
iconUrl
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const title = intl.formatMessage(linkMessages.openPreviewPanel);
|
|
38
|
+
const icon = areToolbarFlagsEnabled() ? /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
39
|
+
label: "",
|
|
40
|
+
spacing: "spacious"
|
|
41
|
+
}) :
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
// This is a hack required for Jira until areToolbarFlagsEnabled are enabled to ensure the icon has padding
|
|
44
|
+
// Padding is removed when areToolbarFlagsEnabed for a button with icon only in platform/packages/editor/editor-common/src/ui/FloatingToolbar/Button.tsx
|
|
45
|
+
React.createElement(Inline, {
|
|
46
|
+
as: "span",
|
|
47
|
+
space: "space.050",
|
|
48
|
+
alignBlock: "center"
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
50
|
+
as: "span",
|
|
51
|
+
"aria-hidden": true,
|
|
52
|
+
role: "presentation"
|
|
53
|
+
}), /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
54
|
+
label: "",
|
|
55
|
+
spacing: "spacious"
|
|
56
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
57
|
+
as: "span",
|
|
58
|
+
"aria-hidden": true,
|
|
59
|
+
role: "presentation"
|
|
60
|
+
}));
|
|
61
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
62
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
63
|
+
gap: "space.050"
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
65
|
+
testId: "open-preview-panel-floating-toolbar-button",
|
|
66
|
+
onClick: handleOpenGlancePanelClick,
|
|
67
|
+
icon: icon,
|
|
68
|
+
title: title
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
@@ -35,6 +35,7 @@ import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
|
35
35
|
import { getCustomHyperlinkAppearanceDropdown } from './HyperlinkToolbarAppearanceDropdown';
|
|
36
36
|
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
37
37
|
import { getLinkAppearanceDropdown } from './LinkToolbarAppearanceDropdown';
|
|
38
|
+
import { OpenPreviewPanelToolbarButton } from './OpenPreviewButton';
|
|
38
39
|
import { ToolbarViewedEvent } from './ToolbarViewedEvent';
|
|
39
40
|
export const removeCard = editorAnalyticsApi => commandWithMetadata((state, dispatch) => {
|
|
40
41
|
if (!(state.selection instanceof NodeSelection)) {
|
|
@@ -320,7 +321,16 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
320
321
|
testId: 'link-toolbar-edit-link-button',
|
|
321
322
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
322
323
|
}];
|
|
323
|
-
const
|
|
324
|
+
const openPreviewPanelItems = fg('platform_editor_preview_panel_linking') ? [{
|
|
325
|
+
type: 'custom',
|
|
326
|
+
fallback: [],
|
|
327
|
+
render: () => /*#__PURE__*/React.createElement(OpenPreviewPanelToolbarButton, {
|
|
328
|
+
node: node,
|
|
329
|
+
intl: intl,
|
|
330
|
+
editorAnalyticsApi: editorAnalyticsApi
|
|
331
|
+
})
|
|
332
|
+
}] : [];
|
|
333
|
+
const toolbarItems = isNewEditorToolbarDisabled ? [...editItems, ...commentItems, ...openPreviewPanelItems, {
|
|
324
334
|
id: 'editor.link.openLink',
|
|
325
335
|
type: 'button',
|
|
326
336
|
icon: LinkExternalIcon,
|
|
@@ -357,7 +367,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
357
367
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
358
368
|
title: intl.formatMessage(commonMessages.remove),
|
|
359
369
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
360
|
-
}] : [...editButtonItems, ...(fg('platform_editor_controls_patch_15') ? [...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
370
|
+
}] : [...openPreviewPanelItems, ...editButtonItems, ...(fg('platform_editor_controls_patch_15') ? [...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
361
371
|
type: 'separator',
|
|
362
372
|
fullHeight: true
|
|
363
373
|
}] : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), {
|
|
@@ -8,6 +8,7 @@ import { UnsupportedInline, findOverflowScrollParent } from '@atlaskit/editor-co
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
10
10
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
13
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
13
14
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
@@ -99,7 +100,8 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
99
100
|
exposure: true
|
|
100
101
|
}) ? handleOnClick : propsOnClick;
|
|
101
102
|
var card = useMemo(function () {
|
|
102
|
-
|
|
103
|
+
// Should be removed when the platform_editor_smart_card_otp experiment is rolled out
|
|
104
|
+
if (isPageSSRed && url && !expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
103
105
|
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
104
106
|
key: url,
|
|
105
107
|
url: url,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
4
|
import { blockCardNodeView } from './blockCard';
|
|
4
5
|
export var lazyBlockCardView = function lazyBlockCardView(props) {
|
|
5
|
-
|
|
6
|
+
var isPageSSRed = props.isPageSSRed;
|
|
7
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
6
8
|
return blockCardNodeView(props);
|
|
7
9
|
}
|
|
8
10
|
return withLazyLoading({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
4
|
import { embedCardNodeView } from './embedCard';
|
|
4
5
|
export var lazyEmbedCardView = function lazyEmbedCardView(props) {
|
|
5
|
-
|
|
6
|
+
var isPageSSRed = props.isPageSSRed;
|
|
7
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
6
8
|
return embedCardNodeView(props);
|
|
7
9
|
}
|
|
8
10
|
return withLazyLoading({
|
|
@@ -2,7 +2,8 @@ import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { inlineCardNodeView } from './inlineCard';
|
|
4
4
|
export var lazyInlineCardView = function lazyInlineCardView(props) {
|
|
5
|
-
var isPageSSRed = props.isPageSSRed
|
|
5
|
+
var _props$isPageSSRed = props.isPageSSRed,
|
|
6
|
+
isPageSSRed = _props$isPageSSRed === void 0 ? false : _props$isPageSSRed;
|
|
6
7
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
|
|
7
8
|
return inlineCardNodeView(props);
|
|
8
9
|
}
|
|
@@ -237,6 +237,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
237
237
|
onClickCallback: onClickCallback,
|
|
238
238
|
allowDatasource: options.allowDatasource,
|
|
239
239
|
inlineCardViewProducer: inlineCardViewProducer,
|
|
240
|
+
isPageSSRed: isPageSSRed,
|
|
240
241
|
CompetitorPrompt: options.CompetitorPrompt
|
|
241
242
|
}),
|
|
242
243
|
embedCard: lazyEmbedCardView({
|
|
@@ -246,6 +247,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
246
247
|
pluginInjectionApi: pluginInjectionApi,
|
|
247
248
|
actionOptions: actionOptions,
|
|
248
249
|
onClickCallback: options.onClickCallback,
|
|
250
|
+
isPageSSRed: isPageSSRed,
|
|
249
251
|
CompetitorPrompt: options.CompetitorPrompt
|
|
250
252
|
})
|
|
251
253
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { linkMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
4
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
6
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
7
|
+
import { Inline, Box, Flex } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
|
|
9
|
+
export var OpenPreviewPanelToolbarButton = function OpenPreviewPanelToolbarButton(_ref) {
|
|
10
|
+
var node = _ref.node,
|
|
11
|
+
intl = _ref.intl;
|
|
12
|
+
var _useSmartLinkContext = useSmartLinkContext(),
|
|
13
|
+
store = _useSmartLinkContext.store,
|
|
14
|
+
isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
|
|
15
|
+
openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
|
|
16
|
+
var url = node.attrs.url;
|
|
17
|
+
var cardState = store === null || store === void 0 ? void 0 : store.getState()[url];
|
|
18
|
+
if (cardState) {
|
|
19
|
+
var ari = getObjectAri(cardState.details);
|
|
20
|
+
var name = getObjectName(cardState.details);
|
|
21
|
+
var iconUrl = getObjectIconUrl(cardState.details);
|
|
22
|
+
var isPanelAvailable = ari && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
23
|
+
ari: ari
|
|
24
|
+
}));
|
|
25
|
+
var handleOpenGlancePanelClick = function handleOpenGlancePanelClick() {
|
|
26
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
27
|
+
openPreviewPanel({
|
|
28
|
+
url: url,
|
|
29
|
+
ari: ari,
|
|
30
|
+
name: name || '',
|
|
31
|
+
iconUrl: iconUrl
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var title = intl.formatMessage(linkMessages.openPreviewPanel);
|
|
36
|
+
var icon = areToolbarFlagsEnabled() ? /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
37
|
+
label: "",
|
|
38
|
+
spacing: "spacious"
|
|
39
|
+
}) :
|
|
40
|
+
/*#__PURE__*/
|
|
41
|
+
// This is a hack required for Jira until areToolbarFlagsEnabled are enabled to ensure the icon has padding
|
|
42
|
+
// Padding is removed when areToolbarFlagsEnabed for a button with icon only in platform/packages/editor/editor-common/src/ui/FloatingToolbar/Button.tsx
|
|
43
|
+
React.createElement(Inline, {
|
|
44
|
+
as: "span",
|
|
45
|
+
space: "space.050",
|
|
46
|
+
alignBlock: "center"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
48
|
+
as: "span",
|
|
49
|
+
"aria-hidden": true,
|
|
50
|
+
role: "presentation"
|
|
51
|
+
}), /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
52
|
+
label: "",
|
|
53
|
+
spacing: "spacious"
|
|
54
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
55
|
+
as: "span",
|
|
56
|
+
"aria-hidden": true,
|
|
57
|
+
role: "presentation"
|
|
58
|
+
}));
|
|
59
|
+
if (openPreviewPanel && isPanelAvailable) {
|
|
60
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
61
|
+
gap: "space.050"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
63
|
+
testId: "open-preview-panel-floating-toolbar-button",
|
|
64
|
+
onClick: handleOpenGlancePanelClick,
|
|
65
|
+
icon: icon,
|
|
66
|
+
title: title
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
};
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -39,6 +39,7 @@ import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
|
39
39
|
import { getCustomHyperlinkAppearanceDropdown } from './HyperlinkToolbarAppearanceDropdown';
|
|
40
40
|
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
41
41
|
import { getLinkAppearanceDropdown } from './LinkToolbarAppearanceDropdown';
|
|
42
|
+
import { OpenPreviewPanelToolbarButton } from './OpenPreviewButton';
|
|
42
43
|
import { ToolbarViewedEvent } from './ToolbarViewedEvent';
|
|
43
44
|
export var removeCard = function removeCard(editorAnalyticsApi) {
|
|
44
45
|
return commandWithMetadata(function (state, dispatch) {
|
|
@@ -321,7 +322,18 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
321
322
|
testId: 'link-toolbar-edit-link-button',
|
|
322
323
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
323
324
|
}];
|
|
324
|
-
var
|
|
325
|
+
var openPreviewPanelItems = fg('platform_editor_preview_panel_linking') ? [{
|
|
326
|
+
type: 'custom',
|
|
327
|
+
fallback: [],
|
|
328
|
+
render: function render() {
|
|
329
|
+
return /*#__PURE__*/React.createElement(OpenPreviewPanelToolbarButton, {
|
|
330
|
+
node: node,
|
|
331
|
+
intl: intl,
|
|
332
|
+
editorAnalyticsApi: editorAnalyticsApi
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}] : [];
|
|
336
|
+
var toolbarItems = isNewEditorToolbarDisabled ? [].concat(editItems, commentItems, openPreviewPanelItems, [{
|
|
325
337
|
id: 'editor.link.openLink',
|
|
326
338
|
type: 'button',
|
|
327
339
|
icon: LinkExternalIcon,
|
|
@@ -358,7 +370,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
358
370
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
359
371
|
title: intl.formatMessage(commonMessages.remove),
|
|
360
372
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
361
|
-
}]) : [].concat(editButtonItems, _toConsumableArray(fg('platform_editor_controls_patch_15') ? [].concat(_toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
373
|
+
}]) : [].concat(openPreviewPanelItems, editButtonItems, _toConsumableArray(fg('platform_editor_controls_patch_15') ? [].concat(_toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
362
374
|
type: 'separator',
|
|
363
375
|
fullHeight: true
|
|
364
376
|
}]) : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
@@ -13,19 +13,19 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
13
13
|
id?: string;
|
|
14
14
|
});
|
|
15
15
|
onResolve: (data: {
|
|
16
|
-
url?: string
|
|
17
|
-
title?: string
|
|
16
|
+
url?: string;
|
|
17
|
+
title?: string;
|
|
18
18
|
}) => void;
|
|
19
19
|
componentWillUnmount(): void;
|
|
20
20
|
private removeCardDispatched;
|
|
21
21
|
private removeCard;
|
|
22
22
|
gapCursorSpan: () => React.JSX.Element | undefined;
|
|
23
23
|
onError: ({ err }: {
|
|
24
|
-
err?: Error
|
|
24
|
+
err?: Error;
|
|
25
25
|
}) => void;
|
|
26
26
|
render(): React.JSX.Element;
|
|
27
27
|
}
|
|
28
|
-
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'pluginInjectionApi' | 'onClickCallback' | 'CompetitorPrompt'>;
|
|
28
|
+
export type BlockCardNodeViewProps = Pick<SmartCardProps, 'actionOptions' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt'>;
|
|
29
29
|
export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
|
|
30
30
|
private id;
|
|
31
31
|
unsubscribe: (() => void) | undefined;
|
|
@@ -43,6 +43,7 @@ export interface BlockCardNodeViewProperties {
|
|
|
43
43
|
onClickCallback: BlockCardNodeViewProps['onClickCallback'];
|
|
44
44
|
allowDatasource: boolean | undefined;
|
|
45
45
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
46
|
+
isPageSSRed: BlockCardNodeViewProps['isPageSSRed'];
|
|
46
47
|
CompetitorPrompt?: React.ComponentType<{
|
|
47
48
|
sourceUrl: string;
|
|
48
49
|
linkType?: string;
|
|
@@ -32,7 +32,7 @@ export declare class DatasourceComponent extends React.PureComponent<DatasourceC
|
|
|
32
32
|
handleColumnResize: (key: string, width: number) => void;
|
|
33
33
|
handleWrappedColumnChange: (key: string, shouldWrap: boolean) => void;
|
|
34
34
|
onError: ({ err }: {
|
|
35
|
-
err?: Error
|
|
35
|
+
err?: Error;
|
|
36
36
|
}) => void;
|
|
37
37
|
private getColumnsInfo;
|
|
38
38
|
render(): jsx.JSX.Element | null;
|