@atlaskit/editor-plugin-card 20.0.4 → 20.0.5
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 +10 -0
- package/dist/cjs/ui/quick-insert/DatasourceQuickInsertMenuItem.js +6 -13
- package/dist/cjs/ui/quick-insert/getCardQuickInsertComponents.js +19 -0
- package/dist/es2019/ui/quick-insert/DatasourceQuickInsertMenuItem.js +2 -8
- package/dist/es2019/ui/quick-insert/getCardQuickInsertComponents.js +17 -0
- package/dist/esm/ui/quick-insert/DatasourceQuickInsertMenuItem.js +6 -13
- package/dist/esm/ui/quick-insert/getCardQuickInsertComponents.js +19 -0
- package/dist/types/ui/quick-insert/DatasourceQuickInsertMenuItem.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 20.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3a4c286fdb8c1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a4c286fdb8c1) -
|
|
8
|
+
Add registry-backed Quick Insert search matching under the existing
|
|
9
|
+
`platform_editor_slash_command` experiment. Make native, provider, and extension registered Quick
|
|
10
|
+
Insert items searchable.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 20.0.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -7,29 +7,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.DatasourceQuickInsertMenuItem = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
10
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
11
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
13
12
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
14
|
-
var
|
|
13
|
+
var _useQuickInsertContext = require("@atlaskit/editor-common/quick-insert/use-quick-insert-context");
|
|
15
14
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
15
|
var _actions = require("../../pm-plugins/actions");
|
|
17
16
|
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); }
|
|
18
17
|
var DatasourceQuickInsertMenuItem = exports.DatasourceQuickInsertMenuItem = function DatasourceQuickInsertMenuItem(_ref) {
|
|
19
|
-
var
|
|
20
|
-
type = _ref.type;
|
|
18
|
+
var type = _ref.type;
|
|
21
19
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
22
20
|
formatMessage = _useIntl.formatMessage;
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
isOffline: (0, _connectivityPluginType.isOfflineMode)(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
|
|
27
|
-
};
|
|
28
|
-
}),
|
|
29
|
-
isOffline = _useSharedPluginState.isOffline;
|
|
21
|
+
var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
|
|
22
|
+
isOffline = _useQuickInsertContex.isOffline;
|
|
30
23
|
var isJira = type === 'jira';
|
|
31
|
-
var onSelect = (0, _react.useCallback)(function (
|
|
32
|
-
var insert =
|
|
24
|
+
var onSelect = (0, _react.useCallback)(function (_ref2) {
|
|
25
|
+
var insert = _ref2.insert;
|
|
33
26
|
var tr = insert(undefined);
|
|
34
27
|
(0, _actions.showDatasourceModal)(type)(tr);
|
|
35
28
|
return tr;
|
|
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getCardQuickInsertComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
10
|
+
var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher");
|
|
9
11
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
10
12
|
var _rank = require("@atlaskit/editor-common/quick-insert/rank");
|
|
11
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
14
|
var _assetsModal = require("@atlaskit/link-datasource/assets-modal");
|
|
15
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
16
|
var _DatasourceQuickInsertMenuItem = require("./DatasourceQuickInsertMenuItem");
|
|
14
17
|
var getCardQuickInsertComponents = exports.getCardQuickInsertComponents = function getCardQuickInsertComponents(_ref) {
|
|
15
18
|
var api = _ref.api,
|
|
@@ -25,6 +28,14 @@ var getCardQuickInsertComponents = exports.getCardQuickInsertComponents = functi
|
|
|
25
28
|
type: _keys.DATA_AND_CHARTS_SECTION.type,
|
|
26
29
|
rank: _rank.DATA_AND_CHARTS_SECTION_RANK[_keys.JIRA_WORK_ITEMS_MENU_ITEM.key]
|
|
27
30
|
}],
|
|
31
|
+
match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref2) {
|
|
32
|
+
var formatMessage = _ref2.formatMessage;
|
|
33
|
+
return {
|
|
34
|
+
description: formatMessage((0, _fg.fg)('confluence-issue-terminology-refresh') ? _messages.cardMessages.datasourceJiraIssueDescriptionIssueTermRefresh : _messages.cardMessages.datasourceJiraIssueDescription),
|
|
35
|
+
keywords: ['jira'],
|
|
36
|
+
title: formatMessage((0, _fg.fg)('confluence-issue-terminology-refresh') ? _messages.cardMessages.datasourceJiraIssueIssueTermRefresh : _messages.cardMessages.datasourceJiraIssue)
|
|
37
|
+
};
|
|
38
|
+
}),
|
|
28
39
|
component: function component() {
|
|
29
40
|
return /*#__PURE__*/_react.default.createElement(_DatasourceQuickInsertMenuItem.DatasourceQuickInsertMenuItem, {
|
|
30
41
|
api: api,
|
|
@@ -41,6 +52,14 @@ var getCardQuickInsertComponents = exports.getCardQuickInsertComponents = functi
|
|
|
41
52
|
type: _keys.DATA_AND_CHARTS_SECTION.type,
|
|
42
53
|
rank: _rank.DATA_AND_CHARTS_SECTION_RANK[_keys.ASSETS_MENU_ITEM.key]
|
|
43
54
|
}],
|
|
55
|
+
match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref3) {
|
|
56
|
+
var formatMessage = _ref3.formatMessage;
|
|
57
|
+
return {
|
|
58
|
+
description: formatMessage(_messages.cardMessages.datasourceAssetsObjectsDescription),
|
|
59
|
+
keywords: ['assets'],
|
|
60
|
+
title: formatMessage(_messages.cardMessages.datasourceAssetsObjectsGeneralAvailability)
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
44
63
|
component: function component() {
|
|
45
64
|
return /*#__PURE__*/_react.default.createElement(_DatasourceQuickInsertMenuItem.DatasourceQuickInsertMenuItem, {
|
|
46
65
|
api: api,
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
4
|
import { IconDatasourceAssetsObjects, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
|
|
6
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
7
|
-
import {
|
|
6
|
+
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
8
|
import { showDatasourceModal } from '../../pm-plugins/actions';
|
|
10
9
|
export const DatasourceQuickInsertMenuItem = ({
|
|
11
|
-
api,
|
|
12
10
|
type
|
|
13
11
|
}) => {
|
|
14
12
|
const {
|
|
@@ -16,11 +14,7 @@ export const DatasourceQuickInsertMenuItem = ({
|
|
|
16
14
|
} = useIntl();
|
|
17
15
|
const {
|
|
18
16
|
isOffline
|
|
19
|
-
} =
|
|
20
|
-
connectivityState
|
|
21
|
-
}) => ({
|
|
22
|
-
isOffline: isOfflineMode(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
|
|
23
|
-
}));
|
|
17
|
+
} = useQuickInsertContext();
|
|
24
18
|
const isJira = type === 'jira';
|
|
25
19
|
const onSelect = useCallback(({
|
|
26
20
|
insert
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
2
4
|
import { ASSETS_MENU_ITEM, DATA_AND_CHARTS_SECTION, JIRA_WORK_ITEMS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
3
5
|
import { DATA_AND_CHARTS_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
4
6
|
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
5
7
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/assets-modal';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
9
|
import { DatasourceQuickInsertMenuItem } from './DatasourceQuickInsertMenuItem';
|
|
7
10
|
export const getCardQuickInsertComponents = ({
|
|
8
11
|
api,
|
|
@@ -19,6 +22,13 @@ export const getCardQuickInsertComponents = ({
|
|
|
19
22
|
type: DATA_AND_CHARTS_SECTION.type,
|
|
20
23
|
rank: DATA_AND_CHARTS_SECTION_RANK[JIRA_WORK_ITEMS_MENU_ITEM.key]
|
|
21
24
|
}],
|
|
25
|
+
match: createQuickInsertMatcher(({
|
|
26
|
+
formatMessage
|
|
27
|
+
}) => ({
|
|
28
|
+
description: formatMessage(fg('confluence-issue-terminology-refresh') ? messages.datasourceJiraIssueDescriptionIssueTermRefresh : messages.datasourceJiraIssueDescription),
|
|
29
|
+
keywords: ['jira'],
|
|
30
|
+
title: formatMessage(fg('confluence-issue-terminology-refresh') ? messages.datasourceJiraIssueIssueTermRefresh : messages.datasourceJiraIssue)
|
|
31
|
+
})),
|
|
22
32
|
component: () => /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
23
33
|
api: api,
|
|
24
34
|
type: "jira"
|
|
@@ -33,6 +43,13 @@ export const getCardQuickInsertComponents = ({
|
|
|
33
43
|
type: DATA_AND_CHARTS_SECTION.type,
|
|
34
44
|
rank: DATA_AND_CHARTS_SECTION_RANK[ASSETS_MENU_ITEM.key]
|
|
35
45
|
}],
|
|
46
|
+
match: createQuickInsertMatcher(({
|
|
47
|
+
formatMessage
|
|
48
|
+
}) => ({
|
|
49
|
+
description: formatMessage(messages.datasourceAssetsObjectsDescription),
|
|
50
|
+
keywords: ['assets'],
|
|
51
|
+
title: formatMessage(messages.datasourceAssetsObjectsGeneralAvailability)
|
|
52
|
+
})),
|
|
36
53
|
component: () => /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
37
54
|
api: api,
|
|
38
55
|
type: "assets"
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
4
|
import { IconDatasourceAssetsObjects, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
|
|
6
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
7
|
-
import {
|
|
6
|
+
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
8
|
import { showDatasourceModal } from '../../pm-plugins/actions';
|
|
10
9
|
export var DatasourceQuickInsertMenuItem = function DatasourceQuickInsertMenuItem(_ref) {
|
|
11
|
-
var
|
|
12
|
-
type = _ref.type;
|
|
10
|
+
var type = _ref.type;
|
|
13
11
|
var _useIntl = useIntl(),
|
|
14
12
|
formatMessage = _useIntl.formatMessage;
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
isOffline: isOfflineMode(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
|
|
19
|
-
};
|
|
20
|
-
}),
|
|
21
|
-
isOffline = _useSharedPluginState.isOffline;
|
|
13
|
+
var _useQuickInsertContex = useQuickInsertContext(),
|
|
14
|
+
isOffline = _useQuickInsertContex.isOffline;
|
|
22
15
|
var isJira = type === 'jira';
|
|
23
|
-
var onSelect = useCallback(function (
|
|
24
|
-
var insert =
|
|
16
|
+
var onSelect = useCallback(function (_ref2) {
|
|
17
|
+
var insert = _ref2.insert;
|
|
25
18
|
var tr = insert(undefined);
|
|
26
19
|
showDatasourceModal(type)(tr);
|
|
27
20
|
return tr;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
2
4
|
import { ASSETS_MENU_ITEM, DATA_AND_CHARTS_SECTION, JIRA_WORK_ITEMS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
3
5
|
import { DATA_AND_CHARTS_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
4
6
|
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
5
7
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource/assets-modal';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
9
|
import { DatasourceQuickInsertMenuItem } from './DatasourceQuickInsertMenuItem';
|
|
7
10
|
export var getCardQuickInsertComponents = function getCardQuickInsertComponents(_ref) {
|
|
8
11
|
var api = _ref.api,
|
|
@@ -18,6 +21,14 @@ export var getCardQuickInsertComponents = function getCardQuickInsertComponents(
|
|
|
18
21
|
type: DATA_AND_CHARTS_SECTION.type,
|
|
19
22
|
rank: DATA_AND_CHARTS_SECTION_RANK[JIRA_WORK_ITEMS_MENU_ITEM.key]
|
|
20
23
|
}],
|
|
24
|
+
match: createQuickInsertMatcher(function (_ref2) {
|
|
25
|
+
var formatMessage = _ref2.formatMessage;
|
|
26
|
+
return {
|
|
27
|
+
description: formatMessage(fg('confluence-issue-terminology-refresh') ? messages.datasourceJiraIssueDescriptionIssueTermRefresh : messages.datasourceJiraIssueDescription),
|
|
28
|
+
keywords: ['jira'],
|
|
29
|
+
title: formatMessage(fg('confluence-issue-terminology-refresh') ? messages.datasourceJiraIssueIssueTermRefresh : messages.datasourceJiraIssue)
|
|
30
|
+
};
|
|
31
|
+
}),
|
|
21
32
|
component: function component() {
|
|
22
33
|
return /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
23
34
|
api: api,
|
|
@@ -34,6 +45,14 @@ export var getCardQuickInsertComponents = function getCardQuickInsertComponents(
|
|
|
34
45
|
type: DATA_AND_CHARTS_SECTION.type,
|
|
35
46
|
rank: DATA_AND_CHARTS_SECTION_RANK[ASSETS_MENU_ITEM.key]
|
|
36
47
|
}],
|
|
48
|
+
match: createQuickInsertMatcher(function (_ref3) {
|
|
49
|
+
var formatMessage = _ref3.formatMessage;
|
|
50
|
+
return {
|
|
51
|
+
description: formatMessage(messages.datasourceAssetsObjectsDescription),
|
|
52
|
+
keywords: ['assets'],
|
|
53
|
+
title: formatMessage(messages.datasourceAssetsObjectsGeneralAvailability)
|
|
54
|
+
};
|
|
55
|
+
}),
|
|
37
56
|
component: function component() {
|
|
38
57
|
return /*#__PURE__*/React.createElement(DatasourceQuickInsertMenuItem, {
|
|
39
58
|
api: api,
|
|
@@ -5,5 +5,5 @@ type Props = {
|
|
|
5
5
|
api: ExtractInjectionAPI<CardPlugin> | undefined;
|
|
6
6
|
type: 'assets' | 'jira';
|
|
7
7
|
};
|
|
8
|
-
export declare const DatasourceQuickInsertMenuItem: ({
|
|
8
|
+
export declare const DatasourceQuickInsertMenuItem: ({ type }: Props) => React.JSX.Element;
|
|
9
9
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.5",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-floating-toolbar": "^16.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-grid": "^14.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-toolbar": "^11.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-ui-control-registry": "^8.
|
|
40
|
+
"@atlaskit/editor-plugin-ui-control-registry": "^8.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-width": "^15.0.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
44
44
|
"@atlaskit/editor-smart-link-draggable": "^1.2.0",
|
|
45
45
|
"@atlaskit/editor-toolbar": "^2.4.0",
|
|
46
|
-
"@atlaskit/editor-ui-control-model": "^2.
|
|
46
|
+
"@atlaskit/editor-ui-control-model": "^2.6.0",
|
|
47
47
|
"@atlaskit/frontend-utilities": "^4.1.0",
|
|
48
48
|
"@atlaskit/icon": "^37.3.0",
|
|
49
49
|
"@atlaskit/json-ld-types": "^2.0.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"uuid": "^3.1.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^118.
|
|
74
|
+
"@atlaskit/editor-common": "^118.10.0",
|
|
75
75
|
"@atlaskit/link-provider": "^5.3.0",
|
|
76
76
|
"react": "^18.2.0 || ^19.2.0",
|
|
77
77
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|