@atlaskit/editor-plugin-expand 19.0.10 → 19.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-expand
2
2
 
3
+ ## 19.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
  ## 19.0.10
4
13
 
5
14
  ### Patch Changes
@@ -20,7 +20,8 @@ var _commands2 = require("../../singlePlayerExpand/commands");
20
20
  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); }
21
21
  var ExpandQuickInsertMenuItem = exports.ExpandQuickInsertMenuItem = function ExpandQuickInsertMenuItem(_ref) {
22
22
  var api = _ref.api,
23
- isLegacy = _ref.isLegacy;
23
+ isLegacy = _ref.isLegacy,
24
+ previewImageUrls = _ref.previewImageUrls;
24
25
  var _useIntl = (0, _reactIntl.useIntl)(),
25
26
  formatMessage = _useIntl.formatMessage;
26
27
  var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorDisabled', 'editorViewMode'], function (states) {
@@ -63,6 +64,7 @@ var ExpandQuickInsertMenuItem = exports.ExpandQuickInsertMenuItem = function Exp
63
64
  }),
64
65
  isDisabled: editorDisabled || mode === 'view',
65
66
  onSelect: onSelect,
67
+ previewImageUrls: previewImageUrls,
66
68
  title: formatMessage(_messages.toolbarInsertBlockMessages.expand)
67
69
  });
68
70
  };
@@ -14,6 +14,10 @@ var _rank = require("@atlaskit/editor-common/quick-insert/rank");
14
14
  var _ExpandQuickInsertMenuItem = require("./ExpandQuickInsertMenuItem");
15
15
  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; }
16
16
  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; }
17
+ var previewImageUrls = {
18
+ light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/ltu45641cf615ybs8mr78hme7370ka38.png',
19
+ dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/gg4nl63re230l87iq0w0wqwas31esm3q.png'
20
+ };
17
21
  var getExpandQuickInsertComponents = exports.getExpandQuickInsertComponents = function getExpandQuickInsertComponents(_ref) {
18
22
  var api = _ref.api,
19
23
  isLegacy = _ref.isLegacy;
@@ -34,7 +38,8 @@ var getExpandQuickInsertComponents = exports.getExpandQuickInsertComponents = fu
34
38
  component: function component() {
35
39
  return /*#__PURE__*/_react.default.createElement(_ExpandQuickInsertMenuItem.ExpandQuickInsertMenuItem, {
36
40
  api: api,
37
- isLegacy: isLegacy
41
+ isLegacy: isLegacy,
42
+ previewImageUrls: previewImageUrls
38
43
  });
39
44
  }
40
45
  }];
@@ -11,7 +11,8 @@ import { createExpandNode as createLegacyExpandNode } from '../../legacyExpand/c
11
11
  import { createExpandNode as createSinglePlayerExpandNode, wrapSelectionAndSetExpandedState } from '../../singlePlayerExpand/commands';
12
12
  export const ExpandQuickInsertMenuItem = ({
13
13
  api,
14
- isLegacy
14
+ isLegacy,
15
+ previewImageUrls
15
16
  }) => {
16
17
  const {
17
18
  formatMessage
@@ -60,6 +61,7 @@ export const ExpandQuickInsertMenuItem = ({
60
61
  }),
61
62
  isDisabled: editorDisabled || mode === 'view',
62
63
  onSelect: onSelect,
64
+ previewImageUrls: previewImageUrls,
63
65
  title: formatMessage(messages.expand)
64
66
  });
65
67
  };
@@ -4,6 +4,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
4
4
  import { EXPAND_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 { ExpandQuickInsertMenuItem } from './ExpandQuickInsertMenuItem';
7
+ const previewImageUrls = {
8
+ light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/ltu45641cf615ybs8mr78hme7370ka38.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/gg4nl63re230l87iq0w0wqwas31esm3q.png'
10
+ };
7
11
  export const getExpandQuickInsertComponents = ({
8
12
  api,
9
13
  isLegacy
@@ -23,6 +27,7 @@ export const getExpandQuickInsertComponents = ({
23
27
  })),
24
28
  component: () => /*#__PURE__*/React.createElement(ExpandQuickInsertMenuItem, {
25
29
  api: api,
26
- isLegacy: isLegacy
30
+ isLegacy: isLegacy,
31
+ previewImageUrls: previewImageUrls
27
32
  })
28
33
  }];
@@ -11,7 +11,8 @@ import { createExpandNode as createLegacyExpandNode } from '../../legacyExpand/c
11
11
  import { createExpandNode as createSinglePlayerExpandNode, wrapSelectionAndSetExpandedState } from '../../singlePlayerExpand/commands';
12
12
  export var ExpandQuickInsertMenuItem = function ExpandQuickInsertMenuItem(_ref) {
13
13
  var api = _ref.api,
14
- isLegacy = _ref.isLegacy;
14
+ isLegacy = _ref.isLegacy,
15
+ previewImageUrls = _ref.previewImageUrls;
15
16
  var _useIntl = useIntl(),
16
17
  formatMessage = _useIntl.formatMessage;
17
18
  var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['editorDisabled', 'editorViewMode'], function (states) {
@@ -54,6 +55,7 @@ export var ExpandQuickInsertMenuItem = function ExpandQuickInsertMenuItem(_ref)
54
55
  }),
55
56
  isDisabled: editorDisabled || mode === 'view',
56
57
  onSelect: onSelect,
58
+ previewImageUrls: previewImageUrls,
57
59
  title: formatMessage(messages.expand)
58
60
  });
59
61
  };
@@ -7,6 +7,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
7
7
  import { EXPAND_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
8
8
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
9
9
  import { ExpandQuickInsertMenuItem } from './ExpandQuickInsertMenuItem';
10
+ var previewImageUrls = {
11
+ light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/ltu45641cf615ybs8mr78hme7370ka38.png',
12
+ dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/gg4nl63re230l87iq0w0wqwas31esm3q.png'
13
+ };
10
14
  export var getExpandQuickInsertComponents = function getExpandQuickInsertComponents(_ref) {
11
15
  var api = _ref.api,
12
16
  isLegacy = _ref.isLegacy;
@@ -27,7 +31,8 @@ export var getExpandQuickInsertComponents = function getExpandQuickInsertCompone
27
31
  component: function component() {
28
32
  return /*#__PURE__*/React.createElement(ExpandQuickInsertMenuItem, {
29
33
  api: api,
30
- isLegacy: isLegacy
34
+ isLegacy: isLegacy,
35
+ previewImageUrls: previewImageUrls
31
36
  });
32
37
  }
33
38
  }];
@@ -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 { ExpandPlugin } from '../../types';
4
5
  type Props = {
5
6
  api: ExtractInjectionAPI<ExpandPlugin> | undefined;
6
7
  isLegacy: boolean;
8
+ previewImageUrls?: QuickInsertMenuItemProps['previewImageUrls'];
7
9
  };
8
- export declare const ExpandQuickInsertMenuItem: ({ api, isLegacy }: Props) => React.JSX.Element;
10
+ export declare const ExpandQuickInsertMenuItem: ({ api, isLegacy, previewImageUrls, }: Props) => React.JSX.Element;
9
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "19.0.10",
3
+ "version": "19.0.11",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,8 +43,8 @@
43
43
  "@atlaskit/platform-feature-experiments": "^0.3.0",
44
44
  "@atlaskit/platform-feature-flags": "^2.2.0",
45
45
  "@atlaskit/prosemirror-history": "^1.2.0",
46
- "@atlaskit/tmp-editor-statsig": "^198.0.0",
47
- "@atlaskit/tokens": "^17.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^199.0.0",
47
+ "@atlaskit/tokens": "^18.0.0",
48
48
  "@atlaskit/tooltip": "^24.3.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@emotion/react": "^11.7.1",
@@ -52,7 +52,7 @@
52
52
  "w3c-keyname": "^2.1.8"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^122.10.0",
55
+ "@atlaskit/editor-common": "^122.11.0",
56
56
  "react": "^18.2.0 || ^19.2.0",
57
57
  "react-dom": "^18.2.0 || ^19.2.0",
58
58
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"