@atlaskit/editor-plugin-paste-options-toolbar 9.1.2 → 9.1.3

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,13 @@
1
1
  # @atlaskit/editor-plugin-paste-options-toolbar
2
2
 
3
+ ## 9.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0fe3de6aa5e9c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fe3de6aa5e9c) -
8
+ [ux] EDITOR-5978 Add additional buttons and update thresholds for Editor AI paste actions. Only
9
+ show existing paste actions if pasting greater than 100 characters.
10
+
3
11
  ## 9.1.2
4
12
 
5
13
  ### Patch Changes
@@ -99,6 +99,7 @@ var PasteActionsMenu = exports.PasteActionsMenu = function PasteActionsMenu(_ref
99
99
  lastContentPasted = _useSharedPluginState.lastContentPasted;
100
100
  var prevShowToolbarRef = (0, _react.useRef)(false);
101
101
  (0, _react.useEffect)(function () {
102
+ var _lastContentPasted$te, _lastContentPasted$te2;
102
103
  if (!lastContentPasted) {
103
104
  (0, _commands.hideToolbar)()(editorView.state, editorView.dispatch);
104
105
  return;
@@ -116,7 +117,7 @@ var PasteActionsMenu = exports.PasteActionsMenu = function PasteActionsMenu(_ref
116
117
  for (var depth = $pos.depth; depth > 0; depth--) {
117
118
  pasteAncestorNodeNames.push($pos.node(depth).type.name);
118
119
  }
119
- var legacyVisible = (0, _toolbar2.isToolbarVisible)(editorView.state, lastContentPasted);
120
+ var legacyVisible = (0, _toolbar2.isToolbarVisible)(editorView.state, lastContentPasted) && ((_lastContentPasted$te = (_lastContentPasted$te2 = lastContentPasted.text) === null || _lastContentPasted$te2 === void 0 ? void 0 : _lastContentPasted$te2.length) !== null && _lastContentPasted$te !== void 0 ? _lastContentPasted$te : 0) >= 100;
120
121
  (0, _commands.showToolbar)(lastContentPasted, selectedOption, legacyVisible, pasteAncestorNodeNames)(editorView.state, editorView.dispatch);
121
122
  }, [lastContentPasted, editorView]);
122
123
  var _useSharedPluginState2 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['pasteOptionsToolbarPlugin'], function (states) {
@@ -89,6 +89,7 @@ export const PasteActionsMenu = ({
89
89
  });
90
90
  const prevShowToolbarRef = useRef(false);
91
91
  useEffect(() => {
92
+ var _lastContentPasted$te, _lastContentPasted$te2;
92
93
  if (!lastContentPasted) {
93
94
  hideToolbar()(editorView.state, editorView.dispatch);
94
95
  return;
@@ -106,7 +107,7 @@ export const PasteActionsMenu = ({
106
107
  for (let depth = $pos.depth; depth > 0; depth--) {
107
108
  pasteAncestorNodeNames.push($pos.node(depth).type.name);
108
109
  }
109
- const legacyVisible = isToolbarVisible(editorView.state, lastContentPasted);
110
+ const legacyVisible = isToolbarVisible(editorView.state, lastContentPasted) && ((_lastContentPasted$te = (_lastContentPasted$te2 = lastContentPasted.text) === null || _lastContentPasted$te2 === void 0 ? void 0 : _lastContentPasted$te2.length) !== null && _lastContentPasted$te !== void 0 ? _lastContentPasted$te : 0) >= 100;
110
111
  showToolbar(lastContentPasted, selectedOption, legacyVisible, pasteAncestorNodeNames)(editorView.state, editorView.dispatch);
111
112
  }, [lastContentPasted, editorView]);
112
113
  const {
@@ -89,6 +89,7 @@ export var PasteActionsMenu = function PasteActionsMenu(_ref) {
89
89
  lastContentPasted = _useSharedPluginState.lastContentPasted;
90
90
  var prevShowToolbarRef = useRef(false);
91
91
  useEffect(function () {
92
+ var _lastContentPasted$te, _lastContentPasted$te2;
92
93
  if (!lastContentPasted) {
93
94
  hideToolbar()(editorView.state, editorView.dispatch);
94
95
  return;
@@ -106,7 +107,7 @@ export var PasteActionsMenu = function PasteActionsMenu(_ref) {
106
107
  for (var depth = $pos.depth; depth > 0; depth--) {
107
108
  pasteAncestorNodeNames.push($pos.node(depth).type.name);
108
109
  }
109
- var legacyVisible = isToolbarVisible(editorView.state, lastContentPasted);
110
+ var legacyVisible = isToolbarVisible(editorView.state, lastContentPasted) && ((_lastContentPasted$te = (_lastContentPasted$te2 = lastContentPasted.text) === null || _lastContentPasted$te2 === void 0 ? void 0 : _lastContentPasted$te2.length) !== null && _lastContentPasted$te !== void 0 ? _lastContentPasted$te : 0) >= 100;
110
111
  showToolbar(lastContentPasted, selectedOption, legacyVisible, pasteAncestorNodeNames)(editorView.state, editorView.dispatch);
111
112
  }, [lastContentPasted, editorView]);
112
113
  var _useSharedPluginState2 = useSharedPluginStateWithSelector(api, ['pasteOptionsToolbarPlugin'], function (states) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste-options-toolbar",
3
- "version": "9.1.2",
3
+ "version": "9.1.3",
4
4
  "description": "Paste options toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,7 +48,7 @@
48
48
  "react-intl-next": "npm:react-intl@^5.18.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^112.4.0",
51
+ "@atlaskit/editor-common": "^112.5.0",
52
52
  "react": "^18.2.0",
53
53
  "react-dom": "^18.2.0"
54
54
  },