@atlaskit/editor-plugin-list 9.0.22 → 9.0.23
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 +8 -0
- package/dist/cjs/listPlugin.js +12 -5
- package/dist/es2019/listPlugin.js +12 -5
- package/dist/esm/listPlugin.js +13 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-list
|
|
2
2
|
|
|
3
|
+
## 9.0.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`19274be1b1972`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/19274be1b1972) -
|
|
8
|
+
[ux] EDITOR-5417 Flexible list indentation ADF schema + validator support
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 9.0.22
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/cjs/listPlugin.js
CHANGED
|
@@ -12,6 +12,7 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
16
17
|
var _commands = require("./pm-plugins/commands");
|
|
17
18
|
var _indentList = require("./pm-plugins/commands/indent-list");
|
|
@@ -36,8 +37,7 @@ var _ui = require("./ui");
|
|
|
36
37
|
*/
|
|
37
38
|
var listPlugin = exports.listPlugin = function listPlugin(_ref) {
|
|
38
39
|
var _api$featureFlags, _api$analytics;
|
|
39
|
-
var
|
|
40
|
-
api = _ref.api;
|
|
40
|
+
var api = _ref.api;
|
|
41
41
|
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
42
42
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
43
43
|
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
@@ -65,6 +65,14 @@ var listPlugin = exports.listPlugin = function listPlugin(_ref) {
|
|
|
65
65
|
return _main.pluginKey.getState(editorState);
|
|
66
66
|
},
|
|
67
67
|
nodes: function nodes() {
|
|
68
|
+
var getListItemNode = function getListItemNode() {
|
|
69
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
|
|
70
|
+
return _adfSchema.listItemWithFlexibleFirstChildStage0;
|
|
71
|
+
} else if ((0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid')) {
|
|
72
|
+
return _adfSchema.listItemWithLocalId;
|
|
73
|
+
}
|
|
74
|
+
return _adfSchema.listItem;
|
|
75
|
+
};
|
|
68
76
|
return [{
|
|
69
77
|
name: 'bulletList',
|
|
70
78
|
node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.bulletListWithLocalId : _adfSchema.bulletList
|
|
@@ -73,7 +81,7 @@ var listPlugin = exports.listPlugin = function listPlugin(_ref) {
|
|
|
73
81
|
node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.orderedListWithOrderAndLocalId : _adfSchema.orderedListWithOrder
|
|
74
82
|
}, {
|
|
75
83
|
name: 'listItem',
|
|
76
|
-
node: (
|
|
84
|
+
node: getListItemNode()
|
|
77
85
|
}];
|
|
78
86
|
},
|
|
79
87
|
pmPlugins: function pmPlugins() {
|
|
@@ -87,8 +95,7 @@ var listPlugin = exports.listPlugin = function listPlugin(_ref) {
|
|
|
87
95
|
name: 'listInputRule',
|
|
88
96
|
plugin: function plugin(_ref3) {
|
|
89
97
|
var _api$analytics2;
|
|
90
|
-
var schema = _ref3.schema
|
|
91
|
-
featureFlags = _ref3.featureFlags;
|
|
98
|
+
var schema = _ref3.schema;
|
|
92
99
|
return (0, _inputRules.default)(schema, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
93
100
|
}
|
|
94
101
|
}, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { bulletList, bulletListWithLocalId, listItem, listItemWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId } from '@atlaskit/adf-schema';
|
|
2
|
+
import { bulletList, bulletListWithLocalId, listItem, listItemWithFlexibleFirstChildStage0, listItemWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId } 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
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
10
|
import { toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './pm-plugins/commands';
|
|
10
11
|
import { indentList } from './pm-plugins/commands/indent-list';
|
|
@@ -28,7 +29,6 @@ import { getListComponents } from './ui';
|
|
|
28
29
|
* from `@atlaskit/editor-core`.
|
|
29
30
|
*/
|
|
30
31
|
export const listPlugin = ({
|
|
31
|
-
config: options,
|
|
32
32
|
api
|
|
33
33
|
}) => {
|
|
34
34
|
var _api$featureFlags, _api$analytics;
|
|
@@ -57,6 +57,14 @@ export const listPlugin = ({
|
|
|
57
57
|
return listPluginKey.getState(editorState);
|
|
58
58
|
},
|
|
59
59
|
nodes() {
|
|
60
|
+
const getListItemNode = () => {
|
|
61
|
+
if (expValEquals('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
|
|
62
|
+
return listItemWithFlexibleFirstChildStage0;
|
|
63
|
+
} else if (fg('platform_editor_adf_with_localid')) {
|
|
64
|
+
return listItemWithLocalId;
|
|
65
|
+
}
|
|
66
|
+
return listItem;
|
|
67
|
+
};
|
|
60
68
|
return [{
|
|
61
69
|
name: 'bulletList',
|
|
62
70
|
node: fg('platform_editor_adf_with_localid') ? bulletListWithLocalId : bulletList
|
|
@@ -65,7 +73,7 @@ export const listPlugin = ({
|
|
|
65
73
|
node: fg('platform_editor_adf_with_localid') ? orderedListWithOrderAndLocalId : orderedListWithOrder
|
|
66
74
|
}, {
|
|
67
75
|
name: 'listItem',
|
|
68
|
-
node:
|
|
76
|
+
node: getListItemNode()
|
|
69
77
|
}];
|
|
70
78
|
},
|
|
71
79
|
pmPlugins() {
|
|
@@ -77,8 +85,7 @@ export const listPlugin = ({
|
|
|
77
85
|
}, {
|
|
78
86
|
name: 'listInputRule',
|
|
79
87
|
plugin: ({
|
|
80
|
-
schema
|
|
81
|
-
featureFlags
|
|
88
|
+
schema
|
|
82
89
|
}) => {
|
|
83
90
|
var _api$analytics2;
|
|
84
91
|
return inputRulePlugin(schema, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
package/dist/esm/listPlugin.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { bulletList, bulletListWithLocalId, listItem, listItemWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId } from '@atlaskit/adf-schema';
|
|
2
|
+
import { bulletList, bulletListWithLocalId, listItem, listItemWithFlexibleFirstChildStage0, listItemWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId } 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
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
10
|
import { toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './pm-plugins/commands';
|
|
10
11
|
import { indentList } from './pm-plugins/commands/indent-list';
|
|
@@ -29,8 +30,7 @@ import { getListComponents } from './ui';
|
|
|
29
30
|
*/
|
|
30
31
|
export var listPlugin = function listPlugin(_ref) {
|
|
31
32
|
var _api$featureFlags, _api$analytics;
|
|
32
|
-
var
|
|
33
|
-
api = _ref.api;
|
|
33
|
+
var api = _ref.api;
|
|
34
34
|
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
35
35
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
36
36
|
if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
@@ -58,6 +58,14 @@ export var listPlugin = function listPlugin(_ref) {
|
|
|
58
58
|
return listPluginKey.getState(editorState);
|
|
59
59
|
},
|
|
60
60
|
nodes: function nodes() {
|
|
61
|
+
var getListItemNode = function getListItemNode() {
|
|
62
|
+
if (expValEquals('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
|
|
63
|
+
return listItemWithFlexibleFirstChildStage0;
|
|
64
|
+
} else if (fg('platform_editor_adf_with_localid')) {
|
|
65
|
+
return listItemWithLocalId;
|
|
66
|
+
}
|
|
67
|
+
return listItem;
|
|
68
|
+
};
|
|
61
69
|
return [{
|
|
62
70
|
name: 'bulletList',
|
|
63
71
|
node: fg('platform_editor_adf_with_localid') ? bulletListWithLocalId : bulletList
|
|
@@ -66,7 +74,7 @@ export var listPlugin = function listPlugin(_ref) {
|
|
|
66
74
|
node: fg('platform_editor_adf_with_localid') ? orderedListWithOrderAndLocalId : orderedListWithOrder
|
|
67
75
|
}, {
|
|
68
76
|
name: 'listItem',
|
|
69
|
-
node:
|
|
77
|
+
node: getListItemNode()
|
|
70
78
|
}];
|
|
71
79
|
},
|
|
72
80
|
pmPlugins: function pmPlugins() {
|
|
@@ -80,8 +88,7 @@ export var listPlugin = function listPlugin(_ref) {
|
|
|
80
88
|
name: 'listInputRule',
|
|
81
89
|
plugin: function plugin(_ref3) {
|
|
82
90
|
var _api$analytics2;
|
|
83
|
-
var schema = _ref3.schema
|
|
84
|
-
featureFlags = _ref3.featureFlags;
|
|
91
|
+
var schema = _ref3.schema;
|
|
85
92
|
return inputRulePlugin(schema, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
86
93
|
}
|
|
87
94
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-list",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.23",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^
|
|
30
|
+
"@atlaskit/adf-schema": "^52.0.0",
|
|
31
31
|
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
32
32
|
"@atlaskit/editor-plugin-block-menu": "^6.1.0",
|
|
33
33
|
"@atlaskit/editor-plugin-feature-flags": "^6.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
39
39
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
40
40
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^31.
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^31.2.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|