@atlaskit/editor-plugin-list 9.0.0 → 9.0.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 +23 -0
- package/dist/cjs/pm-plugins/main.js +4 -5
- package/dist/cjs/ui/BulletedListBlockMenuItem.js +0 -5
- package/dist/cjs/ui/NumberedListBlockMenuItem.js +0 -5
- package/dist/cjs/ui/index.js +12 -2
- package/dist/es2019/pm-plugins/main.js +2 -3
- package/dist/es2019/ui/BulletedListBlockMenuItem.js +0 -5
- package/dist/es2019/ui/NumberedListBlockMenuItem.js +0 -5
- package/dist/es2019/ui/index.js +12 -2
- package/dist/esm/pm-plugins/main.js +2 -3
- package/dist/esm/ui/BulletedListBlockMenuItem.js +0 -5
- package/dist/esm/ui/NumberedListBlockMenuItem.js +0 -5
- package/dist/esm/ui/index.js +12 -2
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-list
|
|
2
2
|
|
|
3
|
+
## 9.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6e8029473620b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e8029473620b) -
|
|
8
|
+
[EDITOR-4496] clean up experiment platform_editor_toolbar_aifc_patch_3 and remove view-mode plugin
|
|
9
|
+
dependency from loom plugin
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 9.0.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`b909e5f47ea91`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b909e5f47ea91) -
|
|
17
|
+
EDITOR-4159 Make sure block-menu-item type component return null when tranform disabled
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
20
|
+
## 9.0.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 9.0.0
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -10,14 +10,13 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
10
10
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
11
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
-
var
|
|
13
|
+
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
15
15
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
16
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _selection2 = require("./utils/selection");
|
|
18
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; }
|
|
19
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; }
|
|
20
|
-
var listPluginKey = new
|
|
19
|
+
var listPluginKey = new _state2.PluginKey('listPlugin');
|
|
21
20
|
var pluginKey = exports.pluginKey = listPluginKey;
|
|
22
21
|
var initialState = {
|
|
23
22
|
bulletListActive: false,
|
|
@@ -26,7 +25,7 @@ var initialState = {
|
|
|
26
25
|
orderedListDisabled: false,
|
|
27
26
|
decorationSet: _view.DecorationSet.empty
|
|
28
27
|
};
|
|
29
|
-
var getDecorations = exports.getDecorations = function getDecorations(doc,
|
|
28
|
+
var getDecorations = exports.getDecorations = function getDecorations(doc, _state, _featureFlags) {
|
|
30
29
|
var decorations = [];
|
|
31
30
|
|
|
32
31
|
// this stack keeps track of each (nested) list to calculate the indentation level
|
|
@@ -125,7 +124,7 @@ var reducer = function reducer() {
|
|
|
125
124
|
var createInitialState = function createInitialState(featureFlags, api) {
|
|
126
125
|
return function (state) {
|
|
127
126
|
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
128
|
-
return _objectSpread(_objectSpread({}, isToolbarAIFCEnabled
|
|
127
|
+
return _objectSpread(_objectSpread({}, isToolbarAIFCEnabled ? getListState(state.doc, state.selection) : initialState), {}, {
|
|
129
128
|
decorationSet: getDecorations(state.doc, state, featureFlags)
|
|
130
129
|
});
|
|
131
130
|
};
|
|
@@ -13,7 +13,6 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
|
13
13
|
var _listBulleted = _interopRequireDefault(require("@atlaskit/icon/core/list-bulleted"));
|
|
14
14
|
var NODE_NAME = 'bulletList';
|
|
15
15
|
var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
|
|
16
|
-
var _api$blockMenu2;
|
|
17
16
|
var api = _ref.api;
|
|
18
17
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
19
18
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -33,10 +32,6 @@ var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
|
|
|
33
32
|
}) : null;
|
|
34
33
|
});
|
|
35
34
|
};
|
|
36
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
37
|
-
if (isTransfromToPanelDisabled) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
35
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
41
36
|
onClick: handleClick,
|
|
42
37
|
elemBefore: /*#__PURE__*/_react.default.createElement(_listBulleted.default, {
|
|
@@ -13,7 +13,6 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
|
13
13
|
var _listNumbered = _interopRequireDefault(require("@atlaskit/icon/core/list-numbered"));
|
|
14
14
|
var NODE_NAME = 'orderedList';
|
|
15
15
|
var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
|
|
16
|
-
var _api$blockMenu2;
|
|
17
16
|
var api = _ref.api;
|
|
18
17
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
19
18
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -33,10 +32,6 @@ var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
|
|
|
33
32
|
}) : null;
|
|
34
33
|
});
|
|
35
34
|
};
|
|
36
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
37
|
-
if (isTransfromToPanelDisabled) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
35
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
41
36
|
onClick: handleClick,
|
|
42
37
|
elemBefore: /*#__PURE__*/_react.default.createElement(_listNumbered.default, {
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.getListComponents = void 0;
|
|
|
7
7
|
var _blockMenu = require("@atlaskit/editor-common/block-menu");
|
|
8
8
|
var _BulletedListBlockMenuItem = require("./BulletedListBlockMenuItem");
|
|
9
9
|
var _NumberedListBlockMenuItem = require("./NumberedListBlockMenuItem");
|
|
10
|
+
var BULLET_LIST_NODE_NAME = 'bulletList';
|
|
11
|
+
var ORDERED_LIST_NODE_NAME = 'orderedList';
|
|
10
12
|
var getListComponents = exports.getListComponents = function getListComponents(api) {
|
|
11
13
|
return [{
|
|
12
14
|
type: 'block-menu-item',
|
|
@@ -18,7 +20,11 @@ var getListComponents = exports.getListComponents = function getListComponents(a
|
|
|
18
20
|
},
|
|
19
21
|
component: (0, _BulletedListBlockMenuItem.createBulletedListBlockMenuItem)({
|
|
20
22
|
api: api
|
|
21
|
-
})
|
|
23
|
+
}),
|
|
24
|
+
isHidden: function isHidden() {
|
|
25
|
+
var _api$blockMenu;
|
|
26
|
+
return Boolean(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.isTransformOptionDisabled(BULLET_LIST_NODE_NAME));
|
|
27
|
+
}
|
|
22
28
|
}, {
|
|
23
29
|
type: 'block-menu-item',
|
|
24
30
|
key: _blockMenu.TRANSFORM_STRUCTURE_NUMBERED_LIST_MENU_ITEM.key,
|
|
@@ -29,6 +35,10 @@ var getListComponents = exports.getListComponents = function getListComponents(a
|
|
|
29
35
|
},
|
|
30
36
|
component: (0, _NumberedListBlockMenuItem.createNumberedListBlockMenuItem)({
|
|
31
37
|
api: api
|
|
32
|
-
})
|
|
38
|
+
}),
|
|
39
|
+
isHidden: function isHidden() {
|
|
40
|
+
var _api$blockMenu2;
|
|
41
|
+
return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(ORDERED_LIST_NODE_NAME));
|
|
42
|
+
}
|
|
33
43
|
}];
|
|
34
44
|
};
|
|
@@ -5,7 +5,6 @@ import { getItemCounterDigitsSize, isListNode, pluginFactory } from '@atlaskit/e
|
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
import { isWrappingPossible } from './utils/selection';
|
|
10
9
|
const listPluginKey = new PluginKey('listPlugin');
|
|
11
10
|
export const pluginKey = listPluginKey;
|
|
@@ -16,7 +15,7 @@ const initialState = {
|
|
|
16
15
|
orderedListDisabled: false,
|
|
17
16
|
decorationSet: DecorationSet.empty
|
|
18
17
|
};
|
|
19
|
-
export const getDecorations = (doc,
|
|
18
|
+
export const getDecorations = (doc, _state, _featureFlags) => {
|
|
20
19
|
const decorations = [];
|
|
21
20
|
|
|
22
21
|
// this stack keeps track of each (nested) list to calculate the indentation level
|
|
@@ -117,7 +116,7 @@ const createInitialState = (featureFlags, api) => state => {
|
|
|
117
116
|
return {
|
|
118
117
|
// When plugin is initialised, editor state is defined with selection
|
|
119
118
|
// hence returning the list state based on the selection to avoid list button in primary toolbar flickering during initial load
|
|
120
|
-
...(isToolbarAIFCEnabled
|
|
119
|
+
...(isToolbarAIFCEnabled ? getListState(state.doc, state.selection) : initialState),
|
|
121
120
|
decorationSet: getDecorations(state.doc, state, featureFlags)
|
|
122
121
|
};
|
|
123
122
|
};
|
|
@@ -8,7 +8,6 @@ const NODE_NAME = 'bulletList';
|
|
|
8
8
|
const BulletedListBlockMenuItem = ({
|
|
9
9
|
api
|
|
10
10
|
}) => {
|
|
11
|
-
var _api$blockMenu2;
|
|
12
11
|
const {
|
|
13
12
|
formatMessage
|
|
14
13
|
} = useIntl();
|
|
@@ -29,10 +28,6 @@ const BulletedListBlockMenuItem = ({
|
|
|
29
28
|
}) : null;
|
|
30
29
|
});
|
|
31
30
|
};
|
|
32
|
-
const isTransfromToPanelDisabled = api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
33
|
-
if (isTransfromToPanelDisabled) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
31
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
37
32
|
onClick: handleClick,
|
|
38
33
|
elemBefore: /*#__PURE__*/React.createElement(ListBulletedIcon, {
|
|
@@ -8,7 +8,6 @@ const NODE_NAME = 'orderedList';
|
|
|
8
8
|
const NumberedListBlockMenuItem = ({
|
|
9
9
|
api
|
|
10
10
|
}) => {
|
|
11
|
-
var _api$blockMenu2;
|
|
12
11
|
const {
|
|
13
12
|
formatMessage
|
|
14
13
|
} = useIntl();
|
|
@@ -29,10 +28,6 @@ const NumberedListBlockMenuItem = ({
|
|
|
29
28
|
}) : null;
|
|
30
29
|
});
|
|
31
30
|
};
|
|
32
|
-
const isTransfromToPanelDisabled = api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
33
|
-
if (isTransfromToPanelDisabled) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
31
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
37
32
|
onClick: handleClick,
|
|
38
33
|
elemBefore: /*#__PURE__*/React.createElement(ListNumberedIcon, {
|
package/dist/es2019/ui/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TRANSFORM_STRUCTURE_MENU_SECTION, TRANSFORM_STRUCTURE_BULLETED_LIST_MENU_ITEM, TRANSFORM_STRUCTURE_NUMBERED_LIST_MENU_ITEM, TRANSFORM_STRUCTURE_MENU_SECTION_RANK } from '@atlaskit/editor-common/block-menu';
|
|
2
2
|
import { createBulletedListBlockMenuItem } from './BulletedListBlockMenuItem';
|
|
3
3
|
import { createNumberedListBlockMenuItem } from './NumberedListBlockMenuItem';
|
|
4
|
+
const BULLET_LIST_NODE_NAME = 'bulletList';
|
|
5
|
+
const ORDERED_LIST_NODE_NAME = 'orderedList';
|
|
4
6
|
export const getListComponents = api => {
|
|
5
7
|
return [{
|
|
6
8
|
type: 'block-menu-item',
|
|
@@ -12,7 +14,11 @@ export const getListComponents = api => {
|
|
|
12
14
|
},
|
|
13
15
|
component: createBulletedListBlockMenuItem({
|
|
14
16
|
api
|
|
15
|
-
})
|
|
17
|
+
}),
|
|
18
|
+
isHidden: () => {
|
|
19
|
+
var _api$blockMenu;
|
|
20
|
+
return Boolean(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.isTransformOptionDisabled(BULLET_LIST_NODE_NAME));
|
|
21
|
+
}
|
|
16
22
|
}, {
|
|
17
23
|
type: 'block-menu-item',
|
|
18
24
|
key: TRANSFORM_STRUCTURE_NUMBERED_LIST_MENU_ITEM.key,
|
|
@@ -23,6 +29,10 @@ export const getListComponents = api => {
|
|
|
23
29
|
},
|
|
24
30
|
component: createNumberedListBlockMenuItem({
|
|
25
31
|
api
|
|
26
|
-
})
|
|
32
|
+
}),
|
|
33
|
+
isHidden: () => {
|
|
34
|
+
var _api$blockMenu2;
|
|
35
|
+
return Boolean(api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(ORDERED_LIST_NODE_NAME));
|
|
36
|
+
}
|
|
27
37
|
}];
|
|
28
38
|
};
|
|
@@ -8,7 +8,6 @@ import { getItemCounterDigitsSize, isListNode, pluginFactory } from '@atlaskit/e
|
|
|
8
8
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
11
|
import { isWrappingPossible } from './utils/selection';
|
|
13
12
|
var listPluginKey = new PluginKey('listPlugin');
|
|
14
13
|
export var pluginKey = listPluginKey;
|
|
@@ -19,7 +18,7 @@ var initialState = {
|
|
|
19
18
|
orderedListDisabled: false,
|
|
20
19
|
decorationSet: DecorationSet.empty
|
|
21
20
|
};
|
|
22
|
-
export var getDecorations = function getDecorations(doc,
|
|
21
|
+
export var getDecorations = function getDecorations(doc, _state, _featureFlags) {
|
|
23
22
|
var decorations = [];
|
|
24
23
|
|
|
25
24
|
// this stack keeps track of each (nested) list to calculate the indentation level
|
|
@@ -118,7 +117,7 @@ var reducer = function reducer() {
|
|
|
118
117
|
var createInitialState = function createInitialState(featureFlags, api) {
|
|
119
118
|
return function (state) {
|
|
120
119
|
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
121
|
-
return _objectSpread(_objectSpread({}, isToolbarAIFCEnabled
|
|
120
|
+
return _objectSpread(_objectSpread({}, isToolbarAIFCEnabled ? getListState(state.doc, state.selection) : initialState), {}, {
|
|
122
121
|
decorationSet: getDecorations(state.doc, state, featureFlags)
|
|
123
122
|
});
|
|
124
123
|
};
|
|
@@ -6,7 +6,6 @@ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
|
6
6
|
import ListBulletedIcon from '@atlaskit/icon/core/list-bulleted';
|
|
7
7
|
var NODE_NAME = 'bulletList';
|
|
8
8
|
var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
|
|
9
|
-
var _api$blockMenu2;
|
|
10
9
|
var api = _ref.api;
|
|
11
10
|
var _useIntl = useIntl(),
|
|
12
11
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -26,10 +25,6 @@ var BulletedListBlockMenuItem = function BulletedListBlockMenuItem(_ref) {
|
|
|
26
25
|
}) : null;
|
|
27
26
|
});
|
|
28
27
|
};
|
|
29
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
30
|
-
if (isTransfromToPanelDisabled) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
28
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
34
29
|
onClick: handleClick,
|
|
35
30
|
elemBefore: /*#__PURE__*/React.createElement(ListBulletedIcon, {
|
|
@@ -6,7 +6,6 @@ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
|
6
6
|
import ListNumberedIcon from '@atlaskit/icon/core/list-numbered';
|
|
7
7
|
var NODE_NAME = 'orderedList';
|
|
8
8
|
var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
|
|
9
|
-
var _api$blockMenu2;
|
|
10
9
|
var api = _ref.api;
|
|
11
10
|
var _useIntl = useIntl(),
|
|
12
11
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -26,10 +25,6 @@ var NumberedListBlockMenuItem = function NumberedListBlockMenuItem(_ref) {
|
|
|
26
25
|
}) : null;
|
|
27
26
|
});
|
|
28
27
|
};
|
|
29
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
30
|
-
if (isTransfromToPanelDisabled) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
28
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
34
29
|
onClick: handleClick,
|
|
35
30
|
elemBefore: /*#__PURE__*/React.createElement(ListNumberedIcon, {
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TRANSFORM_STRUCTURE_MENU_SECTION, TRANSFORM_STRUCTURE_BULLETED_LIST_MENU_ITEM, TRANSFORM_STRUCTURE_NUMBERED_LIST_MENU_ITEM, TRANSFORM_STRUCTURE_MENU_SECTION_RANK } from '@atlaskit/editor-common/block-menu';
|
|
2
2
|
import { createBulletedListBlockMenuItem } from './BulletedListBlockMenuItem';
|
|
3
3
|
import { createNumberedListBlockMenuItem } from './NumberedListBlockMenuItem';
|
|
4
|
+
var BULLET_LIST_NODE_NAME = 'bulletList';
|
|
5
|
+
var ORDERED_LIST_NODE_NAME = 'orderedList';
|
|
4
6
|
export var getListComponents = function getListComponents(api) {
|
|
5
7
|
return [{
|
|
6
8
|
type: 'block-menu-item',
|
|
@@ -12,7 +14,11 @@ export var getListComponents = function getListComponents(api) {
|
|
|
12
14
|
},
|
|
13
15
|
component: createBulletedListBlockMenuItem({
|
|
14
16
|
api: api
|
|
15
|
-
})
|
|
17
|
+
}),
|
|
18
|
+
isHidden: function isHidden() {
|
|
19
|
+
var _api$blockMenu;
|
|
20
|
+
return Boolean(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.isTransformOptionDisabled(BULLET_LIST_NODE_NAME));
|
|
21
|
+
}
|
|
16
22
|
}, {
|
|
17
23
|
type: 'block-menu-item',
|
|
18
24
|
key: TRANSFORM_STRUCTURE_NUMBERED_LIST_MENU_ITEM.key,
|
|
@@ -23,6 +29,10 @@ export var getListComponents = function getListComponents(api) {
|
|
|
23
29
|
},
|
|
24
30
|
component: createNumberedListBlockMenuItem({
|
|
25
31
|
api: api
|
|
26
|
-
})
|
|
32
|
+
}),
|
|
33
|
+
isHidden: function isHidden() {
|
|
34
|
+
var _api$blockMenu2;
|
|
35
|
+
return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(ORDERED_LIST_NODE_NAME));
|
|
36
|
+
}
|
|
27
37
|
}];
|
|
28
38
|
};
|
|
@@ -8,5 +8,5 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
8
8
|
import type { ListPlugin } from '../listPluginType';
|
|
9
9
|
import type { ListState } from '../types';
|
|
10
10
|
export declare const pluginKey: PluginKey<ListState>;
|
|
11
|
-
export declare const getDecorations: (doc: Node,
|
|
11
|
+
export declare const getDecorations: (doc: Node, _state: EditorState, _featureFlags: FeatureFlags) => DecorationSet;
|
|
12
12
|
export declare const createPlugin: (eventDispatch: Dispatch, featureFlags: FeatureFlags, api?: ExtractInjectionAPI<ListPlugin>) => SafePlugin;
|
|
@@ -8,5 +8,5 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
8
8
|
import type { ListPlugin } from '../listPluginType';
|
|
9
9
|
import type { ListState } from '../types';
|
|
10
10
|
export declare const pluginKey: PluginKey<ListState>;
|
|
11
|
-
export declare const getDecorations: (doc: Node,
|
|
11
|
+
export declare const getDecorations: (doc: Node, _state: EditorState, _featureFlags: FeatureFlags) => DecorationSet;
|
|
12
12
|
export declare const createPlugin: (eventDispatch: Dispatch, featureFlags: FeatureFlags, api?: ExtractInjectionAPI<ListPlugin>) => SafePlugin;
|
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.3",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
32
32
|
"@atlaskit/editor-plugin-block-menu": "^6.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-feature-flags": "^6.0.0",
|
|
34
|
-
"@atlaskit/editor-plugin-toolbar": "^4.
|
|
34
|
+
"@atlaskit/editor-plugin-toolbar": "^4.1.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
36
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
37
|
-
"@atlaskit/icon": "^29.
|
|
36
|
+
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
37
|
+
"@atlaskit/icon": "^29.4.0",
|
|
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": "^16.
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^16.30.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@atlaskit/editor-common": "^111.
|
|
45
|
+
"@atlaskit/editor-common": "^111.8.0",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
48
48
|
},
|