@atlaskit/editor-plugin-paste-options-toolbar 7.0.4 → 7.0.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,20 @@
1
1
  # @atlaskit/editor-plugin-paste-options-toolbar
2
2
 
3
+ ## 7.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`840338033507a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/840338033507a) -
8
+ Migrating custom icons behind feature flag.
9
+
10
+ ## 7.0.5
11
+
12
+ ### Patch Changes
13
+
14
+ - [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
15
+ tsignores added for help-center local consumpton removed
16
+ - Updated dependencies
17
+
3
18
  ## 7.0.4
4
19
 
5
20
  ### Patch Changes
@@ -25,30 +25,20 @@ function createPlugin(dispatch) {
25
25
  richTextSlice: _model.Slice.empty,
26
26
  selectedOption: _types.ToolbarDropdownOption.None
27
27
  }),
28
- // @ts-ignore - Workaround for help-center local consumption
29
28
  view: function view(editorView) {
30
29
  return {
31
- // @ts-ignore - Workaround for help-center local consumption
32
30
  update: function update(view, prevState) {
33
31
  return prevState;
34
32
  }
35
33
  };
36
34
  },
37
35
  props: {
38
- // @ts-ignore - Workaround for help-center local consumption
39
-
40
36
  handleDOMEvents: {
41
37
  // Hide toolbar when clicked outside the editor
42
- // @ts-ignore - Workaround for help-center local consumption
43
-
44
38
  blur: _commands.checkAndHideToolbar,
45
39
  // Hide toolbar when clicked anywhere within the editor, tr.getMeta('pointer') does not work if clicked on the same line after pasting so relying on mousedown event
46
- // @ts-ignore - Workaround for help-center local consumption
47
-
48
40
  mousedown: _commands.checkAndHideToolbar
49
41
  },
50
- // @ts-ignore - Workaround for help-center local consumption
51
-
52
42
  handleKeyDown: function handleKeyDown(view) {
53
43
  (0, _commands.checkAndHideToolbar)(view);
54
44
  return false;
@@ -8,6 +8,8 @@ exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _icon = _interopRequireDefault(require("@atlaskit/icon"));
11
+ var _clipboard = _interopRequireDefault(require("@atlaskit/icon/core/clipboard"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
13
  //Using a custom icon for now since Design System Team is in the process of updating the icon set for project griffin.
12
14
 
13
15
  var CustomGlyph = function CustomGlyph(props) {
@@ -19,7 +21,9 @@ var CustomGlyph = function CustomGlyph(props) {
19
21
  xmlns: "http://www.w3.org/2000/svg"
20
22
  // Ignored via go/ees005
21
23
  // eslint-disable-next-line react/jsx-props-no-spreading
22
- }, props), /*#__PURE__*/_react.default.createElement("path", {
24
+ }, props, {
25
+ color: "orange"
26
+ }), /*#__PURE__*/_react.default.createElement("path", {
23
27
  fillRule: "evenodd",
24
28
  clipRule: "evenodd",
25
29
  d: "M14.8293 4C14.4175 2.83481 13.3062 2 12 2C10.6938 2 9.58254 2.83481 9.17071 4H9H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V6C20 4.89543 19.1046 4 18 4H15H14.8293ZM6 6H8V7C8 7.55228 8.44772 8 9 8H15C15.5523 8 16 7.55228 16 7V6H18V18H6V6ZM12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z",
@@ -44,9 +48,13 @@ var CustomGlyph = function CustomGlyph(props) {
44
48
  // Ignored via go/ees005
45
49
  // eslint-disable-next-line react/jsx-props-no-spreading
46
50
  var EditorPasteIcon = function EditorPasteIcon(props) {
47
- return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({}, props, {
51
+ if ((0, _platformFeatureFlags.fg)('platform-custom-icon-migration')) {
52
+ // eslint-disable-next-line react/jsx-props-no-spreading
53
+ return /*#__PURE__*/_react.default.createElement(_clipboard.default, props);
54
+ }
55
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({}, props, {
48
56
  glyph: CustomGlyph
49
- }));
57
+ })));
50
58
  };
51
59
  EditorPasteIcon.displayName = 'EditorPasteIcon';
52
60
  var _default = exports.default = EditorPasteIcon;
@@ -19,32 +19,20 @@ export function createPlugin(dispatch) {
19
19
  richTextSlice: Slice.empty,
20
20
  selectedOption: ToolbarDropdownOption.None
21
21
  }),
22
- // @ts-ignore - Workaround for help-center local consumption
23
-
24
22
  view(editorView) {
25
23
  return {
26
- // @ts-ignore - Workaround for help-center local consumption
27
-
28
24
  update(view, prevState) {
29
25
  return prevState;
30
26
  }
31
27
  };
32
28
  },
33
29
  props: {
34
- // @ts-ignore - Workaround for help-center local consumption
35
-
36
30
  handleDOMEvents: {
37
31
  // Hide toolbar when clicked outside the editor
38
- // @ts-ignore - Workaround for help-center local consumption
39
-
40
32
  blur: checkAndHideToolbar,
41
33
  // Hide toolbar when clicked anywhere within the editor, tr.getMeta('pointer') does not work if clicked on the same line after pasting so relying on mousedown event
42
- // @ts-ignore - Workaround for help-center local consumption
43
-
44
34
  mousedown: checkAndHideToolbar
45
35
  },
46
- // @ts-ignore - Workaround for help-center local consumption
47
-
48
36
  handleKeyDown: view => {
49
37
  checkAndHideToolbar(view);
50
38
  return false;
@@ -3,6 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
 
4
4
  import React from 'react';
5
5
  import Icon from '@atlaskit/icon';
6
+ import ClipboardIcon from '@atlaskit/icon/core/clipboard';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
6
8
  const CustomGlyph = props => /*#__PURE__*/React.createElement("svg", _extends({
7
9
  width: "24",
8
10
  height: "24",
@@ -11,7 +13,9 @@ const CustomGlyph = props => /*#__PURE__*/React.createElement("svg", _extends({
11
13
  xmlns: "http://www.w3.org/2000/svg"
12
14
  // Ignored via go/ees005
13
15
  // eslint-disable-next-line react/jsx-props-no-spreading
14
- }, props), /*#__PURE__*/React.createElement("path", {
16
+ }, props, {
17
+ color: "orange"
18
+ }), /*#__PURE__*/React.createElement("path", {
15
19
  fillRule: "evenodd",
16
20
  clipRule: "evenodd",
17
21
  d: "M14.8293 4C14.4175 2.83481 13.3062 2 12 2C10.6938 2 9.58254 2.83481 9.17071 4H9H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V6C20 4.89543 19.1046 4 18 4H15H14.8293ZM6 6H8V7C8 7.55228 8.44772 8 9 8H15C15.5523 8 16 7.55228 16 7V6H18V18H6V6ZM12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z",
@@ -34,8 +38,14 @@ const CustomGlyph = props => /*#__PURE__*/React.createElement("svg", _extends({
34
38
 
35
39
  // Ignored via go/ees005
36
40
  // eslint-disable-next-line react/jsx-props-no-spreading
37
- const EditorPasteIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
38
- glyph: CustomGlyph
39
- }));
41
+ const EditorPasteIcon = props => {
42
+ if (fg('platform-custom-icon-migration')) {
43
+ // eslint-disable-next-line react/jsx-props-no-spreading
44
+ return /*#__PURE__*/React.createElement(ClipboardIcon, props);
45
+ }
46
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
47
+ glyph: CustomGlyph
48
+ })));
49
+ };
40
50
  EditorPasteIcon.displayName = 'EditorPasteIcon';
41
51
  export default EditorPasteIcon;
@@ -19,30 +19,20 @@ export function createPlugin(dispatch) {
19
19
  richTextSlice: Slice.empty,
20
20
  selectedOption: ToolbarDropdownOption.None
21
21
  }),
22
- // @ts-ignore - Workaround for help-center local consumption
23
22
  view: function view(editorView) {
24
23
  return {
25
- // @ts-ignore - Workaround for help-center local consumption
26
24
  update: function update(view, prevState) {
27
25
  return prevState;
28
26
  }
29
27
  };
30
28
  },
31
29
  props: {
32
- // @ts-ignore - Workaround for help-center local consumption
33
-
34
30
  handleDOMEvents: {
35
31
  // Hide toolbar when clicked outside the editor
36
- // @ts-ignore - Workaround for help-center local consumption
37
-
38
32
  blur: checkAndHideToolbar,
39
33
  // Hide toolbar when clicked anywhere within the editor, tr.getMeta('pointer') does not work if clicked on the same line after pasting so relying on mousedown event
40
- // @ts-ignore - Workaround for help-center local consumption
41
-
42
34
  mousedown: checkAndHideToolbar
43
35
  },
44
- // @ts-ignore - Workaround for help-center local consumption
45
-
46
36
  handleKeyDown: function handleKeyDown(view) {
47
37
  checkAndHideToolbar(view);
48
38
  return false;
@@ -3,6 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
 
4
4
  import React from 'react';
5
5
  import Icon from '@atlaskit/icon';
6
+ import ClipboardIcon from '@atlaskit/icon/core/clipboard';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
6
8
  var CustomGlyph = function CustomGlyph(props) {
7
9
  return /*#__PURE__*/React.createElement("svg", _extends({
8
10
  width: "24",
@@ -12,7 +14,9 @@ var CustomGlyph = function CustomGlyph(props) {
12
14
  xmlns: "http://www.w3.org/2000/svg"
13
15
  // Ignored via go/ees005
14
16
  // eslint-disable-next-line react/jsx-props-no-spreading
15
- }, props), /*#__PURE__*/React.createElement("path", {
17
+ }, props, {
18
+ color: "orange"
19
+ }), /*#__PURE__*/React.createElement("path", {
16
20
  fillRule: "evenodd",
17
21
  clipRule: "evenodd",
18
22
  d: "M14.8293 4C14.4175 2.83481 13.3062 2 12 2C10.6938 2 9.58254 2.83481 9.17071 4H9H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V6C20 4.89543 19.1046 4 18 4H15H14.8293ZM6 6H8V7C8 7.55228 8.44772 8 9 8H15C15.5523 8 16 7.55228 16 7V6H18V18H6V6ZM12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z",
@@ -37,9 +41,13 @@ var CustomGlyph = function CustomGlyph(props) {
37
41
  // Ignored via go/ees005
38
42
  // eslint-disable-next-line react/jsx-props-no-spreading
39
43
  var EditorPasteIcon = function EditorPasteIcon(props) {
40
- return /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
44
+ if (fg('platform-custom-icon-migration')) {
45
+ // eslint-disable-next-line react/jsx-props-no-spreading
46
+ return /*#__PURE__*/React.createElement(ClipboardIcon, props);
47
+ }
48
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
41
49
  glyph: CustomGlyph
42
- }));
50
+ })));
43
51
  };
44
52
  EditorPasteIcon.displayName = 'EditorPasteIcon';
45
53
  export default EditorPasteIcon;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { type IconProps } from '@atlaskit/icon';
2
+ import { type IconProps, type NewCoreIconProps } from '@atlaskit/icon';
3
3
  declare const EditorPasteIcon: {
4
- (props: IconProps): React.JSX.Element;
4
+ (props: Omit<IconProps, "size"> & Omit<NewCoreIconProps, "size">): React.JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  export default EditorPasteIcon;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { type IconProps } from '@atlaskit/icon';
2
+ import { type IconProps, type NewCoreIconProps } from '@atlaskit/icon';
3
3
  declare const EditorPasteIcon: {
4
- (props: IconProps): React.JSX.Element;
4
+ (props: Omit<IconProps, "size"> & Omit<NewCoreIconProps, "size">): React.JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  export default EditorPasteIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste-options-toolbar",
3
- "version": "7.0.4",
3
+ "version": "7.0.6",
4
4
  "description": "Paste options toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,19 +35,17 @@
35
35
  "@atlaskit/editor-prosemirror": "7.0.0",
36
36
  "@atlaskit/editor-shared-styles": "^3.10.0",
37
37
  "@atlaskit/icon": "^29.0.0",
38
- "@atlaskit/tokens": "^8.3.0",
38
+ "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@emotion/react": "^11.7.1",
41
41
  "react-intl-next": "npm:react-intl@^5.18.1"
42
42
  },
43
43
  "peerDependencies": {
44
- "@atlaskit/editor-common": "^110.34.0",
44
+ "@atlaskit/editor-common": "^110.38.0",
45
45
  "react": "^18.2.0",
46
46
  "react-dom": "^18.2.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@af/visual-regression": "workspace:^",
50
- "@atlaskit/ssr": "workspace:^",
51
49
  "@testing-library/react": "^13.4.0",
52
50
  "wait-for-expect": "^1.2.0"
53
51
  },
@@ -91,5 +89,10 @@
91
89
  "stricter": [
92
90
  "@atlassian/tangerine/project-structure"
93
91
  ]
92
+ },
93
+ "platform-feature-flags": {
94
+ "platform-custom-icon-migration": {
95
+ "type": "boolean"
96
+ }
94
97
  }
95
98
  }