@atlaskit/editor-plugin-decorations 0.1.4 → 0.2.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,41 @@
1
1
  # @atlaskit/editor-plugin-decorations
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
8
+
9
+ ## 0.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
14
+ signature of `NextEditorPlugin`.
15
+
16
+ Previously a `NextEditorPlugin` would be consumed as so:
17
+
18
+ ```ts
19
+ const plugin: NextEditorPlugin< ... > = (config, api) => {
20
+ // Can use api like so:
21
+ api.dependencies.core.actions.execute( ... )
22
+ return { ... }
23
+ }
24
+ ```
25
+
26
+ Now these have become named parameters like so and the `pluginInjectionAPI` is used
27
+ without the `dependencies` prop:
28
+
29
+ ```ts
30
+ const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
31
+ // Can use api like so:
32
+ api.core.actions.execute( ... )
33
+ return { ... }
34
+ }
35
+ ```
36
+
37
+ - Updated dependencies
38
+
3
39
  ## 0.1.4
4
40
 
5
41
  ### Patch Changes
package/README.md CHANGED
@@ -1,7 +1,30 @@
1
- # EditorPluginDecorations
1
+ # Editor plugin decorations
2
2
 
3
3
  Decorations plugin for @atlaskit/editor-core
4
4
 
5
+ **Note:** This component is designed for internal Atlassian development.
6
+ External contributors will be able to use this component but will not be able to submit issues.
7
+
8
+ ## Install
9
+ ---
10
+ - **Install** - *yarn add @atlaskit/editor-plugin-decorations*
11
+ - **npm** - [@atlaskit/editor-plugin-decorations](https://www.npmjs.com/package/@atlaskit/editor-plugin-decorations)
12
+ - **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-decorations)
13
+ - **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-decorations/dist/)
14
+
5
15
  ## Usage
16
+ ---
17
+ **Internal use only**
18
+
19
+ @atlaskit/editor-plugin-decorations is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
20
+
21
+ Direct use of this component is not supported.
22
+
23
+ Please see [Atlaskit - Editor plugin decorations](https://atlaskit.atlassian.com/packages/editor/editor-plugin-decorations) for documentation and examples for this package.
6
24
 
7
- `import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';`
25
+ ## Support
26
+ ---
27
+ For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
28
+ ## License
29
+ ---
30
+ Please see [Atlassian Frontend - License](https://developer.atlassian.com/cloud/framework/atlassian-frontend/#license) for more licensing information.
@@ -8,6 +8,10 @@ exports.decorationsPlugin = void 0;
8
8
  var _pmPlugin = _interopRequireWildcard(require("./pm-plugin"));
9
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
+ /**
12
+ * Decorations plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
13
+ * from `@atlaskit/editor-core`.
14
+ */
11
15
  var decorationsPlugin = function decorationsPlugin() {
12
16
  return {
13
17
  name: 'decorations',
@@ -1,4 +1,8 @@
1
1
  import decorationPlugin, { decorationStateKey, hoverDecoration, removeDecoration } from './pm-plugin';
2
+ /**
3
+ * Decorations plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
4
+ * from `@atlaskit/editor-core`.
5
+ */
2
6
  export const decorationsPlugin = () => ({
3
7
  name: 'decorations',
4
8
  pmPlugins() {
@@ -1,4 +1,8 @@
1
1
  import decorationPlugin, { decorationStateKey, hoverDecoration, removeDecoration } from './pm-plugin';
2
+ /**
3
+ * Decorations plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
4
+ * from `@atlaskit/editor-core`.
5
+ */
2
6
  export var decorationsPlugin = function decorationsPlugin() {
3
7
  return {
4
8
  name: 'decorations',
@@ -8,4 +8,8 @@ export type DecorationsPlugin = NextEditorPlugin<'decorations', {
8
8
  removeDecoration: typeof removeDecoration;
9
9
  };
10
10
  }>;
11
+ /**
12
+ * Decorations plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
13
+ * from `@atlaskit/editor-core`.
14
+ */
11
15
  export declare const decorationsPlugin: DecorationsPlugin;
@@ -8,4 +8,8 @@ export type DecorationsPlugin = NextEditorPlugin<'decorations', {
8
8
  removeDecoration: typeof removeDecoration;
9
9
  };
10
10
  }>;
11
+ /**
12
+ * Decorations plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
13
+ * from `@atlaskit/editor-core`.
14
+ */
11
15
  export declare const decorationsPlugin: DecorationsPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-decorations",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Decorations plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -8,7 +8,7 @@
8
8
  "registry": "https://registry.npmjs.org/"
9
9
  },
10
10
  "atlassian": {
11
- "team": "Editor",
11
+ "team": "Editor: Lego",
12
12
  "singleton": true,
13
13
  "releaseModel": "continuous"
14
14
  },
@@ -23,7 +23,7 @@
23
23
  ".": "./src/index.ts"
24
24
  },
25
25
  "dependencies": {
26
- "@atlaskit/editor-common": "^74.52.0",
26
+ "@atlaskit/editor-common": "^74.55.0",
27
27
  "@atlaskit/editor-prosemirror": "1.1.0",
28
28
  "@babel/runtime": "^7.0.0"
29
29
  },
package/report.api.md CHANGED
@@ -32,7 +32,7 @@ export type DecorationsPlugin = NextEditorPlugin<
32
32
  }
33
33
  >;
34
34
 
35
- // @public (undocumented)
35
+ // @public
36
36
  export const decorationsPlugin: DecorationsPlugin;
37
37
 
38
38
  // @public (undocumented)
@@ -0,0 +1,40 @@
1
+ ## API Report File for "@atlaskit/editor-plugin-decorations"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { Command } from '@atlaskit/editor-common/types';
8
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
9
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
10
+ import { NodeType } from '@atlaskit/editor-prosemirror/model';
11
+
12
+ // @public (undocumented)
13
+ export type DecorationsPlugin = NextEditorPlugin<'decorations', {
14
+ sharedState: DecorationState;
15
+ actions: {
16
+ hoverDecoration: HoverDecorationHandler;
17
+ removeDecoration: typeof removeDecoration;
18
+ };
19
+ }>;
20
+
21
+ // @public
22
+ export const decorationsPlugin: DecorationsPlugin;
23
+
24
+ // @public (undocumented)
25
+ export type DecorationState = {
26
+ decoration?: Decoration;
27
+ };
28
+
29
+ // @public (undocumented)
30
+ const hoverDecoration: (nodeType: Array<NodeType> | NodeType, add: boolean, className?: string) => Command;
31
+
32
+ // @public (undocumented)
33
+ export type HoverDecorationHandler = typeof hoverDecoration;
34
+
35
+ // @public (undocumented)
36
+ const removeDecoration: Command;
37
+
38
+ // (No @packageDocumentation comment for this package)
39
+
40
+ ```