@atlaskit/editor-plugin-card 7.7.0 → 7.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +9 -4
- package/dist/cjs/ui/AwarenessWrapper/index.js +1 -2
- package/dist/cjs/ui/toolbar.js +3 -1
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +9 -4
- package/dist/es2019/ui/AwarenessWrapper/index.js +1 -2
- package/dist/es2019/ui/toolbar.js +3 -1
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +9 -4
- package/dist/esm/ui/AwarenessWrapper/index.js +1 -2
- package/dist/esm/ui/toolbar.js +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 7.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bfec478c9e91b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bfec478c9e91b) -
|
|
8
|
+
Splits platform_editor_preview_panel_linking_exp into one for Jira and one for Confluence and
|
|
9
|
+
switches to editorExperiment util.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 7.7.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -12,7 +12,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
12
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _smartCard = require("@atlaskit/smart-card");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
16
|
var _actions = require("../pm-plugins/actions");
|
|
18
17
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
@@ -97,7 +96,9 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
97
96
|
selection = _useSharedState.selection;
|
|
98
97
|
var floatingToolbarNode = selection instanceof _state.NodeSelection && selection.node;
|
|
99
98
|
// This is a prop to show Hover card, Hover card should be shown only in Live View and Classic Renderer (note when only Editor controls enabled we don't show in Live view)
|
|
100
|
-
var showHoverPreview = floatingToolbarNode !== node && (0,
|
|
99
|
+
var showHoverPreview = floatingToolbarNode !== node && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
100
|
+
exposure: true
|
|
101
|
+
});
|
|
101
102
|
var innerCardWithOpenButtonOverlay = (0, _react.useMemo)(function () {
|
|
102
103
|
var _pluginInjectionApi$a;
|
|
103
104
|
return /*#__PURE__*/_react.default.createElement(_ui.HoverLinkOverlay, {
|
|
@@ -141,10 +142,14 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
141
142
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, provider, pluginInjectionApi]);
|
|
142
143
|
var shouldShowOpenButtonOverlay = (0, _react.useMemo)(function () {
|
|
143
144
|
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
144
|
-
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || (0,
|
|
145
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
146
|
+
exposure: true
|
|
147
|
+
}));
|
|
145
148
|
}, [mode, editorAppearance]);
|
|
146
149
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
147
|
-
if (mode === 'view' && (0,
|
|
150
|
+
if (mode === 'view' && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
151
|
+
exposure: true
|
|
152
|
+
})) {
|
|
148
153
|
var _cardContext$value;
|
|
149
154
|
var url = node.attrs.url;
|
|
150
155
|
var cardState = cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 || (_cardContext$value = _cardContext$value.store) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.getState()[url];
|
|
@@ -9,7 +9,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
13
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var _utils = require("../../pm-plugins/utils");
|
|
15
14
|
var _useLinkUpgradeDiscoverability = _interopRequireDefault(require("../hooks/useLinkUpgradeDiscoverability"));
|
|
@@ -86,7 +85,7 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
|
|
|
86
85
|
setOverlayHoveredStyles(isHovered);
|
|
87
86
|
}, [setOverlayHoveredStyles]);
|
|
88
87
|
var cardWithOverlay = (0, _react.useMemo)(function () {
|
|
89
|
-
if (shouldShowLinkOverlay && !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && !(0,
|
|
88
|
+
if (shouldShowLinkOverlay && !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && !(0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true)) {
|
|
90
89
|
return (0, _react2.jsx)(_InlineCardOverlay.default, {
|
|
91
90
|
isSelected: isSelected,
|
|
92
91
|
isVisible: isResolvedViewRendered && (isInserted || isHovered || isSelected),
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -331,7 +331,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
331
331
|
testId: 'link-toolbar-edit-link-button',
|
|
332
332
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
333
333
|
}];
|
|
334
|
-
var openPreviewPanelItems = (0,
|
|
334
|
+
var openPreviewPanelItems = (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
335
|
+
exposure: true
|
|
336
|
+
}) ? [{
|
|
335
337
|
type: 'custom',
|
|
336
338
|
fallback: [],
|
|
337
339
|
render: function render() {
|
|
@@ -3,7 +3,6 @@ import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPl
|
|
|
3
3
|
import { HoverLinkOverlay } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { getObjectAri, getObjectName, getObjectIconUrl } from '@atlaskit/smart-card';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { registerRemoveOverlay } from '../pm-plugins/actions';
|
|
9
8
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -77,7 +76,9 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
77
76
|
} = useSharedState(pluginInjectionApi);
|
|
78
77
|
const floatingToolbarNode = selection instanceof NodeSelection && selection.node;
|
|
79
78
|
// This is a prop to show Hover card, Hover card should be shown only in Live View and Classic Renderer (note when only Editor controls enabled we don't show in Live view)
|
|
80
|
-
const showHoverPreview = floatingToolbarNode !== node &&
|
|
79
|
+
const showHoverPreview = floatingToolbarNode !== node && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
80
|
+
exposure: true
|
|
81
|
+
});
|
|
81
82
|
const innerCardWithOpenButtonOverlay = useMemo(() => {
|
|
82
83
|
var _pluginInjectionApi$a;
|
|
83
84
|
return /*#__PURE__*/React.createElement(HoverLinkOverlay, {
|
|
@@ -119,10 +120,14 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
119
120
|
}), [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, provider, pluginInjectionApi]);
|
|
120
121
|
const shouldShowOpenButtonOverlay = useMemo(() => {
|
|
121
122
|
const shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
122
|
-
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') ||
|
|
123
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') || editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
124
|
+
exposure: true
|
|
125
|
+
}));
|
|
123
126
|
}, [mode, editorAppearance]);
|
|
124
127
|
let innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
125
|
-
if (mode === 'view' &&
|
|
128
|
+
if (mode === 'view' && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
129
|
+
exposure: true
|
|
130
|
+
})) {
|
|
126
131
|
var _cardContext$value, _cardContext$value$st;
|
|
127
132
|
const url = node.attrs.url;
|
|
128
133
|
const cardState = cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : (_cardContext$value$st = _cardContext$value.store) === null || _cardContext$value$st === void 0 ? void 0 : _cardContext$value$st.getState()[url];
|
|
@@ -7,7 +7,6 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
10
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
11
|
import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
|
|
13
12
|
import useLinkUpgradeDiscoverability from '../hooks/useLinkUpgradeDiscoverability';
|
|
@@ -76,7 +75,7 @@ export const AwarenessWrapper = ({
|
|
|
76
75
|
setOverlayHoveredStyles(isHovered);
|
|
77
76
|
}, [setOverlayHoveredStyles]);
|
|
78
77
|
const cardWithOverlay = useMemo(() => {
|
|
79
|
-
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !
|
|
78
|
+
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !editorExperiment('platform_editor_preview_panel_linking_exp', true)) {
|
|
80
79
|
return jsx(InlineCardOverlay, {
|
|
81
80
|
isSelected: isSelected,
|
|
82
81
|
isVisible: isResolvedViewRendered && (isInserted || isHovered || isSelected),
|
|
@@ -321,7 +321,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
321
321
|
testId: 'link-toolbar-edit-link-button',
|
|
322
322
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
323
323
|
}];
|
|
324
|
-
const openPreviewPanelItems =
|
|
324
|
+
const openPreviewPanelItems = editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
325
|
+
exposure: true
|
|
326
|
+
}) ? [{
|
|
325
327
|
type: 'custom',
|
|
326
328
|
fallback: [],
|
|
327
329
|
render: () => /*#__PURE__*/React.createElement(OpenPreviewPanelToolbarButton, {
|
|
@@ -4,7 +4,6 @@ import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPl
|
|
|
4
4
|
import { HoverLinkOverlay } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { getObjectAri, getObjectName, getObjectIconUrl } from '@atlaskit/smart-card';
|
|
7
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
8
|
import { registerRemoveOverlay } from '../pm-plugins/actions';
|
|
10
9
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -88,7 +87,9 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
88
87
|
selection = _useSharedState.selection;
|
|
89
88
|
var floatingToolbarNode = selection instanceof NodeSelection && selection.node;
|
|
90
89
|
// This is a prop to show Hover card, Hover card should be shown only in Live View and Classic Renderer (note when only Editor controls enabled we don't show in Live view)
|
|
91
|
-
var showHoverPreview = floatingToolbarNode !== node &&
|
|
90
|
+
var showHoverPreview = floatingToolbarNode !== node && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
91
|
+
exposure: true
|
|
92
|
+
});
|
|
92
93
|
var innerCardWithOpenButtonOverlay = useMemo(function () {
|
|
93
94
|
var _pluginInjectionApi$a;
|
|
94
95
|
return /*#__PURE__*/React.createElement(HoverLinkOverlay, {
|
|
@@ -132,10 +133,14 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
132
133
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, provider, pluginInjectionApi]);
|
|
133
134
|
var shouldShowOpenButtonOverlay = useMemo(function () {
|
|
134
135
|
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
135
|
-
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') ||
|
|
136
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (editorExperiment('platform_editor_controls', 'variant1') || editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
137
|
+
exposure: true
|
|
138
|
+
}));
|
|
136
139
|
}, [mode, editorAppearance]);
|
|
137
140
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
138
|
-
if (mode === 'view' &&
|
|
141
|
+
if (mode === 'view' && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
142
|
+
exposure: true
|
|
143
|
+
})) {
|
|
139
144
|
var _cardContext$value;
|
|
140
145
|
var url = node.attrs.url;
|
|
141
146
|
var cardState = cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 || (_cardContext$value = _cardContext$value.store) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.getState()[url];
|
|
@@ -8,7 +8,6 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
11
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
12
|
import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
|
|
14
13
|
import useLinkUpgradeDiscoverability from '../hooks/useLinkUpgradeDiscoverability';
|
|
@@ -78,7 +77,7 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
|
|
|
78
77
|
setOverlayHoveredStyles(isHovered);
|
|
79
78
|
}, [setOverlayHoveredStyles]);
|
|
80
79
|
var cardWithOverlay = useMemo(function () {
|
|
81
|
-
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !
|
|
80
|
+
if (shouldShowLinkOverlay && !editorExperiment('platform_editor_controls', 'variant1') && !editorExperiment('platform_editor_preview_panel_linking_exp', true)) {
|
|
82
81
|
return jsx(InlineCardOverlay, {
|
|
83
82
|
isSelected: isSelected,
|
|
84
83
|
isVisible: isResolvedViewRendered && (isInserted || isHovered || isSelected),
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -322,7 +322,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
322
322
|
testId: 'link-toolbar-edit-link-button',
|
|
323
323
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
324
324
|
}];
|
|
325
|
-
var openPreviewPanelItems =
|
|
325
|
+
var openPreviewPanelItems = editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
326
|
+
exposure: true
|
|
327
|
+
}) ? [{
|
|
326
328
|
type: 'custom',
|
|
327
329
|
fallback: [],
|
|
328
330
|
render: function render() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.1",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/primitives": "^14.12.0",
|
|
61
61
|
"@atlaskit/smart-card": "^40.15.0",
|
|
62
62
|
"@atlaskit/theme": "^20.0.0",
|
|
63
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
63
|
+
"@atlaskit/tmp-editor-statsig": "^11.10.0",
|
|
64
64
|
"@atlaskit/tokens": "^6.1.0",
|
|
65
65
|
"@babel/runtime": "^7.0.0",
|
|
66
66
|
"@emotion/react": "^11.7.1",
|