easy-email-pro-theme 1.37.2 → 1.37.4
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 +146 -54
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/RTLDirection.d.ts +9 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/index.d.ts +2 -0
- package/lib/typings/components/Form/adapter/direction.adapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/index.d.ts +1 -0
- package/lib/typings/components/index.d.ts +1 -0
- package/lib/typings/typings/custom-types.d.ts +2 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -26461,6 +26461,16 @@ const arrayStringAdapter = {
|
|
|
26461
26461
|
return val.join(",");
|
|
26462
26462
|
}
|
|
26463
26463
|
};
|
|
26464
|
+
const directionAdapter = {
|
|
26465
|
+
formatter(direction) {
|
|
26466
|
+
return direction === "rtl";
|
|
26467
|
+
},
|
|
26468
|
+
normalize(isRTL) {
|
|
26469
|
+
if (!isRTL)
|
|
26470
|
+
return void 0;
|
|
26471
|
+
return "rtl";
|
|
26472
|
+
}
|
|
26473
|
+
};
|
|
26464
26474
|
const transparentIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABAElEQVRIie2WwW7CMBBEZ8NKOJd8CPRABVVJ+fxUUEgQPbT9kBziFAWbU4FkjXCBICExtxk9Z7KxZYWSJLFoiJmbEYwxMMaI/JC1dv+oQmvE8QTWWvDo5VUs/FwtHSUWvmxTwUniQhHRdUuIyJm3Oslf6dVLmtMQEfhjNhVgFEUiq6oCvmye5zXPSnUF1Os/iSxLF/BlZ9P3mm9tTw4/231uvKuo9RIA4MHzUITHrgpfNgxDFFrv/E0meZT8S/zz/SXCsvyVIDP82U7dr9cSGsdvIsvSBXzZm10rj5KzJf99AGTpXGRB4H4fF6uUgi7LfYnrCLq18eSAqtpAddXObwEoMVtvVloS0QAAAABJRU5ErkJggg==";
|
|
26465
26475
|
const transparentColor$1 = "rgba(0,0,0,0)";
|
|
26466
26476
|
function ColorPicker$1(props) {
|
|
@@ -36526,6 +36536,7 @@ const getFallbackValue = (params) => {
|
|
|
36526
36536
|
return mode === ActiveTabKeys.DESKTOP ? get(defaultElement, "attributes." + name) : get(defaultElement, "mobileAttributes." + name);
|
|
36527
36537
|
};
|
|
36528
36538
|
function Typography(props) {
|
|
36539
|
+
const { showTextDirectionMode } = useEditorProps();
|
|
36529
36540
|
const { label = t("Font"), path: path2, defaultElement } = props;
|
|
36530
36541
|
return useMemo$1(() => {
|
|
36531
36542
|
return /* @__PURE__ */ React__default.createElement("div", { key: props.type }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
@@ -36606,7 +36617,13 @@ function Typography(props) {
|
|
|
36606
36617
|
path: path2,
|
|
36607
36618
|
name: `${props.name}`
|
|
36608
36619
|
}
|
|
36609
|
-
)
|
|
36620
|
+
), showTextDirectionMode && /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 20 } }, /* @__PURE__ */ React__default.createElement(
|
|
36621
|
+
AttributeField.RTLDirection,
|
|
36622
|
+
{
|
|
36623
|
+
name: `${props.name}.direction`,
|
|
36624
|
+
path: path2
|
|
36625
|
+
}
|
|
36626
|
+
))));
|
|
36610
36627
|
}, [
|
|
36611
36628
|
defaultElement,
|
|
36612
36629
|
label,
|
|
@@ -36616,7 +36633,8 @@ function Typography(props) {
|
|
|
36616
36633
|
props.hideStyle,
|
|
36617
36634
|
props.mode,
|
|
36618
36635
|
props.name,
|
|
36619
|
-
props.type
|
|
36636
|
+
props.type,
|
|
36637
|
+
showTextDirectionMode
|
|
36620
36638
|
]);
|
|
36621
36639
|
}
|
|
36622
36640
|
const elements = [
|
|
@@ -36910,6 +36928,7 @@ const PaddingRow = (props) => {
|
|
|
36910
36928
|
};
|
|
36911
36929
|
function Buttons(props) {
|
|
36912
36930
|
const { label = t("Font"), type, defaultElement, path: path2 } = props;
|
|
36931
|
+
const { showTextDirectionMode } = useEditorProps();
|
|
36913
36932
|
return useMemo$1(() => {
|
|
36914
36933
|
return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
36915
36934
|
AttributeField.FontFamily,
|
|
@@ -37017,7 +37036,14 @@ function Buttons(props) {
|
|
|
37017
37036
|
path: path2,
|
|
37018
37037
|
name: `${props.name}`
|
|
37019
37038
|
}
|
|
37020
|
-
),
|
|
37039
|
+
), showTextDirectionMode && /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 20 } }, /* @__PURE__ */ React__default.createElement(
|
|
37040
|
+
AttributeField.RTLDirection,
|
|
37041
|
+
{
|
|
37042
|
+
label: t(`RTL text direction `),
|
|
37043
|
+
name: `${props.name}.direction`,
|
|
37044
|
+
path: path2
|
|
37045
|
+
}
|
|
37046
|
+
)), !props.hidePadding && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Divider$2, null), /* @__PURE__ */ React__default.createElement(
|
|
37021
37047
|
AttributeField.Padding,
|
|
37022
37048
|
{
|
|
37023
37049
|
path: path2,
|
|
@@ -37032,6 +37058,7 @@ function Buttons(props) {
|
|
|
37032
37058
|
props.hidePadding,
|
|
37033
37059
|
props.mode,
|
|
37034
37060
|
props.name,
|
|
37061
|
+
showTextDirectionMode,
|
|
37035
37062
|
type
|
|
37036
37063
|
]);
|
|
37037
37064
|
}
|
|
@@ -38409,6 +38436,31 @@ function ButtonContent(props) {
|
|
|
38409
38436
|
return /* @__PURE__ */ React__default.createElement(AttributeField.TextField, { path: props.path, name: "text", label });
|
|
38410
38437
|
}, [label, props]);
|
|
38411
38438
|
}
|
|
38439
|
+
function RTLDirection(props) {
|
|
38440
|
+
const _a = props, { path: path2, name } = _a, rest = __objRest(_a, ["path", "name"]);
|
|
38441
|
+
return useMemo$1(() => {
|
|
38442
|
+
return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
38443
|
+
AttributeField.SwitchField,
|
|
38444
|
+
__spreadProps(__spreadValues({
|
|
38445
|
+
label: rest.label || /* @__PURE__ */ React__default.createElement(Space, null, t(`RTL text direction `)),
|
|
38446
|
+
name,
|
|
38447
|
+
path: path2
|
|
38448
|
+
}, rest), {
|
|
38449
|
+
formItem: __spreadProps(__spreadValues(__spreadValues({}, rest.formItem), directionAdapter), {
|
|
38450
|
+
wrapperCol: {
|
|
38451
|
+
span: 10,
|
|
38452
|
+
style: {
|
|
38453
|
+
textAlign: "right"
|
|
38454
|
+
}
|
|
38455
|
+
},
|
|
38456
|
+
labelCol: {
|
|
38457
|
+
span: 12
|
|
38458
|
+
}
|
|
38459
|
+
})
|
|
38460
|
+
})
|
|
38461
|
+
)));
|
|
38462
|
+
}, [name, path2, rest]);
|
|
38463
|
+
}
|
|
38412
38464
|
const defaultAttributeFields = {
|
|
38413
38465
|
// Basic Form Field
|
|
38414
38466
|
WatchField,
|
|
@@ -38428,6 +38480,7 @@ const defaultAttributeFields = {
|
|
|
38428
38480
|
// Attributes Field
|
|
38429
38481
|
Heading,
|
|
38430
38482
|
Direction,
|
|
38483
|
+
RTLDirection,
|
|
38431
38484
|
Preheader,
|
|
38432
38485
|
Height,
|
|
38433
38486
|
Width,
|
|
@@ -38471,55 +38524,6 @@ const AttributesPanelWrapper = (props) => {
|
|
|
38471
38524
|
const CollapseWrapper$1 = (props) => {
|
|
38472
38525
|
return /* @__PURE__ */ React__default.createElement(SharedComponents.CollapseWrapper, __spreadValues({}, props));
|
|
38473
38526
|
};
|
|
38474
|
-
const SourceCodePanel = () => {
|
|
38475
|
-
const { selectedNodePath, selectedNode } = useSelectedNode();
|
|
38476
|
-
const { setFieldValue } = useEditorContext();
|
|
38477
|
-
const { values: values2 } = useEditorContext();
|
|
38478
|
-
const { universalElementSetting } = useEditorProps();
|
|
38479
|
-
const [text, setText] = React__default.useState(
|
|
38480
|
-
JSON.stringify(selectedNode, null, 2)
|
|
38481
|
-
);
|
|
38482
|
-
const [mjml2, setMjml] = React__default.useState("");
|
|
38483
|
-
const onBlur = () => {
|
|
38484
|
-
if (!selectedNodePath)
|
|
38485
|
-
return;
|
|
38486
|
-
try {
|
|
38487
|
-
const newNode = JsonAdapter.normalize(text);
|
|
38488
|
-
setFieldValue(selectedNodePath, "", newNode);
|
|
38489
|
-
} catch (error2) {
|
|
38490
|
-
console.log(error2, text);
|
|
38491
|
-
Message.warning(t("Invalid JSON format"));
|
|
38492
|
-
}
|
|
38493
|
-
};
|
|
38494
|
-
const mjmlFormat = useCallback$1(() => {
|
|
38495
|
-
if (!selectedNode)
|
|
38496
|
-
return;
|
|
38497
|
-
try {
|
|
38498
|
-
const mjml22 = EditorCore.toMJML({
|
|
38499
|
-
element: selectedNode,
|
|
38500
|
-
pageElement: values2.content,
|
|
38501
|
-
mode: "production",
|
|
38502
|
-
universalElements: universalElementSetting
|
|
38503
|
-
});
|
|
38504
|
-
setMjml(mjml22);
|
|
38505
|
-
} catch (error2) {
|
|
38506
|
-
console.log(error2, selectedNode);
|
|
38507
|
-
Message.warning(t("Invalid JSON format"));
|
|
38508
|
-
}
|
|
38509
|
-
}, [selectedNode, universalElementSetting, values2.content]);
|
|
38510
|
-
useEffect(() => {
|
|
38511
|
-
mjmlFormat();
|
|
38512
|
-
}, [mjmlFormat]);
|
|
38513
|
-
return /* @__PURE__ */ React__default.createElement(Collapse$1, { defaultActiveKey: ["json", "mjml"] }, /* @__PURE__ */ React__default.createElement(Collapse$1.Item, { name: "json", header: "JSON data" }, /* @__PURE__ */ React__default.createElement(
|
|
38514
|
-
Input.TextArea,
|
|
38515
|
-
{
|
|
38516
|
-
value: text,
|
|
38517
|
-
rows: 15,
|
|
38518
|
-
onChange: setText,
|
|
38519
|
-
onBlur
|
|
38520
|
-
}
|
|
38521
|
-
)), /* @__PURE__ */ React__default.createElement(Collapse$1.Item, { name: "mjml", header: "MJML format" }, /* @__PURE__ */ React__default.createElement(Input.TextArea, { value: mjml2, rows: 10 })));
|
|
38522
|
-
};
|
|
38523
38527
|
const ResponsiveField = (_k) => {
|
|
38524
38528
|
var _l = _k, {
|
|
38525
38529
|
component
|
|
@@ -38645,7 +38649,7 @@ const ResponsiveTabs = ({
|
|
|
38645
38649
|
title: /* @__PURE__ */ React__default.createElement(Space, null, /* @__PURE__ */ React__default.createElement("span", null, t("Source code"))),
|
|
38646
38650
|
key: "Source code"
|
|
38647
38651
|
},
|
|
38648
|
-
/* @__PURE__ */ React__default.createElement(SourceCodePanel, null)
|
|
38652
|
+
/* @__PURE__ */ React__default.createElement(SharedComponents.SourceCodePanel, null)
|
|
38649
38653
|
)
|
|
38650
38654
|
)
|
|
38651
38655
|
);
|
|
@@ -43745,6 +43749,93 @@ function AIAssistant({ isCollapsed }) {
|
|
|
43745
43749
|
}
|
|
43746
43750
|
), /* @__PURE__ */ React__default.createElement("style", null, `.easy-email-pro-ai-assistant .arco-select-view { border: none !important; }`));
|
|
43747
43751
|
}
|
|
43752
|
+
const SourceCodePanel = () => {
|
|
43753
|
+
const { selectedNodePath, selectedNode } = useSelectedNode();
|
|
43754
|
+
const { setFieldValue } = useEditorContext();
|
|
43755
|
+
const { values: values2 } = useEditorContext();
|
|
43756
|
+
const { universalElementSetting, sourceCodeEditable = true } = useEditorProps();
|
|
43757
|
+
const [text, setText] = React__default.useState(
|
|
43758
|
+
JSON.stringify(selectedNode, null, 2)
|
|
43759
|
+
);
|
|
43760
|
+
const [mjml2, setMjml] = React__default.useState("");
|
|
43761
|
+
const onBlur = () => {
|
|
43762
|
+
if (!sourceCodeEditable)
|
|
43763
|
+
return;
|
|
43764
|
+
if (!selectedNodePath)
|
|
43765
|
+
return;
|
|
43766
|
+
try {
|
|
43767
|
+
const newNode = JsonAdapter.normalize(text);
|
|
43768
|
+
setFieldValue(selectedNodePath, "", newNode);
|
|
43769
|
+
} catch (error2) {
|
|
43770
|
+
console.log(error2, text);
|
|
43771
|
+
Message.warning(t("Invalid JSON format"));
|
|
43772
|
+
}
|
|
43773
|
+
};
|
|
43774
|
+
const mjmlFormat = useCallback$1(() => {
|
|
43775
|
+
if (!selectedNode)
|
|
43776
|
+
return;
|
|
43777
|
+
try {
|
|
43778
|
+
const mjml22 = EditorCore.toMJML({
|
|
43779
|
+
element: selectedNode,
|
|
43780
|
+
pageElement: values2.content,
|
|
43781
|
+
mode: "production",
|
|
43782
|
+
universalElements: universalElementSetting
|
|
43783
|
+
});
|
|
43784
|
+
setMjml(mjml22);
|
|
43785
|
+
} catch (error2) {
|
|
43786
|
+
console.log(error2, selectedNode);
|
|
43787
|
+
Message.warning(t("Invalid JSON format"));
|
|
43788
|
+
}
|
|
43789
|
+
}, [selectedNode, universalElementSetting, values2.content]);
|
|
43790
|
+
useEffect(() => {
|
|
43791
|
+
mjmlFormat();
|
|
43792
|
+
}, [mjmlFormat]);
|
|
43793
|
+
return /* @__PURE__ */ React__default.createElement(Collapse$1, { defaultActiveKey: ["json", "mjml"] }, /* @__PURE__ */ React__default.createElement(
|
|
43794
|
+
Collapse$1.Item,
|
|
43795
|
+
{
|
|
43796
|
+
name: "json",
|
|
43797
|
+
header: "JSON data",
|
|
43798
|
+
extra: /* @__PURE__ */ React__default.createElement(
|
|
43799
|
+
Button$2,
|
|
43800
|
+
{
|
|
43801
|
+
type: "primary",
|
|
43802
|
+
onClick: () => __async(void 0, null, function* () {
|
|
43803
|
+
yield navigator.clipboard.writeText(text);
|
|
43804
|
+
Message.success("Copied!");
|
|
43805
|
+
})
|
|
43806
|
+
},
|
|
43807
|
+
t(`Copy`)
|
|
43808
|
+
)
|
|
43809
|
+
},
|
|
43810
|
+
sourceCodeEditable ? /* @__PURE__ */ React__default.createElement(
|
|
43811
|
+
Input.TextArea,
|
|
43812
|
+
{
|
|
43813
|
+
value: text,
|
|
43814
|
+
rows: 15,
|
|
43815
|
+
onChange: setText,
|
|
43816
|
+
onBlur
|
|
43817
|
+
}
|
|
43818
|
+
) : /* @__PURE__ */ React__default.createElement(FullHeightOverlayScrollbars, { maxHeight: 200 }, /* @__PURE__ */ React__default.createElement("div", { style: { whiteSpace: "pre-wrap", padding: "5px 10px" } }, text))
|
|
43819
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
43820
|
+
Collapse$1.Item,
|
|
43821
|
+
{
|
|
43822
|
+
name: "mjml",
|
|
43823
|
+
header: "MJML format",
|
|
43824
|
+
extra: /* @__PURE__ */ React__default.createElement(
|
|
43825
|
+
Button$2,
|
|
43826
|
+
{
|
|
43827
|
+
type: "primary",
|
|
43828
|
+
onClick: () => __async(void 0, null, function* () {
|
|
43829
|
+
yield navigator.clipboard.writeText(mjml2);
|
|
43830
|
+
Message.success("Copied!");
|
|
43831
|
+
})
|
|
43832
|
+
},
|
|
43833
|
+
t(`Copy`)
|
|
43834
|
+
)
|
|
43835
|
+
},
|
|
43836
|
+
/* @__PURE__ */ React__default.createElement(FullHeightOverlayScrollbars, { maxHeight: 200 }, /* @__PURE__ */ React__default.createElement("div", { style: { whiteSpace: "pre-wrap", padding: "5px 10px" } }, mjml2))
|
|
43837
|
+
));
|
|
43838
|
+
};
|
|
43748
43839
|
const SharedComponents = {
|
|
43749
43840
|
PreviewEmailDrawer,
|
|
43750
43841
|
PreviewEmail,
|
|
@@ -43776,7 +43867,8 @@ const SharedComponents = {
|
|
|
43776
43867
|
MinimalistEditorTopBar: EditorTopBar,
|
|
43777
43868
|
ConfigurationToolbar,
|
|
43778
43869
|
AIAssistant,
|
|
43779
|
-
AIPromptModal
|
|
43870
|
+
AIPromptModal,
|
|
43871
|
+
SourceCodePanel
|
|
43780
43872
|
};
|
|
43781
43873
|
const FullScreenLoading = ({
|
|
43782
43874
|
size = 40,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
|
+
import { AttributeField } from ".";
|
|
3
|
+
export declare const DirectionOptions: {
|
|
4
|
+
value: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare function RTLDirection(props: Omit<ComponentProps<typeof AttributeField.SwitchField>, "label" | "options"> & {
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -34,6 +34,7 @@ import { Direction } from "./Direction";
|
|
|
34
34
|
import { FieldItem } from "../WidgetConfigPanel/widgetFields";
|
|
35
35
|
import { Preheader } from "./Preheader";
|
|
36
36
|
import { ButtonContent } from "./ButtonContent";
|
|
37
|
+
import { RTLDirection } from "./RTLDirection";
|
|
37
38
|
export declare const defaultAttributeFields: {
|
|
38
39
|
WatchField: (props: import("../../../Form/WatchField").WatchFieldProps) => import("react").JSX.Element;
|
|
39
40
|
SyncChildrenField: (props: import("../../../Form/SyncChildrenField").SyncChildrenFieldProps) => import("react").JSX.Element;
|
|
@@ -70,6 +71,7 @@ export declare const defaultAttributeFields: {
|
|
|
70
71
|
PixelAndPercentField: typeof PixelAndPercentField;
|
|
71
72
|
Heading: typeof Heading;
|
|
72
73
|
Direction: typeof Direction;
|
|
74
|
+
RTLDirection: typeof RTLDirection;
|
|
73
75
|
Preheader: typeof Preheader;
|
|
74
76
|
Height: typeof Height;
|
|
75
77
|
Width: typeof Width;
|
|
@@ -7,3 +7,4 @@ export { fontStyleAdapter } from "./fontStyle.adapter";
|
|
|
7
7
|
export { fontWeightAdapter } from "./fontWeight.adapter";
|
|
8
8
|
export { italicAdapter } from "./italic.adapter";
|
|
9
9
|
export { arrayStringAdapter } from "./arrayString.adapter";
|
|
10
|
+
export { directionAdapter } from "./direction.adapter";
|
|
@@ -120,6 +120,7 @@ export declare const SharedComponents: {
|
|
|
120
120
|
}[]) => void;
|
|
121
121
|
onRetry: () => void;
|
|
122
122
|
}) => import("react").JSX.Element;
|
|
123
|
+
SourceCodePanel: () => import("react").JSX.Element;
|
|
123
124
|
};
|
|
124
125
|
export { CollapseWrapper } from "./ConfigurationPanel/components/CollapseWrapper";
|
|
125
126
|
export { AttributesPanelWrapper } from "./ConfigurationPanel/components/AttributesPanelWrapper";
|
|
@@ -52,6 +52,7 @@ export interface PluginsCustomEditorTypes {
|
|
|
52
52
|
categories?: Categories;
|
|
53
53
|
attributeFields?: AttributeFieldsMap;
|
|
54
54
|
showSourceCode?: boolean;
|
|
55
|
+
sourceCodeEditable?: boolean;
|
|
55
56
|
universalElementSetting?: {
|
|
56
57
|
elements: Record<string, Element>;
|
|
57
58
|
list: Array<{
|
|
@@ -92,6 +93,7 @@ export interface PluginsCustomEditorTypes {
|
|
|
92
93
|
showLogic?: boolean;
|
|
93
94
|
showLayer?: boolean;
|
|
94
95
|
showTextHTMLMode?: boolean;
|
|
96
|
+
showTextDirectionMode?: boolean;
|
|
95
97
|
showDragMoveIcon?: boolean;
|
|
96
98
|
showInsertTips?: boolean;
|
|
97
99
|
layerConfig?: {
|