easy-email-extensions 3.0.5 → 3.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/lib/index2.js CHANGED
@@ -55,7 +55,7 @@ var __async = (__this, __arguments, generator) => {
55
55
  };
56
56
  import * as React from "react";
57
57
  import React__default, { useCallback, useState, useRef, useEffect, useMemo, Children, isValidElement, cloneElement, createContext, useContext, Component, memo, forwardRef, useLayoutEffect, createRef, useImperativeHandle, PureComponent, useReducer, createElement, Suspense } from "react";
58
- import { IconFont, Stack as Stack$6, TextStyle, getBlockNodeByIdx, useBlock, getShadowRoot, FIXED_CONTAINER_ID, getEditorRoot, useEditorProps, useFocusIdx, useActiveTab, scrollBlockEleIntoView, useEditorContext, useHoverIdx, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, ActiveTabKeys } from "easy-email-editor";
58
+ import { IconFont, Stack as Stack$6, TextStyle, getBlockNodeByIdx, useBlock, getEditNode, getShadowRoot, FIXED_CONTAINER_ID, getEditContent, getEditorRoot, useEditorProps, useFocusIdx, useActiveTab, scrollBlockEleIntoView, useEditorContext, useHoverIdx, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, ActiveTabKeys } from "easy-email-editor";
59
59
  import { BasicType, ImageManager, getIndexByIdx, getSiblingIdx, BlockManager, getPageIdx, getChildIdx, createBlockDataByType, getParentByIdx, getValueByIdx, MjmlToJson, JsonToMjml, getParentIdx, getNodeTypeFromClassName } from "easy-email-core";
60
60
  import { ReactSortable } from "react-sortablejs";
61
61
  import { useForm as useForm$1, useField, Form as Form$3, version as version$2 } from "react-final-form";
@@ -5715,14 +5715,16 @@ function BlockTree(props) {
5715
5715
  if (node) {
5716
5716
  node.classList.remove(styles$8.treeNodeSelected);
5717
5717
  }
5718
- const selectedNode = eleRef.querySelector(`[${DATA_ATTRIBUTE_ID}="${selectedId}"]`);
5719
- if (selectedNode) {
5720
- selectedNode.classList.add(styles$8.treeNodeSelected);
5721
- selectedNode.scrollIntoView({
5722
- block: "center",
5723
- behavior: "smooth"
5724
- });
5725
- }
5718
+ setTimeout(() => {
5719
+ const selectedNode = eleRef.querySelector(`[${DATA_ATTRIBUTE_ID}="${selectedId}"]`);
5720
+ if (selectedNode) {
5721
+ selectedNode.classList.add(styles$8.treeNodeSelected);
5722
+ selectedNode.scrollIntoView({
5723
+ block: "center",
5724
+ behavior: "smooth"
5725
+ });
5726
+ }
5727
+ }, 50);
5726
5728
  }
5727
5729
  }, [eleRef, selectedId]);
5728
5730
  const onDragStart = useCallback((evt, sortable, store) => {
@@ -38635,27 +38637,6 @@ function awaitForElement$1(idx) {
38635
38637
  });
38636
38638
  return promiseObj;
38637
38639
  }
38638
- function getEditNode(node) {
38639
- if (!node.classList)
38640
- return null;
38641
- if (node.classList.contains("node-type-text")) {
38642
- return node.querySelector("div");
38643
- }
38644
- if (node.classList.contains("node-type-button")) {
38645
- return node.querySelector("a") || node.querySelector("p");
38646
- }
38647
- return null;
38648
- }
38649
- function getEditContent(node) {
38650
- var _a, _b;
38651
- if (node.classList.contains("node-type-text")) {
38652
- return ((_a = getEditNode(node)) == null ? void 0 : _a.innerHTML) || "";
38653
- }
38654
- if (node.classList.contains("node-type-button")) {
38655
- return ((_b = getEditNode(node)) == null ? void 0 : _b.innerText) || "";
38656
- }
38657
- return "";
38658
- }
38659
38640
  function InlineText({
38660
38641
  idx,
38661
38642
  onChange,
@@ -44229,7 +44210,7 @@ function Toolbar({
44229
44210
  style: {
44230
44211
  position: "absolute",
44231
44212
  left: 0,
44232
- top: direction === "top" ? 0 : "100%",
44213
+ top: direction === "top" || isPage ? 0 : "100%",
44233
44214
  fontSize: 14,
44234
44215
  zIndex: 3,
44235
44216
  color: "#000",
@@ -44240,7 +44221,7 @@ function Toolbar({
44240
44221
  }, /* @__PURE__ */ React__default.createElement("div", {
44241
44222
  style: {
44242
44223
  color: "#ffffff",
44243
- transform: direction === "top" ? "translateY(-100%)" : void 0,
44224
+ transform: direction !== "top" || isPage ? void 0 : "translateY(-100%)",
44244
44225
  display: "flex"
44245
44226
  }
44246
44227
  }, /* @__PURE__ */ React__default.createElement("div", {
@@ -44347,7 +44328,7 @@ function FocusTooltip() {
44347
44328
  return null;
44348
44329
  return BlockManager.getBlockByType(focusBlock2.type);
44349
44330
  }, [focusBlock2]);
44350
- if (isPage || !block2 || !blockNode)
44331
+ if (!block2 || !blockNode)
44351
44332
  return null;
44352
44333
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, createPortal(/* @__PURE__ */ React__default.createElement("div", {
44353
44334
  style: {