@atlaskit/editor-plugin-card 5.4.0 → 5.4.2
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 +17 -0
- package/dist/cjs/nodeviews/inlineCard.js +27 -5
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +8 -4
- package/dist/cjs/nodeviews/lazy-inline-card.js +2 -1
- package/dist/cjs/pm-plugins/main.js +6 -3
- package/dist/cjs/ui/AwarenessWrapper/index.js +6 -3
- package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +8 -2
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/common.js +2 -2
- package/dist/cjs/ui/LinkToolbarAppearanceDropdown.js +1 -1
- package/dist/cjs/ui/Pulse/index.js +4 -2
- package/dist/cjs/ui/toolbar.js +5 -4
- package/dist/es2019/nodeviews/inlineCard.js +42 -18
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +8 -4
- package/dist/es2019/nodeviews/lazy-inline-card.js +2 -1
- package/dist/es2019/pm-plugins/main.js +6 -3
- package/dist/es2019/ui/AwarenessWrapper/index.js +6 -3
- package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +8 -2
- package/dist/es2019/ui/LinkToolbarAppearanceDropdown.js +2 -2
- package/dist/es2019/ui/Pulse/index.js +4 -2
- package/dist/es2019/ui/toolbar.js +5 -4
- package/dist/esm/nodeviews/inlineCard.js +27 -5
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +8 -4
- package/dist/esm/nodeviews/lazy-inline-card.js +2 -1
- package/dist/esm/pm-plugins/main.js +6 -3
- package/dist/esm/ui/AwarenessWrapper/index.js +6 -3
- package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +8 -2
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/common.js +2 -2
- package/dist/esm/ui/LinkToolbarAppearanceDropdown.js +2 -2
- package/dist/esm/ui/Pulse/index.js +4 -2
- package/dist/esm/ui/toolbar.js +5 -4
- package/dist/types/nodeviews/genericCard.d.ts +1 -0
- package/dist/types/nodeviews/inlineCard.d.ts +3 -2
- package/dist/types/nodeviews/inlineCardWithAwareness.d.ts +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/AwarenessWrapper/index.d.ts +1 -1
- package/dist/types/ui/Pulse/index.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/inlineCard.d.ts +3 -2
- package/dist/types-ts4.5/nodeviews/inlineCardWithAwareness.d.ts +1 -1
- package/dist/types-ts4.5/types/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/AwarenessWrapper/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Pulse/index.d.ts +2 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 5.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#129138](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/129138)
|
|
8
|
+
[`9f003b1dbcdb5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9f003b1dbcdb5) -
|
|
9
|
+
Render ssred smartlink for editor under feature gate 'platform_ssr_smartlinks_editor'
|
|
10
|
+
|
|
11
|
+
## 5.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#130882](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130882)
|
|
16
|
+
[`df1c29f476539`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/df1c29f476539) -
|
|
17
|
+
[ux] Adds a new i18n message and updates icons and tooltips on links, media and extensions.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 5.4.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -19,6 +19,7 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
19
19
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
20
20
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
21
|
var _smartCard = require("@atlaskit/smart-card");
|
|
22
|
+
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
22
23
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
24
|
var _actions = require("../pm-plugins/actions");
|
|
24
25
|
var _utils = require("../pm-plugins/utils");
|
|
@@ -38,7 +39,8 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
|
|
|
38
39
|
onRes = _ref.onResolve,
|
|
39
40
|
isHovered = _ref.isHovered,
|
|
40
41
|
showHoverPreview = _ref.showHoverPreview,
|
|
41
|
-
hoverPreviewOptions = _ref.hoverPreviewOptions
|
|
42
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
43
|
+
isPageSSRed = _ref.isPageSSRed;
|
|
42
44
|
var _node$attrs = node.attrs,
|
|
43
45
|
url = _node$attrs.url,
|
|
44
46
|
data = _node$attrs.data;
|
|
@@ -97,6 +99,22 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
|
|
|
97
99
|
});
|
|
98
100
|
}, [onResolve]);
|
|
99
101
|
var card = (0, _react.useMemo)(function () {
|
|
102
|
+
if (isPageSSRed && url && (0, _platformFeatureFlags.fg)('platform_ssr_smartlinks_editor')) {
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
|
|
104
|
+
key: url,
|
|
105
|
+
url: url,
|
|
106
|
+
appearance: "inline",
|
|
107
|
+
onClick: onClick,
|
|
108
|
+
container: scrollContainer,
|
|
109
|
+
onResolve: onResolve,
|
|
110
|
+
onError: onError,
|
|
111
|
+
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
112
|
+
actionOptions: actionOptions,
|
|
113
|
+
isHovered: isHovered,
|
|
114
|
+
showHoverPreview: showHoverPreview,
|
|
115
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
116
|
+
});
|
|
117
|
+
}
|
|
100
118
|
return /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
|
|
101
119
|
key: url,
|
|
102
120
|
url: url !== null && url !== void 0 ? url : data.url,
|
|
@@ -111,7 +129,7 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
|
|
|
111
129
|
showHoverPreview: showHoverPreview,
|
|
112
130
|
hoverPreviewOptions: hoverPreviewOptions
|
|
113
131
|
});
|
|
114
|
-
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions]);
|
|
132
|
+
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed]);
|
|
115
133
|
|
|
116
134
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
117
135
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -132,7 +150,8 @@ function InlineCardNodeView(props) {
|
|
|
132
150
|
enableInlineUpgradeFeatures = props.enableInlineUpgradeFeatures,
|
|
133
151
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
134
152
|
onClickCallback = props.onClickCallback,
|
|
135
|
-
__livePage = props.__livePage
|
|
153
|
+
__livePage = props.__livePage,
|
|
154
|
+
isPageSSRed = props.isPageSSRed;
|
|
136
155
|
var _useState = (0, _react.useState)(false),
|
|
137
156
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
138
157
|
isOverlayHovered = _useState2[0],
|
|
@@ -155,7 +174,8 @@ function InlineCardNodeView(props) {
|
|
|
155
174
|
showHoverPreview: showHoverPreview,
|
|
156
175
|
hoverPreviewOptions: {
|
|
157
176
|
fadeInDelay: livePagesHoverCardFadeInDelay
|
|
158
|
-
}
|
|
177
|
+
},
|
|
178
|
+
isPageSSRed: isPageSSRed
|
|
159
179
|
});
|
|
160
180
|
return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/_react.default.createElement(_ConfigureOverlay.default, {
|
|
161
181
|
targetElementPos: getPos(),
|
|
@@ -179,7 +199,9 @@ function InlineCardNodeView(props) {
|
|
|
179
199
|
actionOptions: actionOptions,
|
|
180
200
|
useAlternativePreloader: useAlternativePreloader,
|
|
181
201
|
pluginInjectionApi: pluginInjectionApi,
|
|
182
|
-
onClickCallback: onClickCallback
|
|
202
|
+
onClickCallback: onClickCallback,
|
|
203
|
+
isPageSSRed: isPageSSRed,
|
|
204
|
+
appearance: "inline"
|
|
183
205
|
// Ignored via go/ees005
|
|
184
206
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
185
207
|
}, enableInlineUpgradeFeatures && (0, _utils.getAwarenessProps)(view.state, getPos, allowEmbeds, allowBlockCards, !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') ? true : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view')));
|
|
@@ -26,7 +26,9 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
26
26
|
onClick = _ref.onClick,
|
|
27
27
|
isPulseEnabled = _ref.isPulseEnabled,
|
|
28
28
|
isOverlayEnabled = _ref.isOverlayEnabled,
|
|
29
|
-
isSelected = _ref.isSelected
|
|
29
|
+
isSelected = _ref.isSelected,
|
|
30
|
+
isPageSSRed = _ref.isPageSSRed,
|
|
31
|
+
appearance = _ref.appearance;
|
|
30
32
|
var _useState = (0, _react.useState)(false),
|
|
31
33
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
34
|
isHovered = _useState2[0],
|
|
@@ -80,9 +82,10 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
80
82
|
onResolve: onResolve,
|
|
81
83
|
onClick: onClick,
|
|
82
84
|
cardContext: cardContext,
|
|
83
|
-
isHovered: isHovered
|
|
85
|
+
isHovered: isHovered,
|
|
86
|
+
isPageSSRed: isPageSSRed
|
|
84
87
|
});
|
|
85
|
-
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view]);
|
|
88
|
+
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed]);
|
|
86
89
|
return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/_react.default.createElement(_AwarenessWrapper.AwarenessWrapper, {
|
|
87
90
|
isOverlayEnabled: isOverlayEnabled,
|
|
88
91
|
isPulseEnabled: isPulseEnabled,
|
|
@@ -95,7 +98,8 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
95
98
|
isResolvedViewRendered: isResolvedViewRendered,
|
|
96
99
|
markMostRecentlyInsertedLink: markMostRecentlyInsertedLink,
|
|
97
100
|
pluginInjectionApi: pluginInjectionApi,
|
|
98
|
-
setOverlayHoveredStyles: setOverlayHoveredStyles
|
|
101
|
+
setOverlayHoveredStyles: setOverlayHoveredStyles,
|
|
102
|
+
appearance: appearance
|
|
99
103
|
}, innerCard) :
|
|
100
104
|
/*#__PURE__*/
|
|
101
105
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -13,7 +13,8 @@ var _inlineCard = require("./inlineCard");
|
|
|
13
13
|
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); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(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 && {}.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; }
|
|
15
15
|
var lazyInlineCardView = exports.lazyInlineCardView = function lazyInlineCardView(props) {
|
|
16
|
-
|
|
16
|
+
var isPageSSRed = props.isPageSSRed || false;
|
|
17
|
+
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || !(0, _platformFeatureFlags.fg)('platform_editor_ssr_fix_smartlinks') || isPageSSRed && (0, _platformFeatureFlags.fg)('platform_ssr_smartlinks_editor')) {
|
|
17
18
|
return (0, _inlineCard.inlineCardNodeView)(props);
|
|
18
19
|
}
|
|
19
20
|
return (0, _lazyNodeView.withLazyLoading)({
|
|
@@ -67,7 +67,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
67
67
|
allowEmbeds = options.allowEmbeds,
|
|
68
68
|
allowBlockCards = options.allowBlockCards,
|
|
69
69
|
onClickCallback = options.onClickCallback,
|
|
70
|
-
__livePage = options.__livePage
|
|
70
|
+
__livePage = options.__livePage,
|
|
71
|
+
isPageSSRed = options.isPageSSRed;
|
|
71
72
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability;
|
|
72
73
|
var inlineCardViewProducer = (0, _reactNodeView.getInlineNodeViewProducer)(_objectSpread({
|
|
73
74
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
@@ -80,7 +81,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
80
81
|
allowBlockCards: allowBlockCards,
|
|
81
82
|
pluginInjectionApi: pluginInjectionApi,
|
|
82
83
|
onClickCallback: onClickCallback,
|
|
83
|
-
__livePage: __livePage
|
|
84
|
+
__livePage: __livePage,
|
|
85
|
+
isPageSSRed: isPageSSRed
|
|
84
86
|
}
|
|
85
87
|
}, __livePage && (0, _platformFeatureFlags.fg)('linking_platform_smart_links_in_live_pages') && {
|
|
86
88
|
extraNodeViewProps: {
|
|
@@ -254,7 +256,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
254
256
|
props: _objectSpread({
|
|
255
257
|
nodeViews: {
|
|
256
258
|
inlineCard: (0, _lazyInlineCard.lazyInlineCardView)({
|
|
257
|
-
inlineCardViewProducer: inlineCardViewProducer
|
|
259
|
+
inlineCardViewProducer: inlineCardViewProducer,
|
|
260
|
+
isPageSSRed: isPageSSRed
|
|
258
261
|
}),
|
|
259
262
|
blockCard: (0, _lazyBlockCard.lazyBlockCardView)({
|
|
260
263
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
@@ -45,7 +45,8 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
|
|
|
45
45
|
markMostRecentlyInsertedLink = _ref.markMostRecentlyInsertedLink,
|
|
46
46
|
pluginInjectionApi = _ref.pluginInjectionApi,
|
|
47
47
|
setOverlayHoveredStyles = _ref.setOverlayHoveredStyles,
|
|
48
|
-
url = _ref.url
|
|
48
|
+
url = _ref.url,
|
|
49
|
+
appearance = _ref.appearance;
|
|
49
50
|
var _useState = (0, _react.useState)(false),
|
|
50
51
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
51
52
|
isHovered = _useState2[0],
|
|
@@ -112,6 +113,7 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
|
|
|
112
113
|
url: url
|
|
113
114
|
}, children);
|
|
114
115
|
}, [children, isHovered, url, handleOverlayChange, isResolvedViewRendered]);
|
|
116
|
+
var isInline = appearance === 'inline';
|
|
115
117
|
return (0, _react.useMemo)(function () {
|
|
116
118
|
var _cardContext$value;
|
|
117
119
|
return (
|
|
@@ -128,8 +130,9 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
|
|
|
128
130
|
localStorageKeyExpirationInMs: _localStorage.ONE_DAY_IN_MILLISECONDS,
|
|
129
131
|
discoveryMode: "start",
|
|
130
132
|
shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
|
|
131
|
-
testId: "link-discovery-pulse"
|
|
133
|
+
testId: "link-discovery-pulse",
|
|
134
|
+
isInline: isInline
|
|
132
135
|
}, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? cardWithOpenButtonOverlay : cardWithOverlay)))
|
|
133
136
|
);
|
|
134
|
-
}, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, cardWithOpenButtonOverlay]);
|
|
137
|
+
}, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, cardWithOpenButtonOverlay, isInline]);
|
|
135
138
|
};
|
|
@@ -12,11 +12,13 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
14
14
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
15
|
+
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
15
16
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
16
17
|
var _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
|
|
17
18
|
var _menu = require("@atlaskit/menu");
|
|
18
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _primitives = require("@atlaskit/primitives");
|
|
21
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
20
22
|
var _utils = require("../../pm-plugins/utils");
|
|
21
23
|
var _editDatasourceAction = require("../editDatasourceAction");
|
|
22
24
|
/**
|
|
@@ -63,6 +65,9 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
63
65
|
(0, _utils.focusEditorView)(editorView);
|
|
64
66
|
}
|
|
65
67
|
}, [currentAppearance, datasourceId, editorAnalyticsApi, editorView, extensionKey]);
|
|
68
|
+
var icon = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? (0, _react2.jsx)(_edit.default, {
|
|
69
|
+
label: ""
|
|
70
|
+
}) : undefined;
|
|
66
71
|
switch (editVariant) {
|
|
67
72
|
case 'edit-link':
|
|
68
73
|
{
|
|
@@ -70,8 +75,9 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
70
75
|
gap: "space.050"
|
|
71
76
|
}, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
72
77
|
testId: "edit-link",
|
|
73
|
-
onClick: onEditLink
|
|
74
|
-
|
|
78
|
+
onClick: onEditLink,
|
|
79
|
+
icon: icon
|
|
80
|
+
}, (0, _experiments.editorExperiment)('platform_editor_controls', 'control') && (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
75
81
|
// Ignored via go/ees005
|
|
76
82
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
77
83
|
, _messages.linkToolbarMessages.editLink)), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
@@ -25,10 +25,10 @@ var withHistoryMethod = function withHistoryMethod(fn) {
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
var getMethod = exports.getMethod = withHistoryMethod(function (_ref) {
|
|
28
|
-
var
|
|
28
|
+
var _payload;
|
|
29
29
|
var inputMethod = _ref.inputMethod,
|
|
30
30
|
sourceEvent = _ref.sourceEvent;
|
|
31
|
-
inputMethod =
|
|
31
|
+
inputMethod = inputMethod !== null && inputMethod !== void 0 ? inputMethod : sourceEvent === null || sourceEvent === void 0 || (_payload = sourceEvent.payload) === null || _payload === void 0 || (_payload = _payload.attributes) === null || _payload === void 0 ? void 0 : _payload.inputMethod;
|
|
32
32
|
switch (inputMethod) {
|
|
33
33
|
case _analytics.INPUT_METHOD.CLIPBOARD:
|
|
34
34
|
return 'editor_paste';
|
|
@@ -126,7 +126,7 @@ var LinkAppearanceMenu = exports.LinkAppearanceMenu = function LinkAppearanceMen
|
|
|
126
126
|
}),
|
|
127
127
|
href: 'href' in settingsConfig ? settingsConfig.href : undefined,
|
|
128
128
|
target: 'target' in settingsConfig ? settingsConfig.target : undefined
|
|
129
|
-
},
|
|
129
|
+
}, intl.formatMessage(_messages.linkToolbarMessages.preferencesLink))));
|
|
130
130
|
};
|
|
131
131
|
var getLinkAppearanceDropdown = exports.getLinkAppearanceDropdown = function getLinkAppearanceDropdown(_ref2) {
|
|
132
132
|
var url = _ref2.url,
|
|
@@ -18,7 +18,8 @@ var DiscoveryPulse = exports.DiscoveryPulse = function DiscoveryPulse(_ref) {
|
|
|
18
18
|
_ref$discoveryMode = _ref.discoveryMode,
|
|
19
19
|
discoveryMode = _ref$discoveryMode === void 0 ? 'iteration' : _ref$discoveryMode,
|
|
20
20
|
shouldShowPulse = _ref.shouldShowPulse,
|
|
21
|
-
testId = _ref.testId
|
|
21
|
+
testId = _ref.testId,
|
|
22
|
+
isInline = _ref.isInline;
|
|
22
23
|
var discovered = (0, _localStorage.isLocalStorageKeyDiscovered)(localStorageKey);
|
|
23
24
|
var showPulse = shouldShowPulse !== null && shouldShowPulse !== void 0 ? shouldShowPulse : !discovered;
|
|
24
25
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
@@ -44,6 +45,7 @@ var DiscoveryPulse = exports.DiscoveryPulse = function DiscoveryPulse(_ref) {
|
|
|
44
45
|
onAnimationIteration: discoveryMode === 'iteration' ? onDiscovery : undefined,
|
|
45
46
|
onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
|
|
46
47
|
showPulse: showPulse,
|
|
47
|
-
testId: testId
|
|
48
|
+
testId: testId,
|
|
49
|
+
isInline: isInline
|
|
48
50
|
}, children);
|
|
49
51
|
};
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -21,7 +21,7 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
|
21
21
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
22
22
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
23
23
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
24
|
-
var
|
|
24
|
+
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
25
25
|
var _linkBroken = _interopRequireDefault(require("@atlaskit/icon/core/link-broken"));
|
|
26
26
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
27
27
|
var _settings = _interopRequireDefault(require("@atlaskit/icon/core/settings"));
|
|
@@ -340,7 +340,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
340
340
|
selected: false,
|
|
341
341
|
metadata: metadata,
|
|
342
342
|
title: intl.formatMessage(_messages.linkToolbarMessages.editLink),
|
|
343
|
-
icon:
|
|
343
|
+
icon: _edit.default,
|
|
344
344
|
testId: 'link-toolbar-edit-link-button',
|
|
345
345
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
346
346
|
}, {
|
|
@@ -667,8 +667,9 @@ var getStartingToolbarItems = exports.getStartingToolbarItems = function getStar
|
|
|
667
667
|
type: 'button',
|
|
668
668
|
onClick: onEditLink,
|
|
669
669
|
title: intl.formatMessage(_messages.linkToolbarMessages.editLink),
|
|
670
|
-
showTitle: true,
|
|
671
|
-
metadata: metadata
|
|
670
|
+
showTitle: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? false : true,
|
|
671
|
+
metadata: metadata,
|
|
672
|
+
icon: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? _edit.default : undefined
|
|
672
673
|
}, {
|
|
673
674
|
type: 'separator'
|
|
674
675
|
}];
|
|
@@ -8,6 +8,7 @@ import { findOverflowScrollParent, UnsupportedInline } from '@atlaskit/editor-co
|
|
|
8
8
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
11
|
+
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
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';
|
|
@@ -25,7 +26,8 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
25
26
|
onResolve: onRes,
|
|
26
27
|
isHovered,
|
|
27
28
|
showHoverPreview,
|
|
28
|
-
hoverPreviewOptions
|
|
29
|
+
hoverPreviewOptions,
|
|
30
|
+
isPageSSRed
|
|
29
31
|
}) => {
|
|
30
32
|
const {
|
|
31
33
|
url,
|
|
@@ -89,20 +91,38 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
89
91
|
url
|
|
90
92
|
});
|
|
91
93
|
}, [onResolve]);
|
|
92
|
-
const card = useMemo(() =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
const card = useMemo(() => {
|
|
95
|
+
if (isPageSSRed && url && fg('platform_ssr_smartlinks_editor')) {
|
|
96
|
+
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
97
|
+
key: url,
|
|
98
|
+
url: url,
|
|
99
|
+
appearance: "inline",
|
|
100
|
+
onClick: onClick,
|
|
101
|
+
container: scrollContainer,
|
|
102
|
+
onResolve: onResolve,
|
|
103
|
+
onError: onError,
|
|
104
|
+
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
105
|
+
actionOptions: actionOptions,
|
|
106
|
+
isHovered: isHovered,
|
|
107
|
+
showHoverPreview: showHoverPreview,
|
|
108
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return /*#__PURE__*/React.createElement(SmartCard, {
|
|
112
|
+
key: url,
|
|
113
|
+
url: url !== null && url !== void 0 ? url : data.url,
|
|
114
|
+
appearance: "inline",
|
|
115
|
+
onClick: onClick,
|
|
116
|
+
container: scrollContainer,
|
|
117
|
+
onResolve: onResolve,
|
|
118
|
+
onError: onError,
|
|
119
|
+
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
120
|
+
actionOptions: actionOptions,
|
|
121
|
+
isHovered: isHovered,
|
|
122
|
+
showHoverPreview: showHoverPreview,
|
|
123
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
124
|
+
});
|
|
125
|
+
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed]);
|
|
106
126
|
|
|
107
127
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
108
128
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -124,7 +144,8 @@ export function InlineCardNodeView(props) {
|
|
|
124
144
|
enableInlineUpgradeFeatures,
|
|
125
145
|
pluginInjectionApi,
|
|
126
146
|
onClickCallback,
|
|
127
|
-
__livePage
|
|
147
|
+
__livePage,
|
|
148
|
+
isPageSSRed
|
|
128
149
|
} = props;
|
|
129
150
|
const [isOverlayHovered, setIsOverlayHovered] = useState(false);
|
|
130
151
|
const {
|
|
@@ -146,7 +167,8 @@ export function InlineCardNodeView(props) {
|
|
|
146
167
|
showHoverPreview: showHoverPreview,
|
|
147
168
|
hoverPreviewOptions: {
|
|
148
169
|
fadeInDelay: livePagesHoverCardFadeInDelay
|
|
149
|
-
}
|
|
170
|
+
},
|
|
171
|
+
isPageSSRed: isPageSSRed
|
|
150
172
|
});
|
|
151
173
|
return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
152
174
|
targetElementPos: getPos(),
|
|
@@ -170,7 +192,9 @@ export function InlineCardNodeView(props) {
|
|
|
170
192
|
actionOptions: actionOptions,
|
|
171
193
|
useAlternativePreloader: useAlternativePreloader,
|
|
172
194
|
pluginInjectionApi: pluginInjectionApi,
|
|
173
|
-
onClickCallback: onClickCallback
|
|
195
|
+
onClickCallback: onClickCallback,
|
|
196
|
+
isPageSSRed: isPageSSRed,
|
|
197
|
+
appearance: "inline"
|
|
174
198
|
// Ignored via go/ees005
|
|
175
199
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
176
200
|
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, !editorExperiment('live_pages_graceful_edit', 'control') ? true : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view')));
|
|
@@ -15,7 +15,9 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
15
15
|
onClick,
|
|
16
16
|
isPulseEnabled,
|
|
17
17
|
isOverlayEnabled,
|
|
18
|
-
isSelected
|
|
18
|
+
isSelected,
|
|
19
|
+
isPageSSRed,
|
|
20
|
+
appearance
|
|
19
21
|
}) => {
|
|
20
22
|
const [isHovered, setIsHovered] = useState(false);
|
|
21
23
|
const [isInserted, setIsInserted] = useState(false);
|
|
@@ -54,8 +56,9 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
54
56
|
onResolve: onResolve,
|
|
55
57
|
onClick: onClick,
|
|
56
58
|
cardContext: cardContext,
|
|
57
|
-
isHovered: isHovered
|
|
58
|
-
|
|
59
|
+
isHovered: isHovered,
|
|
60
|
+
isPageSSRed: isPageSSRed
|
|
61
|
+
}), [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed]);
|
|
59
62
|
return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/React.createElement(AwarenessWrapper, {
|
|
60
63
|
isOverlayEnabled: isOverlayEnabled,
|
|
61
64
|
isPulseEnabled: isPulseEnabled,
|
|
@@ -68,7 +71,8 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
68
71
|
isResolvedViewRendered: isResolvedViewRendered,
|
|
69
72
|
markMostRecentlyInsertedLink: markMostRecentlyInsertedLink,
|
|
70
73
|
pluginInjectionApi: pluginInjectionApi,
|
|
71
|
-
setOverlayHoveredStyles: setOverlayHoveredStyles
|
|
74
|
+
setOverlayHoveredStyles: setOverlayHoveredStyles,
|
|
75
|
+
appearance: appearance
|
|
72
76
|
}, innerCard) :
|
|
73
77
|
/*#__PURE__*/
|
|
74
78
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -3,7 +3,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
4
|
import { inlineCardNodeView } from './inlineCard';
|
|
5
5
|
export const lazyInlineCardView = props => {
|
|
6
|
-
|
|
6
|
+
const isPageSSRed = props.isPageSSRed || false;
|
|
7
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_ssr_fix_smartlinks') || isPageSSRed && fg('platform_ssr_smartlinks_editor')) {
|
|
7
8
|
return inlineCardNodeView(props);
|
|
8
9
|
}
|
|
9
10
|
return withLazyLoading({
|
|
@@ -57,7 +57,8 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
57
57
|
allowBlockCards,
|
|
58
58
|
onClickCallback,
|
|
59
59
|
// @ts-ignore Temporary solution to check for Live Page editor.
|
|
60
|
-
__livePage
|
|
60
|
+
__livePage,
|
|
61
|
+
isPageSSRed
|
|
61
62
|
} = options;
|
|
62
63
|
const enableInlineUpgradeFeatures = !!showUpgradeDiscoverability;
|
|
63
64
|
const inlineCardViewProducer = getInlineNodeViewProducer({
|
|
@@ -71,7 +72,8 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
71
72
|
allowBlockCards,
|
|
72
73
|
pluginInjectionApi,
|
|
73
74
|
onClickCallback,
|
|
74
|
-
__livePage
|
|
75
|
+
__livePage,
|
|
76
|
+
isPageSSRed
|
|
75
77
|
},
|
|
76
78
|
...(__livePage && fg('linking_platform_smart_links_in_live_pages') && {
|
|
77
79
|
extraNodeViewProps: {
|
|
@@ -253,7 +255,8 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
253
255
|
props: {
|
|
254
256
|
nodeViews: {
|
|
255
257
|
inlineCard: lazyInlineCardView({
|
|
256
|
-
inlineCardViewProducer
|
|
258
|
+
inlineCardViewProducer,
|
|
259
|
+
isPageSSRed
|
|
257
260
|
}),
|
|
258
261
|
blockCard: lazyBlockCardView({
|
|
259
262
|
pmPluginFactoryParams,
|
|
@@ -35,7 +35,8 @@ export const AwarenessWrapper = ({
|
|
|
35
35
|
markMostRecentlyInsertedLink,
|
|
36
36
|
pluginInjectionApi,
|
|
37
37
|
setOverlayHoveredStyles,
|
|
38
|
-
url
|
|
38
|
+
url,
|
|
39
|
+
appearance
|
|
39
40
|
}) => {
|
|
40
41
|
var _cardContext$value2;
|
|
41
42
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -94,6 +95,7 @@ export const AwarenessWrapper = ({
|
|
|
94
95
|
url: url
|
|
95
96
|
}, children);
|
|
96
97
|
}, [children, isHovered, url, handleOverlayChange, isResolvedViewRendered]);
|
|
98
|
+
const isInline = appearance === 'inline';
|
|
97
99
|
return useMemo(() => {
|
|
98
100
|
var _cardContext$value;
|
|
99
101
|
return (
|
|
@@ -110,8 +112,9 @@ export const AwarenessWrapper = ({
|
|
|
110
112
|
localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
|
|
111
113
|
discoveryMode: "start",
|
|
112
114
|
shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
|
|
113
|
-
testId: "link-discovery-pulse"
|
|
115
|
+
testId: "link-discovery-pulse",
|
|
116
|
+
isInline: isInline
|
|
114
117
|
}, editorExperiment('platform_editor_controls', 'variant1') ? cardWithOpenButtonOverlay : cardWithOverlay)))
|
|
115
118
|
);
|
|
116
|
-
}, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, cardWithOpenButtonOverlay]);
|
|
119
|
+
}, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, cardWithOpenButtonOverlay, isInline]);
|
|
117
120
|
};
|
|
@@ -10,11 +10,13 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
10
10
|
import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
13
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
13
14
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
14
15
|
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
15
16
|
import { ButtonItem } from '@atlaskit/menu';
|
|
16
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
import { Flex } from '@atlaskit/primitives';
|
|
19
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
18
20
|
import { focusEditorView } from '../../pm-plugins/utils';
|
|
19
21
|
import { editDatasource } from '../editDatasourceAction';
|
|
20
22
|
const dropdownExpandContainer = css({
|
|
@@ -46,6 +48,9 @@ const EditToolbarButtonPresentation = ({
|
|
|
46
48
|
focusEditorView(editorView);
|
|
47
49
|
}
|
|
48
50
|
}, [currentAppearance, datasourceId, editorAnalyticsApi, editorView, extensionKey]);
|
|
51
|
+
const icon = editorExperiment('platform_editor_controls', 'variant1') ? jsx(EditIcon, {
|
|
52
|
+
label: ""
|
|
53
|
+
}) : undefined;
|
|
49
54
|
switch (editVariant) {
|
|
50
55
|
case 'edit-link':
|
|
51
56
|
{
|
|
@@ -53,8 +58,9 @@ const EditToolbarButtonPresentation = ({
|
|
|
53
58
|
gap: "space.050"
|
|
54
59
|
}, jsx(Button, {
|
|
55
60
|
testId: "edit-link",
|
|
56
|
-
onClick: onEditLink
|
|
57
|
-
|
|
61
|
+
onClick: onEditLink,
|
|
62
|
+
icon: icon
|
|
63
|
+
}, editorExperiment('platform_editor_controls', 'control') && jsx(FormattedMessage
|
|
58
64
|
// Ignored via go/ees005
|
|
59
65
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
60
66
|
, linkToolbarMessages.editLink)), jsx(Separator, null));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { appearancePropsMap, commandWithMetadata, getDropdownOption } from '@atlaskit/editor-common/card';
|
|
4
|
-
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { cardMessages as messages, linkToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { isSupportedInParent } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import { useSmartCardContext } from '@atlaskit/link-provider';
|
|
@@ -110,7 +110,7 @@ export const LinkAppearanceMenu = ({
|
|
|
110
110
|
}),
|
|
111
111
|
href: 'href' in settingsConfig ? settingsConfig.href : undefined,
|
|
112
112
|
target: 'target' in settingsConfig ? settingsConfig.target : undefined
|
|
113
|
-
},
|
|
113
|
+
}, intl.formatMessage(linkToolbarMessages.preferencesLink))));
|
|
114
114
|
};
|
|
115
115
|
export const getLinkAppearanceDropdown = ({
|
|
116
116
|
url,
|
|
@@ -8,7 +8,8 @@ export const DiscoveryPulse = ({
|
|
|
8
8
|
localStorageKeyExpirationInMs,
|
|
9
9
|
discoveryMode = 'iteration',
|
|
10
10
|
shouldShowPulse,
|
|
11
|
-
testId
|
|
11
|
+
testId,
|
|
12
|
+
isInline
|
|
12
13
|
}) => {
|
|
13
14
|
const discovered = isLocalStorageKeyDiscovered(localStorageKey);
|
|
14
15
|
const showPulse = shouldShowPulse !== null && shouldShowPulse !== void 0 ? shouldShowPulse : !discovered;
|
|
@@ -36,6 +37,7 @@ export const DiscoveryPulse = ({
|
|
|
36
37
|
onAnimationIteration: discoveryMode === 'iteration' ? onDiscovery : undefined,
|
|
37
38
|
onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
|
|
38
39
|
showPulse: showPulse,
|
|
39
|
-
testId: testId
|
|
40
|
+
testId: testId,
|
|
41
|
+
isInline: isInline
|
|
40
42
|
}, children);
|
|
41
43
|
};
|
|
@@ -11,7 +11,7 @@ import { findDomRefAtPos, removeSelectedNode } from '@atlaskit/editor-prosemirro
|
|
|
11
11
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
12
12
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
13
13
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
14
|
-
import
|
|
14
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
15
15
|
import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
|
|
16
16
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
17
17
|
import SettingsIcon from '@atlaskit/icon/core/settings';
|
|
@@ -332,7 +332,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
332
332
|
selected: false,
|
|
333
333
|
metadata: metadata,
|
|
334
334
|
title: intl.formatMessage(linkToolbarMessages.editLink),
|
|
335
|
-
icon:
|
|
335
|
+
icon: EditIcon,
|
|
336
336
|
testId: 'link-toolbar-edit-link-button',
|
|
337
337
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
338
338
|
}, {
|
|
@@ -656,8 +656,9 @@ export const getStartingToolbarItems = (options, api) => {
|
|
|
656
656
|
type: 'button',
|
|
657
657
|
onClick: onEditLink,
|
|
658
658
|
title: intl.formatMessage(linkToolbarMessages.editLink),
|
|
659
|
-
showTitle: true,
|
|
660
|
-
metadata: metadata
|
|
659
|
+
showTitle: editorExperiment('platform_editor_controls', 'variant1') ? false : true,
|
|
660
|
+
metadata: metadata,
|
|
661
|
+
icon: editorExperiment('platform_editor_controls', 'variant1') ? EditIcon : undefined
|
|
661
662
|
}, {
|
|
662
663
|
type: 'separator'
|
|
663
664
|
}];
|
|
@@ -9,6 +9,7 @@ import { findOverflowScrollParent, UnsupportedInline } from '@atlaskit/editor-co
|
|
|
9
9
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
12
|
+
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
12
13
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
14
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
14
15
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
@@ -26,7 +27,8 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
26
27
|
onRes = _ref.onResolve,
|
|
27
28
|
isHovered = _ref.isHovered,
|
|
28
29
|
showHoverPreview = _ref.showHoverPreview,
|
|
29
|
-
hoverPreviewOptions = _ref.hoverPreviewOptions
|
|
30
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
31
|
+
isPageSSRed = _ref.isPageSSRed;
|
|
30
32
|
var _node$attrs = node.attrs,
|
|
31
33
|
url = _node$attrs.url,
|
|
32
34
|
data = _node$attrs.data;
|
|
@@ -85,6 +87,22 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
85
87
|
});
|
|
86
88
|
}, [onResolve]);
|
|
87
89
|
var card = useMemo(function () {
|
|
90
|
+
if (isPageSSRed && url && fg('platform_ssr_smartlinks_editor')) {
|
|
91
|
+
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
92
|
+
key: url,
|
|
93
|
+
url: url,
|
|
94
|
+
appearance: "inline",
|
|
95
|
+
onClick: onClick,
|
|
96
|
+
container: scrollContainer,
|
|
97
|
+
onResolve: onResolve,
|
|
98
|
+
onError: onError,
|
|
99
|
+
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
100
|
+
actionOptions: actionOptions,
|
|
101
|
+
isHovered: isHovered,
|
|
102
|
+
showHoverPreview: showHoverPreview,
|
|
103
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
104
|
+
});
|
|
105
|
+
}
|
|
88
106
|
return /*#__PURE__*/React.createElement(SmartCard, {
|
|
89
107
|
key: url,
|
|
90
108
|
url: url !== null && url !== void 0 ? url : data.url,
|
|
@@ -99,7 +117,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
99
117
|
showHoverPreview: showHoverPreview,
|
|
100
118
|
hoverPreviewOptions: hoverPreviewOptions
|
|
101
119
|
});
|
|
102
|
-
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions]);
|
|
120
|
+
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed]);
|
|
103
121
|
|
|
104
122
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
105
123
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -120,7 +138,8 @@ export function InlineCardNodeView(props) {
|
|
|
120
138
|
enableInlineUpgradeFeatures = props.enableInlineUpgradeFeatures,
|
|
121
139
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
122
140
|
onClickCallback = props.onClickCallback,
|
|
123
|
-
__livePage = props.__livePage
|
|
141
|
+
__livePage = props.__livePage,
|
|
142
|
+
isPageSSRed = props.isPageSSRed;
|
|
124
143
|
var _useState = useState(false),
|
|
125
144
|
_useState2 = _slicedToArray(_useState, 2),
|
|
126
145
|
isOverlayHovered = _useState2[0],
|
|
@@ -143,7 +162,8 @@ export function InlineCardNodeView(props) {
|
|
|
143
162
|
showHoverPreview: showHoverPreview,
|
|
144
163
|
hoverPreviewOptions: {
|
|
145
164
|
fadeInDelay: livePagesHoverCardFadeInDelay
|
|
146
|
-
}
|
|
165
|
+
},
|
|
166
|
+
isPageSSRed: isPageSSRed
|
|
147
167
|
});
|
|
148
168
|
return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
|
|
149
169
|
targetElementPos: getPos(),
|
|
@@ -167,7 +187,9 @@ export function InlineCardNodeView(props) {
|
|
|
167
187
|
actionOptions: actionOptions,
|
|
168
188
|
useAlternativePreloader: useAlternativePreloader,
|
|
169
189
|
pluginInjectionApi: pluginInjectionApi,
|
|
170
|
-
onClickCallback: onClickCallback
|
|
190
|
+
onClickCallback: onClickCallback,
|
|
191
|
+
isPageSSRed: isPageSSRed,
|
|
192
|
+
appearance: "inline"
|
|
171
193
|
// Ignored via go/ees005
|
|
172
194
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
173
195
|
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, !editorExperiment('live_pages_graceful_edit', 'control') ? true : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view')));
|
|
@@ -16,7 +16,9 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
16
16
|
onClick = _ref.onClick,
|
|
17
17
|
isPulseEnabled = _ref.isPulseEnabled,
|
|
18
18
|
isOverlayEnabled = _ref.isOverlayEnabled,
|
|
19
|
-
isSelected = _ref.isSelected
|
|
19
|
+
isSelected = _ref.isSelected,
|
|
20
|
+
isPageSSRed = _ref.isPageSSRed,
|
|
21
|
+
appearance = _ref.appearance;
|
|
20
22
|
var _useState = useState(false),
|
|
21
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
24
|
isHovered = _useState2[0],
|
|
@@ -70,9 +72,10 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
70
72
|
onResolve: onResolve,
|
|
71
73
|
onClick: onClick,
|
|
72
74
|
cardContext: cardContext,
|
|
73
|
-
isHovered: isHovered
|
|
75
|
+
isHovered: isHovered,
|
|
76
|
+
isPageSSRed: isPageSSRed
|
|
74
77
|
});
|
|
75
|
-
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view]);
|
|
78
|
+
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed]);
|
|
76
79
|
return isOverlayEnabled || isPulseEnabled ? /*#__PURE__*/React.createElement(AwarenessWrapper, {
|
|
77
80
|
isOverlayEnabled: isOverlayEnabled,
|
|
78
81
|
isPulseEnabled: isPulseEnabled,
|
|
@@ -85,7 +88,8 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
85
88
|
isResolvedViewRendered: isResolvedViewRendered,
|
|
86
89
|
markMostRecentlyInsertedLink: markMostRecentlyInsertedLink,
|
|
87
90
|
pluginInjectionApi: pluginInjectionApi,
|
|
88
|
-
setOverlayHoveredStyles: setOverlayHoveredStyles
|
|
91
|
+
setOverlayHoveredStyles: setOverlayHoveredStyles,
|
|
92
|
+
appearance: appearance
|
|
89
93
|
}, innerCard) :
|
|
90
94
|
/*#__PURE__*/
|
|
91
95
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -3,7 +3,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
4
|
import { inlineCardNodeView } from './inlineCard';
|
|
5
5
|
export var lazyInlineCardView = function lazyInlineCardView(props) {
|
|
6
|
-
|
|
6
|
+
var isPageSSRed = props.isPageSSRed || false;
|
|
7
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || !fg('platform_editor_ssr_fix_smartlinks') || isPageSSRed && fg('platform_ssr_smartlinks_editor')) {
|
|
7
8
|
return inlineCardNodeView(props);
|
|
8
9
|
}
|
|
9
10
|
return withLazyLoading({
|
|
@@ -60,7 +60,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
60
60
|
allowEmbeds = options.allowEmbeds,
|
|
61
61
|
allowBlockCards = options.allowBlockCards,
|
|
62
62
|
onClickCallback = options.onClickCallback,
|
|
63
|
-
__livePage = options.__livePage
|
|
63
|
+
__livePage = options.__livePage,
|
|
64
|
+
isPageSSRed = options.isPageSSRed;
|
|
64
65
|
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability;
|
|
65
66
|
var inlineCardViewProducer = getInlineNodeViewProducer(_objectSpread({
|
|
66
67
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
@@ -73,7 +74,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
73
74
|
allowBlockCards: allowBlockCards,
|
|
74
75
|
pluginInjectionApi: pluginInjectionApi,
|
|
75
76
|
onClickCallback: onClickCallback,
|
|
76
|
-
__livePage: __livePage
|
|
77
|
+
__livePage: __livePage,
|
|
78
|
+
isPageSSRed: isPageSSRed
|
|
77
79
|
}
|
|
78
80
|
}, __livePage && fg('linking_platform_smart_links_in_live_pages') && {
|
|
79
81
|
extraNodeViewProps: {
|
|
@@ -247,7 +249,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
247
249
|
props: _objectSpread({
|
|
248
250
|
nodeViews: {
|
|
249
251
|
inlineCard: lazyInlineCardView({
|
|
250
|
-
inlineCardViewProducer: inlineCardViewProducer
|
|
252
|
+
inlineCardViewProducer: inlineCardViewProducer,
|
|
253
|
+
isPageSSRed: isPageSSRed
|
|
251
254
|
}),
|
|
252
255
|
blockCard: lazyBlockCardView({
|
|
253
256
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
@@ -37,7 +37,8 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
|
|
|
37
37
|
markMostRecentlyInsertedLink = _ref.markMostRecentlyInsertedLink,
|
|
38
38
|
pluginInjectionApi = _ref.pluginInjectionApi,
|
|
39
39
|
setOverlayHoveredStyles = _ref.setOverlayHoveredStyles,
|
|
40
|
-
url = _ref.url
|
|
40
|
+
url = _ref.url,
|
|
41
|
+
appearance = _ref.appearance;
|
|
41
42
|
var _useState = useState(false),
|
|
42
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
44
|
isHovered = _useState2[0],
|
|
@@ -104,6 +105,7 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
|
|
|
104
105
|
url: url
|
|
105
106
|
}, children);
|
|
106
107
|
}, [children, isHovered, url, handleOverlayChange, isResolvedViewRendered]);
|
|
108
|
+
var isInline = appearance === 'inline';
|
|
107
109
|
return useMemo(function () {
|
|
108
110
|
var _cardContext$value;
|
|
109
111
|
return (
|
|
@@ -120,8 +122,9 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
|
|
|
120
122
|
localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
|
|
121
123
|
discoveryMode: "start",
|
|
122
124
|
shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
|
|
123
|
-
testId: "link-discovery-pulse"
|
|
125
|
+
testId: "link-discovery-pulse",
|
|
126
|
+
isInline: isInline
|
|
124
127
|
}, editorExperiment('platform_editor_controls', 'variant1') ? cardWithOpenButtonOverlay : cardWithOverlay)))
|
|
125
128
|
);
|
|
126
|
-
}, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, cardWithOpenButtonOverlay]);
|
|
129
|
+
}, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay, cardWithOpenButtonOverlay, isInline]);
|
|
127
130
|
};
|
|
@@ -11,11 +11,13 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
11
11
|
import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
14
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
14
15
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
15
16
|
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
16
17
|
import { ButtonItem } from '@atlaskit/menu';
|
|
17
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
19
|
import { Flex } from '@atlaskit/primitives';
|
|
20
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
21
|
import { focusEditorView } from '../../pm-plugins/utils';
|
|
20
22
|
import { editDatasource } from '../editDatasourceAction';
|
|
21
23
|
var dropdownExpandContainer = css({
|
|
@@ -55,6 +57,9 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
55
57
|
focusEditorView(editorView);
|
|
56
58
|
}
|
|
57
59
|
}, [currentAppearance, datasourceId, editorAnalyticsApi, editorView, extensionKey]);
|
|
60
|
+
var icon = editorExperiment('platform_editor_controls', 'variant1') ? jsx(EditIcon, {
|
|
61
|
+
label: ""
|
|
62
|
+
}) : undefined;
|
|
58
63
|
switch (editVariant) {
|
|
59
64
|
case 'edit-link':
|
|
60
65
|
{
|
|
@@ -62,8 +67,9 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
62
67
|
gap: "space.050"
|
|
63
68
|
}, jsx(Button, {
|
|
64
69
|
testId: "edit-link",
|
|
65
|
-
onClick: onEditLink
|
|
66
|
-
|
|
70
|
+
onClick: onEditLink,
|
|
71
|
+
icon: icon
|
|
72
|
+
}, editorExperiment('platform_editor_controls', 'control') && jsx(FormattedMessage
|
|
67
73
|
// Ignored via go/ees005
|
|
68
74
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
69
75
|
, linkToolbarMessages.editLink)), jsx(Separator, null));
|
|
@@ -19,10 +19,10 @@ var withHistoryMethod = function withHistoryMethod(fn) {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
export var getMethod = withHistoryMethod(function (_ref) {
|
|
22
|
-
var
|
|
22
|
+
var _payload;
|
|
23
23
|
var inputMethod = _ref.inputMethod,
|
|
24
24
|
sourceEvent = _ref.sourceEvent;
|
|
25
|
-
inputMethod =
|
|
25
|
+
inputMethod = inputMethod !== null && inputMethod !== void 0 ? inputMethod : sourceEvent === null || sourceEvent === void 0 || (_payload = sourceEvent.payload) === null || _payload === void 0 || (_payload = _payload.attributes) === null || _payload === void 0 ? void 0 : _payload.inputMethod;
|
|
26
26
|
switch (inputMethod) {
|
|
27
27
|
case INPUT_METHOD.CLIPBOARD:
|
|
28
28
|
return 'editor_paste';
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { appearancePropsMap, commandWithMetadata, getDropdownOption } from '@atlaskit/editor-common/card';
|
|
7
|
-
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
+
import { cardMessages as messages, linkToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { isSupportedInParent } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import { useSmartCardContext } from '@atlaskit/link-provider';
|
|
@@ -119,7 +119,7 @@ export var LinkAppearanceMenu = function LinkAppearanceMenu(_ref) {
|
|
|
119
119
|
}),
|
|
120
120
|
href: 'href' in settingsConfig ? settingsConfig.href : undefined,
|
|
121
121
|
target: 'target' in settingsConfig ? settingsConfig.target : undefined
|
|
122
|
-
},
|
|
122
|
+
}, intl.formatMessage(linkToolbarMessages.preferencesLink))));
|
|
123
123
|
};
|
|
124
124
|
export var getLinkAppearanceDropdown = function getLinkAppearanceDropdown(_ref2) {
|
|
125
125
|
var url = _ref2.url,
|
|
@@ -9,7 +9,8 @@ export var DiscoveryPulse = function DiscoveryPulse(_ref) {
|
|
|
9
9
|
_ref$discoveryMode = _ref.discoveryMode,
|
|
10
10
|
discoveryMode = _ref$discoveryMode === void 0 ? 'iteration' : _ref$discoveryMode,
|
|
11
11
|
shouldShowPulse = _ref.shouldShowPulse,
|
|
12
|
-
testId = _ref.testId
|
|
12
|
+
testId = _ref.testId,
|
|
13
|
+
isInline = _ref.isInline;
|
|
13
14
|
var discovered = isLocalStorageKeyDiscovered(localStorageKey);
|
|
14
15
|
var showPulse = shouldShowPulse !== null && shouldShowPulse !== void 0 ? shouldShowPulse : !discovered;
|
|
15
16
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -35,6 +36,7 @@ export var DiscoveryPulse = function DiscoveryPulse(_ref) {
|
|
|
35
36
|
onAnimationIteration: discoveryMode === 'iteration' ? onDiscovery : undefined,
|
|
36
37
|
onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
|
|
37
38
|
showPulse: showPulse,
|
|
38
|
-
testId: testId
|
|
39
|
+
testId: testId,
|
|
40
|
+
isInline: isInline
|
|
39
41
|
}, children);
|
|
40
42
|
};
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -15,7 +15,7 @@ import { findDomRefAtPos, removeSelectedNode } from '@atlaskit/editor-prosemirro
|
|
|
15
15
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
16
16
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
17
17
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
18
|
-
import
|
|
18
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
19
19
|
import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
|
|
20
20
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
21
21
|
import SettingsIcon from '@atlaskit/icon/core/settings';
|
|
@@ -330,7 +330,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
330
330
|
selected: false,
|
|
331
331
|
metadata: metadata,
|
|
332
332
|
title: intl.formatMessage(linkToolbarMessages.editLink),
|
|
333
|
-
icon:
|
|
333
|
+
icon: EditIcon,
|
|
334
334
|
testId: 'link-toolbar-edit-link-button',
|
|
335
335
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
336
336
|
}, {
|
|
@@ -657,8 +657,9 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
657
657
|
type: 'button',
|
|
658
658
|
onClick: onEditLink,
|
|
659
659
|
title: intl.formatMessage(linkToolbarMessages.editLink),
|
|
660
|
-
showTitle: true,
|
|
661
|
-
metadata: metadata
|
|
660
|
+
showTitle: editorExperiment('platform_editor_controls', 'variant1') ? false : true,
|
|
661
|
+
metadata: metadata,
|
|
662
|
+
icon: editorExperiment('platform_editor_controls', 'variant1') ? EditIcon : undefined
|
|
662
663
|
}, {
|
|
663
664
|
type: 'separator'
|
|
664
665
|
}];
|
|
@@ -45,6 +45,7 @@ export interface SmartCardProps extends CardProps {
|
|
|
45
45
|
allowEmbeds?: boolean;
|
|
46
46
|
allowBlockCards?: boolean;
|
|
47
47
|
enableInlineUpgradeFeatures?: boolean;
|
|
48
|
+
isPageSSRed?: boolean;
|
|
48
49
|
}
|
|
49
50
|
export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps & {
|
|
50
51
|
id?: string;
|
|
@@ -4,10 +4,11 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { SmartCardProps } from './genericCard';
|
|
6
6
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
7
|
-
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, }: SmartCardProps) => React.JSX.Element | null>;
|
|
8
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage'>;
|
|
7
|
+
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, }: SmartCardProps) => React.JSX.Element | null>;
|
|
8
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage' | 'isPageSSRed'>;
|
|
9
9
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
|
|
10
10
|
export interface InlineCardNodeViewProperties {
|
|
11
11
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
12
|
+
isPageSSRed?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView;
|
|
@@ -5,4 +5,4 @@ export type InlineCardWithAwarenessProps = {
|
|
|
5
5
|
isOverlayEnabled?: boolean;
|
|
6
6
|
isSelected?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, pluginInjectionApi, onClick, isPulseEnabled, isOverlayEnabled, isSelected, }: SmartCardProps & InlineCardWithAwarenessProps) => React.JSX.Element>;
|
|
8
|
+
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, pluginInjectionApi, onClick, isPulseEnabled, isOverlayEnabled, isSelected, isPageSSRed, appearance, }: SmartCardProps & InlineCardWithAwarenessProps) => React.JSX.Element>;
|
|
@@ -12,5 +12,5 @@ type AwarenessWrapperProps = {
|
|
|
12
12
|
isPulseEnabled?: boolean;
|
|
13
13
|
isSelected?: boolean;
|
|
14
14
|
} & Partial<SmartCardProps>;
|
|
15
|
-
export declare const AwarenessWrapper: ({ cardContext, children, getPos, isInserted, isOverlayEnabled, isSelected, isResolvedViewRendered, isPulseEnabled, markMostRecentlyInsertedLink, pluginInjectionApi, setOverlayHoveredStyles, url, }: AwarenessWrapperProps) => jsx.JSX.Element;
|
|
15
|
+
export declare const AwarenessWrapper: ({ cardContext, children, getPos, isInserted, isOverlayEnabled, isSelected, isResolvedViewRendered, isPulseEnabled, markMostRecentlyInsertedLink, pluginInjectionApi, setOverlayHoveredStyles, url, appearance, }: AwarenessWrapperProps) => jsx.JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -20,5 +20,6 @@ export interface PulseProps {
|
|
|
20
20
|
discoveryMode?: PulseDiscoveryMode;
|
|
21
21
|
shouldShowPulse?: boolean;
|
|
22
22
|
testId?: string;
|
|
23
|
+
isInline?: boolean;
|
|
23
24
|
}
|
|
24
|
-
export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, }: PulseProps) => React.JSX.Element;
|
|
25
|
+
export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, isInline, }: PulseProps) => React.JSX.Element;
|
|
@@ -45,6 +45,7 @@ export interface SmartCardProps extends CardProps {
|
|
|
45
45
|
allowEmbeds?: boolean;
|
|
46
46
|
allowBlockCards?: boolean;
|
|
47
47
|
enableInlineUpgradeFeatures?: boolean;
|
|
48
|
+
isPageSSRed?: boolean;
|
|
48
49
|
}
|
|
49
50
|
export declare function Card(SmartCardComponent: React.ComponentType<React.PropsWithChildren<SmartCardProps & {
|
|
50
51
|
id?: string;
|
|
@@ -4,10 +4,11 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { SmartCardProps } from './genericCard';
|
|
6
6
|
import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
|
|
7
|
-
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, }: SmartCardProps) => React.JSX.Element | null>;
|
|
8
|
-
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage'>;
|
|
7
|
+
export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, }: SmartCardProps) => React.JSX.Element | null>;
|
|
8
|
+
export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | '__livePage' | 'isPageSSRed'>;
|
|
9
9
|
export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element;
|
|
10
10
|
export interface InlineCardNodeViewProperties {
|
|
11
11
|
inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>;
|
|
12
|
+
isPageSSRed?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView;
|
|
@@ -5,4 +5,4 @@ export type InlineCardWithAwarenessProps = {
|
|
|
5
5
|
isOverlayEnabled?: boolean;
|
|
6
6
|
isSelected?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, pluginInjectionApi, onClick, isPulseEnabled, isOverlayEnabled, isSelected, }: SmartCardProps & InlineCardWithAwarenessProps) => React.JSX.Element>;
|
|
8
|
+
export declare const InlineCardWithAwareness: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, pluginInjectionApi, onClick, isPulseEnabled, isOverlayEnabled, isSelected, isPageSSRed, appearance, }: SmartCardProps & InlineCardWithAwarenessProps) => React.JSX.Element>;
|
|
@@ -12,5 +12,5 @@ type AwarenessWrapperProps = {
|
|
|
12
12
|
isPulseEnabled?: boolean;
|
|
13
13
|
isSelected?: boolean;
|
|
14
14
|
} & Partial<SmartCardProps>;
|
|
15
|
-
export declare const AwarenessWrapper: ({ cardContext, children, getPos, isInserted, isOverlayEnabled, isSelected, isResolvedViewRendered, isPulseEnabled, markMostRecentlyInsertedLink, pluginInjectionApi, setOverlayHoveredStyles, url, }: AwarenessWrapperProps) => jsx.JSX.Element;
|
|
15
|
+
export declare const AwarenessWrapper: ({ cardContext, children, getPos, isInserted, isOverlayEnabled, isSelected, isResolvedViewRendered, isPulseEnabled, markMostRecentlyInsertedLink, pluginInjectionApi, setOverlayHoveredStyles, url, appearance, }: AwarenessWrapperProps) => jsx.JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -20,5 +20,6 @@ export interface PulseProps {
|
|
|
20
20
|
discoveryMode?: PulseDiscoveryMode;
|
|
21
21
|
shouldShowPulse?: boolean;
|
|
22
22
|
testId?: string;
|
|
23
|
+
isInline?: boolean;
|
|
23
24
|
}
|
|
24
|
-
export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, }: PulseProps) => React.JSX.Element;
|
|
25
|
+
export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, isInline, }: PulseProps) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
38
38
|
"@atlaskit/button": "^21.1.0",
|
|
39
39
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
40
|
-
"@atlaskit/editor-common": "^102.
|
|
40
|
+
"@atlaskit/editor-common": "^102.13.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
42
42
|
"@atlaskit/editor-plugin-base": "^2.3.0",
|
|
43
43
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/primitives": "^14.2.0",
|
|
63
63
|
"@atlaskit/smart-card": "^36.0.0",
|
|
64
64
|
"@atlaskit/theme": "^18.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^4.4.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.5.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -145,6 +145,9 @@
|
|
|
145
145
|
},
|
|
146
146
|
"confluence-issue-terminology-refresh": {
|
|
147
147
|
"type": "boolean"
|
|
148
|
+
},
|
|
149
|
+
"platform_ssr_smartlinks_editor": {
|
|
150
|
+
"type": "boolean"
|
|
148
151
|
}
|
|
149
152
|
},
|
|
150
153
|
"stricter": {
|