@atlaskit/editor-plugin-decorations 2.0.7 → 3.0.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 +48 -0
- package/dist/cjs/pm-plugins/main.js +7 -17
- package/dist/es2019/pm-plugins/main.js +8 -18
- package/dist/esm/pm-plugins/main.js +7 -17
- package/package.json +4 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-decorations
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
|
|
8
|
+
[`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
|
|
9
|
+
Make `@atlaskit/editor-common` a peer dependency
|
|
10
|
+
|
|
11
|
+
**WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
|
|
12
|
+
all editor plugin packages.
|
|
13
|
+
|
|
14
|
+
**WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
|
|
15
|
+
consuming applications, preventing issues caused by multiple versions of singleton libraries (such
|
|
16
|
+
as context mismatches or duplicated state). This is especially important for packages that rely on
|
|
17
|
+
shared context or singletons.
|
|
18
|
+
|
|
19
|
+
**HOW TO ADJUST:**
|
|
20
|
+
|
|
21
|
+
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
22
|
+
any of these editor plugins.
|
|
23
|
+
- Ensure the version you install matches the version required by the plugins.
|
|
24
|
+
- You can use the
|
|
25
|
+
[`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
|
|
26
|
+
verify that all required peer dependencies are installed and compatible.
|
|
27
|
+
- Example install command:
|
|
28
|
+
```
|
|
29
|
+
npm install @atlaskit/editor-common
|
|
30
|
+
```
|
|
31
|
+
or
|
|
32
|
+
```
|
|
33
|
+
yarn add @atlaskit/editor-common
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
|
|
37
|
+
application level, you may see errors or unexpected behavior.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
43
|
+
## 2.0.8
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- [#181594](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181594)
|
|
48
|
+
[`f7fa55cd505ce`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f7fa55cd505ce) -
|
|
49
|
+
Avoid using tables commands directly in floating toolbar plugin.
|
|
50
|
+
|
|
3
51
|
## 2.0.7
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
|
@@ -8,7 +8,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
10
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var decorationStateKey = exports.decorationStateKey = new _state.PluginKey('decorationPlugin');
|
|
13
12
|
var ACTIONS = exports.ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
14
13
|
ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
|
|
@@ -17,22 +16,13 @@ var ACTIONS = exports.ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
|
17
16
|
}({});
|
|
18
17
|
var removeDecoration = exports.removeDecoration = function removeDecoration(state, dispatch) {
|
|
19
18
|
var tr = state.tr;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
} else {
|
|
30
|
-
if (dispatch) {
|
|
31
|
-
dispatch(tr.setMeta(decorationStateKey, {
|
|
32
|
-
action: ACTIONS.DECORATION_REMOVE
|
|
33
|
-
}));
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
19
|
+
var _ref = decorationStateKey.getState(state),
|
|
20
|
+
decoration = _ref.decoration;
|
|
21
|
+
if (decoration && dispatch) {
|
|
22
|
+
dispatch(tr.setMeta(decorationStateKey, {
|
|
23
|
+
action: ACTIONS.DECORATION_REMOVE
|
|
24
|
+
}));
|
|
25
|
+
return true;
|
|
36
26
|
}
|
|
37
27
|
return false;
|
|
38
28
|
};
|
|
@@ -2,7 +2,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
export const decorationStateKey = new PluginKey('decorationPlugin');
|
|
7
6
|
export let ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
8
7
|
ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
|
|
@@ -13,23 +12,14 @@ export const removeDecoration = (state, dispatch) => {
|
|
|
13
12
|
const {
|
|
14
13
|
tr
|
|
15
14
|
} = state;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
} else {
|
|
27
|
-
if (dispatch) {
|
|
28
|
-
dispatch(tr.setMeta(decorationStateKey, {
|
|
29
|
-
action: ACTIONS.DECORATION_REMOVE
|
|
30
|
-
}));
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
15
|
+
const {
|
|
16
|
+
decoration
|
|
17
|
+
} = decorationStateKey.getState(state);
|
|
18
|
+
if (decoration && dispatch) {
|
|
19
|
+
dispatch(tr.setMeta(decorationStateKey, {
|
|
20
|
+
action: ACTIONS.DECORATION_REMOVE
|
|
21
|
+
}));
|
|
22
|
+
return true;
|
|
33
23
|
}
|
|
34
24
|
return false;
|
|
35
25
|
};
|
|
@@ -2,7 +2,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
export var decorationStateKey = new PluginKey('decorationPlugin');
|
|
7
6
|
export var ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
8
7
|
ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
|
|
@@ -11,22 +10,13 @@ export var ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
|
11
10
|
}({});
|
|
12
11
|
export var removeDecoration = function removeDecoration(state, dispatch) {
|
|
13
12
|
var tr = state.tr;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
if (dispatch) {
|
|
25
|
-
dispatch(tr.setMeta(decorationStateKey, {
|
|
26
|
-
action: ACTIONS.DECORATION_REMOVE
|
|
27
|
-
}));
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
13
|
+
var _ref = decorationStateKey.getState(state),
|
|
14
|
+
decoration = _ref.decoration;
|
|
15
|
+
if (decoration && dispatch) {
|
|
16
|
+
dispatch(tr.setMeta(decorationStateKey, {
|
|
17
|
+
action: ACTIONS.DECORATION_REMOVE
|
|
18
|
+
}));
|
|
19
|
+
return true;
|
|
30
20
|
}
|
|
31
21
|
return false;
|
|
32
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-decorations",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Decorations plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Editor: Lego",
|
|
12
|
-
"singleton": true
|
|
13
|
-
"runReact18": true
|
|
12
|
+
"singleton": true
|
|
14
13
|
},
|
|
15
14
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
16
15
|
"main": "dist/cjs/index.js",
|
|
@@ -23,17 +22,17 @@
|
|
|
23
22
|
".": "./src/index.ts"
|
|
24
23
|
},
|
|
25
24
|
"dependencies": {
|
|
26
|
-
"@atlaskit/editor-common": "^107.0.0",
|
|
27
25
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
28
26
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
29
27
|
"@babel/runtime": "^7.0.0"
|
|
30
28
|
},
|
|
31
29
|
"peerDependencies": {
|
|
30
|
+
"@atlaskit/editor-common": "^107.6.0",
|
|
32
31
|
"react": "^18.2.0",
|
|
33
32
|
"react-dom": "^18.2.0"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@atlaskit/editor-plugin-mentions": "^
|
|
35
|
+
"@atlaskit/editor-plugin-mentions": "^5.0.0",
|
|
37
36
|
"@testing-library/react": "^13.4.0",
|
|
38
37
|
"typescript": "~5.4.2",
|
|
39
38
|
"wait-for-expect": "^1.2.0"
|
|
@@ -70,10 +69,5 @@
|
|
|
70
69
|
"emotion"
|
|
71
70
|
]
|
|
72
71
|
}
|
|
73
|
-
},
|
|
74
|
-
"platform-feature-flags": {
|
|
75
|
-
"platform_editor_remove_slow_table_transactions": {
|
|
76
|
-
"type": "boolean"
|
|
77
|
-
}
|
|
78
72
|
}
|
|
79
73
|
}
|