@atlaskit/editor-plugin-highlight 16.0.17 → 17.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
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-highlight
|
|
2
2
|
|
|
3
|
+
## 17.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fb891566dfac2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fb891566dfac2) -
|
|
8
|
+
Add anyMarksActiveFromTr and getHadMarkAttributes so mark-active checks can run from a
|
|
9
|
+
transaction. Color, highlight, toolbar/Cmd+K link apply, and paste events include had-mark
|
|
10
|
+
attributes behind kill switch platform_editor_add_text_color_tracking.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 16.0.18
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 16.0.17
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.changeColor = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
10
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
9
11
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
@@ -13,6 +15,8 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
|
13
15
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
14
16
|
var _main = require("../pm-plugins/main");
|
|
15
17
|
var _color = require("./color");
|
|
18
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
20
|
var maybeSyncSelectionAfterFormat = function maybeSyncSelectionAfterFormat(tr) {
|
|
17
21
|
if (tr.docChanged && (0, _expValEquals.expValEquals)('platform_editor_fix_selection_text_color_change', 'isEnabled', true)) {
|
|
18
22
|
tr.setMeta(_selection.FORMAT_SELECTION_SYNC_META, true);
|
|
@@ -77,15 +81,18 @@ var createAnalyticsEvent = function createAnalyticsEvent(color, inputMethod, tr)
|
|
|
77
81
|
});
|
|
78
82
|
var newColorLabel = newColorFromPalette ? newColorFromPalette.label : color;
|
|
79
83
|
var previousColorLabel = previousColorFromPalette ? previousColorFromPalette.label : previousColor;
|
|
84
|
+
var _tr$doc$type$schema$m = tr.doc.type.schema.marks,
|
|
85
|
+
textColor = _tr$doc$type$schema$m.textColor,
|
|
86
|
+
link = _tr$doc$type$schema$m.link;
|
|
80
87
|
return {
|
|
81
88
|
action: _analytics.ACTION.FORMATTED,
|
|
82
89
|
actionSubject: _analytics.ACTION_SUBJECT.TEXT,
|
|
83
90
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR,
|
|
84
91
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
85
|
-
attributes: {
|
|
92
|
+
attributes: _objectSpread({
|
|
86
93
|
newColor: newColorLabel.toLowerCase(),
|
|
87
94
|
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : '',
|
|
88
95
|
inputMethod: inputMethod
|
|
89
|
-
}
|
|
96
|
+
}, color === _uiColor.REMOVE_HIGHLIGHT_COLOR ? {} : (0, _mark.getHadMarkAttributes)(tr, [textColor, link]))
|
|
90
97
|
};
|
|
91
98
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { removeMark, toggleMark } from '@atlaskit/editor-common/mark';
|
|
2
|
+
import { getHadMarkAttributes, removeMark, toggleMark } from '@atlaskit/editor-common/mark';
|
|
3
3
|
import { FORMAT_SELECTION_SYNC_META } from '@atlaskit/editor-common/selection';
|
|
4
4
|
import { REMOVE_HIGHLIGHT_COLOR, highlightColorPalette, highlightColorPaletteNew } from '@atlaskit/editor-common/ui-color';
|
|
5
5
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -71,6 +71,10 @@ const createAnalyticsEvent = (color, inputMethod, tr) => {
|
|
|
71
71
|
}) => value === previousColor);
|
|
72
72
|
const newColorLabel = newColorFromPalette ? newColorFromPalette.label : color;
|
|
73
73
|
const previousColorLabel = previousColorFromPalette ? previousColorFromPalette.label : previousColor;
|
|
74
|
+
const {
|
|
75
|
+
textColor,
|
|
76
|
+
link
|
|
77
|
+
} = tr.doc.type.schema.marks;
|
|
74
78
|
return {
|
|
75
79
|
action: ACTION.FORMATTED,
|
|
76
80
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
@@ -79,7 +83,8 @@ const createAnalyticsEvent = (color, inputMethod, tr) => {
|
|
|
79
83
|
attributes: {
|
|
80
84
|
newColor: newColorLabel.toLowerCase(),
|
|
81
85
|
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : '',
|
|
82
|
-
inputMethod
|
|
86
|
+
inputMethod,
|
|
87
|
+
...(color === REMOVE_HIGHLIGHT_COLOR ? {} : getHadMarkAttributes(tr, [textColor, link]))
|
|
83
88
|
}
|
|
84
89
|
};
|
|
85
90
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { removeMark, toggleMark } from '@atlaskit/editor-common/mark';
|
|
5
|
+
import { getHadMarkAttributes, removeMark, toggleMark } from '@atlaskit/editor-common/mark';
|
|
3
6
|
import { FORMAT_SELECTION_SYNC_META } from '@atlaskit/editor-common/selection';
|
|
4
7
|
import { REMOVE_HIGHLIGHT_COLOR, highlightColorPalette, highlightColorPaletteNew } from '@atlaskit/editor-common/ui-color';
|
|
5
8
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -71,15 +74,18 @@ var createAnalyticsEvent = function createAnalyticsEvent(color, inputMethod, tr)
|
|
|
71
74
|
});
|
|
72
75
|
var newColorLabel = newColorFromPalette ? newColorFromPalette.label : color;
|
|
73
76
|
var previousColorLabel = previousColorFromPalette ? previousColorFromPalette.label : previousColor;
|
|
77
|
+
var _tr$doc$type$schema$m = tr.doc.type.schema.marks,
|
|
78
|
+
textColor = _tr$doc$type$schema$m.textColor,
|
|
79
|
+
link = _tr$doc$type$schema$m.link;
|
|
74
80
|
return {
|
|
75
81
|
action: ACTION.FORMATTED,
|
|
76
82
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
77
83
|
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR,
|
|
78
84
|
eventType: EVENT_TYPE.TRACK,
|
|
79
|
-
attributes: {
|
|
85
|
+
attributes: _objectSpread({
|
|
80
86
|
newColor: newColorLabel.toLowerCase(),
|
|
81
87
|
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : '',
|
|
82
88
|
inputMethod: inputMethod
|
|
83
|
-
}
|
|
89
|
+
}, color === REMOVE_HIGHLIGHT_COLOR ? {} : getHadMarkAttributes(tr, [textColor, link]))
|
|
84
90
|
};
|
|
85
91
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-highlight",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.0",
|
|
4
4
|
"description": "Highlight plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
],
|
|
25
25
|
"atlaskit:src": "src/index.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/adf-schema": "^57.
|
|
27
|
+
"@atlaskit/adf-schema": "^57.4.0",
|
|
28
28
|
"@atlaskit/css": "^1.1.0",
|
|
29
29
|
"@atlaskit/editor-palette": "^3.5.0",
|
|
30
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
31
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^
|
|
32
|
-
"@atlaskit/editor-plugin-selection-toolbar": "^
|
|
33
|
-
"@atlaskit/editor-plugin-text-formatting": "^
|
|
34
|
-
"@atlaskit/editor-plugin-toolbar": "^
|
|
30
|
+
"@atlaskit/editor-plugin-analytics": "^17.0.0",
|
|
31
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^18.0.0",
|
|
32
|
+
"@atlaskit/editor-plugin-selection-toolbar": "^18.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-text-formatting": "^17.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-toolbar": "^14.0.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
36
36
|
"@atlaskit/editor-shared-styles": "^4.1.0",
|
|
37
37
|
"@atlaskit/editor-tables": "^3.1.0",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
44
44
|
"@atlaskit/primitives": "^22.5.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^179.0.0",
|
|
46
46
|
"@atlaskit/tokens": "^16.11.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@emotion/react": "^11.7.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atlaskit/editor-common": "^
|
|
51
|
+
"@atlaskit/editor-common": "^121.0.0",
|
|
52
52
|
"react": "^18.2.0 || ^19.2.0",
|
|
53
53
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
54
54
|
},
|