@atlaskit/editor-plugin-list 4.0.0 → 4.1.1
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 +26 -0
- package/dist/cjs/listPlugin.js +7 -5
- package/dist/es2019/listPlugin.js +49 -44
- package/dist/esm/listPlugin.js +8 -4
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-list
|
|
2
2
|
|
|
3
|
+
## 4.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 4.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#120472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120472)
|
|
14
|
+
[`4758d7dd443dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4758d7dd443dd) -
|
|
15
|
+
[ux] ED-26766 update adf-schema from 47.2.1 to 47.6.0 and adf-schema-json from 1.27.0 to 1.31.0
|
|
16
|
+
and feature gated the usage of new prosemirror nodes in blockTypePlugin, expandPlugin, listPlugin
|
|
17
|
+
and panelPlugin as the new defaults of these nodes support nesting of extensions
|
|
18
|
+
- [#120472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120472)
|
|
19
|
+
[`73c800ab5f2fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73c800ab5f2fc) -
|
|
20
|
+
ED-26766 update adf-schema from 47.2.1 to 47.6.0 and adf-schema-json from 1.27.0 to 1.31.0
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [#120007](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120007)
|
|
25
|
+
[`e87df0a8c73c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e87df0a8c73c6) -
|
|
26
|
+
[ux] Do not add headings, lists, layouts, panels in the new QuickInsert menu
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
3
29
|
## 4.0.0
|
|
4
30
|
|
|
5
31
|
### Major Changes
|
package/dist/cjs/listPlugin.js
CHANGED
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.listPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
12
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
14
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
15
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
16
|
var _commands = require("./pm-plugins/commands");
|
|
15
17
|
var _indentList = require("./pm-plugins/commands/indent-list");
|
|
16
18
|
var _outdentList2 = require("./pm-plugins/commands/outdent-list");
|
|
@@ -19,9 +21,9 @@ var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
|
19
21
|
var _main = require("./pm-plugins/main");
|
|
20
22
|
var _find = require("./pm-plugins/utils/find");
|
|
21
23
|
var _selection = require("./pm-plugins/utils/selection");
|
|
22
|
-
|
|
24
|
+
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; }
|
|
25
|
+
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; } // Ignored via go/ees005
|
|
23
26
|
// eslint-disable-next-line import/no-named-as-default
|
|
24
|
-
|
|
25
27
|
/*
|
|
26
28
|
Toolbar buttons to bullet and ordered list can be found in
|
|
27
29
|
packages/editor/editor-core/src/plugins/toolbar-lists-indentation/ui/Toolbar.tsx
|
|
@@ -58,7 +60,7 @@ var listPlugin = exports.listPlugin = function listPlugin(_ref) {
|
|
|
58
60
|
return _main.pluginKey.getState(editorState);
|
|
59
61
|
},
|
|
60
62
|
nodes: function nodes() {
|
|
61
|
-
var listItemNode = _adfSchema.
|
|
63
|
+
var listItemNode = (0, _experiments.editorExperiment)('platform_editor_nested_non_bodied_macros', 'test') ? _adfSchema.listItem : _adfSchema.listItemWithoutNonBodiedMacros;
|
|
62
64
|
return [{
|
|
63
65
|
name: 'bulletList',
|
|
64
66
|
node: _adfSchema.bulletList
|
|
@@ -93,7 +95,7 @@ var listPlugin = exports.listPlugin = function listPlugin(_ref) {
|
|
|
93
95
|
}
|
|
94
96
|
}];
|
|
95
97
|
},
|
|
96
|
-
pluginsOptions: {
|
|
98
|
+
pluginsOptions: _objectSpread({}, (0, _experiments.editorExperiment)('platform_editor_insertion', 'control') && {
|
|
97
99
|
quickInsert: function quickInsert(_ref4) {
|
|
98
100
|
var formatMessage = _ref4.formatMessage;
|
|
99
101
|
return [{
|
|
@@ -144,6 +146,6 @@ var listPlugin = exports.listPlugin = function listPlugin(_ref) {
|
|
|
144
146
|
}
|
|
145
147
|
}];
|
|
146
148
|
}
|
|
147
|
-
}
|
|
149
|
+
})
|
|
148
150
|
};
|
|
149
151
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { bulletList,
|
|
2
|
+
import { bulletList, listItem, orderedListWithOrder, listItemWithoutNonBodiedMacros } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { toggleBulletList, toggleOrderedList, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { listMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconList, IconListNumber } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './pm-plugins/commands';
|
|
8
9
|
import { indentList } from './pm-plugins/commands/indent-list';
|
|
9
10
|
import { outdentList } from './pm-plugins/commands/outdent-list';
|
|
@@ -50,7 +51,7 @@ export const listPlugin = ({
|
|
|
50
51
|
return listPluginKey.getState(editorState);
|
|
51
52
|
},
|
|
52
53
|
nodes() {
|
|
53
|
-
const listItemNode =
|
|
54
|
+
const listItemNode = editorExperiment('platform_editor_nested_non_bodied_macros', 'test') ? listItem : listItemWithoutNonBodiedMacros;
|
|
54
55
|
return [{
|
|
55
56
|
name: 'bulletList',
|
|
56
57
|
node: bulletList
|
|
@@ -86,51 +87,55 @@ export const listPlugin = ({
|
|
|
86
87
|
}];
|
|
87
88
|
},
|
|
88
89
|
pluginsOptions: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
90
|
+
...(editorExperiment('platform_editor_insertion', 'control') && {
|
|
91
|
+
quickInsert: ({
|
|
92
|
+
formatMessage
|
|
93
|
+
}) => {
|
|
94
|
+
return [{
|
|
95
|
+
id: 'unorderedList',
|
|
96
|
+
title: formatMessage(messages.unorderedList),
|
|
97
|
+
description: formatMessage(messages.unorderedListDescription),
|
|
98
|
+
keywords: ['ul', 'unordered'],
|
|
99
|
+
priority: 1100,
|
|
100
|
+
keyshortcut: tooltip(toggleBulletList),
|
|
101
|
+
icon: () => /*#__PURE__*/React.createElement(IconList, null),
|
|
102
|
+
action(insert, state) {
|
|
103
|
+
const tr = insert(state.schema.nodes.bulletList.createChecked({}, state.schema.nodes.listItem.createChecked({}, state.schema.nodes.paragraph.createChecked())));
|
|
104
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
105
|
+
action: ACTION.INSERTED,
|
|
106
|
+
actionSubject: ACTION_SUBJECT.LIST,
|
|
107
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_LIST_BULLET,
|
|
108
|
+
eventType: EVENT_TYPE.TRACK,
|
|
109
|
+
attributes: {
|
|
110
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
111
|
+
}
|
|
112
|
+
})(tr);
|
|
113
|
+
return tr;
|
|
108
114
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
115
|
+
}, {
|
|
116
|
+
id: 'orderedList',
|
|
117
|
+
title: formatMessage(messages.orderedList),
|
|
118
|
+
description: formatMessage(messages.orderedListDescription),
|
|
119
|
+
keywords: ['ol', 'ordered'],
|
|
120
|
+
priority: 1200,
|
|
121
|
+
keyshortcut: tooltip(toggleOrderedList),
|
|
122
|
+
icon: () => /*#__PURE__*/React.createElement(IconListNumber, null),
|
|
123
|
+
action(insert, state) {
|
|
124
|
+
const tr = insert(state.schema.nodes.orderedList.createChecked({}, state.schema.nodes.listItem.createChecked({}, state.schema.nodes.paragraph.createChecked())));
|
|
125
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
126
|
+
action: ACTION.INSERTED,
|
|
127
|
+
actionSubject: ACTION_SUBJECT.LIST,
|
|
128
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER,
|
|
129
|
+
eventType: EVENT_TYPE.TRACK,
|
|
130
|
+
attributes: {
|
|
131
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
132
|
+
}
|
|
133
|
+
})(tr);
|
|
134
|
+
return tr;
|
|
129
135
|
}
|
|
130
|
-
}
|
|
131
|
-
return tr;
|
|
136
|
+
}];
|
|
132
137
|
}
|
|
133
|
-
}
|
|
138
|
+
})
|
|
134
139
|
}
|
|
135
140
|
};
|
|
136
141
|
};
|
package/dist/esm/listPlugin.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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; }
|
|
1
4
|
import React from 'react';
|
|
2
|
-
import { bulletList,
|
|
5
|
+
import { bulletList, listItem, orderedListWithOrder, listItemWithoutNonBodiedMacros } from '@atlaskit/adf-schema';
|
|
3
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
7
|
import { toggleBulletList, toggleOrderedList, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
8
|
import { listMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
9
|
import { IconList, IconListNumber } from '@atlaskit/editor-common/quick-insert';
|
|
10
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
11
|
import { toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './pm-plugins/commands';
|
|
8
12
|
import { indentList } from './pm-plugins/commands/indent-list';
|
|
9
13
|
import { outdentList as _outdentList } from './pm-plugins/commands/outdent-list';
|
|
@@ -51,7 +55,7 @@ export var listPlugin = function listPlugin(_ref) {
|
|
|
51
55
|
return listPluginKey.getState(editorState);
|
|
52
56
|
},
|
|
53
57
|
nodes: function nodes() {
|
|
54
|
-
var listItemNode =
|
|
58
|
+
var listItemNode = editorExperiment('platform_editor_nested_non_bodied_macros', 'test') ? listItem : listItemWithoutNonBodiedMacros;
|
|
55
59
|
return [{
|
|
56
60
|
name: 'bulletList',
|
|
57
61
|
node: bulletList
|
|
@@ -86,7 +90,7 @@ export var listPlugin = function listPlugin(_ref) {
|
|
|
86
90
|
}
|
|
87
91
|
}];
|
|
88
92
|
},
|
|
89
|
-
pluginsOptions: {
|
|
93
|
+
pluginsOptions: _objectSpread({}, editorExperiment('platform_editor_insertion', 'control') && {
|
|
90
94
|
quickInsert: function quickInsert(_ref4) {
|
|
91
95
|
var formatMessage = _ref4.formatMessage;
|
|
92
96
|
return [{
|
|
@@ -137,6 +141,6 @@ export var listPlugin = function listPlugin(_ref) {
|
|
|
137
141
|
}
|
|
138
142
|
}];
|
|
139
143
|
}
|
|
140
|
-
}
|
|
144
|
+
})
|
|
141
145
|
};
|
|
142
146
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-list",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,12 +31,13 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^47.
|
|
35
|
-
"@atlaskit/editor-common": "^
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^2.
|
|
34
|
+
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
|
+
"@atlaskit/editor-common": "^101.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^1.3.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
39
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^3.4.0",
|
|
40
41
|
"@babel/runtime": "^7.0.0"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|