@atlaskit/editor-plugin-card 16.3.4 → 16.4.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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 16.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3a31723096050`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a31723096050) -
8
+ Swap feature gate from `platform-native-embeds-short-link-expansion` to
9
+ `platform_native_embeds_rollout_non_maui_experience` for Confluence short-link URL expansion in
10
+ native embeds. This consolidates the short-link expansion behaviour under the existing non-MaUI
11
+ experience rollout gate.
12
+
13
+ ## 16.4.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [`aef936f5a23ea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aef936f5a23ea) -
18
+ Rename the changeboard smart link drag-and-drop experiment from
19
+ `cc_dnd_smart_link_changeboard_po_template` to `cc_dnd_smart_link_changeboard_platform_css` across
20
+ the card plugin and editor statsig config.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+
3
26
  ## 16.3.4
4
27
 
5
28
  ### 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 (0, _platformFeatureFlags.fg)('dst-a11y__replace-anchor-with-link__linking-platfo') ? /*#__PURE__*/_react.default.createElement(_link.default, {
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.expValNoExposure)('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && (0, _platformFeatureFlags.fg)('cc_drag_and_drop_smart_link_from_content_to_tree') ? ['editorViewMode', 'card'] : ['editorViewMode'], (0, _expVal.expValNoExposure)('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && (0, _platformFeatureFlags.fg)('cc_drag_and_drop_smart_link_from_content_to_tree') ? selectorWithCard : selectorWithoutCard),
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;
@@ -80,7 +80,7 @@ var replaceQueuedUrlWithCard = exports.replaceQueuedUrlWithCard = function repla
80
80
 
81
81
  // If an embed card transformer is provided and the resolved card is an embedCard,
82
82
  // attempt to transform it into an alternative node representation first.
83
- if (cardData.type === 'embedCard' && embedCardNodeTransformer && (0, _platformFeatureFlags.fg)('platform-native-embeds-short-link-expansion')) {
83
+ if (cardData.type === 'embedCard' && embedCardNodeTransformer && (0, _platformFeatureFlags.fg)('platform_native_embeds_rollout_non_maui_experience')) {
84
84
  var transformResult = embedCardNodeTransformer(schema, cardData.attrs);
85
85
  // The transformer may return a Promise for async transformations (e.g. short-link expansion).
86
86
  // When async, we snapshot the current requests and positions now (before any dispatch),
@@ -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.expValNoExposure)('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && (0, _platformFeatureFlags.fg)('cc_drag_and_drop_smart_link_from_content_to_tree')) {
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 fg('dst-a11y__replace-anchor-with-link__linking-platfo') ? /*#__PURE__*/React.createElement(Link, {
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 { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
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, expValNoExposure('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? ['editorViewMode', 'card'] : ['editorViewMode'], expValNoExposure('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? selectorWithCard : selectorWithoutCard);
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,
@@ -70,7 +70,7 @@ export const replaceQueuedUrlWithCard = (url, cardData, analyticsAction, editorA
70
70
 
71
71
  // If an embed card transformer is provided and the resolved card is an embedCard,
72
72
  // attempt to transform it into an alternative node representation first.
73
- if (cardData.type === 'embedCard' && embedCardNodeTransformer && fg('platform-native-embeds-short-link-expansion')) {
73
+ if (cardData.type === 'embedCard' && embedCardNodeTransformer && fg('platform_native_embeds_rollout_non_maui_experience')) {
74
74
  const transformResult = embedCardNodeTransformer(schema, cardData.attrs);
75
75
  // The transformer may return a Promise for async transformations (e.g. short-link expansion).
76
76
  // When async, we snapshot the current requests and positions now (before any dispatch),
@@ -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 { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
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 && expValNoExposure('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree')) {
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 fg('dst-a11y__replace-anchor-with-link__linking-platfo') ? /*#__PURE__*/React.createElement(Link, {
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 { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
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, expValNoExposure('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? ['editorViewMode', 'card'] : ['editorViewMode'], expValNoExposure('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree') ? selectorWithCard : selectorWithoutCard),
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;
@@ -74,7 +74,7 @@ export var replaceQueuedUrlWithCard = function replaceQueuedUrlWithCard(url, car
74
74
 
75
75
  // If an embed card transformer is provided and the resolved card is an embedCard,
76
76
  // attempt to transform it into an alternative node representation first.
77
- if (cardData.type === 'embedCard' && embedCardNodeTransformer && fg('platform-native-embeds-short-link-expansion')) {
77
+ if (cardData.type === 'embedCard' && embedCardNodeTransformer && fg('platform_native_embeds_rollout_non_maui_experience')) {
78
78
  var transformResult = embedCardNodeTransformer(schema, cardData.attrs);
79
79
  // The transformer may return a Promise for async transformations (e.g. short-link expansion).
80
80
  // When async, we snapshot the current requests and positions now (before any dispatch),
@@ -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 { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
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 && expValNoExposure('cc_dnd_smart_link_changeboard_po_template', 'isEnabled', false) && fg('cc_drag_and_drop_smart_link_from_content_to_tree')) {
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.4",
3
+ "version": "16.4.1",
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": "^70.2.0",
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.11.0",
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"
@@ -111,7 +111,7 @@
111
111
  }
112
112
  },
113
113
  "platform-feature-flags": {
114
- "platform-native-embeds-short-link-expansion": {
114
+ "platform_native_embeds_rollout_non_maui_experience": {
115
115
  "type": "boolean"
116
116
  },
117
117
  "cc_drag_and_drop_smart_link_from_content_to_tree": {
@@ -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
  },