@useinsider/guido 2.0.0-beta.a3f32aa → 2.0.0-beta.b46bbf6
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/dist/@types/config/schemas.js +33 -45
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +27 -29
- package/dist/composables/useSave.js +11 -13
- package/dist/composables/useStripo.js +54 -55
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/itemsBlockMigrator.js +283 -0
- package/dist/extensions/Blocks/Items/block.js +39 -40
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -49
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +28 -26
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +132 -127
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -48
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -58
- package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
- package/dist/extensions/Blocks/Items/template.js +296 -123
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +172 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +11 -20
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +64 -53
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +366 -287
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +4 -26
- package/dist/src/@types/config/types.d.ts +1 -7
- package/dist/src/composables/useConfig.d.ts +2 -6
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/template.d.ts +20 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +71 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +13 -8
- package/dist/src/stores/config.d.ts +18 -145
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/dist/stores/config.js +0 -7
- package/package.json +3 -3
- package/dist/package.json.js +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { object as o, number as
|
|
2
|
-
const
|
|
1
|
+
import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as b, variant as S } from "../../node_modules/valibot/dist/index.js";
|
|
2
|
+
const i = {
|
|
3
3
|
/** Promotional/marketing emails */
|
|
4
4
|
PROMOTIONAL: 1,
|
|
5
5
|
/** Transactional/system emails */
|
|
@@ -13,22 +13,22 @@ const m = {
|
|
|
13
13
|
UNSUBSCRIBE_PAGES: 97
|
|
14
14
|
}, h = o({
|
|
15
15
|
/** Unique identifier for the template being edited */
|
|
16
|
-
templateId:
|
|
16
|
+
templateId: m(
|
|
17
17
|
t(),
|
|
18
|
-
|
|
18
|
+
u(1, "templateId is required")
|
|
19
19
|
),
|
|
20
20
|
/** Unique identifier for the user editing the template */
|
|
21
|
-
userId:
|
|
21
|
+
userId: m(
|
|
22
22
|
t(),
|
|
23
|
-
|
|
23
|
+
u(1, "userId is required")
|
|
24
24
|
),
|
|
25
25
|
/** Optional variation ID for A/B testing */
|
|
26
26
|
variationId: e(t())
|
|
27
27
|
}), k = o({
|
|
28
28
|
/** Partner/organization name (required) */
|
|
29
|
-
name:
|
|
29
|
+
name: m(
|
|
30
30
|
t(),
|
|
31
|
-
|
|
31
|
+
u(1, "partner.name is required")
|
|
32
32
|
),
|
|
33
33
|
/** Product type identifier */
|
|
34
34
|
productType: e(
|
|
@@ -41,8 +41,8 @@ const m = {
|
|
|
41
41
|
),
|
|
42
42
|
/** Message type (promotional or transactional) */
|
|
43
43
|
messageType: e(
|
|
44
|
-
n([
|
|
45
|
-
|
|
44
|
+
n([i.PROMOTIONAL, i.TRANSACTIONAL]),
|
|
45
|
+
i.PROMOTIONAL
|
|
46
46
|
),
|
|
47
47
|
/** Display name for the current user */
|
|
48
48
|
username: e(t(), "Guido User")
|
|
@@ -60,7 +60,7 @@ const m = {
|
|
|
60
60
|
value: t()
|
|
61
61
|
})
|
|
62
62
|
)
|
|
63
|
-
}),
|
|
63
|
+
}), R = o({
|
|
64
64
|
/** Initial HTML content */
|
|
65
65
|
html: e(t(), ""),
|
|
66
66
|
/** Initial CSS content */
|
|
@@ -71,8 +71,8 @@ const m = {
|
|
|
71
71
|
[]
|
|
72
72
|
),
|
|
73
73
|
/** Selected unsubscribe page IDs */
|
|
74
|
-
selectedUnsubscribePages: e(a(
|
|
75
|
-
}),
|
|
74
|
+
selectedUnsubscribePages: e(a(p()), [])
|
|
75
|
+
}), C = o({
|
|
76
76
|
/** Sender display name */
|
|
77
77
|
senderName: e(t(), ""),
|
|
78
78
|
/** Email subject line */
|
|
@@ -83,9 +83,9 @@ const m = {
|
|
|
83
83
|
/** Path to translations object */
|
|
84
84
|
translationsPath: e(t(), "window.trans.en"),
|
|
85
85
|
/** Migration date for template compatibility */
|
|
86
|
-
migrationDate: e(
|
|
86
|
+
migrationDate: e(p(), 1759696858),
|
|
87
87
|
/** Email header settings */
|
|
88
|
-
emailHeader: e(
|
|
88
|
+
emailHeader: e(C, { senderName: "", subject: "" })
|
|
89
89
|
}), T = o({
|
|
90
90
|
/** Whether to show the header bar */
|
|
91
91
|
showHeader: e(c(), !0),
|
|
@@ -103,7 +103,9 @@ const m = {
|
|
|
103
103
|
/** Enable display conditions */
|
|
104
104
|
displayConditions: e(c(), !0),
|
|
105
105
|
/** Enable unsubscribe block */
|
|
106
|
-
unsubscribe: e(c(), !0)
|
|
106
|
+
unsubscribe: e(c(), !0),
|
|
107
|
+
/** Disable modules panel in the editor */
|
|
108
|
+
modulesDisabled: e(c(), !1)
|
|
107
109
|
}), f = n([
|
|
108
110
|
"amp-accordion",
|
|
109
111
|
"amp-carousel",
|
|
@@ -143,7 +145,7 @@ const m = {
|
|
|
143
145
|
/** Human-readable description */
|
|
144
146
|
description: e(t()),
|
|
145
147
|
/** Priority for rule ordering (lower = earlier) */
|
|
146
|
-
priority:
|
|
148
|
+
priority: p()
|
|
147
149
|
}), N = o({
|
|
148
150
|
...l.entries,
|
|
149
151
|
type: r("replace"),
|
|
@@ -171,32 +173,21 @@ const m = {
|
|
|
171
173
|
...l.entries,
|
|
172
174
|
type: r("custom"),
|
|
173
175
|
/** Custom processor function */
|
|
174
|
-
processor:
|
|
175
|
-
(
|
|
176
|
+
processor: b(
|
|
177
|
+
(d) => typeof d == "function",
|
|
176
178
|
"processor must be a function"
|
|
177
179
|
)
|
|
178
|
-
}),
|
|
180
|
+
}), B = S("type", [
|
|
179
181
|
N,
|
|
180
182
|
O,
|
|
181
183
|
L,
|
|
182
184
|
v
|
|
183
|
-
]),
|
|
185
|
+
]), P = o({
|
|
184
186
|
/** Custom compiler rules to apply */
|
|
185
|
-
customRules: e(a(
|
|
187
|
+
customRules: e(a(B), []),
|
|
186
188
|
/** Skip default compiler rules */
|
|
187
189
|
ignoreDefaultRules: e(c(), !1)
|
|
188
|
-
}),
|
|
189
|
-
/**
|
|
190
|
-
* External validation handler called before save completes.
|
|
191
|
-
* Return false to cancel the save operation.
|
|
192
|
-
*/
|
|
193
|
-
externalValidation: e(
|
|
194
|
-
d(
|
|
195
|
-
(i) => typeof i == "function",
|
|
196
|
-
"externalValidation must be a function"
|
|
197
|
-
)
|
|
198
|
-
)
|
|
199
|
-
}), U = o({
|
|
190
|
+
}), x = o({
|
|
200
191
|
// Required sections
|
|
201
192
|
/** Identity configuration (required) */
|
|
202
193
|
identity: h,
|
|
@@ -204,7 +195,7 @@ const m = {
|
|
|
204
195
|
partner: k,
|
|
205
196
|
// Optional sections (with defaults)
|
|
206
197
|
/** Template content and presets */
|
|
207
|
-
template: e(
|
|
198
|
+
template: e(R, {}),
|
|
208
199
|
/** Editor settings */
|
|
209
200
|
editor: e(I, {}),
|
|
210
201
|
/** UI configuration */
|
|
@@ -214,30 +205,27 @@ const m = {
|
|
|
214
205
|
/** Block configuration */
|
|
215
206
|
blocks: e(E, {}),
|
|
216
207
|
/** Compiler configuration */
|
|
217
|
-
compiler: e(
|
|
218
|
-
/** Callbacks and event handlers */
|
|
219
|
-
callbacks: e(P, {})
|
|
208
|
+
compiler: e(P, {})
|
|
220
209
|
});
|
|
221
210
|
export {
|
|
222
211
|
E as BlocksSchema,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
B as CompilerSchema,
|
|
212
|
+
B as CompilerRuleSchema,
|
|
213
|
+
P as CompilerSchema,
|
|
226
214
|
g as CustomBlockTypeSchema,
|
|
227
215
|
v as CustomRuleSchema,
|
|
228
216
|
f as DefaultBlockTypeSchema,
|
|
229
217
|
y as DynamicContentSchema,
|
|
230
218
|
I as EditorSchema,
|
|
231
|
-
|
|
219
|
+
C as EmailHeaderSchema,
|
|
232
220
|
A as FeaturesSchema,
|
|
233
|
-
|
|
221
|
+
x as GuidoConfigSchema,
|
|
234
222
|
h as IdentitySchema,
|
|
235
|
-
|
|
223
|
+
i as MessageType,
|
|
236
224
|
k as PartnerSchema,
|
|
237
225
|
s as ProductType,
|
|
238
226
|
O as RegexRuleSchema,
|
|
239
227
|
L as RemoveRuleSchema,
|
|
240
228
|
N as ReplaceRuleSchema,
|
|
241
|
-
|
|
229
|
+
R as TemplateSchema,
|
|
242
230
|
T as UISchema
|
|
243
231
|
};
|
|
@@ -7,14 +7,14 @@ var s = function() {
|
|
|
7
7
|
return [t(e.EmailHeaderInfo)];
|
|
8
8
|
}, proxy: !0 }, { key: "headerRightSlot", fn: function() {
|
|
9
9
|
return [t(e.EmailSizeIndicator)];
|
|
10
|
-
}, proxy: !0 }]) }, [e.isContainerReady ? t("iframe", { staticClass: "email-iframe w-1 bor-w-0", style: { height: e.iframeHeight }, attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: e.previewStore.previewHtml } }) : r._e()])], 1);
|
|
10
|
+
}, proxy: !0 }]) }, [e.isContainerReady ? t("iframe", { staticClass: "email-iframe w-1 bor-w-0", style: { height: e.iframeHeight }, attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: e.previewStore.previewHtml } }) : r._e()])], 1);
|
|
11
11
|
}, i = [], n = /* @__PURE__ */ a(
|
|
12
12
|
o,
|
|
13
13
|
s,
|
|
14
14
|
i,
|
|
15
15
|
!1,
|
|
16
16
|
null,
|
|
17
|
-
"
|
|
17
|
+
"b37f3f6d"
|
|
18
18
|
);
|
|
19
19
|
const d = n.exports;
|
|
20
20
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import n from "./ContentView.vue2.js";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
3
|
+
var o = function() {
|
|
4
4
|
var a = this, s = a._self._c, t = a._self._setupProxy;
|
|
5
5
|
return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
|
|
6
6
|
return a.$emit("back-to-inbox");
|
|
7
|
-
} } }, [s(t.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [a._v(a._s(t.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(t.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(t.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("iframe", { ref: "iframeRef", staticClass: "f-g-1 w-1 d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: t.previewStore.previewHtml }, on: { load: t.onLoad } })]);
|
|
8
|
-
},
|
|
7
|
+
} } }, [s(t.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [a._v(a._s(t.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(t.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(t.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("iframe", { ref: "iframeRef", staticClass: "f-g-1 w-1 d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: t.previewStore.previewHtml }, on: { load: t.onLoad } })]);
|
|
8
|
+
}, c = [], i = /* @__PURE__ */ e(
|
|
9
9
|
n,
|
|
10
|
+
o,
|
|
10
11
|
c,
|
|
11
|
-
i,
|
|
12
12
|
!1,
|
|
13
13
|
null,
|
|
14
14
|
null
|
|
15
15
|
);
|
|
16
|
-
const d =
|
|
16
|
+
const d = i.exports;
|
|
17
17
|
export {
|
|
18
18
|
d as default
|
|
19
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as
|
|
1
|
+
import { defineComponent as H, ref as m, computed as _ } from "vue";
|
|
2
2
|
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useExport as V } from "../../../composables/useExport.js";
|
|
4
4
|
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
|
|
|
10
10
|
import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
11
11
|
const J = /* @__PURE__ */ H({
|
|
12
12
|
__name: "RightSlot",
|
|
13
|
-
setup(k, { expose:
|
|
14
|
-
const { config:
|
|
13
|
+
setup(k, { expose: c }) {
|
|
14
|
+
const { config: u } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = m(!1), s = m(!1), f = x(), v = () => {
|
|
15
15
|
if (o.isVersionHistoryOpen) {
|
|
16
16
|
a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
i();
|
|
20
|
-
},
|
|
20
|
+
}, d = async () => {
|
|
21
21
|
e.value = !0, await r(), e.value = !1;
|
|
22
|
-
},
|
|
22
|
+
}, y = () => {
|
|
23
23
|
o.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
-
},
|
|
24
|
+
}, S = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
|
|
25
25
|
s.value = !0, o.loadingStatus = !0;
|
|
26
|
-
const
|
|
27
|
-
return s.value = !1,
|
|
26
|
+
const g = await n(p);
|
|
27
|
+
return s.value = !1, p && (o.loadingStatus = !1), g;
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return c({
|
|
30
30
|
handleSave: l
|
|
31
|
-
}), { __sfc: !0, config:
|
|
31
|
+
}), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: f, handleVersionHistory: v, handleExport: d, handleSaveAs: y, versionHistoryTooltipText: S, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { useConfigStore as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
const
|
|
4
|
-
const e =
|
|
1
|
+
import { useConfigStore as F } from "../stores/config.js";
|
|
2
|
+
import { storeToRefs as I } from "pinia";
|
|
3
|
+
const k = () => {
|
|
4
|
+
const e = F(), {
|
|
5
5
|
config: t,
|
|
6
6
|
initialized: o,
|
|
7
7
|
identity: r,
|
|
8
8
|
partner: i,
|
|
9
|
-
template:
|
|
10
|
-
editor:
|
|
9
|
+
template: n,
|
|
10
|
+
editor: a,
|
|
11
11
|
ui: s,
|
|
12
|
-
features:
|
|
13
|
-
blocks:
|
|
14
|
-
compiler:
|
|
15
|
-
|
|
16
|
-
templateId: p,
|
|
12
|
+
features: u,
|
|
13
|
+
blocks: d,
|
|
14
|
+
compiler: p,
|
|
15
|
+
templateId: c,
|
|
17
16
|
userId: f,
|
|
18
17
|
variationId: m,
|
|
19
18
|
partnerName: g,
|
|
20
|
-
productType:
|
|
21
|
-
messageType:
|
|
22
|
-
username:
|
|
23
|
-
showHeader:
|
|
24
|
-
} =
|
|
19
|
+
productType: l,
|
|
20
|
+
messageType: b,
|
|
21
|
+
username: C,
|
|
22
|
+
showHeader: y
|
|
23
|
+
} = I(e);
|
|
25
24
|
return {
|
|
26
25
|
// State refs
|
|
27
26
|
config: t,
|
|
@@ -29,27 +28,26 @@ const w = () => {
|
|
|
29
28
|
// Section refs
|
|
30
29
|
identity: r,
|
|
31
30
|
partner: i,
|
|
32
|
-
template:
|
|
33
|
-
editor:
|
|
31
|
+
template: n,
|
|
32
|
+
editor: a,
|
|
34
33
|
ui: s,
|
|
35
|
-
features:
|
|
36
|
-
blocks:
|
|
37
|
-
compiler:
|
|
38
|
-
callbacks: l,
|
|
34
|
+
features: u,
|
|
35
|
+
blocks: d,
|
|
36
|
+
compiler: p,
|
|
39
37
|
// Convenience refs
|
|
40
|
-
templateId:
|
|
38
|
+
templateId: c,
|
|
41
39
|
userId: f,
|
|
42
40
|
variationId: m,
|
|
43
41
|
partnerName: g,
|
|
44
|
-
productType:
|
|
45
|
-
messageType:
|
|
46
|
-
username:
|
|
47
|
-
showHeader:
|
|
42
|
+
productType: l,
|
|
43
|
+
messageType: b,
|
|
44
|
+
username: C,
|
|
45
|
+
showHeader: y,
|
|
48
46
|
// Methods
|
|
49
47
|
getConfig: () => t.value,
|
|
50
|
-
isFeatureEnabled: (
|
|
48
|
+
isFeatureEnabled: (E) => e.isFeatureEnabled(E)
|
|
51
49
|
};
|
|
52
50
|
};
|
|
53
51
|
export {
|
|
54
|
-
|
|
52
|
+
k as useConfig
|
|
55
53
|
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
|
|
12
|
-
return r || s(t), t;
|
|
1
|
+
import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
|
|
2
|
+
import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
|
|
3
|
+
import { useHtmlValidator as l } from "./useHtmlValidator.js";
|
|
4
|
+
const f = () => {
|
|
5
|
+
const e = i(), a = m(), { validateHtml: s } = l();
|
|
6
|
+
return { save: async (o = !1) => {
|
|
7
|
+
e();
|
|
8
|
+
const { prepareTemplateDetails: r } = n(), t = await r();
|
|
9
|
+
if (await s(t.compiledHtml, t.dynamicContentList, !0))
|
|
10
|
+
return o || a(t), t;
|
|
13
11
|
} };
|
|
14
12
|
};
|
|
15
13
|
export {
|
|
16
|
-
|
|
14
|
+
f as useSave
|
|
17
15
|
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as _ } from "./useActionsApi.js";
|
|
2
2
|
import { useBlocksConfig as k } from "./useBlocksConfig.js";
|
|
3
|
-
import { useConfig as
|
|
3
|
+
import { useConfig as B } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
|
|
5
|
-
import { useStripoEventHandler as
|
|
6
|
-
import { useToaster as
|
|
7
|
-
import { displayConditions as
|
|
8
|
-
import { useStripoApi as
|
|
9
|
-
import
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { dynamicContentToMergeTags as
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const e = I(), { html: n, css: u, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await C(), p = ((m = g.value) == null ? void 0 : m.displayConditions) ?? !0;
|
|
5
|
+
import { useStripoEventHandler as A } from "./useStripoEventHandler.js";
|
|
6
|
+
import { useToaster as v } from "./useToaster.js";
|
|
7
|
+
import { displayConditions as F } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as D } from "../services/stripoApi.js";
|
|
9
|
+
import I from "../static/styles/customEditorStyle.css.js";
|
|
10
|
+
import { useEditorStore as M } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
|
|
12
|
+
const $ = (a) => {
|
|
13
|
+
const { features: d } = B(), { handleError: c } = v(), { getToken: g, getCustomFonts: f } = D(), { handleEvent: y } = A(), { getStripoBlocksConfig: C } = k(), S = async (i, n = []) => {
|
|
14
|
+
var p, m;
|
|
15
|
+
const o = M(), { html: s, css: t, forceRecreate: h } = i, { baseBlocks: l, extensions: w } = await C(), u = ((p = d.value) == null ? void 0 : p.displayConditions) ?? !0, b = ((m = d.value) == null ? void 0 : m.modulesDisabled) ?? !1;
|
|
17
16
|
window.UIEditor.initEditor(
|
|
18
17
|
document.querySelector("#guido-editor"),
|
|
19
18
|
{
|
|
20
|
-
metadata:
|
|
21
|
-
html:
|
|
22
|
-
css:
|
|
23
|
-
forceRecreate:
|
|
19
|
+
metadata: a,
|
|
20
|
+
html: s,
|
|
21
|
+
css: t,
|
|
22
|
+
forceRecreate: h,
|
|
24
23
|
locale: "en",
|
|
25
24
|
undoButtonSelector: "#guido__undo-button",
|
|
26
25
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,87 +29,87 @@ const N = (c) => {
|
|
|
30
29
|
customAppearanceMergetags: !0,
|
|
31
30
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
31
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
34
|
-
conditionsEnabled:
|
|
35
|
-
customConditionsEnabled:
|
|
36
|
-
conditionCategories:
|
|
32
|
+
customViewStyles: I,
|
|
33
|
+
conditionsEnabled: u,
|
|
34
|
+
customConditionsEnabled: u,
|
|
35
|
+
conditionCategories: F,
|
|
37
36
|
enableXSSSecurity: !0,
|
|
37
|
+
modulesDisabled: b,
|
|
38
38
|
messageSettingsEnabled: !0,
|
|
39
39
|
displayGmailAnnotations: !0,
|
|
40
40
|
displayHiddenPreheader: !1,
|
|
41
41
|
displayTitle: !1,
|
|
42
42
|
displayUTM: !1,
|
|
43
43
|
selectElementAfterDrop: !0,
|
|
44
|
-
...
|
|
44
|
+
...l ? { baseBlocks: l } : {},
|
|
45
45
|
editorFonts: {
|
|
46
46
|
showDefaultStandardFonts: !0,
|
|
47
47
|
showDefaultNotStandardFonts: !0,
|
|
48
|
-
customFonts:
|
|
48
|
+
customFonts: n
|
|
49
49
|
},
|
|
50
50
|
mergeTags: [
|
|
51
51
|
{
|
|
52
|
-
entries:
|
|
52
|
+
entries: U(a.preselectedDynamicContentList)
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
|
-
async onTokenRefreshRequest(
|
|
55
|
+
async onTokenRefreshRequest(e) {
|
|
56
56
|
try {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
} catch (
|
|
60
|
-
|
|
57
|
+
const r = await g();
|
|
58
|
+
e(r);
|
|
59
|
+
} catch (r) {
|
|
60
|
+
c(r, "Failed to refresh token");
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
onTemplateLoaded() {
|
|
64
64
|
try {
|
|
65
|
-
const { importCss:
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
const { importCss: e } = V(), { activateCustomViewStyles: r, updateTimerInClonedTemplate: T } = _();
|
|
66
|
+
e(), r(), T(), a.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
67
|
+
o.hasChanges = !1;
|
|
68
68
|
}, 1e3);
|
|
69
|
-
} catch (
|
|
70
|
-
|
|
69
|
+
} catch (e) {
|
|
70
|
+
c(e, "Failed to load custom interface appearance");
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
onCodeEditorVisibilityChanged(
|
|
74
|
-
|
|
73
|
+
onCodeEditorVisibilityChanged(e) {
|
|
74
|
+
o.isCodeEditorOpen = e;
|
|
75
75
|
},
|
|
76
|
-
onEditorVisualModeChanged(
|
|
77
|
-
|
|
76
|
+
onEditorVisualModeChanged(e) {
|
|
77
|
+
o.editorVisualMode = e.toLowerCase();
|
|
78
78
|
},
|
|
79
|
-
onVersionHistoryVisibilityChanged(
|
|
80
|
-
|
|
79
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
80
|
+
o.isVersionHistoryOpen = e;
|
|
81
81
|
},
|
|
82
82
|
onDataChanged() {
|
|
83
|
-
|
|
83
|
+
o.hasChanges = !0;
|
|
84
84
|
},
|
|
85
|
-
onEvent:
|
|
85
|
+
onEvent: y,
|
|
86
86
|
ignoreClickOutsideSelectors: [
|
|
87
87
|
"#guido-dynamic-content-modal",
|
|
88
88
|
".in-on-board-wrapper",
|
|
89
89
|
".in-drawer__container"
|
|
90
90
|
],
|
|
91
|
-
extensions:
|
|
91
|
+
extensions: w
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
|
-
},
|
|
95
|
-
var d;
|
|
94
|
+
}, E = (i) => new Promise((n, o) => {
|
|
96
95
|
if (document.getElementById("UiEditorScript")) {
|
|
97
|
-
i(),
|
|
96
|
+
i(), n();
|
|
98
97
|
return;
|
|
99
98
|
}
|
|
100
|
-
const
|
|
101
|
-
t.id = "UiEditorScript", t.type = "module", t.src =
|
|
102
|
-
i(),
|
|
99
|
+
const s = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t = document.createElement("script");
|
|
100
|
+
t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
|
|
101
|
+
i(), n();
|
|
103
102
|
}, t.onerror = () => {
|
|
104
|
-
|
|
103
|
+
o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
105
104
|
}, document.body.appendChild(t);
|
|
106
105
|
});
|
|
107
106
|
return { initPlugin: async (i) => {
|
|
108
|
-
await
|
|
109
|
-
const
|
|
110
|
-
await
|
|
107
|
+
await E(async () => {
|
|
108
|
+
const n = await f();
|
|
109
|
+
await S(i, n);
|
|
111
110
|
});
|
|
112
111
|
} };
|
|
113
112
|
};
|
|
114
113
|
export {
|
|
115
|
-
|
|
114
|
+
$ as useStripo
|
|
116
115
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
1
|
+
import { migrateCheckbox as t } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as o } from "./couponBlockMigrator.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { migrateItemsBlock as i } from "./itemsBlockMigrator.js";
|
|
4
|
+
import { migrateRadioButton as e } from "./radioButtonMigrator.js";
|
|
5
|
+
import { migrateRecommendation as a } from "./recommendationMigrator.js";
|
|
6
|
+
import { migrateUnsubscribe as g } from "./unsubscribeMigrator.js";
|
|
7
|
+
const u = async (r) => {
|
|
8
|
+
let m = r;
|
|
9
|
+
return m = t(m), m = e(m), m = await g(m), m = o(m), m = a(m), m = i(m), m;
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
u as migrate
|
|
12
13
|
};
|