@atlaskit/editor-plugin-date 23.0.3 → 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 +27 -0
- package/dist/cjs/ui/quick-insert/DateQuickInsertMenuItem.js +11 -1
- package/dist/cjs/ui/quick-insert/getDateQuickInsertComponents.js +2 -2
- package/dist/es2019/ui/quick-insert/DateQuickInsertMenuItem.js +10 -2
- package/dist/es2019/ui/quick-insert/getDateQuickInsertComponents.js +2 -2
- package/dist/esm/ui/quick-insert/DateQuickInsertMenuItem.js +12 -2
- package/dist/esm/ui/quick-insert/getDateQuickInsertComponents.js +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-date
|
|
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
|
+
|
|
3
30
|
## 23.0.3
|
|
4
31
|
|
|
5
32
|
### Patch 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 _calendar = _interopRequireDefault(require("@atlaskit/icon/core/calendar"));
|
|
15
16
|
var _actions = require("../../pm-plugins/actions");
|
|
16
17
|
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,6 +20,14 @@ var DateQuickInsertMenuItem = exports.DateQuickInsertMenuItem = function DateQui
|
|
|
19
20
|
previewImageUrls = _ref.previewImageUrls;
|
|
20
21
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
21
22
|
formatMessage = _useIntl.formatMessage;
|
|
23
|
+
var preview = (0, _react.useMemo)(function () {
|
|
24
|
+
return previewImageUrls ? {
|
|
25
|
+
image: previewImageUrls,
|
|
26
|
+
attribution: {
|
|
27
|
+
name: formatMessage(_messages2.messages.previewAttributionAtlassian)
|
|
28
|
+
}
|
|
29
|
+
} : undefined;
|
|
30
|
+
}, [formatMessage, previewImageUrls]);
|
|
22
31
|
var onSelect = (0, _react.useCallback)(function (_ref2) {
|
|
23
32
|
var _api$analytics, _api$analytics$attach;
|
|
24
33
|
var insert = _ref2.insert,
|
|
@@ -36,11 +45,12 @@ var DateQuickInsertMenuItem = exports.DateQuickInsertMenuItem = function DateQui
|
|
|
36
45
|
return tr;
|
|
37
46
|
}, [api]);
|
|
38
47
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
48
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.dateDescription),
|
|
39
49
|
iconBefore: /*#__PURE__*/_react.default.createElement(_calendar.default, {
|
|
40
50
|
label: ""
|
|
41
51
|
}),
|
|
42
52
|
onSelect: onSelect,
|
|
43
|
-
|
|
53
|
+
preview: preview,
|
|
44
54
|
shortcut: "//",
|
|
45
55
|
title: formatMessage(_messages.toolbarInsertBlockMessages.date)
|
|
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 _DateQuickInsertMenuItem = require("./DateQuickInsertMenuItem");
|
|
14
14
|
var previewImageUrls = {
|
|
15
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
16
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
15
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVNK.png',
|
|
16
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVJO.png'
|
|
17
17
|
};
|
|
18
18
|
var getDateQuickInsertComponents = exports.getDateQuickInsertComponents = function getDateQuickInsertComponents(_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 CalendarIcon from '@atlaskit/icon/core/calendar';
|
|
7
8
|
import { createDateAtTransaction } from '../../pm-plugins/actions';
|
|
8
9
|
export const DateQuickInsertMenuItem = ({
|
|
@@ -12,6 +13,12 @@ export const DateQuickInsertMenuItem = ({
|
|
|
12
13
|
const {
|
|
13
14
|
formatMessage
|
|
14
15
|
} = useIntl();
|
|
16
|
+
const preview = useMemo(() => previewImageUrls ? {
|
|
17
|
+
image: previewImageUrls,
|
|
18
|
+
attribution: {
|
|
19
|
+
name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
|
|
20
|
+
}
|
|
21
|
+
} : undefined, [formatMessage, previewImageUrls]);
|
|
15
22
|
const onSelect = useCallback(({
|
|
16
23
|
insert,
|
|
17
24
|
source
|
|
@@ -30,11 +37,12 @@ export const DateQuickInsertMenuItem = ({
|
|
|
30
37
|
return tr;
|
|
31
38
|
}, [api]);
|
|
32
39
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
40
|
+
description: formatMessage(messages.dateDescription),
|
|
33
41
|
iconBefore: /*#__PURE__*/React.createElement(CalendarIcon, {
|
|
34
42
|
label: ""
|
|
35
43
|
}),
|
|
36
44
|
onSelect: onSelect,
|
|
37
|
-
|
|
45
|
+
preview: preview,
|
|
38
46
|
shortcut: "//",
|
|
39
47
|
title: formatMessage(messages.date)
|
|
40
48
|
});
|
|
@@ -5,8 +5,8 @@ import { DATE_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 { DateQuickInsertMenuItem } from './DateQuickInsertMenuItem';
|
|
7
7
|
const previewImageUrls = {
|
|
8
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
9
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
8
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVNK.png',
|
|
9
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVJO.png'
|
|
10
10
|
};
|
|
11
11
|
export const getDateQuickInsertComponents = ({
|
|
12
12
|
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 CalendarIcon from '@atlaskit/icon/core/calendar';
|
|
7
8
|
import { createDateAtTransaction } from '../../pm-plugins/actions';
|
|
8
9
|
export var DateQuickInsertMenuItem = function DateQuickInsertMenuItem(_ref) {
|
|
@@ -10,6 +11,14 @@ export var DateQuickInsertMenuItem = function DateQuickInsertMenuItem(_ref) {
|
|
|
10
11
|
previewImageUrls = _ref.previewImageUrls;
|
|
11
12
|
var _useIntl = useIntl(),
|
|
12
13
|
formatMessage = _useIntl.formatMessage;
|
|
14
|
+
var preview = useMemo(function () {
|
|
15
|
+
return previewImageUrls ? {
|
|
16
|
+
image: previewImageUrls,
|
|
17
|
+
attribution: {
|
|
18
|
+
name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
|
|
19
|
+
}
|
|
20
|
+
} : undefined;
|
|
21
|
+
}, [formatMessage, previewImageUrls]);
|
|
13
22
|
var onSelect = useCallback(function (_ref2) {
|
|
14
23
|
var _api$analytics, _api$analytics$attach;
|
|
15
24
|
var insert = _ref2.insert,
|
|
@@ -27,11 +36,12 @@ export var DateQuickInsertMenuItem = function DateQuickInsertMenuItem(_ref) {
|
|
|
27
36
|
return tr;
|
|
28
37
|
}, [api]);
|
|
29
38
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
39
|
+
description: formatMessage(messages.dateDescription),
|
|
30
40
|
iconBefore: /*#__PURE__*/React.createElement(CalendarIcon, {
|
|
31
41
|
label: ""
|
|
32
42
|
}),
|
|
33
43
|
onSelect: onSelect,
|
|
34
|
-
|
|
44
|
+
preview: preview,
|
|
35
45
|
shortcut: "//",
|
|
36
46
|
title: formatMessage(messages.date)
|
|
37
47
|
});
|
|
@@ -5,8 +5,8 @@ import { DATE_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 { DateQuickInsertMenuItem } from './DateQuickInsertMenuItem';
|
|
7
7
|
var previewImageUrls = {
|
|
8
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
9
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
8
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVNK.png',
|
|
9
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVJO.png'
|
|
10
10
|
};
|
|
11
11
|
export var getDateQuickInsertComponents = function getDateQuickInsertComponents(_ref) {
|
|
12
12
|
var api = _ref.api;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-date",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.4",
|
|
4
4
|
"description": "Date plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
40
40
|
"@atlaskit/textfield": "^10.2.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^209.0.0",
|
|
42
42
|
"@atlaskit/tokens": "^20.0.0",
|
|
43
43
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"react-intl": "^7.0.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@atlaskit/editor-common": "^125.
|
|
57
|
+
"@atlaskit/editor-common": "^125.4.0",
|
|
58
58
|
"react": "^18.2.0 || ^19.2.0",
|
|
59
59
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
60
60
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|