@atlaskit/editor-plugin-text-color 1.16.5 → 1.16.6

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,11 @@
1
1
  # @atlaskit/editor-plugin-text-color
2
2
 
3
+ ## 1.16.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 1.16.5
4
10
 
5
11
  ### Patch Changes
@@ -17,6 +17,8 @@ var _toggleColor = require("./toggle-color");
17
17
  * @param palette - Current palette of colors
18
18
  * @return Higher order command with analytics logic inside.
19
19
  */
20
+ // Ignored via go/ees005
21
+ // eslint-disable-next-line @typescript-eslint/max-params
20
22
  function createWithColorAnalytics(newColor, previousColor, palette, editorAnalyticsApi, inputMethod) {
21
23
  var newColorFromPalette = palette.find(function (_ref) {
22
24
  var value = _ref.value;
@@ -46,6 +46,8 @@ function createPlugin(dispatch, pluginConfig) {
46
46
  init: function init(_config, editorState) {
47
47
  return createInitialPluginState(editorState, pluginConfig);
48
48
  },
49
+ // Ignored via go/ees005
50
+ // eslint-disable-next-line @typescript-eslint/max-params
49
51
  apply: function apply(tr, pluginState, _, newState) {
50
52
  var meta = tr.getMeta(pluginKey) || {};
51
53
  var nextState;
@@ -9,6 +9,9 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _hooks = require("@atlaskit/editor-common/hooks");
10
10
  var _types = require("../types");
11
11
  var _ToolbarTextColor = _interopRequireDefault(require("./ToolbarTextColor"));
12
+ // Ignored via go/ees005
13
+ // eslint-disable-next-line import/no-named-as-default
14
+
12
15
  var FloatingToolbarSettings = {
13
16
  disabled: false,
14
17
  isReducedSpacing: true
@@ -19,7 +22,10 @@ function FloatingToolbarComponent(_ref) {
19
22
  dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
20
23
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['textColor']),
21
24
  textColorState = _useSharedPluginState.textColorState;
22
- return /*#__PURE__*/_react.default.createElement(_ToolbarTextColor.default, {
25
+ return /*#__PURE__*/_react.default.createElement(_ToolbarTextColor.default
26
+ // Ignored via go/ees005
27
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
+ , {
23
29
  pluginState: textColorState,
24
30
  isReducedSpacing: FloatingToolbarSettings.isReducedSpacing,
25
31
  editorView: editorView,
@@ -9,6 +9,9 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _hooks = require("@atlaskit/editor-common/hooks");
10
10
  var _types = require("../types");
11
11
  var _ToolbarTextColor = _interopRequireDefault(require("./ToolbarTextColor"));
12
+ // Ignored via go/ees005
13
+ // eslint-disable-next-line import/no-named-as-default
14
+
12
15
  function PrimaryToolbarComponent(_ref) {
13
16
  var api = _ref.api,
14
17
  isReducedSpacing = _ref.isReducedSpacing,
@@ -20,7 +23,10 @@ function PrimaryToolbarComponent(_ref) {
20
23
  disabled = _ref.disabled;
21
24
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['textColor']),
22
25
  textColorState = _useSharedPluginState.textColorState;
23
- return /*#__PURE__*/_react.default.createElement(_ToolbarTextColor.default, {
26
+ return /*#__PURE__*/_react.default.createElement(_ToolbarTextColor.default
27
+ // Ignored via go/ees005
28
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
29
+ , {
24
30
  pluginState: textColorState,
25
31
  isReducedSpacing: isReducedSpacing,
26
32
  editorView: editorView,
@@ -9,17 +9,24 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _base = _interopRequireDefault(require("@atlaskit/icon/base"));
11
11
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
12
+ // Ignored via go/ees005
13
+ // eslint-disable-next-line import/no-named-as-default
12
14
 
13
15
  var textColorGlyph = function textColorGlyph(props) {
14
- return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({}, props, {
15
- width: "24",
16
- height: "24",
17
- xmlns: "http://www.w3.org/2000/svg"
18
- }), /*#__PURE__*/_react.default.createElement("path", {
19
- d: "M14 12.5h-4l-.874 2.186A.5.5 0 0 1 8.66 15H7.273a.5.5 0 0 1-.456-.705l4.05-9A.5.5 0 0 1 11.323 5h1.354a.5.5 0 0 1 .456.295l4.05 9a.5.5 0 0 1-.456.705h-1.388a.5.5 0 0 1-.465-.314L14 12.5zm-.6-1.5L12 7.5 10.6 11h2.8z",
20
- fill: "currentColor",
21
- fillRule: "evenodd"
22
- }));
16
+ return (
17
+ /*#__PURE__*/
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line react/jsx-props-no-spreading
20
+ _react.default.createElement("svg", (0, _extends2.default)({}, props, {
21
+ width: "24",
22
+ height: "24",
23
+ xmlns: "http://www.w3.org/2000/svg"
24
+ }), /*#__PURE__*/_react.default.createElement("path", {
25
+ d: "M14 12.5h-4l-.874 2.186A.5.5 0 0 1 8.66 15H7.273a.5.5 0 0 1-.456-.705l4.05-9A.5.5 0 0 1 11.323 5h1.354a.5.5 0 0 1 .456.295l4.05 9a.5.5 0 0 1-.456.705h-1.388a.5.5 0 0 1-.465-.314L14 12.5zm-.6-1.5L12 7.5 10.6 11h2.8z",
26
+ fill: "currentColor",
27
+ fillRule: "evenodd"
28
+ }))
29
+ );
23
30
  };
24
31
  var EditorTextColorIcon = exports.EditorTextColorIcon = function EditorTextColorIcon() {
25
32
  return /*#__PURE__*/_react.default.createElement(_base.default, {
@@ -258,7 +258,10 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
258
258
  }, {
259
259
  key: "getSelectedColor",
260
260
  value: function getSelectedColor(pluginState) {
261
- var selectedColor = pluginState.color !== pluginState.defaultColor ? pluginState.color ? (0, _editorPalette.hexToEditorTextPaletteColor)(pluginState.color) : pluginState.color : null;
261
+ var selectedColor = pluginState.color !== pluginState.defaultColor ? pluginState.color ?
262
+ // Ignored via go/ees005
263
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
264
+ (0, _editorPalette.hexToEditorTextPaletteColor)(pluginState.color) : pluginState.color : null;
262
265
  return selectedColor;
263
266
  }
264
267
  }, {
@@ -12,6 +12,8 @@ import { toggleColor } from './toggle-color';
12
12
  * @param palette - Current palette of colors
13
13
  * @return Higher order command with analytics logic inside.
14
14
  */
15
+ // Ignored via go/ees005
16
+ // eslint-disable-next-line @typescript-eslint/max-params
15
17
  function createWithColorAnalytics(newColor, previousColor, palette, editorAnalyticsApi, inputMethod) {
16
18
  const newColorFromPalette = palette.find(({
17
19
  value
@@ -7,7 +7,7 @@ export const removeColor = () => (state, dispatch) => {
7
7
  const {
8
8
  textColor
9
9
  } = schema.marks;
10
- let tr = state.tr;
10
+ const tr = state.tr;
11
11
  removeMark(textColor)({
12
12
  tr
13
13
  });
@@ -6,7 +6,7 @@ export const toggleColor = color => (state, dispatch) => {
6
6
  const {
7
7
  textColor
8
8
  } = state.schema.marks;
9
- let tr = state.tr;
9
+ const tr = state.tr;
10
10
  const disabledState = getDisabledState(state);
11
11
  if (disabledState) {
12
12
  if (dispatch) {
@@ -33,6 +33,8 @@ export function createPlugin(dispatch, pluginConfig) {
33
33
  init(_config, editorState) {
34
34
  return createInitialPluginState(editorState, pluginConfig);
35
35
  },
36
+ // Ignored via go/ees005
37
+ // eslint-disable-next-line @typescript-eslint/max-params
36
38
  apply(tr, pluginState, _, newState) {
37
39
  const meta = tr.getMeta(pluginKey) || {};
38
40
  let nextState;
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
3
3
  import { ToolbarType } from '../types';
4
+
5
+ // Ignored via go/ees005
6
+ // eslint-disable-next-line import/no-named-as-default
4
7
  import ToolbarTextColor from './ToolbarTextColor';
5
8
  const FloatingToolbarSettings = {
6
9
  disabled: false,
@@ -14,7 +17,10 @@ export function FloatingToolbarComponent({
14
17
  const {
15
18
  textColorState
16
19
  } = useSharedPluginState(api, ['textColor']);
17
- return /*#__PURE__*/React.createElement(ToolbarTextColor, {
20
+ return /*#__PURE__*/React.createElement(ToolbarTextColor
21
+ // Ignored via go/ees005
22
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
23
+ , {
18
24
  pluginState: textColorState,
19
25
  isReducedSpacing: FloatingToolbarSettings.isReducedSpacing,
20
26
  editorView: editorView,
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
3
3
  import { ToolbarType } from '../types';
4
+
5
+ // Ignored via go/ees005
6
+ // eslint-disable-next-line import/no-named-as-default
4
7
  import ToolbarTextColor from './ToolbarTextColor';
5
8
  export function PrimaryToolbarComponent({
6
9
  api,
@@ -15,7 +18,10 @@ export function PrimaryToolbarComponent({
15
18
  const {
16
19
  textColorState
17
20
  } = useSharedPluginState(api, ['textColor']);
18
- return /*#__PURE__*/React.createElement(ToolbarTextColor, {
21
+ return /*#__PURE__*/React.createElement(ToolbarTextColor
22
+ // Ignored via go/ees005
23
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
24
+ , {
19
25
  pluginState: textColorState,
20
26
  isReducedSpacing: isReducedSpacing,
21
27
  editorView: editorView,
@@ -2,8 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
 
4
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
+ // Ignored via go/ees005
6
+ // eslint-disable-next-line import/no-named-as-default
5
7
  import Icon from '@atlaskit/icon/base';
6
- const textColorGlyph = props => /*#__PURE__*/React.createElement("svg", _extends({}, props, {
8
+ const textColorGlyph = props =>
9
+ /*#__PURE__*/
10
+ // Ignored via go/ees005
11
+ // eslint-disable-next-line react/jsx-props-no-spreading
12
+ React.createElement("svg", _extends({}, props, {
7
13
  width: "24",
8
14
  height: "24",
9
15
  xmlns: "http://www.w3.org/2000/svg"
@@ -239,7 +239,10 @@ export class ToolbarTextColor extends React.Component {
239
239
  );
240
240
  }
241
241
  getSelectedColor(pluginState) {
242
- const selectedColor = pluginState.color !== pluginState.defaultColor ? pluginState.color ? hexToEditorTextPaletteColor(pluginState.color) : pluginState.color : null;
242
+ const selectedColor = pluginState.color !== pluginState.defaultColor ? pluginState.color ?
243
+ // Ignored via go/ees005
244
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
245
+ hexToEditorTextPaletteColor(pluginState.color) : pluginState.color : null;
243
246
  return selectedColor;
244
247
  }
245
248
  getCommonAnalyticsAttributes() {
@@ -12,6 +12,8 @@ import { toggleColor } from './toggle-color';
12
12
  * @param palette - Current palette of colors
13
13
  * @return Higher order command with analytics logic inside.
14
14
  */
15
+ // Ignored via go/ees005
16
+ // eslint-disable-next-line @typescript-eslint/max-params
15
17
  function createWithColorAnalytics(newColor, previousColor, palette, editorAnalyticsApi, inputMethod) {
16
18
  var newColorFromPalette = palette.find(function (_ref) {
17
19
  var value = _ref.value;
@@ -37,6 +37,8 @@ export function createPlugin(dispatch, pluginConfig) {
37
37
  init: function init(_config, editorState) {
38
38
  return createInitialPluginState(editorState, pluginConfig);
39
39
  },
40
+ // Ignored via go/ees005
41
+ // eslint-disable-next-line @typescript-eslint/max-params
40
42
  apply: function apply(tr, pluginState, _, newState) {
41
43
  var meta = tr.getMeta(pluginKey) || {};
42
44
  var nextState;
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
3
3
  import { ToolbarType } from '../types';
4
+
5
+ // Ignored via go/ees005
6
+ // eslint-disable-next-line import/no-named-as-default
4
7
  import ToolbarTextColor from './ToolbarTextColor';
5
8
  var FloatingToolbarSettings = {
6
9
  disabled: false,
@@ -12,7 +15,10 @@ export function FloatingToolbarComponent(_ref) {
12
15
  dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
13
16
  var _useSharedPluginState = useSharedPluginState(api, ['textColor']),
14
17
  textColorState = _useSharedPluginState.textColorState;
15
- return /*#__PURE__*/React.createElement(ToolbarTextColor, {
18
+ return /*#__PURE__*/React.createElement(ToolbarTextColor
19
+ // Ignored via go/ees005
20
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
21
+ , {
16
22
  pluginState: textColorState,
17
23
  isReducedSpacing: FloatingToolbarSettings.isReducedSpacing,
18
24
  editorView: editorView,
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
3
3
  import { ToolbarType } from '../types';
4
+
5
+ // Ignored via go/ees005
6
+ // eslint-disable-next-line import/no-named-as-default
4
7
  import ToolbarTextColor from './ToolbarTextColor';
5
8
  export function PrimaryToolbarComponent(_ref) {
6
9
  var api = _ref.api,
@@ -13,7 +16,10 @@ export function PrimaryToolbarComponent(_ref) {
13
16
  disabled = _ref.disabled;
14
17
  var _useSharedPluginState = useSharedPluginState(api, ['textColor']),
15
18
  textColorState = _useSharedPluginState.textColorState;
16
- return /*#__PURE__*/React.createElement(ToolbarTextColor, {
19
+ return /*#__PURE__*/React.createElement(ToolbarTextColor
20
+ // Ignored via go/ees005
21
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
22
+ , {
17
23
  pluginState: textColorState,
18
24
  isReducedSpacing: isReducedSpacing,
19
25
  editorView: editorView,
@@ -2,17 +2,24 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
 
4
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
+ // Ignored via go/ees005
6
+ // eslint-disable-next-line import/no-named-as-default
5
7
  import Icon from '@atlaskit/icon/base';
6
8
  var textColorGlyph = function textColorGlyph(props) {
7
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
8
- width: "24",
9
- height: "24",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- }), /*#__PURE__*/React.createElement("path", {
12
- d: "M14 12.5h-4l-.874 2.186A.5.5 0 0 1 8.66 15H7.273a.5.5 0 0 1-.456-.705l4.05-9A.5.5 0 0 1 11.323 5h1.354a.5.5 0 0 1 .456.295l4.05 9a.5.5 0 0 1-.456.705h-1.388a.5.5 0 0 1-.465-.314L14 12.5zm-.6-1.5L12 7.5 10.6 11h2.8z",
13
- fill: "currentColor",
14
- fillRule: "evenodd"
15
- }));
9
+ return (
10
+ /*#__PURE__*/
11
+ // Ignored via go/ees005
12
+ // eslint-disable-next-line react/jsx-props-no-spreading
13
+ React.createElement("svg", _extends({}, props, {
14
+ width: "24",
15
+ height: "24",
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }), /*#__PURE__*/React.createElement("path", {
18
+ d: "M14 12.5h-4l-.874 2.186A.5.5 0 0 1 8.66 15H7.273a.5.5 0 0 1-.456-.705l4.05-9A.5.5 0 0 1 11.323 5h1.354a.5.5 0 0 1 .456.295l4.05 9a.5.5 0 0 1-.456.705h-1.388a.5.5 0 0 1-.465-.314L14 12.5zm-.6-1.5L12 7.5 10.6 11h2.8z",
19
+ fill: "currentColor",
20
+ fillRule: "evenodd"
21
+ }))
22
+ );
16
23
  };
17
24
  export var EditorTextColorIcon = function EditorTextColorIcon() {
18
25
  return /*#__PURE__*/React.createElement(Icon, {
@@ -254,7 +254,10 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
254
254
  }, {
255
255
  key: "getSelectedColor",
256
256
  value: function getSelectedColor(pluginState) {
257
- var selectedColor = pluginState.color !== pluginState.defaultColor ? pluginState.color ? hexToEditorTextPaletteColor(pluginState.color) : pluginState.color : null;
257
+ var selectedColor = pluginState.color !== pluginState.defaultColor ? pluginState.color ?
258
+ // Ignored via go/ees005
259
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
260
+ hexToEditorTextPaletteColor(pluginState.color) : pluginState.color : null;
258
261
  return selectedColor;
259
262
  }
260
263
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-color",
3
- "version": "1.16.5",
3
+ "version": "1.16.6",
4
4
  "description": "Text color plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^97.0.0",
35
+ "@atlaskit/editor-common": "^98.0.0",
36
36
  "@atlaskit/editor-palette": "1.6.3",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^2.1.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/icon": "^23.1.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
44
  "@atlaskit/theme": "^14.0.0",
45
- "@atlaskit/tmp-editor-statsig": "^2.29.0",
45
+ "@atlaskit/tmp-editor-statsig": "^2.31.0",
46
46
  "@atlaskit/tokens": "^2.5.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@emotion/react": "^11.7.1"