@atlaskit/editor-plugin-list 1.1.0 → 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 CHANGED
@@ -1,5 +1,47 @@
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
+
33
+ ## 1.1.2
34
+
35
+ ### Patch Changes
36
+
37
+ - [`67971a65d80`](https://bitbucket.org/atlassian/atlassian-frontend/commits/67971a65d80) - use fixed version for adf-schema
38
+
39
+ ## 1.1.1
40
+
41
+ ### Patch Changes
42
+
43
+ - [`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added atlaskit docs to all existing plugins.
44
+
3
45
  ## 1.1.0
4
46
 
5
47
  ### Minor Changes
@@ -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(options, api) {
25
- var _api$dependencies$ana;
26
- var featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
27
- var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions;
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(_ref) {
64
- var dispatch = _ref.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(_ref2) {
70
- var _api$dependencies$ana2;
71
- var schema = _ref2.schema,
72
- featureFlags = _ref2.featureFlags;
73
- return (0, _inputRules.default)(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies$ana2 = api.dependencies.analytics) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.actions);
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$dependencies$ana3;
79
- return (0, _keymap.default)(featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies$ana3 = api.dependencies.analytics) === null || _api$dependencies$ana3 === void 0 ? void 0 : _api$dependencies$ana3.actions);
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(_ref3) {
85
- var formatMessage = _ref3.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),
@@ -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 = (options, api) => {
19
- var _api$dependencies$ana;
20
- const featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
21
- const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions;
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$dependencies$ana2;
65
- return inputRulePlugin(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies$ana2 = api.dependencies.analytics) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.actions);
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$dependencies$ana3;
71
- return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies$ana3 = api.dependencies.analytics) === null || _api$dependencies$ana3 === void 0 ? void 0 : _api$dependencies$ana3.actions);
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
  },
@@ -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(options, api) {
19
- var _api$dependencies$ana;
20
- var featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
21
- var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions;
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(_ref) {
58
- var dispatch = _ref.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(_ref2) {
64
- var _api$dependencies$ana2;
65
- var schema = _ref2.schema,
66
- featureFlags = _ref2.featureFlags;
67
- return inputRulePlugin(schema, featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies$ana2 = api.dependencies.analytics) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.actions);
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$dependencies$ana3;
73
- return keymapPlugin(featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies$ana3 = api.dependencies.analytics) === null || _api$dependencies$ana3 === void 0 ? void 0 : _api$dependencies$ana3.actions);
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(_ref3) {
79
- var formatMessage = _ref3.formatMessage;
80
+ quickInsert: function quickInsert(_ref4) {
81
+ var formatMessage = _ref4.formatMessage;
80
82
  return [{
81
83
  id: 'unorderedList',
82
84
  title: formatMessage(messages.unorderedList),
@@ -1,7 +1,7 @@
1
1
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorCommand, FeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
3
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
5
5
  import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
6
6
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
@@ -23,10 +23,7 @@ export interface ListState {
23
23
  }
24
24
  export type ListPlugin = NextEditorPlugin<'list', {
25
25
  pluginConfiguration: ListPluginOptions | undefined;
26
- dependencies: [
27
- typeof featureFlagsPlugin,
28
- OptionalPlugin<typeof analyticsPlugin>
29
- ];
26
+ dependencies: [FeatureFlagsPlugin, OptionalPlugin<AnalyticsPlugin>];
30
27
  actions: {
31
28
  isInsideListItem: IsInsideListItem;
32
29
  findRootParentListNode: FindRootParentListNode;
@@ -1,7 +1,7 @@
1
1
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorCommand, FeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
3
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
5
5
  import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
6
6
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
@@ -24,8 +24,8 @@ export interface ListState {
24
24
  export type ListPlugin = NextEditorPlugin<'list', {
25
25
  pluginConfiguration: ListPluginOptions | undefined;
26
26
  dependencies: [
27
- typeof featureFlagsPlugin,
28
- OptionalPlugin<typeof analyticsPlugin>
27
+ FeatureFlagsPlugin,
28
+ OptionalPlugin<AnalyticsPlugin>
29
29
  ];
30
30
  actions: {
31
31
  isInsideListItem: IsInsideListItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-list",
3
- "version": "1.1.0",
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",
@@ -31,8 +31,8 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^28.1.0",
35
- "@atlaskit/editor-common": "^74.51.0",
34
+ "@atlaskit/adf-schema": "28.1.2",
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",
@@ -45,7 +45,6 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@af/visual-regression": "*",
48
- "@atlaskit/editor-test-helpers": "^18.11.0",
49
48
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
50
49
  "@testing-library/react": "^12.1.5",
51
50
  "react-dom": "^16.8.0",
package/report.api.md CHANGED
@@ -15,11 +15,11 @@
15
15
  <!--SECTION START: Main Entry Types-->
16
16
 
17
17
  ```ts
18
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
18
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
19
19
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
20
20
  import type { EditorCommand } from '@atlaskit/editor-common/types';
21
21
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
22
- import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
22
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
23
23
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
24
24
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
25
25
  import type { OptionalPlugin } from '@atlaskit/editor-common/types';
@@ -43,10 +43,7 @@ export type ListPlugin = NextEditorPlugin<
43
43
  'list',
44
44
  {
45
45
  pluginConfiguration: ListPluginOptions | undefined;
46
- dependencies: [
47
- typeof featureFlagsPlugin,
48
- OptionalPlugin<typeof analyticsPlugin>,
49
- ];
46
+ dependencies: [FeatureFlagsPlugin, OptionalPlugin<AnalyticsPlugin>];
50
47
  actions: {
51
48
  isInsideListItem: IsInsideListItem;
52
49
  findRootParentListNode: FindRootParentListNode;
@@ -4,11 +4,11 @@
4
4
 
5
5
  ```ts
6
6
 
7
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
8
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
9
  import type { EditorCommand } from '@atlaskit/editor-common/types';
10
10
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
11
- import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
11
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
12
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
13
13
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
14
14
  import type { OptionalPlugin } from '@atlaskit/editor-common/types';
@@ -30,10 +30,7 @@ type IsInsideListItem = (tr: Transaction) => boolean;
30
30
  // @public (undocumented)
31
31
  export type ListPlugin = NextEditorPlugin<'list', {
32
32
  pluginConfiguration: ListPluginOptions | undefined;
33
- dependencies: [
34
- typeof featureFlagsPlugin,
35
- OptionalPlugin<typeof analyticsPlugin>
36
- ];
33
+ dependencies: [FeatureFlagsPlugin, OptionalPlugin<AnalyticsPlugin>];
37
34
  actions: {
38
35
  isInsideListItem: IsInsideListItem;
39
36
  findRootParentListNode: FindRootParentListNode;