@atlaskit/editor-plugin-decorations 8.0.9 → 8.0.10
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 +8 -0
- package/dist/cjs/decorationsPlugin.js +3 -3
- package/dist/cjs/pm-plugins/commands.js +2 -2
- package/dist/cjs/pm-plugins/main.js +3 -2
- package/dist/es2019/decorationsPlugin.js +3 -3
- package/dist/es2019/pm-plugins/commands.js +2 -2
- package/dist/es2019/pm-plugins/main.js +3 -2
- package/dist/esm/decorationsPlugin.js +3 -3
- package/dist/esm/pm-plugins/commands.js +2 -2
- package/dist/esm/pm-plugins/main.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-decorations
|
|
2
2
|
|
|
3
|
+
## 8.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9ed32aea2c1d3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ed32aea2c1d3) -
|
|
8
|
+
Replace feature experiment util with cross platform alternative for platform_editor_block_menu
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 8.0.9
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.decorationsPlugin = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
9
9
|
var _commands = require("./pm-plugins/commands");
|
|
10
10
|
var _main = _interopRequireWildcard(require("./pm-plugins/main"));
|
|
11
11
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -37,7 +37,7 @@ var decorationsPlugin = exports.decorationsPlugin = function decorationsPlugin()
|
|
|
37
37
|
return _main.decorationStateKey.getState(editorState);
|
|
38
38
|
},
|
|
39
39
|
commands: {
|
|
40
|
-
hoverDecoration: (0,
|
|
40
|
+
hoverDecoration: (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? function (_ref) {
|
|
41
41
|
var add = _ref.add,
|
|
42
42
|
className = _ref.className;
|
|
43
43
|
return (0, _commands.hoverDecorationCommand)({
|
|
@@ -45,7 +45,7 @@ var decorationsPlugin = exports.decorationsPlugin = function decorationsPlugin()
|
|
|
45
45
|
className: className
|
|
46
46
|
});
|
|
47
47
|
} : undefined,
|
|
48
|
-
removeDecoration: (0,
|
|
48
|
+
removeDecoration: (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? function () {
|
|
49
49
|
return (0, _commands.removeDecorationCommand)();
|
|
50
50
|
} : undefined
|
|
51
51
|
}
|
|
@@ -9,7 +9,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
9
9
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
10
10
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
11
11
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
12
|
-
var
|
|
12
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
13
|
var _main = require("./main");
|
|
14
14
|
var hoverDecorationCommand = exports.hoverDecorationCommand = function hoverDecorationCommand(_ref) {
|
|
15
15
|
var add = _ref.add,
|
|
@@ -96,7 +96,7 @@ var hoverDecorationCommand = exports.hoverDecorationCommand = function hoverDeco
|
|
|
96
96
|
tr.setMeta(_main.decorationStateKey, {
|
|
97
97
|
action: add ? _main.ACTIONS.DECORATION_ADD : _main.ACTIONS.DECORATION_REMOVE,
|
|
98
98
|
data: _view.DecorationSet.create(tr.doc, decorations),
|
|
99
|
-
hasDangerDecorations: (0,
|
|
99
|
+
hasDangerDecorations: (0, _experiments.editorExperiment)('platform_editor_block_menu', true) && hasDangerDecorations
|
|
100
100
|
}).setMeta('addToHistory', false);
|
|
101
101
|
return tr;
|
|
102
102
|
};
|
|
@@ -9,6 +9,7 @@ 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
11
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
12
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
13
|
var decorationStateKey = exports.decorationStateKey = new _state.PluginKey('decorationPlugin');
|
|
13
14
|
var ACTIONS = exports.ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
14
15
|
ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
|
|
@@ -90,7 +91,7 @@ var _default = exports.default = function _default() {
|
|
|
90
91
|
};
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
if (pluginState.decoration && pluginState.decoration instanceof _view.DecorationSet && (0,
|
|
94
|
+
if (pluginState.decoration && pluginState.decoration instanceof _view.DecorationSet && (0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
|
|
94
95
|
pluginState.decoration = pluginState.decoration.map(tr.mapping, tr.doc);
|
|
95
96
|
}
|
|
96
97
|
var meta = tr.getMeta(decorationStateKey);
|
|
@@ -121,7 +122,7 @@ var _default = exports.default = function _default() {
|
|
|
121
122
|
if (decoration instanceof _view.Decoration) {
|
|
122
123
|
return _view.DecorationSet.create(doc, [decoration]);
|
|
123
124
|
}
|
|
124
|
-
if (decoration instanceof _view.DecorationSet && (0,
|
|
125
|
+
if (decoration instanceof _view.DecorationSet && (0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
|
|
125
126
|
return decoration;
|
|
126
127
|
}
|
|
127
128
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
2
|
import { hoverDecorationCommand, removeDecorationCommand } from './pm-plugins/commands';
|
|
3
3
|
import decorationPlugin, { decorationStateKey, hoverDecoration, removeDecoration } from './pm-plugins/main';
|
|
4
4
|
|
|
@@ -27,13 +27,13 @@ export const decorationsPlugin = () => ({
|
|
|
27
27
|
return decorationStateKey.getState(editorState);
|
|
28
28
|
},
|
|
29
29
|
commands: {
|
|
30
|
-
hoverDecoration:
|
|
30
|
+
hoverDecoration: editorExperiment('platform_editor_block_menu', true) ? ({
|
|
31
31
|
add,
|
|
32
32
|
className
|
|
33
33
|
}) => hoverDecorationCommand({
|
|
34
34
|
add,
|
|
35
35
|
className
|
|
36
36
|
}) : undefined,
|
|
37
|
-
removeDecoration:
|
|
37
|
+
removeDecoration: editorExperiment('platform_editor_block_menu', true) ? () => removeDecorationCommand() : undefined
|
|
38
38
|
}
|
|
39
39
|
});
|
|
@@ -3,7 +3,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
3
3
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import { CellSelection, TableMap } from '@atlaskit/editor-tables';
|
|
5
5
|
import { findTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import {
|
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
7
|
import { ACTIONS, decorationStateKey } from './main';
|
|
8
8
|
export const hoverDecorationCommand = ({
|
|
9
9
|
add,
|
|
@@ -89,7 +89,7 @@ export const hoverDecorationCommand = ({
|
|
|
89
89
|
tr.setMeta(decorationStateKey, {
|
|
90
90
|
action: add ? ACTIONS.DECORATION_ADD : ACTIONS.DECORATION_REMOVE,
|
|
91
91
|
data: DecorationSet.create(tr.doc, decorations),
|
|
92
|
-
hasDangerDecorations:
|
|
92
|
+
hasDangerDecorations: editorExperiment('platform_editor_block_menu', true) && hasDangerDecorations
|
|
93
93
|
}).setMeta('addToHistory', false);
|
|
94
94
|
return tr;
|
|
95
95
|
};
|
|
@@ -3,6 +3,7 @@ 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
5
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
7
|
export const decorationStateKey = new PluginKey('decorationPlugin');
|
|
7
8
|
export let ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
8
9
|
ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
|
|
@@ -82,7 +83,7 @@ export default (() => {
|
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
if (pluginState.decoration && pluginState.decoration instanceof DecorationSet &&
|
|
86
|
+
if (pluginState.decoration && pluginState.decoration instanceof DecorationSet && editorExperiment('platform_editor_block_menu', true)) {
|
|
86
87
|
pluginState.decoration = pluginState.decoration.map(tr.mapping, tr.doc);
|
|
87
88
|
}
|
|
88
89
|
const meta = tr.getMeta(decorationStateKey);
|
|
@@ -116,7 +117,7 @@ export default (() => {
|
|
|
116
117
|
if (decoration instanceof Decoration) {
|
|
117
118
|
return DecorationSet.create(doc, [decoration]);
|
|
118
119
|
}
|
|
119
|
-
if (decoration instanceof DecorationSet &&
|
|
120
|
+
if (decoration instanceof DecorationSet && editorExperiment('platform_editor_block_menu', true)) {
|
|
120
121
|
return decoration;
|
|
121
122
|
}
|
|
122
123
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
2
|
import { hoverDecorationCommand, removeDecorationCommand } from './pm-plugins/commands';
|
|
3
3
|
import decorationPlugin, { decorationStateKey, hoverDecoration, removeDecoration } from './pm-plugins/main';
|
|
4
4
|
|
|
@@ -30,7 +30,7 @@ export var decorationsPlugin = function decorationsPlugin() {
|
|
|
30
30
|
return decorationStateKey.getState(editorState);
|
|
31
31
|
},
|
|
32
32
|
commands: {
|
|
33
|
-
hoverDecoration:
|
|
33
|
+
hoverDecoration: editorExperiment('platform_editor_block_menu', true) ? function (_ref) {
|
|
34
34
|
var add = _ref.add,
|
|
35
35
|
className = _ref.className;
|
|
36
36
|
return hoverDecorationCommand({
|
|
@@ -38,7 +38,7 @@ export var decorationsPlugin = function decorationsPlugin() {
|
|
|
38
38
|
className: className
|
|
39
39
|
});
|
|
40
40
|
} : undefined,
|
|
41
|
-
removeDecoration:
|
|
41
|
+
removeDecoration: editorExperiment('platform_editor_block_menu', true) ? function () {
|
|
42
42
|
return removeDecorationCommand();
|
|
43
43
|
} : undefined
|
|
44
44
|
}
|
|
@@ -3,7 +3,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
3
3
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import { CellSelection, TableMap } from '@atlaskit/editor-tables';
|
|
5
5
|
import { findTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import {
|
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
7
|
import { ACTIONS, decorationStateKey } from './main';
|
|
8
8
|
export var hoverDecorationCommand = function hoverDecorationCommand(_ref) {
|
|
9
9
|
var add = _ref.add,
|
|
@@ -90,7 +90,7 @@ export var hoverDecorationCommand = function hoverDecorationCommand(_ref) {
|
|
|
90
90
|
tr.setMeta(decorationStateKey, {
|
|
91
91
|
action: add ? ACTIONS.DECORATION_ADD : ACTIONS.DECORATION_REMOVE,
|
|
92
92
|
data: DecorationSet.create(tr.doc, decorations),
|
|
93
|
-
hasDangerDecorations:
|
|
93
|
+
hasDangerDecorations: editorExperiment('platform_editor_block_menu', true) && hasDangerDecorations
|
|
94
94
|
}).setMeta('addToHistory', false);
|
|
95
95
|
return tr;
|
|
96
96
|
};
|
|
@@ -3,6 +3,7 @@ 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
5
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
7
|
export var decorationStateKey = new PluginKey('decorationPlugin');
|
|
7
8
|
export var ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
8
9
|
ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
|
|
@@ -84,7 +85,7 @@ export default (function () {
|
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
if (pluginState.decoration && pluginState.decoration instanceof DecorationSet &&
|
|
88
|
+
if (pluginState.decoration && pluginState.decoration instanceof DecorationSet && editorExperiment('platform_editor_block_menu', true)) {
|
|
88
89
|
pluginState.decoration = pluginState.decoration.map(tr.mapping, tr.doc);
|
|
89
90
|
}
|
|
90
91
|
var meta = tr.getMeta(decorationStateKey);
|
|
@@ -115,7 +116,7 @@ export default (function () {
|
|
|
115
116
|
if (decoration instanceof Decoration) {
|
|
116
117
|
return DecorationSet.create(doc, [decoration]);
|
|
117
118
|
}
|
|
118
|
-
if (decoration instanceof DecorationSet &&
|
|
119
|
+
if (decoration instanceof DecorationSet && editorExperiment('platform_editor_block_menu', true)) {
|
|
119
120
|
return decoration;
|
|
120
121
|
}
|
|
121
122
|
return null;
|