@atlaskit/editor-plugin-card 11.2.0 → 11.2.2

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,20 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 11.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6b08c3a8cde08`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6b08c3a8cde08) -
8
+ Construct confluence url from smart card embed preview href when smart card url is short
9
+ confluence url, in the form "{host}/wiki/x/{hash}"
10
+ - Updated dependencies
11
+
12
+ ## 11.2.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 11.2.0
4
19
 
5
20
  ### Minor 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'
@@ -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'
@@ -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'
@@ -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.0",
3
+ "version": "11.2.2",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,27 +41,28 @@
41
41
  "@atlaskit/editor-plugin-editor-disabled": "^6.0.0",
42
42
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
43
43
  "@atlaskit/editor-plugin-feature-flags": "^5.0.0",
44
- "@atlaskit/editor-plugin-floating-toolbar": "^8.1.0",
44
+ "@atlaskit/editor-plugin-floating-toolbar": "^8.2.0",
45
45
  "@atlaskit/editor-plugin-grid": "^6.0.0",
46
- "@atlaskit/editor-plugin-toolbar": "^3.0.0",
46
+ "@atlaskit/editor-plugin-toolbar": "^3.1.0",
47
47
  "@atlaskit/editor-plugin-width": "^7.0.0",
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.3.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": "^42.3.0",
63
+ "@atlaskit/smart-card": "^43.1.0",
63
64
  "@atlaskit/theme": "^21.0.0",
64
- "@atlaskit/tmp-editor-statsig": "^13.0.0",
65
+ "@atlaskit/tmp-editor-statsig": "^13.6.0",
65
66
  "@atlaskit/tokens": "^6.4.0",
66
67
  "@babel/runtime": "^7.0.0",
67
68
  "@emotion/react": "^11.7.1",
@@ -71,7 +72,7 @@
71
72
  "uuid": "^3.1.0"
72
73
  },
73
74
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^110.4.0",
75
+ "@atlaskit/editor-common": "^110.9.0",
75
76
  "@atlaskit/link-provider": "^4.0.0",
76
77
  "react": "^18.2.0",
77
78
  "react-intl-next": "npm:react-intl@^5.18.1"