@atlaskit/editor-plugin-highlight 12.1.10 → 12.1.12

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,20 @@
1
1
  # @atlaskit/editor-plugin-highlight
2
2
 
3
+ ## 12.1.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2c2c8bf9e0f13`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2c2c8bf9e0f13) -
8
+ [EDITOR-7929] move the colors schema change behind a different experiment that can be rolled out
9
+ for graceful rendering
10
+ - Updated dependencies
11
+
12
+ ## 12.1.11
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 12.1.10
4
19
 
5
20
  ### Patch Changes
@@ -23,6 +23,7 @@ var changeColor = exports.changeColor = function changeColor(editorAnalyticsAPI)
23
23
  inputMethod = _ref.inputMethod;
24
24
  return function (_ref2) {
25
25
  var tr = _ref2.tr;
26
+ var marks = tr.doc.type.schema.marks;
26
27
  var backgroundColor = tr.doc.type.schema.marks.backgroundColor;
27
28
  if (!backgroundColor) {
28
29
  return null;
@@ -34,6 +35,16 @@ var changeColor = exports.changeColor = function changeColor(editorAnalyticsAPI)
34
35
  tr: tr
35
36
  });
36
37
  } else {
38
+ if ((0, _expValEquals.expValEquals)('platform_editor_lovability_color_schema_change', 'isEnabled', true) && !(0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
39
+ var overrideMarks = ['textColor'];
40
+ overrideMarks.forEach(function (mark) {
41
+ if (marks[mark]) {
42
+ (0, _mark.removeMark)(marks[mark])({
43
+ tr: tr
44
+ });
45
+ }
46
+ });
47
+ }
37
48
  tr.setMeta(_main.highlightPluginKey, {
38
49
  type: _main.HighlightPluginAction.CHANGE_COLOR,
39
50
  color: color
@@ -58,7 +58,7 @@ var highlightPlugin = exports.highlightPlugin = function highlightPlugin(_ref) {
58
58
  return {
59
59
  name: 'highlight',
60
60
  marks: function marks() {
61
- if ((0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
61
+ if ((0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) || (0, _expValEquals.expValEquals)('platform_editor_lovability_color_schema_change', 'isEnabled', true)) {
62
62
  return [{
63
63
  name: 'backgroundColor',
64
64
  mark: _adfSchema.backgroundColor
@@ -17,6 +17,9 @@ export const changeColor = editorAnalyticsAPI => ({
17
17
  }) => ({
18
18
  tr
19
19
  }) => {
20
+ const {
21
+ marks
22
+ } = tr.doc.type.schema;
20
23
  const {
21
24
  backgroundColor
22
25
  } = tr.doc.type.schema.marks;
@@ -30,6 +33,16 @@ export const changeColor = editorAnalyticsAPI => ({
30
33
  tr
31
34
  });
32
35
  } else {
36
+ if (expValEquals('platform_editor_lovability_color_schema_change', 'isEnabled', true) && !expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
37
+ const overrideMarks = ['textColor'];
38
+ overrideMarks.forEach(mark => {
39
+ if (marks[mark]) {
40
+ removeMark(marks[mark])({
41
+ tr
42
+ });
43
+ }
44
+ });
45
+ }
33
46
  tr.setMeta(highlightPluginKey, {
34
47
  type: HighlightPluginAction.CHANGE_COLOR,
35
48
  color
@@ -50,7 +50,7 @@ export const highlightPlugin = ({
50
50
  return {
51
51
  name: 'highlight',
52
52
  marks() {
53
- if (expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
53
+ if (expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) || expValEquals('platform_editor_lovability_color_schema_change', 'isEnabled', true)) {
54
54
  return [{
55
55
  name: 'backgroundColor',
56
56
  mark: backgroundColor
@@ -17,6 +17,7 @@ export var changeColor = function changeColor(editorAnalyticsAPI) {
17
17
  inputMethod = _ref.inputMethod;
18
18
  return function (_ref2) {
19
19
  var tr = _ref2.tr;
20
+ var marks = tr.doc.type.schema.marks;
20
21
  var backgroundColor = tr.doc.type.schema.marks.backgroundColor;
21
22
  if (!backgroundColor) {
22
23
  return null;
@@ -28,6 +29,16 @@ export var changeColor = function changeColor(editorAnalyticsAPI) {
28
29
  tr: tr
29
30
  });
30
31
  } else {
32
+ if (expValEquals('platform_editor_lovability_color_schema_change', 'isEnabled', true) && !expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
33
+ var overrideMarks = ['textColor'];
34
+ overrideMarks.forEach(function (mark) {
35
+ if (marks[mark]) {
36
+ removeMark(marks[mark])({
37
+ tr: tr
38
+ });
39
+ }
40
+ });
41
+ }
31
42
  tr.setMeta(highlightPluginKey, {
32
43
  type: HighlightPluginAction.CHANGE_COLOR,
33
44
  color: color
@@ -51,7 +51,7 @@ export var highlightPlugin = function highlightPlugin(_ref) {
51
51
  return {
52
52
  name: 'highlight',
53
53
  marks: function marks() {
54
- if (expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
54
+ if (expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) || expValEquals('platform_editor_lovability_color_schema_change', 'isEnabled', true)) {
55
55
  return [{
56
56
  name: 'backgroundColor',
57
57
  mark: backgroundColor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-highlight",
3
- "version": "12.1.10",
3
+ "version": "12.1.12",
4
4
  "description": "Highlight plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/icon": "^36.1.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.0.0",
43
43
  "@atlaskit/primitives": "^20.2.0",
44
- "@atlaskit/tmp-editor-statsig": "^114.6.0",
44
+ "@atlaskit/tmp-editor-statsig": "^115.1.0",
45
45
  "@atlaskit/tokens": "^15.2.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@emotion/react": "^11.7.1"