@atlaskit/editor-plugin-rule 21.0.0 → 22.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-rule
2
2
 
3
+ ## 22.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 21.0.1
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
  ## 21.0.0
4
37
 
5
38
  ### Minor Changes
@@ -11,6 +11,7 @@ var _reactIntl = require("react-intl");
11
11
  var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _messages = require("@atlaskit/editor-common/messages");
13
13
  var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
14
+ var _messages2 = require("@atlaskit/editor-common/quick-insert/messages");
14
15
  var _minus = _interopRequireDefault(require("@atlaskit/icon/core/minus"));
15
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); }
16
17
  var RuleQuickInsertMenuItem = exports.RuleQuickInsertMenuItem = function RuleQuickInsertMenuItem(_ref) {
@@ -18,6 +19,14 @@ var RuleQuickInsertMenuItem = exports.RuleQuickInsertMenuItem = function RuleQui
18
19
  previewImageUrls = _ref.previewImageUrls;
19
20
  var _useIntl = (0, _reactIntl.useIntl)(),
20
21
  formatMessage = _useIntl.formatMessage;
22
+ var preview = (0, _react.useMemo)(function () {
23
+ return previewImageUrls ? {
24
+ image: previewImageUrls,
25
+ attribution: {
26
+ name: formatMessage(_messages2.messages.previewAttributionAtlassian)
27
+ }
28
+ } : undefined;
29
+ }, [formatMessage, previewImageUrls]);
21
30
  var onSelect = (0, _react.useCallback)(function (_ref2) {
22
31
  var _api$analytics;
23
32
  var editorView = _ref2.editorView,
@@ -36,11 +45,12 @@ var RuleQuickInsertMenuItem = exports.RuleQuickInsertMenuItem = function RuleQui
36
45
  return tr;
37
46
  }, [api]);
38
47
  return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
48
+ description: formatMessage(_messages.toolbarInsertBlockMessages.horizontalRuleDescription),
39
49
  iconBefore: /*#__PURE__*/_react.default.createElement(_minus.default, {
40
50
  label: ""
41
51
  }),
42
52
  onSelect: onSelect,
43
- previewImageUrls: previewImageUrls,
53
+ preview: preview,
44
54
  shortcut: "---",
45
55
  title: formatMessage(_messages.toolbarInsertBlockMessages.horizontalRule)
46
56
  });
@@ -12,8 +12,8 @@ var _keys = require("@atlaskit/editor-common/quick-insert/keys");
12
12
  var _rank = require("@atlaskit/editor-common/quick-insert/rank");
13
13
  var _RuleQuickInsertMenuItem = require("./RuleQuickInsertMenuItem");
14
14
  var previewImageUrls = {
15
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/p53x1j2j1855123gdr8fw4jri2f6mn1h.png',
16
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/i2o73i23qw321aj6i5r14wtvfsyqg784.png'
15
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVL8.png',
16
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVK1.png'
17
17
  };
18
18
  var getRuleQuickInsertComponents = exports.getRuleQuickInsertComponents = function getRuleQuickInsertComponents(_ref) {
19
19
  var api = _ref.api;
@@ -1,8 +1,9 @@
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 { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
6
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
6
7
  import MinusIcon from '@atlaskit/icon/core/minus';
7
8
  export const RuleQuickInsertMenuItem = ({
8
9
  api,
@@ -11,6 +12,12 @@ export const RuleQuickInsertMenuItem = ({
11
12
  const {
12
13
  formatMessage
13
14
  } = useIntl();
15
+ const preview = useMemo(() => previewImageUrls ? {
16
+ image: previewImageUrls,
17
+ attribution: {
18
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
19
+ }
20
+ } : undefined, [formatMessage, previewImageUrls]);
14
21
  const onSelect = useCallback(({
15
22
  editorView,
16
23
  insert,
@@ -30,11 +37,12 @@ export const RuleQuickInsertMenuItem = ({
30
37
  return tr;
31
38
  }, [api]);
32
39
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
40
+ description: formatMessage(messages.horizontalRuleDescription),
33
41
  iconBefore: /*#__PURE__*/React.createElement(MinusIcon, {
34
42
  label: ""
35
43
  }),
36
44
  onSelect: onSelect,
37
- previewImageUrls: previewImageUrls,
45
+ preview: preview,
38
46
  shortcut: "---",
39
47
  title: formatMessage(messages.horizontalRule)
40
48
  });
@@ -5,8 +5,8 @@ import { RULE_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { RuleQuickInsertMenuItem } from './RuleQuickInsertMenuItem';
7
7
  const previewImageUrls = {
8
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/p53x1j2j1855123gdr8fw4jri2f6mn1h.png',
9
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/i2o73i23qw321aj6i5r14wtvfsyqg784.png'
8
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVL8.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVK1.png'
10
10
  };
11
11
  export const getRuleQuickInsertComponents = ({
12
12
  api
@@ -1,14 +1,23 @@
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 { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
6
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
6
7
  import MinusIcon from '@atlaskit/icon/core/minus';
7
8
  export var RuleQuickInsertMenuItem = function RuleQuickInsertMenuItem(_ref) {
8
9
  var api = _ref.api,
9
10
  previewImageUrls = _ref.previewImageUrls;
10
11
  var _useIntl = useIntl(),
11
12
  formatMessage = _useIntl.formatMessage;
13
+ var preview = useMemo(function () {
14
+ return previewImageUrls ? {
15
+ image: previewImageUrls,
16
+ attribution: {
17
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
18
+ }
19
+ } : undefined;
20
+ }, [formatMessage, previewImageUrls]);
12
21
  var onSelect = useCallback(function (_ref2) {
13
22
  var _api$analytics;
14
23
  var editorView = _ref2.editorView,
@@ -27,11 +36,12 @@ export var RuleQuickInsertMenuItem = function RuleQuickInsertMenuItem(_ref) {
27
36
  return tr;
28
37
  }, [api]);
29
38
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
39
+ description: formatMessage(messages.horizontalRuleDescription),
30
40
  iconBefore: /*#__PURE__*/React.createElement(MinusIcon, {
31
41
  label: ""
32
42
  }),
33
43
  onSelect: onSelect,
34
- previewImageUrls: previewImageUrls,
44
+ preview: preview,
35
45
  shortcut: "---",
36
46
  title: formatMessage(messages.horizontalRule)
37
47
  });
@@ -5,8 +5,8 @@ import { RULE_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { RuleQuickInsertMenuItem } from './RuleQuickInsertMenuItem';
7
7
  var previewImageUrls = {
8
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/p53x1j2j1855123gdr8fw4jri2f6mn1h.png',
9
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/i2o73i23qw321aj6i5r14wtvfsyqg784.png'
8
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVL8.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVK1.png'
10
10
  };
11
11
  export var getRuleQuickInsertComponents = function getRuleQuickInsertComponents(_ref) {
12
12
  var api = _ref.api;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-rule",
3
- "version": "21.0.0",
3
+ "version": "22.0.0",
4
4
  "description": "Rule plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -22,9 +22,9 @@
22
22
  "@atlaskit/adf-schema": "^57.6.0",
23
23
  "@atlaskit/button": "^25.4.0",
24
24
  "@atlaskit/css": "^1.1.0",
25
- "@atlaskit/editor-plugin-analytics": "^21.0.0",
26
- "@atlaskit/editor-plugin-floating-toolbar": "^23.0.0",
27
- "@atlaskit/editor-plugin-ui-control-registry": "^15.0.0",
25
+ "@atlaskit/editor-plugin-analytics": "^22.0.0",
26
+ "@atlaskit/editor-plugin-floating-toolbar": "^24.0.0",
27
+ "@atlaskit/editor-plugin-ui-control-registry": "^16.0.0",
28
28
  "@atlaskit/editor-prosemirror": "^9.0.0",
29
29
  "@atlaskit/editor-shared-styles": "^4.3.0",
30
30
  "@atlaskit/icon": "^38.0.0",
@@ -38,7 +38,7 @@
38
38
  "react-intl": "^7.0.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "@atlaskit/editor-common": "^125.0.0",
41
+ "@atlaskit/editor-common": "^126.0.0",
42
42
  "react": "^18.2.0 || ^19.2.0",
43
43
  "react-dom": "^18.2.0 || ^19.2.0"
44
44
  },