@atlaskit/editor-plugin-list 1.1.2 → 1.1.3
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 +30 -0
- package/dist/cjs/plugin.js +17 -15
- package/dist/es2019/plugin.js +11 -8
- package/dist/esm/plugin.js +17 -15
- package/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +78 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-list
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
|
|
8
|
+
signature of `NextEditorPlugin`.
|
|
9
|
+
|
|
10
|
+
Previously a `NextEditorPlugin` would be consumed as so:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
const plugin: NextEditorPlugin< ... > = (config, api) => {
|
|
14
|
+
// Can use api like so:
|
|
15
|
+
api.dependencies.core.actions.execute( ... )
|
|
16
|
+
return { ... }
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Now these have become named parameters like so and the `pluginInjectionAPI` is used
|
|
21
|
+
without the `dependencies` prop:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
|
|
25
|
+
// Can use api like so:
|
|
26
|
+
api.core.actions.execute( ... )
|
|
27
|
+
return { ... }
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 1.1.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -21,10 +21,12 @@ 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
|
-
var listPlugin = function listPlugin(
|
|
25
|
-
var _api$
|
|
26
|
-
var
|
|
27
|
-
|
|
24
|
+
var listPlugin = function listPlugin(_ref) {
|
|
25
|
+
var _api$analytics;
|
|
26
|
+
var options = _ref.config,
|
|
27
|
+
api = _ref.api;
|
|
28
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : api.featureFlags.sharedState.currentState()) || {};
|
|
29
|
+
var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
28
30
|
return {
|
|
29
31
|
name: 'list',
|
|
30
32
|
actions: {
|
|
@@ -60,29 +62,29 @@ var listPlugin = function listPlugin(options, api) {
|
|
|
60
62
|
pmPlugins: function pmPlugins() {
|
|
61
63
|
return [{
|
|
62
64
|
name: 'list',
|
|
63
|
-
plugin: function plugin(
|
|
64
|
-
var dispatch =
|
|
65
|
+
plugin: function plugin(_ref2) {
|
|
66
|
+
var dispatch = _ref2.dispatch;
|
|
65
67
|
return (0, _main.createPlugin)(dispatch, featureFlags);
|
|
66
68
|
}
|
|
67
69
|
}, {
|
|
68
70
|
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$
|
|
71
|
+
plugin: function plugin(_ref3) {
|
|
72
|
+
var _api$analytics2;
|
|
73
|
+
var schema = _ref3.schema,
|
|
74
|
+
featureFlags = _ref3.featureFlags;
|
|
75
|
+
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
76
|
}
|
|
75
77
|
}, {
|
|
76
78
|
name: 'listKeymap',
|
|
77
79
|
plugin: function plugin() {
|
|
78
|
-
var _api$
|
|
79
|
-
return (0, _keymap.default)(featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
80
|
+
var _api$analytics3;
|
|
81
|
+
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
82
|
}
|
|
81
83
|
}];
|
|
82
84
|
},
|
|
83
85
|
pluginsOptions: {
|
|
84
|
-
quickInsert: function quickInsert(
|
|
85
|
-
var formatMessage =
|
|
86
|
+
quickInsert: function quickInsert(_ref4) {
|
|
87
|
+
var formatMessage = _ref4.formatMessage;
|
|
86
88
|
return [{
|
|
87
89
|
id: 'unorderedList',
|
|
88
90
|
title: formatMessage(_messages.listMessages.unorderedList),
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -15,10 +15,13 @@ 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
|
-
export const listPlugin = (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
export const listPlugin = ({
|
|
19
|
+
config: options,
|
|
20
|
+
api
|
|
21
|
+
}) => {
|
|
22
|
+
var _api$analytics;
|
|
23
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : api.featureFlags.sharedState.currentState()) || {};
|
|
24
|
+
const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
22
25
|
return {
|
|
23
26
|
name: 'list',
|
|
24
27
|
actions: {
|
|
@@ -61,14 +64,14 @@ export const listPlugin = (options, api) => {
|
|
|
61
64
|
schema,
|
|
62
65
|
featureFlags
|
|
63
66
|
}) => {
|
|
64
|
-
var _api$
|
|
65
|
-
return inputRulePlugin(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
67
|
+
var _api$analytics2;
|
|
68
|
+
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
69
|
}
|
|
67
70
|
}, {
|
|
68
71
|
name: 'listKeymap',
|
|
69
72
|
plugin: () => {
|
|
70
|
-
var _api$
|
|
71
|
-
return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
73
|
+
var _api$analytics3;
|
|
74
|
+
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
75
|
}
|
|
73
76
|
}];
|
|
74
77
|
},
|
package/dist/esm/plugin.js
CHANGED
|
@@ -15,10 +15,12 @@ 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
|
-
export var listPlugin = function listPlugin(
|
|
19
|
-
var _api$
|
|
20
|
-
var
|
|
21
|
-
|
|
18
|
+
export var listPlugin = function listPlugin(_ref) {
|
|
19
|
+
var _api$analytics;
|
|
20
|
+
var options = _ref.config,
|
|
21
|
+
api = _ref.api;
|
|
22
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : api.featureFlags.sharedState.currentState()) || {};
|
|
23
|
+
var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
22
24
|
return {
|
|
23
25
|
name: 'list',
|
|
24
26
|
actions: {
|
|
@@ -54,29 +56,29 @@ export var listPlugin = function listPlugin(options, api) {
|
|
|
54
56
|
pmPlugins: function pmPlugins() {
|
|
55
57
|
return [{
|
|
56
58
|
name: 'list',
|
|
57
|
-
plugin: function plugin(
|
|
58
|
-
var dispatch =
|
|
59
|
+
plugin: function plugin(_ref2) {
|
|
60
|
+
var dispatch = _ref2.dispatch;
|
|
59
61
|
return createPlugin(dispatch, featureFlags);
|
|
60
62
|
}
|
|
61
63
|
}, {
|
|
62
64
|
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$
|
|
65
|
+
plugin: function plugin(_ref3) {
|
|
66
|
+
var _api$analytics2;
|
|
67
|
+
var schema = _ref3.schema,
|
|
68
|
+
featureFlags = _ref3.featureFlags;
|
|
69
|
+
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
70
|
}
|
|
69
71
|
}, {
|
|
70
72
|
name: 'listKeymap',
|
|
71
73
|
plugin: function plugin() {
|
|
72
|
-
var _api$
|
|
73
|
-
return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
74
|
+
var _api$analytics3;
|
|
75
|
+
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
76
|
}
|
|
75
77
|
}];
|
|
76
78
|
},
|
|
77
79
|
pluginsOptions: {
|
|
78
|
-
quickInsert: function quickInsert(
|
|
79
|
-
var formatMessage =
|
|
80
|
+
quickInsert: function quickInsert(_ref4) {
|
|
81
|
+
var formatMessage = _ref4.formatMessage;
|
|
80
82
|
return [{
|
|
81
83
|
id: 'unorderedList',
|
|
82
84
|
title: formatMessage(messages.unorderedList),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-list",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "28.1.2",
|
|
35
|
-
"@atlaskit/editor-common": "^74.
|
|
35
|
+
"@atlaskit/editor-common": "^74.53.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
@@ -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 (undocumented)
|
|
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
|
+
```
|