@atlaskit/editor-plugin-code-block 20.0.10 → 20.0.11

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,14 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 20.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`88fb7a8d4013a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88fb7a8d4013a) -
8
+ [ux] Add optional light and dark preview URLs to slash-command menu items and pass theme-aware
9
+ previews to supported commands when the `platform_editor_slash_command` experiment is enabled.
10
+ - Updated dependencies
11
+
3
12
  ## 20.0.10
4
13
 
5
14
  ### Patch Changes
@@ -15,7 +15,8 @@ var _angleBrackets = _interopRequireDefault(require("@atlaskit/icon/core/angle-b
15
15
  var _editorCommands = require("../../editor-commands");
16
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); }
17
17
  var CodeBlockQuickInsertMenuItem = exports.CodeBlockQuickInsertMenuItem = function CodeBlockQuickInsertMenuItem(_ref) {
18
- var api = _ref.api;
18
+ var api = _ref.api,
19
+ previewImageUrls = _ref.previewImageUrls;
19
20
  var _useIntl = (0, _reactIntl.useIntl)(),
20
21
  formatMessage = _useIntl.formatMessage;
21
22
  var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorDisabled'], function (states) {
@@ -41,6 +42,7 @@ var CodeBlockQuickInsertMenuItem = exports.CodeBlockQuickInsertMenuItem = functi
41
42
  }),
42
43
  isDisabled: editorDisabled,
43
44
  onSelect: onSelect,
45
+ previewImageUrls: previewImageUrls,
44
46
  shortcut: "```",
45
47
  title: formatMessage(_messages.blockTypeMessages.codeblock)
46
48
  });
@@ -11,6 +11,10 @@ var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/cr
11
11
  var _keys = require("@atlaskit/editor-common/quick-insert/keys");
12
12
  var _rank = require("@atlaskit/editor-common/quick-insert/rank");
13
13
  var _CodeBlockQuickInsertMenuItem = require("./CodeBlockQuickInsertMenuItem");
14
+ var previewImageUrls = {
15
+ light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/wtf74vgl71h0j84a742l84qly50mdeq2.png',
16
+ dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/11t8334w2tk154543fv1l248n1he6173.png'
17
+ };
14
18
  var getCodeBlockQuickInsertComponents = exports.getCodeBlockQuickInsertComponents = function getCodeBlockQuickInsertComponents(_ref) {
15
19
  var api = _ref.api;
16
20
  return [{
@@ -32,7 +36,8 @@ var getCodeBlockQuickInsertComponents = exports.getCodeBlockQuickInsertComponent
32
36
  }),
33
37
  component: function component() {
34
38
  return /*#__PURE__*/_react.default.createElement(_CodeBlockQuickInsertMenuItem.CodeBlockQuickInsertMenuItem, {
35
- api: api
39
+ api: api,
40
+ previewImageUrls: previewImageUrls
36
41
  });
37
42
  }
38
43
  }];
@@ -6,7 +6,8 @@ import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-i
6
6
  import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
7
7
  import { createInsertCodeBlockTransactionWithAnalytics } from '../../editor-commands';
8
8
  export const CodeBlockQuickInsertMenuItem = ({
9
- api
9
+ api,
10
+ previewImageUrls
10
11
  }) => {
11
12
  const {
12
13
  formatMessage
@@ -36,6 +37,7 @@ export const CodeBlockQuickInsertMenuItem = ({
36
37
  }),
37
38
  isDisabled: editorDisabled,
38
39
  onSelect: onSelect,
40
+ previewImageUrls: previewImageUrls,
39
41
  shortcut: "```",
40
42
  title: formatMessage(blockTypeMessages.codeblock)
41
43
  });
@@ -4,6 +4,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
4
4
  import { CODE_BLOCK_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { CodeBlockQuickInsertMenuItem } from './CodeBlockQuickInsertMenuItem';
7
+ const previewImageUrls = {
8
+ light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/wtf74vgl71h0j84a742l84qly50mdeq2.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/11t8334w2tk154543fv1l248n1he6173.png'
10
+ };
7
11
  export const getCodeBlockQuickInsertComponents = ({
8
12
  api
9
13
  }) => [{
@@ -23,6 +27,7 @@ export const getCodeBlockQuickInsertComponents = ({
23
27
  title: formatMessage(blockTypeMessages.codeblock)
24
28
  })),
25
29
  component: () => /*#__PURE__*/React.createElement(CodeBlockQuickInsertMenuItem, {
26
- api: api
30
+ api: api,
31
+ previewImageUrls: previewImageUrls
27
32
  })
28
33
  }];
@@ -6,7 +6,8 @@ import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-i
6
6
  import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
7
7
  import { createInsertCodeBlockTransactionWithAnalytics } from '../../editor-commands';
8
8
  export var CodeBlockQuickInsertMenuItem = function CodeBlockQuickInsertMenuItem(_ref) {
9
- var api = _ref.api;
9
+ var api = _ref.api,
10
+ previewImageUrls = _ref.previewImageUrls;
10
11
  var _useIntl = useIntl(),
11
12
  formatMessage = _useIntl.formatMessage;
12
13
  var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['editorDisabled'], function (states) {
@@ -32,6 +33,7 @@ export var CodeBlockQuickInsertMenuItem = function CodeBlockQuickInsertMenuItem(
32
33
  }),
33
34
  isDisabled: editorDisabled,
34
35
  onSelect: onSelect,
36
+ previewImageUrls: previewImageUrls,
35
37
  shortcut: "```",
36
38
  title: formatMessage(blockTypeMessages.codeblock)
37
39
  });
@@ -4,6 +4,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
4
4
  import { CODE_BLOCK_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { CodeBlockQuickInsertMenuItem } from './CodeBlockQuickInsertMenuItem';
7
+ var previewImageUrls = {
8
+ light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/wtf74vgl71h0j84a742l84qly50mdeq2.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/11t8334w2tk154543fv1l248n1he6173.png'
10
+ };
7
11
  export var getCodeBlockQuickInsertComponents = function getCodeBlockQuickInsertComponents(_ref) {
8
12
  var api = _ref.api;
9
13
  return [{
@@ -25,7 +29,8 @@ export var getCodeBlockQuickInsertComponents = function getCodeBlockQuickInsertC
25
29
  }),
26
30
  component: function component() {
27
31
  return /*#__PURE__*/React.createElement(CodeBlockQuickInsertMenuItem, {
28
- api: api
32
+ api: api,
33
+ previewImageUrls: previewImageUrls
29
34
  });
30
35
  }
31
36
  }];
@@ -1,6 +1,8 @@
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 { CodeBlockPlugin } from '../../codeBlockPluginType';
4
- export declare const CodeBlockQuickInsertMenuItem: ({ api, }: {
5
+ export declare const CodeBlockQuickInsertMenuItem: ({ api, previewImageUrls, }: {
5
6
  api: ExtractInjectionAPI<CodeBlockPlugin> | undefined;
7
+ previewImageUrls?: QuickInsertMenuItemProps['previewImageUrls'];
6
8
  }) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "20.0.10",
3
+ "version": "20.0.11",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-plugin-decorations": "^18.0.0",
30
30
  "@atlaskit/editor-plugin-editor-disabled": "^18.0.0",
31
31
  "@atlaskit/editor-plugin-editor-viewmode": "^20.0.0",
32
- "@atlaskit/editor-plugin-interaction": "^30.0.0",
32
+ "@atlaskit/editor-plugin-interaction": "^31.0.0",
33
33
  "@atlaskit/editor-plugin-selection": "^18.0.0",
34
34
  "@atlaskit/editor-plugin-toolbar": "^15.0.0",
35
35
  "@atlaskit/editor-prosemirror": "^8.0.0",
@@ -45,13 +45,13 @@
45
45
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
46
46
  "@atlaskit/react-select": "^4.9.0",
47
47
  "@atlaskit/select": "^22.11.0",
48
- "@atlaskit/tmp-editor-statsig": "^198.0.0",
49
- "@atlaskit/tokens": "^17.0.0",
48
+ "@atlaskit/tmp-editor-statsig": "^199.0.0",
49
+ "@atlaskit/tokens": "^18.0.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@compiled/react": "^1.0.2"
52
52
  },
53
53
  "peerDependencies": {
54
- "@atlaskit/editor-common": "^122.10.0",
54
+ "@atlaskit/editor-common": "^122.11.0",
55
55
  "react": "^18.2.0 || ^19.2.0",
56
56
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
57
57
  },