@atlaskit/editor-plugin-text-color 1.5.0 → 1.6.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 +13 -0
- package/dist/cjs/pm-plugins/main.js +3 -2
- package/dist/cjs/ui/ToolbarTextColor/index.js +3 -2
- package/dist/es2019/pm-plugins/main.js +4 -3
- package/dist/es2019/ui/ToolbarTextColor/index.js +3 -2
- package/dist/esm/pm-plugins/main.js +4 -3
- package/dist/esm/ui/ToolbarTextColor/index.js +3 -2
- package/package.json +81 -94
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-color
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#110884](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110884)
|
|
8
|
+
[`674f78166705c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/674f78166705c) -
|
|
9
|
+
[ux] [ED-23516] Change border color for highlight and text-color palettes to use tokens.
|
|
10
|
+
Changedefault palette color when undefined
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 1.5.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -18,6 +18,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
18
18
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
19
19
|
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
20
20
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
22
|
var _color = require("../utils/color");
|
|
22
23
|
var _constants = require("../utils/constants");
|
|
23
24
|
var _disabled = require("../utils/disabled");
|
|
@@ -28,8 +29,8 @@ function createInitialPluginState(editorState, pluginConfig) {
|
|
|
28
29
|
var palette = [{
|
|
29
30
|
value: defaultColor.color,
|
|
30
31
|
label: defaultColor.label,
|
|
31
|
-
border: _uiColor.DEFAULT_BORDER_COLOR
|
|
32
|
-
}].concat((0, _toConsumableArray2.default)(_uiColor.textColorPalette));
|
|
32
|
+
border: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.dynamic-palette-borders') ? "var(--ds-border, #091E4224)" : _uiColor.DEFAULT_BORDER_COLOR
|
|
33
|
+
}].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.getBooleanFF)('platform.editor.dynamic-palette-borders') ? _uiColor.textColorPaletteWithTokenBorders : _uiColor.textColorPalette));
|
|
33
34
|
var state = {
|
|
34
35
|
color: (0, _color.getActiveColor)(editorState),
|
|
35
36
|
disabled: (0, _disabled.getDisabledState)(editorState),
|
|
@@ -167,7 +167,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
167
167
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
168
168
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
169
169
|
return (
|
|
170
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
170
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
171
171
|
(0, _react2.jsx)("span", {
|
|
172
172
|
css: _styles.wrapperStyle
|
|
173
173
|
}, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
@@ -200,7 +200,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
200
200
|
onKeyDown: this.onKeyDown,
|
|
201
201
|
ref: this.toolbarItemRef,
|
|
202
202
|
iconBefore:
|
|
203
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
203
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
204
204
|
(0, _react2.jsx)("div", {
|
|
205
205
|
css: _styles.triggerWrapperStyles
|
|
206
206
|
}, (0, _react2.jsx)(_icons.SteppedRainbowIconDecoration, {
|
|
@@ -227,6 +227,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
227
227
|
paletteColorTooltipMessages: _uiColor.textPaletteTooltipMessages
|
|
228
228
|
}
|
|
229
229
|
}))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
230
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
230
231
|
(0, _react2.jsx)("span", {
|
|
231
232
|
css: _styles.separatorStyles
|
|
232
233
|
}))
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { DEFAULT_BORDER_COLOR, textColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
2
|
+
import { DEFAULT_BORDER_COLOR, textColorPalette, textColorPaletteWithTokenBorders } from '@atlaskit/editor-common/ui-color';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { getActiveColor } from '../utils/color';
|
|
5
6
|
import { DEFAULT_COLOR } from '../utils/constants';
|
|
6
7
|
import { getDisabledState } from '../utils/disabled';
|
|
@@ -10,8 +11,8 @@ function createInitialPluginState(editorState, pluginConfig) {
|
|
|
10
11
|
const palette = [{
|
|
11
12
|
value: defaultColor.color,
|
|
12
13
|
label: defaultColor.label,
|
|
13
|
-
border: DEFAULT_BORDER_COLOR
|
|
14
|
-
}, ...textColorPalette];
|
|
14
|
+
border: getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-border, #091E4224)" : DEFAULT_BORDER_COLOR
|
|
15
|
+
}, ...(getBooleanFF('platform.editor.dynamic-palette-borders') ? textColorPaletteWithTokenBorders : textColorPalette)];
|
|
15
16
|
const state = {
|
|
16
17
|
color: getActiveColor(editorState),
|
|
17
18
|
disabled: getDisabledState(editorState),
|
|
@@ -146,7 +146,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
146
146
|
selectedColumnIndex
|
|
147
147
|
} = getSelectedRowAndColumnFromPalette(palette, pluginState.color);
|
|
148
148
|
return (
|
|
149
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
149
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
150
150
|
jsx("span", {
|
|
151
151
|
css: wrapperStyle
|
|
152
152
|
}, jsx(Dropdown, {
|
|
@@ -179,7 +179,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
179
179
|
onKeyDown: this.onKeyDown,
|
|
180
180
|
ref: this.toolbarItemRef,
|
|
181
181
|
iconBefore:
|
|
182
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
182
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
183
183
|
jsx("div", {
|
|
184
184
|
css: triggerWrapperStyles
|
|
185
185
|
}, jsx(SteppedRainbowIconDecoration, {
|
|
@@ -206,6 +206,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
206
206
|
paletteColorTooltipMessages: textPaletteTooltipMessages
|
|
207
207
|
}
|
|
208
208
|
}))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
209
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
209
210
|
jsx("span", {
|
|
210
211
|
css: separatorStyles
|
|
211
212
|
}))
|
|
@@ -3,8 +3,9 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
-
import { DEFAULT_BORDER_COLOR, textColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
6
|
+
import { DEFAULT_BORDER_COLOR, textColorPalette, textColorPaletteWithTokenBorders } from '@atlaskit/editor-common/ui-color';
|
|
7
7
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { getActiveColor } from '../utils/color';
|
|
9
10
|
import { DEFAULT_COLOR } from '../utils/constants';
|
|
10
11
|
import { getDisabledState } from '../utils/disabled';
|
|
@@ -14,8 +15,8 @@ function createInitialPluginState(editorState, pluginConfig) {
|
|
|
14
15
|
var palette = [{
|
|
15
16
|
value: defaultColor.color,
|
|
16
17
|
label: defaultColor.label,
|
|
17
|
-
border: DEFAULT_BORDER_COLOR
|
|
18
|
-
}].concat(_toConsumableArray(textColorPalette));
|
|
18
|
+
border: getBooleanFF('platform.editor.dynamic-palette-borders') ? "var(--ds-border, #091E4224)" : DEFAULT_BORDER_COLOR
|
|
19
|
+
}].concat(_toConsumableArray(getBooleanFF('platform.editor.dynamic-palette-borders') ? textColorPaletteWithTokenBorders : textColorPalette));
|
|
19
20
|
var state = {
|
|
20
21
|
color: getActiveColor(editorState),
|
|
21
22
|
disabled: getDisabledState(editorState),
|
|
@@ -161,7 +161,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
161
161
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
162
162
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
163
163
|
return (
|
|
164
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
164
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
165
165
|
jsx("span", {
|
|
166
166
|
css: wrapperStyle
|
|
167
167
|
}, jsx(Dropdown, {
|
|
@@ -194,7 +194,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
194
194
|
onKeyDown: this.onKeyDown,
|
|
195
195
|
ref: this.toolbarItemRef,
|
|
196
196
|
iconBefore:
|
|
197
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
197
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
198
198
|
jsx("div", {
|
|
199
199
|
css: triggerWrapperStyles
|
|
200
200
|
}, jsx(SteppedRainbowIconDecoration, {
|
|
@@ -221,6 +221,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
221
221
|
paletteColorTooltipMessages: textPaletteTooltipMessages
|
|
222
222
|
}
|
|
223
223
|
}))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
224
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
224
225
|
jsx("span", {
|
|
225
226
|
css: separatorStyles
|
|
226
227
|
}))
|
package/package.json
CHANGED
|
@@ -1,95 +1,82 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"lite-mode"
|
|
84
|
-
],
|
|
85
|
-
"deprecation": "no-deprecated-imports",
|
|
86
|
-
"styling": [
|
|
87
|
-
"emotion",
|
|
88
|
-
"emotion"
|
|
89
|
-
],
|
|
90
|
-
"imports": [
|
|
91
|
-
"import-no-extraneous-disable-for-examples-and-docs"
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
2
|
+
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"atlassian": {
|
|
11
|
+
"team": "Editor: Lego",
|
|
12
|
+
"singleton": true,
|
|
13
|
+
"inPublicMirror": false,
|
|
14
|
+
"releaseModel": "continuous",
|
|
15
|
+
"runReact18": false
|
|
16
|
+
},
|
|
17
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
18
|
+
"main": "dist/cjs/index.js",
|
|
19
|
+
"module": "dist/esm/index.js",
|
|
20
|
+
"module:es2019": "dist/es2019/index.js",
|
|
21
|
+
"types": "dist/types/index.d.ts",
|
|
22
|
+
"typesVersions": {
|
|
23
|
+
">=4.5 <4.9": {
|
|
24
|
+
"*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"atlaskit:src": "src/index.ts",
|
|
29
|
+
"af:exports": {
|
|
30
|
+
".": "./src/index.ts"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@atlaskit/adf-schema": "^36.10.7",
|
|
34
|
+
"@atlaskit/editor-common": "^82.6.0",
|
|
35
|
+
"@atlaskit/editor-palette": "1.6.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
37
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
|
|
38
|
+
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
39
|
+
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
40
|
+
"@atlaskit/editor-tables": "^2.7.0",
|
|
41
|
+
"@atlaskit/icon": "^22.3.0",
|
|
42
|
+
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
43
|
+
"@atlaskit/theme": "^12.9.0",
|
|
44
|
+
"@atlaskit/tokens": "^1.50.0",
|
|
45
|
+
"@babel/runtime": "^7.0.0",
|
|
46
|
+
"@emotion/react": "^11.7.1"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^16.8.0",
|
|
50
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@af/visual-regression": "*",
|
|
54
|
+
"@atlaskit/ssr": "*",
|
|
55
|
+
"@atlaskit/visual-regression": "*",
|
|
56
|
+
"@testing-library/react": "^12.1.5",
|
|
57
|
+
"react-dom": "^16.8.0",
|
|
58
|
+
"typescript": "~5.4.2",
|
|
59
|
+
"wait-for-expect": "^1.2.0"
|
|
60
|
+
},
|
|
61
|
+
"techstack": {
|
|
62
|
+
"@atlassian/frontend": {
|
|
63
|
+
"import-structure": ["atlassian-conventions"],
|
|
64
|
+
"circular-dependencies": ["file-and-folder-level"]
|
|
65
|
+
},
|
|
66
|
+
"@repo/internal": {
|
|
67
|
+
"dom-events": "use-bind-event-listener",
|
|
68
|
+
"analytics": ["analytics-next"],
|
|
69
|
+
"design-tokens": ["color"],
|
|
70
|
+
"theming": ["react-context"],
|
|
71
|
+
"ui-components": ["lite-mode"],
|
|
72
|
+
"deprecation": "no-deprecated-imports",
|
|
73
|
+
"styling": ["emotion", "emotion"],
|
|
74
|
+
"imports": ["import-no-extraneous-disable-for-examples-and-docs"]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"platform-feature-flags": {
|
|
78
|
+
"platform.editor.dynamic-palette-borders": {
|
|
79
|
+
"type": "boolean"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|