@atlaskit/editor-plugin-hyperlink 23.0.2 → 23.0.4

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-hyperlink
2
2
 
3
+ ## 23.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a034f535638cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a034f535638cc) -
8
+ Add structured Quick Insert previews with localised title, description and attribution under
9
+ platform_editor_slash_command.
10
+
11
+ Exclude footer and category navigation actions from previews. Left-align attribution, use subtle
12
+ title and attribution text, and default description text.
13
+
14
+ Show text previews even without preview metadata, and reserve a fixed image area while images load
15
+ or when they fail. Keep previews within the viewport, flipping left when needed, with compact
16
+ panel dimensions and typography.
17
+
18
+ Replace baked panel screenshots with image-only assets. Remove image fields from text-only legacy
19
+ previews while preserving their attribution.
20
+
21
+ Let extension providers own their preview images and attribution. Pass preview metadata through
22
+ the Company Hub manifest factory and remove Editor's fallback preview registry.
23
+
24
+ Localize provider attribution names and display Confluence and Jira product icons instead of the
25
+ attribution prefix when an icon is present. Allow the Dropbox manifest to receive the host's
26
+ message formatter.
27
+
28
+ - Updated dependencies
29
+
30
+ ## 23.0.3
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 23.0.2
4
37
 
5
38
  ### Patch Changes
@@ -13,17 +13,26 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
13
13
  var _link = require("@atlaskit/editor-common/link");
14
14
  var _messages = require("@atlaskit/editor-common/messages");
15
15
  var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
16
+ var _messages2 = require("@atlaskit/editor-common/quick-insert/messages");
16
17
  var _link2 = _interopRequireDefault(require("@atlaskit/icon/core/link"));
17
18
  var _main = require("../../pm-plugins/main");
18
19
  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); }
19
20
  var previewImageUrls = {
20
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/k45g2t4lad0x76vcj2450e0rbu878341.png',
21
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/30kh88n77bw11v27ee721oi323c20cr6.png'
21
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHO.png',
22
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLL.png'
22
23
  };
23
24
  var HyperlinkQuickInsertMenuItem = exports.HyperlinkQuickInsertMenuItem = function HyperlinkQuickInsertMenuItem(_ref) {
24
25
  var api = _ref.api;
25
26
  var _useIntl = (0, _reactIntl.useIntl)(),
26
27
  formatMessage = _useIntl.formatMessage;
28
+ var preview = (0, _react.useMemo)(function () {
29
+ return {
30
+ image: previewImageUrls,
31
+ attribution: {
32
+ name: formatMessage(_messages2.messages.previewAttributionAtlassian)
33
+ }
34
+ };
35
+ }, [formatMessage]);
27
36
  var onSelect = (0, _react.useCallback)(function (_ref2) {
28
37
  var _api$analytics, _api$analytics$attach;
29
38
  var insert = _ref2.insert;
@@ -44,11 +53,12 @@ var HyperlinkQuickInsertMenuItem = exports.HyperlinkQuickInsertMenuItem = functi
44
53
  return analyticsAttached !== false ? tr : false;
45
54
  }, [api]);
46
55
  return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
56
+ description: formatMessage(_messages.toolbarInsertBlockMessages.linkDescription),
47
57
  iconBefore: /*#__PURE__*/_react.default.createElement(_link2.default, {
48
58
  label: ""
49
59
  }),
50
60
  onSelect: onSelect,
51
- previewImageUrls: previewImageUrls,
61
+ preview: preview,
52
62
  shortcut: (0, _keymaps.tooltip)(_keymaps.addLink),
53
63
  title: formatMessage(_messages.toolbarInsertBlockMessages.link)
54
64
  });
@@ -1,15 +1,16 @@
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 { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
5
5
  import { LinkAction } from '@atlaskit/editor-common/link';
6
6
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
8
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
8
9
  import LinkIcon from '@atlaskit/icon/core/link';
9
10
  import { stateKey } from '../../pm-plugins/main';
10
11
  const previewImageUrls = {
11
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/k45g2t4lad0x76vcj2450e0rbu878341.png',
12
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/30kh88n77bw11v27ee721oi323c20cr6.png'
12
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHO.png',
13
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLL.png'
13
14
  };
14
15
  export const HyperlinkQuickInsertMenuItem = ({
15
16
  api
@@ -17,6 +18,12 @@ export const HyperlinkQuickInsertMenuItem = ({
17
18
  const {
18
19
  formatMessage
19
20
  } = useIntl();
21
+ const preview = useMemo(() => ({
22
+ image: previewImageUrls,
23
+ attribution: {
24
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
25
+ }
26
+ }), [formatMessage]);
20
27
  const onSelect = useCallback(({
21
28
  insert
22
29
  }) => {
@@ -38,11 +45,12 @@ export const HyperlinkQuickInsertMenuItem = ({
38
45
  return analyticsAttached !== false ? tr : false;
39
46
  }, [api]);
40
47
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
48
+ description: formatMessage(messages.linkDescription),
41
49
  iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
42
50
  label: ""
43
51
  }),
44
52
  onSelect: onSelect,
45
- previewImageUrls: previewImageUrls,
53
+ preview: preview,
46
54
  shortcut: tooltip(addLink),
47
55
  title: formatMessage(messages.link)
48
56
  });
@@ -1,20 +1,29 @@
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 { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
5
5
  import { LinkAction } from '@atlaskit/editor-common/link';
6
6
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
8
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
8
9
  import LinkIcon from '@atlaskit/icon/core/link';
9
10
  import { stateKey } from '../../pm-plugins/main';
10
11
  var previewImageUrls = {
11
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/k45g2t4lad0x76vcj2450e0rbu878341.png',
12
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/30kh88n77bw11v27ee721oi323c20cr6.png'
12
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHO.png',
13
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLL.png'
13
14
  };
14
15
  export var HyperlinkQuickInsertMenuItem = function HyperlinkQuickInsertMenuItem(_ref) {
15
16
  var api = _ref.api;
16
17
  var _useIntl = useIntl(),
17
18
  formatMessage = _useIntl.formatMessage;
19
+ var preview = useMemo(function () {
20
+ return {
21
+ image: previewImageUrls,
22
+ attribution: {
23
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
24
+ }
25
+ };
26
+ }, [formatMessage]);
18
27
  var onSelect = useCallback(function (_ref2) {
19
28
  var _api$analytics, _api$analytics$attach;
20
29
  var insert = _ref2.insert;
@@ -35,11 +44,12 @@ export var HyperlinkQuickInsertMenuItem = function HyperlinkQuickInsertMenuItem(
35
44
  return analyticsAttached !== false ? tr : false;
36
45
  }, [api]);
37
46
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
47
+ description: formatMessage(messages.linkDescription),
38
48
  iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
39
49
  label: ""
40
50
  }),
41
51
  onSelect: onSelect,
42
- previewImageUrls: previewImageUrls,
52
+ preview: preview,
43
53
  shortcut: tooltip(addLink),
44
54
  title: formatMessage(messages.link)
45
55
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "23.0.2",
3
+ "version": "23.0.4",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,7 +24,7 @@
24
24
  "@atlaskit/adf-schema": "^57.6.0",
25
25
  "@atlaskit/analytics-next": "^12.5.0",
26
26
  "@atlaskit/editor-plugin-analytics": "^21.0.0",
27
- "@atlaskit/editor-plugin-card": "^27.0.0",
27
+ "@atlaskit/editor-plugin-card": "^27.1.0",
28
28
  "@atlaskit/editor-plugin-connectivity": "^21.0.0",
29
29
  "@atlaskit/editor-plugin-editor-viewmode": "^23.0.0",
30
30
  "@atlaskit/editor-plugin-primary-toolbar": "^22.0.0",
@@ -33,20 +33,20 @@
33
33
  "@atlaskit/editor-plugin-ui-control-registry": "^15.0.0",
34
34
  "@atlaskit/editor-plugin-user-intent": "^19.0.0",
35
35
  "@atlaskit/editor-prosemirror": "^9.0.0",
36
- "@atlaskit/editor-toolbar": "^2.7.0",
36
+ "@atlaskit/editor-toolbar": "^2.8.0",
37
37
  "@atlaskit/editor-toolbar-model": "^1.2.0",
38
38
  "@atlaskit/editor-ui-control-model": "^2.10.0",
39
39
  "@atlaskit/icon": "^38.0.0",
40
40
  "@atlaskit/platform-feature-experiments": "^0.3.0",
41
41
  "@atlaskit/platform-feature-flags": "^2.2.0",
42
42
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^207.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^209.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1",
46
46
  "uuid": "^11.1.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^125.2.0",
49
+ "@atlaskit/editor-common": "^125.4.0",
50
50
  "react": "^18.2.0 || ^19.2.0",
51
51
  "react-dom": "^18.2.0 || ^19.2.0",
52
52
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"