easy-email-extensions 3.2.1-alpha.2 → 3.2.1-alpha.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1,3 @@
1
- export declare function FontFamily(): JSX.Element;
1
+ export declare function FontFamily({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
package/lib/index2.js CHANGED
@@ -56,7 +56,7 @@ var __async = (__this, __arguments, generator) => {
56
56
  import * as React from "react";
57
57
  import React__default, { Children, isValidElement, cloneElement, createContext, useContext, Component, useMemo, memo, forwardRef, useEffect, useRef, useLayoutEffect, useState, createRef, useImperativeHandle, PureComponent, useCallback, useReducer, Fragment, createElement, Suspense } from "react";
58
58
  import { IconFont, useEditorProps, Stack as Stack$6, getShadowRoot, TextStyle, useEditorContext, useBlock, useFocusIdx, useFocusBlockLayout, getEditNode, MergeTagBadge as MergeTagBadge$1, FIXED_CONTAINER_ID, getPluginElement, isTextBlock, scrollBlockEleIntoView, useHoverIdx, useDataTransfer, useRefState, getBlockNodeByChildEle, getDirectionPosition, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, getBlockNodeByIdx, useLazyState, getEditorRoot, useActiveTab, ActiveTabKeys } from "easy-email-editor";
59
- import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getValueByIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getNodeIdxClassName, getPageIdx, getChildIdx, MjmlToJson, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
59
+ import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getNodeIdxClassName, getPageIdx, getChildIdx, MjmlToJson, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
60
60
  import ReactDOM, { findDOMNode, createPortal } from "react-dom";
61
61
  import { useField, Field, useForm as useForm$1, Form as Form$3, version as version$2, useFormState } from "react-final-form";
62
62
  var index$2 = "";
@@ -39832,7 +39832,7 @@ function EyeIcon() {
39832
39832
  onClick: onToggleVisible
39833
39833
  });
39834
39834
  }
39835
- function FontFamily() {
39835
+ function FontFamily({ name }) {
39836
39836
  const { focusIdx: focusIdx2 } = useFocusIdx();
39837
39837
  const { fontList: fontList2 } = useFontFamily();
39838
39838
  return useMemo(() => {
@@ -39840,10 +39840,10 @@ function FontFamily() {
39840
39840
  style: { minWidth: 100, flex: 1 },
39841
39841
  showSearch: true,
39842
39842
  label: "Font family",
39843
- name: `${focusIdx2}.attributes.font-family`,
39843
+ name: name || `${focusIdx2}.attributes.font-family`,
39844
39844
  options: fontList2
39845
39845
  });
39846
- }, [focusIdx2, fontList2]);
39846
+ }, [focusIdx2, fontList2, name]);
39847
39847
  }
39848
39848
  function Page() {
39849
39849
  const { focusIdx: focusIdx2 } = useFocusIdx();
@@ -39885,7 +39885,9 @@ function Page() {
39885
39885
  spacing: "tight"
39886
39886
  }, /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
39887
39887
  span: 11
39888
- }, /* @__PURE__ */ React__default.createElement(FontFamily, null)), /* @__PURE__ */ React__default.createElement(Grid.Col, {
39888
+ }, /* @__PURE__ */ React__default.createElement(FontFamily, {
39889
+ name: `${focusIdx2}.data.value.font-family`
39890
+ })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
39889
39891
  offset: 1,
39890
39892
  span: 11
39891
39893
  }, /* @__PURE__ */ React__default.createElement(InputWithUnitField, {
@@ -42349,10 +42351,9 @@ function AttributePanel() {
42349
42351
  const { values: values2, focusBlock: focusBlock2 } = useBlock();
42350
42352
  const { initialized } = useEditorContext();
42351
42353
  const { focusIdx: focusIdx2 } = useFocusIdx();
42352
- const value = getValueByIdx(values2, focusIdx2);
42353
42354
  const Com = focusBlock2 && BlockAttributeConfigurationManager.get(focusBlock2.type);
42354
42355
  const shadowRoot = getShadowRoot();
42355
- if (!value || !initialized)
42356
+ if (!initialized)
42356
42357
  return null;
42357
42358
  return /* @__PURE__ */ React__default.createElement(SelectionRangeProvider, null, /* @__PURE__ */ React__default.createElement(PresetColorsProvider, null, Com ? /* @__PURE__ */ React__default.createElement(Com, {
42358
42359
  key: focusIdx2
@@ -46781,9 +46782,9 @@ const SimpleLayout = (props) => {
46781
46782
  bodyStyle: { padding: 0 },
46782
46783
  className: styles.customScrollBar
46783
46784
  }, /* @__PURE__ */ React__default.createElement(Tabs$1, null, /* @__PURE__ */ React__default.createElement(Tabs$1.TabPane, {
46784
- key: "Configuration",
46785
46785
  title: "Configuration"
46786
46786
  }, /* @__PURE__ */ React__default.createElement(AttributePanel, null)), showSourceCode && /* @__PURE__ */ React__default.createElement(Tabs$1.TabPane, {
46787
+ destroyOnHide: true,
46787
46788
  key: "Source code",
46788
46789
  title: "Source code"
46789
46790
  }, /* @__PURE__ */ React__default.createElement(SourceCodePanel, null))))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadge, null)));