@useinsider/guido 1.0.2-beta.05f3233 → 1.0.2-beta.080ccee
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/README.md +1 -1
- package/dist/_virtual/AddCustomFont.js +4 -0
- package/dist/_virtual/AiAssistantValueType.js +4 -0
- package/dist/_virtual/BackgroundColorBuiltInControl.js +4 -0
- package/dist/_virtual/BackgroundImageBuiltInControl.js +4 -0
- package/dist/_virtual/Block.js +4 -0
- package/dist/_virtual/BlockAttributes.js +4 -0
- package/dist/_virtual/BlockCompositionType.js +4 -0
- package/dist/_virtual/BlockPaddingsBuiltInControl.js +4 -0
- package/dist/_virtual/BlockRenderer.js +4 -0
- package/dist/_virtual/BlockType.js +4 -0
- package/dist/_virtual/BlocksPanel.js +4 -0
- package/dist/_virtual/BuiltInControl.js +4 -0
- package/dist/_virtual/BuiltInControlTypes.js +4 -0
- package/dist/_virtual/ButtonBorderBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonColorBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonFontColorBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonTextBuiltInControl.js +4 -0
- package/dist/_virtual/ContextAction.js +4 -0
- package/dist/_virtual/ContextActionType.js +4 -0
- package/dist/_virtual/Control.js +4 -0
- package/dist/_virtual/EditorStatePropertyType.js +4 -0
- package/dist/_virtual/Extension.js +4 -0
- package/dist/_virtual/ExtensionBuilder.js +4 -0
- package/dist/_virtual/FontFamilyBuiltInControl.js +4 -0
- package/dist/_virtual/LinkColorBuiltInControl.js +4 -0
- package/dist/_virtual/ModificationDescription.js +4 -0
- package/dist/_virtual/PanelPosition.js +4 -0
- package/dist/_virtual/PreviewDeviceMode.js +4 -0
- package/dist/_virtual/SettingsPanelRegistry.js +4 -0
- package/dist/_virtual/SettingsPanelTab.js +4 -0
- package/dist/_virtual/SettingsTab.js +4 -0
- package/dist/_virtual/StructureBorderBuiltInControl.js +4 -0
- package/dist/_virtual/StructurePaddingsBuiltInControl.js +4 -0
- package/dist/_virtual/TextColorBuiltInControl.js +4 -0
- package/dist/_virtual/TextLineSpacingBuiltInControl.js +4 -0
- package/dist/_virtual/TextSizeBuiltInControl.js +4 -0
- package/dist/_virtual/TextStyleBuiltInControl.js +4 -0
- package/dist/_virtual/UIElement.js +4 -0
- package/dist/_virtual/UIElementTagRegistry.js +4 -0
- package/dist/_virtual/UIElementType.js +4 -0
- package/dist/_virtual/UIElementsAttributes.js +4 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +50 -51
- package/dist/components/organisms/header/LeftSlot.vue.js +10 -10
- package/dist/components/organisms/header/LeftSlot.vue2.js +10 -23
- package/dist/composables/useHtmlValidator.d.ts +1 -2
- package/dist/composables/useHtmlValidator.js +95 -114
- package/dist/composables/useSave.js +6 -6
- package/dist/composables/useStripo.js +24 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +27 -41
- package/dist/extensions/DynamicContent/extension.js +6 -18
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +48 -72
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +49 -74
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +38 -120
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +101 -116
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +43 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +17 -21
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +15 -8
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +29 -30
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +23 -19
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +19 -37
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +15 -2
- package/package.json +2 -2
- package/dist/config/migrator/checkboxMigrator.d.ts +0 -1
- package/dist/config/migrator/checkboxMigrator.js +0 -83
- package/dist/config/migrator/index.d.ts +0 -1
- package/dist/config/migrator/index.js +0 -5
- package/dist/extensions/Blocks/Checkbox/block.d.ts +0 -10
- package/dist/extensions/Blocks/Checkbox/block.js +0 -39
- package/dist/extensions/Blocks/Checkbox/control.d.ts +0 -22
- package/dist/extensions/Blocks/Checkbox/control.js +0 -104
- package/dist/extensions/Blocks/Checkbox/extension.d.ts +0 -2
- package/dist/extensions/Blocks/Checkbox/extension.js +0 -20
- package/dist/extensions/Blocks/Checkbox/settingsPanel.d.ts +0 -4
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +0 -38
- package/dist/extensions/Blocks/Checkbox/template.d.ts +0 -6
- package/dist/extensions/Blocks/Checkbox/template.js +0 -75
- package/dist/extensions/Blocks/_Boilerplate/block.d.ts +0 -10
- package/dist/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
- package/dist/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
- package/dist/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
- package/dist/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
- package/dist/mock/api/unsubscribe.d.ts +0 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +0 -12
|
@@ -1,139 +1,120 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import { useRecommendationStore as
|
|
6
|
-
import { base64EncodeWithSpecialChars as
|
|
7
|
-
import { useHttp as
|
|
8
|
-
import { useToaster as
|
|
9
|
-
import { useTranslations as
|
|
10
|
-
const
|
|
1
|
+
import { useConfig as V } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as H } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as O, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as B, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as R } from "../enums/html-validator.js";
|
|
4
|
+
import { ToasterTypeOptions as r } from "../enums/toaster.js";
|
|
5
|
+
import { useRecommendationStore as D } from "../stores/recommendation.js";
|
|
6
|
+
import { base64EncodeWithSpecialChars as P } from "../utils/base64.js";
|
|
7
|
+
import { useHttp as X } from "./useHttp.js";
|
|
8
|
+
import { useToaster as j } from "./useToaster.js";
|
|
9
|
+
import { useTranslations as z } from "./useTranslations.js";
|
|
10
|
+
const tt = () => {
|
|
11
11
|
var d;
|
|
12
|
-
const { showToaster:
|
|
13
|
-
const
|
|
12
|
+
const { showToaster: a } = j(), { post: y } = X(), { config: C } = V(), i = z(), m = D(), f = ((d = C.partner) == null ? void 0 : d.messageType) === H.transactional, h = async (t) => {
|
|
13
|
+
const e = await y(
|
|
14
14
|
"/newsletter/template-library/check-template-html-body",
|
|
15
|
-
{ html:
|
|
16
|
-
), { status: n, message:
|
|
17
|
-
return n ||
|
|
18
|
-
type:
|
|
19
|
-
message: n === void 0 ?
|
|
20
|
-
}),
|
|
21
|
-
type:
|
|
22
|
-
message:
|
|
15
|
+
{ html: P(t) }
|
|
16
|
+
), { status: n, message: c } = e.data;
|
|
17
|
+
return n || a({
|
|
18
|
+
type: r.Alert,
|
|
19
|
+
message: n === void 0 ? c : i("newsletter.invalid-url-link-for-toaster")
|
|
20
|
+
}), i(_), c === i(R) && a({
|
|
21
|
+
type: r.Alert,
|
|
22
|
+
message: i("newsletter.already-in-progress")
|
|
23
23
|
}), n;
|
|
24
|
-
}, v = (
|
|
25
|
-
const
|
|
24
|
+
}, v = (t) => !["if", "endif", "else", "elif", "now"].includes(t.toLowerCase()), w = (t) => ["if", "endif"].includes(t.toLowerCase()), S = (t, s) => {
|
|
25
|
+
const e = t.match(/({%(.*?)%})/g);
|
|
26
26
|
let n = !0;
|
|
27
|
-
return
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const [
|
|
31
|
-
v(
|
|
32
|
-
type:
|
|
33
|
-
message:
|
|
27
|
+
return e !== null && !f && e.forEach((c) => {
|
|
28
|
+
const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
29
|
+
if (o && o.length > 0) {
|
|
30
|
+
const [l] = o;
|
|
31
|
+
v(l) && !s.includes(l) && (a({
|
|
32
|
+
type: r.Warning,
|
|
33
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
34
34
|
}), n = !1);
|
|
35
35
|
}
|
|
36
36
|
}), n;
|
|
37
|
-
},
|
|
38
|
-
const n =
|
|
39
|
-
return S(
|
|
40
|
-
},
|
|
41
|
-
type:
|
|
42
|
-
message:
|
|
43
|
-
}), !1),
|
|
44
|
-
const s = (
|
|
45
|
-
return s >
|
|
46
|
-
type:
|
|
47
|
-
message:
|
|
48
|
-
}), s <
|
|
49
|
-
type:
|
|
50
|
-
message:
|
|
51
|
-
}), s ===
|
|
52
|
-
},
|
|
53
|
-
const s =
|
|
54
|
-
return s ||
|
|
55
|
-
type:
|
|
56
|
-
message:
|
|
37
|
+
}, E = async (t, s, e) => {
|
|
38
|
+
const n = e ? await h(t) : !0;
|
|
39
|
+
return S(t, s) && n;
|
|
40
|
+
}, T = (t) => t.length > 0 ? !0 : (a({
|
|
41
|
+
type: r.Warning,
|
|
42
|
+
message: i("newsletter.html-content-is-empty")
|
|
43
|
+
}), !1), I = (t) => {
|
|
44
|
+
const s = (t.match(/{/gm) || []).length, e = (t.match(/}/gm) || []).length;
|
|
45
|
+
return s > e && a({
|
|
46
|
+
type: r.Warning,
|
|
47
|
+
message: i("custom-fields.missing-closing-braces")
|
|
48
|
+
}), s < e && a({
|
|
49
|
+
type: r.Warning,
|
|
50
|
+
message: i("custom-fields.missing-opening-braces")
|
|
51
|
+
}), s === e;
|
|
52
|
+
}, A = (t) => {
|
|
53
|
+
const s = t.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
54
|
+
return s || a({
|
|
55
|
+
type: r.Warning,
|
|
56
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
57
57
|
}), s;
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const n =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</ul>
|
|
70
|
-
`;
|
|
71
|
-
return c({
|
|
72
|
-
type: l.Alert,
|
|
73
|
-
message: o("custom-fields.invalid-custom-fields") + i
|
|
74
|
-
}), !1;
|
|
75
|
-
}
|
|
58
|
+
}, W = (t, s) => {
|
|
59
|
+
const e = t.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
60
|
+
if (e && !f) {
|
|
61
|
+
const n = s.map((o) => o.toLowerCase()), c = e.some((o) => {
|
|
62
|
+
const l = o.replace("{{", "").replace("}}", "").trim().toLowerCase();
|
|
63
|
+
return !n.includes(l) || l === "";
|
|
64
|
+
});
|
|
65
|
+
return c && a({
|
|
66
|
+
type: r.Warning,
|
|
67
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
68
|
+
}), !c;
|
|
76
69
|
}
|
|
77
70
|
return !0;
|
|
78
|
-
},
|
|
79
|
-
const s =
|
|
71
|
+
}, x = (t) => {
|
|
72
|
+
const s = t.match(/{%(.*?)%}/g), e = [];
|
|
80
73
|
let n = !0;
|
|
81
|
-
if (s && s.forEach((
|
|
82
|
-
const
|
|
83
|
-
(!
|
|
84
|
-
type:
|
|
85
|
-
message:
|
|
86
|
-
}), n = !1),
|
|
87
|
-
|
|
88
|
-
type:
|
|
89
|
-
message:
|
|
74
|
+
if (s && s.forEach((c) => {
|
|
75
|
+
const o = c.match(O), l = c.match(B), L = (o == null ? void 0 : o.join("")) || "";
|
|
76
|
+
(!o || c !== L) && !l && (a({
|
|
77
|
+
type: r.Alert,
|
|
78
|
+
message: i("newsletter.display-conditions-invalid-syntax")
|
|
79
|
+
}), n = !1), o && o.forEach((u) => {
|
|
80
|
+
u.trim() === "=" && (a({
|
|
81
|
+
type: r.Alert,
|
|
82
|
+
message: i("custom-conditions.wrong-equality-operators")
|
|
90
83
|
}), n = !1);
|
|
91
|
-
const g =
|
|
84
|
+
const g = u.match(/^[a-zA-Z]*$/g);
|
|
92
85
|
g && g.forEach((p) => {
|
|
93
|
-
w(p) &&
|
|
86
|
+
w(p) && e.push(p);
|
|
94
87
|
});
|
|
95
88
|
});
|
|
96
|
-
}),
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
type:
|
|
100
|
-
message:
|
|
89
|
+
}), e.length) {
|
|
90
|
+
const c = e.filter((l) => l === "if"), o = e.filter((l) => l === "endif");
|
|
91
|
+
c.length !== o.length && (a({
|
|
92
|
+
type: r.Alert,
|
|
93
|
+
message: i("custom-conditions.missing-if-endif-tag")
|
|
101
94
|
}), n = !1);
|
|
102
95
|
}
|
|
103
96
|
return n;
|
|
104
|
-
},
|
|
105
|
-
const s = (
|
|
106
|
-
return n ||
|
|
107
|
-
type:
|
|
108
|
-
message:
|
|
97
|
+
}, b = (t) => {
|
|
98
|
+
const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length, n = s === e;
|
|
99
|
+
return n || a({
|
|
100
|
+
type: r.Warning,
|
|
101
|
+
message: i("custom-conditions.no-space-after-braces")
|
|
109
102
|
}), n;
|
|
110
|
-
},
|
|
111
|
-
type:
|
|
112
|
-
message:
|
|
113
|
-
}), !1) : !0,
|
|
114
|
-
type:
|
|
115
|
-
message:
|
|
116
|
-
}), !1) : !0,
|
|
103
|
+
}, N = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e, n) => e + n, 0) > 0 ? (a({
|
|
104
|
+
type: r.Warning,
|
|
105
|
+
message: i("custom-conditions.no-braces-inside-if-tag")
|
|
106
|
+
}), !1) : !0, k = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (a({
|
|
107
|
+
type: r.Alert,
|
|
108
|
+
message: i("newsletter.fill-all-necessary-fields")
|
|
109
|
+
}), !1) : !0, F = (t) => {
|
|
117
110
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
118
|
-
return
|
|
119
|
-
type:
|
|
120
|
-
message:
|
|
111
|
+
return t.match(s) === null ? !0 : (a({
|
|
112
|
+
type: r.Alert,
|
|
113
|
+
message: i("newsletter.invalid-image-type")
|
|
121
114
|
}), !1);
|
|
122
|
-
}, N = (e) => {
|
|
123
|
-
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
124
|
-
return Array.from(n).find((i) => {
|
|
125
|
-
var r;
|
|
126
|
-
return !((r = i.id) != null && r.trim());
|
|
127
|
-
}) ? (c({
|
|
128
|
-
type: l.Alert,
|
|
129
|
-
message: o("unsubscribe-templates.select-checkbox-groups")
|
|
130
|
-
}), !1) : !0;
|
|
131
115
|
};
|
|
132
|
-
return { validateHtml: async (
|
|
133
|
-
const n = s.map((i) => i.value);
|
|
134
|
-
return await b(e, n, t) && E(e) && A(e) && x(e) && T(e, n) && k(e) && F(e) && I(e) && W() && L(e) && N(e);
|
|
135
|
-
} };
|
|
116
|
+
return { validateHtml: async (t, s, e = !1) => await E(t, s, e) && T(t) && I(t) && A(t) && W(t, s) && x(t) && b(t) && N(t) && k() && F(t) };
|
|
136
117
|
};
|
|
137
118
|
export {
|
|
138
|
-
|
|
119
|
+
tt as useHtmlValidator
|
|
139
120
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useSaveStart as i, useSaveComplete as
|
|
2
|
-
import { useTemplatePreparation as
|
|
3
|
-
import { useHtmlValidator as
|
|
1
|
+
import { useSaveStart as i, useSaveComplete as l } from "./useGuidoActions.js";
|
|
2
|
+
import { useTemplatePreparation as m } from "../utils/templatePreparation.js";
|
|
3
|
+
import { useHtmlValidator as n } from "./useHtmlValidator.js";
|
|
4
4
|
const f = () => {
|
|
5
|
-
const e = i(), a =
|
|
5
|
+
const e = i(), a = l(), { validateHtml: s } = n();
|
|
6
6
|
return { save: async (o = !1) => {
|
|
7
7
|
e();
|
|
8
|
-
const { prepareTemplateDetails: r } =
|
|
9
|
-
if (await s(t.compiledHtml,
|
|
8
|
+
const { prepareTemplateDetails: r } = m(), t = await r();
|
|
9
|
+
if (await s(t.compiledHtml, [], !0))
|
|
10
10
|
return o || a(t), t;
|
|
11
11
|
} };
|
|
12
12
|
};
|
|
@@ -3,20 +3,19 @@ import { useCustomInterfaceAppearance as S } from "./useCustomInterfaceAppearanc
|
|
|
3
3
|
import { useStripoEventHandler as C } from "./useStripoEventHandler.js";
|
|
4
4
|
import { useToaster as E } from "./useToaster.js";
|
|
5
5
|
import { displayConditions as y } from "../enums/displayConditions.js";
|
|
6
|
-
import h from "../extensions/
|
|
7
|
-
import w from "../
|
|
8
|
-
import
|
|
9
|
-
import k from "../static/styles/customEditorStyle.css.js";
|
|
6
|
+
import h from "../extensions/DynamicContent/extension.js";
|
|
7
|
+
import { useStripoApi as w } from "../services/stripoApi.js";
|
|
8
|
+
import b from "../static/styles/customEditorStyle.css.js";
|
|
10
9
|
import { useEditorStore as V } from "../stores/editor.js";
|
|
11
10
|
import { dynamicContentToMergeTags as _ } from "../utils/genericUtil.js";
|
|
12
|
-
const
|
|
13
|
-
const { handleError: d } = E(), { getToken: c, getCustomFonts: u } =
|
|
14
|
-
const
|
|
11
|
+
const R = (s) => {
|
|
12
|
+
const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = w(), { handleEvent: l } = C(), p = (r, i = []) => {
|
|
13
|
+
const e = V(), { html: o, css: a, forceRecreate: g } = r;
|
|
15
14
|
window.UIEditor.initEditor(
|
|
16
15
|
document.querySelector("#guido-editor"),
|
|
17
16
|
{
|
|
18
17
|
metadata: s,
|
|
19
|
-
html:
|
|
18
|
+
html: o,
|
|
20
19
|
css: a,
|
|
21
20
|
forceRecreate: g,
|
|
22
21
|
locale: "en",
|
|
@@ -28,7 +27,7 @@ const H = (s) => {
|
|
|
28
27
|
customAppearanceMergetags: !0,
|
|
29
28
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
30
29
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
31
|
-
customViewStyles:
|
|
30
|
+
customViewStyles: b,
|
|
32
31
|
conditionsEnabled: !0,
|
|
33
32
|
customConditionsEnabled: !0,
|
|
34
33
|
conditionCategories: y,
|
|
@@ -56,50 +55,50 @@ const H = (s) => {
|
|
|
56
55
|
onTemplateLoaded() {
|
|
57
56
|
try {
|
|
58
57
|
const { importCss: t } = S(), { activateCustomViewStyles: n } = f();
|
|
59
|
-
t(), n(), s.onReady(),
|
|
60
|
-
|
|
58
|
+
t(), n(), s.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
59
|
+
e.hasChanges = !1;
|
|
61
60
|
}, 1e3);
|
|
62
61
|
} catch (t) {
|
|
63
62
|
d(t, "Failed to load custom interface appearance");
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
65
|
onCodeEditorVisibilityChanged(t) {
|
|
67
|
-
|
|
66
|
+
e.isCodeEditorOpen = t;
|
|
68
67
|
},
|
|
69
68
|
onEditorVisualModeChanged(t) {
|
|
70
|
-
|
|
69
|
+
e.editorVisualMode = t.toLowerCase();
|
|
71
70
|
},
|
|
72
71
|
onVersionHistoryVisibilityChanged(t) {
|
|
73
|
-
|
|
72
|
+
e.isVersionHistoryOpen = t;
|
|
74
73
|
},
|
|
75
74
|
onDataChanged() {
|
|
76
|
-
|
|
75
|
+
e.hasChanges = !0;
|
|
77
76
|
},
|
|
78
77
|
onEvent: l,
|
|
79
78
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
|
|
80
|
-
extensions: [
|
|
79
|
+
extensions: [h]
|
|
81
80
|
}
|
|
82
81
|
);
|
|
83
|
-
},
|
|
82
|
+
}, m = (r) => new Promise((i, e) => {
|
|
84
83
|
if (document.getElementById("UiEditorScript")) {
|
|
85
84
|
r(), i();
|
|
86
85
|
return;
|
|
87
86
|
}
|
|
88
|
-
const
|
|
89
|
-
|
|
87
|
+
const o = document.createElement("script");
|
|
88
|
+
o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
|
|
90
89
|
r(), i();
|
|
91
|
-
},
|
|
90
|
+
}, o.onerror = () => {
|
|
92
91
|
const a = new Error("Failed to load Stripo UIEditor script");
|
|
93
|
-
|
|
94
|
-
}, document.body.appendChild(
|
|
92
|
+
e(a);
|
|
93
|
+
}, document.body.appendChild(o);
|
|
95
94
|
});
|
|
96
95
|
return { initPlugin: async (r) => {
|
|
97
|
-
await
|
|
96
|
+
await m(async () => {
|
|
98
97
|
const i = await u();
|
|
99
|
-
|
|
98
|
+
p(r, i);
|
|
100
99
|
});
|
|
101
100
|
} };
|
|
102
101
|
};
|
|
103
102
|
export {
|
|
104
|
-
|
|
103
|
+
R as useStripo
|
|
105
104
|
};
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var m = (
|
|
3
|
-
var r = (
|
|
4
|
-
import { dynamicContentToMergeTags as
|
|
5
|
-
import "../../
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
12
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
13
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
14
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
15
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
16
|
-
import { UEAttr as c } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js";
|
|
17
|
-
import { UIElementType as i } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
18
|
-
import { UIElement as l } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js";
|
|
19
|
-
import { UIElementTagRegistry as d } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js";
|
|
20
|
-
import { ExternalMergeTagsLibrary as p } from "./dynamic-content-modal.js";
|
|
21
|
-
const s = "external-dynamic-content-ui-element", T = "button-add-dynamic-content";
|
|
22
|
-
class O extends d {
|
|
23
|
-
registerUiElements(e) {
|
|
24
|
-
e[i.MERGETAGS] = s;
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var m = (i, t, e) => t in i ? o(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var r = (i, t, e) => m(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { dynamicContentToMergeTags as l } from "../../utils/genericUtil.js";
|
|
5
|
+
import { d as n } from "../../_virtual/index.js";
|
|
6
|
+
import { ExternalMergeTagsLibrary as g } from "./dynamic-content-modal.js";
|
|
7
|
+
const a = "external-dynamic-content-ui-element", c = "button-add-dynamic-content";
|
|
8
|
+
class p extends n.UIElementTagRegistry {
|
|
9
|
+
registerUiElements(t) {
|
|
10
|
+
t[n.UIElementType.MERGETAGS] = a;
|
|
25
11
|
}
|
|
26
12
|
}
|
|
27
|
-
class
|
|
13
|
+
class u extends n.UIElement {
|
|
28
14
|
constructor() {
|
|
29
15
|
super(...arguments);
|
|
30
16
|
r(this, "mergeTagsButton", null);
|
|
@@ -34,42 +20,42 @@ class k extends l {
|
|
|
34
20
|
r(this, "selectedDynamicContent", { value: "", text: "" });
|
|
35
21
|
}
|
|
36
22
|
getId() {
|
|
37
|
-
return
|
|
23
|
+
return a;
|
|
38
24
|
}
|
|
39
|
-
onRender(
|
|
40
|
-
var
|
|
41
|
-
this.listener = this._onClick.bind(this), this.mergeTagsButton =
|
|
25
|
+
onRender(e) {
|
|
26
|
+
var s;
|
|
27
|
+
this.listener = this._onClick.bind(this), this.mergeTagsButton = e.querySelector("#guido__btn-add-dynamic-content"), (s = this.mergeTagsButton) == null || s.addEventListener("click", this.listener);
|
|
42
28
|
}
|
|
43
29
|
onDestroy() {
|
|
44
|
-
var
|
|
45
|
-
(
|
|
30
|
+
var e;
|
|
31
|
+
(e = this.mergeTagsButton) == null || e.removeEventListener("click", this.listener);
|
|
46
32
|
}
|
|
47
33
|
_onClick() {
|
|
48
34
|
this.openMergeTagLibrary();
|
|
49
35
|
}
|
|
50
36
|
openMergeTagLibrary() {
|
|
51
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
37
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new g()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
52
38
|
this.selectedDynamicContent,
|
|
53
|
-
(
|
|
54
|
-
this.api.onValueChanged(
|
|
39
|
+
(e) => {
|
|
40
|
+
this.api.onValueChanged(l([e])[0]);
|
|
55
41
|
}
|
|
56
42
|
);
|
|
57
43
|
}
|
|
58
44
|
getTemplate() {
|
|
59
45
|
return `
|
|
60
46
|
<div>
|
|
61
|
-
<${
|
|
47
|
+
<${n.UIElementType.BUTTON}
|
|
62
48
|
id="guido__btn-add-dynamic-content"
|
|
63
49
|
class="btn btn-primary"
|
|
64
|
-
${
|
|
65
|
-
<${
|
|
66
|
-
</${
|
|
50
|
+
${n.UEAttr.BUTTON.name}="${c}">
|
|
51
|
+
<${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
|
|
52
|
+
</${n.UIElementType.ICON}>
|
|
67
53
|
${this.api.translate("Add Dynamic Content")}
|
|
68
|
-
</${
|
|
54
|
+
</${n.UIElementType.BUTTON}>
|
|
69
55
|
</div>`;
|
|
70
56
|
}
|
|
71
57
|
}
|
|
72
58
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
p as DynamicContentTagRegistry,
|
|
60
|
+
u as DynamicContentUiElementExtension
|
|
75
61
|
};
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
6
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
7
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
8
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
|
-
import "../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
|
-
import { ExtensionBuilder as t } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js";
|
|
14
|
-
import { DynamicContentUiElementExtension as i, DynamicContentTagRegistry as o } from "./dynamic-content.js";
|
|
15
|
-
import n from "./dynamic-content.css.js";
|
|
16
|
-
const w = new t().addUiElement(i).withStyles(n).withLocalization({
|
|
1
|
+
import { d as t } from "../../_virtual/index.js";
|
|
2
|
+
import { DynamicContentUiElementExtension as n, DynamicContentTagRegistry as i } from "./dynamic-content.js";
|
|
3
|
+
import e from "./dynamic-content.css.js";
|
|
4
|
+
const s = new t.ExtensionBuilder().addUiElement(n).withStyles(e).withLocalization({
|
|
17
5
|
en: {
|
|
18
6
|
"Add Dynamic Content": "Add Dynamic Content"
|
|
19
7
|
}
|
|
20
|
-
}).withUiElementTagRegistry(
|
|
8
|
+
}).withUiElementTagRegistry(i).build();
|
|
21
9
|
export {
|
|
22
|
-
|
|
10
|
+
s as default
|
|
23
11
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-
|
|
1
|
+
[data-v-a18ac2d3] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-cc1f9260],.guido-editor__container[data-v-cc1f9260]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-cc1f9260]{height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,75 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
getBlocks() {
|
|
49
|
-
return this.blocks;
|
|
50
|
-
}
|
|
51
|
-
getId() {
|
|
52
|
-
return this.id;
|
|
53
|
-
}
|
|
54
|
-
getExternalSmartElementsLibrary() {
|
|
55
|
-
return this.externalSmartElementsLibrary;
|
|
56
|
-
}
|
|
57
|
-
getExternalImageLibrary() {
|
|
58
|
-
return this.externalImageLibrary;
|
|
59
|
-
}
|
|
60
|
-
getExternalAiAssistant() {
|
|
61
|
-
return this.externalAiAssistant;
|
|
62
|
-
}
|
|
63
|
-
getExternalDisplayConditionsLibrary() {
|
|
64
|
-
return this.externalDisplayConditionsLibrary;
|
|
65
|
-
}
|
|
66
|
-
getExternalVideoLibrary() {
|
|
67
|
-
return this.externalVideoLibrary;
|
|
68
|
-
}
|
|
69
|
-
getBlocksPanel() {
|
|
70
|
-
return this.blocksPanel;
|
|
71
|
-
}
|
|
1
|
+
import { __exports as e } from "../../../../_virtual/Extension.js";
|
|
2
|
+
var o;
|
|
3
|
+
function m() {
|
|
4
|
+
if (o) return e;
|
|
5
|
+
o = 1, Object.defineProperty(e, "__esModule", { value: !0 }), e.Extension = void 0;
|
|
6
|
+
var a = (
|
|
7
|
+
/** @class */
|
|
8
|
+
(function() {
|
|
9
|
+
function t(u, l, i, y, n, p, r, s, h, g, c, f, x, E, d) {
|
|
10
|
+
i === void 0 && (i = []), n === void 0 && (n = []), r === void 0 && (r = []), s === void 0 && (s = []), this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.i18n = u, this.styles = l, this.previewStyles = c, this.uiElements = i, this.uiElementTagRegistry = y, this.controls = n, this.settingsPanelRegistry = p, this.contextActions = r, this.blocks = s, this.externalSmartElementsLibrary = h, this.externalImageLibrary = g, this.externalAiAssistant = f, this.externalDisplayConditionsLibrary = x, this.externalVideoLibrary = E, this.blocksPanel = d, this.id = Math.random().toString(36).substring(2);
|
|
11
|
+
}
|
|
12
|
+
return t.prototype.getI18n = function() {
|
|
13
|
+
return this.i18n;
|
|
14
|
+
}, t.prototype.getStyles = function() {
|
|
15
|
+
return this.styles;
|
|
16
|
+
}, t.prototype.getPreviewStyles = function() {
|
|
17
|
+
return this.previewStyles;
|
|
18
|
+
}, t.prototype.getUiElements = function() {
|
|
19
|
+
return this.uiElements;
|
|
20
|
+
}, t.prototype.getUiElementTagRegistry = function() {
|
|
21
|
+
return this.uiElementTagRegistry;
|
|
22
|
+
}, t.prototype.getControls = function() {
|
|
23
|
+
return this.controls;
|
|
24
|
+
}, t.prototype.getSettingsPanelRegistry = function() {
|
|
25
|
+
return this.settingsPanelRegistry;
|
|
26
|
+
}, t.prototype.getContextActions = function() {
|
|
27
|
+
return this.contextActions;
|
|
28
|
+
}, t.prototype.getBlocks = function() {
|
|
29
|
+
return this.blocks;
|
|
30
|
+
}, t.prototype.getId = function() {
|
|
31
|
+
return this.id;
|
|
32
|
+
}, t.prototype.getExternalSmartElementsLibrary = function() {
|
|
33
|
+
return this.externalSmartElementsLibrary;
|
|
34
|
+
}, t.prototype.getExternalImageLibrary = function() {
|
|
35
|
+
return this.externalImageLibrary;
|
|
36
|
+
}, t.prototype.getExternalAiAssistant = function() {
|
|
37
|
+
return this.externalAiAssistant;
|
|
38
|
+
}, t.prototype.getExternalDisplayConditionsLibrary = function() {
|
|
39
|
+
return this.externalDisplayConditionsLibrary;
|
|
40
|
+
}, t.prototype.getExternalVideoLibrary = function() {
|
|
41
|
+
return this.externalVideoLibrary;
|
|
42
|
+
}, t.prototype.getBlocksPanel = function() {
|
|
43
|
+
return this.blocksPanel;
|
|
44
|
+
}, t;
|
|
45
|
+
})()
|
|
46
|
+
);
|
|
47
|
+
return e.Extension = a, e;
|
|
72
48
|
}
|
|
73
49
|
export {
|
|
74
|
-
|
|
50
|
+
m as __require
|
|
75
51
|
};
|