@atlaskit/editor-plugin-quick-insert 19.0.2 → 19.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
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 19.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`64a76a7487e96`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/64a76a7487e96) -
|
|
8
|
+
Add block template hover previews keyed by stable snippet IDs behind
|
|
9
|
+
platform_editor_slash_command, including the legacy Confluence provider path and the direct
|
|
10
|
+
extension renderer used by the slash menu. Unknown snippet IDs remain without a preview. Use the
|
|
11
|
+
supplied highest-quality light and dark preview assets for all 21 supported block templates.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 19.0.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -12,8 +12,10 @@ var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/cr
|
|
|
12
12
|
var _getMenuItemParents = require("@atlaskit/editor-common/quick-insert/get-menu-item-parents");
|
|
13
13
|
var _getProviderMenuItemKey = require("@atlaskit/editor-common/quick-insert/get-provider-menu-item-key");
|
|
14
14
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
15
|
+
var _snippetPreviewImageUrls = require("@atlaskit/editor-common/quick-insert/snippet-preview-image-urls");
|
|
15
16
|
var _useQuickInsertContext = require("@atlaskit/editor-common/quick-insert/use-quick-insert-context");
|
|
16
17
|
var _apps = _interopRequireDefault(require("@atlaskit/icon/core/apps"));
|
|
18
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
17
19
|
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; }
|
|
18
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
21
|
var LegacyQuickInsertProviderMenuItem = function LegacyQuickInsertProviderMenuItem(_ref) {
|
|
@@ -33,12 +35,17 @@ var LegacyQuickInsertProviderMenuItem = function LegacyQuickInsertProviderMenuIt
|
|
|
33
35
|
return result;
|
|
34
36
|
};
|
|
35
37
|
var Icon = item.icon;
|
|
38
|
+
var itemKey = item.key === undefined ? undefined : String(item.key);
|
|
39
|
+
var snippetKeyPrefix = 'snippet-extension:snippet-';
|
|
40
|
+
var previewKey = itemKey !== null && itemKey !== void 0 && itemKey.startsWith(snippetKeyPrefix) ? itemKey.slice(snippetKeyPrefix.length) : undefined;
|
|
41
|
+
var previewImageUrls = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command') && previewKey ? (0, _snippetPreviewImageUrls.getSnippetPreviewImageUrls)(previewKey) : undefined;
|
|
36
42
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
37
43
|
iconBefore: Icon ? /*#__PURE__*/_react.default.createElement(Icon, null) : /*#__PURE__*/_react.default.createElement(_apps.default, {
|
|
38
44
|
label: ""
|
|
39
45
|
}),
|
|
40
46
|
isDisabled: isDisabled,
|
|
41
47
|
onSelect: onSelect,
|
|
48
|
+
previewImageUrls: previewImageUrls,
|
|
42
49
|
shortcut: item.keyshortcut,
|
|
43
50
|
title: item.title
|
|
44
51
|
});
|
|
@@ -3,8 +3,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
|
|
|
3
3
|
import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
|
|
4
4
|
import { getQuickInsertProviderMenuItemKey } from '@atlaskit/editor-common/quick-insert/get-provider-menu-item-key';
|
|
5
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
6
|
+
import { getSnippetPreviewImageUrls } from '@atlaskit/editor-common/quick-insert/snippet-preview-image-urls';
|
|
6
7
|
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
7
8
|
import AppsIcon from '@atlaskit/icon/core/apps';
|
|
9
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
10
|
const LegacyQuickInsertProviderMenuItem = ({
|
|
9
11
|
item,
|
|
10
12
|
onInsert
|
|
@@ -25,12 +27,17 @@ const LegacyQuickInsertProviderMenuItem = ({
|
|
|
25
27
|
return result;
|
|
26
28
|
};
|
|
27
29
|
const Icon = item.icon;
|
|
30
|
+
const itemKey = item.key === undefined ? undefined : String(item.key);
|
|
31
|
+
const snippetKeyPrefix = 'snippet-extension:snippet-';
|
|
32
|
+
const previewKey = itemKey !== null && itemKey !== void 0 && itemKey.startsWith(snippetKeyPrefix) ? itemKey.slice(snippetKeyPrefix.length) : undefined;
|
|
33
|
+
const previewImageUrls = isExperimentEnabled('platform_editor_slash_command') && previewKey ? getSnippetPreviewImageUrls(previewKey) : undefined;
|
|
28
34
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
29
35
|
iconBefore: Icon ? /*#__PURE__*/React.createElement(Icon, null) : /*#__PURE__*/React.createElement(AppsIcon, {
|
|
30
36
|
label: ""
|
|
31
37
|
}),
|
|
32
38
|
isDisabled: isDisabled,
|
|
33
39
|
onSelect: onSelect,
|
|
40
|
+
previewImageUrls: previewImageUrls,
|
|
34
41
|
shortcut: item.keyshortcut,
|
|
35
42
|
title: item.title
|
|
36
43
|
});
|
|
@@ -7,8 +7,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
|
|
|
7
7
|
import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
|
|
8
8
|
import { getQuickInsertProviderMenuItemKey } from '@atlaskit/editor-common/quick-insert/get-provider-menu-item-key';
|
|
9
9
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
10
|
+
import { getSnippetPreviewImageUrls } from '@atlaskit/editor-common/quick-insert/snippet-preview-image-urls';
|
|
10
11
|
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
11
12
|
import AppsIcon from '@atlaskit/icon/core/apps';
|
|
13
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
12
14
|
var LegacyQuickInsertProviderMenuItem = function LegacyQuickInsertProviderMenuItem(_ref) {
|
|
13
15
|
var item = _ref.item,
|
|
14
16
|
onInsert = _ref.onInsert;
|
|
@@ -26,12 +28,17 @@ var LegacyQuickInsertProviderMenuItem = function LegacyQuickInsertProviderMenuIt
|
|
|
26
28
|
return result;
|
|
27
29
|
};
|
|
28
30
|
var Icon = item.icon;
|
|
31
|
+
var itemKey = item.key === undefined ? undefined : String(item.key);
|
|
32
|
+
var snippetKeyPrefix = 'snippet-extension:snippet-';
|
|
33
|
+
var previewKey = itemKey !== null && itemKey !== void 0 && itemKey.startsWith(snippetKeyPrefix) ? itemKey.slice(snippetKeyPrefix.length) : undefined;
|
|
34
|
+
var previewImageUrls = isExperimentEnabled('platform_editor_slash_command') && previewKey ? getSnippetPreviewImageUrls(previewKey) : undefined;
|
|
29
35
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
30
36
|
iconBefore: Icon ? /*#__PURE__*/React.createElement(Icon, null) : /*#__PURE__*/React.createElement(AppsIcon, {
|
|
31
37
|
label: ""
|
|
32
38
|
}),
|
|
33
39
|
isDisabled: isDisabled,
|
|
34
40
|
onSelect: onSelect,
|
|
41
|
+
previewImageUrls: previewImageUrls,
|
|
35
42
|
shortcut: item.keyshortcut,
|
|
36
43
|
title: item.title
|
|
37
44
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.3",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
],
|
|
27
27
|
"atlaskit:src": "src/index.ts",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/button": "^25.
|
|
29
|
+
"@atlaskit/button": "^25.4.0",
|
|
30
30
|
"@atlaskit/css": "^1.1.0",
|
|
31
31
|
"@atlaskit/editor-plugin-analytics": "^19.0.0",
|
|
32
32
|
"@atlaskit/editor-plugin-connectivity": "^19.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-metrics": "^20.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-type-ahead": "^20.0.0",
|
|
35
|
-
"@atlaskit/editor-plugin-ui-control-registry": "^13.
|
|
35
|
+
"@atlaskit/editor-plugin-ui-control-registry": "^13.1.0",
|
|
36
36
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
37
37
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
38
|
-
"@atlaskit/editor-ui-control-model": "^2.
|
|
38
|
+
"@atlaskit/editor-ui-control-model": "^2.10.0",
|
|
39
39
|
"@atlaskit/heading": "^7.2.0",
|
|
40
40
|
"@atlaskit/icon": "^37.7.0",
|
|
41
41
|
"@atlaskit/modal-dialog": "^16.6.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@emotion/react": "^11.7.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^123.
|
|
54
|
+
"@atlaskit/editor-common": "^123.3.0",
|
|
55
55
|
"react": "^18.2.0 || ^19.2.0",
|
|
56
56
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
57
57
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|