@atlaskit/editor-plugin-expand 22.0.3 → 23.0.0

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,38 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 23.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 22.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`a034f535638cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a034f535638cc) -
14
+ Add structured Quick Insert previews with localised title, description and attribution under
15
+ platform_editor_slash_command.
16
+
17
+ Exclude footer and category navigation actions from previews. Left-align attribution, use subtle
18
+ title and attribution text, and default description text.
19
+
20
+ Show text previews even without preview metadata, and reserve a fixed image area while images load
21
+ or when they fail. Keep previews within the viewport, flipping left when needed, with compact
22
+ panel dimensions and typography.
23
+
24
+ Replace baked panel screenshots with image-only assets. Remove image fields from text-only legacy
25
+ previews while preserving their attribution.
26
+
27
+ Let extension providers own their preview images and attribution. Pass preview metadata through
28
+ the Company Hub manifest factory and remove Editor's fallback preview registry.
29
+
30
+ Localize provider attribution names and display Confluence and Jira product icons instead of the
31
+ attribution prefix when an icon is present. Allow the Dropbox manifest to receive the host's
32
+ message formatter.
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 22.0.3
4
37
 
5
38
  ### Patch Changes
@@ -12,6 +12,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _hooks = require("@atlaskit/editor-common/hooks");
13
13
  var _messages = require("@atlaskit/editor-common/messages");
14
14
  var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
15
+ var _messages2 = require("@atlaskit/editor-common/quick-insert/messages");
15
16
  var _utils = require("@atlaskit/editor-common/utils");
16
17
  var _expandElement = _interopRequireDefault(require("@atlaskit/icon-lab/core/expand-element"));
17
18
  var _fg = require("@atlaskit/platform-feature-flags/fg");
@@ -24,6 +25,14 @@ var ExpandQuickInsertMenuItem = exports.ExpandQuickInsertMenuItem = function Exp
24
25
  previewImageUrls = _ref.previewImageUrls;
25
26
  var _useIntl = (0, _reactIntl.useIntl)(),
26
27
  formatMessage = _useIntl.formatMessage;
28
+ var preview = (0, _react.useMemo)(function () {
29
+ return previewImageUrls ? {
30
+ image: previewImageUrls,
31
+ attribution: {
32
+ name: formatMessage(_messages2.messages.previewAttributionAtlassian)
33
+ }
34
+ } : undefined;
35
+ }, [formatMessage, previewImageUrls]);
27
36
  var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorDisabled', 'editorViewMode'], function (states) {
28
37
  var _states$editorDisable, _states$editorViewMod;
29
38
  return {
@@ -59,12 +68,13 @@ var ExpandQuickInsertMenuItem = exports.ExpandQuickInsertMenuItem = function Exp
59
68
  return tr;
60
69
  }, [api, isLegacy]);
61
70
  return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
71
+ description: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
62
72
  iconBefore: /*#__PURE__*/_react.default.createElement(_expandElement.default, {
63
73
  label: ""
64
74
  }),
65
75
  isDisabled: editorDisabled || mode === 'view',
66
76
  onSelect: onSelect,
67
- previewImageUrls: previewImageUrls,
77
+ preview: preview,
68
78
  title: formatMessage(_messages.toolbarInsertBlockMessages.expand)
69
79
  });
70
80
  };
@@ -15,8 +15,8 @@ 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
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'
18
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKK.png',
19
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH5.png'
20
20
  };
21
21
  var getExpandQuickInsertComponents = exports.getExpandQuickInsertComponents = function getExpandQuickInsertComponents(_ref) {
22
22
  var api = _ref.api,
@@ -1,9 +1,10 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useMemo } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
5
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
7
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
7
8
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
9
  import ExpandElementIcon from '@atlaskit/icon-lab/core/expand-element';
9
10
  import { fg } from '@atlaskit/platform-feature-flags/fg';
@@ -17,6 +18,12 @@ export const ExpandQuickInsertMenuItem = ({
17
18
  const {
18
19
  formatMessage
19
20
  } = useIntl();
21
+ const preview = useMemo(() => previewImageUrls ? {
22
+ image: previewImageUrls,
23
+ attribution: {
24
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
25
+ }
26
+ } : undefined, [formatMessage, previewImageUrls]);
20
27
  const {
21
28
  editorDisabled,
22
29
  mode
@@ -56,12 +63,13 @@ export const ExpandQuickInsertMenuItem = ({
56
63
  return tr;
57
64
  }, [api, isLegacy]);
58
65
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
66
+ description: formatMessage(messages.expandDescription),
59
67
  iconBefore: /*#__PURE__*/React.createElement(ExpandElementIcon, {
60
68
  label: ""
61
69
  }),
62
70
  isDisabled: editorDisabled || mode === 'view',
63
71
  onSelect: onSelect,
64
- previewImageUrls: previewImageUrls,
72
+ preview: preview,
65
73
  title: formatMessage(messages.expand)
66
74
  });
67
75
  };
@@ -5,8 +5,8 @@ import { EXPAND_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/qui
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { ExpandQuickInsertMenuItem } from './ExpandQuickInsertMenuItem';
7
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'
8
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKK.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH5.png'
10
10
  };
11
11
  export const getExpandQuickInsertComponents = ({
12
12
  api,
@@ -1,9 +1,10 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useMemo } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
5
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
7
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
7
8
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
8
9
  import ExpandElementIcon from '@atlaskit/icon-lab/core/expand-element';
9
10
  import { fg } from '@atlaskit/platform-feature-flags/fg';
@@ -15,6 +16,14 @@ export var ExpandQuickInsertMenuItem = function ExpandQuickInsertMenuItem(_ref)
15
16
  previewImageUrls = _ref.previewImageUrls;
16
17
  var _useIntl = useIntl(),
17
18
  formatMessage = _useIntl.formatMessage;
19
+ var preview = useMemo(function () {
20
+ return previewImageUrls ? {
21
+ image: previewImageUrls,
22
+ attribution: {
23
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
24
+ }
25
+ } : undefined;
26
+ }, [formatMessage, previewImageUrls]);
18
27
  var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['editorDisabled', 'editorViewMode'], function (states) {
19
28
  var _states$editorDisable, _states$editorViewMod;
20
29
  return {
@@ -50,12 +59,13 @@ export var ExpandQuickInsertMenuItem = function ExpandQuickInsertMenuItem(_ref)
50
59
  return tr;
51
60
  }, [api, isLegacy]);
52
61
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
62
+ description: formatMessage(messages.expandDescription),
53
63
  iconBefore: /*#__PURE__*/React.createElement(ExpandElementIcon, {
54
64
  label: ""
55
65
  }),
56
66
  isDisabled: editorDisabled || mode === 'view',
57
67
  onSelect: onSelect,
58
- previewImageUrls: previewImageUrls,
68
+ preview: preview,
59
69
  title: formatMessage(messages.expand)
60
70
  });
61
71
  };
@@ -8,8 +8,8 @@ import { EXPAND_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/qui
8
8
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
9
9
  import { ExpandQuickInsertMenuItem } from './ExpandQuickInsertMenuItem';
10
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'
11
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKK.png',
12
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH5.png'
13
13
  };
14
14
  export var getExpandQuickInsertComponents = function getExpandQuickInsertComponents(_ref) {
15
15
  var api = _ref.api,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "22.0.3",
3
+ "version": "23.0.0",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -23,27 +23,27 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/adf-schema": "^57.6.0",
25
25
  "@atlaskit/button": "^25.4.0",
26
- "@atlaskit/editor-plugin-analytics": "^21.0.0",
27
- "@atlaskit/editor-plugin-block-controls": "^22.0.0",
28
- "@atlaskit/editor-plugin-block-menu": "^20.0.0",
29
- "@atlaskit/editor-plugin-decorations": "^21.0.0",
30
- "@atlaskit/editor-plugin-editor-disabled": "^21.0.0",
31
- "@atlaskit/editor-plugin-editor-viewmode": "^23.0.0",
32
- "@atlaskit/editor-plugin-limited-mode": "^18.0.0",
33
- "@atlaskit/editor-plugin-local-id": "^19.0.0",
34
- "@atlaskit/editor-plugin-selection": "^21.0.0",
35
- "@atlaskit/editor-plugin-selection-marker": "^21.0.0",
26
+ "@atlaskit/editor-plugin-analytics": "^22.0.0",
27
+ "@atlaskit/editor-plugin-block-controls": "^23.0.0",
28
+ "@atlaskit/editor-plugin-block-menu": "^21.0.0",
29
+ "@atlaskit/editor-plugin-decorations": "^22.0.0",
30
+ "@atlaskit/editor-plugin-editor-disabled": "^22.0.0",
31
+ "@atlaskit/editor-plugin-editor-viewmode": "^24.0.0",
32
+ "@atlaskit/editor-plugin-limited-mode": "^19.0.0",
33
+ "@atlaskit/editor-plugin-local-id": "^20.0.0",
34
+ "@atlaskit/editor-plugin-selection": "^22.0.0",
35
+ "@atlaskit/editor-plugin-selection-marker": "^22.0.0",
36
36
  "@atlaskit/editor-prosemirror": "^9.0.0",
37
37
  "@atlaskit/editor-shared-styles": "^4.3.0",
38
38
  "@atlaskit/editor-tables": "^3.2.0",
39
- "@atlaskit/editor-toolbar": "^2.7.0",
39
+ "@atlaskit/editor-toolbar": "^2.8.0",
40
40
  "@atlaskit/editor-ui-control-model": "^2.10.0",
41
41
  "@atlaskit/icon": "^38.0.0",
42
- "@atlaskit/icon-lab": "^7.9.0",
42
+ "@atlaskit/icon-lab": "^7.10.0",
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": "^208.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^209.0.0",
47
47
  "@atlaskit/tokens": "^20.0.0",
48
48
  "@atlaskit/tooltip": "^24.3.0",
49
49
  "@babel/runtime": "^7.0.0",
@@ -52,7 +52,7 @@
52
52
  "w3c-keyname": "^2.1.8"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^125.2.0",
55
+ "@atlaskit/editor-common": "^126.0.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"