@atlaskit/editor-plugin-card 11.2.1 → 11.3.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,25 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 11.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`0ac75e0d28c72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0ac75e0d28c72) -
8
+ Migrate @atlaskit/editor-prosemirror/history to @atlaskit/prosemirror-history package
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 11.2.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [`6b08c3a8cde08`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6b08c3a8cde08) -
19
+ Construct confluence url from smart card embed preview href when smart card url is short
20
+ confluence url, in the form "{host}/wiki/x/{hash}"
21
+ - Updated dependencies
22
+
3
23
  ## 11.2.1
4
24
 
5
25
  ### Patch Changes
@@ -12,7 +12,9 @@ var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _hooks = require("@atlaskit/editor-common/hooks");
13
13
  var _ui = require("@atlaskit/editor-common/ui");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
+ var _linkExtractors = require("@atlaskit/link-extractors");
15
16
  var _smartCard = require("@atlaskit/smart-card");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
18
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
17
19
  var _actions = require("../pm-plugins/actions");
18
20
  var _pluginKey = require("../pm-plugins/plugin-key");
@@ -195,12 +197,16 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
195
197
  showPanelButtonIcon: isPreviewAvailable && isPreviewPanelAvailable ? 'panel' : 'modal',
196
198
  onClick: function onClick(event) {
197
199
  if (isPreviewPanelAvailable) {
200
+ var _extractSmartLinkEmbe;
198
201
  event.preventDefault();
199
202
  openPreviewPanel === null || openPreviewPanel === void 0 || openPreviewPanel({
200
203
  url: url,
201
204
  ari: ari || '',
202
205
  name: name || '',
203
- iconUrl: iconUrl
206
+ iconUrl: iconUrl,
207
+ panelData: {
208
+ embedUrl: (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = (0, _linkExtractors.extractSmartLinkEmbed)(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
209
+ }
204
210
  });
205
211
  firePreviewPanelClickEvent({
206
212
  previewType: 'panel'
@@ -13,9 +13,9 @@ var _analytics = require("@atlaskit/editor-common/analytics");
13
13
  var _card = require("@atlaskit/editor-common/card");
14
14
  var _link = require("@atlaskit/editor-common/link");
15
15
  var _utils = require("@atlaskit/editor-common/utils");
16
- var _history = require("@atlaskit/editor-prosemirror/history");
17
16
  var _state = require("@atlaskit/editor-prosemirror/state");
18
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
+ var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
19
19
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
20
20
  var _actions = require("./actions");
21
21
  var _pluginKey = require("./plugin-key");
@@ -135,7 +135,7 @@ var replaceQueuedUrlWithCard = exports.replaceQueuedUrlWithCard = function repla
135
135
  }
136
136
  }
137
137
  if (dispatch) {
138
- dispatch((0, _actions.resolveCard)(url)((0, _history.closeHistory)(tr)));
138
+ dispatch((0, _actions.resolveCard)(url)((0, _prosemirrorHistory.closeHistory)(tr)));
139
139
  }
140
140
  return true;
141
141
  };
@@ -42,7 +42,7 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
42
42
  }
43
43
  }, []);
44
44
  return (
45
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
45
+ // eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
46
46
  (0, _react2.jsx)("span", {
47
47
  // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
48
48
  onMouseEnter: function onMouseEnter() {
@@ -11,9 +11,11 @@ var _analytics = require("@atlaskit/editor-common/analytics");
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _ui = require("@atlaskit/editor-common/ui");
13
13
  var _panelRight = _interopRequireDefault(require("@atlaskit/icon/core/panel-right"));
14
+ var _linkExtractors = require("@atlaskit/link-extractors");
14
15
  var _linkProvider = require("@atlaskit/link-provider");
15
16
  var _compiled = require("@atlaskit/primitives/compiled");
16
17
  var _smartCard = require("@atlaskit/smart-card");
18
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
19
  var _utils = require("../../pm-plugins/utils");
18
20
  var _utils2 = require("../analytics/utils");
19
21
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -40,11 +42,15 @@ var OpenPreviewPanelToolbarButton = exports.OpenPreviewPanelToolbarButton = func
40
42
  }));
41
43
  var handleOpenGlancePanelClick = function handleOpenGlancePanelClick() {
42
44
  if (openPreviewPanel && isPanelAvailable) {
45
+ var _extractSmartLinkEmbe;
43
46
  openPreviewPanel({
44
47
  url: url,
45
48
  ari: ari,
46
49
  name: name || '',
47
- iconUrl: iconUrl
50
+ iconUrl: iconUrl,
51
+ panelData: {
52
+ embedUrl: (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = (0, _linkExtractors.extractSmartLinkEmbed)(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
53
+ }
48
54
  });
49
55
  }
50
56
  editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.fireAnalyticsEvent({
@@ -3,7 +3,9 @@ import { ACTION_SUBJECT_ID, EVENT_TYPE, ACTION, ACTION_SUBJECT } from '@atlaskit
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { HoverLinkOverlay } from '@atlaskit/editor-common/ui';
5
5
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
6
7
  import { getObjectAri, getObjectName, getObjectIconUrl } from '@atlaskit/smart-card';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
9
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
10
  import { registerRemoveOverlay } from '../pm-plugins/actions';
9
11
  import { pluginKey } from '../pm-plugins/plugin-key';
@@ -174,12 +176,16 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
174
176
  showPanelButtonIcon: isPreviewAvailable && isPreviewPanelAvailable ? 'panel' : 'modal',
175
177
  onClick: event => {
176
178
  if (isPreviewPanelAvailable) {
179
+ var _extractSmartLinkEmbe;
177
180
  event.preventDefault();
178
181
  openPreviewPanel === null || openPreviewPanel === void 0 ? void 0 : openPreviewPanel({
179
182
  url,
180
183
  ari: ari || '',
181
184
  name: name || '',
182
- iconUrl
185
+ iconUrl,
186
+ panelData: {
187
+ embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
188
+ }
183
189
  });
184
190
  firePreviewPanelClickEvent({
185
191
  previewType: 'panel'
@@ -4,9 +4,9 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, SM
4
4
  import { addLinkMetadata } from '@atlaskit/editor-common/card';
5
5
  import { getActiveLinkMark } from '@atlaskit/editor-common/link';
6
6
  import { getAnnotationMarksForPos, getLinkCreationAnalyticsEvent, isFromCurrentDomain, nodesBetweenChanged, processRawValue } from '@atlaskit/editor-common/utils';
7
- import { closeHistory } from '@atlaskit/editor-prosemirror/history';
8
7
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
9
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { closeHistory } from '@atlaskit/prosemirror-history';
10
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
11
  import { hideDatasourceModal, queueCards, removeDatasourceStash, resolveCard, setDatasourceStash } from './actions';
12
12
  import { pluginKey } from './plugin-key';
@@ -28,7 +28,7 @@ const OverlayWrapper = ({
28
28
  }
29
29
  }, []);
30
30
  return (
31
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
31
+ // eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
32
32
  jsx("span", {
33
33
  // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
34
34
  onMouseEnter: () => {
@@ -3,9 +3,11 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
3
3
  import { linkMessages } from '@atlaskit/editor-common/messages';
4
4
  import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
5
5
  import PanelRightIcon from '@atlaskit/icon/core/panel-right';
6
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
6
7
  import { useSmartLinkContext } from '@atlaskit/link-provider';
7
8
  import { Inline, Box, Flex } from '@atlaskit/primitives/compiled';
8
9
  import { getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
11
  import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
10
12
  import { appearanceForLink } from '../analytics/utils';
11
13
  export const OpenPreviewPanelToolbarButton = ({
@@ -32,11 +34,15 @@ export const OpenPreviewPanelToolbarButton = ({
32
34
  }));
33
35
  const handleOpenGlancePanelClick = () => {
34
36
  if (openPreviewPanel && isPanelAvailable) {
37
+ var _extractSmartLinkEmbe;
35
38
  openPreviewPanel({
36
39
  url,
37
40
  ari,
38
41
  name: name || '',
39
- iconUrl
42
+ iconUrl,
43
+ panelData: {
44
+ embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
45
+ }
40
46
  });
41
47
  }
42
48
  editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.fireAnalyticsEvent({
@@ -4,7 +4,9 @@ import { ACTION_SUBJECT_ID, EVENT_TYPE, ACTION, ACTION_SUBJECT } from '@atlaskit
4
4
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
5
  import { HoverLinkOverlay } from '@atlaskit/editor-common/ui';
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
7
8
  import { getObjectAri, getObjectName, getObjectIconUrl } from '@atlaskit/smart-card';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
11
  import { registerRemoveOverlay } from '../pm-plugins/actions';
10
12
  import { pluginKey } from '../pm-plugins/plugin-key';
@@ -186,12 +188,16 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
186
188
  showPanelButtonIcon: isPreviewAvailable && isPreviewPanelAvailable ? 'panel' : 'modal',
187
189
  onClick: function onClick(event) {
188
190
  if (isPreviewPanelAvailable) {
191
+ var _extractSmartLinkEmbe;
189
192
  event.preventDefault();
190
193
  openPreviewPanel === null || openPreviewPanel === void 0 || openPreviewPanel({
191
194
  url: url,
192
195
  ari: ari || '',
193
196
  name: name || '',
194
- iconUrl: iconUrl
197
+ iconUrl: iconUrl,
198
+ panelData: {
199
+ embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
200
+ }
195
201
  });
196
202
  firePreviewPanelClickEvent({
197
203
  previewType: 'panel'
@@ -8,9 +8,9 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, SM
8
8
  import { addLinkMetadata } from '@atlaskit/editor-common/card';
9
9
  import { getActiveLinkMark } from '@atlaskit/editor-common/link';
10
10
  import { getAnnotationMarksForPos, getLinkCreationAnalyticsEvent, isFromCurrentDomain, nodesBetweenChanged, processRawValue } from '@atlaskit/editor-common/utils';
11
- import { closeHistory } from '@atlaskit/editor-prosemirror/history';
12
11
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
13
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { closeHistory } from '@atlaskit/prosemirror-history';
14
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
15
15
  import { hideDatasourceModal, queueCards, removeDatasourceStash, resolveCard, setDatasourceStash } from './actions';
16
16
  import { pluginKey } from './plugin-key';
@@ -34,7 +34,7 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
34
34
  }
35
35
  }, []);
36
36
  return (
37
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
37
+ // eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
38
38
  jsx("span", {
39
39
  // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
40
40
  onMouseEnter: function onMouseEnter() {
@@ -6,9 +6,11 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
6
6
  import { linkMessages } from '@atlaskit/editor-common/messages';
7
7
  import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
8
8
  import PanelRightIcon from '@atlaskit/icon/core/panel-right';
9
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
9
10
  import { useSmartLinkContext } from '@atlaskit/link-provider';
10
11
  import { Inline, Box, Flex } from '@atlaskit/primitives/compiled';
11
12
  import { getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
14
  import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
13
15
  import { appearanceForLink } from '../analytics/utils';
14
16
  export var OpenPreviewPanelToolbarButton = function OpenPreviewPanelToolbarButton(_ref) {
@@ -33,11 +35,15 @@ export var OpenPreviewPanelToolbarButton = function OpenPreviewPanelToolbarButto
33
35
  }));
34
36
  var handleOpenGlancePanelClick = function handleOpenGlancePanelClick() {
35
37
  if (openPreviewPanel && isPanelAvailable) {
38
+ var _extractSmartLinkEmbe;
36
39
  openPreviewPanel({
37
40
  url: url,
38
41
  ari: ari,
39
42
  name: name || '',
40
- iconUrl: iconUrl
43
+ iconUrl: iconUrl,
44
+ panelData: {
45
+ embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
46
+ }
41
47
  });
42
48
  }
43
49
  editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.fireAnalyticsEvent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "11.2.1",
3
+ "version": "11.3.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,13 +32,13 @@
32
32
  "@atlaskit/adf-schema": "^51.2.0",
33
33
  "@atlaskit/analytics-next": "^11.1.0",
34
34
  "@atlaskit/button": "^23.5.0",
35
- "@atlaskit/custom-steps": "^0.14.0",
35
+ "@atlaskit/custom-steps": "^0.15.0",
36
36
  "@atlaskit/editor-card-provider": "^6.0.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^6.1.0",
38
- "@atlaskit/editor-plugin-base": "^7.0.0",
38
+ "@atlaskit/editor-plugin-base": "^7.1.0",
39
39
  "@atlaskit/editor-plugin-connectivity": "^6.0.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^6.1.0",
41
- "@atlaskit/editor-plugin-editor-disabled": "^6.0.0",
41
+ "@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
42
42
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
43
43
  "@atlaskit/editor-plugin-feature-flags": "^5.0.0",
44
44
  "@atlaskit/editor-plugin-floating-toolbar": "^8.2.0",
@@ -48,20 +48,22 @@
48
48
  "@atlaskit/editor-prosemirror": "7.0.0",
49
49
  "@atlaskit/editor-shared-styles": "^3.6.0",
50
50
  "@atlaskit/frontend-utilities": "^3.2.0",
51
- "@atlaskit/icon": "^28.4.0",
51
+ "@atlaskit/icon": "^28.5.0",
52
52
  "@atlaskit/link": "^3.2.0",
53
53
  "@atlaskit/link-analytics": "^11.0.0",
54
54
  "@atlaskit/link-client-extension": "^6.0.0",
55
55
  "@atlaskit/link-datasource": "^4.25.0",
56
+ "@atlaskit/link-extractors": "^2.4.0",
56
57
  "@atlaskit/linking-common": "^9.7.0",
57
58
  "@atlaskit/linking-types": "^14.0.0",
58
59
  "@atlaskit/menu": "^8.4.0",
59
60
  "@atlaskit/platform-feature-flags": "^1.1.0",
60
61
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
61
62
  "@atlaskit/primitives": "^14.15.0",
62
- "@atlaskit/smart-card": "^43.0.0",
63
+ "@atlaskit/prosemirror-history": "^0.2.0",
64
+ "@atlaskit/smart-card": "^43.1.0",
63
65
  "@atlaskit/theme": "^21.0.0",
64
- "@atlaskit/tmp-editor-statsig": "^13.2.0",
66
+ "@atlaskit/tmp-editor-statsig": "^13.6.0",
65
67
  "@atlaskit/tokens": "^6.4.0",
66
68
  "@babel/runtime": "^7.0.0",
67
69
  "@emotion/react": "^11.7.1",
@@ -71,7 +73,7 @@
71
73
  "uuid": "^3.1.0"
72
74
  },
73
75
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^110.4.0",
76
+ "@atlaskit/editor-common": "^110.10.0",
75
77
  "@atlaskit/link-provider": "^4.0.0",
76
78
  "react": "^18.2.0",
77
79
  "react-intl-next": "npm:react-intl@^5.18.1"