@atlaskit/editor-plugin-list 1.1.2 → 1.2.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 +40 -0
- package/README.md +24 -3
- package/dist/cjs/actions/outdent-list-items-selected.js +2 -2
- package/dist/cjs/commands/indent-list.js +2 -2
- package/dist/cjs/commands/index.js +2 -2
- package/dist/cjs/commands/outdent-list.js +2 -2
- package/dist/cjs/plugin.js +22 -15
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/utils/analytics.js +2 -2
- package/dist/es2019/plugin.js +16 -8
- package/dist/esm/actions/outdent-list-items-selected.js +2 -2
- package/dist/esm/commands/indent-list.js +2 -2
- package/dist/esm/commands/index.js +2 -2
- package/dist/esm/commands/outdent-list.js +2 -2
- package/dist/esm/plugin.js +22 -15
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/utils/analytics.js +2 -2
- package/dist/types/plugin.d.ts +4 -0
- package/dist/types-ts4.5/plugin.d.ts +4 -0
- package/package.json +5 -5
- package/report.api.md +1 -1
- package/tmp/api-report-tmp.d.ts +78 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-list
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.1.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
|
|
18
|
+
signature of `NextEditorPlugin`.
|
|
19
|
+
|
|
20
|
+
Previously a `NextEditorPlugin` would be consumed as so:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
const plugin: NextEditorPlugin< ... > = (config, api) => {
|
|
24
|
+
// Can use api like so:
|
|
25
|
+
api.dependencies.core.actions.execute( ... )
|
|
26
|
+
return { ... }
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Now these have become named parameters like so and the `pluginInjectionAPI` is used
|
|
31
|
+
without the `dependencies` prop:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
|
|
35
|
+
// Can use api like so:
|
|
36
|
+
api.core.actions.execute( ... )
|
|
37
|
+
return { ... }
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
3
43
|
## 1.1.2
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Editor plugin list
|
|
2
2
|
|
|
3
3
|
List plugin for @atlaskit/editor-core
|
|
4
4
|
|
|
5
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
6
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
---
|
|
10
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-list*
|
|
11
|
+
- **npm** - [@atlaskit/editor-plugin-list](https://www.npmjs.com/package/@atlaskit/editor-plugin-list)
|
|
12
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-list)
|
|
13
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-list/dist/)
|
|
14
|
+
|
|
5
15
|
## Usage
|
|
16
|
+
---
|
|
17
|
+
**Internal use only**
|
|
18
|
+
|
|
19
|
+
@atlaskit/editor-plugin-list is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
20
|
+
|
|
21
|
+
Direct use of this component is not supported.
|
|
6
22
|
|
|
7
|
-
|
|
23
|
+
Please see [Atlaskit - Editor plugin list](https://atlaskit.atlassian.com/packages/editor/editor-plugin-list) for documentation and examples for this package.
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
## Support
|
|
26
|
+
---
|
|
27
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
|
+
## License
|
|
29
|
+
---
|
|
30
|
+
Please see [Atlassian Frontend - License](https://developer.atlassian.com/cloud/framework/atlassian-frontend/#license) for more licensing information.
|
|
@@ -16,8 +16,8 @@ var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
|
16
16
|
var _analytics2 = require("../utils/analytics");
|
|
17
17
|
var _find = require("../utils/find");
|
|
18
18
|
var _selection2 = require("../utils/selection");
|
|
19
|
-
function ownKeys(
|
|
20
|
-
function _objectSpread(
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
21
|
var outdentListItemsSelected = function outdentListItemsSelected(tr, featureFlags) {
|
|
22
22
|
var originalSelection = tr.selection;
|
|
23
23
|
var normalizedSelection = (0, _lists.normalizeListItemsSelection)({
|
|
@@ -15,8 +15,8 @@ var _indentListItemsSelected = require("../actions/indent-list-items-selected");
|
|
|
15
15
|
var _types = require("../types");
|
|
16
16
|
var _find = require("../utils/find");
|
|
17
17
|
var _selection = require("../utils/selection");
|
|
18
|
-
function ownKeys(
|
|
19
|
-
function _objectSpread(
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
20
|
var indentList = function indentList(editorAnalyticsAPI) {
|
|
21
21
|
return function () {
|
|
22
22
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
|
@@ -39,8 +39,8 @@ var _isFirstChildOfParent = require("./isFirstChildOfParent");
|
|
|
39
39
|
var _joinListItemForward = require("./join-list-item-forward");
|
|
40
40
|
var _listBackspace = require("./listBackspace");
|
|
41
41
|
var _outdentList = require("./outdent-list");
|
|
42
|
-
function ownKeys(
|
|
43
|
-
function _objectSpread(
|
|
42
|
+
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; }
|
|
43
|
+
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; }
|
|
44
44
|
var enterKeyCommand = function enterKeyCommand(editorAnalyticsAPI) {
|
|
45
45
|
return function (featureFlags) {
|
|
46
46
|
return function (state, dispatch) {
|
|
@@ -15,8 +15,8 @@ var _outdentListItemsSelected = require("../actions/outdent-list-items-selected"
|
|
|
15
15
|
var _analytics2 = require("../utils/analytics");
|
|
16
16
|
var _find = require("../utils/find");
|
|
17
17
|
var _selection = require("../utils/selection");
|
|
18
|
-
function ownKeys(
|
|
19
|
-
function _objectSpread(
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
20
|
var outdentList = function outdentList(editorAnalyticsAPI) {
|
|
21
21
|
return function () {
|
|
22
22
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -21,10 +21,17 @@ var _selection = require("./utils/selection");
|
|
|
21
21
|
Toolbar buttons to bullet and ordered list can be found in
|
|
22
22
|
packages/editor/editor-core/src/plugins/toolbar-lists-indentation/ui/Toolbar.tsx
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
27
|
+
* from `@atlaskit/editor-core`.
|
|
28
|
+
*/
|
|
29
|
+
var listPlugin = function listPlugin(_ref) {
|
|
30
|
+
var _api$analytics;
|
|
31
|
+
var options = _ref.config,
|
|
32
|
+
api = _ref.api;
|
|
33
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : api.featureFlags.sharedState.currentState()) || {};
|
|
34
|
+
var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
28
35
|
return {
|
|
29
36
|
name: 'list',
|
|
30
37
|
actions: {
|
|
@@ -60,29 +67,29 @@ var listPlugin = function listPlugin(options, api) {
|
|
|
60
67
|
pmPlugins: function pmPlugins() {
|
|
61
68
|
return [{
|
|
62
69
|
name: 'list',
|
|
63
|
-
plugin: function plugin(
|
|
64
|
-
var dispatch =
|
|
70
|
+
plugin: function plugin(_ref2) {
|
|
71
|
+
var dispatch = _ref2.dispatch;
|
|
65
72
|
return (0, _main.createPlugin)(dispatch, featureFlags);
|
|
66
73
|
}
|
|
67
74
|
}, {
|
|
68
75
|
name: 'listInputRule',
|
|
69
|
-
plugin: function plugin(
|
|
70
|
-
var _api$
|
|
71
|
-
var schema =
|
|
72
|
-
featureFlags =
|
|
73
|
-
return (0, _inputRules.default)(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
76
|
+
plugin: function plugin(_ref3) {
|
|
77
|
+
var _api$analytics2;
|
|
78
|
+
var schema = _ref3.schema,
|
|
79
|
+
featureFlags = _ref3.featureFlags;
|
|
80
|
+
return (0, _inputRules.default)(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
74
81
|
}
|
|
75
82
|
}, {
|
|
76
83
|
name: 'listKeymap',
|
|
77
84
|
plugin: function plugin() {
|
|
78
|
-
var _api$
|
|
79
|
-
return (0, _keymap.default)(featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
85
|
+
var _api$analytics3;
|
|
86
|
+
return (0, _keymap.default)(featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
80
87
|
}
|
|
81
88
|
}];
|
|
82
89
|
},
|
|
83
90
|
pluginsOptions: {
|
|
84
|
-
quickInsert: function quickInsert(
|
|
85
|
-
var formatMessage =
|
|
91
|
+
quickInsert: function quickInsert(_ref4) {
|
|
92
|
+
var formatMessage = _ref4.formatMessage;
|
|
86
93
|
return [{
|
|
87
94
|
id: 'unorderedList',
|
|
88
95
|
title: formatMessage(_messages.listMessages.unorderedList),
|
|
@@ -14,8 +14,8 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
14
14
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
15
15
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
16
16
|
var _selection2 = require("../utils/selection");
|
|
17
|
-
function ownKeys(
|
|
18
|
-
function _objectSpread(
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
19
|
var listPluginKey = new _state.PluginKey('listPlugin');
|
|
20
20
|
var pluginKey = listPluginKey;
|
|
21
21
|
exports.pluginKey = pluginKey;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.storeRestartListsAttributes = exports.getRestartListsAttributes = exports.RESTART_LISTS_ANALYTICS_KEY = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
function ownKeys(
|
|
10
|
-
function _objectSpread(
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
11
|
var RESTART_LISTS_ANALYTICS_KEY = 'restartListsAnalytics';
|
|
12
12
|
exports.RESTART_LISTS_ANALYTICS_KEY = RESTART_LISTS_ANALYTICS_KEY;
|
|
13
13
|
var getRestartListsAttributes = function getRestartListsAttributes(tr) {
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -15,10 +15,18 @@ import { isInsideListItem } from './utils/selection';
|
|
|
15
15
|
Toolbar buttons to bullet and ordered list can be found in
|
|
16
16
|
packages/editor/editor-core/src/plugins/toolbar-lists-indentation/ui/Toolbar.tsx
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* List plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
21
|
+
* from `@atlaskit/editor-core`.
|
|
22
|
+
*/
|
|
23
|
+
export const listPlugin = ({
|
|
24
|
+
config: options,
|
|
25
|
+
api
|
|
26
|
+
}) => {
|
|
27
|
+
var _api$analytics;
|
|
28
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : api.featureFlags.sharedState.currentState()) || {};
|
|
29
|
+
const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
22
30
|
return {
|
|
23
31
|
name: 'list',
|
|
24
32
|
actions: {
|
|
@@ -61,14 +69,14 @@ export const listPlugin = (options, api) => {
|
|
|
61
69
|
schema,
|
|
62
70
|
featureFlags
|
|
63
71
|
}) => {
|
|
64
|
-
var _api$
|
|
65
|
-
return inputRulePlugin(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
72
|
+
var _api$analytics2;
|
|
73
|
+
return inputRulePlugin(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
66
74
|
}
|
|
67
75
|
}, {
|
|
68
76
|
name: 'listKeymap',
|
|
69
77
|
plugin: () => {
|
|
70
|
-
var _api$
|
|
71
|
-
return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
78
|
+
var _api$analytics3;
|
|
79
|
+
return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
72
80
|
}
|
|
73
81
|
}];
|
|
74
82
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
4
|
import { OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { JoinDirection, joinSiblingLists, normalizeListItemsSelection } from '@atlaskit/editor-common/lists';
|
|
6
6
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getCommonListAnalyticsAttributes, getListItemAttributes, hasValidListIndentationLevel } from '@atlaskit/editor-common/lists';
|
|
6
6
|
import { PassiveTransaction } from '@atlaskit/editor-common/preset';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { findCutBefore } from '@atlaskit/editor-common/commands';
|
|
6
6
|
import { getCommonListAnalyticsAttributes, moveTargetIntoList } from '@atlaskit/editor-common/lists';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists';
|
|
6
6
|
import { PassiveTransaction } from '@atlaskit/editor-common/preset';
|
package/dist/esm/plugin.js
CHANGED
|
@@ -15,10 +15,17 @@ import { isInsideListItem } from './utils/selection';
|
|
|
15
15
|
Toolbar buttons to bullet and ordered list can be found in
|
|
16
16
|
packages/editor/editor-core/src/plugins/toolbar-lists-indentation/ui/Toolbar.tsx
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* List plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
21
|
+
* from `@atlaskit/editor-core`.
|
|
22
|
+
*/
|
|
23
|
+
export var listPlugin = function listPlugin(_ref) {
|
|
24
|
+
var _api$analytics;
|
|
25
|
+
var options = _ref.config,
|
|
26
|
+
api = _ref.api;
|
|
27
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : api.featureFlags.sharedState.currentState()) || {};
|
|
28
|
+
var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
22
29
|
return {
|
|
23
30
|
name: 'list',
|
|
24
31
|
actions: {
|
|
@@ -54,29 +61,29 @@ export var listPlugin = function listPlugin(options, api) {
|
|
|
54
61
|
pmPlugins: function pmPlugins() {
|
|
55
62
|
return [{
|
|
56
63
|
name: 'list',
|
|
57
|
-
plugin: function plugin(
|
|
58
|
-
var dispatch =
|
|
64
|
+
plugin: function plugin(_ref2) {
|
|
65
|
+
var dispatch = _ref2.dispatch;
|
|
59
66
|
return createPlugin(dispatch, featureFlags);
|
|
60
67
|
}
|
|
61
68
|
}, {
|
|
62
69
|
name: 'listInputRule',
|
|
63
|
-
plugin: function plugin(
|
|
64
|
-
var _api$
|
|
65
|
-
var schema =
|
|
66
|
-
featureFlags =
|
|
67
|
-
return inputRulePlugin(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
70
|
+
plugin: function plugin(_ref3) {
|
|
71
|
+
var _api$analytics2;
|
|
72
|
+
var schema = _ref3.schema,
|
|
73
|
+
featureFlags = _ref3.featureFlags;
|
|
74
|
+
return inputRulePlugin(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
68
75
|
}
|
|
69
76
|
}, {
|
|
70
77
|
name: 'listKeymap',
|
|
71
78
|
plugin: function plugin() {
|
|
72
|
-
var _api$
|
|
73
|
-
return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
79
|
+
var _api$analytics3;
|
|
80
|
+
return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
74
81
|
}
|
|
75
82
|
}];
|
|
76
83
|
},
|
|
77
84
|
pluginsOptions: {
|
|
78
|
-
quickInsert: function quickInsert(
|
|
79
|
-
var formatMessage =
|
|
85
|
+
quickInsert: function quickInsert(_ref4) {
|
|
86
|
+
var formatMessage = _ref4.formatMessage;
|
|
80
87
|
return [{
|
|
81
88
|
id: 'unorderedList',
|
|
82
89
|
title: formatMessage(messages.unorderedList),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { setGapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
6
6
|
import { CodeBlockSharedCssClassName, getOrderedListInlineStyles, listItemCounterPadding } from '@atlaskit/editor-common/styles';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
4
|
export var RESTART_LISTS_ANALYTICS_KEY = 'restartListsAnalytics';
|
|
5
5
|
export var getRestartListsAttributes = function getRestartListsAttributes(tr) {
|
|
6
6
|
var _tr$getMeta;
|
package/dist/types/plugin.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-list",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
|
-
"team": "Editor",
|
|
11
|
+
"team": "Editor: AI",
|
|
12
12
|
"releaseModel": "continuous",
|
|
13
13
|
"singleton": true
|
|
14
14
|
},
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "28.1.2",
|
|
35
|
-
"@atlaskit/editor-common": "^74.
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
37
|
-
"@atlaskit/editor-plugin-feature-flags": "^0.
|
|
35
|
+
"@atlaskit/editor-common": "^74.55.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
37
|
+
"@atlaskit/editor-plugin-feature-flags": "^0.2.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
39
|
"@atlaskit/prosemirror-input-rules": "^2.4.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0"
|
package/report.api.md
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-list"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
|
+
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
11
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
12
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
14
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
15
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
16
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
20
|
+
|
|
21
|
+
// @public (undocumented)
|
|
22
|
+
type IndentList = (inputMethod: InputMethod) => EditorCommand;
|
|
23
|
+
|
|
24
|
+
// @public (undocumented)
|
|
25
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
26
|
+
|
|
27
|
+
// @public (undocumented)
|
|
28
|
+
type IsInsideListItem = (tr: Transaction) => boolean;
|
|
29
|
+
|
|
30
|
+
// @public (undocumented)
|
|
31
|
+
export type ListPlugin = NextEditorPlugin<'list', {
|
|
32
|
+
pluginConfiguration: ListPluginOptions | undefined;
|
|
33
|
+
dependencies: [FeatureFlagsPlugin, OptionalPlugin<AnalyticsPlugin>];
|
|
34
|
+
actions: {
|
|
35
|
+
isInsideListItem: IsInsideListItem;
|
|
36
|
+
findRootParentListNode: FindRootParentListNode;
|
|
37
|
+
};
|
|
38
|
+
commands: {
|
|
39
|
+
indentList: IndentList;
|
|
40
|
+
outdentList: OutdentList;
|
|
41
|
+
toggleOrderedList: ToggleOrderedList;
|
|
42
|
+
toggleBulletList: ToggleBulletList;
|
|
43
|
+
};
|
|
44
|
+
sharedState: ListState | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
// @public
|
|
48
|
+
export const listPlugin: ListPlugin;
|
|
49
|
+
|
|
50
|
+
// @public (undocumented)
|
|
51
|
+
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
52
|
+
|
|
53
|
+
// @public (undocumented)
|
|
54
|
+
export interface ListState {
|
|
55
|
+
// (undocumented)
|
|
56
|
+
bulletListActive: boolean;
|
|
57
|
+
// (undocumented)
|
|
58
|
+
bulletListDisabled: boolean;
|
|
59
|
+
// (undocumented)
|
|
60
|
+
decorationSet: DecorationSet;
|
|
61
|
+
// (undocumented)
|
|
62
|
+
orderedListActive: boolean;
|
|
63
|
+
// (undocumented)
|
|
64
|
+
orderedListDisabled: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// @public (undocumented)
|
|
68
|
+
type OutdentList = (inputMethod: InputMethod) => EditorCommand;
|
|
69
|
+
|
|
70
|
+
// @public (undocumented)
|
|
71
|
+
type ToggleBulletList = (inputMethod: InputMethod) => EditorCommand;
|
|
72
|
+
|
|
73
|
+
// @public (undocumented)
|
|
74
|
+
type ToggleOrderedList = (inputMethod: InputMethod) => EditorCommand;
|
|
75
|
+
|
|
76
|
+
// (No @packageDocumentation comment for this package)
|
|
77
|
+
|
|
78
|
+
```
|