easy-email-pro-theme 1.50.15 → 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.
- package/lib/index.js +9 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -35702,12 +35702,17 @@ function AIAssistant({ isCollapsed }) {
|
|
|
35702
35702
|
const [errorMsg, setErrorMsg] = useState("");
|
|
35703
35703
|
const [prompt, setPrompt] = useState([]);
|
|
35704
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
|
+
}
|
|
35705
35711
|
useEffect(() => {
|
|
35706
|
-
|
|
35707
|
-
|
|
35708
|
-
setSelectedText(text);
|
|
35712
|
+
if (blockText) {
|
|
35713
|
+
setSelectedText(blockText);
|
|
35709
35714
|
}
|
|
35710
|
-
}, [
|
|
35715
|
+
}, [blockText]);
|
|
35711
35716
|
useEffect(() => {
|
|
35712
35717
|
if (AIAssistantProps == null ? void 0 : AIAssistantProps.options) {
|
|
35713
35718
|
setOptions(AIAssistantProps == null ? void 0 : AIAssistantProps.options);
|