@atlaskit/editor-plugin-highlight 12.1.9 → 12.1.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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-highlight
|
|
2
2
|
|
|
3
|
+
## 12.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`283c55290e6cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/283c55290e6cc) -
|
|
8
|
+
Preserve visual selection after applying text color or highlight
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 12.1.9
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -6,10 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.changeColor = void 0;
|
|
7
7
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
8
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
9
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
9
10
|
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
11
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
12
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
11
13
|
var _main = require("../pm-plugins/main");
|
|
12
14
|
var _color = require("./color");
|
|
15
|
+
var maybeSyncSelectionAfterFormat = function maybeSyncSelectionAfterFormat(tr) {
|
|
16
|
+
if (tr.docChanged && (0, _expValEquals.expValEquals)('platform_editor_fix_selection_text_color_change', 'isEnabled', true)) {
|
|
17
|
+
tr.setMeta(_selection.FORMAT_SELECTION_SYNC_META, true);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
13
20
|
var changeColor = exports.changeColor = function changeColor(editorAnalyticsAPI) {
|
|
14
21
|
return function (_ref) {
|
|
15
22
|
var color = _ref.color,
|
|
@@ -37,6 +44,7 @@ var changeColor = exports.changeColor = function changeColor(editorAnalyticsAPI)
|
|
|
37
44
|
tr: tr
|
|
38
45
|
});
|
|
39
46
|
}
|
|
47
|
+
maybeSyncSelectionAfterFormat(tr);
|
|
40
48
|
return tr;
|
|
41
49
|
};
|
|
42
50
|
};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { removeMark, toggleMark } from '@atlaskit/editor-common/mark';
|
|
3
|
+
import { FORMAT_SELECTION_SYNC_META } from '@atlaskit/editor-common/selection';
|
|
3
4
|
import { REMOVE_HIGHLIGHT_COLOR, highlightColorPalette, highlightColorPaletteNew } from '@atlaskit/editor-common/ui-color';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
6
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
7
|
import { HighlightPluginAction, highlightPluginKey } from '../pm-plugins/main';
|
|
6
8
|
import { getActiveColor } from './color';
|
|
9
|
+
const maybeSyncSelectionAfterFormat = tr => {
|
|
10
|
+
if (tr.docChanged && expValEquals('platform_editor_fix_selection_text_color_change', 'isEnabled', true)) {
|
|
11
|
+
tr.setMeta(FORMAT_SELECTION_SYNC_META, true);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
7
14
|
export const changeColor = editorAnalyticsAPI => ({
|
|
8
15
|
color,
|
|
9
16
|
inputMethod
|
|
@@ -33,6 +40,7 @@ export const changeColor = editorAnalyticsAPI => ({
|
|
|
33
40
|
tr
|
|
34
41
|
});
|
|
35
42
|
}
|
|
43
|
+
maybeSyncSelectionAfterFormat(tr);
|
|
36
44
|
return tr;
|
|
37
45
|
};
|
|
38
46
|
const createAnalyticsEvent = (color, inputMethod, tr) => {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { removeMark, toggleMark } from '@atlaskit/editor-common/mark';
|
|
3
|
+
import { FORMAT_SELECTION_SYNC_META } from '@atlaskit/editor-common/selection';
|
|
3
4
|
import { REMOVE_HIGHLIGHT_COLOR, highlightColorPalette, highlightColorPaletteNew } from '@atlaskit/editor-common/ui-color';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
6
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
7
|
import { HighlightPluginAction, highlightPluginKey } from '../pm-plugins/main';
|
|
6
8
|
import { getActiveColor } from './color';
|
|
9
|
+
var maybeSyncSelectionAfterFormat = function maybeSyncSelectionAfterFormat(tr) {
|
|
10
|
+
if (tr.docChanged && expValEquals('platform_editor_fix_selection_text_color_change', 'isEnabled', true)) {
|
|
11
|
+
tr.setMeta(FORMAT_SELECTION_SYNC_META, true);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
7
14
|
export var changeColor = function changeColor(editorAnalyticsAPI) {
|
|
8
15
|
return function (_ref) {
|
|
9
16
|
var color = _ref.color,
|
|
@@ -31,6 +38,7 @@ export var changeColor = function changeColor(editorAnalyticsAPI) {
|
|
|
31
38
|
tr: tr
|
|
32
39
|
});
|
|
33
40
|
}
|
|
41
|
+
maybeSyncSelectionAfterFormat(tr);
|
|
34
42
|
return tr;
|
|
35
43
|
};
|
|
36
44
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-highlight",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.10",
|
|
4
4
|
"description": "Highlight plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
36
36
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
37
37
|
"@atlaskit/editor-tables": "^3.0.0",
|
|
38
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
39
|
-
"@atlaskit/editor-toolbar-model": "^1.
|
|
40
|
-
"@atlaskit/heading": "^6.
|
|
41
|
-
"@atlaskit/icon": "^36.
|
|
38
|
+
"@atlaskit/editor-toolbar": "^2.1.0",
|
|
39
|
+
"@atlaskit/editor-toolbar-model": "^1.1.0",
|
|
40
|
+
"@atlaskit/heading": "^6.1.0",
|
|
41
|
+
"@atlaskit/icon": "^36.1.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
43
|
-
"@atlaskit/primitives": "^20.
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^114.
|
|
45
|
-
"@atlaskit/tokens": "^15.
|
|
43
|
+
"@atlaskit/primitives": "^20.2.0",
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^114.6.0",
|
|
45
|
+
"@atlaskit/tokens": "^15.2.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@atlaskit/editor-common": "^116.
|
|
50
|
+
"@atlaskit/editor-common": "^116.17.0",
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
53
53
|
},
|