@atlaskit/editor-plugin-card 2.8.1 → 2.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,24 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 2.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`aef5432662b58`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aef5432662b58) -
8
+ [ux] EDM-10363 Implement opening links via configure overlay dropdown open link button
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 2.8.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [#112464](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112464)
19
+ [`e26f188519478`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e26f188519478) -
20
+ Remove feature flag that is fully rolled out
21
+
3
22
  ## 2.8.1
4
23
 
5
24
  ### Patch Changes
@@ -12,6 +12,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
14
14
  var _hooks = require("@atlaskit/editor-common/hooks");
15
+ var _link = require("@atlaskit/editor-common/link");
15
16
  var _ui = require("@atlaskit/editor-common/ui");
16
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
18
  var _smartCard = require("@atlaskit/smart-card");
@@ -144,7 +145,16 @@ function InlineCardNodeView(props) {
144
145
  return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/_react.default.createElement(_ConfigureOverlay.default, {
145
146
  targetElementPos: getPos(),
146
147
  view: view,
147
- isHoveredCallback: setIsOverlayHovered
148
+ isHoveredCallback: setIsOverlayHovered,
149
+ onOpenLinkClick: function onOpenLinkClick(event) {
150
+ var _pluginInjectionApi$a;
151
+ (0, _link.handleNavigation)({
152
+ fireAnalyticsEvent: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent,
153
+ onClickCallback: onClickCallback,
154
+ url: node.attrs.url,
155
+ event: event
156
+ });
157
+ }
148
158
  }, inlineCard);
149
159
  }
150
160
  return /*#__PURE__*/_react.default.createElement(WrappedInlineCardWithAwareness, (0, _extends2.default)({
@@ -12,7 +12,6 @@ var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
13
13
  var _utils = require("@atlaskit/editor-common/utils");
14
14
  var _linkDatasource = require("@atlaskit/link-datasource");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _createEventsQueue = require("./analytics/create-events-queue");
17
16
  var _actions = require("./pm-plugins/actions");
18
17
  var _doc = require("./pm-plugins/doc");
@@ -142,7 +141,7 @@ var cardPlugin = exports.cardPlugin = function cardPlugin(_ref) {
142
141
  if ((0, _utils.canRenderDatasource)(_linkDatasource.ASSETS_LIST_OF_LINKS_DATASOURCE_ID)) {
143
142
  quickInsertArray.push({
144
143
  id: 'datasource',
145
- title: (0, _platformFeatureFlags.fg)('platform.linking-platform.datasource-assets_objects_remove_beta') ? formatMessage(_messages.cardMessages.datasourceAssetsObjectsGeneralAvailability) : formatMessage(_messages.cardMessages.datasourceAssetsObjects),
144
+ title: formatMessage(_messages.cardMessages.datasourceAssetsObjectsGeneralAvailability),
146
145
  description: formatMessage(_messages.cardMessages.datasourceAssetsObjectsDescription),
147
146
  categories: ['external-content', 'development'],
148
147
  keywords: ['assets'],
@@ -25,7 +25,8 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
25
25
  var view = _ref.view,
26
26
  targetElementPos = _ref.targetElementPos,
27
27
  children = _ref.children,
28
- hoverCallback = _ref.isHoveredCallback;
28
+ hoverCallback = _ref.isHoveredCallback,
29
+ onOpenLinkClick = _ref.onOpenLinkClick;
29
30
  var _useState = (0, _react.useState)(false),
30
31
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
31
32
  showConfigureButton = _useState2[0],
@@ -57,7 +58,8 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
57
58
  }, showConfigureButton && (0, _react2.jsx)(_link.OverlayButton, {
58
59
  editorView: view,
59
60
  targetElementPos: targetElementPos,
60
- onDropdownChange: onDropdownChange
61
+ onDropdownChange: onDropdownChange,
62
+ onOpenLinkClick: onOpenLinkClick
61
63
  })), children);
62
64
  };
63
65
  var _default = exports.default = OverlayWrapper;
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { memo, useCallback, useMemo, useState } from 'react';
3
3
  import rafSchedule from 'raf-schd';
4
4
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
5
+ import { handleNavigation } from '@atlaskit/editor-common/link';
5
6
  import { findOverflowScrollParent, UnsupportedInline } from '@atlaskit/editor-common/ui';
6
7
  import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { Card as SmartCard } from '@atlaskit/smart-card';
@@ -134,7 +135,16 @@ export function InlineCardNodeView(props) {
134
135
  return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
135
136
  targetElementPos: getPos(),
136
137
  view: view,
137
- isHoveredCallback: setIsOverlayHovered
138
+ isHoveredCallback: setIsOverlayHovered,
139
+ onOpenLinkClick: event => {
140
+ var _pluginInjectionApi$a;
141
+ handleNavigation({
142
+ fireAnalyticsEvent: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent,
143
+ onClickCallback,
144
+ url: node.attrs.url,
145
+ event
146
+ });
147
+ }
138
148
  }, inlineCard);
139
149
  }
140
150
  return /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
@@ -4,7 +4,6 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
4
4
  import { IconDatasourceAssetsObjects, IconDatasourceConfluenceSearch, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
5
5
  import { canRenderDatasource } from '@atlaskit/editor-common/utils';
6
6
  import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { createEventsQueue } from './analytics/create-events-queue';
9
8
  import { hideLinkToolbar, showDatasourceModal } from './pm-plugins/actions';
10
9
  import { queueCardsFromChangedTr } from './pm-plugins/doc';
@@ -135,7 +134,7 @@ export const cardPlugin = ({
135
134
  if (canRenderDatasource(ASSETS_LIST_OF_LINKS_DATASOURCE_ID)) {
136
135
  quickInsertArray.push({
137
136
  id: 'datasource',
138
- title: fg('platform.linking-platform.datasource-assets_objects_remove_beta') ? formatMessage(messages.datasourceAssetsObjectsGeneralAvailability) : formatMessage(messages.datasourceAssetsObjects),
137
+ title: formatMessage(messages.datasourceAssetsObjectsGeneralAvailability),
139
138
  description: formatMessage(messages.datasourceAssetsObjectsDescription),
140
139
  categories: ['external-content', 'development'],
141
140
  keywords: ['assets'],
@@ -16,7 +16,8 @@ const OverlayWrapper = ({
16
16
  view,
17
17
  targetElementPos,
18
18
  children,
19
- isHoveredCallback: hoverCallback
19
+ isHoveredCallback: hoverCallback,
20
+ onOpenLinkClick
20
21
  }) => {
21
22
  const [showConfigureButton, setShowConfigureButton] = useState(false);
22
23
  const [dropdownOpen, setDropdownOpen] = useState(false);
@@ -43,7 +44,8 @@ const OverlayWrapper = ({
43
44
  }, showConfigureButton && jsx(OverlayButton, {
44
45
  editorView: view,
45
46
  targetElementPos: targetElementPos,
46
- onDropdownChange: onDropdownChange
47
+ onDropdownChange: onDropdownChange,
48
+ onOpenLinkClick: onOpenLinkClick
47
49
  })), children);
48
50
  };
49
51
  export default OverlayWrapper;
@@ -3,6 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import React, { memo, useCallback, useMemo, useState } from 'react';
4
4
  import rafSchedule from 'raf-schd';
5
5
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
6
+ import { handleNavigation } from '@atlaskit/editor-common/link';
6
7
  import { findOverflowScrollParent, UnsupportedInline } from '@atlaskit/editor-common/ui';
7
8
  import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { Card as SmartCard } from '@atlaskit/smart-card';
@@ -133,7 +134,16 @@ export function InlineCardNodeView(props) {
133
134
  return (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? inlineCard : /*#__PURE__*/React.createElement(OverlayWrapper, {
134
135
  targetElementPos: getPos(),
135
136
  view: view,
136
- isHoveredCallback: setIsOverlayHovered
137
+ isHoveredCallback: setIsOverlayHovered,
138
+ onOpenLinkClick: function onOpenLinkClick(event) {
139
+ var _pluginInjectionApi$a;
140
+ handleNavigation({
141
+ fireAnalyticsEvent: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent,
142
+ onClickCallback: onClickCallback,
143
+ url: node.attrs.url,
144
+ event: event
145
+ });
146
+ }
137
147
  }, inlineCard);
138
148
  }
139
149
  return /*#__PURE__*/React.createElement(WrappedInlineCardWithAwareness, _extends({
@@ -7,7 +7,6 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { IconDatasourceAssetsObjects, IconDatasourceConfluenceSearch, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
8
8
  import { canRenderDatasource } from '@atlaskit/editor-common/utils';
9
9
  import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { createEventsQueue } from './analytics/create-events-queue';
12
11
  import { hideLinkToolbar, showDatasourceModal } from './pm-plugins/actions';
13
12
  import { queueCardsFromChangedTr } from './pm-plugins/doc';
@@ -135,7 +134,7 @@ export var cardPlugin = function cardPlugin(_ref) {
135
134
  if (canRenderDatasource(ASSETS_LIST_OF_LINKS_DATASOURCE_ID)) {
136
135
  quickInsertArray.push({
137
136
  id: 'datasource',
138
- title: fg('platform.linking-platform.datasource-assets_objects_remove_beta') ? formatMessage(messages.datasourceAssetsObjectsGeneralAvailability) : formatMessage(messages.datasourceAssetsObjects),
137
+ title: formatMessage(messages.datasourceAssetsObjectsGeneralAvailability),
139
138
  description: formatMessage(messages.datasourceAssetsObjectsDescription),
140
139
  categories: ['external-content', 'development'],
141
140
  keywords: ['assets'],
@@ -17,7 +17,8 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
17
17
  var view = _ref.view,
18
18
  targetElementPos = _ref.targetElementPos,
19
19
  children = _ref.children,
20
- hoverCallback = _ref.isHoveredCallback;
20
+ hoverCallback = _ref.isHoveredCallback,
21
+ onOpenLinkClick = _ref.onOpenLinkClick;
21
22
  var _useState = useState(false),
22
23
  _useState2 = _slicedToArray(_useState, 2),
23
24
  showConfigureButton = _useState2[0],
@@ -49,7 +50,8 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
49
50
  }, showConfigureButton && jsx(OverlayButton, {
50
51
  editorView: view,
51
52
  targetElementPos: targetElementPos,
52
- onDropdownChange: onDropdownChange
53
+ onDropdownChange: onDropdownChange,
54
+ onOpenLinkClick: onOpenLinkClick
53
55
  })), children);
54
56
  };
55
57
  export default OverlayWrapper;
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { jsx } from '@emotion/react';
3
3
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
4
- declare const OverlayWrapper: ({ view, targetElementPos, children, isHoveredCallback: hoverCallback, }: {
4
+ declare const OverlayWrapper: ({ view, targetElementPos, children, isHoveredCallback: hoverCallback, onOpenLinkClick, }: {
5
5
  view: EditorView;
6
6
  targetElementPos: number | undefined;
7
7
  children: JSX.Element;
8
8
  /** Fired when the mouse enters or leaves the overlay button */
9
9
  isHoveredCallback: (isHovered: boolean) => void;
10
+ onOpenLinkClick: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
10
11
  }) => jsx.JSX.Element;
11
12
  export default OverlayWrapper;
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { jsx } from '@emotion/react';
3
3
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
4
- declare const OverlayWrapper: ({ view, targetElementPos, children, isHoveredCallback: hoverCallback, }: {
4
+ declare const OverlayWrapper: ({ view, targetElementPos, children, isHoveredCallback: hoverCallback, onOpenLinkClick, }: {
5
5
  view: EditorView;
6
6
  targetElementPos: number | undefined;
7
7
  children: JSX.Element;
8
8
  /** Fired when the mouse enters or leaves the overlay button */
9
9
  isHoveredCallback: (isHovered: boolean) => void;
10
+ onOpenLinkClick: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
10
11
  }) => jsx.JSX.Element;
11
12
  export default OverlayWrapper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "2.8.1",
3
+ "version": "2.9.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/adf-schema": "^40.3.0",
36
36
  "@atlaskit/analytics-next": "^9.3.0",
37
37
  "@atlaskit/custom-steps": "^0.6.0",
38
- "@atlaskit/editor-common": "^87.0.0",
38
+ "@atlaskit/editor-common": "^87.2.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.6.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^1.2.0",
41
41
  "@atlaskit/editor-plugin-editor-disabled": "^1.2.0",
@@ -47,11 +47,11 @@
47
47
  "@atlaskit/editor-prosemirror": "5.0.1",
48
48
  "@atlaskit/editor-shared-styles": "^2.13.0",
49
49
  "@atlaskit/frontend-utilities": "^2.7.0",
50
- "@atlaskit/icon": "^22.7.0",
50
+ "@atlaskit/icon": "^22.8.0",
51
51
  "@atlaskit/link-analytics": "^8.3.0",
52
52
  "@atlaskit/link-client-extension": "^1.10.0",
53
53
  "@atlaskit/link-datasource": "^2.9.0",
54
- "@atlaskit/linking-common": "^5.7.0",
54
+ "@atlaskit/linking-common": "^5.8.0",
55
55
  "@atlaskit/linking-types": "^8.12.0",
56
56
  "@atlaskit/menu": "2.8.1",
57
57
  "@atlaskit/platform-feature-flags": "^0.3.0",
@@ -66,7 +66,7 @@
66
66
  "raf-schd": "^4.0.3"
67
67
  },
68
68
  "peerDependencies": {
69
- "@atlaskit/link-provider": "^1.13.0",
69
+ "@atlaskit/link-provider": "^1.14.0",
70
70
  "react": "^16.8.0",
71
71
  "react-intl-next": "npm:react-intl@^5.18.1"
72
72
  },
@@ -125,9 +125,6 @@
125
125
  "platform.linking-platform.datasource.enable-confluence-search-modal": {
126
126
  "type": "boolean"
127
127
  },
128
- "platform.linking-platform.datasource-assets_objects_remove_beta": {
129
- "type": "boolean"
130
- },
131
128
  "platform.editor.card.inject-settings-button": {
132
129
  "type": "boolean"
133
130
  },