easy-email-pro-theme 1.32.0 → 1.33.0

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
@@ -1640,13 +1640,15 @@ function useFontFamily() {
1640
1640
  if (addFonts) {
1641
1641
  const options2 = addFonts.map((item2) => ({
1642
1642
  value: item2.name,
1643
- label: item2.name
1643
+ label: item2.name,
1644
+ href: item2.href
1644
1645
  }));
1645
1646
  fonts.unshift(...options2);
1646
1647
  }
1647
1648
  return fonts.map((item2) => ({
1648
1649
  value: item2.value,
1649
- label: /* @__PURE__ */ React__default.createElement("span", { style: { fontFamily: item2.value } }, item2.label)
1650
+ label: /* @__PURE__ */ React__default.createElement("span", { style: { fontFamily: item2.value } }, item2.label),
1651
+ href: item2.href
1650
1652
  }));
1651
1653
  }, [addFonts, propsFontList]);
1652
1654
  return {
@@ -7326,7 +7328,7 @@ function SortableTree(_g) {
7326
7328
  onRemove: removable ? () => handleRemove(props) : void 0
7327
7329
  }
7328
7330
  );
7329
- }), createPortal(
7331
+ }), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, createPortal(
7330
7332
  /* @__PURE__ */ React__default.createElement(
7331
7333
  DragOverlay,
7332
7334
  {
@@ -7353,7 +7355,7 @@ function SortableTree(_g) {
7353
7355
  ) : null
7354
7356
  ),
7355
7357
  document.body
7356
- ))
7358
+ )))
7357
7359
  );
7358
7360
  function handleDragStart({ active: { id: activeId2 } }) {
7359
7361
  setActiveId(activeId2);
@@ -26340,6 +26342,18 @@ const italicAdapter = {
26340
26342
  return "italic";
26341
26343
  }
26342
26344
  };
26345
+ const arrayStringAdapter = {
26346
+ formatter(val) {
26347
+ if (!isString$1(val))
26348
+ return [];
26349
+ return val.split(",").map((item2) => item2.trim());
26350
+ },
26351
+ normalize(val) {
26352
+ if (!Array.isArray(val))
26353
+ return void 0;
26354
+ return val.join(",");
26355
+ }
26356
+ };
26343
26357
  const transparentIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABAElEQVRIie2WwW7CMBBEZ8NKOJd8CPRABVVJ+fxUUEgQPbT9kBziFAWbU4FkjXCBICExtxk9Z7KxZYWSJLFoiJmbEYwxMMaI/JC1dv+oQmvE8QTWWvDo5VUs/FwtHSUWvmxTwUniQhHRdUuIyJm3Oslf6dVLmtMQEfhjNhVgFEUiq6oCvmye5zXPSnUF1Os/iSxLF/BlZ9P3mm9tTw4/231uvKuo9RIA4MHzUITHrgpfNgxDFFrv/E0meZT8S/zz/SXCsvyVIDP82U7dr9cSGsdvIsvSBXzZm10rj5KzJf99AGTpXGRB4H4fF6uUgi7LfYnrCLq18eSAqtpAddXObwEoMVtvVloS0QAAAABJRU5ErkJggg==";
26344
26358
  const transparentColor$1 = "rgba(0,0,0,0)";
26345
26359
  function ColorPicker$1(props) {
@@ -36195,16 +36209,48 @@ function Border(props) {
36195
36209
  }, [isEnabledBorder, label, name, path2]);
36196
36210
  }
36197
36211
  function FontFamily$1(props) {
36212
+ const { values: values2, setFieldValue } = useEditorContext();
36198
36213
  const { fontList } = useFontFamily();
36214
+ const onChange = useEventCallback((val) => {
36215
+ const webFontList = val.split(",").map((item2) => {
36216
+ const match2 = fontList.find(
36217
+ (font) => font.value === item2 && !!font.href
36218
+ );
36219
+ if (!match2)
36220
+ return null;
36221
+ return {
36222
+ name: match2.value,
36223
+ label: match2.label,
36224
+ href: match2.href
36225
+ };
36226
+ }).filter(Boolean);
36227
+ if (webFontList.length > 0) {
36228
+ const fonts = cloneDeep(values2.content.data.fonts || []);
36229
+ webFontList.forEach((item2) => {
36230
+ if (!fonts.find((font) => font.name === item2.name)) {
36231
+ fonts.push({
36232
+ name: item2.name,
36233
+ href: item2.href
36234
+ });
36235
+ }
36236
+ });
36237
+ setFieldValue([0], "data.fonts", fonts);
36238
+ }
36239
+ });
36199
36240
  return useMemo$1(
36200
36241
  () => /* @__PURE__ */ React__default.createElement(
36201
36242
  AttributeField.SelectField,
36202
- __spreadValues({
36243
+ __spreadProps(__spreadValues({
36203
36244
  label: t("Font family"),
36204
36245
  options: fontList
36205
- }, props)
36246
+ }, props), {
36247
+ mode: "multiple",
36248
+ allowCreate: true,
36249
+ onChange,
36250
+ formItem: __spreadValues(__spreadValues({}, arrayStringAdapter), props.formItem)
36251
+ })
36206
36252
  ),
36207
- [fontList, props]
36253
+ [fontList, onChange, props]
36208
36254
  );
36209
36255
  }
36210
36256
  function FontSize$1(props) {