@atlaskit/editor-plugin-card 25.0.1 → 25.0.3
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 +14 -0
- package/dist/cjs/nodeviews/embedCard.js +2 -2
- package/dist/cjs/ui/DatasourceModal/ModalWithState.js +3 -3
- package/dist/cjs/ui/quick-insert/DatasourceQuickInsertMenuItem.js +3 -1
- package/dist/cjs/ui/quick-insert/getCardQuickInsertComponents.js +14 -0
- package/dist/es2019/entry-points/cardPlugin.js +1 -0
- package/dist/es2019/nodeviews/embedCard.js +2 -2
- package/dist/es2019/ui/DatasourceModal/ModalWithState.js +3 -3
- package/dist/es2019/ui/InlineCardOverlay/index.js +1 -0
- package/dist/es2019/ui/datasourceErrorBoundary.js +1 -0
- package/dist/es2019/ui/quick-insert/DatasourceQuickInsertMenuItem.js +2 -0
- package/dist/es2019/ui/quick-insert/getCardQuickInsertComponents.js +17 -0
- package/dist/esm/entry-points/cardPlugin.js +1 -0
- package/dist/esm/nodeviews/embedCard.js +2 -2
- package/dist/esm/ui/DatasourceModal/ModalWithState.js +3 -3
- package/dist/esm/ui/InlineCardOverlay/index.js +1 -0
- package/dist/esm/ui/datasourceErrorBoundary.js +1 -0
- package/dist/esm/ui/quick-insert/DatasourceQuickInsertMenuItem.js +3 -1
- package/dist/esm/ui/quick-insert/getCardQuickInsertComponents.js +14 -0
- package/dist/types/ui/quick-insert/DatasourceQuickInsertMenuItem.d.ts +3 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 25.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 25.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`38952a4383a53`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38952a4383a53) -
|
|
14
|
+
Add Data and charts slash-command hover previews behind platform_editor_slash_command.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 25.0.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -25,12 +25,12 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
|
|
|
25
25
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
26
26
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
27
27
|
var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable");
|
|
28
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
29
28
|
var _componentWithCondition = require("@atlaskit/platform-feature-flags-react/component-with-condition");
|
|
29
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
30
30
|
var _smartCard = require("@atlaskit/smart-card");
|
|
31
31
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
32
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
33
32
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
33
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
34
34
|
var _actions = require("../pm-plugins/actions");
|
|
35
35
|
var _ResizableEmbedCard = _interopRequireDefault(require("../ui/ResizableEmbedCard"));
|
|
36
36
|
var _SmartCardSSRReactContextsProvider = require("../ui/SmartCardSSRReactContextsProvider");
|
|
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.modalTypeToComponentMap = exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
|
-
var _assetsModal = require("@atlaskit/link-datasource/assets-modal");
|
|
11
10
|
var _assetsConfigModalWithWrappers = require("@atlaskit/link-datasource/assets-config-modal-with-wrappers");
|
|
12
|
-
var
|
|
11
|
+
var _assetsModal = require("@atlaskit/link-datasource/assets-modal");
|
|
13
12
|
var _confluenceSearchConfigModalWithWrappers = require("@atlaskit/link-datasource/confluence-search-config-modal-with-wrappers");
|
|
14
|
-
var
|
|
13
|
+
var _confluenceSearchModal = require("@atlaskit/link-datasource/confluence-search-modal");
|
|
15
14
|
var _jiraIssuesConfigModalWithWrappers = require("@atlaskit/link-datasource/jira-issues-config-modal-with-wrappers");
|
|
15
|
+
var _jiraIssuesModal = require("@atlaskit/link-datasource/jira-issues-modal");
|
|
16
16
|
var _editorSmartCardProviderValueGuard = require("@atlaskit/link-provider/editor-smart-card-provider-value-guard");
|
|
17
17
|
var _useSmartLinkContext = require("@atlaskit/link-provider/use-smart-link-context");
|
|
18
18
|
var _datasourceErrorBoundary = require("../datasourceErrorBoundary");
|
|
@@ -18,7 +18,8 @@ var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
|
18
18
|
var _actions = require("../../pm-plugins/actions");
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var DatasourceQuickInsertMenuItem = exports.DatasourceQuickInsertMenuItem = function DatasourceQuickInsertMenuItem(_ref) {
|
|
21
|
-
var
|
|
21
|
+
var previewImageUrls = _ref.previewImageUrls,
|
|
22
|
+
type = _ref.type;
|
|
22
23
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
23
24
|
formatMessage = _useIntl.formatMessage;
|
|
24
25
|
var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
|
|
@@ -41,6 +42,7 @@ var DatasourceQuickInsertMenuItem = exports.DatasourceQuickInsertMenuItem = func
|
|
|
41
42
|
}),
|
|
42
43
|
isDisabled: isOffline,
|
|
43
44
|
onSelect: onSelect,
|
|
45
|
+
previewImageUrls: previewImageUrls,
|
|
44
46
|
title: formatMessage(isJira ? (0, _fg.fg)('confluence-issue-terminology-refresh') ? _messages.cardMessages.datasourceJiraIssueIssueTermRefresh : _messages.cardMessages.datasourceJiraIssue : isConfluenceSearch ? _messages.cardMessages.datasourceConfluenceSearch : _messages.cardMessages.datasourceAssetsObjectsGeneralAvailability)
|
|
45
47
|
});
|
|
46
48
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.getCardQuickInsertComponents = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
10
11
|
var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher");
|
|
@@ -16,6 +17,16 @@ var _confluenceSearchModal = require("@atlaskit/link-datasource/confluence-searc
|
|
|
16
17
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
17
18
|
var _utils2 = require("../../pm-plugins/utils");
|
|
18
19
|
var _DatasourceQuickInsertMenuItem = require("./DatasourceQuickInsertMenuItem");
|
|
20
|
+
var datasourcePreviewImageUrlsByKey = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.JIRA_WORK_ITEMS_MENU_ITEM.key, {
|
|
21
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/m284qw5066530tr5yd11473uq1l8t86t.png',
|
|
22
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/4b1455q46emetd0jxv70xuo7i7lwo574.png'
|
|
23
|
+
}), _keys.CONFLUENCE_LIST_MENU_ITEM.key, {
|
|
24
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8jh31f0k143b475y5tun230v166c7087.png',
|
|
25
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/6co68akkw56t83fql3m823qi21k8776u.png'
|
|
26
|
+
}), _keys.ASSETS_MENU_ITEM.key, {
|
|
27
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/64d41r462m2343iomn821ver0g4ohh37.png',
|
|
28
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/0w58rc60jh54m68224qqinuk52d6lldt.png'
|
|
29
|
+
});
|
|
19
30
|
var getCardQuickInsertComponents = exports.getCardQuickInsertComponents = function getCardQuickInsertComponents(_ref) {
|
|
20
31
|
var api = _ref.api,
|
|
21
32
|
options = _ref.options;
|
|
@@ -41,6 +52,7 @@ var getCardQuickInsertComponents = exports.getCardQuickInsertComponents = functi
|
|
|
41
52
|
component: function component() {
|
|
42
53
|
return /*#__PURE__*/_react.default.createElement(_DatasourceQuickInsertMenuItem.DatasourceQuickInsertMenuItem, {
|
|
43
54
|
api: api,
|
|
55
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[_keys.JIRA_WORK_ITEMS_MENU_ITEM.key],
|
|
44
56
|
type: "jira"
|
|
45
57
|
});
|
|
46
58
|
}
|
|
@@ -65,6 +77,7 @@ var getCardQuickInsertComponents = exports.getCardQuickInsertComponents = functi
|
|
|
65
77
|
component: function component() {
|
|
66
78
|
return /*#__PURE__*/_react.default.createElement(_DatasourceQuickInsertMenuItem.DatasourceQuickInsertMenuItem, {
|
|
67
79
|
api: api,
|
|
80
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[_keys.ASSETS_MENU_ITEM.key],
|
|
68
81
|
type: "assets"
|
|
69
82
|
});
|
|
70
83
|
}
|
|
@@ -90,6 +103,7 @@ var getCardQuickInsertComponents = exports.getCardQuickInsertComponents = functi
|
|
|
90
103
|
component: function component() {
|
|
91
104
|
return /*#__PURE__*/_react.default.createElement(_DatasourceQuickInsertMenuItem.DatasourceQuickInsertMenuItem, {
|
|
92
105
|
api: api,
|
|
106
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[_keys.CONFLUENCE_LIST_MENU_ITEM.key],
|
|
93
107
|
type: "confluence-search"
|
|
94
108
|
});
|
|
95
109
|
}
|
|
@@ -13,12 +13,12 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
13
13
|
import { floatingLayouts, isRichMediaInsideOfBlockNode } from '@atlaskit/editor-common/utils';
|
|
14
14
|
import { akEditorFullPageNarrowBreakout, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
17
16
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react/component-with-condition';
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
18
18
|
import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
|
|
19
19
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
20
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
21
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
21
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
22
22
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
23
23
|
import ResizableEmbedCard from '../ui/ResizableEmbedCard';
|
|
24
24
|
import { SmartCardSSRReactContextsProvider } from '../ui/SmartCardSSRReactContextsProvider';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/assets-modal';
|
|
4
3
|
import { AssetsConfigModalWithWrappers as AssetsConfigModal } from '@atlaskit/link-datasource/assets-config-modal-with-wrappers';
|
|
5
|
-
import {
|
|
4
|
+
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/assets-modal';
|
|
6
5
|
import { ConfluenceSearchConfigModalWithWrappers as ConfluenceSearchConfigModal } from '@atlaskit/link-datasource/confluence-search-config-modal-with-wrappers';
|
|
7
|
-
import {
|
|
6
|
+
import { CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource/confluence-search-modal';
|
|
8
7
|
import { JiraIssuesConfigModalWithWrappers as JiraIssuesConfigModal } from '@atlaskit/link-datasource/jira-issues-config-modal-with-wrappers';
|
|
8
|
+
import { JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/jira-issues-modal';
|
|
9
9
|
import { EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider/editor-smart-card-provider-value-guard';
|
|
10
10
|
import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
|
|
11
11
|
import { DatasourceErrorBoundary } from '../datasourceErrorBoundary';
|
|
@@ -5,6 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
* @jsxRuntime classic
|
|
6
6
|
* @jsx jsx
|
|
7
7
|
*/
|
|
8
|
+
|
|
8
9
|
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
9
10
|
|
|
10
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
3
|
+
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
5
6
|
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource/analytics/render-failed';
|
|
@@ -9,6 +9,7 @@ import WorkItemsIcon from '@atlaskit/icon/core/work-items';
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { showDatasourceModal } from '../../pm-plugins/actions';
|
|
11
11
|
export const DatasourceQuickInsertMenuItem = ({
|
|
12
|
+
previewImageUrls,
|
|
12
13
|
type
|
|
13
14
|
}) => {
|
|
14
15
|
const {
|
|
@@ -36,6 +37,7 @@ export const DatasourceQuickInsertMenuItem = ({
|
|
|
36
37
|
}),
|
|
37
38
|
isDisabled: isOffline,
|
|
38
39
|
onSelect: onSelect,
|
|
40
|
+
previewImageUrls: previewImageUrls,
|
|
39
41
|
title: formatMessage(isJira ? fg('confluence-issue-terminology-refresh') ? messages.datasourceJiraIssueIssueTermRefresh : messages.datasourceJiraIssue : isConfluenceSearch ? messages.datasourceConfluenceSearch : messages.datasourceAssetsObjectsGeneralAvailability)
|
|
40
42
|
});
|
|
41
43
|
};
|
|
@@ -9,6 +9,20 @@ import { CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource/confl
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { isDatasourceConfigEditable } from '../../pm-plugins/utils';
|
|
11
11
|
import { DatasourceQuickInsertMenuItem } from './DatasourceQuickInsertMenuItem';
|
|
12
|
+
const datasourcePreviewImageUrlsByKey = {
|
|
13
|
+
[JIRA_WORK_ITEMS_MENU_ITEM.key]: {
|
|
14
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/m284qw5066530tr5yd11473uq1l8t86t.png',
|
|
15
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/4b1455q46emetd0jxv70xuo7i7lwo574.png'
|
|
16
|
+
},
|
|
17
|
+
[CONFLUENCE_LIST_MENU_ITEM.key]: {
|
|
18
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8jh31f0k143b475y5tun230v166c7087.png',
|
|
19
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/6co68akkw56t83fql3m823qi21k8776u.png'
|
|
20
|
+
},
|
|
21
|
+
[ASSETS_MENU_ITEM.key]: {
|
|
22
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/64d41r462m2343iomn821ver0g4ohh37.png',
|
|
23
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/0w58rc60jh54m68224qqinuk52d6lldt.png'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
12
26
|
export const getCardQuickInsertComponents = ({
|
|
13
27
|
api,
|
|
14
28
|
options
|
|
@@ -33,6 +47,7 @@ export const getCardQuickInsertComponents = ({
|
|
|
33
47
|
})),
|
|
34
48
|
component: () => /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
35
49
|
api: api,
|
|
50
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[JIRA_WORK_ITEMS_MENU_ITEM.key],
|
|
36
51
|
type: "jira"
|
|
37
52
|
})
|
|
38
53
|
}];
|
|
@@ -54,6 +69,7 @@ export const getCardQuickInsertComponents = ({
|
|
|
54
69
|
})),
|
|
55
70
|
component: () => /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
56
71
|
api: api,
|
|
72
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[ASSETS_MENU_ITEM.key],
|
|
57
73
|
type: "assets"
|
|
58
74
|
})
|
|
59
75
|
});
|
|
@@ -76,6 +92,7 @@ export const getCardQuickInsertComponents = ({
|
|
|
76
92
|
})),
|
|
77
93
|
component: () => /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
78
94
|
api: api,
|
|
95
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[CONFLUENCE_LIST_MENU_ITEM.key],
|
|
79
96
|
type: "confluence-search"
|
|
80
97
|
})
|
|
81
98
|
});
|
|
@@ -24,12 +24,12 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
24
24
|
import { floatingLayouts, isRichMediaInsideOfBlockNode } from '@atlaskit/editor-common/utils';
|
|
25
25
|
import { akEditorFullPageNarrowBreakout, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
26
26
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
27
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
28
27
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react/component-with-condition';
|
|
28
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
29
29
|
import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
|
|
30
30
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
31
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
32
31
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
32
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
33
33
|
import { registerCard, removeCard as _removeCard } from '../pm-plugins/actions';
|
|
34
34
|
import ResizableEmbedCard from '../ui/ResizableEmbedCard';
|
|
35
35
|
import { SmartCardSSRReactContextsProvider } from '../ui/SmartCardSSRReactContextsProvider';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/assets-modal';
|
|
4
3
|
import { AssetsConfigModalWithWrappers as AssetsConfigModal } from '@atlaskit/link-datasource/assets-config-modal-with-wrappers';
|
|
5
|
-
import {
|
|
4
|
+
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/assets-modal';
|
|
6
5
|
import { ConfluenceSearchConfigModalWithWrappers as ConfluenceSearchConfigModal } from '@atlaskit/link-datasource/confluence-search-config-modal-with-wrappers';
|
|
7
|
-
import {
|
|
6
|
+
import { CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource/confluence-search-modal';
|
|
8
7
|
import { JiraIssuesConfigModalWithWrappers as JiraIssuesConfigModal } from '@atlaskit/link-datasource/jira-issues-config-modal-with-wrappers';
|
|
8
|
+
import { JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/jira-issues-modal';
|
|
9
9
|
import { EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider/editor-smart-card-provider-value-guard';
|
|
10
10
|
import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
|
|
11
11
|
import { DatasourceErrorBoundary } from '../datasourceErrorBoundary';
|
|
@@ -9,6 +9,7 @@ var _excluded = ["children", "isSelected", "isVisible", "testId", "url"];
|
|
|
9
9
|
* @jsxRuntime classic
|
|
10
10
|
* @jsx jsx
|
|
11
11
|
*/
|
|
12
|
+
|
|
12
13
|
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
13
14
|
|
|
14
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
@@ -7,6 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
10
|
+
|
|
10
11
|
import React from 'react';
|
|
11
12
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
12
13
|
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource/analytics/render-failed';
|
|
@@ -9,7 +9,8 @@ import WorkItemsIcon from '@atlaskit/icon/core/work-items';
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { showDatasourceModal } from '../../pm-plugins/actions';
|
|
11
11
|
export var DatasourceQuickInsertMenuItem = function DatasourceQuickInsertMenuItem(_ref) {
|
|
12
|
-
var
|
|
12
|
+
var previewImageUrls = _ref.previewImageUrls,
|
|
13
|
+
type = _ref.type;
|
|
13
14
|
var _useIntl = useIntl(),
|
|
14
15
|
formatMessage = _useIntl.formatMessage;
|
|
15
16
|
var _useQuickInsertContex = useQuickInsertContext(),
|
|
@@ -32,6 +33,7 @@ export var DatasourceQuickInsertMenuItem = function DatasourceQuickInsertMenuIte
|
|
|
32
33
|
}),
|
|
33
34
|
isDisabled: isOffline,
|
|
34
35
|
onSelect: onSelect,
|
|
36
|
+
previewImageUrls: previewImageUrls,
|
|
35
37
|
title: formatMessage(isJira ? fg('confluence-issue-terminology-refresh') ? messages.datasourceJiraIssueIssueTermRefresh : messages.datasourceJiraIssue : isConfluenceSearch ? messages.datasourceConfluenceSearch : messages.datasourceAssetsObjectsGeneralAvailability)
|
|
36
38
|
});
|
|
37
39
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
4
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
@@ -9,6 +10,16 @@ import { CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource/confl
|
|
|
9
10
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
11
|
import { isDatasourceConfigEditable } from '../../pm-plugins/utils';
|
|
11
12
|
import { DatasourceQuickInsertMenuItem } from './DatasourceQuickInsertMenuItem';
|
|
13
|
+
var datasourcePreviewImageUrlsByKey = _defineProperty(_defineProperty(_defineProperty({}, JIRA_WORK_ITEMS_MENU_ITEM.key, {
|
|
14
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/m284qw5066530tr5yd11473uq1l8t86t.png',
|
|
15
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/4b1455q46emetd0jxv70xuo7i7lwo574.png'
|
|
16
|
+
}), CONFLUENCE_LIST_MENU_ITEM.key, {
|
|
17
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8jh31f0k143b475y5tun230v166c7087.png',
|
|
18
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/6co68akkw56t83fql3m823qi21k8776u.png'
|
|
19
|
+
}), ASSETS_MENU_ITEM.key, {
|
|
20
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/64d41r462m2343iomn821ver0g4ohh37.png',
|
|
21
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/0w58rc60jh54m68224qqinuk52d6lldt.png'
|
|
22
|
+
});
|
|
12
23
|
export var getCardQuickInsertComponents = function getCardQuickInsertComponents(_ref) {
|
|
13
24
|
var api = _ref.api,
|
|
14
25
|
options = _ref.options;
|
|
@@ -34,6 +45,7 @@ export var getCardQuickInsertComponents = function getCardQuickInsertComponents(
|
|
|
34
45
|
component: function component() {
|
|
35
46
|
return /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
36
47
|
api: api,
|
|
48
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[JIRA_WORK_ITEMS_MENU_ITEM.key],
|
|
37
49
|
type: "jira"
|
|
38
50
|
});
|
|
39
51
|
}
|
|
@@ -58,6 +70,7 @@ export var getCardQuickInsertComponents = function getCardQuickInsertComponents(
|
|
|
58
70
|
component: function component() {
|
|
59
71
|
return /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
60
72
|
api: api,
|
|
73
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[ASSETS_MENU_ITEM.key],
|
|
61
74
|
type: "assets"
|
|
62
75
|
});
|
|
63
76
|
}
|
|
@@ -83,6 +96,7 @@ export var getCardQuickInsertComponents = function getCardQuickInsertComponents(
|
|
|
83
96
|
component: function component() {
|
|
84
97
|
return /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
85
98
|
api: api,
|
|
99
|
+
previewImageUrls: datasourcePreviewImageUrlsByKey[CONFLUENCE_LIST_MENU_ITEM.key],
|
|
86
100
|
type: "confluence-search"
|
|
87
101
|
});
|
|
88
102
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type QuickInsertMenuItemProps } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
2
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { CardPlugin } from '../../cardPluginType';
|
|
4
5
|
type Props = {
|
|
5
6
|
api: ExtractInjectionAPI<CardPlugin> | undefined;
|
|
7
|
+
previewImageUrls: QuickInsertMenuItemProps['previewImageUrls'];
|
|
6
8
|
type: 'assets' | 'confluence-search' | 'jira';
|
|
7
9
|
};
|
|
8
|
-
export declare const DatasourceQuickInsertMenuItem: ({ type }: Props) => React.JSX.Element;
|
|
10
|
+
export declare const DatasourceQuickInsertMenuItem: ({ previewImageUrls, type, }: Props) => React.JSX.Element;
|
|
9
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.3",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
46
46
|
"@atlaskit/editor-smart-link-draggable": "^1.2.0",
|
|
47
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
47
|
+
"@atlaskit/editor-toolbar": "^2.7.0",
|
|
48
48
|
"@atlaskit/editor-ui-control-model": "^2.9.0",
|
|
49
49
|
"@atlaskit/frontend-utilities": "^4.5.0",
|
|
50
50
|
"@atlaskit/icon": "^37.7.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@atlaskit/primitives": "^22.5.0",
|
|
64
64
|
"@atlaskit/prosemirror-history": "^1.2.0",
|
|
65
65
|
"@atlaskit/smart-card": "^45.24.0",
|
|
66
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
66
|
+
"@atlaskit/tmp-editor-statsig": "^201.0.0",
|
|
67
67
|
"@atlaskit/tokens": "^18.2.0",
|
|
68
68
|
"@babel/runtime": "^7.0.0",
|
|
69
69
|
"@emotion/react": "^11.7.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"uuid": "^11.1.1"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@atlaskit/editor-common": "^123.
|
|
76
|
+
"@atlaskit/editor-common": "^123.2.0",
|
|
77
77
|
"@atlaskit/link-provider": "^5.7.0",
|
|
78
78
|
"react": "^18.2.0 || ^19.2.0",
|
|
79
79
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|