easy-email-pro-theme 1.12.0 → 1.12.2

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 CHANGED
@@ -860,12 +860,6 @@ const getNodePathName = (path2, name) => {
860
860
  return path2.join(".children.");
861
861
  return path2.join(".children.") + "." + name;
862
862
  };
863
- const unauthorizedHtml = `<div style="position: fixed;z-index: 9999999999;bottom: 40px;right: 40px;background-color: #ffffff;width: 320px;padding: 20px;box-sizing: border-box;box-shadow: 1px 1px 5px 0px #ccc;">
864
- <div style="font-weight:bold">Authorization Terminated</div>
865
- <div>We regret to inform you that your authorization has been terminated.</div>
866
- <div>Please contact us: <a target="_blank" style="font-weight: bold;color: rgb(0, 120, 212);cursor:pointer;" href="mailto:ch.mao@qq.com">ch.mao@qq.com</a></div>
867
-
868
- </div>`;
869
863
  const EditorContext = createContext({});
870
864
  const getInited = (editor) => {
871
865
  let inited = false;
@@ -883,46 +877,29 @@ const EditorContextProvider = (props) => {
883
877
  const editor = useSlate();
884
878
  const { form } = Form.useFormContext();
885
879
  const values2 = form.getFieldsValue();
886
- const { attributesVariables, loadingElement } = useEditorProps();
880
+ const { attributesVariables } = useEditorProps();
887
881
  const [mergetagsData, setMergetagsData] = useState({});
888
882
  const initialValuesRef = useRef(props.initialValues);
889
883
  const lastAdapterNonPageValues = useRef({});
890
884
  const mergetagsDataRef = useRefState(mergetagsData);
891
885
  const [inited, setInited] = useState(false);
892
- const [hasAuth, setHasAuth] = useState(false);
893
- const [isUnauthorized, setIsUnauthorized] = useState(false);
894
886
  useEffect(() => {
895
887
  if (isEqual$3(props.mergetagsData, mergetagsDataRef.current))
896
888
  return;
897
889
  setMergetagsData(cloneDeep(props.mergetagsData) || {});
898
890
  }, [mergetagsDataRef, props.mergetagsData]);
899
891
  const pageElement = editor.children[0];
900
- useEffect(() => {
901
- EditorCore.auth(props.clientId).then(() => {
902
- setHasAuth(true);
903
- }).catch((error2) => {
904
- const status = get(error2, "response.status");
905
- if (status === 401) {
906
- setIsUnauthorized(true);
907
- } else {
908
- const errorMessage = unauthorizedHtml;
909
- const div = document.createElement("div");
910
- div.innerHTML = errorMessage;
911
- document.body.appendChild(div);
912
- }
913
- });
914
- }, [props.clientId]);
915
892
  useEffect(() => {
916
893
  const timer = setInterval(() => {
917
894
  const inited2 = getInited(editor);
918
- if (inited2 && hasAuth) {
895
+ if (inited2) {
919
896
  setInited(true);
920
897
  } else {
921
898
  setInited(false);
922
899
  }
923
900
  }, 100);
924
901
  return () => timer && clearInterval(timer);
925
- }, [editor, hasAuth]);
902
+ }, [editor]);
926
903
  const { lock } = useEditorState();
927
904
  const { universalElementSetting } = useEditorProps();
928
905
  const valid = !lock;
@@ -1064,8 +1041,7 @@ const EditorContextProvider = (props) => {
1064
1041
  valid,
1065
1042
  reset,
1066
1043
  getFieldValue,
1067
- submit,
1068
- hasAuth
1044
+ submit
1069
1045
  };
1070
1046
  }, [
1071
1047
  adapterValues,
@@ -1077,18 +1053,11 @@ const EditorContextProvider = (props) => {
1077
1053
  valid,
1078
1054
  reset,
1079
1055
  getFieldValue,
1080
- submit,
1081
- hasAuth
1056
+ submit
1082
1057
  ]);
1083
1058
  return useMemo$1(() => {
1084
- if (!hasAuth) {
1085
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, loadingElement) || null;
1086
- }
1087
- if (isUnauthorized) {
1088
- return /* @__PURE__ */ React__default.createElement("div", { dangerouslySetInnerHTML: { __html: unauthorizedHtml } });
1089
- }
1090
1059
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(EditorContext.Provider, { value: data }, props.children));
1091
- }, [hasAuth, isUnauthorized, data, props.children, loadingElement]);
1060
+ }, [data, props.children]);
1092
1061
  };
1093
1062
  const FormProvider = ({ children }) => {
1094
1063
  const props = useEditorProps();
@@ -98,7 +98,6 @@ export interface PluginsCustomEditorTypes {
98
98
  widgetMode?: boolean;
99
99
  widgetElement?: SectionWidgetElement | ContentWidgetElement;
100
100
  emptyPageElement?: PageElement;
101
- loadingElement?: React.ReactNode;
102
101
  ElementToolsInner?: React.FC<{
103
102
  element: Element;
104
103
  nodeElement: HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"