@atlaskit/editor-plugin-text-color 1.5.0 → 1.7.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,30 @@
1
1
  # @atlaskit/editor-plugin-text-color
2
2
 
3
+ ## 1.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#114156](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114156)
8
+ [`bc6a63af2d1d0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc6a63af2d1d0) -
9
+ Bump adf-schema to 37.0.0 and adf-schema-json to 1.16.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.6.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#110884](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110884)
20
+ [`674f78166705c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/674f78166705c) -
21
+ [ux] [ED-23516] Change border color for highlight and text-color palettes to use tokens.
22
+ Changedefault palette color when undefined
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 1.5.0
4
29
 
5
30
  ### 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),
@@ -29,7 +29,7 @@ var _icon = require("./icon");
29
29
  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; }
30
30
  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; }
31
31
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
32
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
32
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
33
33
  var EXPERIMENT_NAME = 'editor.toolbarTextColor.moreColors';
34
34
  var EXPERIMENT_GROUP_CONTROL = 'control';
35
35
  // eslint-disable-next-line @repo/internal/react/no-class-components
@@ -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),
@@ -1,6 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
3
  import React from 'react';
4
+
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
6
  import { jsx } from '@emotion/react';
5
7
  import { injectIntl } from 'react-intl-next';
6
8
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
@@ -146,7 +148,7 @@ export class ToolbarTextColor extends React.Component {
146
148
  selectedColumnIndex
147
149
  } = getSelectedRowAndColumnFromPalette(palette, pluginState.color);
148
150
  return (
149
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
151
+ // 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
152
  jsx("span", {
151
153
  css: wrapperStyle
152
154
  }, jsx(Dropdown, {
@@ -179,7 +181,7 @@ export class ToolbarTextColor extends React.Component {
179
181
  onKeyDown: this.onKeyDown,
180
182
  ref: this.toolbarItemRef,
181
183
  iconBefore:
182
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
184
+ // 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
185
  jsx("div", {
184
186
  css: triggerWrapperStyles
185
187
  }, jsx(SteppedRainbowIconDecoration, {
@@ -206,6 +208,7 @@ export class ToolbarTextColor extends React.Component {
206
208
  paletteColorTooltipMessages: textPaletteTooltipMessages
207
209
  }
208
210
  }))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
211
+ // 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
212
  jsx("span", {
210
213
  css: separatorStyles
211
214
  }))
@@ -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),
@@ -11,6 +11,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
11
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  /** @jsx jsx */
13
13
  import React from 'react';
14
+
15
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
16
  import { jsx } from '@emotion/react';
15
17
  import { injectIntl } from 'react-intl-next';
16
18
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
@@ -161,7 +163,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
161
163
  selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
162
164
  selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
163
165
  return (
164
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
166
+ // 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
167
  jsx("span", {
166
168
  css: wrapperStyle
167
169
  }, jsx(Dropdown, {
@@ -194,7 +196,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
194
196
  onKeyDown: this.onKeyDown,
195
197
  ref: this.toolbarItemRef,
196
198
  iconBefore:
197
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
199
+ // 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
200
  jsx("div", {
199
201
  css: triggerWrapperStyles
200
202
  }, jsx(SteppedRainbowIconDecoration, {
@@ -221,6 +223,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
221
223
  paletteColorTooltipMessages: textPaletteTooltipMessages
222
224
  }
223
225
  }))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
226
+ // 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
227
  jsx("span", {
225
228
  css: separatorStyles
226
229
  }))
package/package.json CHANGED
@@ -1,95 +1,102 @@
1
1
  {
2
- "name": "@atlaskit/editor-plugin-text-color",
3
- "version": "1.5.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
- "*": [
25
- "dist/types-ts4.5/*",
26
- "dist/types-ts4.5/index.d.ts"
27
- ]
28
- }
29
- },
30
- "sideEffects": false,
31
- "atlaskit:src": "src/index.ts",
32
- "af:exports": {
33
- ".": "./src/index.ts"
34
- },
35
- "dependencies": {
36
- "@atlaskit/adf-schema": "^36.10.7",
37
- "@atlaskit/editor-common": "^82.1.0",
38
- "@atlaskit/editor-palette": "1.6.0",
39
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
40
- "@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
41
- "@atlaskit/editor-prosemirror": "4.0.1",
42
- "@atlaskit/editor-shared-styles": "^2.12.0",
43
- "@atlaskit/editor-tables": "^2.7.0",
44
- "@atlaskit/icon": "^22.3.0",
45
- "@atlaskit/theme": "^12.9.0",
46
- "@babel/runtime": "^7.0.0",
47
- "@emotion/react": "^11.7.1"
48
- },
49
- "peerDependencies": {
50
- "react": "^16.8.0",
51
- "react-intl-next": "npm:react-intl@^5.18.1"
52
- },
53
- "devDependencies": {
54
- "@af/visual-regression": "*",
55
- "@atlaskit/ssr": "*",
56
- "@atlaskit/visual-regression": "*",
57
- "@testing-library/react": "^12.1.5",
58
- "react-dom": "^16.8.0",
59
- "typescript": "~5.4.2",
60
- "wait-for-expect": "^1.2.0"
61
- },
62
- "techstack": {
63
- "@atlassian/frontend": {
64
- "import-structure": [
65
- "atlassian-conventions"
66
- ],
67
- "circular-dependencies": [
68
- "file-and-folder-level"
69
- ]
70
- },
71
- "@repo/internal": {
72
- "dom-events": "use-bind-event-listener",
73
- "analytics": [
74
- "analytics-next"
75
- ],
76
- "design-tokens": [
77
- "color"
78
- ],
79
- "theming": [
80
- "react-context"
81
- ],
82
- "ui-components": [
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.7.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
+ "*": [
25
+ "dist/types-ts4.5/*",
26
+ "dist/types-ts4.5/index.d.ts"
27
+ ]
28
+ }
29
+ },
30
+ "sideEffects": false,
31
+ "atlaskit:src": "src/index.ts",
32
+ "af:exports": {
33
+ ".": "./src/index.ts"
34
+ },
35
+ "dependencies": {
36
+ "@atlaskit/adf-schema": "^37.0.0",
37
+ "@atlaskit/editor-common": "^82.12.0",
38
+ "@atlaskit/editor-palette": "1.6.0",
39
+ "@atlaskit/editor-plugin-analytics": "^1.3.0",
40
+ "@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
41
+ "@atlaskit/editor-prosemirror": "4.0.1",
42
+ "@atlaskit/editor-shared-styles": "^2.12.0",
43
+ "@atlaskit/editor-tables": "^2.7.0",
44
+ "@atlaskit/icon": "^22.4.0",
45
+ "@atlaskit/platform-feature-flags": "^0.2.0",
46
+ "@atlaskit/theme": "^12.11.0",
47
+ "@atlaskit/tokens": "^1.53.0",
48
+ "@babel/runtime": "^7.0.0",
49
+ "@emotion/react": "^11.7.1"
50
+ },
51
+ "peerDependencies": {
52
+ "react": "^16.8.0",
53
+ "react-intl-next": "npm:react-intl@^5.18.1"
54
+ },
55
+ "devDependencies": {
56
+ "@af/visual-regression": "*",
57
+ "@atlaskit/ssr": "*",
58
+ "@atlaskit/visual-regression": "*",
59
+ "@testing-library/react": "^12.1.5",
60
+ "react-dom": "^16.8.0",
61
+ "typescript": "~5.4.2",
62
+ "wait-for-expect": "^1.2.0"
63
+ },
64
+ "techstack": {
65
+ "@atlassian/frontend": {
66
+ "import-structure": [
67
+ "atlassian-conventions"
68
+ ],
69
+ "circular-dependencies": [
70
+ "file-and-folder-level"
71
+ ]
72
+ },
73
+ "@repo/internal": {
74
+ "dom-events": "use-bind-event-listener",
75
+ "analytics": [
76
+ "analytics-next"
77
+ ],
78
+ "design-tokens": [
79
+ "color"
80
+ ],
81
+ "theming": [
82
+ "react-context"
83
+ ],
84
+ "ui-components": [
85
+ "lite-mode"
86
+ ],
87
+ "deprecation": "no-deprecated-imports",
88
+ "styling": [
89
+ "emotion",
90
+ "emotion"
91
+ ],
92
+ "imports": [
93
+ "import-no-extraneous-disable-for-examples-and-docs"
94
+ ]
95
+ }
96
+ },
97
+ "platform-feature-flags": {
98
+ "platform.editor.dynamic-palette-borders": {
99
+ "type": "boolean"
100
+ }
101
+ }
102
+ }