easy-email-pro-theme 1.50.14 → 1.50.16

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.
Files changed (2) hide show
  1. package/lib/index.js +11 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2215,6 +2215,7 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
2215
2215
  showPreviousLevelIcon
2216
2216
  } = useEditorProps();
2217
2217
  const { open } = useUniversalContent();
2218
+ const { universalElementSetting } = useEditorProps();
2218
2219
  const { setSelectedNodePath } = useEditorActions();
2219
2220
  const selectedNodePath = useSelectedNodePath();
2220
2221
  const universalElementEditing = useUniversalElementEditing();
@@ -2286,7 +2287,7 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
2286
2287
  if (standaloneElementPath && !isChildOfStandaloneElement) {
2287
2288
  isHideBackIcon = true;
2288
2289
  }
2289
- const hideAddToCollection = universalElementEditing || standaloneElementEditing;
2290
+ const hideAddToCollection = universalElementEditing || standaloneElementEditing || !universalElementSetting;
2290
2291
  const renderContent = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
2291
2292
  "div",
2292
2293
  {
@@ -35701,12 +35702,17 @@ function AIAssistant({ isCollapsed }) {
35701
35702
  const [errorMsg, setErrorMsg] = useState("");
35702
35703
  const [prompt, setPrompt] = useState([]);
35703
35704
  const [selectedText, setSelectedText] = useState("");
35705
+ let blockText = "";
35706
+ try {
35707
+ blockText = !isCollapsed && editor.selection && Editor.string(editor, editor.selection) ? Editor.string(editor, editor.selection) : Editor.string(editor, selectedNodePath);
35708
+ } catch (error2) {
35709
+ console.log("error", error2);
35710
+ }
35704
35711
  useEffect(() => {
35705
- const text = !isCollapsed && editor.selection && Editor.string(editor, editor.selection) ? Editor.string(editor, editor.selection) : Editor.string(editor, selectedNodePath);
35706
- if (text) {
35707
- setSelectedText(text);
35712
+ if (blockText) {
35713
+ setSelectedText(blockText);
35708
35714
  }
35709
- }, [editor, isCollapsed, selectedNodePath]);
35715
+ }, [blockText]);
35710
35716
  useEffect(() => {
35711
35717
  if (AIAssistantProps == null ? void 0 : AIAssistantProps.options) {
35712
35718
  setOptions(AIAssistantProps == null ? void 0 : AIAssistantProps.options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.50.14",
3
+ "version": "1.50.16",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"