@atlaskit/editor-plugin-card 0.10.9 → 0.10.10

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/editor-plugin-card
2
2
 
3
+ ## 0.10.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42151](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42151) [`192b62f6d36`](https://bitbucket.org/atlassian/atlassian-frontend/commits/192b62f6d36) - Cleans up editor feature flag 'lp-analytics-events-next'. Card plugin will now always dispatch link tracking events.
8
+
3
9
  ## 0.10.9
4
10
 
5
11
  ### Patch Changes
@@ -35,7 +35,7 @@ var cardPlugin = exports.cardPlugin = function cardPlugin(_ref) {
35
35
  var options = _ref.config,
36
36
  api = _ref.api;
37
37
  var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
38
- var cardPluginEvents = featureFlags !== null && featureFlags !== void 0 && featureFlags.lpAnalyticsEventsNext ? (0, _createEventsQueue.createEventsQueue)() : undefined;
38
+ var cardPluginEvents = (0, _createEventsQueue.createEventsQueue)();
39
39
  return {
40
40
  name: 'card',
41
41
  getSharedState: function getSharedState(editorState) {
@@ -101,7 +101,7 @@ var cardPlugin = exports.cardPlugin = function cardPlugin(_ref) {
101
101
  popupsBoundariesElement = _ref3.popupsBoundariesElement;
102
102
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_EditorSmartCardEvents.EditorSmartCardEvents, {
103
103
  editorView: editorView
104
- }), cardPluginEvents && /*#__PURE__*/_react.default.createElement(_EditorLinkingPlatformAnalytics.EditorLinkingPlatformAnalytics, {
104
+ }), /*#__PURE__*/_react.default.createElement(_EditorLinkingPlatformAnalytics.EditorLinkingPlatformAnalytics, {
105
105
  cardPluginEvents: cardPluginEvents,
106
106
  editorView: editorView
107
107
  }), /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
@@ -29,14 +29,15 @@ var EditorLinkingPlatformAnalytics = exports.EditorLinkingPlatformAnalytics = /*
29
29
  (0, _createClass2.default)(EditorLinkingPlatformAnalytics, [{
30
30
  key: "render",
31
31
  value: function render() {
32
- var cardContext = this.context.contextAdapter.card;
32
+ var _this$context;
33
+ var cardContext = (_this$context = this.context) === null || _this$context === void 0 || (_this$context = _this$context.contextAdapter) === null || _this$context === void 0 ? void 0 : _this$context.card;
33
34
 
34
35
  /**
35
36
  * The analytics hook needs to be able to communicate with the card context
36
37
  * If we can't access it, don't mount the event bindings
37
38
  * This effectively entirely disables all tracking behaviour
38
39
  */
39
- if (!cardContext) {
40
+ if (!(cardContext !== null && cardContext !== void 0 && cardContext.value)) {
40
41
  return null;
41
42
  }
42
43
  return /*#__PURE__*/_react.default.createElement(cardContext.Provider, {
@@ -26,7 +26,7 @@ export const cardPlugin = ({
26
26
  }) => {
27
27
  var _api$featureFlags;
28
28
  const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
29
- const cardPluginEvents = featureFlags !== null && featureFlags !== void 0 && featureFlags.lpAnalyticsEventsNext ? createEventsQueue() : undefined;
29
+ const cardPluginEvents = createEventsQueue();
30
30
  return {
31
31
  name: 'card',
32
32
  getSharedState(editorState) {
@@ -93,7 +93,7 @@ export const cardPlugin = ({
93
93
  }) {
94
94
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EditorSmartCardEvents, {
95
95
  editorView: editorView
96
- }), cardPluginEvents && /*#__PURE__*/React.createElement(EditorLinkingPlatformAnalytics, {
96
+ }), /*#__PURE__*/React.createElement(EditorLinkingPlatformAnalytics, {
97
97
  cardPluginEvents: cardPluginEvents,
98
98
  editorView: editorView
99
99
  }), /*#__PURE__*/React.createElement(LayoutButton, {
@@ -8,14 +8,15 @@ import { LinkEventsBinding } from './LinkEvents';
8
8
  // eslint-disable-next-line @repo/internal/react/no-class-components
9
9
  export class EditorLinkingPlatformAnalytics extends React.PureComponent {
10
10
  render() {
11
- const cardContext = this.context.contextAdapter.card;
11
+ var _this$context, _this$context$context;
12
+ const cardContext = (_this$context = this.context) === null || _this$context === void 0 ? void 0 : (_this$context$context = _this$context.contextAdapter) === null || _this$context$context === void 0 ? void 0 : _this$context$context.card;
12
13
 
13
14
  /**
14
15
  * The analytics hook needs to be able to communicate with the card context
15
16
  * If we can't access it, don't mount the event bindings
16
17
  * This effectively entirely disables all tracking behaviour
17
18
  */
18
- if (!cardContext) {
19
+ if (!(cardContext !== null && cardContext !== void 0 && cardContext.value)) {
19
20
  return null;
20
21
  }
21
22
  return /*#__PURE__*/React.createElement(cardContext.Provider, {
@@ -28,7 +28,7 @@ export var cardPlugin = function cardPlugin(_ref) {
28
28
  var options = _ref.config,
29
29
  api = _ref.api;
30
30
  var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
31
- var cardPluginEvents = featureFlags !== null && featureFlags !== void 0 && featureFlags.lpAnalyticsEventsNext ? createEventsQueue() : undefined;
31
+ var cardPluginEvents = createEventsQueue();
32
32
  return {
33
33
  name: 'card',
34
34
  getSharedState: function getSharedState(editorState) {
@@ -94,7 +94,7 @@ export var cardPlugin = function cardPlugin(_ref) {
94
94
  popupsBoundariesElement = _ref3.popupsBoundariesElement;
95
95
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EditorSmartCardEvents, {
96
96
  editorView: editorView
97
- }), cardPluginEvents && /*#__PURE__*/React.createElement(EditorLinkingPlatformAnalytics, {
97
+ }), /*#__PURE__*/React.createElement(EditorLinkingPlatformAnalytics, {
98
98
  cardPluginEvents: cardPluginEvents,
99
99
  editorView: editorView
100
100
  }), /*#__PURE__*/React.createElement(LayoutButton, {
@@ -23,14 +23,15 @@ export var EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureCo
23
23
  _createClass(EditorLinkingPlatformAnalytics, [{
24
24
  key: "render",
25
25
  value: function render() {
26
- var cardContext = this.context.contextAdapter.card;
26
+ var _this$context;
27
+ var cardContext = (_this$context = this.context) === null || _this$context === void 0 || (_this$context = _this$context.contextAdapter) === null || _this$context === void 0 ? void 0 : _this$context.card;
27
28
 
28
29
  /**
29
30
  * The analytics hook needs to be able to communicate with the card context
30
31
  * If we can't access it, don't mount the event bindings
31
32
  * This effectively entirely disables all tracking behaviour
32
33
  */
33
- if (!cardContext) {
34
+ if (!(cardContext !== null && cardContext !== void 0 && cardContext.value)) {
34
35
  return null;
35
36
  }
36
37
  return /*#__PURE__*/React.createElement(cardContext.Provider, {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { AnalyticsBindingsProps } from './common';
3
+ import type { AnalyticsBindingsProps } from './common';
4
4
  export declare class EditorLinkingPlatformAnalytics extends React.PureComponent<AnalyticsBindingsProps> {
5
5
  static contextTypes: {
6
6
  contextAdapter: PropTypes.Requireable<object>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { AnalyticsBindingsProps } from './common';
3
+ import type { AnalyticsBindingsProps } from './common';
4
4
  export declare class EditorLinkingPlatformAnalytics extends React.PureComponent<AnalyticsBindingsProps> {
5
5
  static contextTypes: {
6
6
  contextAdapter: PropTypes.Requireable<object>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "0.10.9",
3
+ "version": "0.10.10",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,8 +47,8 @@
47
47
  "@atlaskit/frontend-utilities": "^2.7.0",
48
48
  "@atlaskit/icon": "^21.12.0",
49
49
  "@atlaskit/link-analytics": "^8.3.0",
50
- "@atlaskit/link-datasource": "^1.12.0",
51
- "@atlaskit/linking-common": "^4.15.0",
50
+ "@atlaskit/link-datasource": "^1.13.0",
51
+ "@atlaskit/linking-common": "^4.16.0",
52
52
  "@atlaskit/platform-feature-flags": "^0.2.0",
53
53
  "@atlaskit/smart-card": "^26.41.0",
54
54
  "@atlaskit/theme": "^12.6.0",