@atlaskit/smart-card 26.8.1 → 26.9.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`7811ab546b9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7811ab546b9) - Cleans up FF platform.linking-platform.smart-card.enable-analytics-context introduced in 26.2.2 — resolved attributes now provided to all events fired within Smart Card by default.
8
+
3
9
  ## 26.8.1
4
10
 
5
11
  ### Patch Changes
@@ -12,7 +12,6 @@ var _reactDom = require("react-dom");
12
12
  var _analytics = require("../../analytics");
13
13
  var _helpers = require("../../helpers");
14
14
  var _linkingCommon = require("@atlaskit/linking-common");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _constants = require("../../actions/constants");
17
16
  var _jsonld = require("../../../utils/jsonld");
18
17
  var _constants2 = require("../../../constants");
@@ -120,19 +119,16 @@ var useResolve = function useResolve() {
120
119
  handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('error', hostname, _constants.ERROR_MESSAGE_METADATA), response, isMetadataRequest);
121
120
  return;
122
121
  }
123
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-analytics-context')) {
124
- /**
125
- * Using unstable_batchedUpdates because this store update happens async and trigers a rerender
126
- * more info:
127
- * https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
128
- * https://react-redux.js.org/api/batch
129
- */
130
- (0, _reactDom.unstable_batchedUpdates)(function () {
131
- handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
132
- });
133
- } else {
122
+
123
+ /**
124
+ * Using unstable_batchedUpdates because this store update happens async and trigers a rerender
125
+ * more info:
126
+ * https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
127
+ * https://react-redux.js.org/api/batch
128
+ */
129
+ (0, _reactDom.unstable_batchedUpdates)(function () {
134
130
  handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
135
- }
131
+ });
136
132
  }, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
137
133
  return (0, _react.useCallback)( /*#__PURE__*/function () {
138
134
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.8.1",
3
+ "version": "26.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -9,7 +9,6 @@ exports.CardWithUrlContent = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _analyticsNext = require("@atlaskit/analytics-next");
11
11
  var _linkProvider = require("@atlaskit/link-provider");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var _utils = require("../../utils");
14
13
  var measure = _interopRequireWildcard(require("../../utils/performance"));
15
14
  var _helpers = require("../../state/helpers");
@@ -273,14 +272,11 @@ function Component(_ref) {
273
272
  }
274
273
  }
275
274
  var CardWithUrlContent = function CardWithUrlContent(props) {
276
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-analytics-context')) {
277
- var display = (0, _flexible.isFlexibleUiCard)(props.children) ? _constants.CardDisplay.Flexible : props.appearance;
278
- return /*#__PURE__*/_react.default.createElement(_SmartLinkAnalyticsContext.SmartLinkAnalyticsContext, {
279
- url: props.url,
280
- id: props.id,
281
- display: display
282
- }, /*#__PURE__*/_react.default.createElement(Component, props));
283
- }
284
- return /*#__PURE__*/_react.default.createElement(Component, props);
275
+ var display = (0, _flexible.isFlexibleUiCard)(props.children) ? _constants.CardDisplay.Flexible : props.appearance;
276
+ return /*#__PURE__*/_react.default.createElement(_SmartLinkAnalyticsContext.SmartLinkAnalyticsContext, {
277
+ url: props.url,
278
+ id: props.id,
279
+ display: display
280
+ }, /*#__PURE__*/_react.default.createElement(Component, props));
285
281
  };
286
282
  exports.CardWithUrlContent = CardWithUrlContent;
@@ -3,7 +3,6 @@ import { unstable_batchedUpdates } from 'react-dom';
3
3
  import { addMetadataToExperience } from '../../analytics';
4
4
  import { getStatus } from '../../helpers';
5
5
  import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, APIError, cardAction } from '@atlaskit/linking-common';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
6
  import { ERROR_MESSAGE_FATAL, ERROR_MESSAGE_METADATA, ERROR_MESSAGE_OAUTH } from '../../actions/constants';
8
7
  import { getUnauthorizedJsonLd } from '../../../utils/jsonld';
9
8
  import { SmartLinkStatus } from '../../../constants';
@@ -113,19 +112,16 @@ const useResolve = () => {
113
112
  handleResolvedLinkError(resourceUrl, new APIError('error', hostname, ERROR_MESSAGE_METADATA), response, isMetadataRequest);
114
113
  return;
115
114
  }
116
- if (getBooleanFF('platform.linking-platform.smart-card.enable-analytics-context')) {
117
- /**
118
- * Using unstable_batchedUpdates because this store update happens async and trigers a rerender
119
- * more info:
120
- * https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
121
- * https://react-redux.js.org/api/batch
122
- */
123
- unstable_batchedUpdates(() => {
124
- handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
125
- });
126
- } else {
115
+
116
+ /**
117
+ * Using unstable_batchedUpdates because this store update happens async and trigers a rerender
118
+ * more info:
119
+ * https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
120
+ * https://react-redux.js.org/api/batch
121
+ */
122
+ unstable_batchedUpdates(() => {
127
123
  handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
128
- }
124
+ });
129
125
  }, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
130
126
  return useCallback(async (url, isReloading = false, isMetadataRequest = false, id = '') => {
131
127
  const {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.8.1",
3
+ "version": "26.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useCallback, useMemo } from 'react';
2
2
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
3
  import { useFeatureFlag } from '@atlaskit/link-provider';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
4
  import { isSpecialEvent } from '../../utils';
6
5
  import * as measure from '../../utils/performance';
7
6
  import { getDefinitionId, getServices, isFinalState, getClickUrl, getResourceType, getExtensionKey, getSubproduct, getProduct } from '../../state/helpers';
@@ -260,13 +259,10 @@ function Component({
260
259
  }
261
260
  }
262
261
  export const CardWithUrlContent = props => {
263
- if (getBooleanFF('platform.linking-platform.smart-card.enable-analytics-context')) {
264
- const display = isFlexibleUiCard(props.children) ? CardDisplay.Flexible : props.appearance;
265
- return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
266
- url: props.url,
267
- id: props.id,
268
- display: display
269
- }, /*#__PURE__*/React.createElement(Component, props));
270
- }
271
- return /*#__PURE__*/React.createElement(Component, props);
262
+ const display = isFlexibleUiCard(props.children) ? CardDisplay.Flexible : props.appearance;
263
+ return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
264
+ url: props.url,
265
+ id: props.id,
266
+ display: display
267
+ }, /*#__PURE__*/React.createElement(Component, props));
272
268
  };
@@ -5,7 +5,6 @@ import { unstable_batchedUpdates } from 'react-dom';
5
5
  import { addMetadataToExperience } from '../../analytics';
6
6
  import { getStatus } from '../../helpers';
7
7
  import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, APIError, cardAction } from '@atlaskit/linking-common';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
8
  import { ERROR_MESSAGE_FATAL, ERROR_MESSAGE_METADATA, ERROR_MESSAGE_OAUTH } from '../../actions/constants';
10
9
  import { getUnauthorizedJsonLd } from '../../../utils/jsonld';
11
10
  import { SmartLinkStatus } from '../../../constants';
@@ -113,19 +112,16 @@ var useResolve = function useResolve() {
113
112
  handleResolvedLinkError(resourceUrl, new APIError('error', hostname, ERROR_MESSAGE_METADATA), response, isMetadataRequest);
114
113
  return;
115
114
  }
116
- if (getBooleanFF('platform.linking-platform.smart-card.enable-analytics-context')) {
117
- /**
118
- * Using unstable_batchedUpdates because this store update happens async and trigers a rerender
119
- * more info:
120
- * https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
121
- * https://react-redux.js.org/api/batch
122
- */
123
- unstable_batchedUpdates(function () {
124
- handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
125
- });
126
- } else {
115
+
116
+ /**
117
+ * Using unstable_batchedUpdates because this store update happens async and trigers a rerender
118
+ * more info:
119
+ * https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
120
+ * https://react-redux.js.org/api/batch
121
+ */
122
+ unstable_batchedUpdates(function () {
127
123
  handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
128
- }
124
+ });
129
125
  }, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
130
126
  return useCallback( /*#__PURE__*/function () {
131
127
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.8.1",
3
+ "version": "26.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useCallback, useMemo } from 'react';
2
2
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
3
  import { useFeatureFlag } from '@atlaskit/link-provider';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
4
  import { isSpecialEvent } from '../../utils';
6
5
  import * as measure from '../../utils/performance';
7
6
  import { getDefinitionId, getServices, isFinalState, getClickUrl, getResourceType, getExtensionKey, getSubproduct, getProduct } from '../../state/helpers';
@@ -263,13 +262,10 @@ function Component(_ref) {
263
262
  }
264
263
  }
265
264
  export var CardWithUrlContent = function CardWithUrlContent(props) {
266
- if (getBooleanFF('platform.linking-platform.smart-card.enable-analytics-context')) {
267
- var display = isFlexibleUiCard(props.children) ? CardDisplay.Flexible : props.appearance;
268
- return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
269
- url: props.url,
270
- id: props.id,
271
- display: display
272
- }, /*#__PURE__*/React.createElement(Component, props));
273
- }
274
- return /*#__PURE__*/React.createElement(Component, props);
265
+ var display = isFlexibleUiCard(props.children) ? CardDisplay.Flexible : props.appearance;
266
+ return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
267
+ url: props.url,
268
+ id: props.id,
269
+ display: display
270
+ }, /*#__PURE__*/React.createElement(Component, props));
275
271
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.8.1",
3
+ "version": "26.9.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -138,9 +138,6 @@
138
138
  ".": "./src/index.ts"
139
139
  },
140
140
  "platform-feature-flags": {
141
- "platform.linking-platform.smart-card.enable-analytics-context": {
142
- "type": "boolean"
143
- },
144
141
  "platform.linking-platform.smart-card.remove-dispatch-analytics-as-prop": {
145
142
  "type": "boolean"
146
143
  },