@atlaskit/editor-plugin-text-color 16.1.4 → 16.1.5
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 +6 -0
- package/dist/cjs/pm-plugins/utils/color-contrast.js +3 -3
- package/dist/cjs/textColorPlugin.js +2 -2
- package/dist/es2019/pm-plugins/utils/color-contrast.js +1 -1
- package/dist/es2019/textColorPlugin.js +1 -1
- package/dist/esm/pm-plugins/utils/color-contrast.js +1 -1
- package/dist/esm/textColorPlugin.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getContrastRatio = getContrastRatio;
|
|
7
|
-
var
|
|
7
|
+
var _isHex = require("@atlaskit/adf-schema/is-hex");
|
|
8
8
|
// from platform/packages/design-system/tokens/src/utils/get-contrast-ratio.tsx
|
|
9
9
|
|
|
10
10
|
function hexToRgb(hex) {
|
|
11
|
-
if (!(0,
|
|
11
|
+
if (!(0, _isHex.isHex)(hex)) {
|
|
12
12
|
throw new Error('Invalid HEX');
|
|
13
13
|
}
|
|
14
14
|
var colorParts = hex.substring(1).split('');
|
|
@@ -26,7 +26,7 @@ function relativeLuminanceW3C(r, g, b) {
|
|
|
26
26
|
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
27
27
|
}
|
|
28
28
|
function getContrastRatio(foreground, background) {
|
|
29
|
-
if (!(0,
|
|
29
|
+
if (!(0, _isHex.isHex)(foreground) || !(0, _isHex.isHex)(background)) {
|
|
30
30
|
throw new Error('Invalid HEX');
|
|
31
31
|
}
|
|
32
32
|
var foregroundRgb = hexToRgb(foreground);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.textColorPlugin = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _textColor = require("@atlaskit/adf-schema/text-color");
|
|
10
10
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
11
11
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
12
|
var _changeColor2 = require("./editor-commands/change-color");
|
|
@@ -69,7 +69,7 @@ var textColorPlugin = exports.textColorPlugin = function textColorPlugin(_ref) {
|
|
|
69
69
|
marks: function marks() {
|
|
70
70
|
return [{
|
|
71
71
|
name: 'textColor',
|
|
72
|
-
mark:
|
|
72
|
+
mark: _textColor.textColor
|
|
73
73
|
}];
|
|
74
74
|
},
|
|
75
75
|
pmPlugins: function pmPlugins() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { textColor } from '@atlaskit/adf-schema';
|
|
2
|
+
import { textColor } from '@atlaskit/adf-schema/text-color';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import { changeColor as changeColorCommand } from './editor-commands/change-color';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { textColor } from '@atlaskit/adf-schema';
|
|
2
|
+
import { textColor } from '@atlaskit/adf-schema/text-color';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import { changeColor as changeColorCommand } from './editor-commands/change-color';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.5",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
44
44
|
"@atlaskit/primitives": "^22.5.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^173.0.0",
|
|
46
46
|
"@atlaskit/tokens": "^16.11.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@emotion/react": "^11.7.1"
|