@atlaskit/editor-plugin-card 34.0.3 → 35.0.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,25 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 35.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5ffd5098ef9f9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5ffd5098ef9f9) -
8
+ Fix the paste menu "Display as" section being hidden when `platform_editor_menu_radius_update` is
9
+ enabled.
10
+ - Updated dependencies
11
+
12
+ ## 35.0.0
13
+
14
+ ### Patch Changes
15
+
16
+ - [`cd47720f33219`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd47720f33219) -
17
+ Report team mentions as creationMethod 'linkpicker_searchResult' instead of 'unknown' on the link
18
+ created event, and add a linkCreationType attribute ('mention' | 'conventionalSmartLink' | 'link')
19
+ so mentions can be told apart from conventional smart links. The team mention change is behind the
20
+ `platform_editor_team_mention_link_analytics` gate.
21
+ - Updated dependencies
22
+
3
23
  ## 34.0.3
4
24
 
5
25
  ### Patch Changes
@@ -59,7 +59,8 @@ var LinkEventsBinding = exports.LinkEventsBinding = function LinkEventsBinding(_
59
59
  }, sourceEvent, {
60
60
  display: display,
61
61
  nodeContext: nodeContext,
62
- creationMethod: creationMethod
62
+ creationMethod: creationMethod,
63
+ linkCreationType: (0, _common.getLinkCreationType)(metadata, display)
63
64
  });
64
65
  }), _types.EVENT.UPDATED, function (_ref3) {
65
66
  var node = _ref3.node,
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.getUpdateType = exports.getSourceEventFromMetadata = exports.getMethod = exports.getDeleteType = void 0;
7
+ exports.getUpdateType = exports.getSourceEventFromMetadata = exports.getMethod = exports.getLinkCreationType = exports.getDeleteType = void 0;
8
8
  var _UIAnalyticsEvent = _interopRequireDefault(require("@atlaskit/analytics-next/UIAnalyticsEvent"));
9
9
  var _enums = require("@atlaskit/editor-common/analytics/types/enums");
10
10
  /**
@@ -39,6 +39,7 @@ var getMethod = exports.getMethod = withHistoryMethod(function (_ref) {
39
39
  case _enums.INPUT_METHOD.FORMATTING:
40
40
  return 'editor_type';
41
41
  case _enums.INPUT_METHOD.TYPEAHEAD:
42
+ case _enums.INPUT_METHOD.MENTION_TYPEAHEAD:
42
43
  return 'linkpicker_searchResult';
43
44
  case _enums.INPUT_METHOD.MANUAL:
44
45
  return 'linkpicker_manual';
@@ -48,8 +49,15 @@ var getMethod = exports.getMethod = withHistoryMethod(function (_ref) {
48
49
  return 'unknown';
49
50
  }
50
51
  });
51
- var getUpdateType = exports.getUpdateType = withHistoryMethod(function (_ref2) {
52
- var action = _ref2.action;
52
+ var getLinkCreationType = exports.getLinkCreationType = function getLinkCreationType(_ref2, display) {
53
+ var inputMethod = _ref2.inputMethod;
54
+ if (inputMethod === _enums.INPUT_METHOD.MENTION_TYPEAHEAD) {
55
+ return 'mention';
56
+ }
57
+ return display === 'url' ? 'link' : 'conventionalSmartLink';
58
+ };
59
+ var getUpdateType = exports.getUpdateType = withHistoryMethod(function (_ref3) {
60
+ var action = _ref3.action;
53
61
  switch (action) {
54
62
  case _enums.ACTION.CHANGED_TYPE:
55
63
  return 'display_update';
@@ -59,8 +67,8 @@ var getUpdateType = exports.getUpdateType = withHistoryMethod(function (_ref2) {
59
67
  return 'unknown';
60
68
  }
61
69
  });
62
- var getDeleteType = exports.getDeleteType = withHistoryMethod(function (_ref3) {
63
- var action = _ref3.action;
70
+ var getDeleteType = exports.getDeleteType = withHistoryMethod(function (_ref4) {
71
+ var action = _ref4.action;
64
72
  if (action === _enums.ACTION.UNLINK) {
65
73
  return 'unlink';
66
74
  }
@@ -65,7 +65,8 @@ var AppearanceOptionIconButton = function AppearanceOptionIconButton(_ref) {
65
65
  Icon = _ref.Icon,
66
66
  onClick = _ref.onClick;
67
67
  return /*#__PURE__*/_react.default.createElement(_box.Box, {
68
- xcss: styles.iconWrapper
68
+ xcss: styles.iconWrapper,
69
+ "data-toolbar-component": "menu-item"
69
70
  }, /*#__PURE__*/_react.default.createElement(_toolbarTooltip.ToolbarTooltip, {
70
71
  content: label,
71
72
  position: "bottom"
@@ -2,7 +2,7 @@ import { useEffect, useMemo } from 'react';
2
2
  import { useSmartLinkLifecycleAnalytics } from '@atlaskit/link-analytics/use-smart-link-lifecycle-analytics';
3
3
  import { EVENT, EVENT_SUBJECT } from '../analytics/types';
4
4
  import { appearanceForLink, getUrl } from '../analytics/utils';
5
- import { getDeleteType, getMethod, getSourceEventFromMetadata, getUpdateType } from './common';
5
+ import { getDeleteType, getLinkCreationType, getMethod, getSourceEventFromMetadata, getUpdateType } from './common';
6
6
 
7
7
  /**
8
8
  * Set display category as `link` if not displaying the link as a smart card
@@ -52,7 +52,8 @@ export const LinkEventsBinding = ({
52
52
  }, sourceEvent, {
53
53
  display,
54
54
  nodeContext,
55
- creationMethod
55
+ creationMethod,
56
+ linkCreationType: getLinkCreationType(metadata, display)
56
57
  });
57
58
  },
58
59
  [EVENT.UPDATED]: ({
@@ -35,6 +35,7 @@ export const getMethod = withHistoryMethod(({
35
35
  case INPUT_METHOD.FORMATTING:
36
36
  return 'editor_type';
37
37
  case INPUT_METHOD.TYPEAHEAD:
38
+ case INPUT_METHOD.MENTION_TYPEAHEAD:
38
39
  return 'linkpicker_searchResult';
39
40
  case INPUT_METHOD.MANUAL:
40
41
  return 'linkpicker_manual';
@@ -44,6 +45,14 @@ export const getMethod = withHistoryMethod(({
44
45
  return 'unknown';
45
46
  }
46
47
  });
48
+ export const getLinkCreationType = ({
49
+ inputMethod
50
+ }, display) => {
51
+ if (inputMethod === INPUT_METHOD.MENTION_TYPEAHEAD) {
52
+ return 'mention';
53
+ }
54
+ return display === 'url' ? 'link' : 'conventionalSmartLink';
55
+ };
47
56
  export const getUpdateType = withHistoryMethod(({
48
57
  action
49
58
  }) => {
@@ -55,7 +55,8 @@ const AppearanceOptionIconButton = ({
55
55
  onClick
56
56
  }) => {
57
57
  return /*#__PURE__*/React.createElement(Box, {
58
- xcss: styles.iconWrapper
58
+ xcss: styles.iconWrapper,
59
+ "data-toolbar-component": "menu-item"
59
60
  }, /*#__PURE__*/React.createElement(ToolbarTooltip, {
60
61
  content: label,
61
62
  position: "bottom"
@@ -7,7 +7,7 @@ import { useEffect, useMemo } from 'react';
7
7
  import { useSmartLinkLifecycleAnalytics } from '@atlaskit/link-analytics/use-smart-link-lifecycle-analytics';
8
8
  import { EVENT, EVENT_SUBJECT } from '../analytics/types';
9
9
  import { appearanceForLink, getUrl } from '../analytics/utils';
10
- import { getDeleteType, getMethod, getSourceEventFromMetadata, getUpdateType } from './common';
10
+ import { getDeleteType, getLinkCreationType, getMethod, getSourceEventFromMetadata, getUpdateType } from './common';
11
11
 
12
12
  /**
13
13
  * Set display category as `link` if not displaying the link as a smart card
@@ -53,7 +53,8 @@ export var LinkEventsBinding = function LinkEventsBinding(_ref) {
53
53
  }, sourceEvent, {
54
54
  display: display,
55
55
  nodeContext: nodeContext,
56
- creationMethod: creationMethod
56
+ creationMethod: creationMethod,
57
+ linkCreationType: getLinkCreationType(metadata, display)
57
58
  });
58
59
  }), EVENT.UPDATED, function (_ref3) {
59
60
  var node = _ref3.node,
@@ -32,6 +32,7 @@ export var getMethod = withHistoryMethod(function (_ref) {
32
32
  case INPUT_METHOD.FORMATTING:
33
33
  return 'editor_type';
34
34
  case INPUT_METHOD.TYPEAHEAD:
35
+ case INPUT_METHOD.MENTION_TYPEAHEAD:
35
36
  return 'linkpicker_searchResult';
36
37
  case INPUT_METHOD.MANUAL:
37
38
  return 'linkpicker_manual';
@@ -41,8 +42,15 @@ export var getMethod = withHistoryMethod(function (_ref) {
41
42
  return 'unknown';
42
43
  }
43
44
  });
44
- export var getUpdateType = withHistoryMethod(function (_ref2) {
45
- var action = _ref2.action;
45
+ export var getLinkCreationType = function getLinkCreationType(_ref2, display) {
46
+ var inputMethod = _ref2.inputMethod;
47
+ if (inputMethod === INPUT_METHOD.MENTION_TYPEAHEAD) {
48
+ return 'mention';
49
+ }
50
+ return display === 'url' ? 'link' : 'conventionalSmartLink';
51
+ };
52
+ export var getUpdateType = withHistoryMethod(function (_ref3) {
53
+ var action = _ref3.action;
46
54
  switch (action) {
47
55
  case ACTION.CHANGED_TYPE:
48
56
  return 'display_update';
@@ -52,8 +60,8 @@ export var getUpdateType = withHistoryMethod(function (_ref2) {
52
60
  return 'unknown';
53
61
  }
54
62
  });
55
- export var getDeleteType = withHistoryMethod(function (_ref3) {
56
- var action = _ref3.action;
63
+ export var getDeleteType = withHistoryMethod(function (_ref4) {
64
+ var action = _ref4.action;
57
65
  if (action === ACTION.UNLINK) {
58
66
  return 'unlink';
59
67
  }
@@ -56,7 +56,8 @@ var AppearanceOptionIconButton = function AppearanceOptionIconButton(_ref) {
56
56
  Icon = _ref.Icon,
57
57
  onClick = _ref.onClick;
58
58
  return /*#__PURE__*/React.createElement(Box, {
59
- xcss: styles.iconWrapper
59
+ xcss: styles.iconWrapper,
60
+ "data-toolbar-component": "menu-item"
60
61
  }, /*#__PURE__*/React.createElement(ToolbarTooltip, {
61
62
  content: label,
62
63
  position: "bottom"
@@ -14,6 +14,7 @@ type EventMetadata = {
14
14
  sourceEvent?: unknown;
15
15
  };
16
16
  export declare const getMethod: (metadata: EventMetadata) => string | undefined;
17
+ export declare const getLinkCreationType: ({ inputMethod }: EventMetadata, display: string) => 'mention' | 'conventionalSmartLink' | 'link';
17
18
  export declare const getUpdateType: (metadata: EventMetadata) => string | undefined;
18
19
  export declare const getDeleteType: (metadata: EventMetadata) => string | undefined;
19
20
  export declare const getSourceEventFromMetadata: (metadata: EventMetadata) => UIAnalyticsEvent | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "34.0.3",
3
+ "version": "35.0.1",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,21 +27,21 @@
27
27
  "@atlaskit/css": "^1.1.0",
28
28
  "@atlaskit/custom-steps": "^1.1.0",
29
29
  "@atlaskit/editor-card-provider": "^8.1.0",
30
- "@atlaskit/editor-plugin-analytics": "^28.0.0",
31
- "@atlaskit/editor-plugin-annotation": "^28.1.0",
32
- "@atlaskit/editor-plugin-base": "^29.0.0",
33
- "@atlaskit/editor-plugin-connectivity": "^28.0.0",
34
- "@atlaskit/editor-plugin-decorations": "^28.0.0",
35
- "@atlaskit/editor-plugin-editor-disabled": "^28.0.0",
36
- "@atlaskit/editor-plugin-editor-viewmode": "^30.0.0",
37
- "@atlaskit/editor-plugin-feature-flags": "^27.0.0",
38
- "@atlaskit/editor-plugin-floating-toolbar": "^30.0.0",
39
- "@atlaskit/editor-plugin-grid": "^28.0.0",
40
- "@atlaskit/editor-plugin-selection": "^28.0.0",
41
- "@atlaskit/editor-plugin-toolbar": "^25.0.0",
42
- "@atlaskit/editor-plugin-ui-control-registry": "^22.0.0",
43
- "@atlaskit/editor-plugin-user-intent": "^26.0.0",
44
- "@atlaskit/editor-plugin-width": "^29.0.0",
30
+ "@atlaskit/editor-plugin-analytics": "^29.0.0",
31
+ "@atlaskit/editor-plugin-annotation": "^29.0.0",
32
+ "@atlaskit/editor-plugin-base": "^30.0.0",
33
+ "@atlaskit/editor-plugin-connectivity": "^29.0.0",
34
+ "@atlaskit/editor-plugin-decorations": "^29.0.0",
35
+ "@atlaskit/editor-plugin-editor-disabled": "^29.0.0",
36
+ "@atlaskit/editor-plugin-editor-viewmode": "^31.0.0",
37
+ "@atlaskit/editor-plugin-feature-flags": "^28.0.0",
38
+ "@atlaskit/editor-plugin-floating-toolbar": "^31.0.0",
39
+ "@atlaskit/editor-plugin-grid": "^29.0.0",
40
+ "@atlaskit/editor-plugin-selection": "^29.0.0",
41
+ "@atlaskit/editor-plugin-toolbar": "^26.0.0",
42
+ "@atlaskit/editor-plugin-ui-control-registry": "^23.0.0",
43
+ "@atlaskit/editor-plugin-user-intent": "^27.0.0",
44
+ "@atlaskit/editor-plugin-width": "^30.0.0",
45
45
  "@atlaskit/editor-prosemirror": "^9.0.0",
46
46
  "@atlaskit/editor-shared-styles": "^4.5.0",
47
47
  "@atlaskit/editor-smart-link-draggable": "^1.2.0",
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/primitives": "^22.6.0",
65
65
  "@atlaskit/prosemirror-history": "^1.3.0",
66
66
  "@atlaskit/smart-card": "^46.7.0",
67
- "@atlaskit/tmp-editor-statsig": "^242.0.0",
67
+ "@atlaskit/tmp-editor-statsig": "^243.0.0",
68
68
  "@atlaskit/tokens": "^20.6.0",
69
69
  "@babel/runtime": "^7.0.0",
70
70
  "@emotion/react": "^11.7.1",
@@ -74,7 +74,7 @@
74
74
  "uuid": "^11.1.1"
75
75
  },
76
76
  "peerDependencies": {
77
- "@atlaskit/editor-common": "^132.0.0",
77
+ "@atlaskit/editor-common": "^133.1.0",
78
78
  "@atlaskit/link-provider": "^6.0.0",
79
79
  "react": "^18.2.0 || ^19.2.0",
80
80
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"