@atlaskit/editor-plugin-rule 18.1.0 → 18.1.2
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 +15 -0
- package/dist/cjs/ui/DividerOptions.js +1 -1
- package/dist/cjs/ui/quick-insert/RuleQuickInsertMenuItem.js +3 -1
- package/dist/cjs/ui/quick-insert/getRuleQuickInsertComponents.js +6 -1
- package/dist/es2019/ui/DividerOptions.js +1 -1
- package/dist/es2019/ui/quick-insert/RuleQuickInsertMenuItem.js +3 -1
- package/dist/es2019/ui/quick-insert/getRuleQuickInsertComponents.js +6 -1
- package/dist/esm/ui/DividerOptions.js +1 -1
- package/dist/esm/ui/quick-insert/RuleQuickInsertMenuItem.js +3 -1
- package/dist/esm/ui/quick-insert/getRuleQuickInsertComponents.js +6 -1
- package/dist/types/ui/quick-insert/RuleQuickInsertMenuItem.d.ts +3 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-rule
|
|
2
2
|
|
|
3
|
+
## 18.1.2
|
|
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
|
+
|
|
12
|
+
## 18.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 18.1.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -14,7 +14,8 @@ var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
|
14
14
|
var _minus = _interopRequireDefault(require("@atlaskit/icon/core/minus"));
|
|
15
15
|
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
16
|
var RuleQuickInsertMenuItem = exports.RuleQuickInsertMenuItem = function RuleQuickInsertMenuItem(_ref) {
|
|
17
|
-
var api = _ref.api
|
|
17
|
+
var api = _ref.api,
|
|
18
|
+
previewImageUrls = _ref.previewImageUrls;
|
|
18
19
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
19
20
|
formatMessage = _useIntl.formatMessage;
|
|
20
21
|
var onSelect = (0, _react.useCallback)(function (_ref2) {
|
|
@@ -39,6 +40,7 @@ var RuleQuickInsertMenuItem = exports.RuleQuickInsertMenuItem = function RuleQui
|
|
|
39
40
|
label: ""
|
|
40
41
|
}),
|
|
41
42
|
onSelect: onSelect,
|
|
43
|
+
previewImageUrls: previewImageUrls,
|
|
42
44
|
shortcut: "---",
|
|
43
45
|
title: formatMessage(_messages.toolbarInsertBlockMessages.horizontalRule)
|
|
44
46
|
});
|
|
@@ -11,6 +11,10 @@ var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/cr
|
|
|
11
11
|
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
|
+
var previewImageUrls = {
|
|
15
|
+
light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/p53x1j2j1855123gdr8fw4jri2f6mn1h.png',
|
|
16
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/i2o73i23qw321aj6i5r14wtvfsyqg784.png'
|
|
17
|
+
};
|
|
14
18
|
var getRuleQuickInsertComponents = exports.getRuleQuickInsertComponents = function getRuleQuickInsertComponents(_ref) {
|
|
15
19
|
var api = _ref.api;
|
|
16
20
|
return [{
|
|
@@ -32,7 +36,8 @@ var getRuleQuickInsertComponents = exports.getRuleQuickInsertComponents = functi
|
|
|
32
36
|
}),
|
|
33
37
|
component: function component() {
|
|
34
38
|
return /*#__PURE__*/_react.default.createElement(_RuleQuickInsertMenuItem.RuleQuickInsertMenuItem, {
|
|
35
|
-
api: api
|
|
39
|
+
api: api,
|
|
40
|
+
previewImageUrls: previewImageUrls
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
43
|
}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* DividerOptions.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* DividerOptions.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./DividerOptions.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
@@ -5,7 +5,8 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
|
|
|
5
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
6
6
|
import MinusIcon from '@atlaskit/icon/core/minus';
|
|
7
7
|
export const RuleQuickInsertMenuItem = ({
|
|
8
|
-
api
|
|
8
|
+
api,
|
|
9
|
+
previewImageUrls
|
|
9
10
|
}) => {
|
|
10
11
|
const {
|
|
11
12
|
formatMessage
|
|
@@ -33,6 +34,7 @@ export const RuleQuickInsertMenuItem = ({
|
|
|
33
34
|
label: ""
|
|
34
35
|
}),
|
|
35
36
|
onSelect: onSelect,
|
|
37
|
+
previewImageUrls: previewImageUrls,
|
|
36
38
|
shortcut: "---",
|
|
37
39
|
title: formatMessage(messages.horizontalRule)
|
|
38
40
|
});
|
|
@@ -4,6 +4,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
|
|
|
4
4
|
import { RULE_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 { RuleQuickInsertMenuItem } from './RuleQuickInsertMenuItem';
|
|
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'
|
|
10
|
+
};
|
|
7
11
|
export const getRuleQuickInsertComponents = ({
|
|
8
12
|
api
|
|
9
13
|
}) => [{
|
|
@@ -23,6 +27,7 @@ export const getRuleQuickInsertComponents = ({
|
|
|
23
27
|
title: formatMessage(messages.horizontalRule)
|
|
24
28
|
})),
|
|
25
29
|
component: () => /*#__PURE__*/React.createElement(RuleQuickInsertMenuItem, {
|
|
26
|
-
api: api
|
|
30
|
+
api: api,
|
|
31
|
+
previewImageUrls: previewImageUrls
|
|
27
32
|
})
|
|
28
33
|
}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* DividerOptions.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* DividerOptions.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./DividerOptions.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
@@ -5,7 +5,8 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
|
|
|
5
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
6
6
|
import MinusIcon from '@atlaskit/icon/core/minus';
|
|
7
7
|
export var RuleQuickInsertMenuItem = function RuleQuickInsertMenuItem(_ref) {
|
|
8
|
-
var api = _ref.api
|
|
8
|
+
var api = _ref.api,
|
|
9
|
+
previewImageUrls = _ref.previewImageUrls;
|
|
9
10
|
var _useIntl = useIntl(),
|
|
10
11
|
formatMessage = _useIntl.formatMessage;
|
|
11
12
|
var onSelect = useCallback(function (_ref2) {
|
|
@@ -30,6 +31,7 @@ export var RuleQuickInsertMenuItem = function RuleQuickInsertMenuItem(_ref) {
|
|
|
30
31
|
label: ""
|
|
31
32
|
}),
|
|
32
33
|
onSelect: onSelect,
|
|
34
|
+
previewImageUrls: previewImageUrls,
|
|
33
35
|
shortcut: "---",
|
|
34
36
|
title: formatMessage(messages.horizontalRule)
|
|
35
37
|
});
|
|
@@ -4,6 +4,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
|
|
|
4
4
|
import { RULE_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 { RuleQuickInsertMenuItem } from './RuleQuickInsertMenuItem';
|
|
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'
|
|
10
|
+
};
|
|
7
11
|
export var getRuleQuickInsertComponents = function getRuleQuickInsertComponents(_ref) {
|
|
8
12
|
var api = _ref.api;
|
|
9
13
|
return [{
|
|
@@ -25,7 +29,8 @@ export var getRuleQuickInsertComponents = function getRuleQuickInsertComponents(
|
|
|
25
29
|
}),
|
|
26
30
|
component: function component() {
|
|
27
31
|
return /*#__PURE__*/React.createElement(RuleQuickInsertMenuItem, {
|
|
28
|
-
api: api
|
|
32
|
+
api: api,
|
|
33
|
+
previewImageUrls: previewImageUrls
|
|
29
34
|
});
|
|
30
35
|
}
|
|
31
36
|
}];
|
|
@@ -1,6 +1,8 @@
|
|
|
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 { RulePlugin } from '../../rulePluginType';
|
|
4
|
-
export declare const RuleQuickInsertMenuItem: ({ api, }: {
|
|
5
|
+
export declare const RuleQuickInsertMenuItem: ({ api, previewImageUrls, }: {
|
|
5
6
|
api: ExtractInjectionAPI<RulePlugin> | undefined;
|
|
7
|
+
previewImageUrls?: QuickInsertMenuItemProps['previewImageUrls'];
|
|
6
8
|
}) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-rule",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.2",
|
|
4
4
|
"description": "Rule plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,26 +19,26 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"atlaskit:src": "src/index.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@atlaskit/adf-schema": "^57.
|
|
22
|
+
"@atlaskit/adf-schema": "^57.5.0",
|
|
23
23
|
"@atlaskit/button": "^25.3.0",
|
|
24
24
|
"@atlaskit/css": "^1.1.0",
|
|
25
25
|
"@atlaskit/editor-plugin-analytics": "^18.0.0",
|
|
26
26
|
"@atlaskit/editor-plugin-floating-toolbar": "^20.0.0",
|
|
27
27
|
"@atlaskit/editor-plugin-ui-control-registry": "^12.0.0",
|
|
28
28
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
29
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
30
|
-
"@atlaskit/icon": "^37.
|
|
29
|
+
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
30
|
+
"@atlaskit/icon": "^37.7.0",
|
|
31
31
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
33
33
|
"@atlaskit/primitives": "^22.5.0",
|
|
34
34
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
35
|
-
"@atlaskit/tokens": "^
|
|
35
|
+
"@atlaskit/tokens": "^18.0.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"@compiled/react": "^1.0.2",
|
|
38
38
|
"react-intl": "^7.0.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@atlaskit/editor-common": "^122.
|
|
41
|
+
"@atlaskit/editor-common": "^122.11.0",
|
|
42
42
|
"react": "^18.2.0 || ^19.2.0",
|
|
43
43
|
"react-dom": "^18.2.0 || ^19.2.0"
|
|
44
44
|
},
|