@atlaskit/editor-plugin-list 4.0.0 → 4.1.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-plugin-list
2
2
 
3
+ ## 4.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#120472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120472)
8
+ [`4758d7dd443dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4758d7dd443dd) -
9
+ [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
10
+ and feature gated the usage of new prosemirror nodes in blockTypePlugin, expandPlugin, listPlugin
11
+ and panelPlugin as the new defaults of these nodes support nesting of extensions
12
+ - [#120472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120472)
13
+ [`73c800ab5f2fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73c800ab5f2fc) -
14
+ 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
15
+
16
+ ### Patch Changes
17
+
18
+ - [#120007](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120007)
19
+ [`e87df0a8c73c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e87df0a8c73c6) -
20
+ [ux] Do not add headings, lists, layouts, panels in the new QuickInsert menu
21
+ - Updated dependencies
22
+
3
23
  ## 4.0.0
4
24
 
5
25
  ### Major Changes
@@ -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
- // Ignored via go/ees005
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.listItemWithTask;
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, listItemWithTask, orderedListWithOrder } from '@atlaskit/adf-schema';
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 = listItemWithTask;
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
- quickInsert: ({
90
- formatMessage
91
- }) => [{
92
- id: 'unorderedList',
93
- title: formatMessage(messages.unorderedList),
94
- description: formatMessage(messages.unorderedListDescription),
95
- keywords: ['ul', 'unordered'],
96
- priority: 1100,
97
- keyshortcut: tooltip(toggleBulletList),
98
- icon: () => /*#__PURE__*/React.createElement(IconList, null),
99
- action(insert, state) {
100
- const tr = insert(state.schema.nodes.bulletList.createChecked({}, state.schema.nodes.listItem.createChecked({}, state.schema.nodes.paragraph.createChecked())));
101
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
102
- action: ACTION.INSERTED,
103
- actionSubject: ACTION_SUBJECT.LIST,
104
- actionSubjectId: ACTION_SUBJECT_ID.FORMAT_LIST_BULLET,
105
- eventType: EVENT_TYPE.TRACK,
106
- attributes: {
107
- inputMethod: INPUT_METHOD.QUICK_INSERT
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
- })(tr);
110
- return tr;
111
- }
112
- }, {
113
- id: 'orderedList',
114
- title: formatMessage(messages.orderedList),
115
- description: formatMessage(messages.orderedListDescription),
116
- keywords: ['ol', 'ordered'],
117
- priority: 1200,
118
- keyshortcut: tooltip(toggleOrderedList),
119
- icon: () => /*#__PURE__*/React.createElement(IconListNumber, null),
120
- action(insert, state) {
121
- const tr = insert(state.schema.nodes.orderedList.createChecked({}, state.schema.nodes.listItem.createChecked({}, state.schema.nodes.paragraph.createChecked())));
122
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
123
- action: ACTION.INSERTED,
124
- actionSubject: ACTION_SUBJECT.LIST,
125
- actionSubjectId: ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER,
126
- eventType: EVENT_TYPE.TRACK,
127
- attributes: {
128
- inputMethod: INPUT_METHOD.QUICK_INSERT
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
- })(tr);
131
- return tr;
136
+ }];
132
137
  }
133
- }]
138
+ })
134
139
  }
135
140
  };
136
141
  };
@@ -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, listItemWithTask, orderedListWithOrder } from '@atlaskit/adf-schema';
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 = listItemWithTask;
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.0.0",
3
+ "version": "4.1.0",
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.2.1",
35
- "@atlaskit/editor-common": "^100.0.0",
36
- "@atlaskit/editor-plugin-analytics": "^2.0.0",
34
+ "@atlaskit/adf-schema": "^47.6.0",
35
+ "@atlaskit/editor-common": "^100.5.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": {