@atlaskit/editor-plugin-guideline 0.4.0 → 0.4.2

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,41 @@
1
1
  # @atlaskit/editor-plugin-guideline
2
2
 
3
+ ## 0.4.2
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
+ ## 0.4.1
34
+
35
+ ### Patch Changes
36
+
37
+ - [`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added atlaskit docs to all existing plugins.
38
+
3
39
  ## 0.4.0
4
40
 
5
41
  ### Minor Changes
@@ -92,7 +92,9 @@ var ContentComponent = function ContentComponent(_ref) {
92
92
  updateRect: updateRect
93
93
  }));
94
94
  };
95
- var guidelinePlugin = function guidelinePlugin(options, api) {
95
+ var guidelinePlugin = function guidelinePlugin(_ref4) {
96
+ var options = _ref4.config,
97
+ api = _ref4.api;
96
98
  return {
97
99
  name: 'guideline',
98
100
  getSharedState: function getSharedState(editorState) {
@@ -112,8 +114,8 @@ var guidelinePlugin = function guidelinePlugin(options, api) {
112
114
  }
113
115
  }];
114
116
  },
115
- contentComponent: function contentComponent(_ref4) {
116
- var editorView = _ref4.editorView;
117
+ contentComponent: function contentComponent(_ref5) {
118
+ var editorView = _ref5.editorView;
117
119
  return (0, _react.jsx)(ContentComponent, {
118
120
  editorView: editorView,
119
121
  options: options,
@@ -91,7 +91,10 @@ const ContentComponent = ({
91
91
  updateRect: updateRect
92
92
  }));
93
93
  };
94
- export const guidelinePlugin = (options, api) => ({
94
+ export const guidelinePlugin = ({
95
+ config: options,
96
+ api
97
+ }) => ({
95
98
  name: 'guideline',
96
99
  getSharedState(editorState) {
97
100
  if (!editorState) {
@@ -85,7 +85,9 @@ var ContentComponent = function ContentComponent(_ref) {
85
85
  updateRect: updateRect
86
86
  }));
87
87
  };
88
- export var guidelinePlugin = function guidelinePlugin(options, api) {
88
+ export var guidelinePlugin = function guidelinePlugin(_ref4) {
89
+ var options = _ref4.config,
90
+ api = _ref4.api;
89
91
  return {
90
92
  name: 'guideline',
91
93
  getSharedState: function getSharedState(editorState) {
@@ -105,8 +107,8 @@ export var guidelinePlugin = function guidelinePlugin(options, api) {
105
107
  }
106
108
  }];
107
109
  },
108
- contentComponent: function contentComponent(_ref4) {
109
- var editorView = _ref4.editorView;
110
+ contentComponent: function contentComponent(_ref5) {
111
+ var editorView = _ref5.editorView;
110
112
  return jsx(ContentComponent, {
111
113
  editorView: editorView,
112
114
  options: options,
@@ -1 +1,2 @@
1
1
  export { guidelinePlugin } from './plugin';
2
+ export type { GuidelinePlugin } from './plugin';
@@ -1,11 +1,12 @@
1
1
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import type { widthPlugin } from '@atlaskit/editor-plugin-width';
2
+ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
3
3
  import type { DisplayGuideline, GuidelinePluginState } from './types';
4
4
  export declare const EMPTY_STATE: GuidelinePluginState;
5
- export declare const guidelinePlugin: NextEditorPlugin<'guideline', {
6
- dependencies: [typeof widthPlugin];
5
+ export type GuidelinePlugin = NextEditorPlugin<'guideline', {
6
+ dependencies: [WidthPlugin];
7
7
  sharedState: GuidelinePluginState | null;
8
8
  actions: {
9
9
  displayGuideline: DisplayGuideline;
10
10
  };
11
11
  }>;
12
+ export declare const guidelinePlugin: GuidelinePlugin;
@@ -1 +1,2 @@
1
1
  export { guidelinePlugin } from './plugin';
2
+ export type { GuidelinePlugin } from './plugin';
@@ -1,13 +1,14 @@
1
1
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import type { widthPlugin } from '@atlaskit/editor-plugin-width';
2
+ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
3
3
  import type { DisplayGuideline, GuidelinePluginState } from './types';
4
4
  export declare const EMPTY_STATE: GuidelinePluginState;
5
- export declare const guidelinePlugin: NextEditorPlugin<'guideline', {
5
+ export type GuidelinePlugin = NextEditorPlugin<'guideline', {
6
6
  dependencies: [
7
- typeof widthPlugin
7
+ WidthPlugin
8
8
  ];
9
9
  sharedState: GuidelinePluginState | null;
10
10
  actions: {
11
11
  displayGuideline: DisplayGuideline;
12
12
  };
13
13
  }>;
14
+ export declare const guidelinePlugin: GuidelinePlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-guideline",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "guideline plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -23,12 +23,12 @@
23
23
  ".": "./src/index.ts"
24
24
  },
25
25
  "dependencies": {
26
- "@atlaskit/editor-common": "^74.51.0",
26
+ "@atlaskit/editor-common": "^74.53.0",
27
27
  "@atlaskit/editor-plugin-width": "^0.1.0",
28
28
  "@atlaskit/editor-prosemirror": "1.1.0",
29
29
  "@atlaskit/editor-shared-styles": "^2.6.0",
30
30
  "@atlaskit/theme": "^12.5.0",
31
- "@atlaskit/tokens": "^1.15.0",
31
+ "@atlaskit/tokens": "^1.17.0",
32
32
  "@babel/runtime": "^7.0.0",
33
33
  "@emotion/react": "^11.7.1"
34
34
  },
package/report.api.md CHANGED
@@ -18,13 +18,13 @@
18
18
  import { DisplayGuideline } from '@atlaskit/editor-common/guideline';
19
19
  import { GuidelinePluginState } from '@atlaskit/editor-common/guideline';
20
20
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
21
- import type { widthPlugin } from '@atlaskit/editor-plugin-width';
21
+ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
22
22
 
23
23
  // @public (undocumented)
24
- export const guidelinePlugin: NextEditorPlugin<
24
+ export type GuidelinePlugin = NextEditorPlugin<
25
25
  'guideline',
26
26
  {
27
- dependencies: [typeof widthPlugin];
27
+ dependencies: [WidthPlugin];
28
28
  sharedState: GuidelinePluginState | null;
29
29
  actions: {
30
30
  displayGuideline: DisplayGuideline;
@@ -32,6 +32,9 @@ export const guidelinePlugin: NextEditorPlugin<
32
32
  }
33
33
  >;
34
34
 
35
+ // @public (undocumented)
36
+ export const guidelinePlugin: GuidelinePlugin;
37
+
35
38
  // (No @packageDocumentation comment for this package)
36
39
  ```
37
40
 
@@ -7,17 +7,20 @@
7
7
  import { DisplayGuideline } from '@atlaskit/editor-common/guideline';
8
8
  import { GuidelinePluginState } from '@atlaskit/editor-common/guideline';
9
9
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
10
- import type { widthPlugin } from '@atlaskit/editor-plugin-width';
10
+ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
11
11
 
12
12
  // @public (undocumented)
13
- export const guidelinePlugin: NextEditorPlugin<'guideline', {
14
- dependencies: [typeof widthPlugin];
13
+ export type GuidelinePlugin = NextEditorPlugin<'guideline', {
14
+ dependencies: [WidthPlugin];
15
15
  sharedState: GuidelinePluginState | null;
16
16
  actions: {
17
17
  displayGuideline: DisplayGuideline;
18
18
  };
19
19
  }>;
20
20
 
21
+ // @public (undocumented)
22
+ export const guidelinePlugin: GuidelinePlugin;
23
+
21
24
  // (No @packageDocumentation comment for this package)
22
25
 
23
26
  ```