@atlaskit/editor-plugin-card 16.3.3 → 16.4.0
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 +19 -0
- package/dist/cjs/nodeviews/genericCard.js +1 -10
- package/dist/cjs/nodeviews/inlineCard.js +1 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/es2019/nodeviews/genericCard.js +1 -10
- package/dist/es2019/nodeviews/inlineCard.js +2 -2
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/esm/nodeviews/genericCard.js +1 -10
- package/dist/esm/nodeviews/inlineCard.js +2 -2
- package/dist/esm/pm-plugins/main.js +2 -2
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 16.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`aef936f5a23ea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aef936f5a23ea) -
|
|
8
|
+
Rename the changeboard smart link drag-and-drop experiment from
|
|
9
|
+
`cc_dnd_smart_link_changeboard_po_template` to `cc_dnd_smart_link_changeboard_platform_css` across
|
|
10
|
+
the card plugin and editor statsig config.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 16.3.4
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 16.3.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -19,7 +19,6 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
19
19
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
20
20
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
21
21
|
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
22
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
22
|
var _doc = require("../pm-plugins/doc");
|
|
24
23
|
var _state = require("../pm-plugins/util/state");
|
|
25
24
|
var _utils2 = require("../pm-plugins/utils");
|
|
@@ -95,21 +94,13 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
95
94
|
}
|
|
96
95
|
if (this.state.isError) {
|
|
97
96
|
if (url) {
|
|
98
|
-
return
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
99
98
|
href: url
|
|
100
99
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
101
100
|
,
|
|
102
101
|
onClick: function onClick(e) {
|
|
103
102
|
e.preventDefault();
|
|
104
103
|
}
|
|
105
|
-
}, url) :
|
|
106
|
-
/*#__PURE__*/
|
|
107
|
-
// eslint-disable-next-line @atlaskit/design-system/no-html-anchor
|
|
108
|
-
_react.default.createElement("a", {
|
|
109
|
-
href: url,
|
|
110
|
-
onClick: function onClick(e) {
|
|
111
|
-
e.preventDefault();
|
|
112
|
-
}
|
|
113
104
|
}, url);
|
|
114
105
|
} else {
|
|
115
106
|
return /*#__PURE__*/_react.default.createElement(UnsupportedComponent, null);
|
|
@@ -203,7 +203,7 @@ function InlineCardNodeView(props) {
|
|
|
203
203
|
isPageSSRed = props.isPageSSRed,
|
|
204
204
|
provider = props.provider,
|
|
205
205
|
CompetitorPrompt = props.CompetitorPrompt;
|
|
206
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, (0, _expVal.
|
|
206
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && (0, _platformFeatureFlags.fg)('cc_drag_and_drop_smart_link_from_content_to_tree') ? ['editorViewMode', 'card'] : ['editorViewMode'], (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && (0, _platformFeatureFlags.fg)('cc_drag_and_drop_smart_link_from_content_to_tree') ? selectorWithCard : selectorWithoutCard),
|
|
207
207
|
mode = _useSharedPluginState.mode,
|
|
208
208
|
resolvedInlineSmartLinks = _useSharedPluginState.resolvedInlineSmartLinks;
|
|
209
209
|
var url = node.attrs.url;
|
|
@@ -125,7 +125,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
125
125
|
var newState = (0, _reducers.default)(pluginStateWithUpdatedPos, meta);
|
|
126
126
|
|
|
127
127
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
128
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && (0, _expVal.
|
|
128
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && (0, _expVal.expVal)('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && (0, _platformFeatureFlags.fg)('cc_drag_and_drop_smart_link_from_content_to_tree')) {
|
|
129
129
|
var resolvedRequest = pluginState.requests.find(function (req) {
|
|
130
130
|
return req.url === meta.url;
|
|
131
131
|
});
|
|
@@ -6,7 +6,6 @@ import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
|
6
6
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import Link from '@atlaskit/link';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
|
|
11
10
|
import { getPluginState } from '../pm-plugins/util/state';
|
|
12
11
|
import { titleUrlPairFromNode } from '../pm-plugins/utils';
|
|
@@ -73,21 +72,13 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
73
72
|
}
|
|
74
73
|
if (this.state.isError) {
|
|
75
74
|
if (url) {
|
|
76
|
-
return
|
|
75
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
77
76
|
href: url
|
|
78
77
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
79
78
|
,
|
|
80
79
|
onClick: e => {
|
|
81
80
|
e.preventDefault();
|
|
82
81
|
}
|
|
83
|
-
}, url) :
|
|
84
|
-
/*#__PURE__*/
|
|
85
|
-
// eslint-disable-next-line @atlaskit/design-system/no-html-anchor
|
|
86
|
-
React.createElement("a", {
|
|
87
|
-
href: url,
|
|
88
|
-
onClick: e => {
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
}
|
|
91
82
|
}, url);
|
|
92
83
|
} else {
|
|
93
84
|
return /*#__PURE__*/React.createElement(UnsupportedComponent, null);
|
|
@@ -12,7 +12,7 @@ import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
|
12
12
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
13
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
|
-
import {
|
|
15
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
16
16
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
17
17
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
18
18
|
import { visitCardLinkAnalytics } from '../ui/toolbar';
|
|
@@ -204,7 +204,7 @@ export function InlineCardNodeView(props) {
|
|
|
204
204
|
const {
|
|
205
205
|
mode,
|
|
206
206
|
resolvedInlineSmartLinks
|
|
207
|
-
} = useSharedPluginStateWithSelector(pluginInjectionApi,
|
|
207
|
+
} = useSharedPluginStateWithSelector(pluginInjectionApi, expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? ['editorViewMode', 'card'] : ['editorViewMode'], expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? selectorWithCard : selectorWithoutCard);
|
|
208
208
|
const url = node.attrs.url;
|
|
209
209
|
const CompetitorPromptComponent = CompetitorPrompt && url ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
210
210
|
sourceUrl: url,
|
|
@@ -6,7 +6,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import {
|
|
9
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
10
10
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
11
11
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
12
12
|
import { lazyEmbedCardView } from '../nodeviews/lazy-embed-card';
|
|
@@ -116,7 +116,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
116
116
|
const newState = reducer(pluginStateWithUpdatedPos, meta);
|
|
117
117
|
|
|
118
118
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
119
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length &&
|
|
119
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree')) {
|
|
120
120
|
const resolvedRequest = pluginState.requests.find(req => req.url === meta.url);
|
|
121
121
|
if ((resolvedRequest === null || resolvedRequest === void 0 ? void 0 : resolvedRequest.appearance) === 'inline') {
|
|
122
122
|
var _newState$resolvedInl, _newState$resolvedInl2;
|
|
@@ -13,7 +13,6 @@ import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
|
13
13
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
14
14
|
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
15
15
|
import Link from '@atlaskit/link';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
|
|
18
17
|
import { getPluginState } from '../pm-plugins/util/state';
|
|
19
18
|
import { titleUrlPairFromNode } from '../pm-plugins/utils';
|
|
@@ -86,21 +85,13 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
86
85
|
}
|
|
87
86
|
if (this.state.isError) {
|
|
88
87
|
if (url) {
|
|
89
|
-
return
|
|
88
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
90
89
|
href: url
|
|
91
90
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
92
91
|
,
|
|
93
92
|
onClick: function onClick(e) {
|
|
94
93
|
e.preventDefault();
|
|
95
94
|
}
|
|
96
|
-
}, url) :
|
|
97
|
-
/*#__PURE__*/
|
|
98
|
-
// eslint-disable-next-line @atlaskit/design-system/no-html-anchor
|
|
99
|
-
React.createElement("a", {
|
|
100
|
-
href: url,
|
|
101
|
-
onClick: function onClick(e) {
|
|
102
|
-
e.preventDefault();
|
|
103
|
-
}
|
|
104
95
|
}, url);
|
|
105
96
|
} else {
|
|
106
97
|
return /*#__PURE__*/React.createElement(UnsupportedComponent, null);
|
|
@@ -12,7 +12,7 @@ import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
|
12
12
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
13
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
|
-
import {
|
|
15
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
16
16
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
17
17
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
18
18
|
import { visitCardLinkAnalytics } from '../ui/toolbar';
|
|
@@ -191,7 +191,7 @@ export function InlineCardNodeView(props) {
|
|
|
191
191
|
isPageSSRed = props.isPageSSRed,
|
|
192
192
|
provider = props.provider,
|
|
193
193
|
CompetitorPrompt = props.CompetitorPrompt;
|
|
194
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi,
|
|
194
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? ['editorViewMode', 'card'] : ['editorViewMode'], expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? selectorWithCard : selectorWithoutCard),
|
|
195
195
|
mode = _useSharedPluginState.mode,
|
|
196
196
|
resolvedInlineSmartLinks = _useSharedPluginState.resolvedInlineSmartLinks;
|
|
197
197
|
var url = node.attrs.url;
|
|
@@ -10,7 +10,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
10
10
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
11
11
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import {
|
|
13
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
14
14
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
15
15
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
16
16
|
import { lazyEmbedCardView } from '../nodeviews/lazy-embed-card';
|
|
@@ -118,7 +118,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
118
118
|
var newState = reducer(pluginStateWithUpdatedPos, meta);
|
|
119
119
|
|
|
120
120
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
121
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length &&
|
|
121
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length && expVal('cc_dnd_smart_link_changeboard_platform_css', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree')) {
|
|
122
122
|
var resolvedRequest = pluginState.requests.find(function (req) {
|
|
123
123
|
return req.url === meta.url;
|
|
124
124
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.4.0",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/primitives": "^19.0.0",
|
|
63
63
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
64
64
|
"@atlaskit/smart-card": "^44.3.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^70.4.0",
|
|
66
66
|
"@atlaskit/tokens": "^13.0.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^114.
|
|
75
|
+
"@atlaskit/editor-common": "^114.12.0",
|
|
76
76
|
"@atlaskit/link-provider": "^4.3.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
78
78
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -120,9 +120,6 @@
|
|
|
120
120
|
"confluence-issue-terminology-refresh": {
|
|
121
121
|
"type": "boolean"
|
|
122
122
|
},
|
|
123
|
-
"dst-a11y__replace-anchor-with-link__linking-platfo": {
|
|
124
|
-
"type": "boolean"
|
|
125
|
-
},
|
|
126
123
|
"platform_editor_adf_with_localid": {
|
|
127
124
|
"type": "boolean"
|
|
128
125
|
},
|